From e22c6cef656a4c7f154b123970a5e5385a8cf07a Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Thu, 11 Jun 2026 09:02:47 +0200 Subject: [PATCH] fix: cap pact interference penalty at 1.0 to prevent negative multipliers with 4+ pacts --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- src/lib/game/utils/pact-utils.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 0e12c52..9481e75 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-10T20:57:50.802Z +Generated: 2026-06-10T21:01:48.810Z 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 49b25a9..1ae9fff 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-10T20:57:48.663Z", + "generated": "2026-06-10T21:01:46.760Z", "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/utils/pact-utils.ts b/src/lib/game/utils/pact-utils.ts index f75587d..e6c2ee4 100644 --- a/src/lib/game/utils/pact-utils.ts +++ b/src/lib/game/utils/pact-utils.ts @@ -23,7 +23,7 @@ export function computePactMultiplier(state: { const numAdditionalPacts = signedPacts.length - 1; const basePenalty = 0.5 * numAdditionalPacts; const mitigationReduction = Math.min(pactInterferenceMitigation, 5) * 0.1; - const effectivePenalty = Math.max(0, basePenalty - mitigationReduction); + const effectivePenalty = Math.min(1.0, Math.max(0, basePenalty - mitigationReduction)); if (pactInterferenceMitigation >= 5) { const synergyBonus = (pactInterferenceMitigation - 5) * 0.1; @@ -53,7 +53,7 @@ export function computePactInsightMultiplier(state: { const numAdditionalPacts = signedPacts.length - 1; const basePenalty = 0.5 * numAdditionalPacts; const mitigationReduction = Math.min(pactInterferenceMitigation, 5) * 0.1; - const effectivePenalty = Math.max(0, basePenalty - mitigationReduction); + const effectivePenalty = Math.min(1.0, Math.max(0, basePenalty - mitigationReduction)); if (pactInterferenceMitigation >= 5) { const synergyBonus = (pactInterferenceMitigation - 5) * 0.1;