From 816ff2b6811ac0aede8e03d26a6ed9cf30d4fec1 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Fri, 19 Aug 2022 17:00:32 -0400 Subject: [PATCH 1/2] Fixed vanilla dash exploits Also fixed certain weapons ignoring certain vanilla ammo reduction --- CalPlayer/CalamityPlayer.cs | 4 ++-- Items/Accessories/AsgardianAegis.cs | 2 +- Items/Accessories/AsgardsValor.cs | 2 +- Items/Accessories/CounterScarf.cs | 2 +- Items/Accessories/DeepDiver.cs | 2 +- Items/Accessories/ElysianAegis.cs | 2 +- Items/Accessories/EvasionScarf.cs | 2 +- Items/Accessories/OrnateShield.cs | 2 +- Items/Accessories/StatisVoidSash.cs | 2 +- Items/Armor/Plaguebringer/PlaguebringerVisor.cs | 2 +- Items/CalamityGlobalItem.cs | 7 +++++++ 11 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ad250fbdb1..67fa56a2f2 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5699,7 +5699,7 @@ namespace CalamityMod.CalPlayer if (godSlayerDashHotKeyPressed) { // Set the player to have no registered vanilla dashes. - Player.dash = 0; + Player.dashType = 0; // Prevent the possibility of Shield of Cthulhu invulnerability exploits. Player.eocHit = -1; @@ -5768,7 +5768,7 @@ namespace CalamityMod.CalPlayer private void DisableDashes() { // Set the player to have no registered dashes. - Player.dash = 0; + Player.dashType = 0; DashID = string.Empty; // Put the player in a permanent state of dash cooldown. This is removed 1/5 of a second after disabling the effect. diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 17a0347647..b1c867106a 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.DashID = AsgardianAegisDash.ID; - player.dash = 0; + player.dashType = 0; modPlayer.elysianAegis = true; player.noKnockback = true; player.fireWalk = true; diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index b541626398..975574bcc5 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.DashID = AsgardsValorDash.ID; - player.dash = 0; + player.dashType = 0; player.noKnockback = true; player.fireWalk = true; player.buffImmune[BuffID.OnFire] = true; diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index e540a1815d..5c1e3917f3 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.dodgeScarf = true; modPlayer.DashID = CounterScarfDash.ID; - player.dash = 0; + player.dashType = 0; } } } diff --git a/Items/Accessories/DeepDiver.cs b/Items/Accessories/DeepDiver.cs index 39d35ad055..0eb7f5d27a 100644 --- a/Items/Accessories/DeepDiver.cs +++ b/Items/Accessories/DeepDiver.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.deepDiver = true; modPlayer.DashID = DeepDiverDash.ID; - player.dash = 0; + player.dashType = 0; } } } diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index 911e105e49..ed570ab310 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.DashID = ElysianAegisDash.ID; - player.dash = 0; + player.dashType = 0; modPlayer.elysianAegis = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[ModContent.BuffType()] = true; diff --git a/Items/Accessories/EvasionScarf.cs b/Items/Accessories/EvasionScarf.cs index 1119e7d099..c99177d730 100644 --- a/Items/Accessories/EvasionScarf.cs +++ b/Items/Accessories/EvasionScarf.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Accessories modPlayer.dodgeScarf = true; modPlayer.evasionScarf = true; modPlayer.DashID = CounterScarfDash.ID; - player.dash = 0; + player.dashType = 0; } public override void AddRecipes() diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index bbb214bb36..51eb405cea 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories player.statLifeMax2 += 20; } player.Calamity().DashID = OrnateShieldDash.ID; - player.dash = 0; + player.dashType = 0; } public override void AddRecipes() diff --git a/Items/Accessories/StatisVoidSash.cs b/Items/Accessories/StatisVoidSash.cs index fedf579891..a3176b6894 100644 --- a/Items/Accessories/StatisVoidSash.cs +++ b/Items/Accessories/StatisVoidSash.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Accessories player.noFallDmg = true; player.blackBelt = true; modPlayer.DashID = StatisVoidSashDash.ID; - player.dash = 0; + player.dashType = 0; player.spikedBoots = 2; } diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index 5567b1ec4e..9f43d83af3 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer player.Calamity().plaguebringerPatronSet = true; player.Calamity().DashID = PlaguebringerArmorDash.ID; - player.dash = 0; + player.dashType = 0; player.maxMinions += 3; if (player.whoAmI == Main.myPlayer) { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index ae50b4bc37..193a4b8b10 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1013,6 +1013,7 @@ namespace CalamityMod.Items player.GetDamage() -= 0.1f; player.GetCritChance() -= 10; player.setBonus = "Allows the ability to dash"; + modPlayer.DashID = string.Empty; } else if (set == "SquireTier2") { @@ -1688,12 +1689,18 @@ namespace CalamityMod.Items } } + if (player.magicQuiver && (item.useAmmo == AmmoID.Arrow || item.useAmmo == AmmoID.Stake) && Main.rand.NextBool(5)) + dontConsumeAmmo = true; + if (player.huntressAmmoCost90 && Main.rand.NextBool(10)) + dontConsumeAmmo = true; if (player.ammoBox && Main.rand.NextBool(5)) dontConsumeAmmo = true; if (player.ammoPotion && Main.rand.NextBool(5)) dontConsumeAmmo = true; if (player.ammoCost80 && Main.rand.NextBool(5)) dontConsumeAmmo = true; + if (player.chloroAmmoCost80 && Main.rand.NextBool(5)) + dontConsumeAmmo = true; if (player.ammoCost75 && Main.rand.NextBool(4)) dontConsumeAmmo = true; if (Main.rand.NextFloat() > player.Calamity().rangedAmmoCost) From 80ba569c9029506c0eeac33dd35f6c5bd67cddd5 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Fri, 19 Aug 2022 17:26:14 -0400 Subject: [PATCH 2/2] Fixed ore armor tooltips showing in Social slots --- Items/CalamityGlobalItemTooltip.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index e3c855db21..2f9b094b25 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -237,6 +237,10 @@ namespace CalamityMod.Items // For items such as a Copper Helmet which literally have no tooltips at all, add a custom "Tooltip0" which mimics the vanilla Tooltip0. void AddTooltip(string text) { + // Don't add the tooltip if the item is in a social slot + if (item.social) + return; + int defenseIndex = -1; for (int i = 0; i < tooltips.Count; ++i) if (tooltips[i].Name == "Defense")