From 4d90c79be951da69babac0c1907b256189bc7551 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 3 Apr 2020 21:31:54 -0400 Subject: [PATCH 1/3] hallowed rune no longer vores enemies --- CalPlayer/CalamityPlayer.cs | 2 ++ CalPlayer/CalamityPlayerMiscEffects.cs | 2 ++ NPCs/CalamityGlobalNPC.cs | 11 ----------- Projectiles/CalamityGlobalProjectile.cs | 12 ++++++++++++ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 55bd36ffd1..b12935fda5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -465,6 +465,7 @@ namespace CalamityMod.CalPlayer public bool starbusterCore = false; public bool starTaintedGenerator = false; public bool hallowedRune = false; + public int hallowedRuneCooldown = 0; public bool silvaWings = false; public int icicleCooldown = 0; @@ -1686,6 +1687,7 @@ namespace CalamityMod.CalPlayer sandCloakCooldown = false; icicleCooldown = 0; statisTimer = 0; + hallowedRuneCooldown = 0; alcoholPoisoning = false; shadowflame = false; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6fee47210a..2ff0afa35a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -918,6 +918,8 @@ namespace CalamityMod.CalPlayer modPlayer.icicleCooldown--; if (modPlayer.statisTimer > 0 && player.dashDelay >= 0) modPlayer.statisTimer = 0; + if (modPlayer.hallowedRuneCooldown > 0) + modPlayer.hallowedRuneCooldown--; // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3e1f66370f..918c94c790 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3640,17 +3640,6 @@ namespace CalamityMod.NPCs } } - if (modPlayer.hallowedPower) - { - if (isSummon && Main.rand.NextBool(4)) - { - Vector2 spawnPosition = npc.Center - new Vector2(0f, 920f).RotatedByRandom(0.3f); - float speed = Main.rand.NextFloat(17f, 23f); - Projectile.NewProjectile(spawnPosition, Vector2.Normalize(npc.Center - spawnPosition) * speed, - ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner); - } - } - if (modPlayer.corrosiveSpine && projectile.Calamity().rogue) { for (int i = 0; i < 3; i++) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 563547e5ce..18e8050294 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1580,6 +1580,18 @@ namespace CalamityMod.Projectiles modPlayer.jellyDmg += (float)num; } } + + if (modPlayer.hallowedPower) + { + if (Main.rand.NextBool(3) && modPlayer.hallowedRuneCooldown <= 0) + { + modPlayer.hallowedRuneCooldown = 60; + Vector2 spawnPosition = npc.Center - new Vector2(0f, 920f).RotatedByRandom(0.3f); + float speed = Main.rand.NextFloat(17f, 23f); + Projectile.NewProjectile(spawnPosition, Vector2.Normalize(npc.Center - spawnPosition) * speed, + ModContent.ProjectileType(), projectile.damage / 3, 3f, projectile.owner); + } + } } } From 494277ec397a2c9a0cb3d456ac3b09168ec9890e Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Fri, 3 Apr 2020 20:44:00 -0500 Subject: [PATCH 2/3] Various acid rain changes --- CalPlayer/CalamityPlayerMiscEffects.cs | 8 +- Events/AcidRainEvent.cs | 1 - ModSupport/WeakReferenceSupport.cs | 1 + NPCs/AcidRain/CragmawMire.cs | 18 +- NPCs/AcidRain/FlakCrab.cs | 2 +- NPCs/AcidRain/IrradiatedSlime.cs | 272 +++---------------------- NPCs/AcidRain/NuclearToad.cs | 3 +- NPCs/CalamityGlobalNPC.cs | 8 +- NPCs/CalamityGlobalNPCLoot.cs | 18 +- 9 files changed, 58 insertions(+), 273 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6fee47210a..1d99f1ca12 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -425,10 +425,12 @@ namespace CalamityMod.CalPlayer int acidDmg = CalamityWorld.downedPolterghast ? 35 : CalamityWorld.downedAquaticScourge ? 25 : 15; - if (player.miscCounter % acidRainDropRate == 0f && Main.rand.NextBool(2)) + if (player.miscCounter % acidRainDropRate == 0f) { - Projectile.NewProjectile(spawnPoint, Vector2.UnitY * Main.rand.NextFloat(7f, 11f), - ModContent.ProjectileType(), acidDmg, 0f); + if (CalamityWorld.downedAquaticScourge && !CalamityWorld.downedPolterghast && Main.rand.NextBool(12)) + { + NPC.NewNPC((int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType()); + } } } } diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 0ee06d128b..3333005a7f 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Events ( ModContent.NPCType(), 0, false ), ( ModContent.NPCType(), 0, true ), ( ModContent.NPCType(), 1, true ), - ( ModContent.NPCType(), 1, false ), ( ModContent.NPCType(), 1, true ), ( ModContent.NPCType(), 1, true ), ( ModContent.NPCType(), 1, true ), diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index eba149a326..5ea4671edb 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -561,6 +561,7 @@ namespace CalamityMod { InvasionDifficulty.TryGetValue("Acid Rain Aquatic Scourge", out float order); List enemies = AcidRainEvent.PossibleEnemiesAS.Select(enemy => enemy.Item1).ToList(); + enemies.Add(ModContent.NPCType()); enemies.AddRange(AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Item1)); List summons = new List() { ItemType(), ItemType() }; List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 6628ac50fb..9d0382d847 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -1,7 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Accessories; -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Enemy; +using CalamityMod.Projectiles.Environment; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -137,6 +137,13 @@ namespace CalamityMod.NPCs.AcidRain } } } + else if (npc.ai[0] % 420f > 300f && npc.ai[0] % 7f == 6f && CalamityWorld.downedPolterghast) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(npc.Center, -Vector2.UnitY.RotatedByRandom(0.6f) * Main.rand.NextFloat(10f, 15f), ModContent.ProjectileType(), 69, 4f, Main.myPlayer, 0f, npc.whoAmI); + } + } if (!Phase2) { @@ -162,14 +169,11 @@ namespace CalamityMod.NPCs.AcidRain if (CalamityWorld.downedPolterghast) { possibleEnemies.Add(ModContent.NPCType()); - possibleEnemies.Add(ModContent.NPCType()); possibleEnemies.Add(ModContent.NPCType()); possibleEnemies.Add(ModContent.NPCType()); } else { - possibleEnemies.Add(ModContent.NPCType()); - possibleEnemies.Add(ModContent.NPCType()); possibleEnemies.Add(ModContent.NPCType()); possibleEnemies.Add(ModContent.NPCType()); } @@ -178,17 +182,17 @@ namespace CalamityMod.NPCs.AcidRain int attempts = 0; while (!WorldGen.InWorld((int)spawnPosition.X / 16, (int)spawnPosition.Y / 16)) { - spawnPosition = npc.Center + Utils.RandomVector2(Main.rand, -360f, 360f); + spawnPosition = npc.Center + Utils.RandomVector2(Main.rand, -460f, 460f); attempts++; if (attempts > 200) return; } attempts = 0; - while (CalamityUtils.TileSelectionSolidSquare((int)spawnPosition.X / 16, (int)spawnPosition.Y / 16, 4, 4) || + while (CalamityUtils.TileSelectionSolidSquare((int)spawnPosition.X / 16, (int)spawnPosition.Y / 16, 8, 8) || CalamityUtils.ParanoidTileRetrieval((int)spawnPosition.X / 16, (int)spawnPosition.Y / 16).liquid != 255) { - spawnPosition = npc.Center + Utils.RandomVector2(Main.rand, -420f, 420f); + spawnPosition = npc.Center + Utils.RandomVector2(Main.rand, -620f, 620f); attempts++; if (attempts > 300) return; diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index 98b0eab990..1819ea2704 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.AcidRain npc.chaseable = false; if (Math.Abs(closest.Center.X - npc.Center.X) < 320f && closest.Center.Y - npc.Top.Y < -60f && - npc.ai[1]++ >= Main.rand.Next(35, 95)) + npc.ai[1]++ >= Main.rand.Next(90, 135)) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index f176fb0eb2..9b676700b8 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -2,11 +2,9 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,6 +12,7 @@ namespace CalamityMod.NPCs.AcidRain { public class IrradiatedSlime : ModNPC { + public bool Falling = true; public override void SetStaticDefaults() { DisplayName.SetDefault("Irradiated Slime"); @@ -45,6 +44,14 @@ namespace CalamityMod.NPCs.AcidRain banner = npc.type; bannerItem = ModContent.ItemType(); } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Falling); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + Falling = reader.ReadBoolean(); + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); @@ -53,252 +60,23 @@ namespace CalamityMod.NPCs.AcidRain public override void AI() { Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.6f, 0.8f, 0.6f); - if (!Main.player[npc.target].dead) + if (Falling) { + npc.TargetClosest(false); + Player player = Main.player[npc.target]; npc.aiStyle = aiType = -1; - npc.noTileCollide = false; - npc.noGravity = false; - if (Main.player[npc.target].dead) - { - npc.TargetClosest(true); - if (Main.player[npc.target].dead) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - } - // Hop around - if (npc.ai[0] == 0f) - { - // Lunge towards player if too far away - if ((Main.player[npc.target].Center - npc.Center).Length() > 900f) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - if (npc.velocity.Y == 0f) - { - npc.TargetClosest(true); - npc.velocity.X = npc.velocity.X * 0.85f; - npc.ai[1] += 1f; - float hopRate = 15f + 30f * ((float)npc.life / (float)npc.lifeMax); - float lungeForwardSpeed = 3f + 4f * (1f - (float)npc.life / (float)npc.lifeMax); - float jumpSpeed = 9f; - if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - { - jumpSpeed += 6f; - } - if (npc.ai[1] > hopRate) - { - npc.ai[3] += 1f; - if (npc.ai[3] >= 3f) - { - npc.ai[3] = 0f; - jumpSpeed *= 2f; - lungeForwardSpeed /= 2f; - } - npc.ai[1] = 0f; - npc.velocity.Y -= jumpSpeed; - npc.velocity.X = lungeForwardSpeed * npc.direction; - } - } - else - { - npc.knockBackResist = 0f; - npc.velocity.X = npc.velocity.X * 0.99f; - if (npc.direction < 0 && npc.velocity.X > -1f) - { - npc.velocity.X = -1f; - } - if (npc.direction > 0 && npc.velocity.X < 1f) - { - npc.velocity.X = 1f; - } - } - npc.ai[2]++; - if (npc.ai[2] > 210f && npc.velocity.Y == 0f && Main.netMode != 1) - { - if (Main.rand.NextBool(2)) - { - npc.ai[0] = 2f; - npc.noTileCollide = true; - npc.velocity.Y = -8f; - } - else - { - npc.ai[0] = 3f; - } - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } - } - // Attempt to fly above the player - else if (npc.ai[0] == 1f) - { - npc.noTileCollide = true; - npc.noGravity = true; - npc.knockBackResist = 0f; - npc.direction = (npc.velocity.X > 0).ToDirectionInt(); - npc.TargetClosest(true); - Vector2 idealPosition = Main.player[npc.target].Center; - idealPosition.Y -= 350f; - Vector2 idealDistanceVector = idealPosition - npc.Center; - if (npc.ai[2] == 1f) - { - npc.ai[1] += 1f; - npc.velocity = (npc.velocity * 4f + npc.DirectionTo(Main.player[npc.target].Center) * 10f) / 5f; - // And slam downward - if (npc.ai[1] > 6f) - { - npc.ai[1] = 0f; - npc.ai[0] = 1.1f; - npc.ai[2] = 0f; - npc.velocity = npc.DirectionTo(Main.player[npc.target].Center) * 10f; - return; - } - } - else - { - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 40f && npc.Center.Y < Main.player[npc.target].Center.Y - 300f) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - return; - } - npc.velocity = (npc.velocity * 5f + Vector2.Normalize(idealDistanceVector) * 10f) / 6f; - return; - } - } - // Slam onto the player - else if (npc.ai[0] == 1.1f) - { - npc.knockBackResist = 0f; - if (npc.ai[2] == 0f && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[2] = 1f; - } - if (npc.Bottom.Y >= Main.player[npc.target].position.Y || npc.velocity.Y <= 0f) - { - npc.ai[1] += 1f; - if (npc.ai[1] > 10f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 2f; - } - } - } - else - { - if (npc.ai[2] == 0f) - { - npc.noTileCollide = true; - npc.noGravity = true; - npc.knockBackResist = 0f; - } - } - float yAcceleration = 0.135f; - npc.velocity.Y += yAcceleration; - if (npc.velocity.Y > 18f) - { - npc.velocity.Y = 18f; - return; - } - } - // Lunge towards the player - else if (npc.ai[0] == 2f) - { - npc.direction = (npc.velocity.X > 0).ToDirectionInt(); - npc.noTileCollide = true; - npc.noGravity = true; - npc.knockBackResist = 0f; - Vector2 idealDistanceVector = Main.player[npc.target].Center - npc.Center; - idealDistanceVector.Y -= 4f; - if (idealDistanceVector.Length() < 120f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - if (Main.rand.NextBool(5)) - { - Projectile.NewProjectile(npc.Center, npc.DirectionTo(Main.player[npc.target].Center) * 8f, ModContent.ProjectileType(), - 41, 4f); - } - } - if (idealDistanceVector.Length() > 3f) - { - idealDistanceVector.Normalize(); - idealDistanceVector *= 9f; - } - npc.velocity = (npc.velocity * 4f + idealDistanceVector) / 5f; - return; - } - // Significant, ground-based lunges - else if (npc.ai[0] == 3f) - { - npc.knockBackResist = 0f; - if (npc.velocity.Y == 0f) - { - npc.TargetClosest(true); - npc.velocity.X = npc.velocity.X * 0.8f; - npc.ai[1] += 1f; - if (npc.ai[1] > 5f) - { - npc.ai[1] = 0f; - npc.velocity.Y = npc.velocity.Y - 4f; - if (Main.player[npc.target].Bottom.Y < npc.Center.Y) - { - npc.velocity.Y -= 1.25f; - } - if (Main.player[npc.target].Bottom.Y < npc.Center.Y - 40f) - { - npc.velocity.Y -= 1.5f; - } - if (Main.player[npc.target].Bottom.Y < npc.Center.Y - 80f) - { - npc.velocity.Y -= 1.75f; - } - if (Main.player[npc.target].Bottom.Y < npc.Center.Y - 120f) - { - npc.velocity.Y -= 2f; - } - if (Main.player[npc.target].Bottom.Y < npc.Center.Y - 160f) - { - npc.velocity.Y -= 2.25f; - } - if (Main.player[npc.target].Bottom.Y < npc.Center.Y - 200f) - { - npc.velocity.Y -= 2.5f; - } - if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - { - npc.velocity.Y -= 2f; - } - npc.velocity.X = 10f * npc.direction; - npc.ai[2] += 1f; - } - } - if (npc.ai[2] >= 3f && npc.velocity.Y == 0f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } - } + npc.noTileCollide = npc.noGravity = true; + if (player.Top.Y < npc.Bottom.Y) + { + npc.noTileCollide = npc.noGravity = false; + Falling = false; + npc.netUpdate = true; + } + else + { + npc.velocity = Vector2.UnitY * 6f; + } } else { @@ -329,7 +107,7 @@ namespace CalamityMod.NPCs.AcidRain } public override void NPCLoot() { - DropHelper.DropItemChance(npc, ModContent.ItemType(), 100); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 30); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index a802b60749..c3c961341e 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AcidRain npc.aiStyle = aiType = -1; npc.damage = 15; - npc.lifeMax = 120; + npc.lifeMax = 60; npc.defense = 3; if (CalamityWorld.downedPolterghast) @@ -42,7 +42,6 @@ namespace CalamityMod.NPCs.AcidRain npc.lifeMax = 420; } - npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 5, 0); for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3e1f66370f..374ab20d60 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4009,6 +4009,7 @@ namespace CalamityMod.NPCs { PossibleEnemies = AcidRainEvent.PossibleEnemiesAS; PossibleMinibosses = AcidRainEvent.PossibleMinibossesAS; + PossibleEnemies.Add((ModContent.NPCType(), 1, false)); } if (CalamityWorld.downedPolterghast) { @@ -4019,7 +4020,10 @@ namespace CalamityMod.NPCs { if (spawnInfo.water || !PossibleEnemies.First(potential => potential.Item1 == enemy).Item3) { - pool.Add(enemy, 1f); + if (!pool.ContainsKey(enemy)) + { + pool.Add(enemy, 1f); + } } } if (PossibleMinibosses.Count > 0) @@ -4028,7 +4032,7 @@ namespace CalamityMod.NPCs { if (spawnInfo.water || !PossibleMinibosses.First(potential => potential.Item1 == enemy).Item3) { - pool.Add(enemy, 0.05f); + pool.Add(enemy, enemy == ModContent.NPCType() ? 0.085f : 0.05f); } } } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index f8d31fdb87..ece6e47634 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1598,25 +1598,23 @@ namespace CalamityMod.NPCs #region Acid Rain private void AcidRainProgression(NPC npc) { - List<(int, int, bool)> PossibleEnemies = AcidRainEvent.PossibleEnemiesPreHM; - List<(int, int, bool)> PossibleMinibosses = new List<(int, int, bool)>(); + List<(int, int, bool)> possibleEnemies = AcidRainEvent.PossibleEnemiesPreHM; if (CalamityWorld.downedAquaticScourge) - PossibleEnemies = AcidRainEvent.PossibleEnemiesAS; + possibleEnemies = AcidRainEvent.PossibleEnemiesAS; if (CalamityWorld.downedPolterghast) - PossibleEnemies = AcidRainEvent.PossibleEnemiesPolter; - if (PossibleEnemies.Select(enemy => enemy.Item1).Contains(npc.type) && CalamityWorld.rainingAcid) + possibleEnemies = AcidRainEvent.PossibleEnemiesPolter; + if (possibleEnemies.Select(enemy => enemy.Item1).Contains(npc.type) && CalamityWorld.rainingAcid) { - CalamityWorld.acidRainPoints -= PossibleEnemies.Find(enemy => enemy.Item1 == npc.type).Item2; + CalamityWorld.acidRainPoints -= possibleEnemies.Find(enemy => enemy.Item1 == npc.type).Item2; if (CalamityWorld.downedPolterghast) { CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke. } } - PossibleMinibosses = CalamityWorld.downedPolterghast ? AcidRainEvent.PossibleMinibossesPolter : PossibleMinibosses; - if (AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Item1).Contains(npc.type) || - AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Item1).Contains(npc.type)) + List<(int, int, bool)> possibleMinibosses = CalamityWorld.downedPolterghast ? AcidRainEvent.PossibleMinibossesPolter : AcidRainEvent.PossibleMinibossesAS; + if (possibleMinibosses.Select(miniboss => miniboss.Item1).Contains(npc.type)) { - CalamityWorld.acidRainPoints -= PossibleMinibosses.Find(enemy => enemy.Item1 == npc.type).Item2; + CalamityWorld.acidRainPoints -= possibleMinibosses.Find(enemy => enemy.Item1 == npc.type).Item2; if (CalamityWorld.downedPolterghast) { CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke. From 18c9224b475b5d9889f004ef7e880885b16be207 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 3 Apr 2020 22:03:16 -0400 Subject: [PATCH 3/3] removed unused variable --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index bda55b518f..69003b4677 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -423,8 +423,6 @@ namespace CalamityMod.CalPlayer int acidRainDropRate = (int)(MathHelper.Clamp(Main.invasionSize * 0.4f, 13.5f, 50) * 2.25); Vector2 spawnPoint = new Vector2(player.Center.X + Main.rand.Next(-1000, 1001), player.Center.Y - Main.rand.Next(700, 801)); - int acidDmg = CalamityWorld.downedPolterghast ? 35 : CalamityWorld.downedAquaticScourge ? 25 : 15; - if (player.miscCounter % acidRainDropRate == 0f) { if (CalamityWorld.downedAquaticScourge && !CalamityWorld.downedPolterghast && Main.rand.NextBool(12))