Week 1 Foundation: Core Engine Implementation
Transitioned from design to implementation! Week 1 of the Core Engine plan focused on building the foundational infrastructure: TypeScript interfaces, state management, character creation, and basic CLI shell.
Created comprehensive type definitions covering all game systems: characters with stats and chi aspects, techniques with combo roles and mastery, combat state with ATB turn queue, items and inventory, and complete game state with story progress tracking.
Built a singleton GameStore for centralized state management with save/load functionality including checksum validation. The CharacterFactory creates Li Wei (player) and all 11 enemies from detailed templates—each enemy has full AI patterns, loot tables, dialogue, and phase triggers for bosses.
The CLI shell now shows a proper title screen with Chinese characters (丐帮:李伟的崛起), a functional menu system, new game initialization, and character stats display. TypeScript compiles cleanly and the game launches correctly.
- +Type definitions: character.ts, technique.ts, combat.ts, item.ts, game.ts
- +GameStore.ts: Singleton state with save/load and checksum
- +CharacterFactory.ts: Player + 11 enemy templates + 3 boss templates
- +App.tsx: Title screen, menu, stats display, game flow
- +tsconfig.json updated for Node16 module resolution
- +Build passes, game launches with proper title screen
- Design-first pays off: All the documented types, formulas, and enemy data made implementation straightforward
- TypeScript strictness helps: Catching type conflicts early (like duplicate DEFAULT_STATS exports) prevents runtime bugs
- Ink framework works well: Terminal UI with React paradigm is intuitive for complex menu flows
- Enemy templates are content-rich: Each enemy has AI rules, dialogue, loot—the factory pattern keeps it organized