Damage Cap Reference
The 2024 combat refresh replaced the old flat 30/75 limits with a class-aware ceiling implemented in
calculate_damage_cap()
. This page captures how the cap interacts with melee and spell damage so balance tweaks can
be validated quickly.
Formula
The raw cap is 150 + 6 × prime stat
, where the prime stat comes from class_table
and the value is
read from ch->perm_stat
. Buffs that only modify mod_stat
(giant strength, curse, etc.) currently do not
influence the limit.【F:src/fight.c†L950-L975】【F:src/const.c†L640-L659】
Class | Prime stat | Cap @ 25 stat |
---|---|---|
Warrior | Strength | 300 |
Cleric | Wisdom | 300 |
Mage | Intelligence | 300 |
Thief | Dexterity | 300 |
What counts toward the cap
- Melee swings: Weapon dice, shieldless bonuses, enhanced damage, positional multipliers, critical strike, and damroll are accumulated before clamping.【F:src/fight.c†L769-L867】
- Spell packets & procs: Every call into
damage()
is capped, including spells, breath weapons, and weapon elemental flags. Divine strike is the only override, forcing the damage tovictim->hit / 3
after immunity checks.【F:src/fight.c†L950-L1113】【F:src/effects.c†L188-L304】 - Damroll contribution:
GET_DAMROLL
adds strength-based bonuses on top of equipment damroll before the cap evaluation.【F:src/merc.h†L2493-L2496】
After the clamp
- Resists/vulnerabilities: Immunity zeroes the hit, resistance trims one third, and vulnerability adds one third before the value is subtracted from hit points.【F:src/fight.c†L1094-L1113】
- Saving throws: If the effect allows a save, the damage is halved or negated after the clamp according to
the individual spell logic. Save chances follow the
saves_spell()
formula outlined in the combat primer.【F:src/magic.c†L203-L220】 - Multi-hit throughput: Because the cap is enforced per packet, haste, second/third attack, and dual wield increase DPS by giving more opportunities to reach the ceiling within a round.【F:src/fight.c†L404-L520】【F:src/fight.c†L950-L1113】
Tuning tips
- Raising the base 150 value or per-point multiplier affects all classes. To tweak a single class, adjust either its prime stat weight or the stat itself.
- If buffs should extend the cap, change
calculate_damage_cap()
to useget_curr_stat()
instead ofperm_stat
and update Known Issues accordingly.【F:src/fight.c†L950-L975】 - Area spells with large dice may need bespoke exemptions if the global cap keeps them from landing expected burst.