forked from WikiDeck/wikideck
duel-core: secondPlayerCitations ruleset lever (default 0) for first-player balance
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
## 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).
|
- 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.
|
- 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).
|
- **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.
|
- 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.
|
- 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.
|
||||||
|
|||||||
@@ -623,6 +623,7 @@ function startTurn(state: DuelState, seat: Seat): void {
|
|||||||
p.locationsThisTurn = 0;
|
p.locationsThisTurn = 0;
|
||||||
p.baseCitations = Math.min(state.rules.maxCitations, p.baseCitations + state.rules.citationsPerTurn);
|
p.baseCitations = Math.min(state.rules.maxCitations, p.baseCitations + state.rules.citationsPerTurn);
|
||||||
p.citations = maxCitations(state, seat);
|
p.citations = maxCitations(state, seat);
|
||||||
|
if (state.turn === 2 && seat !== state.firstSeat) p.citations += state.rules.secondPlayerCitations;
|
||||||
for (const perm of state.battlefield) {
|
for (const perm of state.battlefield) {
|
||||||
perm.shielded = false;
|
perm.shielded = false;
|
||||||
if (perm.controller === seat) { perm.tapped = false; perm.sick = false; }
|
if (perm.controller === seat) { perm.tapped = false; perm.sick = false; }
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export const DuelRulesetSchema = z.object({
|
|||||||
handSize: int(1, 15),
|
handSize: int(1, 15),
|
||||||
mulligans: int(0, 3),
|
mulligans: int(0, 3),
|
||||||
firstPlayerDraws: z.boolean(),
|
firstPlayerDraws: z.boolean(),
|
||||||
|
secondPlayerCitations: int(0, 5),
|
||||||
maxCitations: int(1, 20),
|
maxCitations: int(1, 20),
|
||||||
citationsPerTurn: int(1, 5),
|
citationsPerTurn: int(1, 5),
|
||||||
territoryCap: int(0, 10),
|
territoryCap: int(0, 10),
|
||||||
@@ -46,6 +47,7 @@ export const DEFAULT_DUEL_RULESET: DuelRuleset = Object.freeze({
|
|||||||
handSize: 7,
|
handSize: 7,
|
||||||
mulligans: 1,
|
mulligans: 1,
|
||||||
firstPlayerDraws: false,
|
firstPlayerDraws: false,
|
||||||
|
secondPlayerCitations: 0,
|
||||||
maxCitations: 10,
|
maxCitations: 10,
|
||||||
citationsPerTurn: 1,
|
citationsPerTurn: 1,
|
||||||
territoryCap: 2,
|
territoryCap: 2,
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ export interface DuelRuleset {
|
|||||||
handSize: number; // 7: hand limit at end of turn (DUEL_DESIGN `handLimit`); excess discarded highest cost first
|
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
|
mulligans: number; // 1: shuffle, draw openingHand, bottom one per mulligan taken
|
||||||
firstPlayerDraws: boolean; // false
|
firstPlayerDraws: boolean; // false
|
||||||
|
secondPlayerCitations: number; // 0: extra Citations on the second player's first turn (designer's "Second Opinion" lever)
|
||||||
maxCitations: number; // 10
|
maxCitations: number; // 10
|
||||||
citationsPerTurn: number; // 1
|
citationsPerTurn: number; // 1
|
||||||
territoryCap: number; // 2
|
territoryCap: number; // 2
|
||||||
|
|||||||
@@ -150,3 +150,12 @@ test('three consecutive timeouts lose; turnCap decides by Notability', () => {
|
|||||||
c = pass(c);
|
c = pass(c);
|
||||||
assert.deepEqual(c.result, { winner: 0, reason: 'turnCap' });
|
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');
|
||||||
|
});
|
||||||
|
|||||||
@@ -206,4 +206,4 @@ test('golden match', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Regenerate deliberately (an engine rule change) and say so in the PR.
|
// 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' };
|
||||||
|
|||||||
Reference in New Issue
Block a user