Refactor pack system to faction-specific packs with slot-based drops
- Split standard pack into 5 faction-specific packs (imperial, raider, bloodthirsty, xeno, righteous)
- Each pack has 3 guaranteed common slots + 1 special slot with tiered rarity distribution
- Packs unlock by completing their respective campaign missions
- Updated StoreScene to display faction colors, unlock status, and support pack opening animations
Fix bloodpact skill trigger timing and mechanics
- Changed bloodpact from preBattle to preAttack trigger (now fires per attack instead of once per turn)
- Reduced HP cost to 50% of value (was 100%), maintaining same ATK gain
- Moved bloodpact processing from _collectPreBattleFires to _buildPendingAttacks
- Added death check for self-killed cards during preAttack phase
Update drain skill description and trigger
- Changed drain from preBattle to preAttack trigger
- Updated description to clarify it targets the opposing card and its neighbors
Add fusion activation video and enhanced reveal effects
- Added forge2.mp4 for fusion animation (swaps with idle forge during activation)
- Implemented 3-phase energy vortex effect: particle streams, lightning bolts, convergence flash
- Faction-colored effects based on selected stack's faction
Update attack spritesheet and card data
- Updated attacks.png/psd with new bloodpact visual (frame 24)
- Changed all bloodpact skill triggers in cards.json from preBattle to preAttack
```
- 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.
- Change `drain` skill trigger from `preAttack` to `preBattle`, resolving it against the opposing lane/commander before attacks begin.
- Update combat engine to collect and emit `drainFires` in the pre-battle sequence, including death events for drained targets.
- Rebalance card stats across all factions with higher attack/health/armor values and scaled skill magnitudes to match new combat pacing.
- Improve UI label positioning for ATK/ARM/HP on CardObject to handle dynamic text widths.
- 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
Introduces dynamic background images for `BattleScene` based on the opponent's faction (Imperial, Raider, Bloodthirsty). The system:
- Defines a configuration of 3 variant assets per faction.
- Selects a random variant during the preload phase if the opponent's commander card is available.
- Renders the selected background with a dimming overlay in `create`, falling back to the solid color if no image is loaded or defined.
Includes new asset files: `imperial_03.png` and `raider_03.png`.
- **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.
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.
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
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.
Refactor combat flow to separate preBattle (buffs/siege/protect) and attack phases. Introduce `preAttack` and `postAttack` events to handle temporary armor modifications (pierce) and restores.
Key changes:
- **Data Updates**: Updated `cards.json` and `skills.json` to reflect new triggers (`preBattle`, `preAttack`) for skills like Pierce, Protect, Siege, and Counter. Adjusted stats for Imperial Assault card.
- **Combat Logic**: Modified `CombatEngine.js` to process preBattle buffs sequentially (rally, siege, protect) and handle pierce armor reduction/restoration logic.
- **Skill Processor**: Updated `SkillProcessor.js` to implement positional logic for Protect (self + neighbors), direct armor reduction for Pierce, and counter damage calculation.
- **Animations**: Added new animation methods in `CardObject.js` (`animateArmorLoss`, `animateArmorGain`) and `BattleScene.js` to visualize:
- **Pierce**: Projectile flying to target with armor drop animation, restored after attack.
- **Protect**: Shields rising on source and flying to neighbors with armor gain animation.
- **Siege**: Launcher overlay, missile arc trajectory, and explosion impact.
- **Counter**: Spike projectile fired at impact during the attack hold phase.
- **Deck Builder**: Overhauled `DeckBuilderScene.js` with a scrollable card grid, faction/rarity filters, and improved deck management UI (owned/used counts).
Implements a `CardTooltip` component that displays detailed card information (name, type, stats, skills with triggers/values, and flavor text) when hovering over a card in the BattleScene.
Changes include:
- Created `CardTooltip.js` to render dynamic tooltips based on card data and skill definitions.
- Updated `CardObject.js` to handle pointer events (`pointerover`, `pointermove`, `pointerout`) for showing/hiding the tooltip with a 500ms delay.
- Refactored interaction logic in `BattleScene.js` to use the `CardObject`'s native interactive area instead of a separate invisible rectangle, consolidating hover and click handlers.
- 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.
- Adjusted `CardObject.js` to align "ATK", "ARM", "HP", and "DLY" labels horizontally next to their values instead of vertically below, improving visual clarity.
- Added `_animateInitiativeHandoff` in `BattleScene.js` to smoothly tween the initiative indicator icon between the player and opponent sides at the end of each turn.
- Updated `_updateInitiativeIndicator` to increase the icon size (110px) and adjust its X position for better visibility.
- Extracted `_playCardDeath` in `BattleScene.js` to handle the explosion sprite and fade-out sequence for defeated cards, preventing code duplication.
- Updated `_refreshCardAfterAttack` to use the new helper method, serving as a fallback for cards killed by counter or rupture effects without an HP loss animation.
- Modified `animateHPLoss` completion handler in `_animateAttack` to trigger `_playCardDeath` immediately after the HP animation finishes, ensuring the death sequence only plays once and respects the animation timing.
- Added guard logic to prevent double-destruction if a card is already removed from `cardObjects` before the refresh step.
- 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.
- 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`.
- 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.
- 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.
- 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.
- Split `commitPlayerDeploy` into `beginCommit`, `processNextAttack`, and `finalizeCommit` to enable per-attack animation control.
- Introduce `_pendingAttacks` queue in CombatEngine to sequence attacks one by one, allowing the UI to react to intermediate damage (e.g., counter-kills).
- Refactor BattleScene commander rendering into persistent Containers (`commanderObjects`) that support live `refresh()` for HP/stats updates during combat.
- Update `_animateAttack` to handle commander targets and skip scale-back animations for dead cards, deferring cleanup to `_refreshCardAfterAttack`.
- Implement recursive attack loop in `_processNextAttackStep` that drives the battle forward, updating visuals immediately after each hit before proceeding.
- 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.