Vanilla Angband editing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redrobert
    Scout
    • Sep 2011
    • 29

    Vanilla Angband editing

    Hello, now that i can actually compile Angband Vanilla i have a few questions:

    is there an object flag that increases your spell points ... same with hit points. either an absolute number or lik 1 HP per level would be fine

    if not, is there an easy way to make such a flag?

    another thing ... i liked in z+ that i can throw poison potion for some nice low-level damage. is that possible in Vanilla also? It's similar to the oil flasks

    damage multipliers of crossbows ... is it enough if i add a line in tvalsval.c

    i think i will remember more questions in a while

    thanks for your help
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    There's no flag to directly affect HP/SP in Vanilla. I've added flags in the past; IIRC I just followed an existing flag around through the code to make certain my new one was in all the right places, then also found the bit of code I wanted the flag to modify (In your case, wherever maximum HP/SP is calculated).

    Item damage is in object.txt. Take a look at the oil flask to see how it works.

    No idea on the launcher multipliers, sorry.

    Comment

    • PowerDiver
      Prophet
      • Mar 2008
      • 2820

      #3
      Originally posted by redrobert
      Hello, now that i can actually compile Angband Vanilla i have a few questions:

      is there an object flag that increases your spell points ... same with hit points. either an absolute number or lik 1 HP per level would be fine
      It's not what you are asking for, but the traditional answer is to put on an int and wis or con bonus on the item. That has the desired effect, but only in a particular range [like above 18/50 but below max].

      If you want that sort of change to affect early players more, you could join the crowd asking for a linear stat system. The louder more people shout the sooner it may happen.

      If you want a boost over what you get from maximum spellstat or con, you need a new flag. [You don't need to tax your imagination to forsee that I will complain that you are further tilting already broken game balance.] The most important place to modify the code after you manage to add a new flag is in the block of code where attributes are computed, which used to be in src/xtra1.c and I don't know where it is now. Grepping/searching for mhp should show you where to look, probably in the player subdirectory.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        As the others have said, there's no flag that directly increases hp or sp - but yes there is an easy way to make one. Add it to src/object/list-object-flags.h and then add the code to parse it in the functions calc_hitpoints() or calc_mana() in src/player/calcs.c.

        Thrown potions don't do much damage in V, but you can edit the damage they do in lib/edit/object.txt (poison does 3d4).

        Launcher mults are sval-dependent, so you'll need to add an sval to tvalsval.h for each new launcher you want to create (or change the svals of existing launchers if you want to change the mult). The mult is the last digit of the sval (but don't use svals over 99 or things will break - I am not sure if we reliably use % 10).
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • redrobert
          Scout
          • Sep 2011
          • 29

          #5
          maybe i should give the poison potion a brand_pois flag.

          thanks for the help, i will try a few things out :-)

          Comment

          • redrobert
            Scout
            • Sep 2011
            • 29

            #6
            if (p_ptr->state.flags[OF_SP]) b->sp_bonus = _ptr->pval[which_pval(o_ptr, OF_SP)];
            msp += p_ptr->sp_bonus * levels;

            do i have a mistake in this bit of code?

            Comment

            • Magnate
              Angband Devteam member
              • May 2007
              • 5110

              #7
              Originally posted by redrobert
              do i have a mistake in this bit of code?
              Yes - you're missing the o of o_ptr ... you're also assigning the bonus to b->sp_bonus, but then adding something called p_ptr->sp_bonus, which is not the same thing.
              "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

              Comment

              • redrobert
                Scout
                • Sep 2011
                • 29

                #8
                msp += b->sp_bonus * levels;
                it this better?

                Comment

                • Magnate
                  Angband Devteam member
                  • May 2007
                  • 5110

                  #9
                  Originally posted by redrobert
                  it this better?
                  Yes, that should be fine.
                  "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                  Comment

                  • redrobert
                    Scout
                    • Sep 2011
                    • 29

                    #10
                    so one task after the other should be allright

                    Comment

                    • redrobert
                      Scout
                      • Sep 2011
                      • 29

                      #11
                      well magnate i found the code for vampiric weapons in z+angband ... but it sounds very compilcated for a non-expert

                      Comment

                      • redrobert
                        Scout
                        • Sep 2011
                        • 29

                        #12
                        i am back with a question:

                        N:150:'of the Ages'
                        X:30:2
                        W:0:12:0:20000
                        A:13:20 to 100
                        C:1+d6M4:1+d6M4:0
                        T:22:0:99
                        F:BLESSED
                        L:1+d5:1:FIZZ_WARM
                        L:1+d5:2:FIZZ_COOL
                        L:1+d5:3:FIZZ_FIZZ
                        L:1+d5:4:FIZZ_BUZZ
                        L:1+d5:5:FIZZ_ICKY
                        L:1+d5:6:BLOWS
                        is this right if i want the item to have an additional brand for every higher PVAL?

                        PVAL1 = warm brand
                        PVAL2 = warm and cool brand
                        ...

                        or do i have to put it like:
                        L:1+d5:2:FIZZ_COOL | FIZZ_WARM

                        or am i mistaken completly

                        Comment

                        • Magnate
                          Angband Devteam member
                          • May 2007
                          • 5110

                          #13
                          Originally posted by redrobert
                          i am back with a question:



                          is this right if i want the item to have an additional brand for every higher PVAL?

                          PVAL1 = warm brand
                          PVAL2 = warm and cool brand
                          ...

                          or do i have to put it like:
                          L:1+d5:2:FIZZ_COOL | FIZZ_WARM

                          or am i mistaken completly
                          I'm afraid you're mistaken completely.

                          There are two basic categories of object flags - I call them "binary" and "granular".

                          Granular flags use the pval, so the higher the pval is, the more bonus you get. Examples include OF_SPEED, OF_STR, OF_TUNNEL, OF_STEALTH etc. (In code terms, these are OFT_PVAL and OFT_STAT.)

                          Binary flags are different: you either have it or you don't. Examples include OF_IMM_FIRE, OF_SLAY_DEMON, and OF_BRAND_ANYTHING. (All the other OFTs are binary types.)

                          The two categories cannot be mixed, so if you put binary flags on L: lines, things will break.

                          To do what you want, I'd use the "xtra" field - the last field on the X: line. This currently takes 0, 1, 2 or 3, so I'd add "#define OBJECT_XTRA_TYPE_BRAND 4" in src/object/obj-flag.h

                          All you need to do then is add some code to ego_apply_magic() in obj-make.c to pick up that field, test the pval and then apply the relevant brand(s). Simple!
                          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                          Comment

                          • redrobert
                            Scout
                            • Sep 2011
                            • 29

                            #14
                            if (p_ptr->state.flags[OF_THROW]) {
                            b->m = 2;
                            }
                            else {
                            b->m = 1;
                            }
                            multiplier = b->m
                            would this work if i have a object flag called THROW? do i have to declare somewhere a variable?

                            Comment

                            • Magnate
                              Angband Devteam member
                              • May 2007
                              • 5110

                              #15
                              Originally posted by redrobert
                              would this work if i have a object flag called THROW? do i have to declare somewhere a variable?
                              Should do. As long as you have declared the b struct, and multiplier, it should work fine.
                              "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                              Comment

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