From 0317ddc49a0336486da7bdf5309d78631cc80900 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 22 Jun 2020 20:58:47 -0500 Subject: [PATCH] 1 - Fixed Deus sync. 2 - Adjusted Deus spawn resist to work in all modes. --- NPCs/CalamityAI.cs | 3 +++ NPCs/CalamityGlobalNPC.cs | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 43bf763c30..7ce2354444 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -2872,6 +2872,7 @@ namespace CalamityMod.NPCs { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray); + netMessage.Write((byte)npc2); netMessage.Write(Main.npc[npc2].Calamity().newAI[0]); netMessage.Write(Main.npc[npc2].Calamity().newAI[1]); netMessage.Write(Main.npc[npc2].Calamity().newAI[2]); @@ -2889,6 +2890,7 @@ namespace CalamityMod.NPCs { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray); + netMessage.Write((byte)npc3); netMessage.Write(Main.npc[npc3].Calamity().newAI[0]); netMessage.Write(Main.npc[npc3].Calamity().newAI[1]); netMessage.Write(Main.npc[npc3].Calamity().newAI[2]); @@ -3002,6 +3004,7 @@ namespace CalamityMod.NPCs { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray); + netMessage.Write((byte)lol); netMessage.Write(Main.npc[lol].Calamity().newAI[0]); netMessage.Write(Main.npc[lol].Calamity().newAI[1]); netMessage.Write(Main.npc[lol].Calamity().newAI[2]); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 1f812460ae..3d73f2c3a2 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1417,14 +1417,12 @@ namespace CalamityMod.NPCs public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { // Damage reduction on spawn - if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + bool destroyerResist = DestroyerIDs.Contains(npc.type) && (CalamityWorld.revenge || CalamityWorld.bossRushActive); + if (destroyerResist || AstrumDeusIDs.Contains(npc.type)) { - if (DestroyerIDs.Contains(npc.type) || AstrumDeusIDs.Contains(npc.type)) + if (newAI[1] < 480f || (newAI[2] > 0f && DestroyerIDs.Contains(npc.type))) { - if (newAI[1] < 480f || (newAI[2] > 0f && DestroyerIDs.Contains(npc.type))) - { - damage *= 0.01; - } + damage *= 0.01; } }