Commit Graph

2 Commits

Author SHA1 Message Date
Brian Fertig 87e6b8f28b refactor(combat): restructure pre-battle phases and implement Xeno mechanics
Reorganize the combat turn sequence to handle Venom, Carapace, and Molt effects within the `_preBattlePhase`. This ensures damage and stat changes occur before buffs and attacks, allowing for accurate pre-attack animations and logic.

Key changes:
- **CombatEngine.js**:
  - Extracted `_moltPhase` and `_tryCarapace` to handle armor gain and HP conversion separately from the main attack loop.
  - Moved Venom and Molt execution to `_preBattlePhase` to run before `_commanderSkillPhase` and `_attackPhase`.
  - Updated pre-attack logic to capture `carapaceGain` for animation purposes without emitting duplicate events.
  - Added `moltRestore` logic to regenerate a fresh shell for attackers before they strike.
- **SkillProcessor.js**:
  - Adjusted `venom` skill logic to update stacks only if the target is below the new value, preventing redundant updates.
- **BattleScene.js**:
  - Updated event filtering and animation pipelines to handle `venomTick`, `carapace`, and `molt` events during the pre-battle sequence.
  - Added visual effects (sprites 27-31) and tween animations for Venom application, Carapace hardening, and Molt shedding/restoration.
  - Implemented `_restoreMoltForDisplay` and `_reapplyMolt` to ensure the UI renders pre-combat states correctly before animating changes.
- **CardManager.js**:
  - Added `baseArmor` tracking to support Carapace cap calculations.
- **Data**:
  - Updated `missions.json` to refine Xeno enemy lineups for missions 014 through 020.
  - Updated Xeno card assets and UI images.
2026-03-20 21:52:34 -06:00
Brian Fertig 0f1db0884c Campaign 3 2026-03-17 14:22:15 -06:00