diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 93038af046..42f996b630 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -98,6 +98,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public bool gettingTired5 = false; //1% public bool willCharge = false; public bool canFireSplitingFireball = true; + public bool fireFireblastFirst = true; public bool spawnArena = false; public bool enteredBrothersPhase = false; public bool hasSummonedBrothers = false; @@ -125,7 +126,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas public int alicornFrame = 0; public int alicornFrameCounter = 0; public int dashVisualCounter = 0; - public int brothersPause = 15; // Helps prevent telefragging + public int preventionPause = 15; // Helps prevent telefragging + public int attackPause = 0; + public bool respawnBro = true; // Master Mode change public float shieldOpacity = 1f; public float shieldRotation = 0f; @@ -1623,6 +1626,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!hasDoneDeathAnim && !bossRush) // Scrapped death animation for Scal { + attackPause = 5; 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); @@ -2027,9 +2031,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (NPC.life > 0) { + if (attackPause > 0) + attackPause--; + if (lifeRatio < 0.45f && !enteredBrothersPhase) { - if (brothersPause == 0) + attackPause = 5; + if (preventionPause == 0) { enteredBrothersPhase = true; attackCastDelay = brothersSpawnCastTime; @@ -2067,7 +2075,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - brothersPause--; + preventionPause--; NPC.dontTakeDamage = true; NPC.velocity *= 0.85f; return; @@ -2234,6 +2242,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.ai[2] >= 300f) { NPC.ai[1] = -1f; + fireFireblastFirst = true; NPC.TargetClosest(); NPC.netUpdate = true; } @@ -2248,7 +2257,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.localAI[1] = 0f; int randomShot = Main.rand.Next(6); - if (randomShot == 0 && canFireSplitingFireball) + + if (randomShot == 0 && canFireSplitingFireball && !fireFireblastFirst) { canFireSplitingFireball = false; randomShot = gigablast; @@ -2267,7 +2277,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.netUpdate = true; } } - else if (randomShot == 1 && canFireSplitingFireball) // Firing gigablast while hovering above pre laugh + else if ((randomShot == 1 && canFireSplitingFireball) || fireFireblastFirst) // Firing gigablast while hovering above pre laugh { canFireSplitingFireball = false; randomShot = fireblast; @@ -2286,7 +2296,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.netUpdate = true; } } - else + else if (!fireFireblastFirst) { canFireSplitingFireball = true; randomShot = barrage; @@ -2311,6 +2321,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } } + fireFireblastFirst = false; } FrameType = FrameAnimationType.FasterUpwardDraft; @@ -2479,7 +2490,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 projectileSpawn = NPC.Center + projectileVelocity * 4f; projectileVelocity *= 10f * uDieLul; int projectileType = hellblast; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); + if (attackPause == 0) + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -2795,6 +2807,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.ai[2] >= 240f) { NPC.ai[1] = -1f; + fireFireblastFirst = true; NPC.TargetClosest(); NPC.netUpdate = true; } @@ -2809,7 +2822,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.localAI[1] = 0f; int randomShot = Main.rand.Next(6); - if (randomShot == 0 && canFireSplitingFireball) // fireblast while floating post laugh + + if (randomShot == 0 && canFireSplitingFireball && !fireFireblastFirst) // fireblast while floating post laugh { SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); canFireSplitingFireball = false; @@ -2826,10 +2840,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.netUpdate = true; } } - else if (randomShot == 1 && canFireSplitingFireball) // Gigablast while floating post laugh + else if ((randomShot == 1 && canFireSplitingFireball) || fireFireblastFirst) // Gigablast while floating post laugh { SoundEngine.PlaySound(BrimstoneShotSound, NPC.Center); - canFireSplitingFireball = false; + if (NPC.ai[2] > 1) + canFireSplitingFireball = false; randomShot = fireblast; Particle pulse = new DirectionalPulseRing(NPC.Center, projectileVelocity * 1.2f, cirrus ? Color.Pink : Color.Red, new Vector2(0.5f, 1f), projectileVelocity.ToRotation(), 0.95f, 0f, 55); @@ -2843,7 +2858,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.netUpdate = true; } } - else + else if (!fireFireblastFirst) { SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); canFireSplitingFireball = true; @@ -2868,6 +2883,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } } + fireFireblastFirst = false; } } else if (NPC.ai[1] == 1f) @@ -3007,7 +3023,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 projectileSpawn = NPC.Center + projectileVelocity * 4f; projectileVelocity *= 10f * uDieLul; int projectileType = hellblast; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); + if (attackPause == 0) + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index cca36fef24..005abccc7d 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -4,6 +4,7 @@ using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.DevourerofGods; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -173,6 +174,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } + NPC scal = Main.npc[CalamityGlobalNPC.SCal]; + if (scal.ModNPC().respawnBro == false && Main.masterMode && !broIsAlive) + { + if (NPC.life > (NPC.lifeMax * 0.65f)) + NPC.life = (int)(NPC.lifeMax * 0.65f); + } + // Difficulty modes bool bossRush = BossRushEvent.BossRushActive; bool death = CalamityWorld.death || bossRush; @@ -326,7 +334,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas { PunchCounter = 0f; SoundEngine.PlaySound(SupremeCalamitas.HellblastSound, NPC.Center); + int type = ModContent.ProjectileType(); + + if (Main.zenithWorld) + type = ModContent.ProjectileType(); + int damage = NPC.GetProjectileDamage(type); if (bossRush) damage /= 2; @@ -391,6 +404,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas PunchCounter = 0f; int type = ModContent.ProjectileType(); + + if (Main.zenithWorld) + type = ModContent.ProjectileType(); + int damage = NPC.GetProjectileDamage(type); if (bossRush) damage /= 2; @@ -398,8 +415,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, (NPC.DirectionTo(Target.Center) * 11f).RotatedBy(0.6f - BigAttackLimit * 0.16f), type, damage, 0f, Main.myPlayer, 0f, 0, 2); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, (NPC.DirectionTo(Target.Center) * 11f).RotatedBy(-0.6f + BigAttackLimit * 0.16f), type, damage, 0f, Main.myPlayer, 0f, 0, 2); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, (NPC.DirectionTo(Target.Center) * (Main.zenithWorld ? 1 : 11f)).RotatedBy(0.6f - BigAttackLimit * 0.16f), type, damage, 0f, Main.myPlayer, 0f, 0, Main.zenithWorld ? 3 : 2); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, (NPC.DirectionTo(Target.Center) * (Main.zenithWorld ? 1 : 11f)).RotatedBy(-0.6f + BigAttackLimit * 0.16f), type, damage, 0f, Main.myPlayer, 0f, 0, Main.zenithWorld ? 3 : 2); SoundStyle fire = new("CalamityMod/Sounds/NPCHit/ThanatosHitOpen1"); SoundEngine.PlaySound(fire with { Volume = 0.4f, Pitch = -0.8f - BigAttackLimit * 0.1f }, NPC.Center); } @@ -407,7 +424,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, NPC.DirectionTo(Target.Center) * 9.5f, type, damage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt(), 3); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, NPC.DirectionTo(Target.Center) * 9.5f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt(), 3); } SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound with { Volume = 1.8f, Pitch = 0.5f }, NPC.Center); SoundStyle charge = new("CalamityMod/Sounds/Item/ScorchedEarthShot", 3); @@ -533,7 +550,35 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Turn into dust on death. if (NPC.life <= 0) + { + if (NPC.AnyNPCs(ModContent.NPCType())) + { + NPC scal = Main.npc[CalamityGlobalNPC.SCal]; + if (scal.ModNPC().respawnBro == true && Main.masterMode && !broIsAlive) + { + for (int i = 0; i < 45; i++) + { + Vector2 vel = new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); + Dust catastrophedust = Dust.NewDustPerfect(NPC.Center + vel * 2, 279, vel); + catastrophedust.noGravity = true; + catastrophedust.scale = Main.rand.NextFloat(1.2f, 1.8f); + catastrophedust.color = Color.DeepSkyBlue; + } + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Cyan, new Vector2(1f, 1f), 0, 0.1f, 5f, 25); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Lerp(Color.Cyan, Color.DodgerBlue, 0.3f), new Vector2(1f, 1f), 0, 0.05f, 4f, 28); + GeneralParticleHandler.SpawnParticle(pulse2); + + SoundStyle respawn = new("CalamityMod/Sounds/NPCKilled/RavagerLimbLoss3"); + SoundEngine.PlaySound(respawn with { Volume = 0.9f, Pitch = 0.3f }, NPC.Center); + + CalamityUtils.SpawnBossBetter(NPC.Center, ModContent.NPCType(), null, MovingUp ? -1 : 1); + scal.ModNPC().respawnBro = false; + } + + } DeathAshParticle.CreateAshesFromNPC(NPC); + } } } } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 06937b263d..c8b5db4dd0 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -167,6 +167,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } + NPC scal = Main.npc[CalamityGlobalNPC.SCal]; + if (scal.ModNPC().respawnBro == false && Main.masterMode && !broIsAlive) + { + if (NPC.life > (NPC.lifeMax * 0.65f)) + NPC.life = (int)(NPC.lifeMax * 0.65f); + } + // Difficulty modes bool bossRush = BossRushEvent.BossRushActive; bool death = CalamityWorld.death || bossRush; @@ -275,17 +282,42 @@ namespace CalamityMod.NPCs.SupremeCalamitas dashes++; if (dashes == 30 && broIsAlive == false) { - SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); - SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f }, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 90f, type, damage, 0f, Main.myPlayer, 0f, 0, 50); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 90f, type, damage, 0f, Main.myPlayer, 0f, 0, 50); - for (int i = 0; i < 30; i++) + if (Main.zenithWorld) { - Vector2 vel = new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); - Dust catastrophedust = Dust.NewDustPerfect(NPC.Center + vel * 2, 279, vel); - catastrophedust.noGravity = true; - catastrophedust.scale = Main.rand.NextFloat(1.2f, 1.8f); - catastrophedust.color = Color.DeepSkyBlue; + SoundStyle charge = new("CalamityMod/Sounds/Item/ExobladeBeamSlash"); + SoundEngine.PlaySound(charge with { Volume = 0.85f, Pitch = -0.5f }, NPC.Center); + NPC.velocity = NPC.DirectionTo(Target.Center) * 150f; + + for (int i = 0; i < 30; i++) + { + Vector2 vel = new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); + Dust catastrophedust = Dust.NewDustPerfect(NPC.Center + vel * 2, 279, vel); + catastrophedust.noGravity = true; + catastrophedust.scale = Main.rand.NextFloat(1.2f, 1.8f); + catastrophedust.color = Color.DeepSkyBlue; + } + dashes = 0; + dashAttackTimer = 30; + BigAttackTimer = 500; + AttackDelayTimer = 120; + if (NPC.life > 10001) + NPC.life -= 10000; + return; + } + else + { + SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); + SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f }, NPC.Center); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 90f, type, damage, 0f, Main.myPlayer, 0f, 0, 50); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 90f, type, damage, 0f, Main.myPlayer, 0f, 0, 50); + for (int i = 0; i < 30; i++) + { + Vector2 vel = new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); + Dust catastrophedust = Dust.NewDustPerfect(NPC.Center + vel * 2, 279, vel); + catastrophedust.noGravity = true; + catastrophedust.scale = Main.rand.NextFloat(1.2f, 1.8f); + catastrophedust.color = Color.DeepSkyBlue; + } } } NPC.velocity *= 0.975f; @@ -349,6 +381,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas SoundEngine.PlaySound(SupremeCalamitas.CatastropheSwing with { Volume = 0.5f, Pitch = (SlashingFromRight ? 0.2f : -0.2f) }, NPC.Center); int type = ModContent.ProjectileType(); + + if (Main.zenithWorld) + type = ModContent.ProjectileType(); + int damage = NPC.GetProjectileDamage(type); if (bossRush) damage /= 2; @@ -368,7 +404,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = 0.4f }, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition, firingVelocity * 0.2f, type, damage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt(), 3); + Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition, firingVelocity * 0.2f, type, damage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt(), Main.zenithWorld ? 0 : 3); accSlashCounter = 0; } } @@ -412,6 +448,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas SlashCounter = 0f; int type = ModContent.ProjectileType(); + + if (Main.zenithWorld) + type = ModContent.ProjectileType(); + int damage = NPC.GetProjectileDamage(type); if (bossRush) damage /= 2; @@ -420,7 +460,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition + firingVelocity * 130, (Phase2 ? NPC.DirectionTo(Target.Center) : firingVelocity) * 90f, type, damage, 0f, Main.myPlayer, 0f, 5, 50); + Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition + firingVelocity * 130, (Phase2 ? NPC.DirectionTo(Target.Center) : firingVelocity) * 90f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 5, 50); SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f - BigAttackLimit * 0.1f }, NPC.Center); } @@ -545,7 +585,35 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Turn into dust on death. if (NPC.life <= 0) + { + if (NPC.AnyNPCs(ModContent.NPCType())) + { + NPC scal = Main.npc[CalamityGlobalNPC.SCal]; + if (scal.ModNPC().respawnBro == true && Main.masterMode && !broIsAlive) + { + for (int i = 0; i < 45; i++) + { + Vector2 vel = new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); + Dust cataclysmdust = Dust.NewDustPerfect(NPC.Center + vel * 2, 279, vel); + cataclysmdust.noGravity = true; + cataclysmdust.scale = Main.rand.NextFloat(1.2f, 1.8f); + cataclysmdust.color = Color.Red; + } + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Red, new Vector2(1f, 1f), 0, 0.1f, 5f, 25); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Magenta, 0.3f), new Vector2(1f, 1f), 0, 0.05f, 4f, 28); + GeneralParticleHandler.SpawnParticle(pulse2); + + SoundStyle respawn = new("CalamityMod/Sounds/NPCKilled/RavagerLimbLoss3"); + SoundEngine.PlaySound(respawn with { Volume = 0.9f, Pitch = 0.3f }, NPC.Center); + + CalamityUtils.SpawnBossBetter(NPC.Center, ModContent.NPCType(), null, MovingUp ? -1 : 1); + scal.ModNPC().respawnBro = false; + } + + } DeathAshParticle.CreateAshesFromNPC(NPC); + } } } } diff --git a/Projectiles/Boss/Basketball.png b/Projectiles/Boss/Basketball.png new file mode 100644 index 0000000000..e090379e6f Binary files /dev/null and b/Projectiles/Boss/Basketball.png differ diff --git a/Projectiles/Boss/SupremeCataclysmFist.cs b/Projectiles/Boss/SupremeCataclysmFist.cs index 5e630ed544..c6aa6cdf6c 100644 --- a/Projectiles/Boss/SupremeCataclysmFist.cs +++ b/Projectiles/Boss/SupremeCataclysmFist.cs @@ -51,98 +51,147 @@ namespace CalamityMod.Projectiles.Boss // The Orb if (Projectile.ai[2] >= 3) { - if (Projectile.timeLeft > 240) + if (Main.zenithWorld) { - shootVel = Projectile.velocity * 0.4f; - Projectile.timeLeft = 240; - rotDirection = Main.rand.NextBool() ? -1 : 1; - Projectile.velocity *= 5.5f; - broIsAlive = NPC.AnyNPCs(ModContent.NPCType()); + if (Projectile.timeLeft > 400) + { + shootVel = Projectile.velocity * 0.4f; + Projectile.timeLeft = 400; + rotDirection = Main.rand.NextBool() ? -1 : 1; + Projectile.velocity *= 6f; + broIsAlive = NPC.AnyNPCs(ModContent.NPCType()); + } + else + { + if (Time > 10) + Projectile.tileCollide = true; + else + Projectile.velocity *= 0.99f; + Projectile.rotation += 0.02f; + } + + if (Projectile.timeLeft == 1) + { + int points = 25; + float radians = MathHelper.TwoPi / points; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-4f, -4f)); + for (int b = 0; b < 2; b++) + { + float rotRando = Main.rand.NextFloat(0.1f, 2.5f); + for (int k = 0; k < points; k++) + { + Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando); + + Dust cataclysmdust = Dust.NewDustPerfect(Projectile.Center + velocity * (b == 0 ? 7 : 5), 279, velocity * (b == 0 ? 9 : 7)); + cataclysmdust.noGravity = true; + cataclysmdust.scale = Main.rand.NextFloat(1.3f, 1.9f); + cataclysmdust.color = Color.Red; + } + } + Projectile.Kill(); + } + + Vector2 vel = new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); + Dust cataclysmdust2 = Dust.NewDustPerfect(Projectile.Center + vel * 2, 279, vel); + cataclysmdust2.noGravity = true; + cataclysmdust2.scale = Main.rand.NextFloat(0.9f, 1.2f); + cataclysmdust2.color = Color.Red; } else { - float randSize = Main.rand.NextFloat(0.8f, 1.2f); - for (int i = 0; i < 2; i++) + if (Projectile.timeLeft > 240) { - Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Magenta, 0.5f), "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.7f * randSize, 0f, 10); - GeneralParticleHandler.SpawnParticle(bloom); + shootVel = Projectile.velocity * 0.4f; + Projectile.timeLeft = 240; + rotDirection = Main.rand.NextBool() ? -1 : 1; + Projectile.velocity *= 5.5f; + broIsAlive = NPC.AnyNPCs(ModContent.NPCType()); } - Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * 0.9f, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.4f * randSize, 0f, 10); - GeneralParticleHandler.SpawnParticle(bloom3); - - Projectile.velocity *= 0.945f; - } - - // Adds rotation, but it's SUPER unfair a lot of the time - //shootVel = shootVel.RotatedBy(Time * 0.00011f * rotDirection); - - - if (Projectile.timeLeft == 205) // Fist direction telegraphs - { - for (int k = 0; k < 28; k++) + else { - Vector2 vel1 = -shootVel * MathHelper.Clamp(Time * 0.1f, 1, 1.8f); - GlowSparkParticle spark = new GlowSparkParticle(Projectile.Center + vel1 * (9 + k * 11), vel1, false, 7, 0.17f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * 0.5f, new Vector2(0.9f, 0.4f), true, false); - GeneralParticleHandler.SpawnParticle(spark); + float randSize = Main.rand.NextFloat(0.8f, 1.2f); + for (int i = 0; i < 2; i++) + { + Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Magenta, 0.5f), "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.7f * randSize, 0f, 10); + GeneralParticleHandler.SpawnParticle(bloom); + } + Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * 0.9f, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.4f * randSize, 0f, 10); + GeneralParticleHandler.SpawnParticle(bloom3); + + Projectile.velocity *= 0.945f; } - if (broIsAlive == false) + + // Adds rotation, but it's SUPER unfair a lot of the time + //shootVel = shootVel.RotatedBy(Time * 0.00011f * rotDirection); + + + if (Projectile.timeLeft == 205) // Fist direction telegraphs { for (int k = 0; k < 28; k++) { - Vector2 vel2 = (-shootVel * MathHelper.Clamp(Time * 0.1f, 1, 1.8f)).RotatedBy(MathHelper.ToRadians(120f)); - GlowSparkParticle spark2 = new GlowSparkParticle(Projectile.Center + vel2 * (9 + k * 11), vel2, false, 7, 0.17f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * 0.5f, new Vector2(0.9f, 0.4f), true, false); - GeneralParticleHandler.SpawnParticle(spark2); + Vector2 vel1 = -shootVel * MathHelper.Clamp(Time * 0.1f, 1, 1.8f); + GlowSparkParticle spark = new GlowSparkParticle(Projectile.Center + vel1 * (9 + k * 11), vel1, false, 7, 0.17f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * 0.5f, new Vector2(0.9f, 0.4f), true, false); + GeneralParticleHandler.SpawnParticle(spark); } - for (int k = 0; k < 28; k++) + if (broIsAlive == false) { - Vector2 vel3 = (-shootVel * MathHelper.Clamp(Time * 0.1f, 1, 1.8f)).RotatedBy(MathHelper.ToRadians(-120f)); - GlowSparkParticle spark3 = new GlowSparkParticle(Projectile.Center + vel3 * (9 + k * 11), vel3, false, 7, 0.17f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * 0.5f, new Vector2(0.9f, 0.4f), true, false); - GeneralParticleHandler.SpawnParticle(spark3); + for (int k = 0; k < 28; k++) + { + Vector2 vel2 = (-shootVel * MathHelper.Clamp(Time * 0.1f, 1, 1.8f)).RotatedBy(MathHelper.ToRadians(120f)); + GlowSparkParticle spark2 = new GlowSparkParticle(Projectile.Center + vel2 * (9 + k * 11), vel2, false, 7, 0.17f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * 0.5f, new Vector2(0.9f, 0.4f), true, false); + GeneralParticleHandler.SpawnParticle(spark2); + } + for (int k = 0; k < 28; k++) + { + Vector2 vel3 = (-shootVel * MathHelper.Clamp(Time * 0.1f, 1, 1.8f)).RotatedBy(MathHelper.ToRadians(-120f)); + GlowSparkParticle spark3 = new GlowSparkParticle(Projectile.Center + vel3 * (9 + k * 11), vel3, false, 7, 0.17f, Color.Lerp(Color.Red, Color.Magenta, 0.5f) * 0.5f, new Vector2(0.9f, 0.4f), true, false); + GeneralParticleHandler.SpawnParticle(spark3); + } } } - } - if (Projectile.timeLeft <= 200 && Time % 3 == 0) - { - Vector2 randPos = (-shootVel * 1.5f).RotatedByRandom(1) * Main.rand.NextFloat(5, 15); - int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound with { Volume = 1.2f, Pitch = 0.55f }, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + randPos, (-shootVel * MathHelper.Clamp(Time * 0.02f, 0.1f, 1.8f)) * Main.rand.NextFloat(0.75f, 1f), type, Projectile.damage, 0f, Main.myPlayer, 0f, Main.rand.Next(0, 1 + 1), 0); - } - if (Projectile.timeLeft <= 200 && Time % 3 == 0 && broIsAlive == false) - { - Vector2 randPos = (-shootVel * 1.5f).RotatedBy(MathHelper.ToRadians(120f)).RotatedByRandom(1) * Main.rand.NextFloat(5, 15); - Vector2 randPos2 = (-shootVel * 1.5f).RotatedBy(MathHelper.ToRadians(-120f)).RotatedByRandom(1) * Main.rand.NextFloat(5, 15); - int type = ModContent.ProjectileType(); - Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + randPos, (-shootVel * MathHelper.Clamp(Time * 0.02f, 0.1f, 1.8f)).RotatedBy(MathHelper.ToRadians(120f)) * Main.rand.NextFloat(0.75f, 1f), type, Projectile.damage, 0f, Main.myPlayer, 0f, Main.rand.Next(0, 1 + 1), 0); - Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + randPos2, (-shootVel * MathHelper.Clamp(Time * 0.02f, 0.1f, 1.8f)).RotatedBy(MathHelper.ToRadians(-120f)) * Main.rand.NextFloat(0.75f, 1f), type, Projectile.damage, 0f, Main.myPlayer, 0f, Main.rand.Next(0, 1 + 1), 0); - } - if (Projectile.timeLeft == 1) - { - int points = 25; - float radians = MathHelper.TwoPi / points; - Vector2 spinningPoint = Vector2.Normalize(new Vector2(-4f, -4f)); - for (int b = 0; b < 2; b++) + if (Projectile.timeLeft <= 200 && Time % 3 == 0) { - float rotRando = Main.rand.NextFloat(0.1f, 2.5f); - for (int k = 0; k < points; k++) - { - Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando); - - Dust cataclysmdust = Dust.NewDustPerfect(Projectile.Center + velocity * (b == 0 ? 7 : 5), 279, velocity * (b == 0 ? 9 : 7)); - cataclysmdust.noGravity = true; - cataclysmdust.scale = Main.rand.NextFloat(1.3f, 1.9f); - cataclysmdust.color = Color.Red; - } + Vector2 randPos = (-shootVel * 1.5f).RotatedByRandom(1) * Main.rand.NextFloat(5, 15); + int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound with { Volume = 1.2f, Pitch = 0.55f }, Projectile.Center); + Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + randPos, (-shootVel * MathHelper.Clamp(Time * 0.02f, 0.1f, 1.8f)) * Main.rand.NextFloat(0.75f, 1f), type, Projectile.damage, 0f, Main.myPlayer, 0f, Main.rand.Next(0, 1 + 1), 0); } - Projectile.Kill(); - } + if (Projectile.timeLeft <= 200 && Time % 3 == 0 && broIsAlive == false) + { + Vector2 randPos = (-shootVel * 1.5f).RotatedBy(MathHelper.ToRadians(120f)).RotatedByRandom(1) * Main.rand.NextFloat(5, 15); + Vector2 randPos2 = (-shootVel * 1.5f).RotatedBy(MathHelper.ToRadians(-120f)).RotatedByRandom(1) * Main.rand.NextFloat(5, 15); + int type = ModContent.ProjectileType(); + Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + randPos, (-shootVel * MathHelper.Clamp(Time * 0.02f, 0.1f, 1.8f)).RotatedBy(MathHelper.ToRadians(120f)) * Main.rand.NextFloat(0.75f, 1f), type, Projectile.damage, 0f, Main.myPlayer, 0f, Main.rand.Next(0, 1 + 1), 0); + Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + randPos2, (-shootVel * MathHelper.Clamp(Time * 0.02f, 0.1f, 1.8f)).RotatedBy(MathHelper.ToRadians(-120f)) * Main.rand.NextFloat(0.75f, 1f), type, Projectile.damage, 0f, Main.myPlayer, 0f, Main.rand.Next(0, 1 + 1), 0); + } + if (Projectile.timeLeft == 1) + { + int points = 25; + float radians = MathHelper.TwoPi / points; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-4f, -4f)); + for (int b = 0; b < 2; b++) + { + float rotRando = Main.rand.NextFloat(0.1f, 2.5f); + for (int k = 0; k < points; k++) + { + Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando); - Vector2 vel = new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); - Dust cataclysmdust2 = Dust.NewDustPerfect(Projectile.Center + vel * 2, 279, vel); - cataclysmdust2.noGravity = true; - cataclysmdust2.scale = Main.rand.NextFloat(0.9f, 1.2f); - cataclysmdust2.color = Color.Red; + Dust cataclysmdust = Dust.NewDustPerfect(Projectile.Center + velocity * (b == 0 ? 7 : 5), 279, velocity * (b == 0 ? 9 : 7)); + cataclysmdust.noGravity = true; + cataclysmdust.scale = Main.rand.NextFloat(1.3f, 1.9f); + cataclysmdust.color = Color.Red; + } + } + Projectile.Kill(); + } + + Vector2 vel = new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); + Dust cataclysmdust2 = Dust.NewDustPerfect(Projectile.Center + vel * 2, 279, vel); + cataclysmdust2.noGravity = true; + cataclysmdust2.scale = Main.rand.NextFloat(0.9f, 1.2f); + cataclysmdust2.color = Color.Red; + } } else if (Projectile.ai[2] <= 2) { @@ -165,6 +214,9 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= 1.006f; } + if (Main.zenithWorld && Projectile.ai[2] >= 3) + return; + if (Projectile.velocity.X < 0f) { Projectile.spriteDirection = -1; @@ -187,7 +239,7 @@ namespace CalamityMod.Projectiles.Boss Time++; - if (NPC.AnyNPCs(ModContent.NPCType()) == false) + if (NPC.AnyNPCs(ModContent.NPCType()) == false && !Main.zenithWorld) { Projectile.timeLeft = 1; for (int k = 0; k < 10; k++) @@ -207,6 +259,13 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { + if (Main.zenithWorld && Projectile.ai[2] >= 3) + { + Texture2D ballTexture = ModContent.Request("CalamityMod/Projectiles/Boss/Basketball").Value; + Main.EntitySpriteDraw(ballTexture, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, ballTexture.Size() * 0.5f, Projectile.scale / 1.8f, SpriteEffects.None, 0); + return false; + } + lightColor.R = (byte)(255 * Projectile.Opacity); SpriteEffects direction = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; @@ -229,6 +288,21 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 240, true); } + public override bool OnTileCollide(Vector2 oldVelocity) + { + SoundStyle b = new("CalamityMod/Sounds/Custom/Kickball"); + SoundEngine.PlaySound(b with { PitchVariance = 0.15f }, Projectile.Center); + + if (Projectile.velocity.X != oldVelocity.X) + { + Projectile.velocity.X = -oldVelocity.X; + } + if (Projectile.velocity.Y != oldVelocity.Y) + { + Projectile.velocity.Y = -oldVelocity.Y; + } + return false; + } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, (Projectile.ai[2] >= 3 ? 90 : 35 * Projectile.scale), targetHitbox); } } diff --git a/Projectiles/Boss/SupremeCatastropheSlash.cs b/Projectiles/Boss/SupremeCatastropheSlash.cs index d875f0742a..9048168f99 100644 --- a/Projectiles/Boss/SupremeCatastropheSlash.cs +++ b/Projectiles/Boss/SupremeCatastropheSlash.cs @@ -175,7 +175,7 @@ namespace CalamityMod.Projectiles.Boss } } - if (NPC.AnyNPCs(ModContent.NPCType()) == false) + if (NPC.AnyNPCs(ModContent.NPCType()) == false && !Main.zenithWorld) { Projectile.timeLeft = 1; for (int k = 0; k < 10; k++) diff --git a/Sounds/Custom/Kickball.ogg b/Sounds/Custom/Kickball.ogg new file mode 100644 index 0000000000..f67be1f20b Binary files /dev/null and b/Sounds/Custom/Kickball.ogg differ