Armor is tracked per damage type in the armor[4] array on every character, and GET_AC adds the current Dexterity-based defensive bonus whenever the target is awake.【F:src/merc.h†L1846-L1853】【F:src/merc.h†L2478-L2481】
When a character is reset, all four armor slots start at 100, equipment and affects are removed, and the recalculation begins from a neutral baseline.【F:src/handler.c†L547-L553】
A lower numeric armor class is better: worn armor subtracts its protection from the running total, so defensive gear drives the values below 100 (and potentially into the negatives).【F:src/handler.c†L560-L566】【F:src/handler.c†L2014-L2016】
Building armor class
Each armor item contributes a base value per damage type that is multiplied by a slot-specific factor (for example: body ×3, head/legs ×2, cloak ×2, most others ×1) before being subtracted from the character’s armor array.【F:src/handler.c†L1930-L1963】
Any object or spell effect with APPLY_AC adds its modifier to every entry in the armor array, allowing non-armor items and magical buffs/debuffs to influence all four damage types simultaneously.【F:src/handler.c†L599-L629】【F:src/handler.c†L707-L737】
After armor, spell, and item modifiers are applied, the GET_AC macro folds in the defender’s Dexterity defensive adjustment whenever they are conscious, reflecting agile characters avoiding blows more effectively.【F:src/merc.h†L2478-L2481】
How armor class influences attacks
During one_hit, the game reads the relevant armor entry for the damage type, divides it by ten, and compares that value against the attacker’s THAC0 calculation; extremely low armor values (below −150) experience diminishing returns via (victim_ac + 15) / 5 - 15.【F:src/fight.c†L632-L677】
Visibility and posture also shift the effective armor check: unseen defenders gain −4 AC (harder to hit), while sitting/resting characters suffer +4/+6 penalties, respectively.【F:src/fight.c†L679-L688】
Every attack roll uses the adjusted armor class to determine hits versus misses, so equipment changes, spell effects, and Dexterity shifts immediately alter combat outcomes.【F:src/fight.c†L620-L694】【F:src/handler.c†L599-L737】
Key takeaways
Armor values start neutral at 100 and are pushed downward by worn gear, global APPLY_AC modifiers, and Dexterity, making more negative numbers strictly better in combat.【F:src/handler.c†L547-L566】【F:src/merc.h†L2478-L2481】
Slot multipliers mean that chest, head, leg, and cloak items provide outsized protection compared to single-weight slots, so optimizing those locations yields the largest defensive gains.【F:src/handler.c†L1930-L1952】
Attack resolution always references the appropriate damage-type armor value, so diversifying gear to cover pierce, bash, slash, and exotic threats is essential for consistent mitigation.【F:src/fight.c†L632-L671】