---
name: boss-phase-transition
description: Design multi-phase boss fights for roguelike deckbuilders, RPGs, and action games that keep second-half tension high without frustrating players: one-shot HP threshold gates (if hp <= threshold && !transformed) plus hard phase-boundary HP clamps on multi-phase final bosses (e.g. 148 HP -> 96 -> 45 clamp prevents a -70 burst from skipping Phase 2), shield-and-damage rewards with strictly zero boss HP healing (+6/+8/+10/+12 temporary shield instead of refilling HP), and moveset upgrades (more hits 4x2->4x3, heavier blows 14->17, faster tempo) that split one long battle into two climax acts.
---

# Boss Half-HP Phase Transition & Hard Phase-Lock Contract

Half-HP boss transformations are **not** designed to torture players — they exist to kill second-half combat fatigue once the player's build comes online. Great boss design slices one long predictable fight into two (or three) shorter fights, each with its own climax.

## 1. The 3 Mandatory Rules (Extracted from *Zhaoshi Wulin*)

1. **Rule 01 — One-Shot Threshold Gate + Hard Phase-Boundary HP Clamp**:
   - Trigger strictly once per phase using an explicit guard:
     ```ts
     if (hp <= threshold && !triggeredPhases.has(nextPhase)) {
       triggeredPhases.add(nextPhase);
       enterPhase(nextPhase);
     }
     ```
   - Regular bosses trigger at exact 50% HP (`42/84`, `45/90`, `58/116`, `56/112`).
   - Multi-phase final bosses (e.g. 3-phase *Grandmaster Cangfeng* `148 HP` with gates at `96` and `45`) apply a **hard HP floor clamp** on single-hit overflow (`if (prevHp > 45 && rawNextHp < 45) nextHp = 45`) so a massive `-70` burst from `100 HP` stops cleanly at `45 HP` instead of skipping Phase 2.

2. **Rule 02 — Grant Temporary Shield + Permanent Damage Buff, NEVER Heal the Boss**:
   - On transition, grant an immediate temporary **Shield** (`+6`, `+8`, `+10` P2, `+12` P3) and escalate offensive pressure.
   - **Hard Anti-Pattern**: Never restore boss HP on phase shift. Healing erases the player's hard-won damage progress and triggers instant frustration; temporary Shield restores tactical urgency while respecting every HP point already shaved off.

3. **Rule 03 — Upgrade the Moveset to Force Tactical Adaptation**:
   - A solution that solved Phase 1 must no longer autopilot Phase 2. Pick one clear escalation axis per boss:
     - **Heavier Blows**: *Raging Bull Brawler* upgrades Heavy Fist `14 -> 17` (`+3` permanent).
     - **More Hits**: *Bandit Chieftain* upgrades Flurry `4×2 -> 4×3` (punishes flat per-hit weak points / single-hit blocks).
     - **Faster Tempo**: *Palm Grandmaster* upgrades Heavy Palm `15 -> 17` and accelerates Rapid Palm to `4×3`.

## 2. Verification Checklist
- [ ] Phase transition fires strictly once per threshold (`!triggeredPhases.has(phase)`) — never re-fires if HP fluctuates.
- [ ] Multi-phase final boss clamps massive single-hit overflow cleanly at the phase floor (e.g. `100 - 70 -> 45 HP`).
- [ ] Boss HP never increases on phase transition (`bossHeal === 0`); tension comes strictly from temporary Shield + upgraded intent.
- [ ] Phase 2+ visibly changes the enemy's telegraph/intent (more hits, heavier single blow, or faster cadence).
