From 19e09fbedc51ccb1ebcdcc05d19a32645f39264e Mon Sep 17 00:00:00 2001 From: FyloZ Date: Sat, 6 Jun 2020 14:52:58 -0400 Subject: [PATCH] Updated Necro casters so they cannot spawn while the Bloodshot Eye is present. --- Content/NPCs/NecroCaster.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Content/NPCs/NecroCaster.cs b/Content/NPCs/NecroCaster.cs index 66a9f19..61f9f70 100644 --- a/Content/NPCs/NecroCaster.cs +++ b/Content/NPCs/NecroCaster.cs @@ -1,6 +1,9 @@ -using Decimation.Content.Items.Misc; +using System; +using Decimation.Content.Dusts; +using Decimation.Content.Items.Misc; +using Decimation.Content.NPCs.Bloodshot; +using Decimation.Content.Projectiles; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -77,7 +80,7 @@ namespace Decimation.Content.NPCs int width11 = npc.width; int height11 = npc.height; newColor = default(Color); - int num73 = Dust.NewDust(position12, width11, height11, ModContent.DustType(), 0f, 0f, 100, newColor, 2.5f); + int num73 = Dust.NewDust(position12, width11, height11, ModContent.DustType(), 0f, 0f, 100, newColor, 2.5f); dust3 = Main.dust[num73]; dust3.velocity *= 3f; Main.dust[num73].noGravity = true; @@ -96,7 +99,7 @@ namespace Decimation.Content.NPCs int width19 = npc.width; int height19 = npc.height; newColor = default(Color); - int num82 = Dust.NewDust(position20, width19, height19, ModContent.DustType(), 0f, 0f, 100, newColor, 2.5f); + int num82 = Dust.NewDust(position20, width19, height19, ModContent.DustType(), 0f, 0f, 100, newColor, 2.5f); dust3 = Main.dust[num82]; dust3.velocity *= 3f; Main.dust[num82].noGravity = true; @@ -166,7 +169,7 @@ namespace Decimation.Content.NPCs float speedX = Main.rand.NextFloat(-1, 2); float speedY = Main.rand.NextFloat(-1, 2); - Projectile.NewProjectile(new Vector2(npc.Center.X + npc.direction * 8, npc.position.Y), new Vector2(speedX, speedY), ModContent.ProjectileType(), 1, 0, npc.target); + Projectile.NewProjectile(new Vector2(npc.Center.X + npc.direction * 8, npc.position.Y), new Vector2(speedX, speedY), ModContent.ProjectileType(), 1, 0, npc.target); } } } @@ -179,7 +182,7 @@ namespace Decimation.Content.NPCs float speedX9 = npc.velocity.X * 0.2f; float speedY9 = npc.velocity.Y * 0.2f; newColor = default(Color); - int num121 = Dust.NewDust(position27, width26, height26, ModContent.DustType(), speedX9, speedY9, 100, newColor, 2f); + int num121 = Dust.NewDust(position27, width26, height26, ModContent.DustType(), speedX9, speedY9, 100, newColor, 2f); Main.dust[num121].noGravity = true; Dust dust13 = Main.dust[num121]; dust13.velocity.X = dust13.velocity.X * 1f; @@ -192,7 +195,7 @@ namespace Decimation.Content.NPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (!Main.bloodMoon) return 0; + if (!Main.bloodMoon || NPC.AnyNPCs(ModContent.NPCType())) return 0; return SpawnCondition.OverworldNightMonster.Chance * 0.02f; } @@ -200,7 +203,7 @@ namespace Decimation.Content.NPCs { numberKilled++; for (int i = 0; i < 10; i++) - Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType(), npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType(), npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); if(numberKilled >= 3) { @@ -209,13 +212,13 @@ namespace Decimation.Content.NPCs if (Main.netMode == 0) { Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); } else { ModPacket packet = mod.GetPacket(); packet.Write((byte)DecimationModMessageType.SpawnBoss); - packet.Write(ModContent.NPCType()); + packet.Write(ModContent.NPCType()); packet.Write(player.whoAmI); packet.Send(); }