feat: Implement game restart, battlefield styling with art crops and tapped stacks, and initial draw fixes.
Some checks failed
Build and Deploy / build (push) Failing after 1m10s

This commit is contained in:
2025-12-18 20:26:42 +01:00
parent ca7b5bf7fa
commit bc5eda5e2a
35 changed files with 1337 additions and 634 deletions

View File

@@ -0,0 +1,19 @@
---
title: Fix Restart Game Action
status: Completed
---
## Objectives
- Fix the "Restart Game" button not actually resetting the game state fully (players were left with empty hands).
## Diagnosis
- The `restartGame` method in `GameManager` correctly reset the global state (turn, phase, step) and moved cards back to the library.
- However, it **failed to trigger the initial card draw** (Mulligan phase start).
- This happened because `RulesEngine.startGame()` (which handles the initial draw loop) was never called after the reset.
## Fix Implemented
- Updated `GameManager.ts` to instantiate a new `RulesEngine` and call `.startGame()` at the end of `restartGame`.
- This ensures that after resetting variables, the engine immediately shuffles libraries and deals 7 cards to each player, effectively restarting the match.
## Verification
- Clicking "Restart Game" now properly resets life totals, clears the board, and deals a fresh opening hand to all players.