Difference between revisions of "User:Darth l33t/To-hit"

From NetHackWiki
Jump to navigation Jump to search
Line 1: Line 1:
 
When attacking a [[monster]], you must make a successful '''to-hit''' [[D notation|roll]] to actually strike it. To do this, your to-hit bonus must exceed the roll of ''1d20''.{{refsrc|uhitm.c|478|comment=to-hit roll}} Otherwise, your attack misses.
 
When attacking a [[monster]], you must make a successful '''to-hit''' [[D notation|roll]] to actually strike it. To do this, your to-hit bonus must exceed the roll of ''1d20''.{{refsrc|uhitm.c|478|comment=to-hit roll}} Otherwise, your attack misses.
  
== Melee ==
+
== Attacks ==
  
These are the factors that affect your chance of hitting in [[melee]]:
+
These are the factors that affect your chance of hitting with any non-spell attack, whether [[melee]] or ranged:
  
 
=== Weapon and equipment ===
 
=== Weapon and equipment ===
  
* A bonus (or penalty) equal to the weapon's [[enchantment]], if using a [[weapon]].{{refsrc|weapon.c|133|comment=enchantment bonus for weapons}}
+
* The natural to-hit bonus of the [[weapon]].{{refsrc|weapon.c|137|comment=item to-hit bonus}}
* The natural to-hit bonus of the object used to strike.{{refsrc|weapon.c|137|comment=item to-hit bonus}}
+
* A bonus (or penalty) equal to the weapon's [[enchantment]].{{refsrc|weapon.c|133|comment=enchantment bonus for weapons}}
 
* The artifact's to-hit bonus, if using an [[artifact weapon]] against an appropriate target.{{refsrc|weapon.c|164|comment=artifact bonus}}
 
* The artifact's to-hit bonus, if using an [[artifact weapon]] against an appropriate target.{{refsrc|weapon.c|164|comment=artifact bonus}}
 
* A bonus equal to the enchantment level(s) of any [[ring of increase accuracy|rings of increase accuracy]] you are wearing.{{refsrc|uhitm.c|236|comment=your to-hit bonus from rings, <code>u.uhitinc</code>}}
 
* A bonus equal to the enchantment level(s) of any [[ring of increase accuracy|rings of increase accuracy]] you are wearing.{{refsrc|uhitm.c|236|comment=your to-hit bonus from rings, <code>u.uhitinc</code>}}
Line 53: Line 53:
  
 
* &minus;1 for all ranged attacks.{{refsrc|dothrow.c|1198|comment=base &minus;1 for ranged}}
 
* &minus;1 for all ranged attacks.{{refsrc|dothrow.c|1198|comment=base &minus;1 for ranged}}
* A bonus equal to the enchantment level(s) of any [[ring of increase accuracy|rings of increase accuracy]] you are wearing.{{refsrc|uhitm.c|236|comment=your to-hit bonus from rings, <code>u.uhitinc</code>}}
 
 
* The target monster's [[AC]].{{refsrc|uhitm.c|236|comment=monster AC}}
 
* The target monster's [[AC]].{{refsrc|uhitm.c|236|comment=monster AC}}
 
* A bonus based on your [[dexterity]].
 
* A bonus based on your [[dexterity]].
Line 67: Line 66:
 
* +2 if the item used is a [[heavy iron ball]].
 
* +2 if the item used is a [[heavy iron ball]].
 
* +6 if the item used is a [[boulder]].
 
* +6 if the item used is a [[boulder]].
* A bonus (or penalty) equal to the weapon's [[enchantment]], if using a [[weapon]].
 
* The natural to-hit bonus of the item, if it is a weapon or [[gem]].
 
 
* +2 for using a [[blessed]] weapon against a [[demon]] or [[undead]].{{refsrc|weapon.c|142|comment=blessed bonus against demons/undead}}
 
* +2 for using a [[blessed]] weapon against a [[demon]] or [[undead]].{{refsrc|weapon.c|142|comment=blessed bonus against demons/undead}}
 
* +2 for using any [[spear]] against a "kebabable" monster: [[xorn]]s, [[naga]]s, [[dragon]]s, [[jabberwock]]s, and [[giant]]s.{{refsrc|weapon.c|145|comment=spear versus "kebabable" monster}}
 
* +2 for using any [[spear]] against a "kebabable" monster: [[xorn]]s, [[naga]]s, [[dragon]]s, [[jabberwock]]s, and [[giant]]s.{{refsrc|weapon.c|145|comment=spear versus "kebabable" monster}}
Line 74: Line 71:
 
* +2 for using a trident against any {{white|S}} or {{white|;}} that is not in water.
 
* +2 for using a trident against any {{white|S}} or {{white|;}} that is not in water.
 
* +2 for using a [[pick-axe]] or [[dwarvish mattock]] against a [[xorn]] or [[earth elemental]].{{refsrc|weapon.c|155|comment=pick versus phasing and thick-skinned}}
 
