Magic and edit files after the restructure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Therem Harth
    Knight
    • Jan 2008
    • 926

    Magic and edit files after the restructure

    Because I have to ask: post-restructure, will the spell info in p_class.txt still look like this?

    Code:
    B:0:1:1:30:4
    B:1:2:2:35:4
    B:2:3:3:35:4
    B:3:5:3:15:4
    B:4:5:4:35:4
    B:5:7:5:40:3
    B:6:7:5:40:3
    B:7:9:7:40:3
    B:8:9:7:40:3
    B:9:9:8:40:3
    B:10:11:9:40:3
    B:11:11:10:45:3
    B:12:11:10:45:3
    B:13:13:10:45:3
    B:14:13:11:45:4
    B:15:15:13:45:4
    B:16:15:15:50:4
    B:17:17:15:50:4
    B:18:17:15:50:4
    B:19:19:15:50:4
    B:20:19:15:50:4
    B:21:21:17:50:3
    B:22:23:17:50:3
    B:23:25:20:50:3
    B:24:27:21:50:3
    B:25:29:22:50:3
    B:26:31:24:60:3
    B:27:33:28:60:3
    B:28:35:32:70:4
    B:29:99:0:0:0
    B:30:99:0:0:0
    B:31:5:5:50:1
    B:32:15:15:80:12
    B:33:25:25:80:16
    B:34:30:15:80:135
    B:35:99:0:0:0
    B:36:17:15:50:25
    B:37:23:25:60:35
    B:38:99:0:0:0
    B:39:45:80:90:250
    B:40:99:0:0:0
    B:41:20:13:70:20
    B:42:99:0:0:0
    B:43:30:35:80:200
    B:44:40:40:80:100
    B:45:99:0:0:0
    B:46:10:16:50:20
    B:47:25:30:80:15
    B:48:99:0:0:0
    B:49:40:70:80:200
    B:50:42:80:85:250
    B:51:47:95:85:250
    B:52:7:7:50:2
    B:53:20:20:50:4
    B:54:25:25:80:12
    B:55:35:50:75:115
    B:56:40:60:75:10
    B:57:99:0:0:0
    B:58:99:0:0:0
    B:59:99:0:0:0
    B:60:99:0:0:0
    B:61:99:0:0:0
    B:62:99:0:0:0
    B:63:99:0:0:0
    Because that was probably half the reason I removed the Mage/Priest system in Neoband, instead of adding to it. And now that I want to build on the book system instead, the above is making my eyes bleed.

    I know moving stuff to edit files is supposed to be good, but personally I would rather see things like class-based spell prohibitions hardcoded, even if it means cheesy hacks. Anyone with a rudimentary knowledge of programming can deal with hackish hardcoded stuff, as long as the coding style is reasonable. The edit file format OTOH still gives me problems after ~10 years of mucking around with Angband.
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9634

    #2
    Here's a sample book:

    Code:
    book:prayer book:[Words of Wisdom]:7:2
    
    spell:Scare Monster:5:4:29:3
    effect:BOLT_AWARE:TURN_ALL
    dice:$B
    expr:B:PLAYER_LEVEL:+ 0
    desc:Attempts to scare a single monster for a level-dependant duration.
    desc:  Uniques and monsters that resist fear are not affected.
    
    spell:Portal:5:4:30:4
    effect:TELEPORT
    dice:$B
    expr:B:PLAYER_LEVEL:* 3
    desc:Teleports you randomly over a short distance.
    
    spell:Cure Serious Wounds:5:4:32:4
    effect:HEAL_HP
    dice:25+m20
    effect:CURE:BLIND
    effect:CURE:CUT
    effect:CURE:CONFUSED
    desc:Cures 20% of your wounds (min 25hp) and heals all cut damage.
    
    spell:Chant:5:5:34:4
    effect:TIMED_INC:BLESSED
    dice:24+d24
    desc:Blesses you, giving a bonus of +5 to AC and +10 to-hit, for 24+1d24
    desc: turns.
    
    spell:Sanctuary:7:5:36:3
    effect:TOUCH_AWARE:OLD_SLEEP
    dice:$B
    expr:B:PLAYER_LEVEL:+ 0
    desc:Attempts to put to sleep each monster directly adjacent to you.
    desc:  Uniques and monsters that resist sleep are not affected.
    
    spell:Satisfy Hunger:7:5:38:4
    effect:SET_NOURISH
    dice:16999
    desc:Magically renders you well-fed (but not satiated).
    desc:  This will also cure a bloated stomach.
    ## get rid of remove_curse in 3.4 until curses are redone
    #spell:Remove Curse:7:6:38:5
    #effect:REMOVE_CURSE
    #D:Removes all ordinary curses from all equipped items.
    #D:  Heavy or permanent curses are not affected.
    
    spell:Resist Heat and Cold:7:7:38:5
    effect:TIMED_INC:OPP_COLD
    dice:10+d10
    effect:TIMED_INC:OPP_FIRE
    dice:10+d10
    desc:Gives you temporary resistance to cold and fire, for 10+1d10 turns each.
    and restruct has been merged into master branch now, so you can see them all here.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • Therem Harth
      Knight
      • Jan 2008
      • 926

      #3
      Wow, thanks! That's a lot better. I suppose it makes sense for Vanilla...

      OTOH it still looks very verbose to me, for when new classes are wanted. So minimize tedium, I will probably continue avoiding the book-based magic system.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9634

        #4
        Originally posted by Therem Harth
        OTOH it still looks very verbose to me, for when new classes are wanted.
        Well, it has also replaced spell.txt, and all the stuff that was in x-spell.c. There is now no dedicated spell code at all, just references to effects (as seen in effects.c). This has been a big change that has unified all magical effects, and pushed a huge amount of the game control out to the edit files. In fact, creating a new class is pretty much *only* a matter of editing that file.

        It is a lot to take in
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • PowerWyrm
          Prophet
          • Apr 2008
          • 2986

          #5
          This will be fun when I'll have to port the 11 magic realms of PWMAngband
          PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

          Comment

          • Therem Harth
            Knight
            • Jan 2008
            • 926

            #6
            Originally posted by Nick
            Well, it has also replaced spell.txt, and all the stuff that was in x-spell.c. There is now no dedicated spell code at all, just references to effects (as seen in effects.c). This has been a big change that has unified all magical effects, and pushed a huge amount of the game control out to the edit files. In fact, creating a new class is pretty much *only* a matter of editing that file.

            It is a lot to take in
            That sounds really great in general, just not for my purposes; I would rather tack on content as code. Partly because that's how I've been learning to program...

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