diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 5087a7a6cf..4b931a4b1f 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -17,6 +17,12 @@ // This is a const because it replaces a hardcoded value in vanilla internal const float BalloonJumpSpeedBoost = 0.75f; + // Default jump speed boost provided by Frog Leg and tinker combinations in vanilla + internal const float VanillaFrogLegJumpSpeedBoost = 1.6f; + + // Altered jump speed boost provided by Amphibian Boots via global item UpdateAccessory + internal static readonly float AmphibianBootsJumpSpeedBoost = 1f; + // Altered movement stats provided by Shadow Armor via IL edit // This item is modified to not stack with Magiluminescence if on the ground. If in the air, it still functions. internal static readonly float ShadowArmorRunAccelerationMultiplier = 1.25f; // Vanilla and Magi = 1.75f diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6106b15c9e..70989c1168 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -507,6 +507,7 @@ namespace CalamityMod.CalPlayer public bool ascendantTrail = false; public bool eGauntlet = false; public int gloveLevel = 0; // Used to prevent glove stacking + public bool alreadyHasFrogLeg = false; // Used to prevent Frog Leg tinker stacking public bool eTalisman = false; public int statisTimer = 0; public bool nucleogenesis = false; @@ -1703,6 +1704,7 @@ namespace CalamityMod.CalPlayer ascendantTrail = false; eGauntlet = false; gloveLevel = 0; + alreadyHasFrogLeg = false; eTalisman = false; nucleogenesis = false; nuclearFuelRod = false; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 6b546a1061..10845a70b5 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using CalamityMod.Balancing; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; @@ -1237,6 +1238,29 @@ namespace CalamityMod.Items player.GetDamage() += 0.02f; } + // The Frog Leg line is prevented from stacking. + // Additionally, Amphibian boots are directly nerfed so they aren't the best in slot boots at all times. + switch (item.type) + { + default: + break; + case ItemID.AmphibianBoots: + if (modPlayer.alreadyHasFrogLeg) + player.jumpSpeedBoost -= BalancingConstants.VanillaFrogLegJumpSpeedBoost; + else + player.jumpSpeedBoost += BalancingConstants.AmphibianBootsJumpSpeedBoost - BalancingConstants.VanillaFrogLegJumpSpeedBoost; + modPlayer.alreadyHasFrogLeg = true; + break; + case ItemID.FrogLeg: + case ItemID.FrogFlipper: + case ItemID.FrogGear: + case ItemID.FrogWebbing: + if (modPlayer.alreadyHasFrogLeg) + player.jumpSpeedBoost -= BalancingConstants.VanillaFrogLegJumpSpeedBoost; + modPlayer.alreadyHasFrogLeg = true; + break; + } + // Feral Claws line melee speed adjustments and nonstacking // First removes all their melee speed so it can be given based on which you wear without stacking if (item.type == ItemID.FeralClaws)