forked from WikiDeck/wikideck
[sim-balance] SIM_SECOND_EXTRA: sim-only experiment for second-seat compensation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,19 @@ export async function makeDuelSim(sampleFile: string, overrides: Record<string,
|
|||||||
fame: (c as any).basis?.fame, card: c,
|
fame: (c as any).basis?.fame, card: c,
|
||||||
}));
|
}));
|
||||||
const engine = makeDuelAdapter(api, { rules, pool: cards });
|
const engine = makeDuelAdapter(api, { rules, pool: cards });
|
||||||
|
// SIM_SECOND_EXTRA=n: experiment for a proposed ruleset key. The second seat starts with n extra cards
|
||||||
|
// (moved from its library top before mulligans). Sim-only; the engine has no such key yet.
|
||||||
|
const extra = Number(process.env.SIM_SECOND_EXTRA ?? 0);
|
||||||
|
if (extra > 0) {
|
||||||
|
const create = engine.createMatch;
|
||||||
|
engine.createMatch = (r, d, seed) => {
|
||||||
|
const s = create(r, d, seed);
|
||||||
|
const second = (1 - s.firstSeat) as 0 | 1;
|
||||||
|
const p = s.players[second];
|
||||||
|
p.hand.push(...p.library.splice(0, extra));
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
name: 'duel', engine, lens: engine.lens, pool,
|
name: 'duel', engine, lens: engine.lens, pool,
|
||||||
deckPayload: cs => cs.map(c => c.card),
|
deckPayload: cs => cs.map(c => c.card),
|
||||||
|
|||||||
Reference in New Issue
Block a user