From 238b3d27861ec80a72eb61e31ced045d07d76bcc Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:21:52 +0700 Subject: [PATCH] gfb dog does a bit more trolling --- NPCs/DevourerofGods/DevourerofGodsHead.cs | 29 ++++++++++++++++++----- Projectiles/Boss/DoGDeath.cs | 4 ++++ Projectiles/Boss/DoGTeleportRift.cs | 2 +- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index bd7814a5f4..76dcf7751f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2246,10 +2246,21 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) { - int randomRange = 48; + int randomRange = Main.zenithWorld ? 960 : 48; float distance = 500f; Vector2 targetVector = player.Center + player.velocity.SafeNormalize(Vector2.UnitX) * distance + new Vector2(Main.rand.Next(-randomRange, randomRange + 1), Main.rand.Next(-randomRange, randomRange + 1)); Projectile.NewProjectile(NPC.GetSource_FromAI(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + + if (Main.zenithWorld) + { + // Fake portals galore + randomRange = 2000; + for (int k = 0; k < 35; k++) + { + targetVector = player.Center + player.velocity.SafeNormalize(Vector2.UnitX) * distance + new Vector2(Main.rand.Next(-randomRange, randomRange + 1), Main.rand.Next(-randomRange, randomRange + 1)); + Projectile.NewProjectile(NPC.GetSource_FromAI(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI, ai2: 1f); + } + } } } @@ -2419,18 +2430,24 @@ namespace CalamityMod.NPCs.DevourerofGods private Vector2 GetRiftLocation(bool spawnDust) { + Vector2 realSpot = default; for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].type == ModContent.ProjectileType()) + Projectile proj = Main.projectile[i]; + if (proj.type == ModContent.ProjectileType()) { if (!spawnDust) - Main.projectile[i].ai[0] = -1f; + proj.ai[0] = -1f; - Main.projectile[i].Kill(); - return Main.projectile[i].Center; + proj.Kill(); + + if (proj.ai[2] == 1f) + continue; + + realSpot = proj.Center; } } - return default; + return realSpot; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index e15b6a5431..ab76d2e5a0 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -121,6 +121,10 @@ namespace CalamityMod.Projectiles.Boss if (TelegraphDelay >= TelegraphTotalTime) return true; + // for old times sake + if (Main.zenithWorld) + return false; + Texture2D laserTelegraph = ModContent.Request("CalamityMod/ExtraTextures/LaserWallTelegraphBeam").Value; float yScale = 2f; diff --git a/Projectiles/Boss/DoGTeleportRift.cs b/Projectiles/Boss/DoGTeleportRift.cs index 174bf500a8..f336d815ac 100644 --- a/Projectiles/Boss/DoGTeleportRift.cs +++ b/Projectiles/Boss/DoGTeleportRift.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - if (Projectile.ai[0] == -1f) + if (Projectile.ai[0] == -1f || Projectile.ai[2] == 1f) return; int dustAmt = 50;