Commit Graph

15 Commits

Author SHA1 Message Date
Brian Fertig 69df7c5793 chore: update Righteous campaign missions and enhance ability animations
- Updated `data/missions.json` to increase difficulty in Chapter 4:
  - Expanded enemy card pools with higher-tier units (Templars, Purifiers, Prophets, Archangels, Seraphs).
  - Increased gold rewards for missions 022 through 028.
  - Updated mission descriptions and lore to reflect the escalation.

- Enhanced `src/scenes/BattleScene.js` animations for Righteous abilities:
  - Refactored `smite` animations to use new sprite frames (38, 39) and split cast/damage logic.
  - Updated `overcharge` to use sprite 40/41 with pulse effects and integrated HP loss/ATK gain animations.
  - Updated `fortify` to use sprite 37 with projectile travel and pulse effects, integrating armor gain animation.
  - Updated `hack` to use sprite 42 with a 3-cycle pulse before executing copied skills.

- Added new audio assets:
  - `fortify.mp3`, `hack.mp3`, `overcharge.mp3`, `smite-cast.mp3`, `smite-damage.mp3`.
- Updated `src/scenes/BootScene.js` to load the new audio files and removed deprecated smite sounds.
- Updated `assets/images/spritesheets/attacks.png` and `.psd` to include new animation frames.
2026-03-21 18:45:15 -06:00
Brian Fertig 77bbef1e5b Campaign 4 2026-03-21 15:07:09 -06:00
Brian Fertig ad4db7f541 feat(combat): implement pre-battle healing with animations and audio
Moves the `heal` skill trigger from `on_attack` to `preBattle`, allowing cards to restore HP before combat begins. Updates `data/cards.json` to reflect new skill configurations (changing `strike`/`armored` to `swipe`/`heal` for specific cards).

Changes include:
- **Data**: Updated `skills.json` descriptions and triggers. Modified `cards.json` to use the new `heal` skill with `preBattle` trigger.
- **Engine**: Refactored `CombatEngine` to collect `healFires` during pre-battle processing and removed legacy `healAll` event logic from the attack phase.
- **Logic**: Updated `SkillProcessor` to track heal targets and amounts in the context for animation purposes.
- **Visuals**: Added `sfx_heal` audio asset and implemented new animation sequences in `BattleScene` (`_processHealFires`, `_animateHealFire`, `_doHealSpriteAndHP`) featuring flying sprites, HP text pulses, and floating damage numbers.
- **State Management**: Added `_restoreHealForDisplay` and `_reapplyHeal` to handle state snapshots correctly during the pre-battle render phase.
2026-03-21 12:32:21 -06:00
Brian Fertig 35e995aff1 feat(xeno): add faction assets, skills, and combat mechanics
Introduces the Xeno faction with new commanders, units, and mechanics.
- Adds audio SFX for skills: `bloodpact`, `burrow`, `carapace`, `hive_link`,
  `molt-stage1`, `molt-stage2`, `swarm`, `venom-apply`, `venom-effect`.
- Adds Xeno card data to `cards.json` (commanders, assault, token units).
- Updates `skills.json`: changes `swarm` trigger from `preBattle` to `preAttack`.
- Implements combat logic in `CombatEngine.js`:
  - New `_burrowPhase` to decrement burrow stacks post-battle.
  - Burrowed units now take half damage from direct attacks.
  - Venom kills now trigger `on_death` and `hive_link` events.
  - `swarm` buff now applies in `preAttack` and reverts in `postAttack`.
- Updates `CardObject.js`: replaces burrow overlay with a stack-count badge.
- Updates `BattleScene.js`:
  - Animations for `swarm` surge/revert, `hive_link` pulses, `venom` ticks,
    `carapace`, `molt`, and `burrow` ticks.
  - Chains `hive_link` animations immediately after death explosions.
  - Adds SFX playback for all new skill effects.
2026-03-21 10:12:10 -06:00
Brian Fertig fc5babf5a3 refactor(combat): move Bloodrage and Legion to preBattle phase with animations
- Updated `data/cards.json` to change triggers for Bloodrage from `passive` to `preBattle`, and renamed Strike skills to Legion with `preBattle` trigger.
- Refactored `CombatEngine.js` and `SkillProcessor.js`:
  - Removed ad-hoc event pushing for Bloodrage during the attack phase.
  - Moved Legion and Bloodrage processing into the `_preBattlePhase` to generate buff events that are animated before combat resolves.
  - Added logic to track temporary buffs in `_tempBuffs` for Legion.
- Enhanced `BattleScene.js`:
  - Implemented new animations for Legion (cycling flexing arm sprite) and Bloodrage (pulsing red sprite).
  - Added support for restoring and re-applying Drain effects during the pre-battle display phase to ensure correct visual state before animation.
  - Updated sound loading in `BootScene.js` for new `legion` and `bloodrage` effects.
