From a979147d80c5c9caa2bd907ccefcaeaa75ea38b0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 00:01:09 -0500 Subject: [PATCH] sim-balance: Culture home-stat keyword option, critic v1.1 variant Co-Authored-By: Claude Opus 5.5 --- scripts/sim/card-pool.ts | 5 +++-- scripts/sim/run.ts | 2 +- scripts/sim/variants/v1.1-critic.json | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 scripts/sim/variants/v1.1-critic.json diff --git a/scripts/sim/card-pool.ts b/scripts/sim/card-pool.ts index 0586fe6..6d8d538 100644 --- a/scripts/sim/card-pool.ts +++ b/scripts/sim/card-pool.ts @@ -25,7 +25,8 @@ function percentile(score: number, c: number[]): number { return Math.floor(below + equal / 2); } -export interface PoolOptions { costThresholds?: number[]; keywords?: 'faction' | 'none'; table?: string } +export interface PoolOptions { costThresholds?: number[]; keywords?: 'faction' | 'none'; table?: string; /** v1.1 proposal: Culture takes its home-stat keyword. */ cultureKeyword?: 'faction' | 'home' } +const CULTURE_HOME: Record = { attention: 'viral', depth: 'encyclopedic', reach: 'translated' }; export function loadPool(file: string, opts: PoolOptions = {}): GameCard[] { const raw = JSON.parse(readFileSync(file, 'utf8')).cards as RawCard[]; @@ -40,7 +41,7 @@ export function loadPool(file: string, opts: PoolOptions = {}): GameCard[] { let home: Stat = HOME_TIE[0]; for (const s of HOME_TIE) { const v = pct[s], cur = pct[home]; if (v !== null && (cur === null || v > cur)) home = s; } const faction = (c.category ?? c.legacyCategory ?? 'Culture') as GameCard['faction']; - const kw = FACTION_KEYWORD[faction]; + const kw = faction === 'Culture' && opts.cultureKeyword === 'home' ? CULTURE_HOME[home] : FACTION_KEYWORD[faction]; const keyword = cost === 1 || opts.keywords === 'none' || !kw || !(KEYWORD_IDS as readonly string[]).includes(kw) ? null : kw; return { cardId: `loaner:${c.pageId}`, pageId: c.pageId, title: c.title, faction, rarity: 'Common', cost, power: 0, diff --git a/scripts/sim/run.ts b/scripts/sim/run.ts index 4e2798a..9f0e88b 100644 --- a/scripts/sim/run.ts +++ b/scripts/sim/run.ts @@ -34,7 +34,7 @@ export async function loadEngine(name: string): Promise> if (process.env.SIM_STARTERS) extraDecks.push(...cp.loadStarterDecks(process.env.SIM_STARTERS)); if (process.env.SIM_POOL) { const { loadPool } = cp; - pool = loadPool(process.env.SIM_POOL, { keywords: process.env.SIM_KEYWORDS === 'none' ? 'none' : 'faction', costThresholds: process.env.SIM_COST_THRESHOLDS ? JSON.parse(process.env.SIM_COST_THRESHOLDS) : undefined }); + pool = loadPool(process.env.SIM_POOL, { keywords: process.env.SIM_KEYWORDS === 'none' ? 'none' : 'faction', costThresholds: process.env.SIM_COST_THRESHOLDS ? JSON.parse(process.env.SIM_COST_THRESHOLDS) : undefined, cultureKeyword: process.env.SIM_CULTURE_KW === 'home' ? 'home' : 'faction' }); } if (pool && process.env.SIM_OWNED) extraDecks.push(...cp.ownedDecks(pool, Number(process.env.SIM_OWNED))); return makeGameEngine({ rulesets, pool, extraDecks }); diff --git a/scripts/sim/variants/v1.1-critic.json b/scripts/sim/variants/v1.1-critic.json new file mode 100644 index 0000000..ee33a08 --- /dev/null +++ b/scripts/sim/variants/v1.1-critic.json @@ -0,0 +1,6 @@ +{ + "v1.1-critic": { "keywordParams": { + "rising": { "amount": 1, "cap": 2, "powerDelta": -1 }, + "viral": { "amount": 1, "cap": 2, "powerDelta": 1 }, + "encyclopedic": { "amount": 2, "powerDelta": 1 } } } +}