1 - Adult Eidolon Wyrm crack cocaine on higher difficulties.

2 - Ares body and arms moved down a bit, proper arm rotation and movement implemented.
3 - Young Wyrms and Eidolists no longer drop loot if the Adult Wyrm is alive.
4 - T Hanos no longer fires a hellstorm of lasers in deathray phase.
5 - Verium Bullets no longer hurt friendly NPCs.
This commit is contained in:
Andrew Marheine committed 2021-08-04 01:36:19 -05:00
1 parent 308048c576
commit e9b7ac0ebf
17 files changed
+285 -65

No files matched your search

+11 -4
View File
@@ -1,3 +1,4 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -55,7 +56,13 @@ namespace CalamityMod.NPCs.Abyss
{
npc.damage = 0;
if (npc.ai[2] > 0f)
// Difficulty modes
bool malice = CalamityWorld.malice;
bool death = CalamityWorld.death || malice;
bool revenge = CalamityWorld.revenge || malice;
bool expertMode = Main.expertMode || malice;
if (npc.ai[2] > 0f)
npc.realLife = (int)npc.ai[2];
// Check if other segments are still alive, if not, die
@@ -82,8 +89,8 @@ namespace CalamityMod.NPCs.Abyss
CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity();
float chargePhaseGateValue = 300f;
float lightningChargePhaseGateValue = 180f;
float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f;
float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f;
bool invisiblePartOfChargePhase = calamityGlobalNPC_Head.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= chargePhaseGateValue + 1f && (calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ChargeOne || calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ChargeTwo || calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.FastCharge);
bool invisiblePartOfLightningChargePhase = calamityGlobalNPC_Head.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= lightningChargePhaseGateValue + 1f && calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.LightningCharge;
@@ -111,7 +118,7 @@ namespace CalamityMod.NPCs.Abyss
if (Vector2.Distance(npc.Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) > 160f)
{
npc.localAI[0] += 1f;
float shootShadowFireballGateValue = 90f;
float shootShadowFireballGateValue = malice ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f;
float divisor = 2f;
if (npc.ai[3] % divisor == 0f && npc.localAI[0] >= shootShadowFireballGateValue)
{
+11 -4
View File
@@ -1,3 +1,4 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -55,7 +56,13 @@ namespace CalamityMod.NPCs.Abyss
{
npc.damage = 0;
if (npc.ai[2] > 0f)
// Difficulty modes
bool malice = CalamityWorld.malice;
bool death = CalamityWorld.death || malice;
bool revenge = CalamityWorld.revenge || malice;
bool expertMode = Main.expertMode || malice;
if (npc.ai[2] > 0f)
npc.realLife = (int)npc.ai[2];
// Check if other segments are still alive, if not, die
@@ -82,8 +89,8 @@ namespace CalamityMod.NPCs.Abyss
CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity();
float chargePhaseGateValue = 300f;
float lightningChargePhaseGateValue = 180f;
float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f;
float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f;
bool invisiblePartOfChargePhase = calamityGlobalNPC_Head.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= chargePhaseGateValue + 1f && (calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ChargeOne || calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ChargeTwo || calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.FastCharge);
bool invisiblePartOfLightningChargePhase = calamityGlobalNPC_Head.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= lightningChargePhaseGateValue + 1f && calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.LightningCharge;
@@ -111,7 +118,7 @@ namespace CalamityMod.NPCs.Abyss
if (Vector2.Distance(npc.Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) > 160f)
{
npc.localAI[0] += 1f;
float spawnAncientLightGateValue = 120f;
float spawnAncientLightGateValue = malice ? 90f : death ? 100f : revenge ? 105f : expertMode ? 110f : 120f;
float divisor = 4f;
if (npc.ai[3] % divisor == 0f && npc.localAI[0] >= spawnAncientLightGateValue)
{
+13 -1
View File
@@ -451,7 +451,19 @@ namespace CalamityMod.NPCs.Abyss
return 0f;
}
public override void NPCLoot()
public override bool PreNPCLoot()
{
bool adultWyrmAlive = false;
if (CalamityGlobalNPC.adultEidolonWyrmHead != -1)
{
if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active)
adultWyrmAlive = true;
}
return !adultWyrmAlive;
}
public override void NPCLoot()
{
DropHelper.DropItem(npc, ModContent.ItemType<Voidstone>(), 30, 40);
if (Main.rand.NextBool(10))
+27 -22
View File
@@ -276,14 +276,14 @@ namespace CalamityMod.NPCs.Abyss
// Phase gate values
float velocityAdjustTime = 20f;
float chargePhaseGateValue = 300f;
float lightningRainDuration = 180f;
float eidolonWyrmPhaseDuration = 180f;
float iceMistDuration = 180f;
float spinPhaseDuration = 300f;
float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f;
float lightningRainDuration = malice ? 150f : 180f;
float eidolonWyrmPhaseDuration = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f;
float iceMistDuration = malice ? 150f : 180f;
float spinPhaseDuration = malice ? 210f : death ? 240f : revenge ? 255f : expertMode ? 270f : 300f;
float ancientDoomPhaseGateValue = 30f;
float ancientDoomGateValue = 120f;
float lightningChargePhaseGateValue = 180f;
float ancientDoomGateValue = malice ? 80f : death ? 95f : revenge ? 100f : expertMode ? 105f : 120f;
float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f;
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = AIState == (float)Phase.FinalPhase || AIState == (float)Phase.ShadowFireballSpin;
@@ -365,7 +365,7 @@ namespace CalamityMod.NPCs.Abyss
}
Vector2 chargeLocation = destination + chargeVector;
Vector2 chargeVectorFlipped = chargeVector * -1f;
float chargePredictionAmt = 60f;
float chargePredictionAmt = malice ? 60f : death ? 50f : revenge ? 40f : expertMode ? 30f : 20f;
// Lightning Rain variables
Vector2 lightningRainLocation = new Vector2(0f, -baseDistance);
@@ -374,7 +374,8 @@ namespace CalamityMod.NPCs.Abyss
// Wyrm and Eidolist variables
Vector2 eidolonWyrmPhaseLocation = new Vector2(0f, baseDistance);
float eidolonWyrmPhaseLocationDistance = turnDistance * 0.5f;
int maxEidolists = targetDownDeep ? 3 : 5;
int eidolistScale = malice ? 4 : death ? 3 : revenge ? 2 : expertMode ? 1 : 0;
int maxEidolists = (targetDownDeep ? 3 : 5) + eidolistScale;
// Ice Mist variables
Vector2 iceMistLocation = new Vector2(0f, baseDistance);
@@ -388,8 +389,9 @@ namespace CalamityMod.NPCs.Abyss
// Ancient Doom variables
Vector2 ancientDoomLocation = new Vector2(0f, -baseDistance);
float ancientDoomLocationDistance = turnDistance * 0.2f;
int ancientDoomLimit = targetDownDeep ? 5 : 8;
int ancientDoomDistance = 550;
int ancientDoomScale = malice ? 4 : death ? 3 : revenge ? 2 : expertMode ? 1 : 0;
int ancientDoomLimit = (targetDownDeep ? 4 : 6) + ancientDoomScale;
int ancientDoomDistance = malice ? 480 : death ? 520 : revenge ? 535 : expertMode ? 550 : 600;
float maxAncientDoomRings = 3f;
// Lightning charge variables
@@ -399,12 +401,13 @@ namespace CalamityMod.NPCs.Abyss
Vector2 lightningChargeVectorFlipped = lightningChargeVector * -1f;
float lightningSpawnY = 540f;
Vector2 lightningSpawnLocation = new Vector2(npc.Center.X, npc.Center.Y - lightningSpawnY);
int numLightningBolts = 8;
int numLightningBolts = malice ? 12 : death ? 10 : revenge ? 8 : expertMode ? 6 : 4;
float distanceBetweenBolts = lightningSpawnY * 2f / numLightningBolts;
// Velocity and turn speed values
float velocityScale = malice ? 4f : death ? 2.5f : revenge ? 2f : expertMode ? 1.5f : 0f;
float baseVelocity = targetDownDeep ? 12f : 18f;
float turnSpeed = targetDownDeep ? MathHelper.ToRadians(1.5f) : MathHelper.ToRadians(2.25f);
float turnSpeed = baseVelocity * 0.125f;
float normalChargeVelocityMult = MathHelper.Lerp(1f, 2f, chargeVelocityScalar);
float normalChargeTurnSpeedMult = MathHelper.Lerp(1f, 8f, chargeVelocityScalar);
float invisiblePhaseVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar);
@@ -548,7 +551,8 @@ namespace CalamityMod.NPCs.Abyss
}
float predictionAmt = targetDownDeep ? 45f : 60f;
float lightningVelocity = (targetDownDeep && !targetOnMount) ? 6f : 8f;
float lightningVelocityScale = malice ? 3f : death ? 2f : revenge ? 1.5f : expertMode ? 1f : 0f;
float lightningVelocity = ((targetDownDeep && !targetOnMount) ? 6f : 8f) + lightningVelocityScale;
for (int i = 0; i < numProjectiles; i++)
{
// Predictive bolt
@@ -864,7 +868,8 @@ namespace CalamityMod.NPCs.Abyss
}
float predictionAmt = targetDownDeep ? 90f : 120f;
float iceMistVelocity = targetDownDeep ? 12f : 16f;
float iceMistVelocityScale = malice ? 3f : death ? 2f : revenge ? 1.5f : expertMode ? 1f : 0f;
float iceMistVelocity = (targetDownDeep ? 12f : 16f) + iceMistVelocityScale;
for (int i = 0; i < numProjectiles; i++)
{
// Predictive mist
@@ -1015,9 +1020,9 @@ namespace CalamityMod.NPCs.Abyss
if (aiGateValue % ancientDoomGateValue == 0f)
{
// Spawn 3 (or more) circles of Ancient Dooms around the target
int ancientDoomScale = (int)(aiGateValue / ancientDoomGateValue);
ancientDoomLimit += ancientDoomScale;
ancientDoomDistance += ancientDoomScale * 45;
int ancientDoomScale2 = (int)(aiGateValue / ancientDoomGateValue);
ancientDoomLimit += ancientDoomScale2;
ancientDoomDistance += ancientDoomScale2 * 45;
int ancientDoomDegrees = 360 / ancientDoomLimit;
for (int i = 0; i < ancientDoomLimit; i++)
{
@@ -1099,7 +1104,7 @@ namespace CalamityMod.NPCs.Abyss
{
Vector2 projectileDestination = player.Center - lightningSpawnLocation;
float ai = Main.rand.Next(100);
int proj = Projectile.NewProjectile(lightningSpawnLocation, npc.velocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai);
int proj = Projectile.NewProjectile(lightningSpawnLocation, npc.velocity * 0.5f, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai);
Main.projectile[proj].tileCollide = false;
lightningSpawnLocation.Y += distanceBetweenBolts;
if (i == numLightningBolts / 2)
@@ -1213,9 +1218,9 @@ namespace CalamityMod.NPCs.Abyss
if (aiGateValue % ancientDoomGateValue == 0f)
{
// Spawn 3 (or more) circles of Ancient Dooms around the target
int ancientDoomScale = (int)(aiGateValue / ancientDoomGateValue);
ancientDoomLimit += ancientDoomScale;
ancientDoomDistance += ancientDoomScale * 45;
int ancientDoomScale2 = (int)(aiGateValue / ancientDoomGateValue);
ancientDoomLimit += ancientDoomScale2;
ancientDoomDistance += ancientDoomScale2 * 45;
int ancientDoomDegrees = 360 / ancientDoomLimit;
for (int i = 0; i < ancientDoomLimit; i++)
{
+10 -3
View File
@@ -1,3 +1,4 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -44,7 +45,13 @@ namespace CalamityMod.NPCs.Abyss
{
npc.damage = 0;
if (npc.ai[2] > 0f)
// Difficulty modes
bool malice = CalamityWorld.malice;
bool death = CalamityWorld.death || malice;
bool revenge = CalamityWorld.revenge || malice;
bool expertMode = Main.expertMode || malice;
if (npc.ai[2] > 0f)
npc.realLife = (int)npc.ai[2];
// Check if other segments are still alive, if not, die
@@ -71,8 +78,8 @@ namespace CalamityMod.NPCs.Abyss
CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity();
float chargePhaseGateValue = 300f;
float lightningChargePhaseGateValue = 180f;
float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f;
float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f;
bool invisiblePartOfChargePhase = calamityGlobalNPC_Head.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= chargePhaseGateValue + 1f && (calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ChargeOne || calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ChargeTwo || calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.FastCharge);
bool invisiblePartOfLightningChargePhase = calamityGlobalNPC_Head.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= lightningChargePhaseGateValue + 1f && calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.LightningCharge;
-1
View File
@@ -5554,7 +5554,6 @@ namespace CalamityMod.NPCs
}
// Rotation
// Phase switch
float rateOfRotation = 0.04f;
if (npc.ai[0] == 1f || npc.ai[0] == 6f || npc.ai[0] == 7f || npc.ai[0] == 14f)
rateOfRotation = 0f;
+1 -1
View File
@@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.rotation = npc.velocity.X * 0.003f;
// Default vector to fly to
Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X, player.Center.Y - 800f) : AIState != (float)Phase.Deathrays ? new Vector2(player.Center.X, player.Center.Y - 500f) : player.Center;
Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X, player.Center.Y - 800f) : AIState != (float)Phase.Deathrays ? new Vector2(player.Center.X, player.Center.Y - 450f) : player.Center;
// Velocity and acceleration values
float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f;
+47 -6
View File
@@ -224,8 +224,45 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.Opacity = 0f;
}
// Rotate the cannon to look at the target
// npc.rotation = npc.velocity.X * 0.003f;
// Predictiveness
float predictionAmt = malice ? 30f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
Vector2 predictionVector = player.velocity * predictionAmt;
Vector2 rotationVector = player.Center + predictionVector - npc.Center;
float rateOfRotation = AIState == (int)Phase.GaussNuke ? 0.08f : 0.04f;
Vector2 lookAt = player.Center + Vector2.Normalize(rotationVector);
float rotation = (float)Math.Atan2(lookAt.Y - npc.Center.Y, lookAt.X - npc.Center.X);
if (npc.spriteDirection == 1)
rotation += MathHelper.Pi;
if (rotation < 0f)
rotation += MathHelper.TwoPi;
if (rotation > MathHelper.TwoPi)
rotation -= MathHelper.TwoPi;
if (npc.rotation < rotation)
{
if (rotation - npc.rotation > MathHelper.Pi)
npc.rotation -= rateOfRotation;
else
npc.rotation += rateOfRotation;
}
if (npc.rotation > rotation)
{
if (npc.rotation - rotation > MathHelper.Pi)
npc.rotation += rateOfRotation;
else
npc.rotation -= rateOfRotation;
}
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
if (npc.rotation < 0f)
npc.rotation += MathHelper.TwoPi;
if (npc.rotation > MathHelper.TwoPi)
npc.rotation -= MathHelper.TwoPi;
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
// Default vector to fly to
Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 750f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y);
@@ -259,12 +296,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Attacking phases
switch ((int)AIState)
{
// Do nothing, rotate to aim at the target and fly in place
// Do nothing and fly in place
case (int)Phase.Nothing:
if (!targetDead)
npc.SimpleFlyMovement(desiredVelocity, baseAcceleration);
calamityGlobalNPC.newAI[1] += 1f;
if (calamityGlobalNPC.newAI[1] >= gaussNukePhaseGateValue)
{
@@ -295,8 +329,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
if (exactFrame == 41 && calamityGlobalNPC.newAI[1] == 0f)
{
calamityGlobalNPC.newAI[1] = 1f;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float projectileVelocity = 12f;
Vector2 gaussNukeVelocity = Vector2.Normalize(rotationVector) * projectileVelocity;
/*int type = ModContent.ProjectileType<AresGaussNuke>();
int damage = npc.GetProjectileDamage(type);*/
}
@@ -330,6 +367,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
break;
}
// Movement
if (!targetDead)
npc.SimpleFlyMovement(desiredVelocity, baseAcceleration);
}
public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false;
+37 -3
View File
@@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
private const float deathrayTelegraphDuration = 240f;
// Total duration of the deathray
private const float deathrayDuration = 180f;
private const float deathrayDuration = 60f;
public override void SetStaticDefaults()
{
@@ -224,7 +224,41 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Rotate the cannon to look at the target while not firing the beam
// Rotate the cannon to look in the direction it will fire only while it's charging or while it's firing
// npc.rotation = npc.velocity.X * 0.003f;
// Rotation
float rateOfRotation = AIState == (int)Phase.Deathray ? 0.08f : 0.04f;
Vector2 lookAt = AIState == (int)Phase.Deathray ? (calamityGlobalNPC.newAI[3] == 0f ? new Vector2(0f, npc.Center.Y + 1000f) : new Vector2(npc.Center.X + 1000f, 0f)) : player.Center;
float rotation = (float)Math.Atan2(lookAt.Y - npc.Center.Y, lookAt.X - npc.Center.X);
if (npc.spriteDirection == 1)
rotation += MathHelper.Pi;
if (rotation < 0f)
rotation += MathHelper.TwoPi;
if (rotation > MathHelper.TwoPi)
rotation -= MathHelper.TwoPi;
if (npc.rotation < rotation)
{
if (rotation - npc.rotation > MathHelper.Pi)
npc.rotation -= rateOfRotation;
else
npc.rotation += rateOfRotation;
}
if (npc.rotation > rotation)
{
if (npc.rotation - rotation > MathHelper.Pi)
npc.rotation += rateOfRotation;
else
npc.rotation -= rateOfRotation;
}
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
if (npc.rotation < 0f)
npc.rotation += MathHelper.TwoPi;
if (npc.rotation > MathHelper.TwoPi)
npc.rotation -= MathHelper.TwoPi;
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
// Default vector to fly to
Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y - 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 750f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y);
@@ -247,7 +281,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
float deathrayPhaseGateValue = 420f;
float deathrayPhaseVelocityMult = 0.95f;
float deathrayDecelerationTime = 15f;
float deathrayPhaseVelocity = 5f;
float deathrayPhaseVelocity = 15f;
// Variable to disable deathray firing
bool doNotFire = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays || calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune;
+46 -6
View File
@@ -222,8 +222,45 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.Opacity = 0f;
}
// Rotate the cannon to look at the target
// npc.rotation = npc.velocity.X * 0.003f;
// Predictiveness
float predictionAmt = malice ? 30f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
Vector2 predictionVector = player.velocity * predictionAmt;
Vector2 rotationVector = player.Center + predictionVector - npc.Center;
float rateOfRotation = AIState == (int)Phase.PlasmaBolts ? 0.08f : 0.04f;
Vector2 lookAt = player.Center + Vector2.Normalize(rotationVector);
float rotation = (float)Math.Atan2(lookAt.Y - npc.Center.Y, lookAt.X - npc.Center.X);
if (npc.spriteDirection == 1)
rotation += MathHelper.Pi;
if (rotation < 0f)
rotation += MathHelper.TwoPi;
if (rotation > MathHelper.TwoPi)
rotation -= MathHelper.TwoPi;
if (npc.rotation < rotation)
{
if (rotation - npc.rotation > MathHelper.Pi)
npc.rotation -= rateOfRotation;
else
npc.rotation += rateOfRotation;
}
if (npc.rotation > rotation)
{
if (npc.rotation - rotation > MathHelper.Pi)
npc.rotation += rateOfRotation;
else
npc.rotation -= rateOfRotation;
}
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
if (npc.rotation < 0f)
npc.rotation += MathHelper.TwoPi;
if (npc.rotation > MathHelper.TwoPi)
npc.rotation -= MathHelper.TwoPi;
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
// Default vector to fly to
Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y - 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 375f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 160f);
@@ -258,12 +295,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Attacking phases
switch ((int)AIState)
{
// Do nothing, rotate to aim at the target and fly in place
// Do nothing and fly in place
case (int)Phase.Nothing:
if (!targetDead)
npc.SimpleFlyMovement(desiredVelocity, baseAcceleration);
calamityGlobalNPC.newAI[1] += 1f;
if (calamityGlobalNPC.newAI[1] >= plasmaBoltPhaseGateValue)
{
@@ -300,6 +334,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float projectileVelocity = 12f;
Vector2 plasmaBoltVelocity = Vector2.Normalize(rotationVector) * projectileVelocity;
/*int type = ModContent.ProjectileType<AresPlasmaBolt>();
int damage = npc.GetProjectileDamage(type);*/
}
@@ -316,6 +352,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
break;
}
// Movement
if (!targetDead)
npc.SimpleFlyMovement(desiredVelocity, baseAcceleration);
}
public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false;
+46 -6
View File
@@ -222,8 +222,45 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
npc.Opacity = 0f;
}
// Rotate the cannon to look at the target
// npc.rotation = npc.velocity.X * 0.003f;
// Predictiveness
float predictionAmt = malice ? 30f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
Vector2 predictionVector = player.velocity * predictionAmt;
Vector2 rotationVector = player.Center + predictionVector - npc.Center;
float rateOfRotation = AIState == (int)Phase.TeslaOrbs ? 0.08f : 0.04f;
Vector2 lookAt = player.Center + Vector2.Normalize(rotationVector);
float rotation = (float)Math.Atan2(lookAt.Y - npc.Center.Y, lookAt.X - npc.Center.X);
if (npc.spriteDirection == 1)
rotation += MathHelper.Pi;
if (rotation < 0f)
rotation += MathHelper.TwoPi;
if (rotation > MathHelper.TwoPi)
rotation -= MathHelper.TwoPi;
if (npc.rotation < rotation)
{
if (rotation - npc.rotation > MathHelper.Pi)
npc.rotation -= rateOfRotation;
else
npc.rotation += rateOfRotation;
}
if (npc.rotation > rotation)
{
if (npc.rotation - rotation > MathHelper.Pi)
npc.rotation += rateOfRotation;
else
npc.rotation -= rateOfRotation;
}
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
if (npc.rotation < 0f)
npc.rotation += MathHelper.TwoPi;
if (npc.rotation > MathHelper.TwoPi)
npc.rotation -= MathHelper.TwoPi;
if (npc.rotation > rotation - rateOfRotation && npc.rotation < rotation + rateOfRotation)
npc.rotation = rotation;
// Default vector to fly to
Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 375f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 160f);
@@ -258,12 +295,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
// Attacking phases
switch ((int)AIState)
{
// Do nothing, rotate to aim at the target and fly in place
// Do nothing and fly in place
case (int)Phase.Nothing:
if (!targetDead)
npc.SimpleFlyMovement(desiredVelocity, baseAcceleration);
calamityGlobalNPC.newAI[1] += 1f;
if (calamityGlobalNPC.newAI[1] >= teslaOrbPhaseGateValue)
{
@@ -300,6 +334,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float projectileVelocity = 12f;
Vector2 teslaOrbVelocity = Vector2.Normalize(rotationVector) * projectileVelocity;
/*int type = ModContent.ProjectileType<AresTeslaOrb>();
int damage = npc.GetProjectileDamage(type);*/
}
@@ -316,6 +352,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
break;
}
// Movement
if (!targetDead)
npc.SimpleFlyMovement(desiredVelocity, baseAcceleration);
}
public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false;
+7 -2
View File
@@ -220,11 +220,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
else
{
// This is only used in deathray phase to prevent laser spam
int numSegments = ThanatosHead.minLength;
double numSegmentsAbleToFire = 5D;
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
npc.ai[3] += 1f;
float shootProjectile = 120f;
float timer = npc.ai[0] + 15f;
float divisor = timer + shootProjectile;
if (npc.ai[3] % divisor == 0f || npc.Calamity().newAI[0] > 0f)
if ((npc.ai[3] % divisor == 0f && (npc.localAI[2] % segmentDivisor == 0f || !berserk)) || npc.Calamity().newAI[0] > 0f)
{
// Body is vulnerable while firing lasers
vulnerable = true;
@@ -261,7 +266,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
}
float predictionAmt = malice ? 40f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
float predictionAmt = malice ? 30f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
int type = ModContent.ProjectileType<ExoDestroyerLaser>();
int damage = npc.GetProjectileDamage(type);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center);
+7 -2
View File
@@ -220,11 +220,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
else
{
// This is only used in deathray phase to prevent laser spam
int numSegments = ThanatosHead.minLength;
double numSegmentsAbleToFire = 5D;
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
npc.ai[3] += 1f;
float shootProjectile = 120f;
float timer = npc.ai[0] + 15f;
float divisor = timer + shootProjectile;
if (npc.ai[3] % divisor == 0f || npc.Calamity().newAI[0] > 0f)
if ((npc.ai[3] % divisor == 0f && (npc.localAI[2] % segmentDivisor == 0f || !berserk)) || npc.Calamity().newAI[0] > 0f)
{
// Body is vulnerable while firing lasers
vulnerable = true;
@@ -261,7 +266,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
}
float predictionAmt = malice ? 40f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
float predictionAmt = malice ? 30f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
int type = ModContent.ProjectileType<ExoDestroyerLaser>();
int damage = npc.GetProjectileDamage(type);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center);
+7 -2
View File
@@ -219,11 +219,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
else
{
// This is only used in deathray phase to prevent laser spam
int numSegments = ThanatosHead.minLength;
double numSegmentsAbleToFire = 5D;
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
npc.ai[3] += 1f;
float shootProjectile = 120f;
float timer = npc.ai[0] + 15f;
float divisor = timer + shootProjectile;
if (npc.ai[3] % divisor == 0f || npc.Calamity().newAI[0] > 0f)
if ((npc.ai[3] % divisor == 0f && (npc.localAI[2] % segmentDivisor == 0f || !berserk)) || npc.Calamity().newAI[0] > 0f)
{
// Body is vulnerable while firing lasers
vulnerable = true;
@@ -260,7 +265,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
}
float predictionAmt = malice ? 40f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
float predictionAmt = malice ? 30f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f;
int type = ModContent.ProjectileType<ExoDestroyerLaser>();
int damage = npc.GetProjectileDamage(type);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center);
+13 -1
View File
@@ -311,7 +311,19 @@ namespace CalamityMod.NPCs.NormalNPCs
}
}
public override void NPCLoot()
public override bool PreNPCLoot()
{
bool adultWyrmAlive = false;
if (CalamityGlobalNPC.adultEidolonWyrmHead != -1)
{
if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active)
adultWyrmAlive = true;
}
return !adultWyrmAlive;
}
public override void NPCLoot()
{
if (Main.rand.NextBool(10))
{
+1
View File
@@ -262,6 +262,7 @@ namespace CalamityMod.NPCs.Perforator
}
}
}
float num188 = speed;
float num189 = turnSpeed;
float burrowDistance = malice ? 500f : 750f;
+1 -1
View File
@@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Ranged
return true;
}
public override bool? CanHitNPC(NPC target) => projectile.ai[0] <= 0f;
public override bool? CanHitNPC(NPC target) => projectile.ai[0] <= 0f && target.CanBeChasedBy(projectile);
public override bool CanHitPvp(Player target) => projectile.ai[0] <= 0f;