From 27fd180bb5f99ddea1ecfc01d17183c57e72a456 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 8 Jan 2023 13:29:41 -0600 Subject: [PATCH] 1 - Man Eaters, Snatchers and Angry Trappers emit glowing spore dust while behind tiles and near the player. 2 - Clingers emit cursed flame dust while behind tiles and near the player. 3 - Made Sunken Sea Fan Coral force the water style to change, this fixes the piss water issue. --- NPCs/CalamityGlobalNPC.cs | 34 +++++++++++++++++++++++++++++++++- Tiles/SunkenSea/FanCoral.cs | 7 ++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 738bee7c55..2a43cf7a74 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4145,7 +4145,7 @@ namespace CalamityMod.NPCs { if (Main.rand.NextBool()) { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 204, 0f, 0f, 150, default(Color), 0.3f); + Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 204, 0f, 0f, 150, default, 0.3f); dust.fadeIn = 0.75f; dust.velocity *= 0.1f; dust.noLight = true; @@ -4153,6 +4153,38 @@ namespace CalamityMod.NPCs } } + // Plants that go through tiles emit spores while inside tiles + else if (npc.type == NPCID.ManEater || npc.type == NPCID.Snatcher || npc.type == NPCID.AngryTrapper) + { + Point point = npc.Center.ToTileCoordinates(); + Tile tileSafely = Framing.GetTileSafely(point); + bool createDust = tileSafely.HasUnactuatedTile && npc.Distance(Main.player[npc.target].Center) < 800f; + if (createDust) + { + if (Main.rand.NextBool(5)) + { + Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 44, 0f, 0f, 250, default, 0.4f); + dust.fadeIn = 0.7f; + } + } + } + + // Clingers emit cursed fire while inside tiles + else if (npc.type == NPCID.Clinger) + { + Point point = npc.Center.ToTileCoordinates(); + Tile tileSafely = Framing.GetTileSafely(point); + bool createDust = tileSafely.HasUnactuatedTile && npc.Distance(Main.player[npc.target].Center) < 800f; + if (createDust) + { + if (Main.rand.NextBool(5)) + { + Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 75, 0f, 0f, 100, default, 1.5f); + dust.noGravity = true; + } + } + } + // Debuff decrements if (debuffResistanceTimer > 0) debuffResistanceTimer--; diff --git a/Tiles/SunkenSea/FanCoral.cs b/Tiles/SunkenSea/FanCoral.cs index c15e036ea6..d345f8ca59 100644 --- a/Tiles/SunkenSea/FanCoral.cs +++ b/Tiles/SunkenSea/FanCoral.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Enums; using Terraria.ModLoader; @@ -25,6 +25,11 @@ namespace CalamityMod.Tiles.SunkenSea base.SetStaticDefaults(); } + public override void NearbyEffects(int i, int j, bool closer) + { + CalamityGlobalTile.SetActiveFountainColor(ModContent.Find("CalamityMod/SunkenSeaWater").Slot); + } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3;