* +2 for using a [[pick-axe]] or [[dwarvish mattock]] against a [[xorn]] or [[earth elemental]].{{refsrc|weapon.c|155|comment=pick versus phasing and thick-skinned}}
* The artifact's to-hit bonus, if using an [[artifact weapon]] (or [[The Heart of Ahriman|artifact gem]]) against an appropriate target.{{refsrc|weapon.c|164|comment=artifact bonus}}
 
 
* +1 if you are hitting any [[orc]] as an [[elf (starting race)|elven]] hero currently in natural form, or [[polymorph]]ed into an [[elf (monster attribute)|elven monster]].{{refsrc|dothrow.c|1232|comment=elves versus orcs}}
 
* +1 if you are hitting any [[orc]] as an [[elf (starting race)|elven]] hero currently in natural form, or [[polymorph]]ed into an [[elf (monster attribute)|elven monster]].{{refsrc|dothrow.c|1232|comment=elves versus orcs}}
 
* If you throw any gem at a [[unicorn]], it will always be caught.
 
* If you throw any gem at a [[unicorn]], it will always be caught.
Line 81: Line 77:
 
* A bonus (or penalty) equal to the [[enchantment]] of your launcher, if firing ammo from it.
 
* A bonus (or penalty) equal to the [[enchantment]] of your launcher, if firing ammo from it.
 
* A penalty based on the [[erosion]] of your launcher, if firing ammo from it: &minus;1 if eroded, &minus;2 if very eroded, or &minus;3 if completely eroded.
 
* A penalty based on the [[erosion]] of your launcher, if firing ammo from it: &minus;1 if eroded, &minus;2 if very eroded, or &minus;3 if completely eroded.
* The artifact's to-hit bonus, if firing appropriate ammo from an [[The Longbow of Diana|artifact launcher]], against an appropriate target.
 
 
* +1 if you are an [[elf (starting race)|elf]] or [[Samurai]] firing any [[arrow]]s from any [[bow]].
 
* +1 if you are an [[elf (starting race)|elf]] or [[Samurai]] firing any [[arrow]]s from any [[bow]].
 
* An additional +1 if you are an [[elf (starting race)|elf]] firing [[elven arrow]]s from an [[elven bow]].
 
* An additional +1 if you are an [[elf (starting race)|elf]] firing [[elven arrow]]s from an [[elven bow]].
Line 88: Line 83:
 
* +2 if throwing or kicking an item that counts as a throwing weapon.
 
* +2 if throwing or kicking an item that counts as a throwing weapon.
 
* &minus;2 if throwing or kicking an item that is neither a throwing weapon nor ammo.
 
