diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 8c466c9f90..426f6a85a2 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -44,6 +44,7 @@ using ReLogic.Utilities; using CalamityMod.Projectiles.Ranged; using Steamworks; using CalamityMod.Particles; +using Terraria.Utilities.Terraria.Utilities; namespace CalamityMod.NPCs.SupremeCalamitas { @@ -101,9 +102,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas public bool enteredBrothersPhase = false; public bool hasSummonedBrothers = false; public bool cirrus = false; + public bool hasDoneDeathAnim = false; + public bool postMusicHit = false; private const int GiveUpCounterMax = 1200; + private const int musicSyncCounterMax = 2082; // Used to sync a visual with scal's third music track public int giveUpCounter = GiveUpCounterMax; + public int musicSyncCounter = musicSyncCounterMax; public int phaseChange = 0; public int spawnX = 0; public int spawnX2 = 0; @@ -119,11 +124,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas public int hitTimer = 0; public int alicornFrame = 0; public int alicornFrameCounter = 0; + public int dashVisualCounter = 0; public float shieldOpacity = 1f; public float shieldRotation = 0f; public float forcefieldOpacity = 1f; public float forcefieldScale = 1; + public float rotateToPlayer = 0; + public float rotateAwayPlayer = 0; public FrameAnimationType FrameType { @@ -202,6 +210,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public static readonly SoundStyle HurtSound = new("CalamityMod/Sounds/NPCHit/ShieldHit", 3); public static readonly SoundStyle BulletHellSound = new("CalamityMod/Sounds/Custom/SCalSounds/SCalRumble"); public static readonly SoundStyle BulletHellEndSound = new("CalamityMod/Sounds/Custom/SCalSounds/SCalEndBH"); + public static readonly SoundStyle GiveUpSound = new("CalamityMod/Sounds/Custom/SCalSounds/SupremeCalamitasGiveUp"); public SlotId BulletHellRumbleSlot; public static Asset HoodedTexture; @@ -528,6 +537,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (hitTimer > 0) hitTimer--; + if (NPC.dontTakeDamage && !hasDoneDeathAnim) // Dust visuals for shield when immune + { + Vector2 sustVel = new Vector2(-78 * Main.rand.NextFloat(0.95f, 1.05f), 0).RotatedBy(rotateToPlayer + MathHelper.PiOver2).RotatedByRandom(1.4); + Dust sust = Dust.NewDustPerfect(NPC.Center + sustVel, 269, sustVel * Main.rand.NextFloat(0.001f, 0.03f)); + sust.noGravity = true; + sust.scale = Main.rand.NextFloat(0.5f, 0.9f); + sust.alpha = 200; + sust.color = (Main.rand.NextBool() ? Color.Goldenrod : Color.Red); + } + Vector2 hitboxSize = new Vector2(forcefieldScale * 216f / 1.4142f); hitboxSize = Vector2.Max(hitboxSize, new Vector2(42, 44)); if (NPC.Size != hitboxSize) @@ -537,7 +556,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.ai[0] == 1f || NPC.ai[0] == 2f; // Make the shield and forcefield fade away in SCal's acceptance phase. - if (lifeRatio <= 0.01f) + if (lifeRatio <= 0.01f && hasDoneDeathAnim) { shieldOpacity = MathHelper.Lerp(shieldOpacity, 0f, 0.08f); forcefieldScale = MathHelper.Lerp(forcefieldScale, 0f, 0.08f); @@ -777,22 +796,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.damage = 0; NPC.dontTakeDamage = true; - // Make a magic effect over time. - for (int i = 0; i < (attackCastDelay == 0 ? 16 : 1); i++) - { - Vector2 dustSpawnPosition = NPC.Bottom; - float horizontalSpawnOffset = bodyWidth * Main.rand.NextFloat(0.42f, 0.5f); - if (Main.rand.NextBool()) - horizontalSpawnOffset *= -1f; - dustSpawnPosition.X += horizontalSpawnOffset; - - Dust magic = Dust.NewDustPerfect(dustSpawnPosition, 264); - magic.color = Color.Lerp(cirrus ? Color.Pink : Color.Red, cirrus ? Color.Violet : Color.Lerp(Color.Red, Color.Magenta, 0.3f), Main.rand.NextFloat(0.8f)); - magic.noGravity = true; - magic.velocity = Vector2.UnitY * -Main.rand.NextFloat(5f, 9f); - magic.scale = 1f + NPC.velocity.Y * 0.35f; - } - if ((startBattle && !hasSummonedSepulcher1) || (gettingTired && !hasSummonedSepulcher2)) DoHeartsSpawningCastAnimation(player, death); @@ -1147,6 +1150,56 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region FourthAttack + if (lifeRatio <= 0.3f && musicSyncCounter > -120) + musicSyncCounter--; + if (musicSyncCounter <= 126 && musicSyncCounter > 0) + { + forcefieldOpacity = MathHelper.Lerp(forcefieldOpacity, 0.3f, 0.08f); + + if (shieldOpacity > 0f) + shieldOpacity = MathHelper.Lerp(shieldOpacity, 0f, 0.065f); + } + if (musicSyncCounter <= 42 && musicSyncCounter > 0) + { + forcefieldScale = MathHelper.Lerp(forcefieldScale, 0.3f, 0.095f); + } + if (musicSyncCounter == 0 && !postMusicHit) + { + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, cirrus ? Color.Pink : Color.Red, new Vector2(1f, 1f), 0, 0.1f, 4f, 17); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(NPC.Center, Vector2.Zero, cirrus ? Color.Pink : Color.Lerp(Color.Red, Color.Magenta, 0.3f), new Vector2(1f, 1f), 0, 0.05f, 3f, 19); + GeneralParticleHandler.SpawnParticle(pulse2); + for (int i = 0; i < 30; i++) + { + Vector2 orbvel = new Vector2(25, 25).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.2f); + Particle orb = new SparkParticle(NPC.Center + orbvel, orbvel, false, 90, Main.rand.NextFloat(0.95f, 1.85f), Color.Lerp(Color.Red, Color.Magenta, 0.3f)); + GeneralParticleHandler.SpawnParticle(orb); + } + forcefieldOpacity = 0.7f; + forcefieldScale = 1; + postMusicHit = true; + } + if (postMusicHit && lifeRatio > 0.01f && !canDespawn && NPC.ai[1] != 2f) + { + Vector2 velOffset = new Vector2(56, 56).RotatedByRandom(100) * forcefieldScale; + for (int i = 0; i < 2; i++) + { + Dust fust = Dust.NewDustPerfect(NPC.Center + velOffset, Main.rand.NextBool(3) ? 60 : 114); + fust.noGravity = true; + fust.velocity = velOffset * Main.rand.NextFloat(0.05f, 0.2f); + fust.scale = Main.rand.NextFloat(0.3f, 0.8f); + if (Main.rand.NextBool()) + { + Dust sust = Dust.NewDustPerfect(NPC.Center + velOffset, 269, velOffset * Main.rand.NextFloat(0.01f, 0.1f)); + sust.noGravity = true; + sust.scale = Main.rand.NextFloat(0.2f, 0.6f); + sust.alpha = 200; + sust.color = (Main.rand.NextBool() ? Color.Goldenrod : Color.Red); + } + } + + } + if (bulletHellCounter2 < FourthBulletHellEndValue && startFourthAttack) { despawnProj = true; @@ -1526,29 +1579,158 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } } - else + else // Scal gives up { - if (NPC.velocity.Y < 9f) - NPC.velocity.Y += 0.185f; - - NPC.noTileCollide = false; - NPC.noGravity = false; - NPC.damage = 0; - - // Teleport back to the arena on defeat - if (giveUpCounter == GiveUpCounterMax) + // Clear Debuffs DOESNT WORK YET + for (int l = 0; l < NPC.maxBuffs ; ++l) { - Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, cirrus ? Color.Pink : Color.Red); - NPC.Center = initialRitualPosition; + int buffID = NPC.buffType[l]; + + bool shouldHalveDuration = CalamityLists.debuffList.Contains(buffID); + + if (shouldHalveDuration && NPC.buffTime[l] > 2) + NPC.buffTime[l] = 2; } - if (!canDespawn) - NPC.velocity.X *= 0.96f; - if (DownedBossSystem.downedCalamitas && !bossRush) + if (!hasDoneDeathAnim && !bossRush) // Scrapped death animation for Scal { - if (giveUpCounter == 720) + Dust.QuickDustLine(NPC.Center, safeBox.Center() + new Vector2(0, -30), 500f, cirrus ? Color.Pink : Color.Red); + NPC.Center = safeBox.Center() + new Vector2(0, -30); + NPC.velocity = new Vector2(10 * NPC.spriteDirection, -7); + hasDoneDeathAnim = true; + NPC.noTileCollide = false; + NPC.noGravity = false; + NPC.damage = 0; + + /* + // Teleport back to the arena on defeat + if (giveUpCounter == GiveUpCounterMax) { + Dust.QuickDustLine(NPC.Center, initialRitualPosition + new Vector2(0, -30), 500f, cirrus ? Color.Pink : Color.Red); + NPC.Center = initialRitualPosition + new Vector2(0, -30); + NPC.noTileCollide = false; + NPC.noGravity = false; + NPC.damage = 0; + SoundEngine.PlaySound(GiveUpSound with { Volume = 1.7f }, NPC.Center); + } + if (giveUpCounter == 1010) + { + Particle pulse2 = new StaticPulseRing(NPC.Center, Vector2.Zero, Color.Red * 0.55f, new Vector2(1f, 1f), 0f, 5f, 0f, 47); + GeneralParticleHandler.SpawnParticle(pulse2); + } + + if (shieldOpacity > 0f) + shieldOpacity = 0; + if (giveUpCounter > 1000) + forcefieldScale = MathHelper.Lerp(forcefieldScale, 1.55f, 0.045f); + else if (giveUpCounter > 960) + forcefieldScale = MathHelper.Lerp(forcefieldScale, 0.4f, 0.085f); + + if (giveUpCounter > 960) + { + for (int i = 0; i < 2; i++) + { + Vector2 sparkVel = new Vector2(15, 15).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.1f); + GlowOrbParticle orb = new GlowOrbParticle(NPC.Center + sparkVel * (8 * forcefieldScale), sparkVel * Utils.GetLerpValue(1200, 960, giveUpCounter, true), false, 60, Main.rand.NextFloat(0.7f, 1.7f) * Utils.GetLerpValue(1200, 960, giveUpCounter), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); + GeneralParticleHandler.SpawnParticle(orb); + } + + float vibrate = 15 * Utils.GetLerpValue(1200, 960, giveUpCounter, true); + NPC.Center = (initialRitualPosition + new Vector2(0, -30)) + Main.rand.NextVector2Circular(vibrate, vibrate); + } + else + { + if (giveUpCounter == 960) + { + NPC.Center = initialRitualPosition + new Vector2(0, -30); + + Vector2 BurstFXDirection = new Vector2(0, 15); + for (int i = 0; i < 4; i++) + { + SparkParticle spark = new SparkParticle(NPC.Center, (BurstFXDirection) * (i + 1), false, 11, (5f - i * 0.6f) * 3, Color.Lerp(Color.Red, Color.Magenta, Utils.GetLerpValue(-3, 3, i)) * 0.8f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i < 4; i++) + { + SparkParticle spark = new SparkParticle(NPC.Center, (-BurstFXDirection) * (i + 1), false, 11, (5f - i * 0.6f) * 3, Color.Lerp(Color.Red, Color.Magenta, Utils.GetLerpValue(-3, 3, i)) * 0.8f); + GeneralParticleHandler.SpawnParticle(spark); + } + + Particle orb = new CustomPulse(NPC.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.2f, 1.1f, 13); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new CustomPulse(NPC.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Magenta, 0.5f), "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1f, 0.9f, 13); + GeneralParticleHandler.SpawnParticle(orb2); + for (int i = 0; i < 4; i++) + { + Particle orb3 = new CustomPulse(NPC.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.9f, 0.8f, 13); + GeneralParticleHandler.SpawnParticle(orb3); + } + + for (int i = 0; i < 30; i++) + { + GlowOrbParticle burst = new GlowOrbParticle(NPC.Center, (new Vector2(30, 30).RotatedByRandom(100) + new Vector2(0, -2)) * Main.rand.NextFloat(0.1f, 1.2f), true, 120, Main.rand.NextFloat(1.7f, 2.7f), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); + GeneralParticleHandler.SpawnParticle(burst); + } + + NPC.velocity = new Vector2(18 * NPC.spriteDirection, -12); + giveUpCounter = GiveUpCounterMax; + hasDoneDeathAnim = true; + } + } + */ + } + else + { + if (bossRush) + NPC.Center = initialRitualPosition + new Vector2(0, -30); + + if (NPC.velocity.Y < 8f) + NPC.velocity.Y += 0.165f; + if (!canDespawn) + NPC.velocity.X *= 0.965f; + + if (DownedBossSystem.downedCalamitas && !bossRush) + { + if (giveUpCounter == 720) + { + for (int i = 0; i < 24; i++) + { + Dust brimstoneFire = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Square(-24f, 24f), DustID.Torch); + brimstoneFire.color = cirrus ? Color.Pink : Color.Red; + brimstoneFire.velocity = Vector2.UnitY * -Main.rand.NextFloat(2f, 3.25f); + brimstoneFire.scale = Main.rand.NextFloat(0.95f, 1.15f); + brimstoneFire.fadeIn = 1.25f; + brimstoneFire.noGravity = true; + } + + NPC.active = false; + NPC.netUpdate = true; + NPC.NPCLoot(); + } + } + else if (giveUpCounter == 900 && !bossRush) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText1", textColor); + } + else if (giveUpCounter == 600 && !bossRush) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText2", textColor); + } + else if (giveUpCounter == 300 && !bossRush) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText3", textColor); + } + + if (giveUpCounter <= 0) + { + if (bossRush) + { + NPC.chaseable = true; + NPC.dontTakeDamage = false; + return; + } + for (int i = 0; i < 24; i++) { Dust brimstoneFire = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Square(-24f, 24f), DustID.Torch); @@ -1562,44 +1744,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.active = false; NPC.netUpdate = true; NPC.NPCLoot(); - } - } - else if (giveUpCounter == 900 && !bossRush) - { - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText1", textColor); - } - else if (giveUpCounter == 600 && !bossRush) - { - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText2", textColor); - } - else if (giveUpCounter == 300 && !bossRush) - { - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText3", textColor); - } - - if (giveUpCounter <= 0) - { - if (bossRush) - { - NPC.chaseable = true; - NPC.dontTakeDamage = false; return; } - - for (int i = 0; i < 24; i++) - { - Dust brimstoneFire = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Square(-24f, 24f), DustID.Torch); - brimstoneFire.color = cirrus ? Color.Pink : Color.Red; - brimstoneFire.velocity = Vector2.UnitY * -Main.rand.NextFloat(2f, 3.25f); - brimstoneFire.scale = Main.rand.NextFloat(0.95f, 1.15f); - brimstoneFire.fadeIn = 1.25f; - brimstoneFire.noGravity = true; - } - - NPC.active = false; - NPC.netUpdate = true; - NPC.NPCLoot(); - return; } } @@ -1614,10 +1760,27 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.type == ModContent.ProjectileType()) + if (projectile.active) { - if (projectile.timeLeft > 90) - projectile.timeLeft = 90; + if (projectile.type == ModContent.ProjectileType()) + { + if (projectile.timeLeft > 90) + projectile.timeLeft = 90; + } + if (projectile.type == bulletHellblast || + projectile.type == barrage || + projectile.type == wave) + { + if (projectile.timeLeft > 60) + projectile.timeLeft = 60; + } + else if (projectile.type == fireblast || projectile.type == gigablast) + { + projectile.ai[1] = 1f; + + if (projectile.timeLeft > 15) + projectile.timeLeft = 15; + } } } @@ -2167,17 +2330,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.ai[2] += 1f; - // Bonus visuals - if (!canDespawn && NPC.ai[2] < 23) - { - VoidSparkParticle spark2 = new VoidSparkParticle(NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.height) - NPC.velocity * 0.3f, -NPC.velocity.RotatedByRandom(0.15f) * Main.rand.NextFloat(0.9f, 1.2f), false, 9, Main.rand.NextFloat(0.11f, 0.18f) - NPC.ai[2] * 0.0035f, Color.Red); - GeneralParticleHandler.SpawnParticle(spark2); - Dust dashDust = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.height), 182); - dashDust.noGravity = true; - dashDust.velocity = -NPC.velocity.RotatedByRandom(0.15f) * Main.rand.NextFloat(0.9f, 1.2f); - dashDust.scale = Main.rand.NextFloat(0.3f, 0.6f); - } - if (Math.Abs(NPC.velocity.X) > 0.15f) NPC.spriteDirection = (NPC.velocity.X < 0f).ToDirectionInt(); @@ -2684,17 +2836,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Set damage NPC.damage = NPC.defDamage; - // Bonus visuals - if (!canDespawn && NPC.ai[2] < 23) - { - VoidSparkParticle spark2 = new VoidSparkParticle(NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.height) - NPC.velocity * 0.3f, -NPC.velocity.RotatedByRandom(0.15f) * Main.rand.NextFloat(0.9f, 1.2f), false, 9, Main.rand.NextFloat(0.11f, 0.18f) - NPC.ai[2] * 0.0035f, Color.Red); - GeneralParticleHandler.SpawnParticle(spark2); - Dust dashDust = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.height), 182); - dashDust.noGravity = true; - dashDust.velocity = -NPC.velocity.RotatedByRandom(0.15f) * Main.rand.NextFloat(0.9f, 1.2f); - dashDust.scale = Main.rand.NextFloat(0.3f, 0.6f); - } - float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; if (Main.getGoodWorld) @@ -2834,9 +2975,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.rand.NextBool()) // Hand visual post laugh { - GlowOrbParticle orb = new GlowOrbParticle(handPosition, new Vector2(0, -6).RotatedByRandom(0.4) * Main.rand.NextFloat(0.8f, 1.4f), false, 15, Main.rand.NextFloat(0.95f, 1.45f), cirrus ? Color.Magenta : Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.3f), true, true); + GlowOrbParticle orb = new GlowOrbParticle(handPosition, new Vector2(0, -6).RotatedByRandom(0.4) * Main.rand.NextFloat(0.8f, 1.4f), false, 15, Main.rand.NextFloat(0.95f, 1.45f), cirrus ? Color.Magenta : Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); GeneralParticleHandler.SpawnParticle(orb); } + Dust fust = Dust.NewDustPerfect(handPosition, Main.rand.NextBool(3) ? 60 : 114); + fust.noGravity = true; + fust.velocity = new Vector2(0, -6).RotatedByRandom(0.4) * Main.rand.NextFloat(0.8f, 1.4f); + fust.scale = Main.rand.NextFloat(0.3f, 0.65f); FrameChangeSpeed = 0.245f; FrameType = FrameAnimationType.PunchHandCast; @@ -2914,6 +3059,33 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } } + // Bonus visuals + if (!canDespawn && !hasDoneDeathAnim && shieldOpacity >= 0.9f) + { + if (dashVisualCounter < 9) + dashVisualCounter++; + else + { + // Spawn in a helix-style pattern + float sine = (float)Math.Sin(NPC.ai[2] * (0.975f * MathHelper.Clamp(Utils.GetLerpValue(120, 0, dashVisualCounter), 0.5f, 1.1f)) / MathHelper.Pi); + + Vector2 offset = NPC.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 33f; + + SparkParticle spark4 = new SparkParticle(NPC.Center + offset - NPC.velocity.SafeNormalize(Vector2.UnitY) * 15f, -NPC.velocity * 0.85f, false, 10, 1.9f * MathHelper.Clamp(Utils.GetLerpValue(120, 0, dashVisualCounter), 0.5f, 1.1f), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f)); + GeneralParticleHandler.SpawnParticle(spark4); + SparkParticle spark5 = new SparkParticle(NPC.Center - offset - NPC.velocity.SafeNormalize(Vector2.UnitY) * 15f, -NPC.velocity * 0.85f, false, 10, 1.9f * MathHelper.Clamp(Utils.GetLerpValue(120, 0, dashVisualCounter), 0.5f, 1.1f), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f)); + GeneralParticleHandler.SpawnParticle(spark5); + + Dust dashDust = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Circular(NPC.width, NPC.height), 182); + dashDust.noGravity = true; + dashDust.velocity = -NPC.velocity.RotatedByRandom(0.15f) * Main.rand.NextFloat(0.9f, 1.2f); + dashDust.scale = Main.rand.NextFloat(0.6f, 1.4f); + + dashVisualCounter++; + } + } + else + dashVisualCounter = 0; #endregion } @@ -3188,7 +3360,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas CalamityGlobalNPC.SCalEpiphany = -1; CalamityGlobalNPC.SCalAcceptance = -1; - if (startFifthAttack && gettingTired5) + if (startFifthAttack && gettingTired5 && (giveUpCounter < 1160 || hasDoneDeathAnim)) CalamityGlobalNPC.SCalAcceptance = NPC.whoAmI; else if (lifeRatio <= 0.3f) CalamityGlobalNPC.SCalEpiphany = NPC.whoAmI; @@ -3369,7 +3541,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override Color? GetAlpha(Color drawColor) => willCharge ? drawColor * NPC.Opacity * 0.45f : null; + public override Color? GetAlpha(Color drawColor) => willCharge ? Color.Lerp(Color.Red, drawColor, 0.7f) * NPC.Opacity * 0.45f : null; public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { @@ -3453,6 +3625,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas public void DrawForcefield(SpriteBatch spriteBatch) { + Player player = Main.player[NPC.target]; + + float opacity = 1; spriteBatch.EnterShaderRegion(); float intensity = hitTimer / 35f; @@ -3462,20 +3637,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas intensity = 0.75f + Math.Abs((float)Math.Cos(Main.GlobalTimeWrappedHourly * 1.7f)) * 0.1f; // Make the forcefield weaker in the second phase as a means of showing desparation. - if (NPC.ai[0] >= 3f) - intensity *= 0.6f; + //if (NPC.ai[0] >= 3f) + //intensity *= 0.6f; float lifeRatio = NPC.life / (float)NPC.lifeMax; + + if (lifeRatio < 0.05f) + forcefieldOpacity = 0.75f; + if (lifeRatio <= 0.01f) + forcefieldOpacity = 0.6f; + float flickerPower = 0f; if (lifeRatio < 0.6f) flickerPower += 0.1f; if (lifeRatio < 0.3f) - flickerPower += 0.15f; - if (lifeRatio < 0.1f) - flickerPower += 0.2f; + flickerPower += 0.25f; + if (postMusicHit) + flickerPower += 0.61f; if (lifeRatio < 0.05f) - flickerPower += 0.1f; - float opacity = forcefieldOpacity; + flickerPower += Main.rand.NextFloat(0.7f, 1f); + if (lifeRatio <= 0.01f) + flickerPower += 0.08f; + opacity = forcefieldOpacity; opacity *= MathHelper.Lerp(1f, MathHelper.Max(1f - flickerPower, 0.56f), (float)Math.Pow(Math.Cos(Main.GlobalTimeWrappedHourly * MathHelper.Lerp(3f, 5f, flickerPower)), 24D)); // During/prior to a charge the forcefield is always darker than usual and thus its intensity is also higher. @@ -3483,8 +3666,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas intensity = 1.1f; // Dampen the opacity and intensity slightly, to allow SCal to be more easily visible inside of the forcefield. - intensity *= 0.75f; - opacity *= 0.75f; + intensity *= musicSyncCounter <= 0 && musicSyncCounter > -30 ? Utils.GetLerpValue(120, 0, musicSyncCounter, true) : 0.75f; + opacity *= musicSyncCounter <= 0 && musicSyncCounter > -30 ? Utils.GetLerpValue(120, 0, musicSyncCounter, true) : 0.75f; Texture2D forcefieldTexture = ForcefieldTexture.Value; GameShaders.Misc["CalamityMod:SupremeShield"].UseImage1("Images/Misc/Perlin"); @@ -3505,12 +3688,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas GameShaders.Misc["CalamityMod:SupremeShield"].UseSecondaryColor(secondaryForcefieldColor); GameShaders.Misc["CalamityMod:SupremeShield"].UseColor(forcefieldColor); - GameShaders.Misc["CalamityMod:SupremeShield"].UseSaturation(intensity); - GameShaders.Misc["CalamityMod:SupremeShield"].UseOpacity(opacity); + GameShaders.Misc["CalamityMod:SupremeShield"].UseSaturation(1); + GameShaders.Misc["CalamityMod:SupremeShield"].UseOpacity(0.65f); GameShaders.Misc["CalamityMod:SupremeShield"].Apply(); - spriteBatch.Draw(forcefieldTexture, NPC.Center - Main.screenPosition, null, Color.White * opacity, 0f, forcefieldTexture.Size() * 0.5f, forcefieldScale * 3f, SpriteEffects.None, 0f); + Texture2D centerTexture = ModContent.Request("CalamityMod/Particles/CentralGold").Value; + rotateToPlayer = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation() + MathHelper.PiOver2; + rotateAwayPlayer = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation() - MathHelper.PiOver2; + + Texture2D immuneTex = ModContent.Request("CalamityMod/Particles/SemiCircularSmearVertical").Value; + if (postMusicHit) + spriteBatch.Draw(centerTexture, NPC.Center - Main.screenPosition, null, (Color.White with { A = 0 } * opacity) * 2f, rotateAwayPlayer, centerTexture.Size() * 0.5f, forcefieldScale * 0.088f, SpriteEffects.None, 0f); + if (!NPC.dontTakeDamage) + spriteBatch.Draw(forcefieldTexture, NPC.Center - Main.screenPosition, null, Color.White * opacity, postMusicHit ? rotateToPlayer : 0, forcefieldTexture.Size() * 0.5f, forcefieldScale * 3f, SpriteEffects.None, 0f); + else + spriteBatch.Draw(immuneTex, NPC.Center - Main.screenPosition, null, Color.White * opacity * 0.3f, rotateToPlayer, immuneTex.Size() * 0.5f, forcefieldScale * 1.35f, SpriteEffects.None, 0f); spriteBatch.ExitShaderRegion(); } diff --git a/Particles/CentralGold.png b/Particles/CentralGold.png new file mode 100644 index 0000000000..f91e12cdb7 Binary files /dev/null and b/Particles/CentralGold.png differ diff --git a/Particles/SemiCircularSmearVertical.png b/Particles/SemiCircularSmearVertical.png new file mode 100644 index 0000000000..40306fac87 Binary files /dev/null and b/Particles/SemiCircularSmearVertical.png differ diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 28a4668823..26e2f2f0d7 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -99,9 +99,9 @@ namespace CalamityMod.Projectiles.Boss trailDust.velocity = (-Projectile.velocity * 0.5f) * Main.rand.NextFloat(0.1f, 0.9f); trailDust.scale = Main.rand.NextFloat(0.2f, 0.6f); } - else if (Projectile.timeLeft % 2 == 0 && targetDist < 1400f) + else if (targetDist < 1400f) { - SparkParticle orb = new SparkParticle(Projectile.Center - Projectile.velocity * 0.5f, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.6f), false, (int)MathHelper.Clamp(9 * Utils.GetLerpValue(510, 690, Projectile.timeLeft), 2, 9), 1.1f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * Projectile.Opacity * 0.85f); + SparkParticle orb = new SparkParticle(Projectile.Center - Projectile.velocity * 0.5f, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.6f), false, (int)MathHelper.Clamp(9 * Utils.GetLerpValue(630, 690, Projectile.timeLeft), 2, 9), 1.1f, (Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f)) * Projectile.Opacity * 0.85f); GeneralParticleHandler.SpawnParticle(orb); } diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index f3008b73ba..9ffe0d9afd 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -106,10 +106,10 @@ namespace CalamityMod.Projectiles.Boss spawnDust.noGravity = true; spawnDust.scale = Main.rand.NextFloat(1.7f, 2.8f) - Projectile.scale * 1.5f; } - for (int i = 0; i < 4; i++) + for (int i = 0; i < 3; i++) { Vector2 sparkVel = new Vector2(20, 20).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.1f); - GlowOrbParticle orb = new GlowOrbParticle(Projectile.Center + sparkVel * 2 * (Projectile.scale * 5), sparkVel, false, 120, Main.rand.NextFloat(1.55f, 2.75f) - Projectile.scale * 1.5f, Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); + GlowOrbParticle orb = new GlowOrbParticle(Projectile.Center + sparkVel * 2 * (Projectile.scale * 5), sparkVel, false, 60, Main.rand.NextFloat(1.55f, 2.75f) - Projectile.scale * 1.5f, Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); GeneralParticleHandler.SpawnParticle(orb); } } diff --git a/Sounds/Custom/SCalSounds/SupremeCalamitasGiveUp.ogg b/Sounds/Custom/SCalSounds/SupremeCalamitasGiveUp.ogg new file mode 100644 index 0000000000..03dcd515f7 Binary files /dev/null and b/Sounds/Custom/SCalSounds/SupremeCalamitasGiveUp.ogg differ