diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index c6b3218cf8..96898e2192 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -250,6 +250,9 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = Main.npc[(int)NPC.ai[2]].Opacity; } + // Copy the damage state of the head + NPC.damage = Main.npc[(int)NPC.ai[2]].damage == 0 ? 0 : NPC.defDamage; + NPC aheadSegment = Main.npc[(int)NPC.ai[1]]; Vector2 directionToNextSegment = aheadSegment.Center - NPC.Center; if (aheadSegment.rotation != NPC.rotation) @@ -345,7 +348,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override bool CanHitPlayer(Player target, ref int cooldownSlot) { - if (Main.npc[(int)NPC.ai[2]].dontTakeDamage) return false; cooldownSlot = ImmunityCooldownID.Bosses; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 352bf5c3c0..0e3cd4c729 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -798,6 +798,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.Opacity >= 1f) { + // Don't do contact damage while flying away after laser walls + NPC.damage = 0; NPC.Opacity = 1f; laserWallPhase = (int)LaserWallPhase.SetUp; @@ -2299,6 +2301,7 @@ namespace CalamityMod.NPCs.DevourerofGods AwaitingPhase2Teleport = false; NPC.Opacity = 1f - (postTeleportTimer / 255f); NPC.velocity = Vector2.Normalize(AdjustedPlayerCenter(10) - NPC.Center) * chargeVelocity; + NPC.damage = NPC.defDamage; NPC.ForceNetUpdate(false); NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; foreach (NPC n in Main.ActiveNPCs) diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index b420b42454..76374999e1 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -152,7 +152,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.life = Main.npc[(int)NPC.ai[2]].life; NPC.lifeMax = Main.npc[(int)NPC.ai[2]].lifeMax; - // Percent life remaining float lifeRatio = Main.npc[(int)NPC.ai[2]].life / (float)Main.npc[(int)NPC.ai[2]].lifeMax; @@ -249,6 +248,9 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = Main.npc[(int)NPC.ai[2]].Opacity; } + // Copy the damage state of the head + NPC.damage = Main.npc[(int)NPC.ai[2]].damage == 0 ? 0 : NPC.defDamage; + Vector2 segmentDirection = NPC.Center; float playerXDist = player.position.X + (player.width / 2); float playerYDist = player.position.Y + (player.height / 2);