Commit Graph

6 Commits

Author SHA1 Message Date
Brian Fertig c7f4dc9bbb feat(combat): implement alternating initiative with enhanced attack animations
- Added `playerGoesFirst` state to `CombatEngine` to alternate turn order each round.
- Updated `beginTurn` and `beginCommit` to handle AI deployment based on the current initiative (opponent deploys first if they have initiative, otherwise after the player).
- Modified `_buildPendingAttacks` to respect the alternating attack order.
- Added `animateHPLoss` to `CardObject.js` for a visual HP reduction animation similar to the Berserk gain effect.
- Enhanced `_animateAttack` in `BattleScene.js`:
  - Integrated sprite animations for attacks (gun turret) and explosions using new spritesheets.
  - Synchronized HP loss and Berserk gain animations with the attack sprite completion.
  - Added an "Attacks First" indicator icon next to the commander of the side with initiative.
- Updated `BootScene.js` to load the new `attacksFirst` UI image and `attacks` spritesheet.
2026-03-13 10:31:09 -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 5e0d17b2c4 feat(ui): add card art assets and dynamic image rendering
- Add PNG artwork assets for Imperial and Raider faction cards (commanders and units).
- Update `BootScene` to dynamically load card images based on `artKey` entries in `cards.json`.
- Refactor `CardObject` to render the loaded image over a faction-colored backing, falling back gracefully if the texture is missing.
- Replace the previous solid background rectangle with a transparent red overlay (`.bg`) for the attack flash animation, ensuring art remains visible during impacts.
2026-03-12 20:21:26 -06:00
Brian Fertig fc20545364 refactor(ui): unify card rendering with CardObject and remove HealthBar dependency
- Completely rewrite `CardObject` to use a structured layout: top banner (ATK/ARM), 16:9 image area, content section (name/skills), and bottom banner (HP/DLY).
- Remove the `HealthBar` class dependency; HP is now displayed as text within the card's bottom banner.
- Update `BattleScene` to use `CardObject` for Commander displays, ensuring visual consistency with lane cards and simplifying state updates via `.refresh()`.
- Refactor the card picker UI to instantiate actual `CardObjects` instead of manual rectangles/text, adding hover scale effects for better interactivity.
2026-03-12 18:02:47 -06:00
Brian Fertig b9ee2b5aea refactor(combat): split turn into begin/commit phases with animated card picker
- Split CombatEngine.stepTurn() into beginTurn() (draw + AI deploy) and commitPlayerDeploy() (player choice + combat resolution).
- Add a card picker UI in BattleScene for player deployment, with pass option.
- Implement phased animations: deploy scale-in, sequential attack sequences with enlarged cards, particle bursts, shake/flash on defender, and floating damage numbers.
- Update CardObject to scale fonts/layout with card size and show ATK/HP/ARM/DLY stats plus skills text.
- Adjust battlefield layout constants (lane positions/commander column) and UI button placements for the new flow.
2026-03-12 17:11:17 -06:00
Brian Fertig 1a28234859 initial commit 2026-03-12 16:36:32 -06:00