diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 4ff11e4435..0ee06d128b 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -137,6 +137,26 @@ namespace CalamityMod.Events } return false; } + public static int NeededEnemyKills + { + get + { + int playerCount = 0; + for (int i = 0; i < Main.player.Length; i++) + { + if (Main.player[i].active) + { + playerCount++; + } + } + if (CalamityWorld.downedPolterghast) + return (int)(180 * Math.Log(playerCount + Math.E - 1)); + else if (CalamityWorld.downedAquaticScourge) + return (int)(125 * Math.Log(playerCount + Math.E - 1)); + else + return (int)(90 * Math.Log(playerCount + Math.E - 1)); + } + } /// /// Attempts to start the Acid Rain event. Will fail if there is another invasion going on or the EoC has not been killed yet (unless you're in hardmode). /// @@ -155,9 +175,7 @@ namespace CalamityMod.Events if (playerCount > 0) { CalamityWorld.rainingAcid = true; - // The E - 1 part is to ensure that we start at 1 as a multiple instead of 0 - // At a maximum of 255 players, the max multiplier is 9.98, or 998 enemies that need to be killed. - CalamityWorld.acidRainPoints = (int)(180 * Math.Log(playerCount + Math.E - 1)); + CalamityWorld.acidRainPoints = NeededEnemyKills; // Make it rain normally if (forceRain) diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 29c31f96b1..45d7c99837 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -115,18 +115,7 @@ namespace CalamityMod.World { get { - int playerCount = 0; - for (int i = 0; i < Main.player.Length; i++) - { - if (Main.player[i].active) - { - playerCount++; - } - } - // The E - 1 part is to ensure that we start at 1 as a multiple instead of 0 - // At a maximum of 255 players, the max multiplier is 9.98, or 998 enemies that need to be killed. - float totalKillsNeeded = (int)(180 * Math.Log(playerCount + Math.E - 1)); - return MathHelper.Clamp(acidRainPoints / totalKillsNeeded, 0f, 1f); + return MathHelper.Clamp(acidRainPoints / (float)AcidRainEvent.NeededEnemyKills, 0f, 1f); } }