1 - Yharon phases are now all one health bar, he no longer heals but still has the rainbow invulnerability phase.
2 - Yharon HP reduced by 70% and combined into one HP amount.
This commit is contained in:
1 parent
f14149e744
commit
2a362ec5ae
1 file changed
+15
-37
+15
-37
@@ -38,7 +38,6 @@ namespace CalamityMod.NPCs.Yharon
|
||||
private bool protectionBoost = false;
|
||||
private bool moveCloser = false;
|
||||
private bool useTornado = true;
|
||||
private int healCounter = 0;
|
||||
private int secondPhasePhase = 1;
|
||||
private int teleportLocation = 0;
|
||||
private bool startSecondAI = false;
|
||||
@@ -46,6 +45,8 @@ namespace CalamityMod.NPCs.Yharon
|
||||
private int invincibilityCounter = 0;
|
||||
private int fastChargeTelegraphTime = 120;
|
||||
|
||||
private const float ai2GateValue = 0.55f;
|
||||
|
||||
public static float normalDR = 0.22f;
|
||||
public static float ChargeTelegraph_DR = 0.4f;
|
||||
public static float EnragedDR = 0.9f;
|
||||
@@ -65,7 +66,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
npc.width = 200;
|
||||
npc.height = 200;
|
||||
npc.defense = 90;
|
||||
npc.LifeMaxNERB(2275000, 2525000, 3700000);
|
||||
npc.LifeMaxNERB(1296750, 1556100, 3700000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.knockBackResist = 0f;
|
||||
@@ -117,7 +118,6 @@ namespace CalamityMod.NPCs.Yharon
|
||||
bb[4] = startSecondAI;
|
||||
bb[5] = npc.dontTakeDamage;
|
||||
writer.Write(bb);
|
||||
writer.Write(healCounter);
|
||||
writer.Write(secondPhasePhase);
|
||||
writer.Write(teleportLocation);
|
||||
writer.Write(invincibilityCounter);
|
||||
@@ -141,7 +141,6 @@ namespace CalamityMod.NPCs.Yharon
|
||||
useTornado = bb[3];
|
||||
startSecondAI = bb[4];
|
||||
npc.dontTakeDamage = bb[5];
|
||||
healCounter = reader.ReadInt32();
|
||||
secondPhasePhase = reader.ReadInt32();
|
||||
teleportLocation = reader.ReadInt32();
|
||||
invincibilityCounter = reader.ReadInt32();
|
||||
@@ -186,10 +185,10 @@ namespace CalamityMod.NPCs.Yharon
|
||||
}
|
||||
|
||||
// Phase booleans
|
||||
float phase2GateValue = revenge ? 0.8f : expertMode ? 0.7f : 0.5f;
|
||||
float phase2GateValue = revenge ? 0.9f : expertMode ? 0.85f : 0.75f;
|
||||
bool phase2Check = death || lifeRatio <= phase2GateValue;
|
||||
bool phase3Check = lifeRatio <= (death ? 0.6f : revenge ? 0.5f : expertMode ? 0.4f : 0.25f);
|
||||
bool phase4Check = lifeRatio <= 0.1f;
|
||||
bool phase3Check = lifeRatio <= (death ? 0.8f : revenge ? 0.75f : expertMode ? 0.7f : 0.625f);
|
||||
bool phase4Check = lifeRatio <= ai2GateValue;
|
||||
bool phase1Change = npc.ai[0] > -1f;
|
||||
bool phase2Change = npc.ai[0] > 5f;
|
||||
bool phase3Change = npc.ai[0] > 12f;
|
||||
@@ -282,7 +281,8 @@ namespace CalamityMod.NPCs.Yharon
|
||||
int newPhaseTimer = 180;
|
||||
|
||||
float flareDustPhaseScalar = death ? 80f : 100f;
|
||||
int flareDustPhaseTimerReduction = revenge ? (int)(flareDustPhaseScalar * ((phase2GateValue - lifeRatio) / phase2GateValue)) : 0;
|
||||
phase2GateValue -= ai2GateValue; // 0.35, 70% HP = 0.7 - 0.55 = 0.15, 0.35 - 0.15 = 0.2 / 0.35 = 0.57, 60% HP = 0.6 - 0.55 = 0.05, 0.35 - 0.05 = 0.3 / 0.35 = 0.85, 80% HP = 0.8 - 0.55 = 0.25, 0.35 - 0.25 = 0.1 / 0.35 = 0.28
|
||||
int flareDustPhaseTimerReduction = revenge ? (int)(flareDustPhaseScalar * ((phase2GateValue - (lifeRatio - ai2GateValue)) / phase2GateValue)) : 0;
|
||||
int flareDustPhaseTimer = (death ? 240 : 300) - flareDustPhaseTimerReduction;
|
||||
int flareDustPhaseTimer2 = (death ? 120 : 150) - (flareDustPhaseTimerReduction / 2);
|
||||
|
||||
@@ -965,7 +965,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
SpawnDetonatingFlares(flareDustBulletHellSpawn, player, maxFlareCount, new int[] { ModContent.NPCType<DetonatingFlare2>() });
|
||||
float maxRingReduction = 20f - (int)(10f * (1f - lifeRatio));
|
||||
float maxRingReduction = 20f - (int)(10f * (phase2GateValue - lifeRatio));
|
||||
int ringReduction = (int)MathHelper.Lerp(0f, maxRingReduction, npc.ai[2] / flareDustPhaseTimer);
|
||||
int totalProjectiles = 38 - ringReduction; // 36 for first ring, 18 for last ring
|
||||
DoFlareDustBulletHell(0, flareDustSpawnDivisor, npc.GetProjectileDamage(ModContent.ProjectileType<FlareDust>()), totalProjectiles, 0f, 0f, false);
|
||||
@@ -1517,10 +1517,10 @@ namespace CalamityMod.NPCs.Yharon
|
||||
#region AI2
|
||||
public void Yharon_AI2(bool expertMode, bool revenge, bool death, float pie, float lifeRatio, Vector2 vectorCenter, CalamityGlobalNPC calamityGlobalNPC)
|
||||
{
|
||||
float phase2GateValue = revenge ? 0.8f : expertMode ? 0.7f : 0.5f;
|
||||
float phase2GateValue = revenge ? 0.44f : expertMode ? 0.385f : 0.275f;
|
||||
bool phase2 = death || lifeRatio <= phase2GateValue;
|
||||
bool phase3 = lifeRatio <= (death ? 0.65f : revenge ? 0.5f : expertMode ? 0.4f : 0.25f);
|
||||
float phase4GateValue = death ? 0.3f : 0.2f;
|
||||
bool phase3 = lifeRatio <= (death ? 0.358f : revenge ? 0.275f : expertMode ? 0.22f : 0.138f);
|
||||
float phase4GateValue = death ? 0.165f : 0.11f;
|
||||
bool phase4 = lifeRatio <= phase4GateValue && revenge;
|
||||
|
||||
if (npc.ai[0] != 8f)
|
||||
@@ -1551,29 +1551,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
if (invincibilityCounter < 900)
|
||||
{
|
||||
phase2 = phase3 = phase4 = false;
|
||||
|
||||
invincibilityCounter += 1;
|
||||
|
||||
int heal = 5; //900 / 5 = 180
|
||||
healCounter += 1;
|
||||
if (healCounter >= heal)
|
||||
{
|
||||
healCounter = 0;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int healAmt = npc.lifeMax / 200;
|
||||
if (healAmt > npc.lifeMax - npc.life)
|
||||
healAmt = npc.lifeMax - npc.life;
|
||||
|
||||
if (healAmt > 0)
|
||||
{
|
||||
npc.life += healAmt;
|
||||
npc.HealEffect(healAmt, true);
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1674,7 +1652,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
float splittingFireballBreathPhaseTimer = splittingFireballBreathTimer + splittingFireballBreathTimer2 + splittingFireballBreathYVelocityTimer;
|
||||
|
||||
float flareDustPhaseScalar = secondPhasePhase == 4 ? (death ? 54f : 60f) : (death ? 67f : 80f);
|
||||
int spinPhaseTimerReduction = revenge ? (secondPhasePhase == 4 ? (int)(flareDustPhaseScalar * ((phase4GateValue - lifeRatio) / phase4GateValue)) : (int)(flareDustPhaseScalar * (1f - lifeRatio))) : 0;
|
||||
int spinPhaseTimerReduction = revenge ? (secondPhasePhase == 4 ? (int)(flareDustPhaseScalar * ((phase4GateValue - lifeRatio) / phase4GateValue)) : (int)(flareDustPhaseScalar * (ai2GateValue - lifeRatio))) : 0;
|
||||
int spinPhaseTimer = (secondPhasePhase == 4 ? (death ? 160 : 180) : (death ? 200 : 240)) - spinPhaseTimerReduction;
|
||||
float spinTime = spinPhaseTimer / 2;
|
||||
float spinRotation = MathHelper.TwoPi * 3 / spinTime;
|
||||
@@ -1684,7 +1662,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
float increasedIdleTimeAfterBulletHell = -120f;
|
||||
|
||||
float flareSpawnDecelerationTimer = death ? 75f : 90f;
|
||||
int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (1f - lifeRatio)) : 0;
|
||||
int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (ai2GateValue - lifeRatio)) : 0;
|
||||
float flareSpawnPhaseTimer = (death ? 150f : 180f) - flareSpawnPhaseTimerReduction;
|
||||
|
||||
float teleportPhaseTimer = 45f;
|
||||
@@ -2222,7 +2200,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
{
|
||||
if (npc.ai[1] % flareDustSpawnDivisor == 0f)
|
||||
{
|
||||
float maxRingReduction = 18f - (int)(9f * (1f - lifeRatio));
|
||||
float maxRingReduction = 18f - (int)(9f * (ai2GateValue - lifeRatio));
|
||||
int ringReduction = (int)MathHelper.Lerp(0f, maxRingReduction, npc.ai[1] / spinPhaseTimer);
|
||||
int totalProjectiles = (secondPhasePhase == 2 ? 42 : 38) - ringReduction; // 36 for first ring, 18 for last ring
|
||||
DoFlareDustBulletHell(0, spinPhaseTimer, npc.GetProjectileDamage(ModContent.ProjectileType<FlareDust>()), totalProjectiles, 0f, 0f, true);
|
||||
|
||||
Reference in new issue
Block a user