adventure: T6 Amendment (Custodian) + in-combat round-end boss seam (P8)

First in-combat Layer-2 mechanic. applyBossInCombatRoundEnd is a new
round-boundary seam called from the turn engine's stepRoundEnd, the
counterpart to the pre-combat applyBossRunModifiers. The Custodian snapshots
its HP at end of round 3 and rewinds to it once on the phase-2 crossing
(refunding front-loaded burst); a soft midnight timer past round 20 climbs
its Attack via the existing enemyAtkBuff. New state (EnemyRewindHP/Used)
round-trips through CombatStatuses so a suspend/resume can't replay the
rewind. Sim A/B (n=120 L20 party): last_meridian fighter 65->37.5% clear,
a clean -27.5pp swing attributable to the mechanic; shipped as-is per the
opt-in-endgame difficulty call.

Claude-Session: https://claude.ai/code/session_0156WqjgsbmSY2U8eQ3Kkb1s
This commit is contained in:
prosolis
2026-07-16 09:20:29 -07:00
parent db13ed75b9
commit 189a44e1eb
6 changed files with 323 additions and 12 deletions

View File

@@ -443,6 +443,15 @@ type combatState struct {
enemyFearImmune bool // fear_immune: player control spells (enemy-skip) fizzle against this enemy
enemyAtkBuff int // ally_buff: flat, accumulating bonus to the enemy's attack damage
// Amendment (T6 Custodian) — an in-combat Layer-2 hook resolved at round end
// by applyBossInCombatRoundEnd. enemyRewindHP is the boss's round-3 HP
// snapshot (0 until captured); enemyRewindUsed gates the once-only rewind
// that restores it to that snapshot when the boss crosses into phase 2. The
// soft midnight timer past round 20 rides enemyAtkBuff. Round-tripped through
// CombatStatuses; zero/false for every non-Custodian fight.
enemyRewindHP int
enemyRewindUsed bool
round int
events []CombatEvent