How do monsters in NetHack attack?

[BACK]
How do monsters in NetHack attack?
Posted On: April 25, 2024

There is much information about how the player attacks (or attempts to attack) in the weapon spoiler. But there is no information on how monsters attack.


How is the monsters value of to-Hit* calculated?


*) alias 'chance to hit' or 'toHit'.


The damage and effects of successful hits is described in the monster spoiler from the spoiler page.


Question from user Martin Frank at gaming.stackexchange.com.


Answer:

The to-hit formula is covered in detail on the wiki's Armor Class page. The source ref for much of this is in mhitu.c.


I'll summarize the to-hit; there are a lot of special cases based on visibility, attack type, situation, and consecutive monster attacks.


The basic formula is: 10 + AC + Level, where "AC" is the player's current AC (i.e. Armor Class - it is lowered primarily by equipping armor; lower is better), and Level is the monster level of the attacker. This value is compared against a random number between 1 and 20; if the roll is lower than this formula, the attack hits.


If the player's AC is below 0, it is instead treated as a random number between -1 and their displayed AC. Lower AC is always better, but even at -100 AC it is possible to get a very unlucky roll and still get hit.


The wiki includes tables showing statistically expected damage for differing armor class values from various attackers; this can give a general idea of how much AC protects you, but this also includes the damage resistance from having negative AC.


Answer from user qazmlpok at gaming.stackexchange.com.


[BACK]
How do monsters in NetHack attack?
Posted On: April 25, 2024

There is much information about how the player attacks (or attempts to attack) in the weapon spoiler. But there is no information on how monsters attack.


How is the monsters value of to-Hit* calculated?


*) alias 'chance to hit' or 'toHit'.


The damage and effects of successful hits is described in the monster spoiler from the spoiler page.


Question from user Martin Frank at gaming.stackexchange.com.


Answer:

The to-hit formula is covered in detail on the wiki's Armor Class page. The source ref for much of this is in mhitu.c.


I'll summarize the to-hit; there are a lot of special cases based on visibility, attack type, situation, and consecutive monster attacks.


The basic formula is: 10 + AC + Level, where "AC" is the player's current AC (i.e. Armor Class - it is lowered primarily by equipping armor; lower is better), and Level is the monster level of the attacker. This value is compared against a random number between 1 and 20; if the roll is lower than this formula, the attack hits.


If the player's AC is below 0, it is instead treated as a random number between -1 and their displayed AC. Lower AC is always better, but even at -100 AC it is possible to get a very unlucky roll and still get hit.


The wiki includes tables showing statistically expected damage for differing armor class values from various attackers; this can give a general idea of how much AC protects you, but this also includes the damage resistance from having negative AC.


Answer from user qazmlpok at gaming.stackexchange.com.


[BACK]

What are the upgrade paths for the academy? What are the upgrade paths for the academy?

Posted On: January 24, 2023
The academy only shows what unit type it upgrades to for existing units already in the army, and only if you've already unlocked the correct race and level upgrades. Can anyone provide or link to a di...[More]


How do I kill these spiders in Hogwarts Legacy? How do I kill these spiders in Hogwarts Legacy?

Posted On: August 20, 2023
I’m trying to make my way to jackdaws rest. I’m going through the forbidden forest. And these spiders I keep running into seem to be impossible to beat with my noob status. Like they keep ...[More]


In what way is super mario advance 2 less difficult than the original game? In what way is super mario advance 2 less difficult than the original game?

Posted On: March 2, 2024
The Wikipedia article for Super Mario World states that the Gameboy Advance version (Super Mario Advance 2) has a 'toned down difficulty' compared to the original game. However, I am curious as to how...[More]


Lae'Zel death Lae'Zel death

Posted On: March 15, 2026
Acabei de eliminar os membros da Absolute na ponte, aqueles com o dragão e que matam mercenários com o Punho Flamejante, mas quando fui verificar os corpos, Lae'zel estava morta entre eles, e eu nem...[More]


How to pick up the walkie talkie in Walking Dead Season 2: Episode 3? How to pick up the walkie talkie in Walking Dead Season 2: Episode 3?

Posted On: March 25, 2023
I am stuck at the quick time event where Clem has to pick up the walkie talkie. I see two brackets moving towards each other, yet I forgot what to do for those quick time events. How to pick up the...[More]


Is it possible to play Prop Hunt in GMod without CS:S? Is it possible to play Prop Hunt in GMod without CS:S?

Posted On: July 5, 2023
I've got GMod and just about every mainstream Valve game excepting CS:S. I'd like to play Prop Hunt, a GMod game mode. Is it possible to play Prop Hunt without CS:S, possibly by obtaining t...[More]


Haunted Hogsmede - Minding Your Own Business Haunted Hogsmede - Minding Your Own Business

Posted On: June 7, 2023
Am I the only one who found this incredibly difficult?. Maybe it was because I was on edge the whole time, but I feel like this is definitely the hardest quest I've done so far. I can't ...[More]


Does Bozai show up before defeating Vah Naboris? Does Bozai show up before defeating Vah Naboris?

Posted On: June 13, 2023
Bozai is the NPC in BOTW that gives the player snow and sand boots. I am searching for him around the outskirts of Gerudo Town and I can not find him. I have also looked at the tent he would sit in. T...[More]


How long do I need to survive on the Hyperbolica rocket skis? How long do I need to survive on the Hyperbolica rocket skis?

Posted On: May 9, 2023
In the Frosted Fields there is an inventor who created a pair of rocket skis. They ask you to prove the rocket skis are safe by testing them and surviving until they run out of fuel. How long do I ...[More]


Can someone tell me what is wrong with my game in Hogwarts Legacy? Can someone tell me what is wrong with my game in Hogwarts Legacy?

Posted On: May 21, 2023
I’ve tried most of the settings and the game is still very laggy when trying to talk or do anything. . Also nightmare fuel graphics. AlL NPC/ characters look like this. Question from user ...[More]