From 2b1b6fe6d3494469219b06575a72dd43dbb4c522 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 11 Jun 2020 02:31:27 -0500 Subject: [PATCH] Nuclear Toad spawn limit cap --- Events/AcidRainEvent.cs | 2 ++ NPCs/CalamityGlobalNPC.cs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 4d72473cef..26dc6bd101 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Events // A partially bright pale-ish cyan with a hint of yellow. public static readonly Color TextColor = new Color(115, 194, 147); + public static int MaxNuclearToadCount = 5; // To prevent the things from spamming. This happens frequently in pre-HM. + public const int InvasionNoKillPersistTime = 14400; // How long the invasion persists, in frames, if nothing is killed. public const float BloodwormSpawnRate = 0.1f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8e3596754e..8889300312 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4128,7 +4128,7 @@ namespace CalamityMod.NPCs { pool.Clear(); - if (!(CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 2)) + if (!(CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 1)) { Dictionary PossibleEnemies = AcidRainEvent.PossibleEnemiesPreHM; Dictionary PossibleMinibosses = new Dictionary(); @@ -4190,6 +4190,10 @@ namespace CalamityMod.NPCs } } } + if (NPC.CountNPCS(NPCType()) >= AcidRainEvent.MaxNuclearToadCount) + { + pool.Remove(NPCType()); + } } } }