Updated Necro casters so they cannot spawn while the Bloodshot Eye is present.

This commit is contained in:
FyloZ 2020-06-06 14:52:58 -04:00
parent 4e65dbdfbb
commit 19e09fbedc

View File

@ -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 Microsoft.Xna.Framework;
using System;
using Terraria; using Terraria;
using Terraria.ID; using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
@ -77,7 +80,7 @@ namespace Decimation.Content.NPCs
int width11 = npc.width; int width11 = npc.width;
int height11 = npc.height; int height11 = npc.height;
newColor = default(Color); newColor = default(Color);
int num73 = Dust.NewDust(position12, width11, height11, ModContent.DustType<Dusts.Blood>(), 0f, 0f, 100, newColor, 2.5f); int num73 = Dust.NewDust(position12, width11, height11, ModContent.DustType<Blood>(), 0f, 0f, 100, newColor, 2.5f);
dust3 = Main.dust[num73]; dust3 = Main.dust[num73];
dust3.velocity *= 3f; dust3.velocity *= 3f;
Main.dust[num73].noGravity = true; Main.dust[num73].noGravity = true;
@ -96,7 +99,7 @@ namespace Decimation.Content.NPCs
int width19 = npc.width; int width19 = npc.width;
int height19 = npc.height; int height19 = npc.height;
newColor = default(Color); newColor = default(Color);
int num82 = Dust.NewDust(position20, width19, height19, ModContent.DustType<Dusts.Blood>(), 0f, 0f, 100, newColor, 2.5f); int num82 = Dust.NewDust(position20, width19, height19, ModContent.DustType<Blood>(), 0f, 0f, 100, newColor, 2.5f);
dust3 = Main.dust[num82]; dust3 = Main.dust[num82];
dust3.velocity *= 3f; dust3.velocity *= 3f;
Main.dust[num82].noGravity = true; Main.dust[num82].noGravity = true;
@ -166,7 +169,7 @@ namespace Decimation.Content.NPCs
float speedX = Main.rand.NextFloat(-1, 2); float speedX = Main.rand.NextFloat(-1, 2);
float speedY = 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<Projectiles.Bone>(), 1, 0, npc.target); Projectile.NewProjectile(new Vector2(npc.Center.X + npc.direction * 8, npc.position.Y), new Vector2(speedX, speedY), ModContent.ProjectileType<Bone>(), 1, 0, npc.target);
} }
} }
} }
@ -179,7 +182,7 @@ namespace Decimation.Content.NPCs
float speedX9 = npc.velocity.X * 0.2f; float speedX9 = npc.velocity.X * 0.2f;
float speedY9 = npc.velocity.Y * 0.2f; float speedY9 = npc.velocity.Y * 0.2f;
newColor = default(Color); newColor = default(Color);
int num121 = Dust.NewDust(position27, width26, height26, ModContent.DustType<Dusts.Blood>(), speedX9, speedY9, 100, newColor, 2f); int num121 = Dust.NewDust(position27, width26, height26, ModContent.DustType<Blood>(), speedX9, speedY9, 100, newColor, 2f);
Main.dust[num121].noGravity = true; Main.dust[num121].noGravity = true;
Dust dust13 = Main.dust[num121]; Dust dust13 = Main.dust[num121];
dust13.velocity.X = dust13.velocity.X * 1f; dust13.velocity.X = dust13.velocity.X * 1f;
@ -192,7 +195,7 @@ namespace Decimation.Content.NPCs
public override float SpawnChance(NPCSpawnInfo spawnInfo) public override float SpawnChance(NPCSpawnInfo spawnInfo)
{ {
if (!Main.bloodMoon) return 0; if (!Main.bloodMoon || NPC.AnyNPCs(ModContent.NPCType<BloodshotEye>())) return 0;
return SpawnCondition.OverworldNightMonster.Chance * 0.02f; return SpawnCondition.OverworldNightMonster.Chance * 0.02f;
} }
@ -200,7 +203,7 @@ namespace Decimation.Content.NPCs
{ {
numberKilled++; numberKilled++;
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType<Dusts.Blood>(), npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType<Blood>(), npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f);
if(numberKilled >= 3) if(numberKilled >= 3)
{ {
@ -209,13 +212,13 @@ namespace Decimation.Content.NPCs
if (Main.netMode == 0) if (Main.netMode == 0)
{ {
Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<NPCs.Bloodshot.BloodshotEye>()); NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<BloodshotEye>());
} }
else else
{ {
ModPacket packet = mod.GetPacket(); ModPacket packet = mod.GetPacket();
packet.Write((byte)DecimationModMessageType.SpawnBoss); packet.Write((byte)DecimationModMessageType.SpawnBoss);
packet.Write(ModContent.NPCType<NPCs.Bloodshot.BloodshotEye>()); packet.Write(ModContent.NPCType<BloodshotEye>());
packet.Write(player.whoAmI); packet.Write(player.whoAmI);
packet.Send(); packet.Send();
} }