Multiple Death Mode AI changes.
Death Mode slime AI changes. Brimstone Crag brimstone geysers in Death Mode.
This commit is contained in:
1 parent
29a9a62603
commit
bc0ab4ed28
29 files changed
+644
-58
No files matched your search
@@ -16,6 +16,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
aiType = 141;
|
||||
npc.damage = 50;
|
||||
npc.width = 40;
|
||||
npc.height = 30;
|
||||
|
||||
+506
-7
@@ -14059,10 +14059,507 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Death Mode NPC AI
|
||||
public static bool BuffedFighterAI(NPC npc, Mod mod)
|
||||
#region Death Mode NPC AI
|
||||
|
||||
#region Slime AI
|
||||
public static bool BuffedSlimeAI(NPC npc, Mod mod)
|
||||
{
|
||||
if (npc.type == 1 && (npc.ai[1] == 1f || npc.ai[1] == 2f || npc.ai[1] == 3f))
|
||||
{
|
||||
npc.ai[1] = -1f;
|
||||
}
|
||||
if (npc.type == 1 && npc.ai[1] == 0f && Main.netMode != 1 && npc.value > 0f)
|
||||
{
|
||||
npc.ai[1] = -1f;
|
||||
if (Main.rand.Next(20) == 0)
|
||||
{
|
||||
int num = Main.rand.Next(4);
|
||||
if (num == 0)
|
||||
{
|
||||
num = Main.rand.Next(7);
|
||||
if (num == 0)
|
||||
{
|
||||
num = 290;
|
||||
}
|
||||
else if (num == 1)
|
||||
{
|
||||
num = 292;
|
||||
}
|
||||
else if (num == 2)
|
||||
{
|
||||
num = 296;
|
||||
}
|
||||
else if (num == 3)
|
||||
{
|
||||
num = 2322;
|
||||
}
|
||||
else if (Main.netMode != 0 && Main.rand.Next(2) == 0)
|
||||
{
|
||||
num = 2997;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = 2350;
|
||||
}
|
||||
}
|
||||
else if (num == 1)
|
||||
{
|
||||
num = Main.rand.Next(4);
|
||||
if (num == 0)
|
||||
{
|
||||
num = 8;
|
||||
}
|
||||
else if (num == 1)
|
||||
{
|
||||
num = 166;
|
||||
}
|
||||
else if (num == 2)
|
||||
{
|
||||
num = 965;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = 58;
|
||||
}
|
||||
}
|
||||
else if (num == 2)
|
||||
{
|
||||
if (Main.rand.Next(2) == 0)
|
||||
{
|
||||
num = Main.rand.Next(11, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = Main.rand.Next(699, 703);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num = Main.rand.Next(3);
|
||||
if (num == 0)
|
||||
{
|
||||
num = 71;
|
||||
}
|
||||
else if (num == 1)
|
||||
{
|
||||
num = 72;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = 73;
|
||||
}
|
||||
}
|
||||
npc.ai[1] = (float)num;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
if (npc.type == 244)
|
||||
{
|
||||
float num2 = (float)Main.DiscoR / 255f;
|
||||
float num3 = (float)Main.DiscoG / 255f;
|
||||
float num4 = (float)Main.DiscoB / 255f;
|
||||
num2 *= 1f;
|
||||
num3 *= 1f;
|
||||
num4 *= 1f;
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), num2, num3, num4);
|
||||
npc.color.R = (byte)Main.DiscoR;
|
||||
npc.color.G = (byte)Main.DiscoG;
|
||||
npc.color.B = (byte)Main.DiscoB;
|
||||
npc.color.A = 100;
|
||||
npc.alpha = 175;
|
||||
}
|
||||
bool flag = true;
|
||||
if (npc.type == 81)
|
||||
{
|
||||
if (Main.rand.Next(30) == 0)
|
||||
{
|
||||
int num5 = Dust.NewDust(npc.position, npc.width, npc.height, 14, 0f, 0f, npc.alpha, npc.color, 1f);
|
||||
Main.dust[num5].velocity *= 0.3f;
|
||||
}
|
||||
}
|
||||
if (npc.type == 147 && Main.rand.Next(10) == 0)
|
||||
{
|
||||
int num6 = Dust.NewDust(npc.position, npc.width, npc.height, 76, 0f, 0f, 0, default(Color), 1f);
|
||||
Main.dust[num6].noGravity = true;
|
||||
Main.dust[num6].velocity *= 0.1f;
|
||||
}
|
||||
if (npc.type == 184)
|
||||
{
|
||||
if (Main.rand.Next(8) == 0)
|
||||
{
|
||||
int num7 = Dust.NewDust(npc.position - npc.velocity, npc.width, npc.height, 76, 0f, 0f, 0, default(Color), 1f);
|
||||
Main.dust[num7].noGravity = true;
|
||||
Main.dust[num7].velocity *= 0.15f;
|
||||
}
|
||||
if (npc.localAI[0] > 0f)
|
||||
{
|
||||
npc.localAI[0] -= 1f;
|
||||
}
|
||||
if (!npc.wet && !Main.player[npc.target].npcTypeNoAggro[npc.type])
|
||||
{
|
||||
Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num8 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector.X;
|
||||
float num9 = Main.player[npc.target].position.Y - vector.Y;
|
||||
float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9));
|
||||
if (Main.expertMode && num10 < 120f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.ai[0] = -40f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
}
|
||||
if (Main.netMode != 1 && npc.localAI[0] == 0f)
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Vector2 vector2 = new Vector2((float)(i - 2), -4f);
|
||||
vector2.X *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f;
|
||||
vector2.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f;
|
||||
vector2.Normalize();
|
||||
vector2 *= 4f + (float)Main.rand.Next(-50, 51) * 0.01f;
|
||||
Projectile.NewProjectile(vector.X, vector.Y, vector2.X, vector2.Y, 174, 9, 0f, Main.myPlayer, 0f, 0f);
|
||||
npc.localAI[0] = 30f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num10 < 200f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.ai[0] = -40f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
}
|
||||
if (Main.netMode != 1 && npc.localAI[0] == 0f)
|
||||
{
|
||||
num9 = Main.player[npc.target].position.Y - vector.Y - (float)Main.rand.Next(0, 200);
|
||||
num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9));
|
||||
num10 = 4.5f / num10;
|
||||
num8 *= num10;
|
||||
num9 *= num10;
|
||||
npc.localAI[0] = 50f;
|
||||
Projectile.NewProjectile(vector.X, vector.Y, num8, num9, 174, 9, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.type == 535)
|
||||
{
|
||||
if (npc.localAI[0] > 0f)
|
||||
{
|
||||
npc.localAI[0] -= 1f;
|
||||
}
|
||||
if (!npc.wet && !Main.player[npc.target].npcTypeNoAggro[npc.type])
|
||||
{
|
||||
Vector2 vector3 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num11 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector3.X;
|
||||
float num12 = Main.player[npc.target].position.Y - vector3.Y;
|
||||
float num13 = (float)Math.Sqrt((double)(num11 * num11 + num12 * num12));
|
||||
if (Main.expertMode && num13 < 120f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.ai[0] = -40f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
}
|
||||
if (Main.netMode != 1 && npc.localAI[0] == 0f)
|
||||
{
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
Vector2 vector4 = new Vector2((float)(j - 2), -4f);
|
||||
vector4.X *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f;
|
||||
vector4.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f;
|
||||
vector4.Normalize();
|
||||
vector4 *= 4f + (float)Main.rand.Next(-50, 51) * 0.01f;
|
||||
Projectile.NewProjectile(vector3.X, vector3.Y, vector4.X, vector4.Y, 605, 9, 0f, Main.myPlayer, 0f, 0f);
|
||||
npc.localAI[0] = 30f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num13 < 200f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.ai[0] = -40f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
}
|
||||
if (Main.netMode != 1 && npc.localAI[0] == 0f)
|
||||
{
|
||||
num12 = Main.player[npc.target].position.Y - vector3.Y - (float)Main.rand.Next(0, 200);
|
||||
num13 = (float)Math.Sqrt((double)(num11 * num11 + num12 * num12));
|
||||
num13 = 4.5f / num13;
|
||||
num11 *= num13;
|
||||
num12 *= num13;
|
||||
npc.localAI[0] = 50f;
|
||||
Projectile.NewProjectile(vector3.X, vector3.Y, num11, num12, 605, 9, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.type == 204)
|
||||
{
|
||||
if (npc.localAI[0] > 0f)
|
||||
{
|
||||
npc.localAI[0] -= 1f;
|
||||
}
|
||||
if (!npc.wet && !Main.player[npc.target].npcTypeNoAggro[npc.type])
|
||||
{
|
||||
Vector2 vector5 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num14 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector5.X;
|
||||
float num15 = Main.player[npc.target].position.Y - vector5.Y;
|
||||
float num16 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15));
|
||||
if (Main.expertMode && num16 < 200f && Collision.CanHit(new Vector2(npc.position.X, npc.position.Y - 20f), npc.width, npc.height + 20, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.ai[0] = -40f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
}
|
||||
if (Main.netMode != 1 && npc.localAI[0] == 0f)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Vector2 vector6 = new Vector2((float)(k - 2), -2f);
|
||||
vector6.X *= 1f + (float)Main.rand.Next(-50, 51) * 0.02f;
|
||||
vector6.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.02f;
|
||||
vector6.Normalize();
|
||||
vector6 *= 3f + (float)Main.rand.Next(-50, 51) * 0.01f;
|
||||
Projectile.NewProjectile(vector5.X, vector5.Y, vector6.X, vector6.Y, 176, 13, 0f, Main.myPlayer, 0f, 0f);
|
||||
npc.localAI[0] = 80f;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num16 < 400f && Collision.CanHit(new Vector2(npc.position.X, npc.position.Y - 20f), npc.width, npc.height + 20, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.ai[0] = -80f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
}
|
||||
if (Main.netMode != 1 && npc.localAI[0] == 0f)
|
||||
{
|
||||
num15 = Main.player[npc.target].position.Y - vector5.Y - (float)Main.rand.Next(-30, 20);
|
||||
num15 -= num16 * 0.05f;
|
||||
num14 = Main.player[npc.target].position.X - vector5.X - (float)Main.rand.Next(-20, 20);
|
||||
num16 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15));
|
||||
num16 = 7f / num16;
|
||||
num14 *= num16;
|
||||
num15 *= num16;
|
||||
npc.localAI[0] = 65f;
|
||||
Projectile.NewProjectile(vector5.X, vector5.Y, num14, num15, 176, 13, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.type == 59 || npc.type == ModContent.NPCType<CharredSlime>())
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1f, 0.3f, 0.1f);
|
||||
int num17 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 1.7f);
|
||||
Main.dust[num17].noGravity = true;
|
||||
}
|
||||
if (npc.ai[2] > 1f)
|
||||
{
|
||||
npc.ai[2] -= 1f;
|
||||
}
|
||||
if (npc.wet)
|
||||
{
|
||||
if (npc.collideY)
|
||||
{
|
||||
npc.velocity.Y = -4f;
|
||||
}
|
||||
if (npc.velocity.Y < 0f && npc.ai[3] == npc.position.X)
|
||||
{
|
||||
npc.direction *= -1;
|
||||
npc.ai[2] = 200f;
|
||||
}
|
||||
if (npc.velocity.Y > 0f)
|
||||
{
|
||||
npc.ai[3] = npc.position.X;
|
||||
}
|
||||
if (npc.type == 59 || npc.type == ModContent.NPCType<CharredSlime>())
|
||||
{
|
||||
if (npc.velocity.Y > 2f)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y * 0.9f;
|
||||
}
|
||||
else if (npc.directionY < 0)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - 1.2f;
|
||||
}
|
||||
npc.velocity.Y = npc.velocity.Y - 0.8f;
|
||||
if (npc.velocity.Y < -16f)
|
||||
{
|
||||
npc.velocity.Y = -16f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.velocity.Y > 2f)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y * 0.9f;
|
||||
}
|
||||
npc.velocity.Y = npc.velocity.Y - 0.6f;
|
||||
if (npc.velocity.Y < -6f)
|
||||
{
|
||||
npc.velocity.Y = -6f;
|
||||
}
|
||||
}
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
}
|
||||
}
|
||||
npc.aiAction = 0;
|
||||
if (npc.ai[2] == 0f)
|
||||
{
|
||||
npc.ai[0] = -100f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.TargetClosest(true);
|
||||
}
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
if (npc.collideY && npc.oldVelocity.Y != 0f && Collision.SolidCollision(npc.position, npc.width, npc.height))
|
||||
{
|
||||
npc.position.X = npc.position.X - (npc.velocity.X + (float)npc.direction);
|
||||
}
|
||||
if (npc.ai[3] == npc.position.X)
|
||||
{
|
||||
npc.direction *= -1;
|
||||
npc.ai[2] = 200f;
|
||||
}
|
||||
npc.ai[3] = 0f;
|
||||
npc.velocity.X = npc.velocity.X * 0.8f;
|
||||
if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1)
|
||||
{
|
||||
npc.velocity.X = 0f;
|
||||
}
|
||||
npc.ai[0] += (Main.slimeRain ? 4f : 3f);
|
||||
if (npc.type == 59 || npc.type == ModContent.NPCType<CharredSlime>())
|
||||
{
|
||||
npc.ai[0] += 2f;
|
||||
}
|
||||
if (npc.type == 71 || npc.type == ModContent.NPCType<CryoSlime>() || npc.type == ModContent.NPCType<CrimulanBlightSlime>() ||
|
||||
npc.type == ModContent.NPCType<EbonianBlightSlime>())
|
||||
{
|
||||
npc.ai[0] += 3f;
|
||||
}
|
||||
if (npc.type == 138)
|
||||
{
|
||||
npc.ai[0] += 2f;
|
||||
}
|
||||
if (npc.type == 183)
|
||||
{
|
||||
npc.ai[0] += 1f;
|
||||
}
|
||||
if (npc.type == 244)
|
||||
{
|
||||
npc.ai[0] += 2f;
|
||||
}
|
||||
if (npc.type == 304)
|
||||
{
|
||||
npc.ai[0] += 10f;
|
||||
}
|
||||
if (npc.type == 81)
|
||||
{
|
||||
if (npc.scale >= 0f)
|
||||
{
|
||||
npc.ai[0] += 4f;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[0] += 1f;
|
||||
}
|
||||
}
|
||||
int num19 = 0;
|
||||
if (npc.ai[0] >= 0f)
|
||||
{
|
||||
num19 = 1;
|
||||
}
|
||||
if (npc.ai[0] >= -1000f && npc.ai[0] <= -500f)
|
||||
{
|
||||
num19 = 2;
|
||||
}
|
||||
if (npc.ai[0] >= -2000f && npc.ai[0] <= -1500f)
|
||||
{
|
||||
num19 = 3;
|
||||
}
|
||||
if (num19 > 0)
|
||||
{
|
||||
npc.netUpdate = true;
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
}
|
||||
if (num19 == 3)
|
||||
{
|
||||
npc.velocity.Y = (Main.slimeRain ? -12f : -10f);
|
||||
if (npc.type == 59 || npc.type == ModContent.NPCType<CharredSlime>())
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - 2f;
|
||||
}
|
||||
npc.velocity.X = npc.velocity.X + (float)((Main.slimeRain ? 6 : 5) * npc.direction);
|
||||
if (npc.type == 59 || npc.type == ModContent.NPCType<CharredSlime>())
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X + 0.5f * (float)npc.direction;
|
||||
}
|
||||
npc.ai[0] = -200f;
|
||||
npc.ai[3] = npc.position.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.velocity.Y = (Main.slimeRain ? -5f : -4f);
|
||||
npc.velocity.X = npc.velocity.X + (float)((Main.slimeRain ? 5 : 4) * npc.direction);
|
||||
if (npc.type == 59 || npc.type == ModContent.NPCType<CharredSlime>())
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X + (float)(2 * npc.direction);
|
||||
}
|
||||
npc.ai[0] = -120f;
|
||||
if (num19 == 1)
|
||||
{
|
||||
npc.ai[0] -= 1000f;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[0] -= 2000f;
|
||||
}
|
||||
}
|
||||
if (npc.type == 141 || npc.type == ModContent.NPCType<PerennialSlime>() || npc.type == ModContent.NPCType<BloomSlime>() ||
|
||||
npc.type == ModContent.NPCType<IrradiatedSlime>())
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y * 1.3f;
|
||||
npc.velocity.X = npc.velocity.X * 1.2f;
|
||||
}
|
||||
}
|
||||
else if (npc.ai[0] >= -30f)
|
||||
{
|
||||
npc.aiAction = 1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (npc.target < 255 && ((npc.direction == 1 && npc.velocity.X < 3f) || (npc.direction == -1 && npc.velocity.X > -3f)))
|
||||
{
|
||||
if (npc.collideX && Math.Abs(npc.velocity.X) == 0.2f)
|
||||
{
|
||||
npc.position.X = npc.position.X - 1.4f * (float)npc.direction;
|
||||
}
|
||||
if (npc.collideY && npc.oldVelocity.Y != 0f && Collision.SolidCollision(npc.position, npc.width, npc.height))
|
||||
{
|
||||
npc.position.X = npc.position.X - (npc.velocity.X + (float)npc.direction);
|
||||
}
|
||||
if ((npc.direction == -1 && (double)npc.velocity.X < 0.01) || (npc.direction == 1 && (double)npc.velocity.X > -0.01))
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X + 0.2f * (float)npc.direction;
|
||||
return false;
|
||||
}
|
||||
npc.velocity.X = npc.velocity.X * 0.93f;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fighter AI
|
||||
public static bool BuffedFighterAI(NPC npc, Mod mod)
|
||||
{
|
||||
if (npc.type == NPCID.Psycho)
|
||||
{
|
||||
@@ -15940,7 +16437,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (npc.type == NPCID.WalkingAntlion)
|
||||
else if (npc.type == NPCID.WalkingAntlion || npc.type == ModContent.NPCType<StormlionCharger>())
|
||||
{
|
||||
float num71 = 2.5f;
|
||||
float num72 = 60f;
|
||||
@@ -17615,7 +18112,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
int num170 = (int)((npc.position.X + (float)(npc.width / 2) + (float)(15 * npc.direction)) / 16f);
|
||||
int num171 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f);
|
||||
if (npc.type == 109 || npc.type == 163 || npc.type == 164 || npc.type == 199 || npc.type == 236 || npc.type == 239 || npc.type == 257 || npc.type == 258 || npc.type == 290 || npc.type == 391 || npc.type == 425 || npc.type == 427 || npc.type == 426 || npc.type == 508 || npc.type == 415 || npc.type == 530 || npc.type == 532)
|
||||
if (npc.type == 109 || npc.type == 163 || npc.type == 164 || npc.type == 199 || npc.type == 236 || npc.type == 239 || npc.type == 257 || npc.type == 258 || npc.type == 290 || npc.type == 391 || npc.type == 425 || npc.type == 427 || npc.type == 426 || npc.type == 508 || npc.type == ModContent.NPCType<StormlionCharger>() || npc.type == 415 || npc.type == 530 || npc.type == 532)
|
||||
{
|
||||
num170 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 16) * npc.direction)) / 16f);
|
||||
}
|
||||
@@ -17860,6 +18357,8 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1554,6 +1554,40 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
switch (npc.aiStyle)
|
||||
{
|
||||
case 1:
|
||||
switch (npc.type)
|
||||
{
|
||||
case NPCID.BlueSlime:
|
||||
case NPCID.MotherSlime:
|
||||
case NPCID.LavaSlime:
|
||||
case NPCID.DungeonSlime:
|
||||
case NPCID.CorruptSlime:
|
||||
case NPCID.IlluminantSlime:
|
||||
case NPCID.ToxicSludge:
|
||||
case NPCID.IceSlime:
|
||||
case NPCID.Crimslime:
|
||||
case NPCID.SpikedIceSlime:
|
||||
case NPCID.SpikedJungleSlime:
|
||||
case NPCID.UmbrellaSlime:
|
||||
case NPCID.RainbowSlime:
|
||||
case NPCID.SlimeMasked:
|
||||
case NPCID.HoppinJack:
|
||||
case NPCID.SlimeRibbonWhite:
|
||||
case NPCID.SlimeRibbonYellow:
|
||||
case NPCID.SlimeRibbonGreen:
|
||||
case NPCID.SlimeRibbonRed:
|
||||
case NPCID.SlimeSpiked:
|
||||
case NPCID.SandSlime:
|
||||
case ModContent.NPCType<BloomSlime>():
|
||||
case ModContent.NPCType<CharredSlime>():
|
||||
case ModContent.NPCType<CrimulanBlightSlime>():
|
||||
case ModContent.NPCType<CryoSlime>():
|
||||
case ModContent.NPCType<EbonianBlightSlime>():
|
||||
case ModContent.NPCType<PerennialSlime>():
|
||||
case ModContent.NPCType<WulfrumSlime>():
|
||||
case ModContent.NPCType<IrradiatedSlime>():
|
||||
return CalamityGlobalAI.BuffedSlimeAI(npc, mod);
|
||||
}
|
||||
case 3:
|
||||
switch (npc.type)
|
||||
{
|
||||
@@ -1737,6 +1771,8 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.MartianWalker:
|
||||
case NPCID.DemonTaxCollector:
|
||||
case NPCID.TheBride:
|
||||
case ModContent.NPCType<StormlionCharger>():
|
||||
case ModContent.NPCType<WulfrumDrone>():
|
||||
return CalamityGlobalAI.BuffedFighterAI(npc, mod);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AngryDogGrowl"), (int)npc.position.X, (int)npc.position.Y);
|
||||
}
|
||||
bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.5;
|
||||
bool phase2 = (double)npc.life <= (double)npc.lifeMax * (CalamityWorld.death ? 0.9 : 0.5);
|
||||
if (phase2)
|
||||
{
|
||||
if (!reset)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
@@ -20,8 +21,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.height = 38;
|
||||
npc.defense = 30;
|
||||
npc.Calamity().RevPlusDR(0.35f);
|
||||
npc.lifeMax = 20000;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.lifeMax = CalamityWorld.death ? 30000 : 20000;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.behindTiles = true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.SummonItems;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
@@ -26,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.height = 54;
|
||||
npc.defense = 15;
|
||||
npc.Calamity().RevPlusDR(0.15f);
|
||||
npc.lifeMax = 20000;
|
||||
npc.lifeMax = CalamityWorld.death ? 30000 : 20000;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
@@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.ai[3] = (float)npc.whoAmI;
|
||||
npc.realLife = npc.whoAmI;
|
||||
int num2 = npc.whoAmI;
|
||||
int num3 = 40;
|
||||
int num3 = CalamityWorld.death ? 60 : 40;
|
||||
for (int j = 0; j <= num3; j++)
|
||||
{
|
||||
int num4 = ModContent.NPCType<ArmoredDiggerBody>();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
@@ -20,8 +21,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.height = 34;
|
||||
npc.defense = 45;
|
||||
npc.Calamity().RevPlusDR(0.45f);
|
||||
npc.lifeMax = 20000;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.lifeMax = CalamityWorld.death ? 30000 : 20000;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.behindTiles = true;
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
npc.damage = 80;
|
||||
aiType = 141;
|
||||
npc.damage = 80;
|
||||
npc.width = 40;
|
||||
npc.height = 30;
|
||||
npc.defense = 25;
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
aiType = 59;
|
||||
npc.damage = 40;
|
||||
npc.width = 40;
|
||||
npc.height = 30;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
@@ -65,29 +66,29 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.TargetClosest(true);
|
||||
bool flag51 = false;
|
||||
int offsetX = 80;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.33)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.33 || CalamityWorld.death)
|
||||
{
|
||||
num823 = 2f;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.death)
|
||||
{
|
||||
num823 = 4f;
|
||||
}
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
npc.ai[1] += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.33)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.33 || CalamityWorld.death)
|
||||
{
|
||||
npc.ai[1] += 1f;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.death)
|
||||
{
|
||||
npc.ai[1] += 1f;
|
||||
}
|
||||
if (npc.ai[1] >= 300f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.ai[1] = 0f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.25)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.death)
|
||||
{
|
||||
npc.ai[0] = (float)Main.rand.Next(3, 5);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
npc.damage = 30;
|
||||
aiType = 71;
|
||||
npc.damage = 30;
|
||||
npc.width = 60;
|
||||
npc.height = 42;
|
||||
npc.defense = 8;
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
npc.damage = 30;
|
||||
aiType = 71;
|
||||
npc.damage = 30;
|
||||
npc.width = 40;
|
||||
npc.height = 30;
|
||||
npc.defense = 8;
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
npc.damage = 30;
|
||||
aiType = 71;
|
||||
npc.damage = 30;
|
||||
npc.width = 60;
|
||||
npc.height = 42;
|
||||
npc.defense = 8;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
@@ -107,10 +108,13 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.velocity.X = 0f;
|
||||
return;
|
||||
}
|
||||
float num65 = 1f;
|
||||
float num66 = 0.08f;
|
||||
num65 += (1f - (float)npc.life / (float)npc.lifeMax) * 2f;
|
||||
num66 += (1f - (float)npc.life / (float)npc.lifeMax) * 0.2f;
|
||||
float num65 = CalamityWorld.death ? 3f : 1f;
|
||||
float num66 = CalamityWorld.death ? 0.28f : 0.08f;
|
||||
if (!CalamityWorld.death)
|
||||
{
|
||||
num65 += (1f - (float)npc.life / (float)npc.lifeMax) * 2f;
|
||||
num66 += (1f - (float)npc.life / (float)npc.lifeMax) * 0.2f;
|
||||
}
|
||||
if (npc.velocity.X < -num65 || npc.velocity.X > num65)
|
||||
{
|
||||
if (npc.velocity.Y == 0f)
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Items.Tools.ClimateChange;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -218,9 +219,9 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
Vector2 direction = Main.player[npc.target].Center - npc.Center;
|
||||
direction.Normalize();
|
||||
chargetimer += expertMode ? 2 : 1;
|
||||
if (chargetimer >= Math.Sqrt(npc.life) * 14.0)
|
||||
if (chargetimer >= (CalamityWorld.death ? 14D : Math.Sqrt(npc.life) * 14D))
|
||||
{
|
||||
if (Main.rand.Next(25) == 1)
|
||||
if (Main.rand.NextBool(25))
|
||||
{
|
||||
direction.X *= 6f;
|
||||
direction.Y *= 6f;
|
||||
|
||||
@@ -50,6 +50,11 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
float num = revenge ? 7f : 6f;
|
||||
float num2 = revenge ? 0.07f : 0.06f;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num *= 1.5f;
|
||||
num2 *= 1.5f;
|
||||
}
|
||||
Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num4 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
|
||||
float num5 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -108,24 +109,25 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.TargetClosest(true);
|
||||
npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.2f;
|
||||
npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.2f;
|
||||
if (npc.velocity.X > 12f)
|
||||
float velocityMax = CalamityWorld.death ? 16f : 12f;
|
||||
if (npc.velocity.X > velocityMax)
|
||||
{
|
||||
npc.velocity.X = 12f;
|
||||
npc.velocity.X = velocityMax;
|
||||
}
|
||||
if (npc.velocity.X < -12f)
|
||||
if (npc.velocity.X < -velocityMax)
|
||||
{
|
||||
npc.velocity.X = -12f;
|
||||
npc.velocity.X = -velocityMax;
|
||||
}
|
||||
if (npc.velocity.Y > 12f)
|
||||
if (npc.velocity.Y > velocityMax)
|
||||
{
|
||||
npc.velocity.Y = 12f;
|
||||
npc.velocity.Y = velocityMax;
|
||||
}
|
||||
if (npc.velocity.Y < -12f)
|
||||
if (npc.velocity.Y < -velocityMax)
|
||||
{
|
||||
npc.velocity.Y = -12f;
|
||||
npc.velocity.Y = -velocityMax;
|
||||
}
|
||||
npc.localAI[0] += 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 90f)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= (CalamityWorld.death ? 60f : 90f))
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
@@ -227,7 +229,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if ((double)npc.rotation > 0.1)
|
||||
{
|
||||
npc.rotation = 0.1f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,9 +140,14 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
float num65 = 1.5f;
|
||||
float num66 = 0.1f;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num65 *= 1.5f;
|
||||
num66 *= 1.5f;
|
||||
}
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 400f)
|
||||
{
|
||||
num65 += 4f - ((Main.player[npc.target].Center - npc.Center).Length() * 0.01f);
|
||||
num65 += (CalamityWorld.death ? 6f : 4f) - ((Main.player[npc.target].Center - npc.Center).Length() * 0.01f);
|
||||
}
|
||||
if (npc.velocity.X < -num65 || npc.velocity.X > num65)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.aiStyle = 1;
|
||||
npc.damage = 35;
|
||||
aiType = 141;
|
||||
npc.damage = 35;
|
||||
npc.width = 40;
|
||||
npc.height = 30;
|
||||
npc.defense = 12;
|
||||
|
||||
@@ -138,6 +138,11 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
float num65 = 1.2f + ((Main.player[npc.target].Center - npc.Center).Length() * 0.005f);
|
||||
float num66 = 0.12f + ((Main.player[npc.target].Center - npc.Center).Length() * 0.0005f);
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num65 *= 1.5f;
|
||||
num66 *= 1.5f;
|
||||
}
|
||||
if (npc.velocity.X < -num65 || npc.velocity.X > num65)
|
||||
{
|
||||
if (npc.velocity.Y == 0f)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
float num818 = Main.player[npc.target].Center.X - vector102.X;
|
||||
float num819 = Main.player[npc.target].Center.Y - vector102.Y;
|
||||
float num820 = (float)Math.Sqrt((double)(num818 * num818 + num819 * num819));
|
||||
float num821 = 17f;
|
||||
float num821 = CalamityWorld.death ? 22f : 17f;
|
||||
num820 = num821 / num820;
|
||||
num818 *= num820;
|
||||
num819 *= num820;
|
||||
@@ -56,7 +56,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
dust.velocity *= 0.1f;
|
||||
Main.dust[num822].scale = 1.3f;
|
||||
Main.dust[num822].noGravity = true;
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
float num818 = Main.player[npc.target].Center.X - vector102.X;
|
||||
float num819 = Main.player[npc.target].Center.Y - vector102.Y;
|
||||
float num820 = (float)Math.Sqrt((double)(num818 * num818 + num819 * num819));
|
||||
float num821 = 12f;
|
||||
float num821 = CalamityWorld.death ? 16f : 12f;
|
||||
num820 = num821 / num820;
|
||||
num818 *= num820;
|
||||
num819 *= num820;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
float num818 = Main.player[npc.target].Center.X - vector102.X;
|
||||
float num819 = Main.player[npc.target].Center.Y - vector102.Y;
|
||||
float num820 = (float)Math.Sqrt((double)(num818 * num818 + num819 * num819));
|
||||
float num821 = 13.5f;
|
||||
float num821 = CalamityWorld.death ? 18f : 13.5f;
|
||||
num820 = num821 / num820;
|
||||
num818 *= num820;
|
||||
num819 *= num820;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
float num818 = Main.player[npc.target].Center.X - vector102.X;
|
||||
float num819 = Main.player[npc.target].Center.Y - vector102.Y;
|
||||
float num820 = (float)Math.Sqrt((double)(num818 * num818 + num819 * num819));
|
||||
float num821 = 15f;
|
||||
float num821 = CalamityWorld.death ? 20f : 15f;
|
||||
num820 = num821 / num820;
|
||||
num818 *= num820;
|
||||
num819 *= num820;
|
||||
@@ -63,7 +63,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
dust.velocity *= 0.1f;
|
||||
Main.dust[num822].scale = 1.3f;
|
||||
Main.dust[num822].noGravity = true;
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
@@ -60,6 +61,11 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
float num = 6f; //2
|
||||
float num2 = 0.05f;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num *= 1.5f;
|
||||
num2 *= 1.5f;
|
||||
}
|
||||
Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num4 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
|
||||
float num5 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -55,6 +56,10 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
num321 = 12;
|
||||
}
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num321 /= 4;
|
||||
}
|
||||
if (npc.ai[2] < (float)num321)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X * 0.9f;
|
||||
|
||||
@@ -535,7 +535,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
npc.velocity.X = 8f * npc.ai[2];
|
||||
}
|
||||
npc.rotation = 0f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,13 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
float num1465 = (float)npc.life / (float)npc.lifeMax;
|
||||
num1461 += (1f - num1465) * 6f;
|
||||
num1462 += (1f - num1465) * 0.02f;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num1461 = 10f;
|
||||
num1462 = 0.15f;
|
||||
}
|
||||
|
||||
if (num1465 < 0.5f)
|
||||
if (num1465 < 0.5f || CalamityWorld.death)
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
npc.localAI[2] = 0f;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Projectile.Boss;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using CalamityMod.Tiles.Astral;
|
||||
using CalamityMod.Tiles.AstralDesert;
|
||||
using CalamityMod.Tiles.Crags;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.Tiles.SunkenSea;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -511,21 +514,23 @@ namespace CalamityMod.Tiles
|
||||
}
|
||||
if (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
if ((type == TileID.Ash || type == TileID.Hellstone) && closer)
|
||||
bool underworldTile = type == TileID.Ash || type == TileID.Hellstone;
|
||||
bool cragTile = type == ModContent.TileType<BrimstoneSlag>() || type == ModContent.TileType<CharredOre>();
|
||||
if ((underworldTile || cragTile) && closer)
|
||||
{
|
||||
if (j > Main.maxTilesY - 180 && j < Main.maxTilesY - 50)
|
||||
{
|
||||
if (Main.tile[i, j - 1] == null)
|
||||
Main.tile[i, j - 1] = new Tile();
|
||||
|
||||
Tile tileAboveAsh = Main.tile[i, j - 1];
|
||||
if (tileAboveAsh.liquidType() == 1 && !tileAboveAsh.active())
|
||||
Tile tileAbove = Main.tile[i, j - 1];
|
||||
if (tileAbove.liquidType() == 1 && !tileAbove.active())
|
||||
{
|
||||
// Only shoot flames if tiles underneath are lava and if tiles above and below aren't active
|
||||
bool shootFlames = Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(300);
|
||||
if (shootFlames)
|
||||
{
|
||||
int lavaTilesAboveAsh = 0;
|
||||
int lavaTilesAbove = 0;
|
||||
int lavaTopY = 0;
|
||||
Tile lavaTop = new Tile();
|
||||
for (int k = j - 1; k > Main.maxTilesY - 180; k--)
|
||||
@@ -535,12 +540,12 @@ namespace CalamityMod.Tiles
|
||||
|
||||
if (!Main.tile[i, k].active() && Main.tile[i, k].liquidType() == 1)
|
||||
{
|
||||
if (lavaTilesAboveAsh < 5)
|
||||
lavaTilesAboveAsh++;
|
||||
if (lavaTilesAbove < 5)
|
||||
lavaTilesAbove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lavaTilesAboveAsh == 5)
|
||||
if (lavaTilesAbove == 5)
|
||||
{
|
||||
lavaTopY = k;
|
||||
lavaTop = Main.tile[i, k];
|
||||
@@ -565,8 +570,9 @@ namespace CalamityMod.Tiles
|
||||
}
|
||||
if (shootFlames)
|
||||
{
|
||||
int projectileType = underworldTile ? ProjectileID.GeyserTrap : ModContent.ProjectileType<BrimstoneFire>();
|
||||
float randomVelocity = Main.rand.NextFloat() + 0.5f;
|
||||
Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, -8f * randomVelocity, ProjectileID.GeyserTrap, 20, 2f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, -8f * randomVelocity, projectileType, 20, 2f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user