Difference between revisions of "To-hit"

From NetHackWiki
Jump to navigation Jump to search
(Ranged: launcher enchantment bonus)
m (languages + lede)
 
(22 intermediate revisions by 17 users not shown)
Line 1: Line 1:
When [[attack]]ing a [[monster]], you must make a successful '''to-hit''' roll in order to actually strike it. To do this, your to-hit bonus must exceed the roll of ''1d20''.<ref>[[uhitm.c#line478]] (to-hit roll)</ref>
+
{{languages}}
 +
In ''[[NetHack]]'', when attacking a [[monster]] you must make a successful '''to-hit''' [[D notation|roll]] to actually strike it - your total to-hit must exceed the roll of ''1d20'', or your attack will miss.{{refsrc|uhitm.c|478|comment=to-hit roll}}
  
 
== Melee ==
 
== Melee ==
  
These are some of the factors that might affect your chance to hit in [[melee]]:
+
These are the factors that affect your chance of hitting in [[melee]]:
  
 
=== Weapon and equipment ===
 
=== Weapon and equipment ===
  
* A bonus (or penalty) equal to the weapon's [[enchantment]], if using a [[weapon]].<ref>[[weapon.c#line133]] (enchantment bonus for weapons)</ref>
+
* 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 object used to strike.<ref>[[weapon.c#line137]] (item to-hit bonus)</ref>
+
* The natural to-hit bonus of the object used to strike.{{refsrc|weapon.c|137|comment=item to-hit bonus}}
* The artifact's to-hit bonus, if using an [[artifact weapon]] against an appropriate target.<ref>[[weapon.c#line164]] (artifact bonus)</ref>
+
* 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.<ref>[[uhitm.c#line236]] (your to-hit bonus from rings, <code>u.uhitinc</code>)</ref>
+
* 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>}}
* -20 if you are a [[Monk]] wearing [[body armor]].
+
* &minus;20 if you are a [[Monk]] wearing [[body armor]].{{refsrc|uhitm.c|267}}
* If you are a Monk not wearing body armor or a [[shield]], and not [[wield]]ing any item, +(''experience level'' / 3)+2.<ref>[[uhitm.c#line267]] (monk penalty and bonus)</ref>
+
* If you are a Monk not wearing body armor or a [[shield]], and not [[wield]]ing any item, +(''experience level'' / 3)+2.{{refsrc|uhitm.c|267|comment=monk penalty and bonus}}
  
 
=== Your characteristics and status ===
 
=== Your characteristics and status ===
  
* +1 for all melee attacks.<ref>[[uhitm.c#line236]] (base +1 for melee)</ref>
+
* +1 for all melee attacks.{{refsrc|uhitm.c|236|comment=base +1 for melee}}
* Bonuses based on your [[strength]] and [[dexterity]] (see [[#Strength bonus|strength table]] and [[#Dexterity bonus|dexterity table]]).<ref>[[weapon.c#line688]] (strength and dexterity bonuses)</ref>
+
* Bonuses based on your [[strength]] and [[dexterity]] (see [[#Strength bonus|strength table]] and [[#Dexterity bonus|dexterity table]]).{{refsrc|weapon.c|688|comment=strength and dexterity bonuses}}
* A bonus equal to your [[Luck]].<ref>[[uhitm.c#line236]] (Luck bonus)</ref>
+
* A bonus equal to your [[Luck]].{{refsrc|uhitm.c|236|comment=Luck bonus}}
 
* A bonus equal to your [[experience level]], if you are in your natural form.
 
* A bonus equal to your [[experience level]], if you are in your natural form.
* A bonus equal to your monster type's "level" if you are [[polymorph]]ed.<ref>[[uhitm.c#line237]] (natural and polymorphed level bonuses)</ref>
+
* A bonus equal to your [[monster level]] (hit dice) if you are [[polymorph]]ed.{{refsrc|uhitm.c|237|comment=natural and polymorphed level bonuses}}
* +1 if you are at experience level 1 or 2.<ref>[[weapon.c#line703]] (beginner to-hit bonus)</ref>
+
* +1 if you are at experience level 1 or 2.{{refsrc|weapon.c|703|comment=beginner to-hit bonus}}
* -1 if you are [[encumbrance|burdened]], -3 if you are stressed, or -5 if you are strained; if you are overtaxed or overloaded you will be unable to attack at all.<ref>[[uhitm.c#line277]] (weight penalty)</ref>
+
* &minus;1 if you are [[encumbrance|burdened]], &minus;3 if you are stressed, or &minus;5 if you are strained; if you are overtaxed or overloaded you will be unable to attack at all.{{refsrc|uhitm.c|277|comment=weight penalty}}
* -3 if you are currently [[trap]]ped.<ref>[[uhitm.c#line278]] (trap penalty)</ref>
+
* &minus;3 if you are currently [[trap]]ped.{{refsrc|uhitm.c|278|comment=trap penalty}}
* If you are [[engulfing|engulfed]], you always hit.<ref>[[uhitm.c#line478]] (always hit if engulfed)</ref>
+
* If you are [[engulfing|engulfed]], you always hit.{{refsrc|uhitm.c|478|comment=always hit if engulfed}}
  
 
=== Skills ===
 
=== Skills ===
  
* A bonus or penalty from -4 to +3 ([[#Weapon skill bonus|see table]]), depending on your [[skill]] with the wielded weapon, if you are not two-weaponing.<ref>[[weapon.c#line1109]] (skill bonus)</ref>
+
* A bonus or penalty from &minus;4 to +3 ([[#Weapon skill bonus|see table]]), depending on your [[skill]] with the wielded weapon, if you are not two-weaponing.{{refsrc|weapon.c|1109|comment=skill bonus}}
* A penalty from -9 to -3 ([[#Two weapon penalty|see table]]), depending on your [[two weapon combat]] skill (or your weapon skill, if it is lower), if you are two-weaponing.<ref>[[weapon.c#line1118]] (two weapon penalty)</ref>
+
* A penalty from &minus;9 to &minus;3 ([[#Two weapon penalty|see table]]), depending on your [[two weapon combat]] skill (or your weapon skill, if it is lower), if you are two-weaponing.{{refsrc|weapon.c|1118|comment=two weapon penalty}}
* A bonus from +1 to +7 ([[#Bare hands bonus|see table]]), depending on your [[bare hands]] or [[martial arts]] skill, if you attack without any wielded item.<ref>[[weapon.c#line1129]] (bare hands bonus)</ref>
+
* No bonus for [[bare hands]] or [[martial arts]] skill.{{reffunc|weapon.c|weapon_hit_bonus|comment=This function is never called because {{sourcecode|uhitm.c|283}} or {{sourcecode|uhitm.c|1957}} checks if you're wielding something}}
* A penalty if riding a steed: -2 if restricted or unskilled in [[riding]], -1 if basic, and no penalty if skilled or better.<ref>[[weapon.c#line1146]] (base riding penalty)</ref>
+
* A penalty if riding a steed: &minus;2 if restricted or Unskilled in [[riding]], &minus;1 if Basic, and no penalty if Skilled or better.{{refsrc|weapon.c|1146|comment=base riding penalty}}
* An additional -2 if you engage in two weapon combat while riding a steed.<ref>[[weapon.c#line1154]] (two weapon riding penalty)</ref>
+
* An additional &minus;2 if you engage in two weapon combat while riding a steed.{{refsrc|weapon.c|1154|comment=two weapon riding penalty}}
  
 
=== Monster characteristics and status ===
 
=== Monster characteristics and status ===
  
* The target monster's [[AC]].<ref>[[uhitm.c#line236]] (monster AC)</ref>
+
* The target monster's [[AC]].{{refsrc|uhitm.c|236|comment=monster AC}}
* +2 (cumulative) against a stunned, fleeing, or sleeping monster.<ref>[[uhitm.c#line250]] (monster status bonuses)</ref>
+
* +2 (cumulative) against a stunned, fleeing, or sleeping monster.{{refsrc|uhitm.c|250|comment=monster status bonuses}}
* +4 against a paralysed monster.<ref>[[uhitm.c#line257]] (paralysed monster bonus)</ref>
+
* +4 against a paralyzed monster.{{refsrc|uhitm.c|257|comment=paralyzed monster bonus}}
  
 
=== Monster-specific ===
 
=== Monster-specific ===
  
* +2 for using a [[blessed]] weapon against a [[demon]] or [[undead]].<ref>[[weapon.c#line142]] (blessed bonus against demons/undead)</ref>
+
* +2 for using a [[blessed]] weapon against a [[M2_DEMON|demon]] or [[undead]] monster.{{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.<ref>[[weapon.c#line145]] (spear versus "kebabable" monster)</ref>
+
* +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}}
* +4 for using a [[trident]] against any [[swimmer]] that is in [[water]].<ref>[[weapon.c#line149]] (trident versus swimmers)</ref>
+
* +4 for using a [[trident]] against any [[swimmer]] that is in [[water]].{{refsrc|weapon.c|149|comment=trident versus swimmers}}
* +2 for using a trident against any {{white|S}} or {{white|;}} that is not in water.
+
* +2 for using a trident against any {{monclasssym|S}} or {{monclasssym|;}} that is not in water.
* +2 for using a [[pick-axe]] or [[dwarvish mattock|mattock]] against a [[xorn]] or [[earth elemental]].<ref>[[weapon.c#line155]] (pick versus phasing and thick-skinned)</ref>
+
* +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}}
* +1 if you are an [[elf]] (either naturally or by polymorph) hitting any [[orc]].<ref>[[uhitm.c#line264]] (elves versus orcs)</ref>
+
* +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|uhitm.c|264|comment=elves versus orcs}}
  
 
== Ranged ==
 
== Ranged ==
  
These are some of the factors that might affect your chance to hit when [[throw]]ing or [[kick]]ing items, or when [[apply]]ing a [[polearm]]:
+
These are some of the factors that might affect your chance of hitting when [[throw]]ing or [[kick]]ing items, or when [[apply]]ing a [[polearm]]:
  
* -1 for all ranged attacks.<ref>[[dothrow.c#line1198]] (base -1 for ranged)</ref>
+
* &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.<ref>[[uhitm.c#line236]] (your to-hit bonus from rings, <code>u.uhitinc</code>)</ref>
+
* 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]].<ref>[[uhitm.c#line236]] (monster AC)</ref>
+
* The target monster's [[AC]].{{refsrc|uhitm.c|236|comment=monster AC}}
 
* A bonus based on your [[dexterity]].
 
* A bonus based on your [[dexterity]].
* A bonus equal to your [[Luck]].<ref>[[uhitm.c#line236]] (Luck bonus)</ref>
+
* A bonus equal to your [[Luck]].{{refsrc|uhitm.c|236|comment=Luck bonus}}
 
* A bonus equal to your [[experience level]], if you are in your natural form.
 
* A bonus equal to your [[experience level]], if you are in your natural form.
* A bonus equal to your monster type's "level" if you are [[polymorph]]ed.<ref>[[uhitm.c#line237]] (natural and polymorphed level bonuses)</ref>
+
* A bonus equal to your [[monster level]] (hit dice) if you are [[polymorph]]ed.{{refsrc|uhitm.c|237|comment=natural and polymorphed level bonuses}}
* A bonus based on how far away the target is. A target adjacent to you gives a +2 bonus; this decreases by 1 for each move's worth of distance, to a maximum penalty of -4.
+
* A bonus based on how far away the target is. A target adjacent to you gives a +2 bonus; this decreases by 1 for each move's worth of distance, to a maximum penalty of &minus;4.
* -2 if you are wielding any [[bow]] while wearing [[gauntlets of power]].
+
* &minus;2 if you are wielding any [[bow]] while wearing [[gauntlets of power]].
* -3 if you are wielding any [[bow]] while wearing [[gauntlets of fumbling]].
+
* &minus;3 if you are wielding any [[bow]] while wearing [[gauntlets of fumbling]].
* A bonus or penalty from -2 to +5 ([[#Monster size bonus|see table]]), depending on the size of the target monster.
+
* A bonus or penalty from &minus;2 to +5 ([[#Monster size bonus|see table]]), depending on the size of the target monster.
 
* +2 against a sleeping monster.
 
* +2 against a sleeping monster.
* +4 against a paralysed monster.
+
* +4 against a paralyzed monster.
 
* +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]].
 
* 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]].
 
* 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]].<ref>[[weapon.c#line142]] (blessed bonus against demons/undead)</ref>
+
* +2 for using a [[blessed]] weapon against a demon or undead creature.{{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.<ref>[[weapon.c#line145]] (spear versus "kebabable" monster)</ref>
+
* +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}}
* +4 for using a [[trident]] against any [[swimmer]] that is in [[water]].<ref>[[weapon.c#line149]] (trident versus swimmers)</ref>
+
* +4 for using a [[trident]] against any [[swimmer]] that is in [[water]].{{refsrc|weapon.c|149|comment=trident versus swimmers}}
 
* +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|mattock]] against a [[xorn]] or [[earth elemental]].<ref>[[weapon.c#line155]] (pick versus phasing and thick-skinned)</ref>
+
* +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.<ref>[[weapon.c#line164]] (artifact bonus)</ref>
+
* 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 an [[elf]] (either naturally or by polymorph) hitting any [[orc]].<ref>[[uhitm.c#line264]] (elves versus orcs)</ref>
+
* +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.
* If you throw your [[quest artifact]] at your [[quest leader]], and he/she is peaceful and not paralysed, it will be caught and returned to you.
+
* If you throw your [[quest artifact]] at your [[quest leader]], and he/she is peaceful and not paralyzed, it will be caught and returned to you.
* -4 if you throw [[ammo]] without wielding the appropriate [[launcher]].
+
* &minus;4 if you throw [[ammo]] without wielding the appropriate [[launcher]].
 
* 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: -1 if eroded, -2 if thoroughly eroded, or -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.
 
* 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]] 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]] 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]].
 
* An additional +1 if you are a [[Samurai]] firing [[ya]] from a [[yumi]].
 
* An additional +1 if you are a [[Samurai]] firing [[ya]] from a [[yumi]].
 
* +4 if throwing or kicking a [[boomerang]].
 
* +4 if throwing or kicking a [[boomerang]].
 
* +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.
* -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 -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.
+
* 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 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 &minus;4 to +3 ([[#Spell skill bonus|see table]]), depending on your [[skill]] with the spell school.{{refsrc|zap.c|2540|comment=skill bonus}}
 +
* A bonus based on your dexterity (see [[#Dexterity bonus|dexterity table]]).{{refsrc|zap.c|2548|comment=spell dexterity bonus}}
 +
* 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 &minus;1 and its AC.
 +
 
 +
Non-ray spells work differently. {{spell of|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 [[Magic resistance (monster)|resisted]].
  
 
== Bonus tables ==
 
== Bonus tables ==
Line 97: Line 111:
 
The [[strength]] bonus applies to [[melee]] attacks only.
 
The [[strength]] bonus applies to [[melee]] attacks only.
  
{| class="prettytable"
+
{|class="prettytable"
! Strength !! Bonus
+
!Strength !! Bonus
 
|-
 
|-
| 3 to 5 || -2
+
|3 to 5 || &minus;2
 
|-
 
|-
| 6 to 7|| -1
+
|6 to 7 || &minus;1
 
|-
 
|-
| 8 to 16 || 0
+
|8 to 16 ||0
 
|-
 
|-
| 17 to 18/50 || +1
+
|17 to 18/50 || +1
 
|-
 
|-
| 18/51 to 18/99 || +2
+
|18/51 to 18/99 || +2
 
|-
 
|-
| 18/** to 25 || +3
+
|18/** to 25 || +3
 
|}
 
|}
  
Line 117: Line 131:
 
The [[dexterity]] bonus applies to both [[melee]] and ranged attacks.
 
The [[dexterity]] bonus applies to both [[melee]] and ranged attacks.
  
{| class="prettytable"
+
{|class="prettytable"
! Dexterity !! Bonus
+
!Dexterity !! Bonus
 
|-
 
|-
| 3 || -3
+
|3 || &minus;3
 
|-
 
|-
| 4 to 5 || -2
+
|4 to 5 || &minus;2
 
|-
 
|-
| 6 to 7 || -1
+
|6 to 7 || &minus;1
 
|-
 
|-
| 8 to 14 || 0
+
|8 to 14 ||0
 
|-
 
|-
| 15 || +1
+
|15 || +1
 
|-
 
|-
| 16 || +2
+
|16 || +2
 
|-
 
|-
| 17 || +3
+
|17 || +3
 
|-
 
|-
| 18 || +4
+
|18 || +4
 
|-
 
|-
| 19 || +5
+
|19 || +5
 
|-
 
|-
| 20 || +6
+
|20 || +6
 
|-
 
|-
| 21 || +7
+
|21 || +7
 
|-
 
|-
| 22 || +8
+
|22 || +8
 
|-
 
|-
| 23 || +9
+
|23 || +9
 
|-
 
|-
| 24 || +10
+
|24 || +10
 
|-
 
|-
| 25 || +11
+
|25 || +11
 
|}
 
|}
  
Line 155: Line 169:
 
The weapon [[skill]] bonus applies to both melee and ranged attacks.
 
The weapon [[skill]] bonus applies to both melee and ranged attacks.
  
{| class="prettytable"
+
{|class="prettytable"
! Skill !! Bonus
+
!Skill !! Bonus
 
|-
 
|-
| Restricted or<br>Unskilled || -4
+
|Restricted or<br />Unskilled || &minus;4
 
|-
 
|-
| Basic || 0
+
|Basic || 0
 
|-
 
|-
| Skilled || +2
+
|Skilled || +2
 
|-
 
|-
| Expert || +3
+
|Expert || +3
 
|}
 
|}
  
=== Two weapon penalty ===
+
=== Spell skill bonus ===
  
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.
+
The spell [[skill]] bonus applies only to [[ray]] and [[beam]] attacks.
  
{| class="prettytable"
+
{|class="prettytable"
! Skill !! Penalty
+
!Skill !! Bonus
 
|-
 
|-
| Restricted or<br>Unskilled || -9
+
|Restricted or<br />Unskilled || &minus;4
 
|-
 
|-
| Basic || -7
+
|Basic ||0
 
|-
 
|-
| Skilled || -5
+
|Skilled || +2
 
|-
 
|-
| Expert || -3
+
|Expert || +3
 
|}
 
|}
  
=== Bare hands bonus ===
+
=== Two weapon penalty ===
  
The bare handed combat bonus applies when hitting in melee without any wielded item. [[Monk]]s and [[Samurai]] get the [[martial arts]] bonus; other [[role]]s get the [[bare hands]] bonus.
+
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.
  
{| class="prettytable"
+
{|class="prettytable"
! Skill !! Bare hands<br>bonus !! Martial arts<br>bonus
+
!Skill !! Penalty
 
|-
 
|-
| Unskilled   || +1 || ''(n/a)''
+
|Restricted or Unskilled || &minus;9
 
|-
 
|-
| Basic       || +1 || +3
+
|Basic || &minus;7
 
|-
 
|-
| Skilled     || +2 || +4
+
|Skilled || &minus;5
 
|-
 
|-
| Expert       || +2 || +5
+
|Expert || &minus;3
 +
|}
 +
 
 +
=== Riding penalty ===
 +
 
 +
The [[riding]] penalty applies if you are mounted on a steed, and varies based on your riding skill.
 +
 
 +
{|class="prettytable"
 +
!Skill !! Penalty
 
|-
 
|-
| Master      || +3 || +6
+
|Restricted or Unskilled || &minus;2
 
|-
 
|-
| Grand Master || +3 || +7
+
|Basic || &minus;1
 +
|-
 +
|Skilled or Expert || 0
 
|}
 
|}
  
Line 207: Line 231:
 
The monster size bonus applies to ranged attacks only.
 
The monster size bonus applies to ranged attacks only.
  
{| class="prettytable"
+
{|class="prettytable"
! Size !! Bonus
+
!Size !! Bonus
 +
|-
 +
|Tiny || &minus;2
 +
|-
 +
|Small || &minus;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. [[Monk]]s and [[Samurai]] get the [[martial arts]] bonus; other [[role]]s get the [[bare hands]] bonus.
 +
 
 +
{|class="prettytable"
 +
!Skill !! Bare hands<br />bonus !! Martial arts<br />bonus
 
|-
 
|-
| Tiny  || -2
+
|Unskilled || +1 ||''(n/a)''
 
|-
 
|-
| Small || -1
+
|Basic || +1 || +3
 
|-
 
|-
| Medium || 0
+
|Skilled || +2 || +4
 
|-
 
|-
| Large || +1
+
|Expert || +2 || +5
 
|-
 
|-
| Huge || +2
+
|Master || +3 || +6
 
|-
 
|-
| Gigantic || +5
+
|Grand Master || +3 || +7
 
|}
 
|}
  
Line 226: Line 269:
  
 
<references />
 
<references />
 
 
[[Category:Strategy]]
 
[[Category:Strategy]]
 +
{{nethack-343}}

Latest revision as of 15:52, 18 February 2024

In NetHack, when attacking a monster you must make a successful to-hit roll to actually strike it - your total to-hit must exceed the roll of 1d20, or your attack will miss.[1]

Melee

These are the factors that affect your chance of hitting in melee:

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, 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]
  • No bonus for bare hands or martial arts skill.[18]
  • A penalty if riding a steed: −2 if restricted or Unskilled in riding, −1 if Basic, and no penalty if Skilled or better.[19]
  • An additional −2 if you engage in two weapon combat while riding a steed.[20]

Monster characteristics and status

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

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:

  • −1 for all ranged attacks.[29]
  • A bonus equal to the enchantment level(s) of any rings of increase accuracy you are wearing.[30]
  • The target monster's AC.[31]
  • A bonus based on your dexterity.
  • A bonus equal to your Luck.[32]
  • A bonus equal to your experience level, if you are in your natural form.
  • A bonus equal to your monster level (hit dice) if you are polymorphed.[33]
  • A bonus based on how far away the target is. A target adjacent to you gives a +2 bonus; this decreases by 1 for each move's worth of distance, to a maximum penalty of −4.
  • −2 if you are wielding any bow while wearing gauntlets of power.
  • −3 if you are wielding any bow while wearing gauntlets of fumbling.
  • A bonus or penalty from −2 to +5 (see table), depending on the size of the target monster.
  • +2 against a sleeping monster.
  • +4 against a paralyzed monster.
  • +2 if the item used is a heavy iron ball.
  • +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 creature.[34]
  • +2 for using any spear against a "kebabable" monster: xorns, nagas, dragons, jabberwocks, and giants.[35]
  • +4 for using a trident against any swimmer that is in water.[36]
  • +2 for using a trident against any S or ; that is not in water.
  • +2 for using a pick-axe or dwarvish mattock against a xorn or earth elemental.[37]
  • The artifact's to-hit bonus, if using an artifact weapon (or artifact gem) against an appropriate target.[38]
  • +1 if you are hitting any orc as an elven hero currently in natural form, or polymorphed into an elven monster.[39]
  • If you throw any gem at a unicorn, it will always be caught.
  • If you throw your quest artifact at your quest leader, and he/she is peaceful and not paralyzed, it will be caught and returned to you.
  • −4 if you throw ammo without wielding the appropriate launcher.
  • 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: −1 if eroded, −2 if very eroded, or −3 if completely eroded.
  • The artifact's to-hit bonus, if firing appropriate ammo from an artifact launcher, against an appropriate target.
  • +1 if you are an elf or Samurai firing any arrows from any bow.
  • An additional +1 if you are an elf firing elven arrows from an elven bow.
  • An additional +1 if you are a Samurai firing ya from a yumi.
  • +4 if throwing or kicking a boomerang.
  • +2 if throwing or kicking an item that counts as a throwing weapon.
  • −2 if throwing or kicking an item that is neither a throwing weapon nor ammo.
  • A bonus or penalty from −4 to +3 (see table), depending on your skill with the thrown item, unless you throw ammo without wielding the appropriate launcher.

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.[40]
  • A bonus based on your dexterity (see dexterity table).[41]
  • 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 133: enchantment bonus for weapons
  3. weapon.c in NetHack 3.4.3, line 137: item to-hit bonus
  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_hit_bonus in weapon.c: This function is never called because uhitm.c, line 283 or uhitm.c, line 1957 checks if you're wielding something
  19. weapon.c in NetHack 3.4.3, line 1146: base riding penalty
  20. weapon.c in NetHack 3.4.3, line 1154: two weapon riding penalty
  21. uhitm.c in NetHack 3.4.3, line 236: monster AC
  22. uhitm.c in NetHack 3.4.3, line 250: monster status bonuses
  23. uhitm.c in NetHack 3.4.3, line 257: paralyzed monster bonus
  24. weapon.c in NetHack 3.4.3, line 142: blessed bonus against demons/undead
  25. weapon.c in NetHack 3.4.3, line 145: spear versus "kebabable" monster
  26. weapon.c in NetHack 3.4.3, line 149: trident versus swimmers
  27. weapon.c in NetHack 3.4.3, line 155: pick versus phasing and thick-skinned
  28. uhitm.c in NetHack 3.4.3, line 264: elves versus orcs
  29. dothrow.c in NetHack 3.4.3, line 1198: base −1 for ranged
  30. uhitm.c in NetHack 3.4.3, line 236: your to-hit bonus from rings, u.uhitinc
  31. uhitm.c in NetHack 3.4.3, line 236: monster AC
  32. uhitm.c in NetHack 3.4.3, line 236: Luck bonus
  33. uhitm.c in NetHack 3.4.3, line 237: natural and polymorphed level bonuses
  34. weapon.c in NetHack 3.4.3, line 142: blessed bonus against demons/undead
  35. weapon.c in NetHack 3.4.3, line 145: spear versus "kebabable" monster
  36. weapon.c in NetHack 3.4.3, line 149: trident versus swimmers
  37. weapon.c in NetHack 3.4.3, line 155: pick versus phasing and thick-skinned
  38. weapon.c in NetHack 3.4.3, line 164: artifact bonus
  39. dothrow.c in NetHack 3.4.3, line 1232: elves versus orcs
  40. zap.c in NetHack 3.4.3, line 2540: skill bonus
  41. zap.c in NetHack 3.4.3, line 2548: spell dexterity bonus

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

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

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