From 78f71bcde52f025f2df2183bfe48c9bc02e83e87 Mon Sep 17 00:00:00 2001 From: Raesh Date: Thu, 25 Sep 2025 23:17:17 -0400 Subject: [PATCH] Ammo Consumption Changes Part2 -Moves the ammo saving from the set bonus of Tarragon, Bloodflare, God Slayer, and Auric to the helmet for consistency with other calamity bonuses, and late game vanilla ones. -Adjusts Plague Reaper, Hydrothermic, and Daedalus ammo bonuses to use non booleans so they scale properly with other bonuses of the same amount. Additionally, adjusts these sets to use common tooltips for ease of localization. -Adds 25% ammo saving to Lunic Corps, to be on par with the sets around it (astral, hydrothermic) --- Items/Armor/Auric/AuricTeslaHeadRanged.cs | 11 ++++---- .../Armor/Bloodflare/BloodflareHeadRanged.cs | 9 +++--- Items/Armor/Daedalus/DaedalusHeadRanged.cs | 7 +++-- Items/Armor/GodSlayer/GodSlayerHeadRanged.cs | 9 +++--- .../Hydrothermic/HydrothermicHeadRanged.cs | 7 +++-- Items/Armor/LunicCorps/LunicCorpsHelmet.cs | 5 +++- Items/Armor/PlagueReaper/PlagueReaperMask.cs | 7 +++-- Items/Armor/Tarragon/TarragonHeadRanged.cs | 9 +++--- ...ods.CalamityMod.Items.Armor.Hardmode.hjson | 7 +++-- ...CalamityMod.Items.Armor.PostMoonLord.hjson | 28 +++++++++++++------ 10 files changed, 60 insertions(+), 39 deletions(-) diff --git a/Items/Armor/Auric/AuricTeslaHeadRanged.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs index 09e87e4ae4..fa54b263bd 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRanged.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -23,10 +23,8 @@ namespace CalamityMod.Items.Armor.Auric public static float RangedDamageBoost = 0.22f; public static int RangedCritBoost = 20; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); - - // Set Bonus - public static float SetBonusAmmoReduction = 0.7f; + public static float AmmoReduction = 0.7f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost, (1f - AmmoReduction).ToPercent()); public override void SetDefaults() { @@ -43,7 +41,7 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format((1f - SetBonusAmmoReduction).ToPercent()); + player.setBonus = this.GetLocalizedValue("SetBonus"); var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraRanged = true; @@ -53,7 +51,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayerRanged = true; modPlayer.auricSet = true; player.crimsonRegen = true; // Inherited from Bloodflare - modPlayer.ammoCost *= SetBonusAmmoReduction; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; @@ -61,6 +58,8 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index b3d07208e4..52693da3f5 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Armor.Bloodflare public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/BloodflareRangerActivation"); public static float RangedDamageBoost = 0.1f; + public static float AmmoReduction = 0.75f; public static int RangedCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), (1f - AmmoReduction).ToPercent()); // Set Bonus - public static float SetBonusAmmoReduction = 0.75f; public static int SoulCooldown = CalamityUtils.SecondsToFrames(30); public static int SoulDamage = 300; public static int SoulAmount = 16; @@ -45,15 +45,16 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - modPlayer.ammoCost *= SetBonusAmmoReduction; modPlayer.bloodflareSet = true; modPlayer.bloodflareRanged = true; - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds(), (1f - SetBonusAmmoReduction).ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds()); player.crimsonRegen = true; } public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; } diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index 22eff4e7fb..5874e283de 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Items.Armor.Daedalus public static float RangedDamageBoost = 0.13f; public static int RangedCritBoost = 7; - // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public static float AmmoReduction = 0.8f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost, (1f - AmmoReduction).ToPercent()); // Set Bonus public static int ShardDamage => CalamityUtils.ScaleWithDifficulty(30); @@ -47,9 +47,10 @@ namespace CalamityMod.Items.Armor.Daedalus public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; - player.ammoCost80 = true; } public override void AddRecipes() diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs index e7c9442336..2ebf7198d3 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Armor.GodSlayer public static float RangedDamageBoost = 0.1f; public static int RangedCritBoost = 12; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public static float AmmoReduction = 0.7f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost, (1f - AmmoReduction).ToPercent()); // Set Bonus public static int ShrapnelRoundCooldown = CalamityUtils.SecondsToFrames(2.5f); - public static float SetBonusAmmoReduction = 0.7f; public static double ShrapnelRoundDamageRatio = 1D; public static int ShrapnelRoundDamageSoftcap = 800; @@ -41,11 +41,10 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - modPlayer.ammoCost *= SetBonusAmmoReduction; modPlayer.godSlayer = true; modPlayer.godSlayerRanged = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds(), (1f - SetBonusAmmoReduction).ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { @@ -56,6 +55,8 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs index 728599f3c6..929c234733 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Items.Armor.Hydrothermic public static float RangedDamageBoost = 0.12f; public static int RangedCritBoost = 10; - // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public static float AmmoReduction = 0.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost, (1f - AmmoReduction).ToPercent()); // Set Bonus public static int FlareCooldown = CalamityUtils.SecondsToFrames(0.33f); @@ -49,9 +49,10 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; - player.ammoCost75 = true; } public override void AddRecipes() diff --git a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs index 911258eb47..1bcb8f392c 100644 --- a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs +++ b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Items.Armor.LunicCorps public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; public static float NonArrowDamageBoost = 0.15f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(NonArrowDamageBoost.ToPercent()); + public static float AmmoReduction = 0.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(NonArrowDamageBoost.ToPercent(), (1f - AmmoReduction).ToPercent()); // Set Bonus public static float SetBonusJumpSpeedBoost = 1f; @@ -94,6 +95,8 @@ namespace CalamityMod.Items.Armor.LunicCorps public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.bulletDamage += NonArrowDamageBoost; player.specialistDamage += NonArrowDamageBoost; player.nightVision = true; diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index 22a247b1e7..d0567771bb 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Armor.PlagueReaper public static float RangedDamageBoost = 0.1f; public static int RangedCritBoost = 8; - // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public static float AmmoReduction = 0.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost, (1f - AmmoReduction).ToPercent()); // Set Bonus public static float SetBonusFlightTimeBoost = 0.05f; @@ -63,9 +63,10 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; - player.ammoCost75 = true; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonHeadRanged.cs b/Items/Armor/Tarragon/TarragonHeadRanged.cs index beb9911ca5..1245b69731 100644 --- a/Items/Armor/Tarragon/TarragonHeadRanged.cs +++ b/Items/Armor/Tarragon/TarragonHeadRanged.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Items.Armor.Tarragon public static float RangedDamageBoost = 0.1f; public static int RangedCritBoost = 7; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public static float AmmoReduction = 0.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost, (1f - AmmoReduction).ToPercent()); // Set Bonus public static int OnHitEffectCooldown = CalamityUtils.SecondsToFrames(1); - public static float SetBonusAmmoReduction = 0.75f; public static float LeafDamageRatio = 0.25f; public static int LeafDamageSoftcap = 150; public static float EnergyDamageRatio = 0.33f; @@ -46,14 +46,15 @@ namespace CalamityMod.Items.Armor.Tarragon public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - modPlayer.ammoCost *= SetBonusAmmoReduction; modPlayer.tarraSet = true; modPlayer.tarraRanged = true; - player.setBonus = this.GetLocalization("SetBonus").Format((1f - SetBonusAmmoReduction).ToPercent()); + player.setBonus = this.GetLocalizedValue("SetBonus"); } public override void UpdateEquip(Player player) { + var modPlayer = player.Calamity(); + modPlayer.ammoCost *= AmmoReduction; player.GetDamage() += RangedDamageBoost; player.GetCritChance() += RangedCritBoost; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index ad8c019e6e..dd114b12d9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -96,7 +96,7 @@ DaedalusHeadRanged: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} - 20% chance to save ammo + {$Common.AmmoUseReduction@2} ''' SetBonus: Getting hit causes you to emit a blast of crystal shards } @@ -239,7 +239,7 @@ HydrothermicHeadRanged: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} - 25% chance to save ammo + {$Common.AmmoUseReduction@2} ''' SetBonus: ''' @@ -301,6 +301,7 @@ LunicCorpsHelmet: { DisplayName: Lunic Corps Helmet Tooltip: ''' + {$Common.AmmoUseReduction@1} Increases non-bow damage by {0}% Improves vision and shows the location of enemies ''' @@ -394,7 +395,7 @@ PlagueReaperMask: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} - 25% chance to save ammo + {$Common.AmmoUseReduction@2} ''' SetBonus: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 0586cf2fbe..35b2d0b788 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -16,10 +16,13 @@ AuricTeslaCuisses: { AuricTeslaHeadRanged: { DisplayName: Auric Tesla Hooded Facemask - Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}" + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + {$Common.AmmoUseReduction@2} + ''' SetBonus: ''' - {$Common.AmmoUseReduction@0} Ranged Tarragon, Bloodflare and God Slayer armor effects Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' @@ -219,11 +222,14 @@ BloodflareHeadMelee: { BloodflareHeadRanged: { DisplayName: Bloodflare Horned Helm - Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamageCritChance}" + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedRangedDamageCritChance} + {$Common.AmmoUseReduction@1} + ''' SetBonus: "{$BloodflareHeadRanged.SetBonusEffect}" SetBonusEffect: ''' - {$Common.AmmoUseReduction@3} {0} to unleash the lost souls of polterghast to destroy your enemies This effect has a {1} second cooldown Ranged weapons fire bloodsplosion orbs every {2} seconds @@ -447,11 +453,14 @@ GodSlayerHeadMelee: { GodSlayerHeadRanged: { DisplayName: God Slayer Helmet - Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}" + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + {$Common.AmmoUseReduction@2} + ''' SetBonus: "{$GodSlayerHeadRanged.SetBonusEffect}" SetBonusEffect: ''' - {$Common.AmmoUseReduction@3} Ranged weapons fire a god killer shrapnel round every {0} seconds {$GodSlayerChestplate.CommonSetBonus@1} ''' @@ -670,11 +679,14 @@ TarragonHeadMelee: { TarragonHeadRanged: { DisplayName: Tarragon Visage - Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}" + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + {$Common.AmmoUseReduction@2} + ''' SetBonus: "{$TarragonHeadRanged.SetBonusEffect}" SetBonusEffect: ''' - {$Common.AmmoUseReduction@0} Ranged projectiles spawn homing life energy and leaves on enemy hits {$TarragonBreastplate.CommonSetBonus} '''