diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index ddf5dd1f1f..e19c7a3bf6 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1811,9 +1811,12 @@ namespace CalamityMod.NPCs projectileVelocity += 3f * enrageScale; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Vector2 fireballVelocity = Vector2.Normalize(player.Center - npc.Center) * projectileVelocity; + bool shootPredictiveShot = CalamityWorld.LegendaryMode && CalamityWorld.revenge && Main.rand.NextBool(); + Vector2 predictionVector = shootPredictiveShot ? player.velocity * 20f : Vector2.Zero; + Vector2 fireballVelocity = Vector2.Normalize(player.Center + predictionVector - npc.Center) * projectileVelocity; Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); + Main.projectile[proj].netUpdate = true; } } } @@ -1910,7 +1913,7 @@ namespace CalamityMod.NPCs { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Vector2 fireballVelocity = npc.velocity * 0.01f; + Vector2 fireballVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : npc.velocity * 0.01f; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, fireballVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); } } diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index e746c824b7..e0a35d479a 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -178,6 +178,8 @@ namespace CalamityMod.NPCs.Leviathan bubbleVelocity += 2f * (1f - lifeRatio); if (Main.getGoodWorld) bubbleVelocity *= 1.15f; + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + bubbleVelocity *= 2f; NPC.damage = NPC.defDamage; @@ -616,38 +618,74 @@ namespace CalamityMod.NPCs.Leviathan int totalProjectiles = 8; int projectileDistance = 600; int type = ModContent.ProjectileType(); - switch ((int)NPC.localAI[3]) + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) { - case 0: - SoundEngine.PlaySound(SoundID.Item21, player.Center); - break; - case 1: - totalProjectiles = 3; - type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item30, player.Center); - break; - case 2: - totalProjectiles = 6; - type = ModContent.ProjectileType(); - float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; - Main.musicPitch = soundPitch; - SoundEngine.PlaySound(SoundID.Item26, player.Center); - break; + float radians = MathHelper.TwoPi / totalProjectiles; + int damage = NPC.GetProjectileDamage(type); + for (int i = 0; i < totalProjectiles; i++) + { + switch (Main.rand.Next(3)) + { + case 0: + SoundEngine.PlaySound(SoundID.Item21, player.Center); + break; + + case 1: + type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item30, player.Center); + break; + + case 2: + type = ModContent.ProjectileType(); + float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; + Main.musicPitch = soundPitch; + SoundEngine.PlaySound(SoundID.Item26, player.Center); + break; + } + + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; + Vector2 projVelocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity; + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, projVelocity, type, damage, 0f, Main.myPlayer); + Main.projectile[proj].netUpdate = true; + } } - NPC.localAI[3] += 1f; - if (NPC.localAI[3] > 2f) - NPC.localAI[3] = 0f; - - if ((phase2 && !leviAlive) || phase4) - totalProjectiles += totalProjectiles / 2; - - float radians = MathHelper.TwoPi / totalProjectiles; - int damage = NPC.GetProjectileDamage(type); - for (int i = 0; i < totalProjectiles; i++) + else { - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; - Vector2 projVelocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, projVelocity, type, damage, 0f, Main.myPlayer); + switch ((int)NPC.localAI[3]) + { + case 0: + SoundEngine.PlaySound(SoundID.Item21, player.Center); + break; + + case 1: + totalProjectiles = 3; + type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item30, player.Center); + break; + + case 2: + totalProjectiles = 6; + type = ModContent.ProjectileType(); + float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; + Main.musicPitch = soundPitch; + SoundEngine.PlaySound(SoundID.Item26, player.Center); + break; + } + NPC.localAI[3] += 1f; + if (NPC.localAI[3] > 2f) + NPC.localAI[3] = 0f; + + if ((phase2 && !leviAlive) || phase4) + totalProjectiles += totalProjectiles / 2; + + float radians = MathHelper.TwoPi / totalProjectiles; + int damage = NPC.GetProjectileDamage(type); + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; + Vector2 projVelocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, projVelocity, type, damage, 0f, Main.myPlayer); + } } } @@ -719,6 +757,22 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = (int)(NPC.defDamage * 1.5); + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge && NPC.ai[1] % 5f == 0f) + { + SoundEngine.PlaySound(SoundID.Item85, NPC.Center); + Vector2 vector119 = new Vector2(NPC.position.X + (NPC.width / 2) + (15 * NPC.direction * NPC.scale), NPC.position.Y + 30 * NPC.scale); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int spawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, NPCID.DetonatingBubble); + Main.npc[spawn].target = NPC.target; + Main.npc[spawn].velocity = player.Center - vector119; + Main.npc[spawn].velocity.Normalize(); + Main.npc[spawn].velocity *= bubbleVelocity; + Main.npc[spawn].netUpdate = true; + Main.npc[spawn].ai[3] = Main.rand.Next(80, 121) / 100f; + } + } + // Spawn dust int num24 = 7; for (int j = 0; j < num24; j++) diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 8bc034a679..9cded84c3b 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -391,13 +391,18 @@ namespace CalamityMod.NPCs.Leviathan num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; + if (CalamityWorld.getFixedBoi) { - type = ProjectileID.Boulder; + type = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; vector40.Y -= 5; //Shoot a bit more up since boulders are affected by gravity damage *= 2; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), vector40.X, vector40.Y, num415, num416, type, damage, 0f, Main.myPlayer); + + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector40.X, vector40.Y, num415, num416, type, damage, 0f, Main.myPlayer); + if (CalamityWorld.getFixedBoi) + Main.projectile[proj].scale *= 5f; + if (soundDelay <= 0) { soundDelay = 120; @@ -425,7 +430,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.ai[1] += num638 / 2; bool flag103 = false; - float num640 = (!sirenAlive || phase4) ? 60f : 40f; + float num640 = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 20f : (!sirenAlive || phase4) ? 60f : 40f; if (NPC.ai[1] > num640) { NPC.ai[1] = 0f; @@ -433,7 +438,7 @@ namespace CalamityMod.NPCs.Leviathan flag103 = true; } - int spawnLimit = (sirenAlive && !phase4) ? 1 : (death ? 2 : 3); + int spawnLimit = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10 : (sirenAlive && !phase4) ? 1 : (death ? 2 : 3); if (flag103 && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit) { SoundEngine.PlaySound(soundChoice with { Pitch = soundChoice.Pitch + extrapitch }, vector); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7629ab1a2c..c7ab65f04a 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -2357,7 +2357,7 @@ namespace CalamityMod.NPCs.Providence bool allowedClass = projectile.CountsAsClass() || (!projectile.CountsAsClass() && !projectile.CountsAsClass() && !projectile.CountsAsClass() && !projectile.CountsAsClass() && !projectile.CountsAsClass()); - bool allowedDamage = allowedClass && damage <= 75; //Flat 75 regardless of difficulty. + bool allowedDamage = allowedClass && hit.Damage <= 75; //Flat 75 regardless of difficulty. //Absorber on-hit effects likely won't proc this but Deific Amulet and Astral Bulwark stars will proc this. bool allowedBabs = Main.player[projectile.owner].Calamity().pArtifact && !Main.player[projectile.owner].Calamity().profanedCrystalBuffs;