More Death Mode boss edits.

This commit is contained in:
Andrew Marheine committed 2020-01-16 18:40:07 -06:00
1 parent f6f76a5268
commit a257ca6f11
9 files changed
+306 -375

No files matched your search

+47 -56
View File
@@ -57,6 +57,7 @@ namespace CalamityMod.NPCs.SlimeGod
CalamityGlobalNPC.slimeGodPurple = npc.whoAmI;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
if (Vector2.Distance(Main.player[npc.target].Center, vector) > 5400f)
{
@@ -163,16 +164,14 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.aiAction = 0;
npc.knockBackResist = 0.2f * Main.knockBackMultiplier;
npc.noTileCollide = false;
npc.noGravity = false;
npc.reflectingProjectiles = false;
if (npc.ai[0] != 7f && Main.player[npc.target].dead)
if (npc.ai[0] != 6f && Main.player[npc.target].dead)
{
npc.TargetClosest(true);
if (Main.player[npc.target].dead)
{
npc.ai[0] = 7f;
npc.ai[0] = 6f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -185,24 +184,14 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.ai[0] == 0f)
{
npc.TargetClosest(true);
Vector2 vector271 = Main.player[npc.target].Center - vector;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
else if (npc.ai[0] == 1f)
{
npc.ai[1] += 1f;
if (npc.ai[1] > 18f)
{
npc.ai[0] = 2f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 2f)
{
if ((Main.player[npc.target].Center - vector).Length() > (hyperMode ? 1200f : 2400f)) //1200
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -212,8 +201,15 @@ namespace CalamityMod.NPCs.SlimeGod
npc.TargetClosest(true);
npc.velocity.X = npc.velocity.X * 0.8f;
npc.ai[1] += flag100 ? 1f : 3f;
float num1879 = 15f - 5f * ((float)npc.life / (float)npc.lifeMax);
float num1880 = (CalamityWorld.bossRushActive ? 12f : 3f) + 4f * (1f - (float)npc.life / (float)npc.lifeMax);
float num1879 = 30f;
float num1880 = CalamityWorld.bossRushActive ? 12f : 3f;
if (revenge)
{
float moveBoost = death ? 14f : 28f * (1f - (float)npc.life / (float)npc.lifeMax);
float speedBoost = death ? 4f : 8f * (1f - (float)npc.life / (float)npc.lifeMax);
num1879 -= moveBoost;
num1880 += speedBoost;
}
float num1881 = 9f;
if (!Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1))
{
@@ -235,7 +231,6 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
npc.knockBackResist = 0f;
npc.velocity.X = npc.velocity.X * 0.99f;
if (npc.direction < 0 && npc.velocity.X > -1f)
{
@@ -247,47 +242,47 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.ai[2] += 1f;
if (npc.ai[2] > 360f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
if (revenge)
{
npc.ai[2] += (death ? 2f : 4f * (1f - (float)npc.life / (float)npc.lifeMax));
}
if (npc.ai[2] >= 360f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
{
int num1882 = Main.rand.Next(3);
if (num1882 == 0)
{
npc.ai[0] = 3f;
}
else if (num1882 == 1)
{
npc.ai[0] = 4f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -12f : -8f;
}
else if (num1882 == 2)
{
npc.ai[0] = 6f;
}
else
{
npc.ai[0] = 2f;
}
switch (Main.rand.Next(3))
{
case 0:
npc.ai[0] = 2f;
break;
case 1:
npc.ai[0] = 3f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -12f : -8f;
break;
case 2:
npc.ai[0] = 5f;
break;
default:
break;
}
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 3f)
else if (npc.ai[0] == 2f)
{
npc.velocity.X = npc.velocity.X * 0.85f;
npc.ai[1] += 1f;
if (npc.ai[1] >= 80f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 4f)
else if (npc.ai[0] == 3f)
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
if (npc.velocity.X < 0f)
{
npc.direction = -1;
@@ -311,7 +306,7 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.ai[1] > 6f)
{
npc.ai[1] = 0f;
npc.ai[0] = 4.1f;
npc.ai[0] = 3.1f;
npc.ai[2] = 0f;
npc.velocity = vector272;
}
@@ -329,9 +324,8 @@ namespace CalamityMod.NPCs.SlimeGod
npc.velocity = (npc.velocity * 5f + vector272) / 6f;
}
}
else if (npc.ai[0] == 4.1f)
else if (npc.ai[0] == 3.1f)
{
npc.knockBackResist = 0f;
if (npc.ai[2] == 0f && Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[2] = 1f;
@@ -341,13 +335,13 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
if (npc.ai[1] > 10f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
if (Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
}
}
}
@@ -355,7 +349,6 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
}
npc.velocity.Y = npc.velocity.Y + 0.2f;
if (npc.velocity.Y > 16f)
@@ -365,7 +358,7 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
if (npc.ai[0] == 5f)
if (npc.ai[0] == 4f)
{
npc.localAI[0] += (float)Main.rand.Next(4, 9);
if (npc.velocity.X > 0f)
@@ -379,12 +372,11 @@ namespace CalamityMod.NPCs.SlimeGod
npc.spriteDirection = npc.direction;
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
Vector2 value74 = Main.player[npc.target].Center - vector;
value74.Y -= 4f;
if (value74.Length() < 200f && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -397,9 +389,8 @@ namespace CalamityMod.NPCs.SlimeGod
npc.velocity = (npc.velocity * 4f + value74) / 5f;
return;
}
if (npc.ai[0] == 6f)
if (npc.ai[0] == 5f)
{
npc.knockBackResist = 0f;
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
@@ -437,7 +428,7 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.velocity.Y = npc.velocity.Y - 2f;
}
npc.velocity.X = (float)(12 * npc.direction);
npc.velocity.X = (float)((CalamityWorld.bossRushActive ? 22 : 14) * npc.direction);
npc.ai[2] += 1f;
}
}
@@ -455,13 +446,13 @@ namespace CalamityMod.NPCs.SlimeGod
}
if (npc.ai[2] >= 3f && npc.velocity.Y == 0f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 7f)
else if (npc.ai[0] == 6f)
{
npc.life = npc.lifeMax;
npc.defense = 9999;
+3 -2
View File
@@ -67,7 +67,8 @@ namespace CalamityMod.NPCs.SlimeGod
CalamityGlobalNPC.slimeGod = npc.whoAmI;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
Player player = Main.player[npc.target];
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Player player = Main.player[npc.target];
int randomDust = Main.rand.Next(2);
if (randomDust == 0)
{
@@ -81,7 +82,7 @@ namespace CalamityMod.NPCs.SlimeGod
Main.dust[num658].noGravity = true;
Main.dust[num658].velocity *= 0.5f;
bool flag100 = false;
if (!CalamityWorld.bossRushActive)
if (!death)
{
if (CalamityGlobalNPC.slimeGodRed != -1)
{
+76 -93
View File
@@ -60,7 +60,8 @@ namespace CalamityMod.NPCs.SlimeGod
CalamityGlobalNPC.slimeGodRed = npc.whoAmI;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
if (Vector2.Distance(Main.player[npc.target].Center, vector) > 5400f)
{
npc.position.X = (float)(Main.player[npc.target].Center.X / 16) * 16f - (float)(npc.width / 2);
@@ -104,11 +105,7 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.localAI[0] += 2f;
}
if (CalamityWorld.revenge || CalamityWorld.bossRushActive)
{
npc.localAI[0] += 1f;
}
if (CalamityWorld.death || CalamityWorld.bossRushActive)
if (revenge)
{
npc.localAI[0] += 1f;
}
@@ -189,16 +186,14 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.aiAction = 0;
npc.knockBackResist = 0.2f * Main.knockBackMultiplier;
npc.noTileCollide = false;
npc.noGravity = false;
npc.reflectingProjectiles = false;
if (npc.ai[0] != 7f && Main.player[npc.target].dead)
if (npc.ai[0] != 6f && Main.player[npc.target].dead)
{
npc.TargetClosest(true);
if (Main.player[npc.target].dead)
{
npc.ai[0] = 7f;
npc.ai[0] = 6f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -211,24 +206,14 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.ai[0] == 0f)
{
npc.TargetClosest(true);
Vector2 vector271 = Main.player[npc.target].Center - vector;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
else if (npc.ai[0] == 1f)
{
npc.ai[1] += 1f;
if (npc.ai[1] > 9f)
{
npc.ai[0] = 2f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 2f)
{
if ((Main.player[npc.target].Center - vector).Length() > (hyperMode ? 1200f : 2400f))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -236,11 +221,18 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
npc.velocity.X = npc.velocity.X * 0.85f;
npc.velocity.X = npc.velocity.X * 0.8f;
npc.ai[1] += 1f;
float num1879 = 15f - 5f * ((float)npc.life / (float)npc.lifeMax);
float num1880 = (CalamityWorld.bossRushActive ? 16f : 6f) + 8f * (1f - (float)npc.life / (float)npc.lifeMax);
float num1881 = 4.5f;
float num1879 = 24f;
float num1880 = CalamityWorld.bossRushActive ? 16f : 4f;
if (revenge)
{
float moveBoost = death ? 12f : 24f * (1f - (float)npc.life / (float)npc.lifeMax);
float speedBoost = death ? 5f : 10f * (1f - (float)npc.life / (float)npc.lifeMax);
num1879 -= moveBoost;
num1880 += speedBoost;
}
float num1881 = 6f;
if (!Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1))
{
num1881 += 2f;
@@ -248,7 +240,7 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.ai[1] > num1879)
{
npc.ai[3] += 1f;
if (npc.ai[3] >= 4f)
if (npc.ai[3] >= 2f)
{
npc.ai[3] = 0f;
num1881 *= 0.75f;
@@ -261,7 +253,6 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
npc.knockBackResist = 0f;
npc.velocity.X = npc.velocity.X * 0.99f;
if (npc.direction < 0 && npc.velocity.X > -1f)
{
@@ -273,47 +264,47 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.ai[2] += 1f;
if (npc.ai[2] > 300f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
if (revenge)
{
npc.ai[2] += (death ? 2f : 4f * (1f - (float)npc.life / (float)npc.lifeMax));
}
if (npc.ai[2] >= 300f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
{
int num1882 = Main.rand.Next(3);
if (num1882 == 0)
{
npc.ai[0] = 3f;
}
else if (num1882 == 1)
{
npc.ai[0] = 4f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -12f : -8f;
}
else if (num1882 == 2)
{
npc.ai[0] = 6f;
}
else
{
npc.ai[0] = 2f;
}
switch (Main.rand.Next(3))
{
case 0:
npc.ai[0] = 2f;
break;
case 1:
npc.ai[0] = 3f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -14f : -10f;
break;
case 2:
npc.ai[0] = 5f;
break;
default:
break;
}
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 3f)
else if (npc.ai[0] == 2f)
{
npc.velocity.X = npc.velocity.X * 0.85f;
npc.ai[1] += 1f;
if (npc.ai[1] >= 40f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 4f)
else if (npc.ai[0] == 3f)
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
if (npc.velocity.X < 0f)
{
npc.direction = -1;
@@ -332,12 +323,12 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
vector272 = Main.player[npc.target].Center - vector;
vector272.Normalize();
vector272 *= CalamityWorld.bossRushActive ? 12f : 8f;
vector272 *= CalamityWorld.bossRushActive ? 14f : 10f;
npc.velocity = (npc.velocity * 4f + vector272) / 5f;
if (npc.ai[1] > 6f)
{
npc.ai[1] = 0f;
npc.ai[0] = 4.1f;
npc.ai[0] = 3.1f;
npc.ai[2] = 0f;
npc.velocity = vector272;
}
@@ -351,13 +342,12 @@ namespace CalamityMod.NPCs.SlimeGod
return;
}
vector272.Normalize();
vector272 *= CalamityWorld.bossRushActive ? 18f : 12f;
vector272 *= CalamityWorld.bossRushActive ? 24f : 16f;
npc.velocity = (npc.velocity * 5f + vector272) / 6f;
}
}
else if (npc.ai[0] == 4.1f)
else if (npc.ai[0] == 3.1f)
{
npc.knockBackResist = 0f;
if (npc.ai[2] == 0f && Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[2] = 1f;
@@ -367,13 +357,13 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
if (npc.ai[1] > 10f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
if (Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
}
}
}
@@ -381,7 +371,6 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
}
npc.velocity.Y = npc.velocity.Y + 0.2f;
if (npc.velocity.Y > 18f)
@@ -391,7 +380,7 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
if (npc.ai[0] == 5f)
if (npc.ai[0] == 4f)
{
if (npc.velocity.X > 0f)
{
@@ -404,12 +393,11 @@ namespace CalamityMod.NPCs.SlimeGod
npc.spriteDirection = npc.direction;
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
Vector2 value74 = Main.player[npc.target].Center - vector;
value74.Y -= 4f;
if (value74.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -417,14 +405,13 @@ namespace CalamityMod.NPCs.SlimeGod
if (value74.Length() > 20f)
{
value74.Normalize();
value74 *= CalamityWorld.bossRushActive ? 22f : 14f;
value74 *= CalamityWorld.bossRushActive ? 24f : 16f;
}
npc.velocity = (npc.velocity * 4f + value74) / 5f;
return;
}
if (npc.ai[0] == 6f)
if (npc.ai[0] == 5f)
{
npc.knockBackResist = 0f;
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
@@ -462,7 +449,7 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.velocity.Y = npc.velocity.Y - 2f;
}
npc.velocity.X = (float)(12 * npc.direction);
npc.velocity.X = (float)((CalamityWorld.bossRushActive ? 24 : 16) * npc.direction);
npc.ai[2] += 1f;
}
}
@@ -480,13 +467,13 @@ namespace CalamityMod.NPCs.SlimeGod
}
if (npc.ai[2] >= 3f && npc.velocity.Y == 0f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 7f)
else if (npc.ai[0] == 6f)
{
npc.life = npc.lifeMax;
npc.defense = 9999;
@@ -529,31 +516,27 @@ namespace CalamityMod.NPCs.SlimeGod
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num660 = (int)((double)npc.lifeMax * 0.05);
if ((float)(npc.life + num660) < bossLife)
{
bossLife = (float)npc.life;
int num661 = 1;
for (int num662 = 0; num662 < num661; num662++)
{
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
int num663 = ModContent.NPCType<SlimeSpawnCrimson>();
if (Main.rand.NextBool(3))
{
num663 = ModContent.NPCType<SlimeSpawnCrimson2>();
}
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num664].SetDefaults(num663, -1f);
Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3));
Main.npc[num664].ai[1] = 0f;
if (Main.netMode == NetmodeID.Server && num664 < 200)
{
NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
}
}
}
if ((float)(npc.life + num660) < bossLife)
{
bossLife = (float)npc.life;
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
int num663 = ModContent.NPCType<SlimeSpawnCrimson>();
if (Main.rand.NextBool(3))
{
num663 = ModContent.NPCType<SlimeSpawnCrimson2>();
}
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num664].SetDefaults(num663, -1f);
Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3));
Main.npc[num664].ai[1] = 0f;
if (Main.netMode == NetmodeID.Server && num664 < 200)
{
NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
}
}
}
}
}
+76 -98
View File
@@ -60,7 +60,8 @@ namespace CalamityMod.NPCs.SlimeGod
CalamityGlobalNPC.slimeGodRed = npc.whoAmI;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
bool flag100 = false;
bool hyperMode = false;
if (CalamityGlobalNPC.slimeGodPurple != -1)
@@ -89,10 +90,6 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.localAI[0] += 2f;
}
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
npc.localAI[0] += 1f;
}
if (expertMode && Main.rand.NextBool(2))
{
if (npc.localAI[0] >= 450f)
@@ -164,16 +161,14 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.aiAction = 0;
npc.knockBackResist = 0.2f * Main.knockBackMultiplier;
npc.noTileCollide = false;
npc.noGravity = false;
npc.reflectingProjectiles = false;
if (npc.ai[0] != 7f && Main.player[npc.target].dead)
if (npc.ai[0] != 6f && Main.player[npc.target].dead)
{
npc.TargetClosest(true);
if (Main.player[npc.target].dead)
{
npc.ai[0] = 7f;
npc.ai[0] = 6f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -186,24 +181,14 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.ai[0] == 0f)
{
npc.TargetClosest(true);
Vector2 vector271 = Main.player[npc.target].Center - vector;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
else if (npc.ai[0] == 1f)
{
npc.ai[1] += 1f;
if (npc.ai[1] > 6f)
{
npc.ai[0] = 2f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 2f)
{
if ((Main.player[npc.target].Center - vector).Length() > (hyperMode ? 1200f : 3600f))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -211,24 +196,26 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
npc.velocity.X = npc.velocity.X * 0.85f;
npc.velocity.X = npc.velocity.X * 0.8f;
npc.ai[1] += 1f;
float num1879 = 15f + 30f * ((float)npc.life / (float)npc.lifeMax);
float num1880 = (CalamityWorld.bossRushActive ? 16f : 6f) + 8f * (1f - (float)npc.life / (float)npc.lifeMax);
float num1881 = 4.5f;
float num1879 = 12f;
float num1880 = CalamityWorld.bossRushActive ? 21f : 9f;
if (revenge)
{
float moveBoost = death ? 10f : 10f * (1f - (float)npc.life / (float)npc.lifeMax);
float speedBoost = death ? 2f : 2f * (1f - (float)npc.life / (float)npc.lifeMax);
num1879 -= moveBoost;
num1880 += speedBoost;
}
float num1881 = 6f;
if (!Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1))
{
num1881 += 2f;
}
if (npc.ai[1] > num1879)
{
npc.ai[3] += 1f;
if (npc.ai[3] >= 2f)
{
npc.ai[3] = 0f;
num1881 *= 0.75f;
num1880 *= 1.5f;
}
num1881 *= 0.75f;
num1880 *= 1.5f;
npc.ai[1] = 0f;
npc.velocity.Y = npc.velocity.Y - num1881;
npc.velocity.X = num1880 * (float)npc.direction;
@@ -236,7 +223,6 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
npc.knockBackResist = 0f;
npc.velocity.X = npc.velocity.X * 0.99f;
if (npc.direction < 0 && npc.velocity.X > -1f)
{
@@ -248,47 +234,47 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.ai[2] += 1f;
if (npc.ai[2] > 240f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
if (revenge)
{
npc.ai[2] += (death ? 1f : 1f * (1f - (float)npc.life / (float)npc.lifeMax));
}
if (npc.ai[2] >= 100f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
{
int num1882 = Main.rand.Next(3);
if (num1882 == 0)
{
npc.ai[0] = 3f;
}
else if (num1882 == 1)
{
npc.ai[0] = 4f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -12f : -8f;
}
else if (num1882 == 2)
{
npc.ai[0] = 6f;
}
else
{
npc.ai[0] = 2f;
}
npc.ai[1] = 0f;
switch (Main.rand.Next(3))
{
case 0:
npc.ai[0] = 2f;
break;
case 1:
npc.ai[0] = 3f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -16f : -12f;
break;
case 2:
npc.ai[0] = 5f;
break;
default:
break;
}
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 3f)
else if (npc.ai[0] == 2f)
{
npc.velocity.X = npc.velocity.X * 0.85f;
npc.ai[1] += 1f;
if (npc.ai[1] >= 30f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 4f)
else if (npc.ai[0] == 3f)
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
if (npc.velocity.X < 0f)
{
npc.direction = -1;
@@ -307,12 +293,12 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
vector272 = Main.player[npc.target].Center - vector;
vector272.Normalize();
vector272 *= CalamityWorld.bossRushActive ? 12f : 8f;
vector272 *= CalamityWorld.bossRushActive ? 16f : 12f;
npc.velocity = (npc.velocity * 4f + vector272) / 5f;
if (npc.ai[1] > 6f)
{
npc.ai[1] = 0f;
npc.ai[0] = 4.1f;
npc.ai[0] = 3.1f;
npc.ai[2] = 0f;
npc.velocity = vector272;
}
@@ -326,13 +312,12 @@ namespace CalamityMod.NPCs.SlimeGod
return;
}
vector272.Normalize();
vector272 *= CalamityWorld.bossRushActive ? 18f : 12f;
vector272 *= CalamityWorld.bossRushActive ? 26f : 18f;
npc.velocity = (npc.velocity * 5f + vector272) / 6f;
}
}
else if (npc.ai[0] == 4.1f)
else if (npc.ai[0] == 3.1f)
{
npc.knockBackResist = 0f;
if (npc.ai[2] == 0f && Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[2] = 1f;
@@ -342,13 +327,13 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
if (npc.ai[1] > 10f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
if (Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
}
}
}
@@ -356,7 +341,6 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
}
npc.velocity.Y = npc.velocity.Y + 0.2f;
if (npc.velocity.Y > 20f)
@@ -366,7 +350,7 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
if (npc.ai[0] == 5f)
if (npc.ai[0] == 4f)
{
if (npc.velocity.X > 0f)
{
@@ -379,12 +363,11 @@ namespace CalamityMod.NPCs.SlimeGod
npc.spriteDirection = npc.direction;
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
Vector2 value74 = Main.player[npc.target].Center - vector;
value74.Y -= 4f;
if (value74.Length() < 250f && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -397,9 +380,8 @@ namespace CalamityMod.NPCs.SlimeGod
npc.velocity = (npc.velocity * 4f + value74) / 5f;
return;
}
if (npc.ai[0] == 6f)
if (npc.ai[0] == 5f)
{
npc.knockBackResist = 0f;
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
@@ -437,7 +419,7 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.velocity.Y = npc.velocity.Y - 2f;
}
npc.velocity.X = (float)(12 * npc.direction);
npc.velocity.X = (float)((CalamityWorld.bossRushActive ? 26 : 18) * npc.direction);
npc.ai[2] += 1f;
}
}
@@ -455,13 +437,13 @@ namespace CalamityMod.NPCs.SlimeGod
}
if (npc.ai[2] >= 3f && npc.velocity.Y == 0f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 7f)
else if (npc.ai[0] == 6f)
{
npc.life = npc.lifeMax;
npc.defense = 9999;
@@ -504,31 +486,27 @@ namespace CalamityMod.NPCs.SlimeGod
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num660 = (int)((double)npc.lifeMax * 0.05);
if ((float)(npc.life + num660) < bossLife)
{
bossLife = (float)npc.life;
int num661 = 1;
for (int num662 = 0; num662 < num661; num662++)
{
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
int num663 = ModContent.NPCType<SlimeSpawnCrimson>();
if (Main.rand.NextBool(3))
{
num663 = ModContent.NPCType<SlimeSpawnCrimson2>();
}
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num664].SetDefaults(num663, -1f);
Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3));
Main.npc[num664].ai[1] = 0f;
if (Main.netMode == NetmodeID.Server && num664 < 200)
{
NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
}
}
}
if ((float)(npc.life + num660) < bossLife)
{
bossLife = (float)npc.life;
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
int num663 = ModContent.NPCType<SlimeSpawnCrimson>();
if (Main.rand.NextBool(3))
{
num663 = ModContent.NPCType<SlimeSpawnCrimson2>();
}
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num664].SetDefaults(num663, -1f);
Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3));
Main.npc[num664].ai[1] = 0f;
if (Main.netMode == NetmodeID.Server && num664 < 200)
{
NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
}
}
}
}
}
+72 -90
View File
@@ -60,7 +60,8 @@ namespace CalamityMod.NPCs.SlimeGod
CalamityGlobalNPC.slimeGodPurple = npc.whoAmI;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
bool flag100 = false;
bool hyperMode = false;
if (CalamityGlobalNPC.slimeGodRed != -1)
@@ -148,16 +149,14 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.aiAction = 0;
npc.knockBackResist = 0.2f * Main.knockBackMultiplier;
npc.noTileCollide = false;
npc.noGravity = false;
npc.reflectingProjectiles = false;
if (npc.ai[0] != 7f && Main.player[npc.target].dead)
if (npc.ai[0] != 6f && Main.player[npc.target].dead)
{
npc.TargetClosest(true);
if (Main.player[npc.target].dead)
{
npc.ai[0] = 7f;
npc.ai[0] = 6f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -170,24 +169,14 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.ai[0] == 0f)
{
npc.TargetClosest(true);
Vector2 vector271 = Main.player[npc.target].Center - vector;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
else if (npc.ai[0] == 1f)
{
npc.ai[1] += 1f;
if (npc.ai[1] > 12f)
{
npc.ai[0] = 2f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 2f)
{
if ((Main.player[npc.target].Center - vector).Length() > (hyperMode ? 1200f : 3600f))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -197,22 +186,24 @@ namespace CalamityMod.NPCs.SlimeGod
npc.TargetClosest(true);
npc.velocity.X = npc.velocity.X * 0.8f;
npc.ai[1] += flag100 ? 1f : 3f;
float num1879 = 15f - 5f * ((float)npc.life / (float)npc.lifeMax);
float num1880 = (CalamityWorld.bossRushActive ? 12f : 3f) + 4f * (1f - (float)npc.life / (float)npc.lifeMax);
float num1881 = 9f;
float num1879 = 15f;
float num1880 = CalamityWorld.bossRushActive ? 16f : 7f;
if (revenge)
{
float moveBoost = death ? 12f : 12f * (1f - (float)npc.life / (float)npc.lifeMax);
float speedBoost = death ? 2f : 2f * (1f - (float)npc.life / (float)npc.lifeMax);
num1879 -= moveBoost;
num1880 += speedBoost;
}
float num1881 = 9f;
if (!Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1))
{
num1881 += 2f;
}
if (npc.ai[1] > num1879)
{
npc.ai[3] += 1f;
if (npc.ai[3] >= 1f)
{
npc.ai[3] = 0f;
num1881 *= 1.5f;
num1880 *= 0.75f;
}
num1881 *= 1.5f;
num1880 *= 0.75f;
npc.ai[1] = 0f;
npc.velocity.Y = npc.velocity.Y - num1881;
npc.velocity.X = num1880 * (float)npc.direction;
@@ -220,7 +211,6 @@ namespace CalamityMod.NPCs.SlimeGod
}
else
{
npc.knockBackResist = 0f;
npc.velocity.X = npc.velocity.X * 0.99f;
if (npc.direction < 0 && npc.velocity.X > -1f)
{
@@ -232,47 +222,47 @@ namespace CalamityMod.NPCs.SlimeGod
}
}
npc.ai[2] += 1f;
if (npc.ai[2] > 150f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
if (revenge)
{
npc.ai[2] += (death ? 1f : 1f * (1f - (float)npc.life / (float)npc.lifeMax));
}
if (npc.ai[2] >= 120f && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient)
{
int num1882 = Main.rand.Next(3);
if (num1882 == 0)
{
npc.ai[0] = 3f;
}
else if (num1882 == 1)
{
npc.ai[0] = 4f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -12f : -8f;
}
else if (num1882 == 2)
{
npc.ai[0] = 6f;
}
else
{
npc.ai[0] = 2f;
}
switch (Main.rand.Next(3))
{
case 0:
npc.ai[0] = 2f;
break;
case 1:
npc.ai[0] = 3f;
npc.noTileCollide = true;
npc.velocity.Y = CalamityWorld.bossRushActive ? -14f : -10f;
break;
case 2:
npc.ai[0] = 5f;
break;
default:
break;
}
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 3f)
else if (npc.ai[0] == 2f)
{
npc.velocity.X = npc.velocity.X * 0.85f;
npc.ai[1] += 1f;
if (npc.ai[1] >= 40f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
}
}
else if (npc.ai[0] == 4f)
else if (npc.ai[0] == 3f)
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
if (npc.velocity.X < 0f)
{
npc.direction = -1;
@@ -291,12 +281,12 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
vector272 = Main.player[npc.target].Center - vector;
vector272.Normalize();
vector272 *= CalamityWorld.bossRushActive ? 12f : 8f;
vector272 *= CalamityWorld.bossRushActive ? 14f : 10f;
npc.velocity = (npc.velocity * 4f + vector272) / 5f;
if (npc.ai[1] > 6f)
{
npc.ai[1] = 0f;
npc.ai[0] = 4.1f;
npc.ai[0] = 3.1f;
npc.ai[2] = 0f;
npc.velocity = vector272;
}
@@ -310,13 +300,12 @@ namespace CalamityMod.NPCs.SlimeGod
return;
}
vector272.Normalize();
vector272 *= CalamityWorld.bossRushActive ? 18f : 12f;
vector272 *= CalamityWorld.bossRushActive ? 24f : 16f;
npc.velocity = (npc.velocity * 5f + vector272) / 6f;
}
}
else if (npc.ai[0] == 4.1f)
else if (npc.ai[0] == 3.1f)
{
npc.knockBackResist = 0f;
if (npc.ai[2] == 0f && Collision.CanHit(vector, 1, 1, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[2] = 1f;
@@ -326,13 +315,13 @@ namespace CalamityMod.NPCs.SlimeGod
npc.ai[1] += 1f;
if (npc.ai[1] > 10f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
if (Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 5f;
npc.ai[0] = 4f;
}
}
}
@@ -340,17 +329,16 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
}
npc.velocity.Y = npc.velocity.Y + 0.2f;
if (npc.velocity.Y > 16f)
if (npc.velocity.Y > 18f)
{
npc.velocity.Y = 16f;
npc.velocity.Y = 18f;
}
}
else
{
if (npc.ai[0] == 5f)
if (npc.ai[0] == 4f)
{
npc.localAI[0] += (float)Main.rand.Next(4, 9);
if (npc.velocity.X > 0f)
@@ -364,12 +352,11 @@ namespace CalamityMod.NPCs.SlimeGod
npc.spriteDirection = npc.direction;
npc.noTileCollide = true;
npc.noGravity = true;
npc.knockBackResist = 0f;
Vector2 value74 = Main.player[npc.target].Center - vector;
value74.Y -= 4f;
if (value74.Length() < 200f && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
@@ -382,9 +369,8 @@ namespace CalamityMod.NPCs.SlimeGod
npc.velocity = (npc.velocity * 4f + value74) / 5f;
return;
}
if (npc.ai[0] == 6f)
if (npc.ai[0] == 5f)
{
npc.knockBackResist = 0f;
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
@@ -422,7 +408,7 @@ namespace CalamityMod.NPCs.SlimeGod
{
npc.velocity.Y = npc.velocity.Y - 2f;
}
npc.velocity.X = (float)(12 * npc.direction);
npc.velocity.X = (float)((CalamityWorld.bossRushActive ? 24 : 16) * npc.direction);
npc.ai[2] += 1f;
}
}
@@ -440,13 +426,13 @@ namespace CalamityMod.NPCs.SlimeGod
}
if (npc.ai[2] >= 3f && npc.velocity.Y == 0f)
{
npc.ai[0] = 2f;
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
}
}
else if (npc.ai[0] == 7f)
else if (npc.ai[0] == 6f)
{
npc.life = npc.lifeMax;
npc.defense = 9999;
@@ -489,27 +475,23 @@ namespace CalamityMod.NPCs.SlimeGod
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num660 = (int)((double)npc.lifeMax * 0.15);
if ((float)(npc.life + num660) < bossLife)
{
bossLife = (float)npc.life;
int num661 = 1;
for (int num662 = 0; num662 < num661; num662++)
{
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
int num663 = ModContent.NPCType<SlimeSpawnCorrupt>();
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num664].SetDefaults(num663, -1f);
Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3));
Main.npc[num664].ai[1] = 0f;
if (Main.netMode == NetmodeID.Server && num664 < 200)
{
NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
}
}
}
if ((float)(npc.life + num660) < bossLife)
{
bossLife = (float)npc.life;
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
int num663 = ModContent.NPCType<SlimeSpawnCorrupt>();
int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num664].SetDefaults(num663, -1f);
Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3));
Main.npc[num664].ai[1] = 0f;
if (Main.netMode == NetmodeID.Server && num664 < 200)
{
NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0);
}
}
}
}
}
+4 -4
View File
@@ -80,7 +80,8 @@ namespace CalamityMod.NPCs.StormWeaver
public override void AI()
{
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
if (npc.defense < 99999 && CalamityWorld.DoGSecondStageCountdown <= 0)
{
npc.defense = 99999;
@@ -93,8 +94,6 @@ namespace CalamityMod.NPCs.StormWeaver
{
RainStart();
}
int BoltProjectiles = 1;
bool expertMode = Main.expertMode;
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f);
if (npc.ai[3] > 0f)
{
@@ -175,7 +174,8 @@ namespace CalamityMod.NPCs.StormWeaver
Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn;
baseVelocity.Normalize();
baseVelocity *= speed2;
for (int i = 0; i < BoltProjectiles; i++)
int BoltProjectiles = 1;
for (int i = 0; i < BoltProjectiles; i++)
{
Vector2 spawn2 = baseSpawn;
spawn2.X = spawn2.X + i * 30 - (BoltProjectiles * 15);
+4 -3
View File
@@ -87,7 +87,8 @@ namespace CalamityMod.NPCs.StormWeaver
public override void AI()
{
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
if (invinceTime > 0)
{
@@ -107,7 +108,7 @@ namespace CalamityMod.NPCs.StormWeaver
double lifeRatio = (double)npc.life / (double)npc.lifeMax;
int lifePercentage = (int)(100.0 * lifeRatio);
int BoltProjectiles = 2;
if (lifePercentage < 33)
if (lifePercentage < 33 || death)
{
BoltProjectiles = 4;
}
@@ -166,7 +167,7 @@ namespace CalamityMod.NPCs.StormWeaver
}
int damage = expertMode ? 62 : 75;
npc.localAI[0] += 1f;
if (npc.localAI[0] >= ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 180f : 300f))
if (npc.localAI[0] >= 300f)
{
npc.localAI[0] = 0f;
npc.TargetClosest(true);
+6 -4
View File
@@ -227,7 +227,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas
CalamityMod.StopRain();
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
Player player = Main.player[npc.target];
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Player player = Main.player[npc.target];
if (!startText)
{
@@ -307,7 +309,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
{
spawnArena = true;
Vector2 vectorPlayer = new Vector2(player.position.X, player.position.Y);
if (CalamityWorld.death || CalamityWorld.bossRushActive)
if (death)
{
safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - 1000f);
spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + 1000f);
@@ -470,7 +472,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
if (Main.netMode != NetmodeID.MultiplayerClient)
{
spawnY += 250;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
if (death)
{
spawnY -= 50;
}
@@ -931,7 +933,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
if (Main.netMode != NetmodeID.MultiplayerClient)
{
spawnY += 250;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
if (death)
{
spawnY -= 50;
}
+18 -25
View File
@@ -226,17 +226,17 @@ namespace CalamityMod.NPCs.Yharon
return;
}
// Phase bools
// Phase bools
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool phase2Check = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.85 : 0.7);
bool phase3Check = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.6 : 0.4);
bool phase4Check = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.25 : 0.2);
if (CalamityWorld.death && !CalamityWorld.bossRushActive)
if (death)
{
phase2Check = (double)npc.life <= (double)npc.lifeMax * 0.9;
phase3Check = (double)npc.life <= (double)npc.lifeMax * 0.8;
phase4Check = (double)npc.life <= (double)npc.lifeMax * 0.3;
phase2Check = (double)npc.life <= (double)npc.lifeMax * 0.95;
phase3Check = (double)npc.life <= (double)npc.lifeMax * 0.9;
}
bool phase5Check = (double)npc.life <= (double)npc.lifeMax * 0.1;
bool phase2Change = npc.ai[0] > 5f;
@@ -1241,7 +1241,7 @@ namespace CalamityMod.NPCs.Yharon
case 1:
case 2:
case 3:
aiState = (CalamityWorld.death && !CalamityWorld.bossRushActive) ? 5 : 1; //normal charges
aiState = death ? 5 : 1; //normal charges
break;
case 4:
case 5:
@@ -1561,7 +1561,7 @@ namespace CalamityMod.NPCs.Yharon
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y);
}
if (CalamityWorld.death && !CalamityWorld.bossRushActive)
if (death)
{
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1457 - 30))
{
@@ -1832,22 +1832,23 @@ namespace CalamityMod.NPCs.Yharon
#region AI2
public void Yharon_AI2()
{
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.75;
bool phase3 = (double)npc.life <= (double)npc.lifeMax * 0.5;
bool phase4 = (double)npc.life <= (double)npc.lifeMax * 0.05;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
bool phase4 = (double)npc.life <= (double)npc.lifeMax * 0.1;
if (death)
{
phase2 = (double)npc.life <= (double)npc.lifeMax * 0.95;
phase3 = (double)npc.life <= (double)npc.lifeMax * 0.7;
phase4 = (double)npc.life <= (double)npc.lifeMax * 0.15;
phase3 = (double)npc.life <= (double)npc.lifeMax * 0.9;
phase4 = (double)npc.life <= (double)npc.lifeMax * 0.35;
}
else if (revenge)
{
phase2 = (double)npc.life <= (double)npc.lifeMax * 0.85;
phase3 = (double)npc.life <= (double)npc.lifeMax * 0.6;
phase4 = (double)npc.life <= (double)npc.lifeMax * 0.1;
phase4 = (double)npc.life <= (double)npc.lifeMax * 0.2;
}
if (npc.ai[0] != 8f)
{
@@ -1945,17 +1946,17 @@ namespace CalamityMod.NPCs.Yharon
num4 = (int)((double)num4 * 1.25);
}
float num6 = revenge ? 0.6f : 0.55f;
float scaleFactor = revenge ? 10f : 9f;
float scaleFactor = revenge ? 10.5f : 9f;
float chargeTime = 34f;
float chargeTime2 = 30f;
float chargeSpeed = revenge ? 26f : 25f;
float chargeSpeed2 = revenge ? 40f : 38f;
float chargeSpeed = revenge ? 27f : 25f;
float chargeSpeed2 = revenge ? 41f : 38f;
float num11 = 40f;
float num12 = 80f;
float num13 = num11 + num12;
float num15 = 60f;
float scaleFactor3 = 14f;
float scaleFactor4 = revenge ? 16f : 15f; //12
float scaleFactor4 = revenge ? 16.5f : 15f; //12
int num16 = 10;
int num17 = 6 * num16;
float num18 = 60f;
@@ -1963,15 +1964,7 @@ namespace CalamityMod.NPCs.Yharon
float num20 = 60f;
float num21 = 1f;
float num22 = 6.28318548f * (num21 / num20);
float scaleFactor5 = revenge ? 38f : 36.5f; //32
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
scaleFactor = 10.5f;
chargeSpeed = 27f;
chargeSpeed2 = 41f;
scaleFactor4 = 16.5f;
scaleFactor5 = 39f;
}
float scaleFactor5 = revenge ? 39f : 36.5f; //32
if (npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
{
num6 = 0.65f;