diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 04b4a18..afcaa47 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-10T19:48:45.847Z +Generated: 2026-06-10T19:51:19.886Z Found: 3 circular chain(s) — these MUST be fixed before modifying involved files. 1. 1) stores/golem-combat-actions.ts > stores/golem-combat-helpers.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 2701b67..bda0bdb 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-10T19:48:43.733Z", + "generated": "2026-06-10T19:51:17.712Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, diff --git a/src/lib/game/data/conversion-costs.ts b/src/lib/game/data/conversion-costs.ts index 0ba0602..eea9b2c 100644 --- a/src/lib/game/data/conversion-costs.ts +++ b/src/lib/game/data/conversion-costs.ts @@ -39,37 +39,46 @@ function baseElementCost(element: string): ConversionCost { /** Build a ConversionCost for a composite element (distance 2) */ function compositeElementCost(element: string, components: string[]): ConversionCost { + const costPerComponent = computeComponentCost(2); // 30 each + const componentCosts: Record = {}; + for (const c of components) { + componentCosts[c] = (componentCosts[c] || 0) + costPerComponent; + } return { element, distance: 2, rawCost: computeRawCost(2), // 1,000 - componentCosts: Object.fromEntries( - components.map(c => [c, computeComponentCost(2)]), // 30 each - ), + componentCosts, }; } /** Build a ConversionCost for an exotic element (distance 3) */ function exoticElementCost(element: string, components: string[]): ConversionCost { + const costPerComponent = computeComponentCost(3); // 40 each + const componentCosts: Record = {}; + for (const c of components) { + componentCosts[c] = (componentCosts[c] || 0) + costPerComponent; + } return { element, distance: 3, rawCost: computeRawCost(3), // 10,000 - componentCosts: Object.fromEntries( - components.map(c => [c, computeComponentCost(3)]), // 40 each - ), + componentCosts, }; } /** Build a ConversionCost for time (distance 4) */ function timeElementCost(element: string, components: string[]): ConversionCost { + const costPerComponent = computeComponentCost(4); // 50 each + const componentCosts: Record = {}; + for (const c of components) { + componentCosts[c] = (componentCosts[c] || 0) + costPerComponent; + } return { element, distance: 4, rawCost: computeRawCost(4), // 100,000 - componentCosts: Object.fromEntries( - components.map(c => [c, computeComponentCost(4)]), // 50 each - ), + componentCosts, }; }