[High] [Bug] 4+ pacts produce negative damage/insight multiplier #360

Closed
opened 2026-06-10 19:26:54 +02:00 by Anexim · 2 comments
Owner

Severity: High
File: src/lib/game/utils/pact-utils.ts (lines 14-32, 44-63)

Description:
computePactMultiplier and computePactInsightMultiplier use the formula baseMult * (1 - effectivePenalty) where effectivePenalty = 0.5 * (numPacts - 1). With 3+ pacts and no pactInterferenceMitigation upgrade:

  • 3 pacts: multiplier = 1 - 1.0 = 0 (no damage/insight)
  • 4+ pacts: multiplier becomes negative

A negative multiplier would invert damage (healing enemies instead of damaging) or cause negative insight gain (losing insight on prestige).

Impact: Exploit or broken behavior — with 4+ pacts and no mitigation, the multiplier becomes negative, potentially causing negative damage (healing enemies) or negative insight gain (losing insight on prestige).

Fix needed: Clamp the multiplier to a minimum of 0 (or a small positive value like 0.1) to prevent negative values.

**Severity:** High **File:** `src/lib/game/utils/pact-utils.ts` (lines 14-32, 44-63) **Description:** `computePactMultiplier` and `computePactInsightMultiplier` use the formula `baseMult * (1 - effectivePenalty)` where `effectivePenalty = 0.5 * (numPacts - 1)`. With 3+ pacts and no `pactInterferenceMitigation` upgrade: - 3 pacts: multiplier = `1 - 1.0 = 0` (no damage/insight) - 4+ pacts: multiplier becomes **negative** A negative multiplier would invert damage (healing enemies instead of damaging) or cause negative insight gain (losing insight on prestige). **Impact:** Exploit or broken behavior — with 4+ pacts and no mitigation, the multiplier becomes negative, potentially causing negative damage (healing enemies) or negative insight gain (losing insight on prestige). **Fix needed:** Clamp the multiplier to a minimum of 0 (or a small positive value like 0.1) to prevent negative values.
Anexim added the ai:todo label 2026-06-10 19:26:54 +02:00
n8n-gitea was assigned by Anexim 2026-06-10 19:26:54 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-10 23:03:41 +02:00
Author
Owner

Starting work on fixing the negative damage/insight multiplier when 4+ pacts are signed. Investigating the pact multiplier calculation.

Starting work on fixing the negative damage/insight multiplier when 4+ pacts are signed. Investigating the pact multiplier calculation.
Anexim added ai:done and removed ai:in-progress labels 2026-06-11 09:03:21 +02:00
Author
Owner

Fixed. Capped the effective pact interference penalty at 1.0 using Math.min(1.0, ...) in both computePactMultiplier and computePactInsightMultiplier. Previously, 4+ pacts with 0 mitigation would produce a negative multiplier (e.g., 4 pacts: penalty=1.5, result=baseMult*(1-1.5)=-0.5*baseMult). Now the penalty is capped so the multiplier never goes below 0. All 1158 tests pass.

Fixed. Capped the effective pact interference penalty at 1.0 using Math.min(1.0, ...) in both computePactMultiplier and computePactInsightMultiplier. Previously, 4+ pacts with 0 mitigation would produce a negative multiplier (e.g., 4 pacts: penalty=1.5, result=baseMult*(1-1.5)=-0.5*baseMult). Now the penalty is capped so the multiplier never goes below 0. All 1158 tests pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#360