From 6c42598693a1626ec668585f5cfb2a92f9bc5cfd Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 22 Feb 2024 22:11:56 -0600 Subject: [PATCH] 1 - Fixed some issues with Master Mode Rev+ Skeletron Prime bombs. 2 - Fixed some weird-looking movement problems with Skeletron (will do Prime soon too). --- NPCs/CalamityGlobalNPC.cs | 4 +- .../VanillaNPCOverrides/Bosses/SkeletronAI.cs | 223 ++++++++---------- Projectiles/CalamityGlobalProjectile.cs | 197 +++++++++++----- 3 files changed, 236 insertions(+), 188 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 10d83979a8..b3a937b078 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6157,8 +6157,8 @@ namespace CalamityMod.NPCs Color eyesColor = new Color(200, 200, 200, 0); if ((Main.masterMode || BossRushEvent.BossRushActive) && CalamityWorld.revenge) { - eyesColor = npc.type == ModContent.NPCType() ? new Color(100, 50, 255, 0) : new Color(200, 255, 0, 0); - for (int i = 0; i < 3; i++) + eyesColor = npc.type == ModContent.NPCType() ? new Color(150, 100, 255, 0) : new Color(255, 255, 0, 0); + for (int i = 0; i < 6; i++) spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); } else diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index 3de13b7d3b..a6ab813e32 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -436,41 +436,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } } - float headYAcceleration = 0.04f + (death ? 0.04f * (1f - lifeRatio) : 0f); - float headYTopSpeed = 3.5f - (death ? 1.75f - lifeRatio : 0f); - float headXAcceleration = 0.08f + (death ? 0.08f * (1f - lifeRatio) : 0f); - float headXTopSpeed = 8.5f - (death ? 4.25f * (1f - lifeRatio) : 0f); - - if (masterMode) - { - headYAcceleration += 0.02f; - headYTopSpeed -= 0.5f; - headXAcceleration += 0.08f; - headXTopSpeed -= 1f; - } - - if (Main.getGoodWorld) - { - headYAcceleration += 0.01f; - headYTopSpeed -= 1f; - headXAcceleration += 0.05f; - headXTopSpeed -= 2f; - } + float headYAcceleration = (Main.getGoodWorld ? 0.07f : masterMode ? 0.06f : 0.04f) + (death ? 0.04f * (1f - lifeRatio) : 0f); + float headYTopSpeed = headYAcceleration * 100f; + float headXAcceleration = (Main.getGoodWorld ? 0.21f : masterMode ? 0.16f : 0.08f) + (death ? 0.08f * (1f - lifeRatio) : 0f); + float headXTopSpeed = headXAcceleration * 100f; + float deceleration = Main.getGoodWorld ? 0.83f : Main.masterMode ? 0.86f : Main.expertMode ? 0.89f : 0.92f; if (bossRush) { headYAcceleration *= 1.25f; - headYTopSpeed *= 0.75f; headXAcceleration *= 1.25f; - headXTopSpeed *= 0.75f; } - float headTopSpeedCap = 0.5f; - if (headYTopSpeed < headTopSpeedCap) - headYTopSpeed = headTopSpeedCap; - if (headXTopSpeed < headTopSpeedCap) - headXTopSpeed = headTopSpeedCap; - float moveAwayGateValue = chargePhaseGateValue - (5f + chargePhaseChangeRate); bool moveAwayBeforeCharge = npc.ai[2] >= moveAwayGateValue; if (moveAwayBeforeCharge) @@ -910,6 +887,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float velocityMultiplier = MathHelper.Lerp(death ? 0.5f : 0.7f, 1f, skeletronLifeRatio); float velocityIncrement = MathHelper.Lerp(0.2f, death ? 0.6f : 0.45f, 1f - skeletronLifeRatio); float handSwipeVelocity = MathHelper.Lerp(16f, death ? 28f : 22f, 1f - skeletronLifeRatio); + float deceleration = Main.getGoodWorld ? 0.78f : Main.masterMode ? 0.82f : Main.expertMode ? 0.86f : 0.9f; + float handSwipeDuration = HandSwipeDistance / handSwipeVelocity; float slapGateValue = HandSlapGateValue; @@ -929,13 +908,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.npc[(int)npc.ai[1]].ai[1] != 0f) { - float maxX = (bossRush ? 4f : death ? 6f : 7f) * velocityMultiplier; - float maxY = (bossRush ? 3f : death ? 4.5f : 5f) * velocityMultiplier; + float maxX = velocityIncrement * 100f * velocityMultiplier; + float maxY = velocityIncrement * 100f * velocityMultiplier; if (npc.Top.Y > Main.npc[(int)npc.ai[1]].Top.Y - 100f * yMultiplier) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.94f; + npc.velocity.Y *= deceleration; npc.velocity.Y -= velocityIncrement; if (npc.velocity.Y > maxY) npc.velocity.Y = maxY; @@ -943,7 +922,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.Top.Y < Main.npc[(int)npc.ai[1]].Top.Y - 100f * yMultiplier) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.94f; + npc.velocity.Y *= deceleration; npc.velocity.Y += velocityIncrement; if (npc.velocity.Y < -maxY) npc.velocity.Y = -maxY; @@ -952,7 +931,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X - 120f * npc.ai[0]) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.94f; + npc.velocity.X *= deceleration; npc.velocity.X -= velocityIncrement; if (npc.velocity.X > maxX) npc.velocity.X = maxX; @@ -961,7 +940,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 120f * npc.ai[0]) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.94f; + npc.velocity.X *= deceleration; npc.velocity.X += velocityIncrement; if (npc.velocity.X < -maxX) npc.velocity.X = -maxX; @@ -993,13 +972,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } } - float maxX = (bossRush ? 4f : death ? 6f : 7f) * velocityMultiplier; - float maxY = (bossRush ? 1f : death ? 2f : 2.5f) * velocityMultiplier; + float maxX = velocityIncrement * 100f * velocityMultiplier; + float maxY = velocityIncrement * 100f * velocityMultiplier; if (npc.Top.Y > Main.npc[(int)npc.ai[1]].Top.Y + 230f * yMultiplier) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.92f; + npc.velocity.Y *= deceleration; npc.velocity.Y -= velocityIncrement; if (npc.velocity.Y > maxY) npc.velocity.Y = maxY; @@ -1007,7 +986,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.Top.Y < Main.npc[(int)npc.ai[1]].Top.Y + 230f * yMultiplier) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.92f; + npc.velocity.Y *= deceleration; npc.velocity.Y += velocityIncrement; if (npc.velocity.Y < -maxY) npc.velocity.Y = -maxY; @@ -1016,7 +995,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0]) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.92f; + npc.velocity.X *= deceleration; npc.velocity.X -= velocityIncrement; if (npc.velocity.X > maxX) npc.velocity.X = maxX; @@ -1025,7 +1004,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0]) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.92f; + npc.velocity.X *= deceleration; npc.velocity.X += velocityIncrement; if (npc.velocity.X < -maxX) npc.velocity.X = -maxX; @@ -1318,63 +1297,49 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.rotation = npc.velocity.X / 15f; - float num161 = 0.02f; - float num162 = 2f; - float num163 = 0.05f; - float num164 = 8f; - if (Main.expertMode) - { - num161 = Main.masterMode ? 0.04f : 0.03f; - num162 = Main.masterMode ? 3f : 4f; - num163 = Main.masterMode ? 0.09f : 0.07f; - num164 = Main.masterMode ? 8.5f : 9.5f; - } - - if (Main.getGoodWorld) - { - num161 += 0.01f; - num162 += 1f; - num163 += 0.05f; - num164 += 2f; - } + float accelerationY = Main.getGoodWorld ? 0.05f : Main.masterMode ? 0.04f : Main.expertMode ? 0.03f : 0.02f; + float maxVelocityY = accelerationY * 100f; + float accelerationX = Main.getGoodWorld ? 0.093f : Main.masterMode ? 0.088f : Main.expertMode ? 0.076f : 0.064f; + float maxVelocityX = accelerationX * 100f; + float deceleration = Main.getGoodWorld ? 0.83f : Main.masterMode ? 0.86f : Main.expertMode ? 0.89f : 0.92f; if (npc.position.Y > Main.player[npc.target].position.Y - 250f) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.98f; + npc.velocity.Y *= deceleration; - npc.velocity.Y -= num161; - if (npc.velocity.Y > num162) - npc.velocity.Y = num162; + npc.velocity.Y -= accelerationY; + if (npc.velocity.Y > maxVelocityY) + npc.velocity.Y = maxVelocityY; } else if (npc.position.Y < Main.player[npc.target].position.Y - 250f) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.98f; + npc.velocity.Y *= deceleration; - npc.velocity.Y += num161; - if (npc.velocity.Y < 0f - num162) - npc.velocity.Y = 0f - num162; + npc.velocity.Y += accelerationY; + if (npc.velocity.Y < -maxVelocityY) + npc.velocity.Y = -maxVelocityY; } if (npc.Center.X > Main.player[npc.target].Center.X) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.98f; + npc.velocity.X *= deceleration; - npc.velocity.X -= num163; - if (npc.velocity.X > num164) - npc.velocity.X = num164; + npc.velocity.X -= accelerationX; + if (npc.velocity.X > maxVelocityX) + npc.velocity.X = maxVelocityX; } if (npc.Center.X < Main.player[npc.target].Center.X) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.98f; + npc.velocity.X *= deceleration; - npc.velocity.X += num163; - if (npc.velocity.X < 0f - num164) - npc.velocity.X = 0f - num164; + npc.velocity.X += accelerationX; + if (npc.velocity.X < 0f - maxVelocityX) + npc.velocity.X = 0f - maxVelocityX; } } else if (npc.ai[1] == 1f) @@ -1553,43 +1518,49 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.npc[(int)npc.ai[1]].ai[1] != 0f) { + float accelerationY = Main.getGoodWorld ? 0.1f : Main.masterMode ? 0.09f : Main.expertMode ? 0.08f : 0.07f; + float maxVelocityY = accelerationY * 100f; + float accelerationX = Main.getGoodWorld ? 0.16f : Main.masterMode ? 0.14f : Main.expertMode ? 0.12f : 0.1f; + float maxVelocityX = accelerationX * 100f; + float deceleration = Main.getGoodWorld ? 0.81f : Main.masterMode ? 0.84f : Main.expertMode ? 0.87f : 0.9f; + if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 100f) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.96f; + npc.velocity.Y *= deceleration; - npc.velocity.Y -= (Main.masterMode ? 0.09f : 0.07f); - if (npc.velocity.Y > 6f) - npc.velocity.Y = 6f; + npc.velocity.Y -= accelerationY; + if (npc.velocity.Y > maxVelocityY) + npc.velocity.Y = maxVelocityY; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 100f) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.96f; + npc.velocity.Y *= deceleration; - npc.velocity.Y += (Main.masterMode ? 0.09f : 0.07f); - if (npc.velocity.Y < -6f) - npc.velocity.Y = -6f; + npc.velocity.Y += accelerationY; + if (npc.velocity.Y < -maxVelocityY) + npc.velocity.Y = -maxVelocityY; } if (npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X - 120f * npc.ai[0]) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.96f; + npc.velocity.X *= deceleration; - npc.velocity.X -= (Main.masterMode ? 0.12f : 0.1f); - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + npc.velocity.X -= accelerationX; + if (npc.velocity.X > maxVelocityX) + npc.velocity.X = maxVelocityX; } if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 120f * npc.ai[0]) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.96f; + npc.velocity.X *= deceleration; - npc.velocity.X += (Main.masterMode ? 0.12f : 0.1f); - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + npc.velocity.X += accelerationX; + if (npc.velocity.X < -maxVelocityX) + npc.velocity.X = -maxVelocityX; } } else @@ -1607,85 +1578,91 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.netUpdate = true; } + float accelerationY = Main.getGoodWorld ? 0.07f : Main.masterMode ? 0.06f : Main.expertMode ? 0.05f : 0.04f; + float maxVelocityY = accelerationY * 100f; + float accelerationX = Main.getGoodWorld ? 0.13f : Main.masterMode ? 0.11f : Main.expertMode ? 0.09f : 0.07f; + float maxVelocityX = accelerationX * 100f; + float deceleration = Main.getGoodWorld ? 0.88f : Main.masterMode ? 0.9f : Main.expertMode ? 0.92f : 0.94f; + if (Main.expertMode) { if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 230f) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.96f; + npc.velocity.Y *= deceleration; - npc.velocity.Y -= (Main.masterMode ? 0.06f : 0.04f); - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; + npc.velocity.Y -= accelerationY; + if (npc.velocity.Y > maxVelocityY) + npc.velocity.Y = maxVelocityY; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 230f) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.96f; + npc.velocity.Y *= deceleration; - npc.velocity.Y += (Main.masterMode ? 0.06f : 0.04f); - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; + npc.velocity.Y += accelerationY; + if (npc.velocity.Y < -maxVelocityY) + npc.velocity.Y = -maxVelocityY; } if (npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0]) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.96f; + npc.velocity.X *= deceleration; - npc.velocity.X -= (Main.masterMode ? 0.09f : 0.07f); - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + npc.velocity.X -= accelerationX; + if (npc.velocity.X > maxVelocityX) + npc.velocity.X = maxVelocityX; } if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0]) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.96f; + npc.velocity.X *= deceleration; - npc.velocity.X += (Main.masterMode ? 0.09f : 0.07f); - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + npc.velocity.X += accelerationX; + if (npc.velocity.X < -maxVelocityX) + npc.velocity.X = -maxVelocityX; } } if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 230f) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.96f; + npc.velocity.Y *= deceleration; - npc.velocity.Y -= (Main.masterMode ? 0.06f : 0.04f); - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; + npc.velocity.Y -= accelerationY; + if (npc.velocity.Y > maxVelocityY) + npc.velocity.Y = maxVelocityY; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 230f) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.96f; + npc.velocity.Y *= deceleration; - npc.velocity.Y += (Main.masterMode ? 0.06f : 0.04f); - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; + npc.velocity.Y += accelerationY; + if (npc.velocity.Y < -maxVelocityY) + npc.velocity.Y = -maxVelocityY; } if (npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0]) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.96f; + npc.velocity.X *= deceleration; - npc.velocity.X -= (Main.masterMode ? 0.09f : 0.07f); - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + npc.velocity.X -= accelerationX; + if (npc.velocity.X > maxVelocityX) + npc.velocity.X = maxVelocityX; } if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0]) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.96f; + npc.velocity.X *= deceleration; - npc.velocity.X += (Main.masterMode ? 0.09f : 0.07f); - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + npc.velocity.X += accelerationX; + if (npc.velocity.X < -maxVelocityX) + npc.velocity.X = -maxVelocityX; } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 59132d6081..2d29bfd106 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1685,62 +1685,8 @@ namespace CalamityMod.Projectiles // Blow up when within a certain distance of the target if (Vector2.Distance(projectile.Center, Main.player[target].Center) < 16f) { - SoundEngine.PlaySound(SoundID.Item14, projectile.position); - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 22; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - - for (int num951 = 0; num951 < 20; num951++) - { - int num952 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); - Dust dust2 = Main.dust[num952]; - dust2.velocity *= 1.4f; - } - - int num950 = 6; - for (int num953 = 0; num953 < 10; num953++) - { - int num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[num954].noGravity = true; - Dust dust2 = Main.dust[num954]; - dust2.velocity *= 5f; - num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 1.5f); - dust2 = Main.dust[num954]; - dust2.velocity *= 3f; - } - - int num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - Gore gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y -= 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y -= 1f; - - Vector2 vector76 = projectile.position; - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 128; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - projectile.Damage(); - projectile.position = vector76; - projectile.width = projectile.height = 22; + projectile.Kill(); + return false; } if (masterModeSkeletronPrimeHomingBomb) @@ -3529,18 +3475,123 @@ namespace CalamityMod.Projectiles } #endregion - #region Kill - public override void OnKill(Projectile projectile, int timeLeft) + public override bool PreKill(Projectile projectile, int timeLeft) { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); + bool masterRevSkeletronPrimeBomb = projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && Main.masterMode; + bool revQueenBeeBeeHive = projectile.type == ProjectileID.BeeHive && (CalamityWorld.revenge || BossRushEvent.BossRushActive) && (projectile.ai[2] == 1f || CalamityWorld.death) && projectile.wet; + + if (revQueenBeeBeeHive) + { + SoundEngine.PlaySound(SoundID.NPCDeath1, projectile.Center); + for (int num573 = 0; num573 < 30; num573++) + { + int num574 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 147); + if (Main.rand.NextBool()) + { + Dust dust2 = Main.dust[num574]; + dust2.scale *= 1.4f; + } + + projectile.velocity *= 1.9f; + } + } + if (projectile.owner == Main.myPlayer) { - if (projectile.type == ProjectileID.BeeHive && (CalamityWorld.revenge || BossRushEvent.BossRushActive) && (projectile.ai[2] == 1f || CalamityWorld.death) && projectile.wet) + if (masterRevSkeletronPrimeBomb) + { + SoundEngine.PlaySound(SoundID.Item14, projectile.position); + projectile.position.X += projectile.width / 2; + projectile.position.Y += projectile.height / 2; + projectile.width = projectile.height = 22; + projectile.position.X -= projectile.width / 2; + projectile.position.Y -= projectile.height / 2; + + for (int num951 = 0; num951 < 20; num951++) + { + int num952 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Dust dust2 = Main.dust[num952]; + dust2.velocity *= 1.4f; + } + + int num950 = 6; + for (int num953 = 0; num953 < 10; num953++) + { + int num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num954].noGravity = true; + Dust dust2 = Main.dust[num954]; + dust2.velocity *= 5f; + num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 1.5f); + dust2 = Main.dust[num954]; + dust2.velocity *= 3f; + } + + int num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); + Gore gore2 = Main.gore[num955]; + gore2.velocity *= 0.4f; + Main.gore[num955].velocity.X += 1f; + Main.gore[num955].velocity.Y += 1f; + num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); + gore2 = Main.gore[num955]; + gore2.velocity *= 0.4f; + Main.gore[num955].velocity.X -= 1f; + Main.gore[num955].velocity.Y += 1f; + num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); + gore2 = Main.gore[num955]; + gore2.velocity *= 0.4f; + Main.gore[num955].velocity.X += 1f; + Main.gore[num955].velocity.Y -= 1f; + num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); + gore2 = Main.gore[num955]; + gore2.velocity *= 0.4f; + Main.gore[num955].velocity.X -= 1f; + Main.gore[num955].velocity.Y -= 1f; + + Vector2 vector76 = projectile.position; + projectile.position.X += projectile.width / 2; + projectile.position.Y += projectile.height / 2; + projectile.width = projectile.height = 128; + projectile.position.X -= projectile.width / 2; + projectile.position.Y -= projectile.height / 2; + projectile.Damage(); + projectile.position = vector76; + projectile.width = projectile.height = 22; + + if (Main.getGoodWorld && !Main.remixWorld) + { + int num1011 = 4; + Vector2 center3 = projectile.position; + int num1012 = num1011; + int num1013 = num1011; + int num1014 = (int)(center3.X / 16f - (float)num1012); + int num1015 = (int)(center3.X / 16f + (float)num1012); + int num1016 = (int)(center3.Y / 16f - (float)num1013); + int num1017 = (int)(center3.Y / 16f + (float)num1013); + if (num1014 < 0) + num1014 = 0; + + if (num1015 > Main.maxTilesX) + num1015 = Main.maxTilesX; + + if (num1016 < 0) + num1016 = 0; + + if (num1017 > Main.maxTilesY) + num1017 = Main.maxTilesY; + + bool wallSplode2 = projectile.ShouldWallExplode(center3, num1011, num1014, num1015, num1016, num1017); + projectile.ExplodeTiles(center3, num1011, num1014, num1015, num1016, num1017, wallSplode2); + } + + if (Main.netMode != NetmodeID.SinglePlayer) + NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); + } + + else if (revQueenBeeBeeHive) { if (Main.netMode != NetmodeID.MultiplayerClient) { - int beeAmt = Main.rand.Next(2, 4); + int beeAmt = Main.rand.Next(2, 6); int availableAmountOfNPCsToSpawnUpToSlot = NPC.GetAvailableAmountOfNPCsToSpawnUpToSlot(beeAmt); for (int i = 0; i < availableAmountOfNPCsToSpawnUpToSlot; i++) { @@ -3552,8 +3603,28 @@ namespace CalamityMod.Projectiles Main.npc[beeSpawn].netUpdate = true; } } - } + if (Main.netMode != NetmodeID.SinglePlayer) + NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); + } + } + + if (masterRevSkeletronPrimeBomb || revQueenBeeBeeHive) + { + projectile.active = false; + return false; + } + + return true; + } + + #region Kill + public override void OnKill(Projectile projectile, int timeLeft) + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (projectile.owner == Main.myPlayer) + { if (!projectile.npcProj && !projectile.trap) { if (projectile.CountsAsClass())