From 67ecbccf79a0ad240dae1e1a00ac976ccd736686 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Thu, 11 Sep 2025 19:13:15 -0500 Subject: [PATCH] bugfixes --- NPCs/DevourerofGods/DevourerofGodsBody.cs | 13 +++++++------ NPCs/DevourerofGods/DevourerofGodsHead.cs | 7 ++----- NPCs/DevourerofGods/DevourerofGodsTail.cs | 18 +++++++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index e612aa2d03..6b71d81ddb 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.DevourerofGods global.unbreakableDR = true; NPC.chaseable = false; } - NPC.LifeMaxNERB(750000, 900000, 1500000); + NPC.LifeMaxNERB(760000, 910000, 1500000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -149,19 +149,20 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; - if (NPC.life > Main.npc[(int)NPC.ai[1]].life) - NPC.life = Main.npc[(int)NPC.ai[1]].life; + NPC.life = Main.npc[(int)NPC.ai[2]].life; + NPC.lifeMax = Main.npc[(int)NPC.ai[2]].lifeMax;NPC.life = NPC.lifeMax; // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; + float lifeRatio = Main.npc[(int)NPC.ai[2]].life / (float)Main.npc[(int)NPC.ai[2]].lifeMax; bool phase2 = lifeRatio < 0.65f; bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (phase2) + if (phase2 && !phase2Started && Main.npc[(int)NPC.ai[2]].localAI[2] <= 60) { + phase2Started = true; // Once before DoG spawns, set new size @@ -264,7 +265,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Decide segment offset stuff. NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2; - NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * NPC.width; + NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * (phase2Started ? 80 : NPC.width ); NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); // Velocity variables diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index f1e0a49651..2ca5af73be 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -42,11 +42,9 @@ using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.GameContent.Events; using Terraria.GameContent.ItemDropRules; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using static System.Net.Mime.MediaTypeNames; namespace CalamityMod.NPCs.DevourerofGods { @@ -289,6 +287,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToSickness = false; + + NPC.life = NPC.lifeMax; } public override void BossHeadSlot(ref int index) @@ -536,9 +536,6 @@ namespace CalamityMod.NPCs.DevourerofGods // Continuously reset certain things. AttemptingToEnterPortal = false; - // Worm variable - if (NPC.ai[2] > 0f) - NPC.realLife = (int)NPC.ai[2]; // Despawn if (player.dead) diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 5ab1ead78d..7e785a3b8e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.width = 66; NPC.height = 66; NPC.defense = 50; - NPC.LifeMaxNERB(750000, 900000, 1500000); + NPC.LifeMaxNERB(760000, 910000, 1500000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -152,30 +152,26 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; - if (NPC.life > Main.npc[(int)NPC.ai[1]].life) - NPC.life = Main.npc[(int)NPC.ai[1]].life; + NPC.life = Main.npc[(int)NPC.ai[2]].life; + NPC.lifeMax = Main.npc[(int)NPC.ai[2]].lifeMax; + // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; + float lifeRatio = Main.npc[(int)NPC.ai[2]].life / (float)Main.npc[(int)NPC.ai[2]].lifeMax; bool phase2 = lifeRatio < 0.65f; bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (phase2) + if (phase2 && !phase2Started && Main.npc[(int)NPC.ai[2]].localAI[2] <= 60) { phase2Started = true; - - // Once before DoG spawns, set new size - if (Main.npc[(int)NPC.ai[2]].localAI[2] == 60f) - { NPC.position = NPC.Center; NPC.width = (int)(80 * NPC.scale); - NPC.height = (int)(140 * NPC.scale); + NPC.height = (int)(80 * NPC.scale); NPC.frame = new Rectangle(0, 0, 86, 148); NPC.position -= NPC.Size * 0.5f; NPC.ForceNetUpdate(false); - } } if (invinceTime > 0)