Commit Graph

4 Commits

Author SHA1 Message Date
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
Brian Fertig d865634a2f refactor(data): rebalance card stats and update starter deck composition
- Significantly increase HP values across all Imperial and Raider cards to extend combat duration and emphasize defense mechanics.
- Adjust armor values on select units (e.g., Raider Berserker, Marauder) to better match their roles.
- Reformat `cards.json` skills into expanded multi-line objects for improved readability and maintainability.
- Update the default starter deck in `DeckManager` to a more focused composition: 4x Trooper, 3x Gunner, 3x Guardian.
- Reduce starting gold in `SaveManager` from 1500 to 400 to better align with the new economic balance.
2026-03-12 20:49:15 -06:00
Brian Fertig 1a28234859 initial commit 2026-03-12 16:36:32 -06:00