diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 1865635b72..573da6aa4e 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1243,7 +1243,7 @@ namespace CalamityMod.NPCs // Phases bool phase3 = lifeRatio < 0.7f; bool phase4 = lifeRatio < 0.35f; - bool phase5 = npc.life / (float)npc.lifeMax < 0.1f && revenge; + bool phase5 = npc.life / (float)npc.lifeMax <= 0.1f && revenge; // Don't take damage during bullet hells npc.dontTakeDamage = calamityGlobalNPC.newAI[2] > 0f; @@ -1609,13 +1609,25 @@ namespace CalamityMod.NPCs else { npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; npc.ai[3] = 0f; npc.localAI[1] = 0f; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; npc.alpha = 0; + + // Prevent bullshit charge hits when second bullet hell ends. + if (phase5) + { + npc.ai[1] = 4f; + npc.ai[2] = -105f; + npc.TargetClosest(); + } + else + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; for (int x = 0; x < Main.maxProjectiles; x++) @@ -2756,16 +2768,8 @@ namespace CalamityMod.NPCs // Start up if (npc.ai[0] == 0f) { - // If hit or after two seconds start Idle phase - npc.ai[1] += 1f; - if (npc.justHit || npc.ai[1] >= 120f || malice) - { - // Set AI to next phase (Idle) and reset other AI - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.netUpdate = true; - } - + npc.ai[0] = 1f; + npc.netUpdate = true; CustomGravity(); } @@ -2782,11 +2786,12 @@ namespace CalamityMod.NPCs npc.ai[1] += 1f; if (npc.ai[1] >= 120f || malice) { - // Increase defense + // Increase defense and damage npc.defense = npc.defDefense; + npc.damage = npc.defDamage; // Stop colliding with tiles - npc.noTileCollide = true; + npc.noTileCollide = true; // Set AI to next phase (Walk) and reset other AI npc.TargetClosest(); @@ -3093,8 +3098,11 @@ namespace CalamityMod.NPCs // Teleport else if (npc.ai[0] == 5f) { - // Slow down - npc.velocity.X *= 0.9f; + // Don't deal damage + npc.damage = 0; + + // Slow down + npc.velocity.X *= 0.9f; // Spawn slimes and start teleport if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index c381f247ea..9edd604af6 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; using System; using System.IO; using Microsoft.Xna.Framework; @@ -282,10 +281,11 @@ namespace CalamityMod.NPCs.OldDuke { spawnedProjectiles = true; int spawnX = npc.width / 2; - int damage = Main.expertMode ? 55 : 70; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < 2; i++) Projectile.NewProjectile(npc.Center.X + Main.rand.Next(-spawnX, spawnX), npc.Center.Y, - Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), type, damage, 0f, Main.myPlayer); } return true; diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index affb836f3f..3834ce27e5 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -241,15 +241,19 @@ namespace CalamityMod.NPCs.OldDuke spawnedProjectiles = true; int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = Main.expertMode ? 55 : 70; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int k = 0; k < totalProjectiles; k++) { float velocity = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? Main.rand.Next(6, 10) : Main.rand.Next(7, 11); Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 360; } - Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + + type = ModContent.ProjectileType(); + damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); } return true; diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 2d40303951..7222f1488a 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Polterghast int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); float maxVelocity = 8f * tileEnrageMult; - float acceleration = 1.05f + (tileEnrageMult - 1f) * 0.1f; + float acceleration = 1.15f + (tileEnrageMult - 1f) * 0.15f; Projectile.NewProjectile(npc.Center, direction, type, damage, 1f, npc.target, maxVelocity, acceleration); } npc.ai[2] = 0f; diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 0a4af076a9..7c32b2fcf2 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Ravager npc.height = 80; npc.defense = 40; npc.DR_NERD(0.15f); - npc.lifeMax = 23000; + npc.lifeMax = 16352; npc.knockBackResist = 0f; aiType = -1; npc.noGravity = true; @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Ravager } if (BossRushEvent.BossRushActive) { - npc.lifeMax = 31500; + npc.lifeMax = 22500; } double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); diff --git a/Utilities/MathematicalUtils.cs b/Utilities/MathematicalUtils.cs index a84e2ecc1c..8f9ace99a5 100644 --- a/Utilities/MathematicalUtils.cs +++ b/Utilities/MathematicalUtils.cs @@ -235,7 +235,7 @@ namespace CalamityMod ratio += (float)Math.Sin(segmentProgress * MathHelper.Pi / 2f) * segment.displacement; break; case EasingType.SineInOut: - ratio += (-(float)Math.Cos((segmentProgress * MathHelper.Pi) - 1) / 2f) * segment.displacement; + ratio += (-((float)Math.Cos(segmentProgress * MathHelper.Pi) - 1) / 2f) * segment.displacement; break; case EasingType.SineBump: ratio += ((float)Math.Sin(segmentProgress * MathHelper.Pi)) * segment.displacement; diff --git a/Utilities/NPCStats.cs b/Utilities/NPCStats.cs index 9bad0f1295..255c1e0dfd 100644 --- a/Utilities/NPCStats.cs +++ b/Utilities/NPCStats.cs @@ -742,11 +742,11 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 260, 288, 304, 432 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 212, 236, 248, 354 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 256, 366 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 240, 264, 276, 390 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 400, 440, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 264, 292, 396 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 252, 272, 378 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 256, 366 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 240, 264, 276, 390 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 288, 316, 332, 468 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 240, 264, 276, 390 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 320, 456 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 300, 332, 348, 498 } },