Skip to content

Commit

Permalink
fix speed boost bonus calculation
Browse files Browse the repository at this point in the history
The speed boost consumable bonus is additive, not multiplicative.
  • Loading branch information
floribe2000 committed Oct 14, 2023
1 parent a62fbc4 commit 14db6a0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public static ManeuverabilityDataContainer FromShip(Ship ship, List<ShipUpgrade>
decimal maxSpeedModifier = modifiers.FindModifiers("speedCoef", true).Aggregate(1m, (current, modifier) => current * (decimal)modifier);
maxSpeedModifier = modifiers.FindModifiers("shipSpeedCoeff", true).Aggregate(maxSpeedModifier, (current, modifier) => current * (decimal)modifier);

var speedBoostModifier = modifiers.FindModifiers("speedBoost_boostCoeff", true).Sum(); // Speed boost is additive
var speedBoostModifier = modifiers.FindModifiers("speedBoost_boostCoeff", true).Sum();
if (speedBoostModifier != 0)
{
maxSpeedModifier *= (decimal)(1 + speedBoostModifier + modifiers.FindModifiers("boostCoeffForsage").Sum()); // needed for Halland UU
maxSpeedModifier += (decimal)(1 + speedBoostModifier + modifiers.FindModifiers("boostCoeffForsage").Sum()); // Speed boost is additive, Halland UU bonus only applies if regular speed boost is active
}

decimal maxDiveSpeedModifier = modifiers.FindModifiers("maxBuoyancySpeedCoeff", true).Aggregate(1m, (current, modifier) => current * (decimal)modifier);
Expand Down

0 comments on commit 14db6a0

Please sign in to comment.