Talk:Armor class

From NetHackWiki
Revision as of 02:54, 25 January 2007 by MadDawg2552 (talk | contribs)
Jump to navigation Jump to search

The section discussing how armor class works is well intentioned, but wrong. For armor class values between 0 and 10, the game mechanics are as described in the text. However, for armor class values below 0, the mechanics are different. If your armor class is -N, then each time you are attacked, the game randomly chooses a value x between 0 and N, and your armor class for the purposes of that attack is set to -x. For example, if your armor class is -20, then each time you are attacked by a monster, the game randomly chooses a number out of the interval 0, -1, -2, -3, -4, ..., -20 and sets your armor class equal to that number. This is done independently for each attack. The other omission in the text is that an armor class of -x for that attack not only reduces the monster's to-hit value by x, but it also reduces the amount of damage that the attack inflicts by x.

Disclaimer: My knowledge of the mechanics of armor class is not from reading the source code, but rather from playing the game way too much. Djao 05:55, 24 January 2007 (UTC)

The game randomly changing your armor class is exactly the same as the game randomly changing the monter's to-hit roll. I don't know the exact mechanics, but either way it is the same thing. I don't know how AC factors into damage taken, which is why that was left out. I was just basing the information on how it was done in Dungeons & Dragons, which is the easiest way to program it in the game. Randomly changing armor class for any negative value just seems too clunky for me. --MadDawg2552 02:28, 25 January 2007 (UTC)
After looking at the source code (starting at line mhitu.c#line1560) it does seem that negative AC reduces damage done. I can't, however, find where it determines if the monster hits or not. It's got to be in there somewhere, but I can't find it. --MadDawg2552 02:54, 25 January 2007 (UTC)