2026-03-15 21:55:36 -06:00
Brian Fertig c4e967c72c feat(ui): add custom fonts and apply Audiowide/RaiderCrusader across all scenes
- Add `Audiowide-Regular.ttf` and `raidercrusader.ttf` to assets/fonts.
- Update Phaser version to v3.90.0 in index.html.
- Load custom fonts in BootScene.preload().
- Apply `fontFamily: 'Audiowide'` to standard UI text (stats, labels, menus).
- Apply `fontFamily: 'RaiderCrusader'` to prominent titles and large display text (main menu, victory/defeat, pack labels).
- Consistently update text styles in CardObject, CardTooltip, HealthBar, and all scene files.
2026-03-15 13:57:59 -06:00
Brian Fertig d6682baa66 feat: Add Bloodthirsty faction campaign with new cards, skills, and animations
- Added 13 new Bloodthirsty cards (common to legendary) including Countess Vireska commander
- Implemented 4 new skills: siphon, drain, bloodpact, and bloodrage with full combat engine support
- Created Chapter 2 campaign (8 missions) with progressive difficulty and unique lore entries
- Added corresponding audio effects (bloodrage.mp3, drain.mp3, siphon.mp3) and card art assets
- Implemented visual animations for all new skills:
  - Drain: projectile to primary target + splash damage to neighbors + green heal return particles
  - Siphon: blood-red projectile with glow effect that heals attacker
  - Bloodpact: red flash for HP loss followed by ATK gain animation (handles self-destruction)
  - Bloodrage: red pulse and ATK boost display when below 50% HP
- Updated CombatEngine to handle preBattle death checks (bloodpact can kill cards immediately)
- Modified BattleScene to sequence new skill animations within the combat flow
2026-03-14 21:56:19 -06:00
Brian Fertig 19e743c6f9 feat(combat): implement "Swipe" skill with sequential multi-target animation
- **Combat Logic**: Refactored `swipe` to trigger on `preAttack`, dealing damage to all enemy cards and the commander while ignoring armor. Updated `data/skills.json` and card definitions in `data/cards.json` accordingly.
- **Animation**: Added `_animateSwipeSequence` in `BattleScene.js`. The animation spawns a rotating sprite (index 20) that flies sequentially to each target, playing impact sounds (`sfx_swipe_02`) and triggering HP loss/death animations per target.
- **Assets**: Added new audio files (`swipe_01.mp3`, `swipe_02.mp3`) and UI images for factions (`bloodthirsty`, `imperial`, `raider`). Updated the attack spritesheet.
- **Collection Scene**: Overhauled `CollectionScene.js` with a modern UI featuring:
  - Filterable, scrollable card grid with hover tilt effects.
  - Interactive card selection showing a large showcase view.
  - CRT-style terminal that types out detailed card stats and skill descriptions character-by-character.
2026-03-14 17:05:46 -06:00
Brian Fertig 313d2548d9 feat: implement card leveling system and campaign progression
Adds a 5-level scaling system to all cards with progressively increasing stats and skill values. Introduces a campaign structure with unlock conditions, level requirements, and completion rewards that grant new cards and player level-ups.

Key changes:
- Refactored `data/cards.json` to use a `levels` array for stat progression
- Added `data/campaigns.json` defining 5 faction campaigns with mission lists and rewards
- Updated `CardManager.createInstance()` to accept a level parameter and resolve stats accordingly
- Implemented save migration (v1→v2) to track player level and unlocked campaigns
- Added `CampaignSelectScene` for browsing unlocked campaigns by faction/level
- Added `SkirmishSetupScene` allowing players to choose card levels for skirmishes
- Enhanced combat engine to pass level data to both player and AI decks
- Implemented visual animations for new skills: `enfeeble` (ATK reduction) and `jam` (skill suppression) with floating text feedback
- Updated UI components (Collection, Deck Builder, Store, Fusion) to display Level 1 stats by default
2026-03-14 13:00:16 -06:00
Brian Fertig 850a32c33f feat: Add sound effects for battle actions and menu interactions
Integrate audio feedback across the game by adding new SFX assets and loading them in `BootScene`. Key changes include:
- Added 12 new sound effect files (attacks, abilities, UI) and a main menu music track.
- Implemented SFX playback in `BattleScene` for actions like attacks, counters, mortar/strike/siege/pierce fires, buffs (rally), shields (protect), damage, destructions, and legendary card plays.
- Stopped main menu music during battles to avoid audio overlap and resumed it upon returning to `MainMenuScene`.
- Added hover and select sounds for UI buttons in `MainMenuScene`.
- Fixed deck composition in `DeckManager` by removing one 'imp_trooper_1' from the starter deck.
2026-03-14 08:47:26 -06:00
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 73302be3cc refactor(ui): upgrade to 1920x1080 resolution with responsive scaling
- Update `game.js` configuration to 1920x1080 with `Phaser.Scale.FIT` for responsive window resizing.
- Scale all UI elements across scenes (MainMenu, Battle, DeckBuilder, Collection, Store, Fusion) to match the new resolution:
  - Increase font sizes by ~35-50% for better readability.
  - Enlarge buttons and interactive areas to accommodate the larger viewport.
  - Expand card display dimensions in battle and deck management screens.
- Adjust layout coordinates in `BattleScene` to center the 4-lane arena properly on the wider screen.
- Update `BootScene` loading text to center dynamically based on scale dimensions.
- Add project documentation (`CLAUDE.md`) outlining architecture, scene flow, and data models for future contributors.
2026-03-12 23:52:11 -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 1a28234859 initial commit 2026-03-12 16:36:32 -06:00