Technical Details
This page summarizes the canonical v1.0 technical model in player-readable form. Implementation-grade details live in the Phalanx Duel game repository.
Turn Sequence
Canonical v1.0 executes a deterministic 7-phase turn lifecycle. Attack declaration and combat resolution happen inside that lifecycle, not as a standalone loop.
flowchart LR
A[StartTurn] --> B[AttackPhase]
B --> C[AttackResolution]
C --> D[CleanupPhase]
D --> E[ReinforcementPhase]
E --> F[DrawPhase]
F --> G[EndTurn]
Gameplay Loop
The game alternates deterministic turns. Each turn emits events for all phases, even if no state changes occur.
flowchart TD
S[Classic Setup
Draw 12, alternate deploy] --> T[Turn Trace] T --> U[7 Phase Execution] U --> V{Continue Match?} V -- Yes --> T V -- No --> X[Match Termination]
Draw 12, alternate deploy] --> T[Turn Trace] T --> U[7 Phase Execution] U --> V{Continue Match?} V -- Yes --> T V -- No --> X[Match Termination]
Statechart
State-level view of the canonical turn lifecycle.
stateDiagram-v2
[*] --> Setup
Setup --> TurnStart
TurnStart --> AttackPhase
AttackPhase --> AttackResolution
AttackResolution --> CleanupPhase
CleanupPhase --> ReinforcementPhase
ReinforcementPhase --> DrawPhase
DrawPhase --> EndTurn
EndTurn --> TurnStart: next turn
EndTurn --> GameOver: termination / forfeit / system error
GameOver --> [*]
Suit Ability Timing
Suit effects are evaluated at boundaries during attack resolution. Canonical boundary order is Shield -> Weapon -> Clamp.
| Suit | Role | Boundary | Canonical Trigger | Practical Effect |
|---|---|---|---|---|
| Diamonds | Shield | Card -> Card | If the current destroyed card is a Diamond and the next target is a card | Reduces carryover before the next defender takes damage |
| Hearts | Shield | Card -> Player | If the last destroyed card before the player is a Heart | Reduces final player damage (Hearts do not stack) |
| Clubs | Weapon | Card -> Card | If the attacker is Club and this is the first eligible boundary after the first destruction | Doubles carryover once per attack |
| Spades | Weapon | Card -> Player | If the attacker is Spade and carryover reaches the player | Doubles final player damage |
Match Termination Signals (Canonical Concepts)
- Player damage: Attack resolution can reduce player LP when carryover reaches the player boundary.
- Pass limits: Exceeding consecutive or total pass limits results in forfeit.
- System errors: Deterministic invariant violations terminate the match with an unrecoverable error event.
- Important: Empty deck alone is not an automatic loss in canonical v1.0.
Classic Special Cards
- Classic Aces: A front-rank Ace is destroyable only by a direct Ace attack at target index 0.
- Classic Face Cards: Jack/Queen/King destroy eligibility is rank-restricted (J < Q < K hierarchy).
- Origin attacker is immutable: Destroy eligibility is determined by the original attacker across the full target chain.
Trust Model (Why This Matters Online)
- Phalanx Duel uses a server-authoritative architecture in digital play.
- The server validates actions against the rules engine.
- Turns emit structured events and can be replay-verified with hashes.
- Identical inputs must produce identical outputs under the same spec version.