Build the voidexa Phase 11 turn-based card combat system. Use this skill when implementing PvP duels, PvE card encounters, the deck builder UI, the 3D duel zone, card animations on ships, or anything in the card-combat surface. Triggers on "card combat", "duel", "deck builder", "card battle", "PvP", or "Phase 11" in the context of voidexa.
voidexa Star System — Phase 11: Turn-Based Card Combat
Turn-based card combat integrated into Free Flight. Players duel other players (PvP) or NPC ships (PvE) using decks of 20 cards. Combat takes place in a 3D duel zone with both ships visible. Cards trigger 3D animations on the ships when played.
Existing systems used:
lib/game/cards.ts — CardRarity, CardCategory enums, Card interfacelib/game/ships.ts — Ship classes with stats (shield, hull, speed, energyPerTurn, handSize)lib/cards/starter_set.ts — 40 Core Set cards with statslib/cards/deck.ts — Deck management (20 cards, 2-copy limit, hand drawing)lib/cards/collection.ts — Disenchant, craft, fuselib/game/ranks.ts — Rank system, canDuel checklib/game/alientech.tslib/achievements/tracker.ts — PvP achievement tracking| Category | Effect |
|---|---|
| Attack | Deal damage to opponent's shield/hull |
| Defense | Add temporary shield, reduce incoming damage |
| Tactical | Buff your ship stats, debuff opponent |
| Deployment | Summon drone/turret that deals damage over turns |
| Alien | Powerful effect BUT 20% backfire chance (damages YOU) |
| Rarity | Typical Cost | Typical Power |
|---|---|---|
| Common | 1-2 | Low damage/defense |
| Uncommon | 2-3 | Medium |
| Rare | 3-4 | Strong |
| Epic | 4-5 | Very strong |
| Legendary | 5-6 | Game-changing |
┌──────────────────────────────────────────────┐
│ OPPONENT: [name] [rank] HULL ████░░ │
│ Ship: [3D model, top half of screen] │
│ Shield ██████░░ Energy: ⚡⚡○○○ │
│ │
│ ┌──────────────────────────────────────┐ │
│ │ BATTLE LOG / PLAY AREA │ │
│ │ "Heavy Barrage hits for 12 dmg" │ │
│ │ "Shield Plating blocks 8 dmg" │ │
│ └──────────────────────────────────────┘ │
│ │
│ YOUR Ship: [3D model, bottom half] │
│ HULL ████████░░ Shield ██████████ │
│ Energy: ⚡⚡⚡○○ TURN: [YOUR TURN / WAIT] │
│ │
│ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
│ │C1│ │C2│ │C3│ │C4│ │C5│ YOUR HAND │
│ └──┘ └──┘ └──┘ └──┘ └──┘ │
│ [END TURN] [SURRENDER] │
└──────────────────────────────────────────────┘
┌─────────────┐
│ ⚡3 [RARE] │ <- Energy cost + rarity color border
│ │
│ [ART IMG] │ <- 512x512 render from public/images/renders/
│ │
│ Guided │ <- Card name
│ Missile │
│ │
│ Deal 15 dmg │ <- Effect text
│ to target │
└─────────────┘
Each card type triggers a visual effect on the 3D ships:
| Card | Animation |
|---|---|
| Plasma Bolt | Blue energy projectile → impact sparks |
| Guided Missile | Missile model curves toward target → explosion |
| Heavy Barrage | Rapid small projectiles stream |
| Nova Launcher | Large orange blast |
| Triple Strike | Three projectiles simultaneously |
| Shield Plating | Blue transparent sphere pulses around ship |
| Hull Reinforcement | Ship glows green briefly |
| Evasive Maneuver | Ship barrel rolls |
| Engine Boost | Thrusters flare, speed lines |
| Deploy Fighter Drone | Small ship model spawns nearby |
| Void Cannon (Alien) | Dark purple beam with distortion |
| Backfire! | Red explosion on YOUR ship, screen shake |
components/combat/
├── CombatArena.tsx — Main 3D scene with both ships
├── CombatUI.tsx — React overlay (hand, health bars, energy, buttons)
├── CardHand.tsx — Fan of cards at bottom, drag to play
├── CardComponent.tsx — Individual card visual (art, stats, glow border)
├── HealthBars.tsx — Hull + Shield bars for both players
├── EnergyDisplay.tsx — Energy dots (filled/empty)
├── BattleLog.tsx — Scrolling text log of actions
├── TurnIndicator.tsx — "YOUR TURN" / "OPPONENT'S TURN" banner
├── CombatAnimations.tsx — 3D projectile/shield/effect animations
├── EndScreen.tsx — Win/Loss/Draw result with rewards
├── DeckBuilder.tsx — Pre-combat deck building UI
├── CardCollection.tsx — All owned cards grid view
└── CombatEngine.ts — Game state machine (turns, damage calc, win check)
IDLE → CHALLENGE_SENT → CHALLENGE_ACCEPTED →
LOADING (decks) → COIN_FLIP →
TURN_PLAYER_A (draw → energy → play → resolve → end) →
TURN_PLAYER_B (same) →
... repeat until WIN/LOSE/DRAW →
REWARDS → EXIT