fix: add curse amplification to applyEnemyDefenses (spec §6.3)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s

The curse debuff was stored on enemies via dot-runtime.ts but the
amplification was never applied to incoming damage. Added curse
magnitude check in applyEnemyDefenses (combat-tick.ts) that multiplies
incoming damage by (1 + magnitude) for each active curse effect.

- Curse amplification applied BEFORE dodge/barrier/armse defenses
- Multiple curse effects stack multiplicatively
- Non-curse effects (burn, freeze, etc.) are ignored for amplification

Also updated spire-combat-spec.md Known Gaps table to reflect:
- Melee defense bypass fixed (issue #285)
- Curse amplification now implemented (issue #286)

Added 9 regression tests in curse-amplification.test.ts.

All 957 tests pass (50 test files).
This commit is contained in:
2026-06-06 17:46:39 +02:00
parent 325949cc5f
commit bd15df85ff
6 changed files with 158 additions and 7 deletions
@@ -65,6 +65,17 @@ export function applyEnemyDefenses(
): number {
if (!enemy) return dmg;
// 0. Curse amplification (spec §6.3) — amplifies all incoming damage
let curseMult = 1;
for (const effect of enemy.activeEffects) {
if (effect.type === 'curse') {
curseMult *= (1 + effect.magnitude);
}
}
if (curseMult > 1) {
dmg *= curseMult;
}
// 1. Dodge check (spec §5.2, §4.5)
let effectiveDodge = enemy.dodgeChance;
if (roomType === 'speed') {