1 - Rev+ vanilla bosses support For The Worthy.
This commit is contained in:
1 parent
4c567b5cab
commit
af3db27b0f
12 files changed
+253
-31
No files matched your search
@@ -135,6 +135,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
float velocityScale = death ? 4f : 2f;
|
||||
float velocityBoost = velocityScale * (1f - lifeRatio);
|
||||
float num798 = 8f + velocityBoost + 3f * enrageScale;
|
||||
if (Main.getGoodWorld)
|
||||
num798 *= 1.15f;
|
||||
|
||||
num797 = num798 / num797;
|
||||
num795 *= num797;
|
||||
num796 *= num797;
|
||||
@@ -168,6 +171,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
// Velocity
|
||||
npc.velocity = Vector2.Normalize(Main.player[npc.target].Center + (malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * ((death ? 20f : 16f) + 4f * enrageScale);
|
||||
if (Main.getGoodWorld)
|
||||
npc.velocity *= 1.15f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +231,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
npc.ai[2] -= 1f;
|
||||
npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * ((death ? -10f : -8f) - 2f * enrageScale);
|
||||
if (Main.getGoodWorld)
|
||||
npc.velocity *= 1.15f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,6 +443,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
float num804 = Main.player[npc.target].Center.Y - vector99.Y;
|
||||
float num805 = (float)Math.Sqrt(num803 * num803 + num804 * num804);
|
||||
float num806 = (death ? 2f : 1f) + (creeperScale * 0.1f);
|
||||
if (Main.getGoodWorld)
|
||||
num806 *= 3f;
|
||||
|
||||
if (num805 < num806)
|
||||
{
|
||||
@@ -637,8 +646,16 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
chargeVelocity += 4f * enrageScale;
|
||||
Vector2 value2 = Main.player[npc.target].Center - npc.Center;
|
||||
value2.Normalize();
|
||||
value2 *= chargeVelocity;
|
||||
npc.velocity = (npc.velocity * 99f + value2) / 100f;
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
value2 *= 12f;
|
||||
npc.velocity = (npc.velocity * 49f + value2) / 50f;
|
||||
}
|
||||
else
|
||||
{
|
||||
value2 *= chargeVelocity;
|
||||
npc.velocity = (npc.velocity * 99f + value2) / 100f;
|
||||
}
|
||||
|
||||
Vector2 vector101 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num815 = Main.npc[NPC.crimsonBoss].Center.X - vector101.X;
|
||||
@@ -682,7 +699,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
public static int GetBrainOfCthuluCreepersCountRevDeath()
|
||||
{
|
||||
return (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 25;
|
||||
return Main.getGoodWorld ? 40 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 25;
|
||||
}
|
||||
|
||||
private static float GetCrimsonBossKnockBack(NPC npc, int numPlayers, float lifeScale, float baseKnockBackResist)
|
||||
|
||||
@@ -75,6 +75,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
idleTime = 30;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
iceMistFireRate = 30;
|
||||
iceMistSpeed = 15f;
|
||||
fireballFireRate = 6;
|
||||
fireballSpeed *= 1.25f;
|
||||
lightningOrbPhaseTime = 60;
|
||||
ancientLightSpawnRate = 10;
|
||||
ancientLightAmt = 5;
|
||||
idleTime = 20;
|
||||
}
|
||||
|
||||
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice;
|
||||
|
||||
// Get a target
|
||||
|
||||
@@ -145,6 +145,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
int index = npc.whoAmI;
|
||||
|
||||
int totalSegments = death ? 60 : 80;
|
||||
if (Main.getGoodWorld)
|
||||
totalSegments *= 2;
|
||||
|
||||
for (int j = 0; j <= totalSegments; j++)
|
||||
{
|
||||
int type = NPCID.TheDestroyerBody;
|
||||
@@ -387,6 +390,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
speed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f;
|
||||
turnSpeed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
speed *= 1.2f;
|
||||
turnSpeed *= 1.2f;
|
||||
}
|
||||
|
||||
Vector2 vector3 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num20 = player.position.X + (player.width / 2);
|
||||
float num21 = player.position.Y + (player.height / 2);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Vile spit
|
||||
if (npc.type == NPCID.EaterofWorldsBody)
|
||||
{
|
||||
if (Main.rand.NextBool(900) && phase2)
|
||||
if (Main.rand.NextBool(Main.getGoodWorld ? 600 : 900) && phase2)
|
||||
{
|
||||
npc.TargetClosest();
|
||||
if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1))
|
||||
@@ -310,6 +310,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num38 += 0.015f * enrageScale;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num37 += 4f;
|
||||
num38 += 0.05f;
|
||||
}
|
||||
|
||||
Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num39 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2);
|
||||
float num40 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2);
|
||||
@@ -339,6 +345,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num52 = (float)Math.Sqrt(num39 * num39 + num40 * num40);
|
||||
int num53 = npc.width;
|
||||
num53 = (int)(num53 * npc.scale);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
num53 = 62;
|
||||
|
||||
num52 = (num52 - num53) / num52;
|
||||
num39 *= num52;
|
||||
num40 *= num52;
|
||||
|
||||
@@ -121,6 +121,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
hoverAcceleration += 0.17f * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
hoverSpeed += 1f;
|
||||
hoverAcceleration += 0.05f;
|
||||
}
|
||||
|
||||
Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 200f;
|
||||
Vector2 idealVelocity = npc.SafeDirectionTo(hoverDestination) * hoverSpeed;
|
||||
npc.SimpleFlyMovement(idealVelocity, hoverAcceleration);
|
||||
@@ -140,7 +146,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (!Main.player[npc.target].dead)
|
||||
npc.ai[3] += 1f;
|
||||
|
||||
if (npc.ai[3] >= 40f)
|
||||
float servantSpawnGateValue = 40f;
|
||||
if (Main.getGoodWorld)
|
||||
servantSpawnGateValue *= 0.8f;
|
||||
|
||||
if (npc.ai[3] >= servantSpawnGateValue)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.rotation = num8;
|
||||
@@ -174,6 +184,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
chargeSpeed += 5f * enrageScale;
|
||||
if (death)
|
||||
chargeSpeed += 8.5f * (1f - lifeRatio);
|
||||
if (Main.getGoodWorld)
|
||||
chargeSpeed += 1f;
|
||||
|
||||
npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed;
|
||||
|
||||
npc.ai[1] = 2f;
|
||||
@@ -188,6 +201,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (npc.ai[2] >= 40f)
|
||||
{
|
||||
npc.velocity *= 0.975f;
|
||||
if (Main.getGoodWorld)
|
||||
npc.velocity *= 0.99f;
|
||||
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
npc.velocity.X = 0f;
|
||||
if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1)
|
||||
@@ -199,6 +215,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
int num28 = 90;
|
||||
if (death)
|
||||
num28 -= (int)Math.Round(120f * (1f - lifeRatio));
|
||||
if (Main.getGoodWorld)
|
||||
num28 -= 15;
|
||||
|
||||
if (npc.ai[2] >= num28)
|
||||
{
|
||||
@@ -349,6 +367,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
hoverSpeed += 1f;
|
||||
hoverAcceleration += 0.1f;
|
||||
}
|
||||
|
||||
Vector2 idealHoverVelocity = npc.SafeDirectionTo(hoverDestination) * hoverSpeed;
|
||||
npc.SimpleFlyMovement(idealHoverVelocity, hoverAcceleration);
|
||||
|
||||
@@ -381,6 +405,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
chargeSpeed *= 1.15f;
|
||||
if (npc.ai[3] == 2f)
|
||||
chargeSpeed *= 1.3f;
|
||||
if (Main.getGoodWorld)
|
||||
chargeSpeed *= 1.2f;
|
||||
|
||||
npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed;
|
||||
npc.ai[1] = 2f;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
}
|
||||
|
||||
// Enrage if the target isn't inside the temple
|
||||
// Turbo enrage if target isn't inside the temple and it's malice mode
|
||||
// Turbo enrage if target isn't inside the temple and it's malice mode or for the worthy
|
||||
bool enrage = true;
|
||||
bool turboEnrage = false;
|
||||
if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0)
|
||||
@@ -66,12 +66,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
enrage = false;
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
}
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
|
||||
if (malice)
|
||||
if (malice || Main.getGoodWorld)
|
||||
enrage = true;
|
||||
|
||||
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && (enrage || turboEnrage);
|
||||
@@ -202,6 +202,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (npc.ai[1] > 0f)
|
||||
{
|
||||
npc.ai[1] += 1f;
|
||||
if (Main.getGoodWorld)
|
||||
npc.ai[1] += 100f;
|
||||
if (enrage || death)
|
||||
npc.ai[1] += 18f;
|
||||
else
|
||||
@@ -409,7 +411,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
// Enrage if the target isn't inside the temple
|
||||
// Turbo enrage if target isn't inside the temple and it's malice mode
|
||||
// Turbo enrage if target isn't inside the temple and it's malice mode or for the worthy
|
||||
bool enrage = true;
|
||||
bool turboEnrage = false;
|
||||
if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0)
|
||||
@@ -421,12 +423,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
enrage = false;
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
}
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
|
||||
if (malice)
|
||||
if (malice || Main.getGoodWorld)
|
||||
enrage = true;
|
||||
|
||||
float aggression = turboEnrage ? 3f : enrage ? 2f : death ? 1.5f : 1f;
|
||||
@@ -458,6 +460,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
float num725 = Main.npc[NPC.golemBoss].Center.Y - vector80.Y;
|
||||
num725 -= 9f;
|
||||
num724 = (npc.type != NPCID.GolemFistLeft) ? (num724 + 78f) : (num724 - 84f);
|
||||
if (Main.getGoodWorld)
|
||||
num724 = (npc.type != NPCID.GolemFistLeft) ? (num724 - 40f) : (num724 + 40f);
|
||||
|
||||
float num726 = (float)Math.Sqrt(num724 * num724 + num725 * num725);
|
||||
if (num726 < 12f + num723)
|
||||
{
|
||||
@@ -662,7 +667,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.dontTakeDamage = flag41 || flag42;
|
||||
|
||||
// Stay in position on top of body
|
||||
npc.Center = Main.npc[NPC.golemBoss].Center - new Vector2(3f, 57f);
|
||||
npc.Center = Main.npc[NPC.golemBoss].Center - new Vector2(Main.getGoodWorld ? 2f : 3f, Main.getGoodWorld ? 37f : 57f);
|
||||
|
||||
// Enrage if the target isn't inside the temple
|
||||
bool enrage = true;
|
||||
@@ -676,12 +681,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
enrage = false;
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
}
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
|
||||
if (malice)
|
||||
if (malice || Main.getGoodWorld)
|
||||
enrage = true;
|
||||
|
||||
// Alpha
|
||||
@@ -912,12 +917,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
enrage = false;
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
}
|
||||
else
|
||||
turboEnrage = malice;
|
||||
turboEnrage = malice || Main.getGoodWorld;
|
||||
|
||||
if (malice)
|
||||
if (malice || Main.getGoodWorld)
|
||||
enrage = true;
|
||||
|
||||
if (turboEnrage && NPC.golemBoss >= 0)
|
||||
@@ -1108,6 +1113,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
for (int num713 = 0; num713 < 2; num713++)
|
||||
{
|
||||
Vector2 vector89 = new Vector2(npc.Center.X, npc.Center.Y - 50f);
|
||||
if (Main.getGoodWorld)
|
||||
vector89.Y += 30f;
|
||||
if (num713 == 0)
|
||||
vector89.X -= 14f;
|
||||
else if (num713 == 1)
|
||||
|
||||
@@ -14,11 +14,20 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
public static bool BuffedKingSlimeAI(NPC npc, Mod mod)
|
||||
{
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Variables
|
||||
float num234 = 1f;
|
||||
bool teleporting = false;
|
||||
bool flag9 = false;
|
||||
npc.aiAction = 0;
|
||||
float num237 = 2f;
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num237 -= 1f - lifeRatio;
|
||||
num234 *= num237;
|
||||
}
|
||||
|
||||
// Reset damage
|
||||
npc.damage = npc.defDamage;
|
||||
@@ -35,9 +44,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
|
||||
npc.TargetClosest();
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Phases based on life percentage
|
||||
bool phase2 = lifeRatio < 0.75f;
|
||||
bool phase3 = lifeRatio < 0.5f;
|
||||
@@ -155,6 +161,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.ai[0] += 1f;
|
||||
num234 = MathHelper.Clamp((60f - npc.ai[0]) / 60f, 0f, 1f);
|
||||
num234 = 0.5f + num234 * 0.5f;
|
||||
if (Main.getGoodWorld)
|
||||
num234 *= num237;
|
||||
|
||||
if (npc.ai[0] >= 60f)
|
||||
flag9 = true;
|
||||
@@ -199,6 +207,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.ai[0] += 1f;
|
||||
num234 = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f);
|
||||
num234 = 0.5f + num234 * 0.5f;
|
||||
if (Main.getGoodWorld)
|
||||
num234 *= num237;
|
||||
|
||||
if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -307,12 +317,19 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
}
|
||||
|
||||
// Change jump velocity
|
||||
else if (npc.target < Main.maxPlayers && ((npc.direction == 1 && npc.velocity.X < 3f) || (npc.direction == -1 && npc.velocity.X > -3f)))
|
||||
else if (npc.target < Main.maxPlayers)
|
||||
{
|
||||
if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1))
|
||||
npc.velocity.X += (malice ? 0.4f : death ? 0.25f : 0.2f) * npc.direction;
|
||||
else
|
||||
npc.velocity.X *= malice ? 0.9f : death ? 0.92f : 0.93f;
|
||||
float num252 = 3f;
|
||||
if (Main.getGoodWorld)
|
||||
num252 = 6f;
|
||||
|
||||
if ((npc.direction == 1 && npc.velocity.X < num252) || (npc.direction == -1 && npc.velocity.X > 0f - num252))
|
||||
{
|
||||
if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1))
|
||||
npc.velocity.X += (malice ? 0.4f : death ? 0.25f : 0.2f) * npc.direction;
|
||||
else
|
||||
npc.velocity.X *= malice ? 0.9f : death ? 0.92f : 0.93f;
|
||||
}
|
||||
}
|
||||
|
||||
// Spawn dust
|
||||
|
||||
@@ -181,6 +181,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
velocity *= tileEnrageMult;
|
||||
acceleration *= tileEnrageMult;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
velocity *= 1.15f;
|
||||
acceleration *= 1.15f;
|
||||
}
|
||||
|
||||
// Velocity ranges from 4 to 7.2, Acceleration ranges from 0.04 to 0.072, non-enraged phase 1
|
||||
// Velocity ranges from 7 to 12.6, Acceleration ranges from 0.07 to 0.126, non-enraged phase 2
|
||||
// Velocity ranges from 9 to 16.2, Acceleration ranges from 0.07 to 0.126, non-enraged phase 3
|
||||
@@ -288,6 +294,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (enrage)
|
||||
npc.localAI[1] += 2f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
npc.localAI[1] += 1f;
|
||||
|
||||
// If hit, fire projectiles even if target is behind tiles
|
||||
if (npc.justHit)
|
||||
npc.localAI[3] = 1f;
|
||||
@@ -370,9 +379,25 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.localAI[0] = 3f;
|
||||
int baseTentacles = death ? 10 : 8;
|
||||
int totalTentacles = (int)(baseTentacles * tileEnrageMult);
|
||||
if (Main.getGoodWorld)
|
||||
totalTentacles += 6;
|
||||
|
||||
for (int i = 0; i < totalTentacles; i++)
|
||||
{
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (Main.npc[i].active && Main.npc[i].aiStyle == 52)
|
||||
{
|
||||
for (int j = 0; j < totalTentacles / 2 - 1; j++)
|
||||
{
|
||||
int num800 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
Main.npc[num800].ai[3] = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -812,6 +837,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
float num780 = 100f + (num781 * 150f);
|
||||
float deceleration = (death ? 0.5f : 0.8f) / (1f + num781);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
num779 += 4f;
|
||||
|
||||
// Despawn if Plantera is gone
|
||||
if (!Main.npc[num778].active || num778 < 0)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (enrageScale > 1f)
|
||||
enrageScale = 1f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
enrageScale += 0.5f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 2f;
|
||||
|
||||
|
||||
@@ -279,6 +279,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (handsDead && npc.ai[1] == 0f)
|
||||
{
|
||||
float num158 = BossRushEvent.BossRushActive ? 10f : malice ? 15f : phase2 ? (60f - (death ? 30f * (1f - lifeRatio) : 0f)) : 75f;
|
||||
if (Main.getGoodWorld)
|
||||
num158 *= 0.8f;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] >= num158)
|
||||
{
|
||||
calamityGlobalNPC.newAI[1] = 0f;
|
||||
@@ -338,6 +341,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
float num170 = 3.5f - (death ? 1f - lifeRatio : 0f);
|
||||
float num171 = 0.08f + (death ? 0.04f * (1f - lifeRatio) : 0f);
|
||||
float num172 = 8.5f - (death ? 2f * (1f - lifeRatio) : 0f);
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num169 += 0.01f;
|
||||
num170 += 1f;
|
||||
num171 += 0.05f;
|
||||
num172 += 2f;
|
||||
}
|
||||
if (malice)
|
||||
{
|
||||
num169 *= 1.25f;
|
||||
@@ -424,6 +434,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num176 *= baseDistanceVelocityMult;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
num176 *= 1.3f;
|
||||
|
||||
num175 = num176 / num175;
|
||||
npc.velocity.X = num173 * num175;
|
||||
npc.velocity.Y = num174 * num175;
|
||||
|
||||
@@ -107,6 +107,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num421 = 9.5f;
|
||||
num422 = 0.175f;
|
||||
}
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num421 *= 1.15f;
|
||||
num422 *= 1.15f;
|
||||
}
|
||||
// Reduce acceleration if target is holding a true melee weapon
|
||||
if (Main.player[npc.target].HoldingTrueMeleeWeapon())
|
||||
{
|
||||
@@ -218,6 +223,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num430 = 9.5f;
|
||||
num431 = 0.25f;
|
||||
}
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num430 *= 1.15f;
|
||||
num431 *= 1.15f;
|
||||
}
|
||||
// Reduce acceleration if target is holding a true melee weapon
|
||||
if (Main.player[npc.target].HoldingTrueMeleeWeapon())
|
||||
{
|
||||
@@ -438,6 +448,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num383 += 0.1f * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num382 *= 1.15f;
|
||||
num383 *= 1.15f;
|
||||
}
|
||||
|
||||
int num384 = 1;
|
||||
if (npc.position.X + (npc.width / 2) < Main.player[npc.target].position.X + Main.player[npc.target].width)
|
||||
num384 = -1;
|
||||
@@ -490,7 +506,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
else if (npc.position.Y + npc.height < Main.player[npc.target].position.Y && num388 < 400f)
|
||||
{
|
||||
if (!Main.player[npc.target].dead)
|
||||
{
|
||||
npc.ai[3] += 1f;
|
||||
if (Main.getGoodWorld)
|
||||
npc.ai[3] += 0.5f;
|
||||
}
|
||||
|
||||
if (npc.ai[3] >= 30f)
|
||||
{
|
||||
@@ -526,6 +546,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num393 += 10f * enrageScale;
|
||||
if (death)
|
||||
num393 += 12f * (1f - lifeRatio);
|
||||
if (Main.getGoodWorld)
|
||||
num393 += 2f;
|
||||
|
||||
Vector2 vector41 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num394 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector41.X;
|
||||
@@ -664,6 +686,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num399 += 4.5f * enrageScale;
|
||||
num400 += 0.075f * enrageScale;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num399 *= 1.15f;
|
||||
num400 *= 1.15f;
|
||||
}
|
||||
|
||||
// Reduce acceleration if target is holding a true melee weapon
|
||||
if (Main.player[npc.target].HoldingTrueMeleeWeapon())
|
||||
{
|
||||
@@ -765,6 +793,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num409 += 4.5f * enrageScale;
|
||||
num410 += 0.15f * enrageScale;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num409 *= 1.15f;
|
||||
num410 *= 1.15f;
|
||||
}
|
||||
|
||||
// Reduce acceleration if target is holding a true melee weapon
|
||||
if (Main.player[npc.target].HoldingTrueMeleeWeapon())
|
||||
{
|
||||
@@ -864,6 +898,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (!spazAlive)
|
||||
num450 += 2f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
num450 += 2f;
|
||||
|
||||
Vector2 vector47 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num451 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector47.X;
|
||||
float num452 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector47.Y;
|
||||
@@ -936,7 +973,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Charge four times
|
||||
float chargeGateValue = 30f;
|
||||
chargeGateValue -= chargeGateValue / 4 * enrageScale;
|
||||
if (npc.ai[2] >= chargeTime + 30f)
|
||||
if (npc.ai[2] >= chargeTime + chargeGateValue)
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] += 1f;
|
||||
@@ -966,6 +1003,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num64 *= 0.75f;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num63 *= 1.15f;
|
||||
num64 *= 1.15f;
|
||||
}
|
||||
|
||||
int num408 = 1;
|
||||
if (npc.position.X + (npc.width / 2) < Main.player[npc.target].position.X + Main.player[npc.target].width)
|
||||
num408 = -1;
|
||||
@@ -1066,6 +1109,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Velocity
|
||||
float chargeVelocity = 20f + (death ? 6f * (0.7f - lifeRatio) : 0f);
|
||||
chargeVelocity += 10f * enrageScale;
|
||||
if (Main.getGoodWorld)
|
||||
chargeVelocity += 2f;
|
||||
if (npc.ai[2] == -1f || (!retAlive && npc.ai[3] == 4f))
|
||||
chargeVelocity *= 1.3f;
|
||||
|
||||
@@ -1155,6 +1200,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num425 += 0.3f * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num424 *= 1.15f;
|
||||
num425 *= 1.15f;
|
||||
}
|
||||
|
||||
int num426 = 1;
|
||||
if (npc.position.X + (npc.width / 2) < Main.player[npc.target].position.X + Main.player[npc.target].width)
|
||||
num426 = -1;
|
||||
@@ -1208,7 +1259,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
// Fire cursed flame every half second
|
||||
if (!Main.player[npc.target].dead)
|
||||
{
|
||||
npc.ai[3] += 1f;
|
||||
if (Main.getGoodWorld)
|
||||
npc.ai[3] += 0.4f;
|
||||
}
|
||||
|
||||
if (npc.ai[3] >= 30f)
|
||||
{
|
||||
@@ -1247,6 +1302,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num434 += 8f * enrageScale;
|
||||
if (death)
|
||||
num434 += 12f * (1f - lifeRatio);
|
||||
if (Main.getGoodWorld)
|
||||
num434 *= 1.2f;
|
||||
|
||||
Vector2 vector45 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num435 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector45.X;
|
||||
@@ -1417,6 +1474,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (num445 > 400f)
|
||||
num440 += 0.5f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num440 *= 1.15f;
|
||||
num441 *= 1.15f;
|
||||
}
|
||||
|
||||
num445 = num440 / num445;
|
||||
num443 *= num445;
|
||||
num444 *= num445;
|
||||
@@ -1520,6 +1583,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.rotation = num420;
|
||||
float num450 = 16.75f + (death ? 5f * (0.7f - lifeRatio) : 0f);
|
||||
num450 += 8f * enrageScale;
|
||||
if (Main.getGoodWorld)
|
||||
num450 *= 1.2f;
|
||||
|
||||
Vector2 distanceVector = Main.player[npc.target].Center - npc.Center;
|
||||
npc.velocity = Vector2.Normalize(distanceVector) * num450;
|
||||
@@ -1591,6 +1656,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num48 += 10f * enrageScale;
|
||||
if (npc.ai[2] == -1f || (!retAlive && npc.ai[3] == secondFastCharge))
|
||||
num48 *= 1.3f;
|
||||
if (Main.getGoodWorld)
|
||||
num48 *= 1.2f;
|
||||
|
||||
Vector2 distanceVector = Main.player[npc.target].Center + (!retAlive && malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center;
|
||||
npc.velocity = Vector2.Normalize(distanceVector) * num48;
|
||||
@@ -1682,6 +1749,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num64 *= 0.75f;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
num63 *= 1.15f;
|
||||
num64 *= 1.15f;
|
||||
}
|
||||
|
||||
Vector2 vector11 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num65 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector11.X;
|
||||
float num66 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) + num62 - vector11.Y;
|
||||
|
||||
@@ -254,12 +254,19 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (malice)
|
||||
speedMult += 0.2f;
|
||||
|
||||
// NOTE: Max velocity is 8 in expert mode
|
||||
// NOTE: Max velocity is 8 in Expert Mode
|
||||
// NOTE: Max velocity is 9 in For The Worthy
|
||||
|
||||
float velocityBoost = 4f * (1f - lifeRatio);
|
||||
float velocityX = (BossRushEvent.BossRushActive ? 7f : death ? 3.5f : 2f) + velocityBoost;
|
||||
velocityX *= speedMult;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
velocityX *= 1.1f;
|
||||
velocityX += 0.2f;
|
||||
}
|
||||
|
||||
// NOTE: Values below are based on Rev Mode only!
|
||||
// Max velocity without enrage is 12
|
||||
// Min velocity is 1.5
|
||||
|
||||
Reference in new issue
Block a user