[High] [Bug] 4+ pacts produce negative damage/insight multiplier #360
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High
File:
src/lib/game/utils/pact-utils.ts(lines 14-32, 44-63)Description:
computePactMultiplierandcomputePactInsightMultiplieruse the formulabaseMult * (1 - effectivePenalty)whereeffectivePenalty = 0.5 * (numPacts - 1). With 3+ pacts and nopactInterferenceMitigationupgrade:1 - 1.0 = 0(no damage/insight)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.
Starting work on fixing the negative damage/insight multiplier when 4+ pacts are signed. Investigating the pact multiplier calculation.
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.