This is an implementation of a trading card game battle system in Typescript written on the @cards-ts framework. It contains no actual game data and is intended for research purposes around gameplay strategization.
Developed mainly though generative AI so even with test coverage there is a chance of bugs.
- ✅ Card battles with HP and damage tracking
- ✅ Active card and bench management (max 3 benched cards)
- ✅ Card evolution system (Basic → Stage 1 → Stage 2)
- ✅ Attack system with damage calculation
- ✅ Knockout detection and handling
- ✅ Points-based winning system (3 points to win)
- ✅ Turn-based gameplay with state machine architecture
- ✅ Evolution chains (multiple evolution stages)
- ✅ Card promotion from bench to active
- ✅ Evolution restrictions (once per turn, not on first turn)
- ✅ Individual card instance tracking for evolution logic
- ✅ Game setup with active card selection
- ✅ Turn structure with Draw, Main, Attack, and Checkup phases
- ✅ Hand and deck management
- ✅ Bot opponents for single-player games
- ✅ Turn counter and state tracking
- ✅ Energy Zone with automatic generation
- ✅ Energy attachment mechanics
- ✅ Energy-based attack requirements
- ✅ Multi-type Energy generation
- ✅ Energy accelerator effects
- ✅ Asleep, Burned, Confused, Paralyzed, Poisoned
- ✅ Special condition interactions and removal
- ✅ Status effect damage between turns
- ✅ Tool attachment system
- ✅ Card abilities (passive effects)
- ✅ Retreating with Energy costs
- ✅ Weakness (+20 damage) system
- ✅ First turn restrictions
- ❌ Turn limits (30/50 turns)
- ✅ Special cards (2 points when knocked out)
- ✅ Coin flip mechanics for attacks/effects
- ✅ Special condition checkup phase
npm run build# Run all tests
pnpm test
# Run specific tests
pnpm test -- --grep 'Target'Architecture & Framework:
- Cards-TS Framework - The core framework this implementation is built on
- Framework Documentation - Hosted documentation for the Cards-TS framework
Related Packages:
- @cards-ts/core - Core game mechanics and state management
- @cards-ts/state-machine - Turn-based state machine implementation
We use SemVer for versioning. For the versions available, see the tags on this repository.
- John Meyer - Initial work - johnameyer
See also the list of contributors who participated in this project.