Aquatic Scourge takes up no NPC slots while non-hostile and will despawn if taken outside the Sulphur Sea while non-hostile.

This commit is contained in:
mountaindrew10 committed 2023-01-27 23:50:23 -06:00
1 parent 1b2917813a
commit 341efcbbc8
2 files changed
+7 -3

No files matched your search

+2 -1
View File
@@ -52,7 +52,6 @@ namespace CalamityMod.NPCs.AquaticScourge
public override void SetDefaults()
{
NPC.npcSlots = 16f;
NPC.GetNPCDamage();
NPC.Calamity().canBreakPlayerDefense = true;
NPC.width = 90;
@@ -108,6 +107,7 @@ namespace CalamityMod.NPCs.AquaticScourge
writer.Write(NPC.localAI[1]);
writer.Write(NPC.localAI[2]);
writer.Write(NPC.localAI[3]);
writer.Write(NPC.npcSlots);
for (int i = 0; i < 4; i++)
writer.Write(NPC.Calamity().newAI[i]);
}
@@ -118,6 +118,7 @@ namespace CalamityMod.NPCs.AquaticScourge
NPC.localAI[1] = reader.ReadSingle();
NPC.localAI[2] = reader.ReadSingle();
NPC.localAI[3] = reader.ReadSingle();
NPC.npcSlots = reader.ReadSingle();
for (int i = 0; i < 4; i++)
NPC.Calamity().newAI[i] = reader.ReadSingle();
}
+5 -2
View File
@@ -47,15 +47,18 @@ namespace CalamityMod.NPCs
CalamityGlobalNPC.aquaticScourge = npc.whoAmI;
// Adjust hostility and stats
bool nonHostile = calamityGlobalNPC.newAI[0] == 0f;
if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || bossRush || Main.getGoodWorld)
{
if (calamityGlobalNPC.newAI[0] == 0f)
if (nonHostile)
{
// Kiss my motherfucking ass you piece of shit game
npc.timeLeft *= 20;
npc.npcSlots = 16f;
CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime);
calamityGlobalNPC.KillTime = revKillTime;
calamityGlobalNPC.newAI[0] = 1f;
nonHostile = false;
npc.boss = head;
npc.chaseable = true;
npc.netUpdate = true;
@@ -359,7 +362,7 @@ namespace CalamityMod.NPCs
}
float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f;
if (player.dead || Vector2.Distance(npc.Center, player.Center) > maxDistance)
if (player.dead || Vector2.Distance(npc.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged))
{
calamityGlobalNPC.newAI[1] = 1f;
npc.TargetClosest(false);