Commit Graph

16 Commits

Author SHA1 Message Date
Brian Fertig 5b206fda33 feat: implement BattleResultScene with full post-battle flow
- Add new BattleResultScene to handle post-battle victory/defeat sequence
- Include animated terminal-style debrief with stats, rating, and card/commander unlocks
- Support dynamic commander videos (victory/defeated) with fallback placeholders
- Implement gold counter animation and card reveal system with rarity effects
- Add victory/defeat music assets and integrate into result flow

BattleScene changes:
- Track all battle events across turns for detailed post-battle stats
- Transition to BattleResultScene instead of showing inline results
- Preserve save logic (gold, cards, unlocks) in result scene transition

BootScene changes:
- Load victory/defeat music assets for result scene playback
2026-03-31 17:54:00 -06:00
Brian Fertig 313f14b956 Changes 2026-03-23 22:31:50 -06:00
Brian Fertig eabf10ca4a feat: add store audio effects and rebalance card stats
- Added new audio files for store interactions: `buy.mp3`, `card.mp3`, and `card-bonus.mp3`.
- Updated `BootScene` to preload the new sound effects.
- Implemented sound triggers in `StoreScene`:
  - Plays `sfx_store_buy` upon purchasing cards.
  - Plays `sfx_store_card` when revealing a card.
  - Plays `sfx_store_card_bonus` for rare, epic, and legendary cards.
- Rebalanced `data/cards.json` to adjust game mechanics:
  - Set `attack` to `0` for all legendary card levels.
  - Reduced `health` values across all card tiers.
  - Standardized `delay` values to `0` or `1` for most cards, removing high delay values.
2026-03-23 18:50:22 -06:00
Brian Fertig 480f1ce354 feat: add new Raider commanders, units, and Rupture/Weaken skill systems
- Added two new legendary Raider commanders: Warboss Kragath (Weaken + Strike) and Scar-Queen Vex (Enfeeble + Rupture).
- Introduced new Raider units across all rarities: Brute, Cutpurse, Berserker, Cutthroat, Marauder, Scavenger, Defiler, Warlord, Reaver, Warband Breaker, Carnage, Overlord, Ravager, Iron Destroyer, and Skulltaker.
- Implemented full Rupture mechanics:
  - Added `ruptureStacks` tracking and pre-battle damage phase that can kill units.
  - New `rupture` skill logic with single-target and `all` variants, including burrow immunity.
  - Visuals: rupture stack badge on cards, knife throw animations for application, and pulsing heart effect for tick damage.
  - Audio: new SFX for rupture cast and damage.
- Implemented Weaken mechanics:
  - Reduces target Armor and Attack (split 50/50) with clamping to non-negative values.
  - Added `weakenFires` event tracking and pre-battle animation with stat reduction visuals.
  - Audio: new SFX for weaken cast.
- Updated missions to feature new commanders and units, and increased gold rewards.
- Updated `attacks.png` and `attacks.psd` spritesheets with new effect frames (knife, heart).
- Updated `data/cards.json` and `data/missions.json` with new entries and rebalanced values.
2026-03-22 17:51:06 -06:00
Brian Fertig b2981cd389 chore: update combat engine formatting and battle scene animations
- Normalize whitespace and alignment in `src/combat/CombatEngine.js` (variable assignments and filter calls).
- Extend projectile tween duration in `src/scenes/BattleScene.js` from 350ms to 2000ms for smoother visual effect.
- Adjust sprite pulse animation scale range from 0.8–1.5 to 0.5–1.0 for a more subtle effect.
- Update binary assets: new `smite2.mp3`, modified `fortify.mp3` and `smite-cast.mp3`, updated `attacks.png` and `attacks.psd`, removed duplicate `attacks (1).png`.
2026-03-22 08:29:22 -06:00
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 71d291f814 feat: add Righteous faction assets and enhance Sanctify animations
- Add new audio and image assets for the Righteous faction:
  - FX: sanctify.mp3
  - Cards: Archangel, Commander (x3), Inquisitor, Judicator, Prophet, Purifier, Seraph, Templar
  - UI: right_01.png, right_02.png, right_03.png
- Update battle backgrounds to include the 'righteous' theme.
- Fix CombatEngine to pass actual enemy lanes to commander offensive buff collection, ensuring all-targeting skills function correctly.
- Refactor Sanctify animations in BattleScene:
  - Introduce `_doSanctifySpriteTo` to animate a projectile flying from source to target.
  - Animate sprite 35 flying in, shaking on impact, swapping to sprite 36, and fading out.
  - Apply the new animation logic to both single-target and multi-target Sanctify effects.
- Update attack spritesheet to support the new animation frames.
2026-03-21 16:37:39 -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 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 f927529555 feat: implement "all" target modifier for skills and battle music playlist
Add a new `all` modifier to skills (`strike`, `pierce`, `mortar`, `rally`, `heal`, `enfeeble`, `weaken`, `rupture`) that targets all valid enemies or allies instead of a single target. This includes:

- **Data Layer**: Updated cards.json with expanded skill definitions and added new cards (Imperial Guardian, Pillager, Marauder). Added `allDescription` and `supportsAll` flags to skills.json.
- **Combat Logic**: Extended SkillProcessor and CombatEngine to handle "all" variants, managing parallel state updates for HP, armor, attack stats, and buffs/debuffs across multiple targets.
- **Visuals**: Implemented new animation sequences in BattleScene for area-of-effect skills (parallel projectiles, shared sound effects) and updated CardTooltip/CardObject to display the "all" modifier.
- **Audio**: Introduced a shuffled battle music playlist that cycles through multiple tracks during combat, resuming main menu music upon exit.
2026-03-14 15:26:21 -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