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 game is this music from? What game is this music from?

Posted On: September 2, 2023
I was watching some funny Garry's Mod Idiot Box episodes on YouTube. In episode 3 at 5:41 is a scene that has some music being played in the background. What game is from? It sounds so familiar to...[More]


In Tears of the Kingdom is there a workaround for using an Amiibo more than once per day? In Tears of the Kingdom is there a workaround for using an Amiibo more than once per day?

Posted On: May 13, 2023
Each unique amiibo unlock random loot, but can only be used once every 24 hours in The Legend of Zelda: Tears of the Kingdom. If you try and exceed the limit you will receive the message “This a...[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]


What happens if you dont found a religion? What happens if you dont found a religion?

Posted On: March 18, 2024
Suppose the other civilizations have founded all the religions that could be founded in that map (that never happened to me, but I'm curious, but not curious enough to spend a night doing an experimen...[More]


Anyone else disturbed by Sebastian using imperio on a goblin to make it kill itself? Anyone else disturbed by Sebastian using imperio on a goblin to make it kill itself?

Posted On: August 31, 2023
I'm not usually one for trigger warnings on things, but this was a lot for me. I figured Sebastian would just kill it, but when he forced it to kill itself, it changed the entire tone of the game ...[More]


Not letting me pick up these blue things in Hogwarts Legacy Not letting me pick up these blue things in Hogwarts Legacy

Posted On: July 30, 2023
i walk over them and nothing happens. i think it’s supposed to be picking up XP but they just disappear. playing on ps4, i have tried restarting the game. Question from user xWolfy012x at Hog...[More]


Does leaving the car on use up fuel? Does leaving the car on use up fuel?

Posted On: March 3, 2024
In Pacific Drive, when I put the car in park I can exit the car without turning off the engine. Does leaving the engine turned on use up fuel if the car isn't moving?Question from user Stevoisiak at g...[More]


Is it possible to max out both health and stamina in ToTK? Is it possible to max out both health and stamina in ToTK?

Posted On: May 16, 2023
In Breath of the Wild, there were only enough Spirit Orbs to obtain max health or max stamina, but you couldn't max out both (without using buffs that is). During the intro sequence of Tears of th...[More]


How can I show the map layer ui? How can I show the map layer ui?

Posted On: October 20, 2023
With the release of version 4.0 layered maps are now in the game, allowing you to swap between surface level and lower levels. When you select something 'underground' the layers map ui is s...[More]


Can a redstone latch in Minecraft Bedrock Edition be supplemented with a toggle function? Can a redstone latch in Minecraft Bedrock Edition be supplemented with a toggle function?

Posted On: April 3, 2023
SR latches and T-flip-flops are trivial circuitry in Minecraft redstone, but it appears that there is little to be found for a circuit that combines both, allowing for both SR and T functionality. ...[More]