From f2564445ca735133ed76d144c4015ea25b07fd10 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Tue, 11 Aug 2020 13:07:59 -0500 Subject: [PATCH] 1 - Fixed an exploit with the RE weapons. 2 - Reduced how many small slimes the Slime Gods spawn as they take damage. 3 - Hopefully fixed Astrum Deus in Boss Rush. --- Items/Weapons/Typeless/FiniteUse/Bazooka.cs | 3 ++- .../Typeless/FiniteUse/ElephantKiller.cs | 17 +++++++++-------- Items/Weapons/Typeless/FiniteUse/Hydra.cs | 17 +++++++++-------- .../Weapons/Typeless/FiniteUse/LightningHawk.cs | 17 +++++++++-------- Items/Weapons/Typeless/FiniteUse/Magnum.cs | 17 +++++++++-------- NPCs/CalamityAI.cs | 4 ++-- NPCs/CalamityGlobalNPCLoot.cs | 3 +-- NPCs/SlimeGod/SlimeGod.cs | 2 +- NPCs/SlimeGod/SlimeGodRun.cs | 2 +- NPCs/SlimeGod/SlimeGodRunSplit.cs | 2 +- NPCs/SlimeGod/SlimeGodSplit.cs | 2 +- 11 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs index 047b1f6d2a..a15d10c70a 100644 --- a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs +++ b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs @@ -72,7 +72,8 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { if (CalamityPlayer.areThereAnyDamnBosses) { - for (int i = 0; i < 58; i++) + player.inventory[player.selectedItem].Calamity().timesUsed++; + for (int i = 0; i < Main.maxInventory; i++) { if (player.inventory[i].type == item.type) { diff --git a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs index b5dc650ec2..65ff91d229 100644 --- a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs +++ b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs @@ -74,14 +74,15 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { if (CalamityPlayer.areThereAnyDamnBosses) { - for (int i = 0; i < 58; i++) - { - if (player.inventory[i].type == item.type) - { - player.inventory[i].Calamity().timesUsed++; - } - } - } + player.inventory[player.selectedItem].Calamity().timesUsed++; + for (int i = 0; i < Main.maxInventory; i++) + { + if (player.inventory[i].type == item.type) + { + player.inventory[i].Calamity().timesUsed++; + } + } + } return true; } diff --git a/Items/Weapons/Typeless/FiniteUse/Hydra.cs b/Items/Weapons/Typeless/FiniteUse/Hydra.cs index 0bf0ebd7b2..44a54cf9f7 100644 --- a/Items/Weapons/Typeless/FiniteUse/Hydra.cs +++ b/Items/Weapons/Typeless/FiniteUse/Hydra.cs @@ -78,14 +78,15 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse } if (CalamityPlayer.areThereAnyDamnBosses) { - for (int i = 0; i < 58; i++) - { - if (player.inventory[i].type == item.type) - { - player.inventory[i].Calamity().timesUsed++; - } - } - } + player.inventory[player.selectedItem].Calamity().timesUsed++; + for (int i = 0; i < Main.maxInventory; i++) + { + if (player.inventory[i].type == item.type) + { + player.inventory[i].Calamity().timesUsed++; + } + } + } return false; } diff --git a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs index c456560ec9..97b538dd98 100644 --- a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs +++ b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs @@ -73,14 +73,15 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { if (CalamityPlayer.areThereAnyDamnBosses) { - for (int i = 0; i < 58; i++) - { - if (player.inventory[i].type == item.type) - { - player.inventory[i].Calamity().timesUsed++; - } - } - } + player.inventory[player.selectedItem].Calamity().timesUsed++; + for (int i = 0; i < Main.maxInventory; i++) + { + if (player.inventory[i].type == item.type) + { + player.inventory[i].Calamity().timesUsed++; + } + } + } return true; } diff --git a/Items/Weapons/Typeless/FiniteUse/Magnum.cs b/Items/Weapons/Typeless/FiniteUse/Magnum.cs index 3afac8019c..758d926046 100644 --- a/Items/Weapons/Typeless/FiniteUse/Magnum.cs +++ b/Items/Weapons/Typeless/FiniteUse/Magnum.cs @@ -73,14 +73,15 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { if (CalamityPlayer.areThereAnyDamnBosses) { - for (int i = 0; i < 58; i++) - { - if (player.inventory[i].type == item.type) - { - player.inventory[i].Calamity().timesUsed++; - } - } - } + player.inventory[player.selectedItem].Calamity().timesUsed++; + for (int i = 0; i < Main.maxInventory; i++) + { + if (player.inventory[i].type == item.type) + { + player.inventory[i].Calamity().timesUsed++; + } + } + } return true; } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 48b2893baf..1e3b76fc70 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3009,8 +3009,8 @@ namespace CalamityMod.NPCs Main.npc[lol].localAI[3] = 1f; Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].Calamity().newAI[0] = calamityGlobalNPC.newAI[0]; - Main.npc[lol].Calamity().newAI[3] = calamityGlobalNPC.newAI[3]; + Main.npc[lol].Calamity().newAI[0] = Main.npc[Previous].Calamity().newAI[0]; + Main.npc[lol].Calamity().newAI[3] = Main.npc[Previous].Calamity().newAI[3]; if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index f0c9ba81f4..0dc0c026c0 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -14,7 +14,6 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.Bumblebirb; using CalamityMod.NPCs.Calamitas; @@ -489,7 +488,7 @@ namespace CalamityMod.NPCs CalamityUtils.KillAllHostileProjectiles(); CalamityWorld.bossRushHostileProjKillCounter = 3; } - else if (npc.type == ModContent.NPCType()) + else if (npc.type == ModContent.NPCType() && npc.Calamity().newAI[0] != 0f) { CalamityWorld.bossRushStage = 30; CalamityUtils.KillAllHostileProjectiles(); diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index d70d78c6d5..df7745a0f4 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -516,7 +516,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (Main.netMode != NetmodeID.MultiplayerClient) { - int num660 = (int)((double)npc.lifeMax * 0.15); + int num660 = (int)((double)npc.lifeMax * 0.2); if ((float)(npc.life + num660) < bossLife) { bossLife = (float)npc.life; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 4b06132d0a..aac5ad87ca 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -528,7 +528,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (Main.netMode != NetmodeID.MultiplayerClient) { - int num660 = (int)((double)npc.lifeMax * 0.05); + int num660 = (int)((double)npc.lifeMax * 0.15); if ((float)(npc.life + num660) < bossLife) { bossLife = (float)npc.life; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 21203b572b..f254feef31 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -504,7 +504,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (Main.netMode != NetmodeID.MultiplayerClient) { - int num660 = (int)((double)npc.lifeMax * 0.05); + int num660 = (int)((double)npc.lifeMax * 0.15); if ((float)(npc.life + num660) < bossLife) { bossLife = (float)npc.life; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index c295f07f12..862e2d942c 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -498,7 +498,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (Main.netMode != NetmodeID.MultiplayerClient) { - int num660 = (int)((double)npc.lifeMax * 0.15); + int num660 = (int)((double)npc.lifeMax * 0.2); if ((float)(npc.life + num660) < bossLife) { bossLife = (float)npc.life;