From 4f467ede7fbb51554c811db90a5febbcf5e372fb Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 27 May 2022 17:38:57 -0500 Subject: [PATCH] 1 - Astrum Aureus doesn't deal contact damage for 2 seconds after teleport phase ends. 2 - Astrum Aureus should now be possible in Malice. 3 - Cal Clone doesn't deal contact damage while her bros are alive. --- NPCs/AstrumAureus/AstrumAureus.cs | 2 ++ NPCs/CalamityAI.cs | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index c028ac5024..a7128bee70 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -80,6 +80,7 @@ namespace CalamityMod.NPCs.AstrumAureus writer.Write(stomping); writer.Write(NPC.alpha); writer.Write(NPC.localAI[2]); + writer.Write(NPC.localAI[3]); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); } @@ -89,6 +90,7 @@ namespace CalamityMod.NPCs.AstrumAureus stomping = reader.ReadBoolean(); NPC.alpha = reader.ReadInt32(); NPC.localAI[2] = reader.ReadSingle(); + NPC.localAI[3] = reader.ReadSingle(); for (int i = 0; i < 4; i++) NPC.Calamity().newAI[i] = reader.ReadSingle(); } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 6557177690..3f8c1ed831 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -20,7 +20,6 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Audio; using System; using Terraria; using Terraria.ID; @@ -1665,6 +1664,7 @@ namespace CalamityMod.NPCs } npc.alpha = npc.dontTakeDamage ? 255 : 0; + npc.damage = npc.dontTakeDamage ? 0 : npc.defDamage; // Float above target and fire lasers or fireballs if (npc.ai[1] == 0f) @@ -2421,6 +2421,13 @@ namespace CalamityMod.NPCs bool postMoonLordBuff = NPC.downedMoonlord && !BossRushEvent.BossRushActive; npc.damage = postMoonLordBuff ? npc.defDamage * 2 : npc.defDamage; + // Don't deal contact damage for 2 seconds after the teleport phase to avoid cheap bullshit + if (npc.localAI[3] > 0f) + { + npc.localAI[3] -= 1f; + npc.damage = 0; + } + // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -2438,7 +2445,7 @@ namespace CalamityMod.NPCs if (Main.dayTime || malice) { npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 2f; + enrageScale += 1f; } // Get a target @@ -2480,12 +2487,16 @@ namespace CalamityMod.NPCs if (npc.timeLeft > 60) npc.timeLeft = 60; - if (npc.ai[0] != 1f) + if (npc.ai[0] != 0f) { - npc.ai[0] = 1f; + npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; + npc.localAI[2] = 0f; + npc.localAI[3] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = 0f; npc.netUpdate = true; } return; @@ -2827,6 +2838,7 @@ namespace CalamityMod.NPCs { npc.ai[0] = phase2 ? (Main.rand.NextBool() ? (phase3 ? 2f : 1f) : 5f) : (Main.rand.NextBool() ? 2f : 1f); npc.ai[2] = 0f; + npc.ai[3] = 0f; npc.netUpdate = true; } else @@ -2835,6 +2847,7 @@ namespace CalamityMod.NPCs npc.direction = playerLocation < 0 ? 1 : -1; npc.ai[0] = 3f; + npc.ai[3] = 0f; npc.netUpdate = true; } @@ -3132,6 +3145,7 @@ namespace CalamityMod.NPCs npc.alpha = 0; npc.ai[0] = phase3 ? (Main.rand.NextBool() ? 3f : 2f) : (Main.rand.NextBool() ? 1f : 2f); npc.ai[2] = 0f; + npc.localAI[3] = 120f; npc.netUpdate = true; }