* &minus;2 if throwing or kicking an item that is neither a throwing weapon nor ammo.
* A bonus or penalty from &minus;4 to +3 ([[#Weapon skill bonus|see table]]), depending on your [[skill]] with the thrown item, unless you throw ammo without wielding the appropriate launcher.
 
  
 
== Spells ==
 
== Spells ==

Revision as of 15:57, 9 July 2021

When attacking a monster, you must make a successful to-hit roll to actually strike it. To do this, your to-hit bonus must exceed the roll of 1d20.[1] Otherwise, your attack misses.

Attacks

These are the factors that affect your chance of hitting with any non-spell attack, whether melee or ranged:

Weapon and equipment

Your characteristics and status

Skills

  • A bonus or penalty from −4 to +3 (see table), depending on your skill with the wielded weapon (or bare hands or martial arts, if you are not two-weaponing.[16]
  • A penalty from −9 to −3 (see table), depending on your two weapon combat skill (or your weapon skill, if it is lower), if you are two-weaponing.[17]
  • A penalty if riding a steed: −2 if restricted or Unskilled in riding, −1 if Basic, and no penalty if Skilled or better.[18]
  • An additional −2 if you engage in two weapon combat while riding a steed.[19]

Monster characteristics and status

  • The target monster's AC.[20]
  • +2 (cumulative) against a stunned, fleeing, or sleeping monster.[21]
  • +4 against a paralyzed monster.[22]

Monster-specific

Ranged

These are some of the factors that might affect your chance of hitting when throwing or kicking items, or when applying a polearm:

Spells

Spells to-hit calculation is quite different. For ray spells, your to-hit bonus must exceed the result of 4 minus 1d20.

The calculation of the to-hit bonus is simple:

  • A bonus or penalty from −4 to +3 (see table), depending on your skill with the spell school.[37]
  • A bonus based on your dexterity (see dexterity table).[38]
  • If the monster's AC is non-negative, add the monster's AC.
  • If the monster's AC is negative, add a random number between −1 and its AC.

Non-ray spells work differently. Force bolt will hit if the roll of a d20 is lower than (10 + target's AC), with no modification for dexterity or skill. Other beam and non-directional spells will always hit, but may be resisted.

Bonus tables

Strength bonus

The strength bonus applies to melee attacks only.

Strength Bonus
3 to 5 −2
6 to 7 −1
8 to 16 0
17 to 18/50 +1
18/51 to 18/99 +2
18/** to 25 +3

Dexterity bonus

The dexterity bonus applies to both melee and ranged attacks.

Dexterity Bonus
3 −3
4 to 5 −2
6 to 7 −1
8 to 14 0
15 +1
16 +2
17 +3
18 +4
19 +5
20 +6
21 +7
22 +8
23 +9
24 +10
25 +11

Weapon skill bonus

The weapon skill bonus applies to both melee and ranged attacks.

Skill Bonus
Restricted or
Unskilled
−4
Basic 0
Skilled +2
Expert +3

Spell skill bonus

The spell skill bonus applies only to ray and beam attacks.

Skill Bonus
Restricted or
Unskilled
−4
Basic 0
Skilled +2
Expert +3

Two weapon penalty

The two weapon combat penalty applies to melee attacks only. It uses the lesser of the two weapon combat skill and your primary weapon's skill.

Skill Penalty
Restricted or Unskilled −9
Basic −7
Skilled −5
Expert −3

Riding penalty

The riding penalty applies if you are mounted on a steed, and varies based on your riding skill.

Skill Penalty
Restricted or Unskilled −2
Basic −1
Skilled or Expert 0

Monster size bonus

The monster size bonus applies to ranged attacks only.

Size Bonus
Tiny −2
Small −1
Medium 0
Large +1
Huge +2
Gigantic +5

Variants

SporkHack does grant to-hit bonues for bare-hands or martial arts skill when hitting in melee without any wielded item. Monks and Samurai get the martial arts bonus; other roles get the bare hands bonus.

Skill Bare hands
bonus
Martial arts
bonus
Unskilled +1 (n/a)
Basic +1 +3
Skilled +2 +4
Expert +2 +5
Master +3 +6
Grand Master +3 +7

References

  1. uhitm.c in NetHack 3.4.3, line 478: to-hit roll
  2. weapon.c in NetHack 3.4.3, line 137: item to-hit bonus
  3. weapon.c in NetHack 3.4.3, line 133: enchantment bonus for weapons
  4. weapon.c in NetHack 3.4.3, line 164: artifact bonus
  5. uhitm.c in NetHack 3.4.3, line 236: your to-hit bonus from rings, u.uhitinc
  6. uhitm.c in NetHack 3.4.3, line 267
  7. uhitm.c in NetHack 3.4.3, line 267: monk penalty and bonus
  8. uhitm.c in NetHack 3.4.3, line 236: base +1 for melee
  9. weapon.c in NetHack 3.4.3, line 688: strength and dexterity bonuses
  10. uhitm.c in NetHack 3.4.3, line 236: Luck bonus
  11. uhitm.c in NetHack 3.4.3, line 237: natural and polymorphed level bonuses
  12. weapon.c in NetHack 3.4.3, line 703: beginner to-hit bonus
  13. uhitm.c in NetHack 3.4.3, line 277: weight penalty
  14. uhitm.c in NetHack 3.4.3, line 278: trap penalty
  15. uhitm.c in NetHack 3.4.3, line 478: always hit if engulfed
  16. weapon.c in NetHack 3.4.3, line 1109: skill bonus
  17. weapon.c in NetHack 3.4.3, line 1118: two weapon penalty
  18. weapon.c in NetHack 3.4.3, line 1146: base riding penalty
  19. weapon.c in NetHack 3.4.3, line 1154: two weapon riding penalty
  20. uhitm.c in NetHack 3.4.3, line 236: monster AC
  21. uhitm.c in NetHack 3.4.3, line 250: monster status bonuses
  22. uhitm.c in NetHack 3.4.3, line 257: paralyzed monster bonus
  23. weapon.c in NetHack 3.4.3, line 142: blessed bonus against demons/undead
  24. weapon.c in NetHack 3.4.3, line 145: spear versus "kebabable" monster
  25. weapon.c in NetHack 3.4.3, line 149: trident versus swimmers
  26. weapon.c in NetHack 3.4.3, line 155: pick versus phasing and thick-skinned
  27. uhitm.c in NetHack 3.4.3, line 264: elves versus orcs
  28. dothrow.c in NetHack 3.4.3, line 1198: base −1 for ranged
  29. uhitm.c in NetHack 3.4.3, line 236: monster AC
  30. uhitm.c in NetHack 3.4.3, line 236: Luck bonus
  31. uhitm.c in NetHack 3.4.3, line 237: natural and polymorphed level bonuses
  32. weapon.c in NetHack 3.4.3, line 142: blessed bonus against demons/undead
  33. weapon.c in NetHack 3.4.3, line 145: spear versus "kebabable" monster
  34. weapon.c in NetHack 3.4.3, line 149: trident versus swimmers
  35. weapon.c in NetHack 3.4.3, line 155: pick versus phasing and thick-skinned
  36. dothrow.c in NetHack 3.4.3, line 1232: elves versus orcs
  37. zap.c in NetHack 3.4.3, line 2540: skill bonus
  38. zap.c in NetHack 3.4.3, line 2548: spell dexterity bonus