1 - Master Mode Duke Fishron and contact damage fairness.

2 - Enrage and Defense/DR Boss HP Bar color support for vanilla non-rev/death bosses.
3 - Destroyer and Astrum Deus spawn DR now scale down smoothly from 99% to their base values.
4 - Destroyer spawn DR now applies to non-rev/death Destroyer.
5 - Non-rev/death Empress of Light rotation and DR in certain phases.
This commit is contained in:
mountaindrew10 committed 2024-02-26 00:37:54 -06:00
1 parent 0b13b2915c
commit 5379e4792d
12 files changed
+1123 -24

No files matched your search

+8 -9
View File
@@ -2630,14 +2630,13 @@ namespace CalamityMod.NPCs
ApplyDR(npc, ref modifiers);
// Damage reduction on spawn for certain worm bosses.
bool destroyerResist = CalamityLists.DestroyerIDs.Contains(npc.type) && (CalamityWorld.revenge || BossRushEvent.BossRushActive);
bool eaterofWorldsResist = CalamityLists.EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive;
if (destroyerResist || eaterofWorldsResist || CalamityLists.AstrumDeusIDs.Contains(npc.type))
{
float resistanceGateValue = (CalamityLists.AstrumDeusIDs.Contains(npc.type) && newAI[0] != 0f) ? 300f : 600f;
if (newAI[1] < resistanceGateValue || (newAI[2] > 0f && CalamityLists.DestroyerIDs.Contains(npc.type)))
modifiers.FinalDamage *= 0.01f;
}
if (CalamityLists.DestroyerIDs.Contains(npc.type))
modifiers.FinalDamage *= 1f - MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / DestroyerAI.DRIncraeseTime, 0f, 1f));
if (CalamityLists.AstrumDeusIDs.Contains(npc.type))
modifiers.FinalDamage *= 1f - MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / (newAI[0] != 0f ? 300f : 600f), 0f, 1f));
if (eaterofWorldsResist)
modifiers.FinalDamage *= 0.01f;
// Large Deus worm takes reduced damage in order to last a long enough time.
// TODO -- WHY DOES DEUS HAVE THIS UNDOCUMENTED MULTIPLIER HERE??
@@ -3138,10 +3137,10 @@ namespace CalamityMod.NPCs
case NPCID.GolemHeadFree:
return GolemAI.VanillaGolemHeadFreeAI(npc, Mod);
/*case NPCID.DukeFishron:
case NPCID.DukeFishron:
return DukeFishronAI.VanillaDukeFishronAI(npc, Mod);
case NPCID.CultistBoss:
/*case NPCID.CultistBoss:
case NPCID.CultistBossClone:
return CultistAI.VanillaCultistAI(npc, Mod);
case NPCID.AncientLight:
+5
View File
@@ -352,6 +352,8 @@ namespace CalamityMod.NPCs.NormalNPCs
NPC.defense *= 2;
NPC.damage = NPC.defDamage * 2;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true;
if (phase2 && Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.localAI[0] += 1f;
@@ -455,6 +457,9 @@ namespace CalamityMod.NPCs.NormalNPCs
calamityGlobalNPC.DR = 0.9999f;
calamityGlobalNPC.unbreakableDR = true;
calamityGlobalNPC.CurrentlyEnraged = true;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true;
if (NPC.IsMechQueenUp)
NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f);
else
+11 -3
View File
@@ -14,6 +14,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
public static class DestroyerAI
{
public const float DRIncraeseTime = 600f;
public static bool BuffedDestroyerAI(NPC npc, Mod mod)
{
int mechdusaCurvedSpineSegmentIndex = 0;
@@ -51,10 +53,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
bool death = CalamityWorld.death || bossRush;
// 10 seconds of resistance to prevent spawn killing
if (calamityGlobalNPC.newAI[1] < 600f)
if (calamityGlobalNPC.newAI[1] < DRIncraeseTime)
calamityGlobalNPC.newAI[1] += 1f;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < 600f;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < DRIncraeseTime;
// Percent life remaining
float lifeRatio = npc.life / (float)npc.lifeMax;
@@ -129,7 +131,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
// Phase for flying at the player
bool flyAtTarget = (calamityGlobalNPC.newAI[3] >= 900f && startFlightPhase) || (calamityGlobalNPC.newAI[1] < 600f && calamityGlobalNPC.newAI[1] > 60f);
bool flyAtTarget = (calamityGlobalNPC.newAI[3] >= 900f && startFlightPhase) || (calamityGlobalNPC.newAI[1] < DRIncraeseTime && calamityGlobalNPC.newAI[1] > 60f);
// Dust on spawn and alpha effects
if (npc.type == NPCID.TheDestroyer || (npc.type != NPCID.TheDestroyer && Main.npc[(int)npc.ai[1]].alpha < 128))
@@ -775,6 +777,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
}
// 10 seconds of resistance to prevent spawn killing
if (npc.Calamity().newAI[1] < DRIncraeseTime)
npc.Calamity().newAI[1] += 1f;
npc.Calamity().CurrentlyIncreasingDefenseOrDR = npc.Calamity().newAI[1] < DRIncraeseTime;
if (npc.ai[3] > 0f)
npc.realLife = (int)npc.ai[3];
File diff suppressed because it is too large. Load diff
@@ -81,12 +81,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float enrageScale = bossRush ? 1.5f : 0f;
if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush)
{
npc.Calamity().CurrentlyEnraged = !bossRush;
calamityGlobalNPC.CurrentlyEnraged = !bossRush;
enrageScale += 0.5f;
}
if (!Main.player[npc.target].ZoneCorrupt || bossRush)
{
npc.Calamity().CurrentlyEnraged = !bossRush;
calamityGlobalNPC.CurrentlyEnraged = !bossRush;
enrageScale += 2f;
}
@@ -1287,7 +1287,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
int rainbowStreakDamage = 45;
int lastingRainbowDamage = 45;
int sunDanceDamage = 50;
// Rotation
npc.rotation = npc.velocity.X * 0.005f;
// Reset DR every frame
calamityGlobalNPC.DR = 0.15f;
bool phase2 = npc.AI_120_HallowBoss_IsInPhase2();
bool expertMode = Main.expertMode;
bool masterMode = Main.masterMode;
@@ -1298,10 +1304,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
bool genuinePhase2 = npc.life / (float)npc.lifeMax <= phase2LifeRatio;
bool phase3 = npc.life / (float)npc.lifeMax <= phase3LifeRatio && expertMode;
bool shouldBeInPhase2ButIsStillInPhase1 = npc.life / (float)npc.lifeMax <= phase2LifeRatio && !phase2;
if (shouldBeInPhase2ButIsStillInPhase1)
calamityGlobalNPC.DR = 0.99f;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = shouldBeInPhase2ButIsStillInPhase1 || npc.ai[0] == 6f;
bool enraged = NPC.ShouldEmpressBeEnraged();
if (npc.life == npc.lifeMax && enraged && !npc.AI_120_HallowBoss_IsGenuinelyEnraged())
npc.ai[3] += 2f;
calamityGlobalNPC.CurrentlyEnraged = !BossRushEvent.BossRushActive && enraged;
int projectileDamageMultiplier = enraged ? 2 : 1;
bool becomeVisible = true;
@@ -1845,6 +1859,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Avoid cheap bullshit.
npc.damage = 0;
// Increase durability.
calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : (BossRushEvent.BossRushActive ? 0.99f : 0.575f);
float extraPhaseTime = (masterMode ? 30 : expertMode ? 75 : 120) - reducedAttackCooldown;
Vector2 offset = new Vector2(0f, -100f);
Vector2 sunDanceSpawnLocation = npc.Center + offset;
@@ -1311,6 +1311,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if ((!Main.player[npc.target].ZoneLihzhardTemple && !Main.player[npc.target].ZoneJungle) || (double)Main.player[npc.target].Center.Y < Main.worldSurface * 16.0)
enrageScale *= 2f;
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && enrageScale > 1f;
if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[0] = 1f;
@@ -1231,6 +1231,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
num780 = 0.15f;
}
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && flag39;
if (Main.expertMode)
{
num779 += (Main.masterMode ? 2f : 1f);
@@ -43,12 +43,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float enrageScale = death ? 0.5f : 0f;
if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush)
{
npc.Calamity().CurrentlyEnraged = !bossRush;
calamityGlobalNPC.CurrentlyEnraged = !bossRush;
enrageScale += 0.5f;
}
if (!Main.player[npc.target].ZoneJungle || bossRush)
{
npc.Calamity().CurrentlyEnraged = !bossRush;
calamityGlobalNPC.CurrentlyEnraged = !bossRush;
enrageScale += 0.5f;
}
@@ -843,6 +843,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (!Main.player[npc.target].ZoneJungle)
num644 += 1f;
npc.Calamity().CurrentlyEnraged = num644 > 0f;
if (Main.getGoodWorld)
num644 += 0.5f;
@@ -756,6 +756,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.damage = 1000;
calamityGlobalNPC.DR = 0.9999f;
calamityGlobalNPC.unbreakableDR = true;
calamityGlobalNPC.CurrentlyEnraged = true;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true;
npc.rotation += npc.direction * 0.3f;
Vector2 enrageSpinPos = npc.Center;
float enrageSpinTargetX = Main.player[npc.target].Center.X - enrageSpinPos.X;
@@ -1236,6 +1240,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
npc.defense += numHands * (Main.masterMode ? 50 : 25);
npc.Calamity().CurrentlyIncreasingDefenseOrDR = numHands > 0;
npc.chaseable = numHands == 0;
if ((numHands < maxHands || (double)npc.life < (double)npc.lifeMax * 0.75 || Main.masterMode) && npc.ai[1] == 0f)
{
float num151 = 80f;
@@ -1449,6 +1455,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
npc.damage = 1000;
npc.defense = 9999;
npc.Calamity().CurrentlyEnraged = true;
npc.Calamity().CurrentlyIncreasingDefenseOrDR = true;
npc.rotation += (float)npc.direction * 0.3f;
Vector2 vector21 = npc.Center;
float num176 = Main.player[npc.target].Center.X - vector21.X;
@@ -324,6 +324,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.defense *= 2;
npc.damage = npc.defDamage * 2;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true;
if (phase2 && Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[0] += 1f;
@@ -427,6 +429,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
calamityGlobalNPC.DR = 0.9999f;
calamityGlobalNPC.unbreakableDR = true;
calamityGlobalNPC.CurrentlyEnraged = true;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true;
if (NPC.IsMechQueenUp)
npc.rotation = npc.rotation.AngleLerp(npc.velocity.X / 15f * 0.5f, 0.75f);
else
@@ -2079,6 +2084,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
npc.defense *= 2;
npc.damage = npc.defDamage * 2;
npc.Calamity().CurrentlyIncreasingDefenseOrDR = true;
npc.ai[2] += 1f;
if (npc.ai[2] == 2f)
SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center);
@@ -2157,6 +2165,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
npc.damage = 1000;
npc.defense = 9999;
npc.Calamity().CurrentlyEnraged = true;
npc.Calamity().CurrentlyIncreasingDefenseOrDR = true;
if (NPC.IsMechQueenUp)
npc.rotation = npc.rotation.AngleLerp(npc.velocity.X / 15f * 0.5f, 0.75f);
else
@@ -274,6 +274,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
}
calamityGlobalNPC.CurrentlyEnraged = distanceFromTarget > halfAverageScreenWidth || npc.ai[3] == 1f;
if (bossRush)
speedMult += 0.2f;