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,15 @@
# 2024-12-18 - Fix Empty Combat Step Skipping
## Problem
When a player declares 0 attackers (Skip Combat), the game correctly advances from `declare_attackers` but then proceeds to `declare_blockers` instead of skipping to the end of combat. This forces the (non-existent) defending player to declare blockers against nothing, or the active player to wait through irrelevant priority passes.
## Root Cause
The `RulesEngine.advanceStep()` method strictly followed the standard phase/step structure defined in `server/game/RulesEngine.ts`. It lacked the logic to implement Rule 508.8, which states that if no attackers are declared, the Declare Blockers and Combat Damage steps are skipped.
## Solution
Modified `RulesEngine.advanceStep()` to check for attackers before transitioning steps.
If the current phase is `combat` and the next projected step is `declare_blockers`, it checks if any cards have the `attacking` property.
If `attackers.length === 0`, it overrides `nextStep` to `end_combat`, effectively skipping the interactive combat steps.
## Outcome
Declaring 0 attackers (or passing with no attacks) now correctly transitions the game immediately to the "End of Combat" step (and then likely Main Phase 2), smoothing out the gameplay flow.