From a0e13da37bdc5ae2bb57e6a50123ef9510d246ec Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 23 May 2024 08:48:21 -0500 Subject: [PATCH] Desert Scourge vomit spam fix? --- NPCs/DesertScourge/DesertScourgeHead.cs | 47 +++---------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 405b9dbe4b..4cd787ab44 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -258,47 +258,6 @@ namespace CalamityMod.NPCs.DesertScourge turnSpeed *= 1.2f; } - // Projectile spit (unused, for now) - /*if ((phase2 || death) && revenge && NPC.Distance(Main.player[NPC.target].Center) > 400f && (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) - { - if (NPC.Calamity().newAI[0] % (death ? SpitGateValue_Death : SpitGateValue) == 0f) - { - SoundEngine.PlaySound(SoundID.NPCDeath11, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * (masterMode ? 10f : 8f); - int numProj = death ? 9 : 6; - int spread = masterMode ? 49 : 35; - if (masterMode) - { - numProj += 3; - spread += 14; - } - - float rotation = MathHelper.ToRadians(spread); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - - for (int k = 0; k < 10; k++) - { - int dust = Dust.NewDust(NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, 10, 10, (int)CalamityDusts.SulphurousSeaAcid); - Main.dust[dust].velocity = perturbedSpeed; - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].aiStyle = -1; - Main.projectile[proj].netUpdate = true; - } - } - } - } - }*/ - // Sand splash if (!quickFall) { @@ -591,7 +550,7 @@ namespace CalamityMod.NPCs.DesertScourge float targetDistance = (float)Math.Sqrt((double)(playerX * playerX + targettingPosition * targettingPosition)); // Lunge up towards target - if (burrow && NPC.Center.Y >= burrowTarget - 16f) + if (burrow && NPC.Center.Y >= burrowTarget - 16f && !lungeUpward && !quickFall) { NPC.Calamity().newAI[1] = 1f; NPC.localAI[3] = 0f; @@ -603,7 +562,7 @@ namespace CalamityMod.NPCs.DesertScourge } // Quickly fall back down once above target - if (lungeUpward && NPC.Center.Y <= NPC.Calamity().newAI[3] + LungeUpwardDistanceOffset - LungeUpwardCutoffDistance && Math.Abs(NPC.Center.X - player.Center.X) < 480f) + if (lungeUpward && NPC.Center.Y <= NPC.Calamity().newAI[3] + LungeUpwardDistanceOffset - LungeUpwardCutoffDistance && Math.Abs(NPC.Center.X - player.Center.X) < 480f && !quickFall) { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SoundID.NPCDeath13, NPC.Center); @@ -656,7 +615,9 @@ namespace CalamityMod.NPCs.DesertScourge { NPC.Calamity().newAI[0] = 0f; NPC.Calamity().newAI[1] = 0f; + NPC.Calamity().newAI[3] = 0f; NPC.localAI[3] = 0f; + playRoarSound = false; } if (hide && !player.dead)