diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index e5a2b40933..ddf5dd1f1f 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -917,7 +917,7 @@ namespace CalamityMod.NPCs int tornadoType = brimmy.currentMode == 3 ? ModContent.ProjectileType() : ProjectileID.SandnadoHostileMark; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(npc.GetSource_FromAI(), pos, Vector2.Zero, tornadoType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), pos, Vector2.Zero, tornadoType, damage, 0f, Main.myPlayer, 0f, 0f); } } if (brimmy.currentMode == 2) @@ -984,6 +984,8 @@ namespace CalamityMod.NPCs Vector2 projectileVelocity = Vector2.Normalize(player.Center - npc.Center) * velocity; int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * 5f, projectileVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); Main.projectile[proj].timeLeft = 240; + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + Main.projectile[proj].extraUpdates += 1; if (npc.ai[1] % divisor2 == divisor2 - 1f) { @@ -1007,7 +1009,9 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f); + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + Main.projectile[proj2].extraUpdates += 1; } } } @@ -1068,6 +1072,8 @@ namespace CalamityMod.NPCs int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 300; Main.projectile[proj].tileCollide = false; + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + Main.projectile[proj].extraUpdates += 1; } totalProjectiles = 12; @@ -1086,7 +1092,9 @@ namespace CalamityMod.NPCs for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(vector255) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(vector255) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f); + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + Main.projectile[proj].extraUpdates += 1; } if (death) @@ -1095,7 +1103,9 @@ namespace CalamityMod.NPCs for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(vector255) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(vector255) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f); + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + Main.projectile[proj].extraUpdates += 1; } } @@ -1324,6 +1334,10 @@ namespace CalamityMod.NPCs { SoundEngine.PlaySound(SoundID.Item109, npc.Center); calamityGlobalNPC.newAI[2] = 2f; + + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + calamityGlobalNPC.newAI[3] = 0f; + SpawnDust(); } else if (calamityGlobalNPC.newAI[0] <= npc.lifeMax * 0.4) @@ -1344,6 +1358,10 @@ namespace CalamityMod.NPCs { SoundEngine.PlaySound(SoundID.Item109, npc.Center); calamityGlobalNPC.newAI[2] = 1f; + + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + calamityGlobalNPC.newAI[3] = 0f; + SpawnDust(); } } @@ -1709,6 +1727,47 @@ namespace CalamityMod.NPCs return; } + else if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + { + if (calamityGlobalNPC.newAI[3] < 900f) + calamityGlobalNPC.newAI[3] += 1f; + else + calamityGlobalNPC.newAI[3] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.ai[0] += 1f; + float hellblastGateValue = 30f - enrageScale; + if (npc.ai[0] >= hellblastGateValue) + { + npc.ai[0] = 0f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + float projSpeed = bossRush ? 5f : 4f; + if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) + { + float distance = Main.rand.NextBool() ? -1000f : 1000f; + float velocity = distance == -1000f ? projSpeed : -projSpeed; + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + if (calamityGlobalNPC.newAI[3] < 300f) // Blasts from above + { + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + else if (calamityGlobalNPC.newAI[3] < 600f) // Blasts from left and right + { + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + else // Blasts from above, left, and right + { + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + } + } + } npc.alpha = npc.dontTakeDamage ? 255 : 0; npc.damage = npc.dontTakeDamage ? 0 : npc.defDamage; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index ed4127f069..22a93c7b04 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -289,14 +289,41 @@ namespace CalamityMod.NPCs.Cryogen else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + { + int spawnType = CalamityWorld.getFixedBoi ? NPCID.RedDevil : NPCID.IceGolem; + if (!NPC.AnyNPCs(spawnType)) + { + int num167 = 1000; + for (int num168 = 0; num168 < num167; num168++) + { + int num169 = (int)(NPC.Center.X / 16f) + Main.rand.Next(-50, 51); + int num170; + for (num170 = (int)(NPC.Center.Y / 16f) + Main.rand.Next(-50, 51); num170 < Main.maxTilesY - 10 && !WorldGen.SolidTile(num169, num170); num170++) + { + } + + num170--; + if (!WorldGen.SolidTile(num169, num170)) + { + int num171 = NPC.NewNPC(NPC.GetSource_FromAI(), num169 * 16 + 8, num170 * 16, spawnType); + if (Main.netMode == NetmodeID.Server && num171 < Main.maxNPCs) + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num171); + + break; + } + } + } + } + float chargePhaseGateValue = bossRush ? 240f : 360f; float chargeDuration = 60f; - float chargeTelegraphTime = NPC.ai[0] == 2f ? 80f : 120f; + float chargeTelegraphTime = NPC.ai[0] == 2f ? ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 60f : 80f) : ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 90f : 120f); float chargeTelegraphMaxRotationIncrement = 1f; float chargeTelegraphRotationIncrement = chargeTelegraphMaxRotationIncrement / chargeTelegraphTime; float chargeSlowDownTime = 15f; - float chargeVelocityMin = 12f; - float chargeVelocityMax = 30f; + float chargeVelocityMin = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 24f : 12f; + float chargeVelocityMax = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 42f : 30f; if (Main.getGoodWorld) { chargePhaseGateValue *= 0.7f; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index f0ca16bf64..91eeaca5dd 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -213,7 +213,7 @@ namespace CalamityMod.NPCs.DevourerofGods { if (phase2) { - // Fire lasers from every 10th (20th in normal mode) body segment if not in laser wall phase + // Fire lasers from every 15th (20th in normal mode) body segment if not in laser wall phase float laserWallPhaseGateValue = 720f; if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] < laserWallPhaseGateValue - 180f) { @@ -222,7 +222,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.getGoodWorld) laserGateValue *= 0.5f; - if (NPC.localAI[0] >= laserGateValue && NPC.ai[0] % (expertMode ? 10f : 20f) == 0f) + if (NPC.localAI[0] >= laserGateValue && NPC.ai[0] % (expertMode ? 15f : 20f) == 0f) { NPC.localAI[0] = 0f; if (!AnyTeleportRifts()) @@ -243,14 +243,14 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - // Fire lasers from every 10th (20th in normal mode) body segment if not in laser barrage phase + // Fire lasers from every 15th (20th in normal mode) body segment if not in laser barrage phase float laserBarrageGateValue = bossRush ? 780f : death ? 900f : 960f; float laserBarrageShootGateValue = bossRush ? 160f : 240f; float laserBarragePhaseGateValue = laserBarrageGateValue - laserBarrageShootGateValue * 1.5f; if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[1] < laserBarragePhaseGateValue) { NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= laserBarrageGateValue * (Main.getGoodWorld ? 0.1f : 0.2f) && NPC.ai[0] % (expertMode ? 10f : 20f) == 0f) + if (NPC.localAI[0] >= laserBarrageGateValue * (Main.getGoodWorld ? 0.1f : 0.2f) && NPC.ai[0] % (expertMode ? 15f : 20f) == 0f) { NPC.TargetClosest(); SoundEngine.PlaySound(SoundID.Item12, player.Center); diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index ffdb92b1bd..a7e0b56b94 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -136,6 +136,8 @@ namespace CalamityMod.Projectiles.Boss Vector2 projVelocity = Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, death ? 2f : 1f, 0f); Main.projectile[proj].tileCollide = true; + if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + Main.projectile[proj].extraUpdates += 1; } fireFrom += velocity * distanceBetweenProjectiles; } diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index e29fdd8963..94a9112cbf 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public Vector2 OldVelocity; public const float TelegraphTotalTime = 210f; public const float TelegraphFadeTime = 30f; - public const float TelegraphWidth = 4200f; + public const float TelegraphWidth = 3150f; public const float FadeTime = 100f; public override void SetStaticDefaults()