feat: implement golemancy combat system (spec §6, §9)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s

- Add ActiveGolem interface and activeGolems to GolemancyState
- Add maxRoomDuration to all 12 golem definitions
- Create golem-combat-actions.ts with pure golem combat logic (summoning, maintenance, attacks, room-duration)
- Create golem-combat.ts pipeline for golem combat setup
- Wire golem maintenance and attacks into processCombatTick
- Wire golem summoning into advanceRoomOrFloor on room entry
- Wire golem room-duration countdown into onFloorCleared callback
- Update combat-actions tests for new processCombatTick signature
- All 921 tests pass, all files under 400-line limit

Closes #259
This commit is contained in:
2026-06-03 15:40:39 +02:00
parent 7c0e740226
commit a2cdf6d21c
20 changed files with 583 additions and 41 deletions
@@ -7,6 +7,7 @@ import { getGuardianForFloor } from '../../data/guardian-encounters';
import { hasSpecial, SPECIAL_EFFECTS } from '../../effects/special-effects';
import type { ComputedEffects } from '../../effects/upgrade-effects.types';
import type { EnemyState } from '../../types';
import { countdownGolemRoomDuration } from '../golem-combat-actions';
// ─── Enemy Defense Context ────────────────────────────────────────────────────
// Snapshot of the current tick's enemy defense state, captured once per tick
@@ -55,6 +56,19 @@ export function buildCombatCallbacks(params: BuildCombatCallbacksParams) {
params.addLog('Floor ' + floor + ' cleared!');
}
useCombatStore.setState({ guardianShield: 0, guardianShieldMax: 0, guardianBarrier: 0, guardianBarrierMax: 0 });
// ── Golem room-duration countdown (spec §9.6) ──────────────────────
const cs = useCombatStore.getState();
const activeGolems = cs.golemancy?.activeGolems ?? [];
if (activeGolems.length > 0) {
const result = countdownGolemRoomDuration(activeGolems);
if (result.logMessages.length > 0) {
result.logMessages.forEach((msg) => params.addLog(msg));
}
useCombatStore.setState({
golemancy: { ...cs.golemancy, activeGolems: result.remainingGolems },
});
}
};
/** Mage barrier recharge rate (spec §5.2): 5% per tick */