From 4534407745d57550d336c8d387563b0e1b29fa62 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 24 Feb 2023 06:50:57 -0600 Subject: [PATCH 1/2] 1 - Astrum Deus no longer spams god ray laser projectiles in phase 2. 2 - Astrum Aureus laser projectiles accelerate after moving at regular velocity for some time in Expert+, this is to make them dangerous if the player just tries to run away. 3 - Astrum Aureus homing flames have a higher top velocity in Death Mode. --- NPCs/CalamityAI.cs | 17 ++++++++++------- Projectiles/Boss/AstralFlame.cs | 4 ++-- Projectiles/Boss/AstralLaser.cs | 17 ++++++++++++++++- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index d1cabd363a..fb19ddbae9 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -2735,7 +2735,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < maxProjectiles; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); } if (phase3) @@ -2773,7 +2773,7 @@ namespace CalamityMod.NPCs if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3] && i != lasersToNotFire[4] && i != lasersToNotFire[5]) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); } } } @@ -3109,7 +3109,7 @@ namespace CalamityMod.NPCs if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3]) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, laserVelocity * 2f); } } } @@ -4074,9 +4074,11 @@ namespace CalamityMod.NPCs float shootProjectile = 400 / shootTime; float timer = npc.ai[0] + 15f; float divisor = timer + shootProjectile; + bool shootGodRays = phase2 || deathModeEnragePhase_BodyAndTail; if (!flyAtTarget || deathModeEnragePhase_BodyAndTail) { - if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) + float laserDivisor = (phase2 && !deathModeEnragePhase_BodyAndTail) ? 4f : 2f; + if (npc.localAI[0] % divisor == 0f && npc.ai[0] % laserDivisor == 0f) { npc.TargetClosest(); @@ -4090,6 +4092,7 @@ namespace CalamityMod.NPCs vector15 *= Main.rand.Next(90, 121) * 0.01f; velocity = vector15; } + int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; @@ -4098,7 +4101,7 @@ namespace CalamityMod.NPCs if (Vector2.Distance(player.Center, npc.Center) > 80f) { - SoundEngine.PlaySound((phase2 || deathModeEnragePhase_BodyAndTail) ? SoundID.Item91 : SoundID.Item12, npc.Center); + SoundEngine.PlaySound(shootGodRays ? SoundID.Item91 : SoundID.Item12, npc.Center); float num941 = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; Vector2 vector104 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + (npc.height / 2)); float num942 = player.position.X + player.width * 0.5f - vector104.X; @@ -4111,9 +4114,9 @@ namespace CalamityMod.NPCs vector104.Y += num943 * 5f; Vector2 shootDirection = new Vector2(num942, num943).SafeNormalize(Vector2.UnitY); Vector2 laserVelocity = shootDirection * num941; - int type = (phase2 || deathModeEnragePhase_BodyAndTail) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = shootGodRays ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - if (phase2 || deathModeEnragePhase_BodyAndTail) + if (shootGodRays) { // Waving beams need to start offset so they cross each other neatly. float waveSideOffset = Main.rand.NextFloat(9f, 14f); diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index ce1269c93f..9c26dbcd37 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -94,8 +94,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity.Normalize(); Projectile.velocity *= scaleFactor2; } - else if (Projectile.velocity.Length() < 12f) - Projectile.velocity *= 1.01f; + else if (Projectile.velocity.Length() < (death ? 15f : 12f)) + Projectile.velocity *= death ? 1.015f : 1.01f; Projectile.ai[1] += 1f; } diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index 502bf6e1c4..53474ee6cb 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -4,6 +4,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class AstralLaser : ModProjectile @@ -25,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.alpha = 255; Projectile.penetrate = -1; - Projectile.timeLeft = 720; + Projectile.timeLeft = 1200; Projectile.extraUpdates = 1; } @@ -40,6 +41,20 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame > 2) Projectile.frame = 0; + // Speed up after some time + if (Projectile.timeLeft < 600 && Main.expertMode) + { + if (Projectile.velocity.Length() < Projectile.ai[1]) + { + Projectile.velocity *= 1.005f; + if (Projectile.velocity.Length() > Projectile.ai[1]) + { + Projectile.velocity.Normalize(); + Projectile.velocity *= Projectile.ai[1]; + } + } + } + if (Projectile.velocity.X < 0f) { Projectile.spriteDirection = -1; From 1beaa4172e728501fdd06ba580ace14c5161ef2a Mon Sep 17 00:00:00 2001 From: Mortis3 <53282720+DylanDoe21@users.noreply.github.com> Date: Fri, 24 Feb 2023 08:01:38 -0500 Subject: [PATCH 2/2] various fixes --- Tiles/Abyss/AbyssFossilTile.cs | 5 +++-- Tiles/GiantPlanteraBulb.cs | 1 + World/AstralBiome.cs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Tiles/Abyss/AbyssFossilTile.cs b/Tiles/Abyss/AbyssFossilTile.cs index d493dc9d62..ef2d4d45f0 100644 --- a/Tiles/Abyss/AbyssFossilTile.cs +++ b/Tiles/Abyss/AbyssFossilTile.cs @@ -14,10 +14,11 @@ namespace CalamityMod.Tiles.Abyss Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = false; Main.tileWaterDeath[Type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.addTile(Type); - AddMapEntry(new Color(29, 37, 58)); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Abyss Shell Fossil"); + AddMapEntry(new Color(29, 37, 58), name); DustType = 33; } diff --git a/Tiles/GiantPlanteraBulb.cs b/Tiles/GiantPlanteraBulb.cs index a2959b5788..613a8fa520 100644 --- a/Tiles/GiantPlanteraBulb.cs +++ b/Tiles/GiantPlanteraBulb.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Tiles { Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; + TileID.Sets.IsATreeTrunk[Type] = true; TileObjectData.newTile.Width = 5; TileObjectData.newTile.Height = 5; TileObjectData.newTile.Origin = new Point16(2, 4); diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 8e804e2428..8010974902 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -125,10 +125,10 @@ namespace CalamityMod.World float worldEdgeMargin = (float)Main.maxTilesX * 0.08f; int xLimit = Main.maxTilesX / 2; - int realX = Abyss.AtLeftSideOfWorld ? rand.Next(SulphurousSea.BiomeWidth + 300, xLimit - 400) : rand.Next(xLimit + 400, Main.maxTilesX - SulphurousSea.BiomeWidth - 300); + int realX = Abyss.AtLeftSideOfWorld ? rand.Next(SulphurousSea.BiomeWidth + 400, xLimit - 400) : rand.Next(xLimit + 400, Main.maxTilesX - SulphurousSea.BiomeWidth - 400); //clamp so it doesnt crash hopefully - int x = Utils.Clamp(realX, SulphurousSea.BiomeWidth + 300, Main.maxTilesX - SulphurousSea.BiomeWidth - 300); + int x = Utils.Clamp(realX, SulphurousSea.BiomeWidth + 400, Main.maxTilesX - SulphurousSea.BiomeWidth - 400); //world surface = 920 large 740 medium 560 small int y = (int)(Main.worldSurface * 0.5); //Large = 522, Medium = 444, Small = 336