diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 3ec55ca2d1..460c2f5a1b 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -43,8 +43,8 @@ namespace CalamityMod.NPCs.AstrumAureus npc.npcSlots = 15f; npc.GetNPCDamage(); npc.Calamity().canBreakPlayerDefense = true; - npc.width = 400; - npc.height = 280; + npc.width = 426; + npc.height = 374; npc.defense = 40; npc.DR_NERD(0.15f); npc.LifeMaxNERB(NPC.downedMoonlord ? 230000 : 84000, NPC.downedMoonlord ? 292500 : 107000, 740000); // 30 seconds in boss rush @@ -423,15 +423,12 @@ namespace CalamityMod.NPCs.AstrumAureus // Can only hit the target if within certain distance public override bool CanHitPlayer(Player target, ref int cooldownSlot) { - /*Vector2 npcCenter = new Vector2(npc.Center.X, npc.Center.Y + 8f); + Vector2 npcCenter = npc.Center; // NOTE: Right and left hitboxes are interchangeable, each hitbox is the same size and is located to the right or left of the center hitbox. - // Width = 83, Height = 107 - Rectangle leftHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 2f)), (int)(npcCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); - // Width = 166, Height = 214 - Rectangle bodyHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 4f)), (int)(npcCenter.Y - (npc.height / 2f)), npc.width / 2, npc.height); - // Width = 83, Height = 107 - Rectangle rightHitbox = new Rectangle((int)(npcCenter.X + (npc.width / 4f)), (int)(npcCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); + Rectangle leftHitbox = new Rectangle((int)(npcCenter.X - 93f - 5f + 4f), (int)(npcCenter.Y + 33f - 5f), 10, 10); + Rectangle bodyHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 4f)), (int)(npcCenter.Y - (npc.height / 2f) + 24f), npc.width / 2, npc.height); + Rectangle rightHitbox = new Rectangle((int)(npcCenter.X + 93f - 5f - 4f), (int)(npcCenter.Y + 33f - 5f), 10, 10); Vector2 leftHitboxCenter = new Vector2(leftHitbox.X + (leftHitbox.Width / 2), leftHitbox.Y + (leftHitbox.Height / 2)); Vector2 bodyHitboxCenter = new Vector2(bodyHitbox.X + (bodyHitbox.Width / 2), bodyHitbox.Y + (bodyHitbox.Height / 2)); @@ -452,7 +449,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (leftDist4 < minLeftDist) minLeftDist = leftDist4; - bool insideLeftHitbox = minLeftDist <= 55f; + bool insideLeftHitbox = minLeftDist <= 120f; float bodyDist1 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopLeft()); float bodyDist2 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopRight()); @@ -467,7 +464,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (bodyDist4 < minBodyDist) minBodyDist = bodyDist4; - bool insideBodyHitbox = minBodyDist <= 110f; + bool insideBodyHitbox = minBodyDist <= 160f; float rightDist1 = Vector2.Distance(rightHitboxCenter, targetHitbox.TopLeft()); float rightDist2 = Vector2.Distance(rightHitboxCenter, targetHitbox.TopRight()); @@ -482,9 +479,9 @@ namespace CalamityMod.NPCs.AstrumAureus if (rightDist4 < minRightDist) minRightDist = rightDist4; - bool insideRightHitbox = minRightDist <= 55f;*/ + bool insideRightHitbox = minRightDist <= 120f; - return /*(insideLeftHitbox || insideBodyHitbox || insideRightHitbox) &&*/ npc.alpha == 0 && npc.ai[0] > 1f; + return (insideLeftHitbox || insideBodyHitbox || insideRightHitbox) && npc.alpha == 0 && npc.ai[0] > 1f; } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index c8077e7b23..a93060abeb 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -2609,8 +2609,6 @@ namespace CalamityMod.NPCs #region Astrum Aureus public static void AstrumAureusAI(NPC npc, Mod mod) { - npc.gfxOffY = -46; - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool postMoonLordBuff = NPC.downedMoonlord && !BossRushEvent.BossRushActive; diff --git a/NPCs/Crabulon/CrabulonAttack.png b/NPCs/Crabulon/CrabulonAttack.png index dfe35810cf..d895eb79c6 100644 Binary files a/NPCs/Crabulon/CrabulonAttack.png and b/NPCs/Crabulon/CrabulonAttack.png differ diff --git a/NPCs/Crabulon/CrabulonAttackGlow.png b/NPCs/Crabulon/CrabulonAttackGlow.png index e0a7336330..0ef19ea41d 100644 Binary files a/NPCs/Crabulon/CrabulonAttackGlow.png and b/NPCs/Crabulon/CrabulonAttackGlow.png differ diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 621631fce8..e0d7263293 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -37,8 +37,8 @@ namespace CalamityMod.NPCs.Crabulon npc.Calamity().canBreakPlayerDefense = true; npc.npcSlots = 14f; npc.GetNPCDamage(); - npc.width = 280; - npc.height = 160; + npc.width = 312; + npc.height = 196; npc.defense = 8; npc.LifeMaxNERB(3000, 4000, 1100000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; @@ -74,8 +74,6 @@ namespace CalamityMod.NPCs.Crabulon { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - npc.gfxOffY = -16; - Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0.3f, 0.7f); bool enraged = calamityGlobalNPC.enraged > 0; @@ -611,12 +609,71 @@ namespace CalamityMod.NPCs.Crabulon } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - return npc.ai[0] > 1f; - } + // Can only hit the target if within certain distance + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + Vector2 npcCenter = npc.Center; - public override void FindFrame(int frameHeight) + // NOTE: Right and left hitboxes are interchangeable, each hitbox is the same size and is located to the right or left of the center hitbox. + Rectangle leftHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 2f) + 6f), (int)(npcCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); + Rectangle bodyHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 4f)), (int)(npcCenter.Y - (npc.height / 2f)), npc.width / 2, npc.height); + Rectangle rightHitbox = new Rectangle((int)(npcCenter.X + (npc.width / 4f) - 6f), (int)(npcCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); + + Vector2 leftHitboxCenter = new Vector2(leftHitbox.X + (leftHitbox.Width / 2), leftHitbox.Y + (leftHitbox.Height / 2)); + Vector2 bodyHitboxCenter = new Vector2(bodyHitbox.X + (bodyHitbox.Width / 2), bodyHitbox.Y + (bodyHitbox.Height / 2)); + Vector2 rightHitboxCenter = new Vector2(rightHitbox.X + (rightHitbox.Width / 2), rightHitbox.Y + (rightHitbox.Height / 2)); + + Rectangle targetHitbox = target.Hitbox; + + float leftDist1 = Vector2.Distance(leftHitboxCenter, targetHitbox.TopLeft()); + float leftDist2 = Vector2.Distance(leftHitboxCenter, targetHitbox.TopRight()); + float leftDist3 = Vector2.Distance(leftHitboxCenter, targetHitbox.BottomLeft()); + float leftDist4 = Vector2.Distance(leftHitboxCenter, targetHitbox.BottomRight()); + + float minLeftDist = leftDist1; + if (leftDist2 < minLeftDist) + minLeftDist = leftDist2; + if (leftDist3 < minLeftDist) + minLeftDist = leftDist3; + if (leftDist4 < minLeftDist) + minLeftDist = leftDist4; + + bool insideLeftHitbox = minLeftDist <= 45f; + + float bodyDist1 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopLeft()); + float bodyDist2 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopRight()); + float bodyDist3 = Vector2.Distance(bodyHitboxCenter, targetHitbox.BottomLeft()); + float bodyDist4 = Vector2.Distance(bodyHitboxCenter, targetHitbox.BottomRight()); + + float minBodyDist = bodyDist1; + if (bodyDist2 < minBodyDist) + minBodyDist = bodyDist2; + if (bodyDist3 < minBodyDist) + minBodyDist = bodyDist3; + if (bodyDist4 < minBodyDist) + minBodyDist = bodyDist4; + + bool insideBodyHitbox = minBodyDist <= 90f; + + float rightDist1 = Vector2.Distance(rightHitboxCenter, targetHitbox.TopLeft()); + float rightDist2 = Vector2.Distance(rightHitboxCenter, targetHitbox.TopRight()); + float rightDist3 = Vector2.Distance(rightHitboxCenter, targetHitbox.BottomLeft()); + float rightDist4 = Vector2.Distance(rightHitboxCenter, targetHitbox.BottomRight()); + + float minRightDist = rightDist1; + if (rightDist2 < minRightDist) + minRightDist = rightDist2; + if (rightDist3 < minRightDist) + minRightDist = rightDist3; + if (rightDist4 < minRightDist) + minRightDist = rightDist4; + + bool insideRightHitbox = minRightDist <= 45f; + + return (insideLeftHitbox || insideBodyHitbox || insideRightHitbox) && npc.ai[0] > 1f; + } + + public override void FindFrame(int frameHeight) { npc.frameCounter += 0.15f; npc.frameCounter %= Main.npcFrameCount[npc.type]; diff --git a/NPCs/Crabulon/CrabulonIdleAlt.png b/NPCs/Crabulon/CrabulonIdleAlt.png index d8955a3930..bb6c27497a 100644 Binary files a/NPCs/Crabulon/CrabulonIdleAlt.png and b/NPCs/Crabulon/CrabulonIdleAlt.png differ diff --git a/NPCs/Crabulon/CrabulonIdleAltGlow.png b/NPCs/Crabulon/CrabulonIdleAltGlow.png index 50feb37a72..cd0c4f8135 100644 Binary files a/NPCs/Crabulon/CrabulonIdleAltGlow.png and b/NPCs/Crabulon/CrabulonIdleAltGlow.png differ diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 3e42569c13..1bed594695 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -691,7 +691,7 @@ namespace CalamityMod.NPCs.Ravager // Can only hit the target if within certain distance public override bool CanHitPlayer(Player target, ref int cooldownSlot) { - Vector2 npcCenter = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 npcCenter = npc.Center; // NOTE: Right and left hitboxes are interchangeable, each hitbox is the same size and is located to the right or left of the center hitbox. // Width = 83, Height = 107