From 9eb7eb9bb3b1cf79f7f137cbda72ff6a7b8fae40 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 13 Oct 2021 13:14:38 -0500 Subject: [PATCH] 1 - Artemis charge laser adjustments. --- NPCs/ExoMechs/Artemis/Artemis.cs | 56 +++++++++++----------- Projectiles/Boss/ArtemisChargeTelegraph.cs | 2 +- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 975877b11b..4f39799c0a 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -384,7 +384,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Gate values float attackPhaseGateValue = lastMechAlive ? 320f : 480f; - float timeToLineUpAttack = 30f; + float timeToLineUpAttack = phase2 ? 30f : 45f; // Spin variables float spinRadius = 500f; @@ -512,7 +512,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination) * baseVelocity; // Duration of deathray spin to do a full circle - float spinTime = 180f - baseVelocity * baseVelocityMult; + // Normal = 120, Expert = 104, Rev = 96, Death = 88, Malice = 72 + float spinTime = 120f - 160f * (baseVelocityMult - 1.25f); // Set to transition to phase 2 if it hasn't happened yet if (phase2 && npc.localAI[3] == 0f) @@ -729,33 +730,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis { // Save the normalized charge velocity for use in the charge phase if (chargeVelocityNormalized == default) - { chargeVelocityNormalized = Vector2.Normalize(aimedVector); - // Fire a spread of projectiles in the direction of the charge - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 laserVelocity = chargeVelocityNormalized * 10f; - int numLasersPerSpread = 6; - int spread = 21; - float rotation = MathHelper.ToRadians(spread); - float distanceFromTarget = Vector2.Distance(npc.Center, npc.Center + chargeVelocityNormalized * chargeDistance); - - for (int i = 0; i < numLasersPerSpread + 1; i++) - { - Vector2 perturbedSpeed = laserVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numLasersPerSpread - 1))); - Vector2 normalizedPerturbedSpeed = Vector2.Normalize(perturbedSpeed); - - Vector2 offset = normalizedPerturbedSpeed * 70f; - Vector2 newCenter = npc.Center + offset; - - Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - } - } - } - // Decelerate npc.velocity *= decelerationVelocityMult; } @@ -827,6 +803,32 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } + // Fire a spread of projectiles in the direction of the charge + if (!phase2 && calamityGlobalNPC.newAI[3] == attackPhaseGateValue + 2f + (timeToLineUpAttack - 30f)) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Vector2 laserVelocity = chargeVelocityNormalized * 10f; + int numLasersPerSpread = 6; + int spread = 21; + float rotation = MathHelper.ToRadians(spread); + float distanceFromTarget = Vector2.Distance(npc.Center, npc.Center + chargeVelocityNormalized * chargeDistance); + + for (int i = 0; i < numLasersPerSpread + 1; i++) + { + Vector2 perturbedSpeed = laserVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numLasersPerSpread - 1))); + Vector2 normalizedPerturbedSpeed = Vector2.Normalize(perturbedSpeed); + + Vector2 offset = normalizedPerturbedSpeed * 70f; + Vector2 newCenter = npc.Center + offset; + + Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); + } + } + } + if (doBigAttack) { calamityGlobalNPC.newAI[3] = 0f; diff --git a/Projectiles/Boss/ArtemisChargeTelegraph.cs b/Projectiles/Boss/ArtemisChargeTelegraph.cs index ec5479a874..9d30dc807d 100644 --- a/Projectiles/Boss/ArtemisChargeTelegraph.cs +++ b/Projectiles/Boss/ArtemisChargeTelegraph.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.alpha = 255; projectile.penetrate = -1; - projectile.timeLeft = 30; + projectile.timeLeft = 45; } public override void SendExtraAI(BinaryWriter writer)