Commit Graph

3 Commits

Author SHA1 Message Date
Brian Fertig 031264bbb9 feat: Implement Siege mechanic and add Fullscreen toggle
- **Combat Logic**: Changed `siege` skill trigger from `on_attack` to `preBattle`.
- **Engine Updates**: Modified `_collectPreBattleBuffs` (renamed to `_collectPreBattleFires`) in `CombatEngine.js` to capture and log siege damage events separately from buffs.
- **Skill Processor**: Updated `SkillProcessor.js` to record `siegeTarget` and `siegeDamage` in the context for event logging.
- **Data Updates**: Adjusted descriptions and triggers in `cards.json` and `skills.json`.
- **UI**: Added a "Toggle Fullscreen" button to the Main Menu with state-aware labeling.
2026-03-13 17:08:30 -06:00
Brian Fertig a17adba1e9 feat(combat): implement pre-battle buffs and pre-attack skill animations
- Updated `cards.json` and `skills.json` to define `preBattle` (Rally) and `preAttack` (Strike, Mortar) triggers with new descriptions.
- Added `_preBattlePhase` in `CombatEngine.js` to process Rally skills before combat, tracking temporary buffs on cards.
- Added `_postBattlePhase` to remove temporary buffs after combat resolves, ensuring stat changes are cleared for the next turn.
- Modified `SkillProcessor.js` to handle `Strike`, `Mortar`, and `Rally` logic with context data for animation targets and damage values.
- Implemented `_onPreAttackStep` in `BattleScene.js` to sequence animations before the main attack:
  - `_animateMortarFire`: Flies a mortar shell in an arc, explodes on impact, and handles HP loss/death.
  - `_animateStrikeFire`: Launches a missile at the opposing lane/commander with similar impact effects.
  - `_animateRallyBuff`: Animates a flag flying between cards to visualize ATK gains.
- Updated `CardObject.js` `animateHPLoss` to accept explicit `fromHP`/`toHP` arguments, ensuring correct display values during multi-step damage sequences.
- Added `_playSkillExplosion` for consistent impact visual effects during skill resolution.
- Adjusted attack flow to pause for pre-attack animations before the standard card clash sequence.
2026-03-13 15:45:57 -06:00
Brian Fertig 73ce826100 refactor(combat): change Berserk trigger to on_attack with animated gain
- Updated `cards.json` and `skills.json` to trigger Berserk on damage dealt (`on_attack`) instead of on kill, adjusting descriptions accordingly.
- Modified `CombatEngine.js` to emit a `berserk` event after successful attacks and removed the previous kill-based logic.
- Enhanced `SkillProcessor.js` to apply Berserk attack power gains only when damage is dealt during an attack.
- Added `animateBerserkGain` in `CardObject.js` to visually display the ATK increase with scaling, a "+N" label, and smooth transitions.
- Overhauled `_animateAttack` in `BattleScene.js`:
  - Cards now slide to the center and scale up during attacks, then return to their original positions.
  - Added a "VS" image that appears between cards during the clash.
  - Synchronized particle bursts, shakes, and damage numbers with the new centered animation timing.
  - Integrated Berserk gain animation into the attack flow, rewinding ATK text before animating the increase.
- Added `vs.png` asset loading in `BootScene.js`.
2026-03-13 09:32:55 -06:00