Vulnerabilities to elements

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Selkie
    Swordsman
    • Aug 2020
    • 434

    Vulnerabilities to elements

    How much additional damage is dealt to a monster if you attack it with an element to which it is vulnerable?

    For example, it seems more effective to blast an eight head hydra with frost bolts (15d8) than mana bolts (currently 22d8). Is there a hidden damage multiplier applied to the elemental attack that I can't see?

    Also (slightly related) when you shape change in Angband and you're wielding an elemental brand, is the creature you transform into still wielding the weapon? The flavour text hides if an elemental brand is still being applied. Real world experimentation seems to suggest it is.
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #2
    Yes, you can see it. Hydras are uniformly vulnerable to cold, and it says so in their lore. They take 4/3 nominal damage, so that's effectively 20d8, or just a little less than mana bolt at much less cost.

    Comment

    • Sky
      Veteran
      • Oct 2016
      • 2321

      #3
      in case that you have a weapon branded with cold, you would do additional damage to monsters which do not resist cold, AND extra damage on top to monsters which are vulnerable to cold, such as hydras.
      "i can take this dracolich"

      Comment

      • Pete Mack
        Prophet
        • Apr 2007
        • 6883

        #4
        It gives you a brand multiplier of 4 instead of 3

        Comment

        • backwardsEric
          Knight
          • Aug 2019
          • 527

          #5
          The handling of branded weapons or ammunition against especially vulnerable monsters changed in 4.2.1. Before that (seems to be all the 4.* releases, perhaps earlier), the extra vulnerability only factored into the damage from spells, devices, or activations and didn't affect melee, thrown, or missile attacks.
          When the O-combat birth option isn't in effect, the extra multiplicative factor applied to the result from the base dice is two (that was chosen to match the multiplicative factor against especially vulnerable monsters used for spells, devices, and activations; from the code, I'm not seeing the factor of 4/3 mentioned earlier).

          For the question about shape changes, the current equipment at the time of the shape change remains in place and continues to affect the attributes of the shape-changed character, including extra damage from brands or slays. The knowledge menu entries for the shapes (new in 4.2.2) mention that.

          Comment

          • Selkie
            Swordsman
            • Aug 2020
            • 434

            #6
            Originally posted by Pete Mack
            It gives you a brand multiplier of 4 instead of 3
            Thanks Pete, this is the answer I was looking for.

            Comment

            • Pete Mack
              Prophet
              • Apr 2007
              • 6883

              #7
              BacjwardsEric:
              Oh, I was using old data then. Where is this determined in the code? Also, where is the element data (resistance multipliers, max value, etc) maintained now?

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9634

                #8
                Originally posted by Pete Mack
                BacjwardsEric:
                Oh, I was using old data then. Where is this determined in the code? Also, where is the element data (resistance multipliers, max value, etc) maintained now?
                The relevant bit of code for melee is get_monster_brand_multiplier() in obj-slays.c (and also monster_elemental_damage() in mon-blows.c, technically), and for breath etc in project_monster_hurt_immune() and the individual project_monster_handler_*()s in project-mon.c. The actual values for elemental damage are in brand.txt, or projection.txt.
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • Pete Mack
                  Prophet
                  • Apr 2007
                  • 6883

                  #9
                  Nick--
                  Having separate files for brands and slays is a questionable normalization. They can be unified by adding a single field, say damage-type "slay" or "brand". All the other fields are identical. Also, what is *this*

                  code:MANA
                  name:mana
                  type:element
                  desc:mana
                  player-desc:the elements
                  blind-desc:something
                  lash-desc:raw magic
                  divisor:3
                  damage-cap:1600
                  msgt:BR_ELEMENTS
                  obvious:1
                  wake:1
                  color:Light dark

                  1600 unresistable damage is an instakill for any character!
                  Last edited by Pete Mack; March 15, 2021, 20:57.

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9634

                    #10
                    Originally posted by Pete Mack
                    Nick--
                    Having separate files for brands and slays is a questionable normalization. They can be unified by adding a single field, say damage-type "slay" or "brand". All the other fields are identical.
                    There is sufficient difference in the structs (reflecting actual difference in use within the code) that it's worth it, IMHO
                    Code:
                    /**
                     * Brand type
                     */
                    struct brand {
                    	char *code;
                    	char *name;
                    	char *verb;
                    	int resist_flag;
                    	int vuln_flag;
                    	int multiplier;
                    	int o_multiplier;
                    	int power;
                    	struct brand *next;
                    };
                    
                    /**
                     * Slay type
                     */
                    struct slay {
                    	char *code;
                    	char *name;
                    	char *base;
                    	char *melee_verb;
                    	char *range_verb;
                    	int race_flag;
                    	int multiplier;
                    	int o_multiplier;
                    	int power;
                    	struct slay *next;
                    };
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • backwardsEric
                      Knight
                      • Aug 2019
                      • 527

                      #11
                      Originally posted by Pete Mack
                      BacjwardsEric:
                      Oh, I was using old data then. Where is this determined in the code? Also, where is the element data (resistance multipliers, max value, etc) maintained now?
                      From what I know, the factors for the HURT_FIRE and HURT_COLD flags (i.e. the flags indicating that a monster is especially vulnerable to fire or cold) are hardwired in the code. For projection effects on a monster, those multipliers are in project-mon.c (lines 504, 510, and 655). For melee attack by a monster, the multiplier is in mon-blows.c (line 293). The reduction factors for when a monster strongly resists an element are also hardwired in those files.

                      The change for 4.2.1 which included HURT_FIRE and HURT_COLD for a player's melee, thrown, or missile attacks similarly hardwired the value; that's in get_monster_brand_multiplier() in obj-slays.c (line 327 currently).

                      For a player's vulnerability to an element, a factor of 4/3 is applied for projection effects. That's hardwired in project-player.c's adjust_dam() (line 70 currently). The reduction factor for having armor for an acid attack is also there.

                      As far as I know, the other constants related to elemental damage are configurable and are in lib/gamedata/projection.txt.

                      Comment

                      • Pete Mack
                        Prophet
                        • Apr 2007
                        • 6883

                        #12
                        Thanks Eric.
                        I would have been a long time looking for bare constants in the code otherwise.

                        Comment

                        • Pete Mack
                          Prophet
                          • Apr 2007
                          • 6883

                          #13
                          So here's a summation of current resistance code.

                          For pure magical attacks:
                          Monsters which "resist a lot" (IM_FIRE,etc) take 1/9 nominal damage.
                          Monsters that "resist somewhat" (Nether vs Evil) take 1/2 damage
                          Monsters with implicit resistance get 1/3 nominal damage (Time, Chaos, etc.)
                          Monsters with explicit resistance (Nether, Light, Dark, Disenchantment..) take between 3/7 and 1/4 damage, at random.
                          Monsters which are vulnerable to Fire or Cold take 2x damage
                          Monsters vulnerable to light take 2x damage from bright light.
                          Last edited by Pete Mack; March 15, 2021, 23:28.

                          Comment

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