1 - Artemis charge laser adjustments.
This commit is contained in:
1 parent
1328731dee
commit
9eb7eb9bb3
2 files changed
+30
-28
No files matched your search
@@ -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<ArtemisLaser>();
|
||||
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<ArtemisLaser>();
|
||||
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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user