1 - T Hanos body and tail get angry once deathray is used by the head, which means the head is in berserk phase.

This commit is contained in:
Andrew Marheine committed 2021-08-02 20:46:58 -05:00
1 parent 19c9ecbb99
commit f4e768bd7a
3 files changed
+36 -9

No files matched your search

+12 -3
View File
@@ -139,7 +139,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (npc.localAI[2] == 0f)
npc.localAI[2] = npc.ai[0];
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
// Set the AI to become more aggressive if head is berserk
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Deathray)
npc.Calamity().newAI[3] = 1f;
bool berserk = npc.Calamity().newAI[3] == 1f;
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage || berserk) && calamityGlobalNPC_Head.newAI[2] > 0f;
if (shootLasers && !invisiblePhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -148,11 +153,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (npc.Calamity().newAI[0] == 0f)
npc.ai[3] += 1f;
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge)
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk)
{
float divisor = 120f;
int numSegments = ThanatosHead.minLength;
double numSegmentsAbleToFire = malice ? 25D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
{
@@ -270,6 +275,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
else
{
// Normal laser
if (malice && berserk)
Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI);
// Predictive laser
Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt;
Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI);
+12 -3
View File
@@ -139,7 +139,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (npc.localAI[2] == 0f)
npc.localAI[2] = npc.ai[0];
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
// Set the AI to become more aggressive if head is berserk
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Deathray)
npc.Calamity().newAI[3] = 1f;
bool berserk = npc.Calamity().newAI[3] == 1f;
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage || berserk) && calamityGlobalNPC_Head.newAI[2] > 0f;
if (shootLasers && !invisiblePhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -148,11 +153,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (npc.Calamity().newAI[0] == 0f)
npc.ai[3] += 1f;
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge)
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk)
{
float divisor = 120f;
int numSegments = ThanatosHead.minLength;
double numSegmentsAbleToFire = malice ? 25D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
{
@@ -270,6 +275,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
else
{
// Normal laser
if (malice && berserk)
Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI);
// Predictive laser
Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt;
Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI);
+12 -3
View File
@@ -138,7 +138,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (npc.localAI[2] == 0f)
npc.localAI[2] = npc.ai[0];
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f;
// Set the AI to become more aggressive if head is berserk
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Deathray)
npc.Calamity().newAI[3] = 1f;
bool berserk = npc.Calamity().newAI[3] == 1f;
bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage || berserk) && calamityGlobalNPC_Head.newAI[2] > 0f;
if (shootLasers && !invisiblePhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -147,11 +152,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
if (npc.Calamity().newAI[0] == 0f)
npc.ai[3] += 1f;
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge)
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk)
{
float divisor = 120f;
int numSegments = ThanatosHead.minLength;
double numSegmentsAbleToFire = malice ? 25D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
{
@@ -269,6 +274,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
}
else
{
// Normal laser
if (malice && berserk)
Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI);
// Predictive laser
Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt;
Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI);