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]

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.

SuitRoleBoundaryCanonical TriggerPractical Effect
DiamondsShieldCard -> CardIf the current destroyed card is a Diamond and the next target is a cardReduces carryover before the next defender takes damage
HeartsShieldCard -> PlayerIf the last destroyed card before the player is a HeartReduces final player damage (Hearts do not stack)
ClubsWeaponCard -> CardIf the attacker is Club and this is the first eligible boundary after the first destructionDoubles carryover once per attack
SpadesWeaponCard -> PlayerIf the attacker is Spade and carryover reaches the playerDoubles final player damage

Match Termination Signals (Canonical Concepts)

Classic Special Cards

Trust Model (Why This Matters Online)