Double damage is a property of some weapons that doubles their damage.
Components of damage doubled
- The weapon's base damage.
- The enchantment damage bonus.
- The Rogue's d(XL) backstab damage.
- The negative penalty for erosion.
Components of damage not doubled
- 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 (wood golems, but there are no axes with double damage.)
- 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.)
Weapons that have the double damage property
- The Tsurugi of Muramasa, against large monsters 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 non level drain resistant.
- The Heart of Ahriman when slung.
- The Sceptre of Might against cross-aligned.
- Grayswandir, against all monsters.
- Frost Brand and Fire Brand, against non cold resistant and non fire resistant respectively.
- Sunsword against all undead.
- Demonbane, Dragonbane, Giantslayer, Ogresmasher, Sting, Orcrist, Trollsbane, and Werebane, against their targeted monsters.
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 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 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-haters).
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.
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.. 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).. dmgval also subtracts damage due to erosion.
hmon_hitmon then considers backstab damage..
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..
Finally, hmon_hitmon adds on intrinsic damage bonuses and damage bonuses from rings of increase damage; followed by the bonus for skill in the weapon's class ; and lastly, poison damage is potentially added . 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.
(tmp, the damage, is subtracted from the monster's hp, mon->mhp on line 1064.)
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.
- uhitm.c in NetHack 3.6.0, line 504: hitum calls known_hitum
- uhitm.c in NetHack 3.6.0, line 464: first call to hmon
- uhitm.c in NetHack 3.6.0, line 512: second call to known_hitum for second weapon
- uhitm.c in NetHack 3.6.0, line 531: hmon calls hmon_hitmon
- uhitm.c in NetHack 3.6.0, line 643
- weapon.c in NetHack 3.6.0, line 332: bonuses calculated and fiddled with
- weapon.c in NetHack 3.6.0, line 346
- uhitm.c in NetHack 3.6.0, line 648: back stab damage section
- uhitm.c in NetHack 3.6.0, line 685: hmon_hitmon calls artifact_hit
- uhitm.c in NetHack 3.6.0, line 962: damage bonus added
- uhitm.c in NetHack 3.6.0, line 976: weapon skill bonus
- uhitm.c in NetHack 3.6.0, line 1003: poison damage
- uhitm.c in NetHack 3.6.0, line 464: bare-handed start
- uhitm.c in NetHack 3.6.0, line 976: weapon_dam_bonus call
- weapon.c in NetHack 3.6.0, line 1395: bare-handed calculation
- uhitm.c in NetHack 3.6.0, line 1064: tmp subtracted from mon->mhp