diff --git a/docs/game/DUEL_API.md b/docs/game/DUEL_API.md index 511c5eb..5f73396 100644 --- a/docs/game/DUEL_API.md +++ b/docs/game/DUEL_API.md @@ -55,7 +55,7 @@ Built by duel-cards (`derive()`), frozen by the host at match start. Shape agree ## Rules (defaults: `DEFAULT_DUEL_RULESET`; details in DUEL_DESIGN §2) - 40-card decks (`deckSize`), ≤ 4 per `pageId`, unique `cardId`s, no tokens. 20 Notability. Drawing from an empty library loses (`libraryEmpty: 'lose'`; `'reshuffle'` and `'fatigue'` exist as data). - Opening hand 7. Up to `mulligans` (1): shuffle in, draw 7, then on `keep` put one card per mulligan on the bottom (the last in hand order). Seat 0 decides first, then seat 1. -- First player (from the seed) skips their first draw. +- First player (from the seed) skips their first draw. Balance levers (data only): `firstPlayerDraws`, and `secondPlayerCitations` (extra Citations on the second player's first turn, default 0). - **Turn:** refresh (base max +1 to 10, plus Territory ≤ 2; refill; untap; Pending review ends; Stub and `startOfTurn` triggers) → draw → **main** → **attack** → **block** → damage → end (damage and "until end of turn" clear; discard down to `handSize` 7, **highest cost first**, automatically). - Locations: `locationsPerTurn` (1), can't attack. Garrison Locations (toughness > 0) block as 0-power. - Combat: attack the opponent only; each blocker blocks one attacker, at most one blocker per attacker; simultaneous damage; destroy triggers after all combat damage. No trample, first strike, stack or instants. diff --git a/shared/duel/engine.ts b/shared/duel/engine.ts index b7dd247..3dba767 100644 --- a/shared/duel/engine.ts +++ b/shared/duel/engine.ts @@ -623,6 +623,7 @@ function startTurn(state: DuelState, seat: Seat): void { p.locationsThisTurn = 0; p.baseCitations = Math.min(state.rules.maxCitations, p.baseCitations + state.rules.citationsPerTurn); p.citations = maxCitations(state, seat); + if (state.turn === 2 && seat !== state.firstSeat) p.citations += state.rules.secondPlayerCitations; for (const perm of state.battlefield) { perm.shielded = false; if (perm.controller === seat) { perm.tapped = false; perm.sick = false; } diff --git a/shared/duel/ruleset.ts b/shared/duel/ruleset.ts index 8c7e2a3..2aa7942 100644 --- a/shared/duel/ruleset.ts +++ b/shared/duel/ruleset.ts @@ -18,6 +18,7 @@ export const DuelRulesetSchema = z.object({ handSize: int(1, 15), mulligans: int(0, 3), firstPlayerDraws: z.boolean(), + secondPlayerCitations: int(0, 5), maxCitations: int(1, 20), citationsPerTurn: int(1, 5), territoryCap: int(0, 10), @@ -46,6 +47,7 @@ export const DEFAULT_DUEL_RULESET: DuelRuleset = Object.freeze({ handSize: 7, mulligans: 1, firstPlayerDraws: false, + secondPlayerCitations: 0, maxCitations: 10, citationsPerTurn: 1, territoryCap: 2, diff --git a/shared/duel/types.ts b/shared/duel/types.ts index 96e4742..1c81a23 100644 --- a/shared/duel/types.ts +++ b/shared/duel/types.ts @@ -166,6 +166,7 @@ export interface DuelRuleset { handSize: number; // 7: hand limit at end of turn (DUEL_DESIGN `handLimit`); excess discarded highest cost first mulligans: number; // 1: shuffle, draw openingHand, bottom one per mulligan taken firstPlayerDraws: boolean; // false + secondPlayerCitations: number; // 0: extra Citations on the second player's first turn (designer's "Second Opinion" lever) maxCitations: number; // 10 citationsPerTurn: number; // 1 territoryCap: number; // 2 diff --git a/tests/duel-core-effects.test.ts b/tests/duel-core-effects.test.ts index f54db54..b59f38d 100644 --- a/tests/duel-core-effects.test.ts +++ b/tests/duel-core-effects.test.ts @@ -150,3 +150,12 @@ test('three consecutive timeouts lose; turnCap decides by Notability', () => { c = pass(c); assert.deepEqual(c.result, { winner: 0, reason: 'turnCap' }); }); + +test('secondPlayerCitations gives the second player extra Citations on their first turn only', () => { + let s = scenario([[], []], { citationsPerTurn: 1, secondPlayerCitations: 1 }); + assert.equal(s.players[0].citations, 1); + s = pass(s); + assert.equal(s.players[1].citations, 2); + s = pass(s); s = pass(s); + assert.equal(s.players[1].citations, 2, 'turn 4: base 2, no bonus'); +}); diff --git a/tests/duel-core-engine.test.ts b/tests/duel-core-engine.test.ts index b717c5e..2f26686 100644 --- a/tests/duel-core-engine.test.ts +++ b/tests/duel-core-engine.test.ts @@ -206,4 +206,4 @@ test('golden match', () => { }); // Regenerate deliberately (an engine rule change) and say so in the PR. -const GOLDEN = { actions: 60, turn: 11, result: { winner: 1, reason: 'life' }, log: 83, digest: 'eb83865b9b4e30c9' }; +const GOLDEN = { actions: 60, turn: 11, result: { winner: 1, reason: 'life' }, log: 83, digest: '4f4296d6951a616b' };