Difference between revisions of "Double damage"

From NetHackWiki
Jump to navigation Jump to search
m (Calculation: fix a couple of versions that the previous edit missed)
m (chance to:opportunity::chance of:probability)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''Double damage''' is a property of some weapons that doubles their damage.
+
'''Double damage''' is a weapon property that occurs in ''[[NetHack]]'' and its variants. As can be guessed, it doubles the base [[damage]] of that weapon.
 +
 
 +
==Appearances==
 +
The [[Banes]] and other similar weapons deal double damage against specific types of [[monster]]s:
 +
 
 +
* [[Demonbane]]
 +
* [[Dragonbane]]
 +
* [[Giantslayer]]
 +
* [[Ogresmasher]]
 +
* [[Trollsbane]]
 +
* [[Werebane]]
 +
* [[Sting]] against all [[Orc (monster class)|orcs]].
 +
* [[Orcrist]] against all orcs.
 +
* [[Sunsword]] against all [[undead]].
 +
 
 +
Other weapons that have the double damage property are:
 +
* The [[Heart of Ahriman]] when fired from a [[sling]].
 +
* [[The Sceptre of Might]] against [[alignment|cross-aligned]] monsters.
 +
* The [[Staff of Aesculapius]] against monsters without [[drain resistance]].
 +
* The [[Tsurugi of Muramasa]] has a 5% chance of dealing double-damage against [[Physical size|large]] [[monster]]s - this is of a different nature compared to the others, but is calculated at effectively the same time and in the same way.
 +
* [[Fire Brand]], against those without [[fire resistance]].
 +
* [[Frost Brand]] against monsters without [[cold resistance]].
 +
* [[Grayswandir]], against all monsters.
 +
 
 +
==Details==
 +
When the double damage property activates, it affects the following components of a weapon's damage:
  
Components of damage doubled
 
 
* The weapon's base damage.
 
* The weapon's base damage.
* The [[enchantment#Weapons|enchantment]] damage bonus.  
+
* The [[Enchantment#Weapons|enchantment]] damage bonus (or penalty.)
 
* The [[Rogue]]'s d(XL) [[backstab]] damage.
 
* The [[Rogue]]'s d(XL) [[backstab]] damage.
 
* The negative penalty for [[erosion]].
 
* The negative penalty for [[erosion]].
  
Components of damage not doubled
+
Double damage does not affect the following:
 
* The extra d4 for using a [[blessed]] weapon against [[undead]].
 
* The extra d4 for using a [[blessed]] weapon against [[undead]].
* The extra d20 for using a [[silver]] weapon against [[Silver#Silver_damage|silver haters]].
+
* The extra d20 for using a [[silver]] weapon against silver haters.
* The bonus d4 for using an [[axe]] against [[wood|wooden]] monsters ([[wood golem]]s, but there are no [[axe]]s with double damage.)
+
* The bonus d4 for using an [[axe]] against [[wood]]en monsters.
* Bonus 2d10 or 2d2 (if [[twoweaponing]]) damage from a successful [[joust]] (though there are no artifact [[lance]]s in vanilla nethack.)
+
* Bonus 2d10 or 2d2 (if [[twoweaponing]]) damage from a successful [[joust]] (though there are no artifact [[lance]]s in vanilla NetHack.)
 
* Damage bonus due to weapon [[skill]].
 
* Damage bonus due to weapon [[skill]].
 
* Damage bonus due to [[Attribute#Strength|strength]].
 
* Damage bonus due to [[Attribute#Strength|strength]].
Line 17: Line 41:
 
* Extra damage from striking with a [[poison|poisoned]] weapon (though no weapon that can deal double damage can also be [[poison|poisoned]] in vanilla nethack.)
 
* Extra damage from striking with a [[poison|poisoned]] weapon (though no weapon that can deal double damage can also be [[poison|poisoned]] in vanilla nethack.)
  
Weapons that have the double damage property
+
Enchanting double-damage artifact weapons generally yields higher returns compared to their standard counterparts, though negative enchantments also result in much weaker damage.
* The [[Tsurugi of Muramasa]], against [[Physical size|large]] [[monster]]s with 5% chance. (While this weapon's double damage is of a different nature than that of the others, it is calculated at effectively the same time and in the same way.)
 
* The [[Staff of Aesculapius]] against [[drain resistance|non level drain resistant]].
 
* The [[Heart of Ahriman]] when [[sling|slung]].
 
* The [[Sceptre of Might]] against [[alignment|cross-aligned]].
 
* [[Grayswandir]], against all monsters.
 
* [[Frost Brand]] and [[Fire Brand]], against [[cold resistance|non cold resistant]] and [[fire resistance|non fire resistant]] respectively.
 
* [[Sunsword]] against all [[undead]].
 
* [[Demonbane]], [[Dragonbane]], [[Giantslayer]], [[Ogresmasher]], [[Sting]], [[Orcrist]], [[Trollsbane]], and [[Werebane]], against their targeted [[monster]]s.
 
 
 
Even at +0, these weapons are twice as powerful as their base [[damage]] alone would suggest, but even greater benefits are to be had from [[enchantment|enchanting]] them: a [[scroll of enchant weapon]] used on an [[artifact weapon]] with double damage is more effective than the same scroll used on a [[weapon]] without double damage (for [[Grayswandir]] that's twice as effective, since the doubled damage applies to all monsters.) This also works in reverse; if you ever come across a [[enchantment|negatively enchanted]] -3 [[Grayswandir]] you might not want to use it, because it will deal 2*1d8 - 6 for an average of 3 damage (but will still do nicely against [[silver|silver-haters]]).
 
  
 
==Calculation==
 
==Calculation==
Line 33: Line 47:
 
The damage calculation in NetHack is quite complex, but when concerned only with melee weapons, it is simple enough to describe.
 
The damage calculation in NetHack is quite complex, but when concerned only with melee weapons, it is simple enough to describe.
  
hmon_hitmon in uhitm.c is called once for each melee hit on a monster, whether the hit is barehanded, with a weapon, with a weapon tool, or with something else (silver wand, cream pie, or cockatrice corpse for instance). If twoweaponing, it is called once for each of the two weapons or weapon-tools in use.{{refsrc|uhitm.c|504|nethack=3.6.0|comment=hitum calls known_hitum}}{{refsrc|uhitm.c|464|nethack=3.6.0|comment=first call to hmon}}{{refsrc|uhitm.c|512|nethack=3.6.0|comment=second call to known_hitum for second weapon}}{{refsrc|uhitm.c|531|nethack=3.6.0|comment=hmon calls hmon_hitmon}}
+
hmon_hitmon in uhitm.c is called once for each melee hit on a monster, whether the hit is barehanded, with a weapon, with a weapon tool, or with something else (silver wand, cream pie, or cockatrice corpse for instance). If twoweaponing, it is called once for each of the two weapons or weapon-tools in use.{{refsrc|src/uhitm.c|504|nethack=3.6.0|comment=hitum calls known_hitum}}{{refsrc|src/uhitm.c|464|nethack=3.6.0|comment=first call to hmon}}{{refsrc|src/uhitm.c|512|nethack=3.6.0|comment=second call to known_hitum for second weapon}}{{refsrc|src/uhitm.c|531|nethack=3.6.0|comment=hmon calls hmon_hitmon}}
  
 
Reading hmon_hitmon and its sub-functions gives us the order in which bonuses are applied, and thus tells us which of these bonuses will be affected by double damage.
 
Reading hmon_hitmon and its sub-functions gives us the order in which bonuses are applied, and thus tells us which of these bonuses will be affected by double damage.
  
Inside hmon_hitmon, the weapon/item in question is stored in the variable obj. The damage is stored in tmp, and this variable is modified as the function progresses, adding layer upon layer of NetHack combat functionality. hmon_hitman calls dmgval in weapon.c to get the base damage, enchantment bonus, and situation bonuses for the weapon.{{refsrc|uhitm.c|643|nethack=3.6.0}}. dmgval adds bonuses for using blessed weapons against undead, axes against wooden monsters, and silver against silver hating monsters, but tests to see if the weapon will do double damage and divides these values by two in that case (so the bonuses are not doubled).{{refsrc|weapon.c|332|nethack=3.6.0|comment=bonuses calculated and fiddled with}}. dmgval also subtracts damage due to erosion.{{refsrc|weapon.c|346|nethack=3.6.0}}
+
Inside hmon_hitmon, the weapon/item in question is stored in the variable obj. The damage is stored in tmp, and this variable is modified as the function progresses, adding layer upon layer of NetHack combat functionality. hmon_hitman calls dmgval in weapon.c to get the base damage, enchantment bonus, and situation bonuses for the weapon.{{refsrc|src/uhitm.c|643|nethack=3.6.0}}. dmgval adds bonuses for using blessed weapons against undead, axes against wooden monsters, and silver against silver hating monsters, but tests to see if the weapon will do double damage and divides these values by two in that case (so the bonuses are not doubled).{{refsrc|src/weapon.c|332|nethack=3.6.0|comment=bonuses calculated and fiddled with}}. dmgval also subtracts damage due to erosion.{{refsrc|src/weapon.c|346|nethack=3.6.0}}
 +
 
 +
hmon_hitmon then considers backstab damage.{{refsrc|src/uhitm.c|648|nethack=3.6.0|comment=back stab damage section}}.
  
hmon_hitmon then considers backstab damage.{{refsrc|uhitm.c|648|nethack=3.6.0|comment=back stab damage section}}.  
+
Double damage and other special artifact effects (like Magicbane's specials and the Tsurugi's special, which could itself by double damage) are added in by artifact_hit in artifact.c.{{refsrc|src/uhitm.c|685|nethack=3.6.0|comment=hmon_hitmon calls artifact_hit}}.
  
Double damage and other special artifact effects (like Magicbane's specials and the Tsurugi's special, which could itself by double damage) are added in by artifact_hit in artifact.c.{{refsrc|uhitm.c|685|nethack=3.6.0|comment=hmon_hitmon calls artifact_hit}}.
+
Finally, hmon_hitmon adds on intrinsic damage bonuses and damage bonuses from rings of increase damage{{refsrc|src/uhitm.c|962|nethack=3.6.0|comment=damage bonus added}}; followed by the bonus for skill in the weapon's class {{refsrc|src/uhitm.c|976|nethack=3.6.0|comment=weapon skill bonus}}; and lastly, poison damage is potentially added {{refsrc|src/uhitm.c|1003|nethack=3.6.0|comment=poison damage}}. Bare-hands or martial arts skill only grant their damage bonus if the d2 or d4 base damage is at least two -- effectively you are at unskilled 50% or 25% of the time.{{refsrc|src/uhitm.c|464|nethack=3.6.0|comment=bare-handed start}}{{refsrc|src/uhitm.c|976|nethack=3.6.0|comment=weapon_dam_bonus call}}{{refsrc|src/weapon.c|1395|nethack=3.6.0|comment=bare-handed calculation}}
  
Finally, hmon_hitmon adds on intrinsic damage bonuses and damage bonuses from rings of increase damage{{refsrc|uhitm.c|962|nethack=3.6.0|comment=damage bonus added}}; followed by the bonus for skill in the weapon's class {{refsrc|uhitm.c|976|nethack=3.6.0|comment=weapon skill bonus}}; and lastly, poison damage is potentially added {{refsrc|uhitm.c|1003|nethack=3.6.0|comment=poison damage}}. Bare-hands or martial arts skill only grant their damage bonus if the d2 or d4 base damage is at least two -- effectively you are at unskilled 50% or 25% of the time.{{refsrc|uhitm.c|464|nethack=3.6.0|comment=bare-handed start}}{{refsrc|uhitm.c|976|nethack=3.6.0|comment=weapon_dam_bonus call}}{{refsrc|weapon.c|1395|nethack=3.6.0|comment=bare-handed calculation}}
+
(tmp, the damage, is subtracted from the monster's hp, mon->mhp on line 1064{{refsrc|src/uhitm.c|1064|nethack=3.6.0|comment=tmp subtracted from mon->mhp}}.)
  
(tmp, the damage, is subtracted from the monster's hp, mon->mhp on line 1064{{refsrc|uhitm.c|1064|nethack=3.6.0|comment=tmp subtracted from mon->mhp}}.)
+
==SLASH'EM==
 +
A number of [[SLASH'EM]] [[technique]]s grant temporary double damage: [[Samurai]]'s [[Kiii]] doubles all weapon damage, while [[Missile flurry]], for [[Drow (starting race)|droven]] [[Ranger]]s only, doubles the damage done with their racial bow and arrows.  Finally, [[Caveman]]'s [[Primal roar]] grants double damage to [[pet]]s.
 +
Note that these effects may be calculated differently from the vanilla mechanics described above.
  
 
==See also==
 
==See also==
Line 52: Line 70:
 
==References==
 
==References==
 
<references/>
 
<references/>
 
+
{{nethack-360}}
 
[[Category:Weapons]]
 
[[Category:Weapons]]
{{nethack-360}}
 

Latest revision as of 10:00, 29 October 2023

Double damage is a weapon property that occurs in NetHack and its variants. As can be guessed, it doubles the base damage of that weapon.

Appearances

The Banes and other similar weapons deal double damage against specific types of monsters:

Other weapons that have the double damage property are:

Details

When the double damage property activates, it affects the following components of a weapon's damage:

Double damage does not affect the following:

  • The extra d4 for using a blessed weapon against undead.
  • The extra d20 for using a silver weapon against silver haters.
  • The bonus d4 for using an axe against wooden monsters.
  • Bonus 2d10 or 2d2 (if twoweaponing) damage from a successful joust (though there are no artifact lances in vanilla NetHack.)
  • Damage bonus due to weapon skill.
  • Damage bonus due to strength.
  • Damage bonus from rings of increase damage or intrinsic damage bonuses obtained by eating those rings.
  • Extra damage from striking with a poisoned weapon (though no weapon that can deal double damage can also be poisoned in vanilla nethack.)

Enchanting double-damage artifact weapons generally yields higher returns compared to their standard counterparts, though negative enchantments also result in much weaker damage.

Calculation

A user has suggested this page be merged with "damage"

The damage calculation in NetHack is quite complex, but when concerned only with melee weapons, it is simple enough to describe.

hmon_hitmon in uhitm.c is called once for each melee hit on a monster, whether the hit is barehanded, with a weapon, with a weapon tool, or with something else (silver wand, cream pie, or cockatrice corpse for instance). If twoweaponing, it is called once for each of the two weapons or weapon-tools in use.[1][2][3][4]

Reading hmon_hitmon and its sub-functions gives us the order in which bonuses are applied, and thus tells us which of these bonuses will be affected by double damage.

Inside hmon_hitmon, the weapon/item in question is stored in the variable obj. The damage is stored in tmp, and this variable is modified as the function progresses, adding layer upon layer of NetHack combat functionality. hmon_hitman calls dmgval in weapon.c to get the base damage, enchantment bonus, and situation bonuses for the weapon.[5]. dmgval adds bonuses for using blessed weapons against undead, axes against wooden monsters, and silver against silver hating monsters, but tests to see if the weapon will do double damage and divides these values by two in that case (so the bonuses are not doubled).[6]. dmgval also subtracts damage due to erosion.[7]

hmon_hitmon then considers backstab damage.[8].

Double damage and other special artifact effects (like Magicbane's specials and the Tsurugi's special, which could itself by double damage) are added in by artifact_hit in artifact.c.[9].

Finally, hmon_hitmon adds on intrinsic damage bonuses and damage bonuses from rings of increase damage[10]; followed by the bonus for skill in the weapon's class [11]; and lastly, poison damage is potentially added [12]. Bare-hands or martial arts skill only grant their damage bonus if the d2 or d4 base damage is at least two -- effectively you are at unskilled 50% or 25% of the time.[13][14][15]

(tmp, the damage, is subtracted from the monster's hp, mon->mhp on line 1064[16].)

SLASH'EM

A number of SLASH'EM techniques grant temporary double damage: Samurai's Kiii doubles all weapon damage, while Missile flurry, for droven Rangers only, doubles the damage done with their racial bow and arrows. Finally, Caveman's Primal roar grants double damage to pets. Note that these effects may be calculated differently from the vanilla mechanics described above.

See also

See http://www.steelypips.org/nethack/343/weap-343.txt, the weapons spoiler by Kevin Hugo at steelypips for a run down on NetHack's entire damage calculation process.

References

This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.6.0. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-360}} tag to the current version's tag or {{noversion}} as appropriate.