Edited Death Mode Adrenaline and Rage to reflect the changelog posts on main.

Edited many Death Mode AIs to reflect the changelog post on main.
This commit is contained in:
Andrew Marheine committed 2020-01-13 00:13:34 -06:00
1 parent 52ef20fc6f
commit c26d44db2d
6 files changed
+411 -417

No files matched your search

+26 -26
View File
@@ -118,8 +118,6 @@ namespace CalamityMod.CalPlayer
public bool playRogueStealthSound = false;
public bool playFullRageSound = true;
public bool playFullAdrenalineSound = true;
public bool playAdrenalineBurnoutSound = true;
public bool playFullAdrenalineBurnoutSound = true;
// Proficiency
public int meleeLevel = 0;
@@ -193,9 +191,6 @@ namespace CalamityMod.CalPlayer
// Adrenaline
public int adrenalineMax = 10000;
public int adrenalineMaxTimer = 300;
public int adrenalineDmgDown = 600;
public float adrenalineDmgMult = 1f;
public int adrenaline;
public int adrenalineCD;
public bool adrenalineMode = false;
@@ -1441,9 +1436,6 @@ namespace CalamityMod.CalPlayer
galileoCooldown = 0;
stress = 0;
adrenaline = 0;
adrenalineMaxTimer = 300;
adrenalineDmgDown = 600;
adrenalineDmgMult = 1f;
raiderStack = 0;
raiderCooldown = 0;
gSabatonFall = 0;
@@ -2304,7 +2296,7 @@ namespace CalamityMod.CalPlayer
player.AddBuff(ModContent.BuffType<RageMode>(), 300);
}
}
if (CalamityMod.AdrenalineHotKey.JustPressed)
if (CalamityMod.AdrenalineHotKey.JustPressed && Config.AdrenalineAndRage && CalamityWorld.revenge)
{
if (adrenaline == adrenalineMax && !adrenalineMode)
{
@@ -4277,8 +4269,7 @@ namespace CalamityMod.CalPlayer
{
if (item.melee)
{
double damageMultAdr = 1.5 * (double)adrenalineDmgMult;
damageMult += damageMultAdr;
damageMult += 1.5;
}
}
}
@@ -4541,7 +4532,7 @@ namespace CalamityMod.CalPlayer
{
damageMult += 0.33;
}
if (CalamityWorld.revenge)
if (CalamityWorld.revenge && Config.AdrenalineAndRage)
{
bool DHorHoD = draedonsHeart || heartOfDarkness;
if (rageMode && adrenalineMode)
@@ -4567,8 +4558,7 @@ namespace CalamityMod.CalPlayer
{
if (hasClassType)
{
double damageMultAdr = 1.5 * (double)adrenalineDmgMult;
damageMult += damageMultAdr;
damageMult += 1.5;
}
}
}
@@ -5524,7 +5514,7 @@ namespace CalamityMod.CalPlayer
}
// Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons.
// To prevent abuse, this effect does not work if there are any bosses alive.
if(fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon))
if (fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon))
{
damage = (int)(damage * 0.85f);
}
@@ -5540,8 +5530,15 @@ namespace CalamityMod.CalPlayer
{
if (!CalamityWorld.downedBossAny)
damage = (int)((double)damage * 0.8);
if (Config.AdrenalineAndRage)
{
if (adrenaline == adrenalineMax && !adrenalineMode)
damage = (int)((double)damage * 0.5);
}
}
if (player.mount.Active && (player.mount.Type == ModContent.MountType<AngryDogMount>() || player.mount.Type == ModContent.MountType<OnyxExcavator>()) && Math.Abs(player.velocity.X) > player.mount.RunSpeed / 2f)
if (player.mount.Active && (player.mount.Type == ModContent.MountType<AngryDogMount>() || player.mount.Type == ModContent.MountType<OnyxExcavator>())
&& Math.Abs(player.velocity.X) > player.mount.RunSpeed / 2f)
{
damage = (int)((double)damage * 0.9);
}
@@ -5583,21 +5580,24 @@ namespace CalamityMod.CalPlayer
modStealth = 1f;
if (player.whoAmI == Main.myPlayer)
{
if (rageMode)
{
stress = 0;
if (player.FindBuffIndex(ModContent.BuffType<RageMode>()) > -1)
player.ClearBuff(ModContent.BuffType<RageMode>());
}
if (Config.AdrenalineAndRage && CalamityWorld.revenge)
{
if (rageMode)
{
stress = 0;
if (player.FindBuffIndex(ModContent.BuffType<RageMode>()) > -1)
player.ClearBuff(ModContent.BuffType<RageMode>());
}
if (!adrenalineMode)
{
adrenaline = 0;
}
}
if (amidiasBlessing)
{
player.ClearBuff(ModContent.BuffType<AmidiasBlessing>());
Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 96);
}
if (!adrenalineMode && adrenaline != adrenalineMax)
{
adrenaline = 0;
}
if ((gShell || fabledTortoise) && !player.panic)
{
player.AddBuff(ModContent.BuffType<ShellBoost>(), 300);
-41
View File
@@ -168,47 +168,6 @@ namespace CalamityMod.CalPlayer
player.AddBuff(ModContent.BuffType<HeartAttack>(), 18000);
}
// Play Adrenaline burnout sounds that happen the more time you wait while having max Adrenaline
if (modPlayer.adrenaline >= modPlayer.adrenalineMax)
{
modPlayer.adrenalineMaxTimer--;
if (modPlayer.adrenalineMaxTimer <= 0)
{
if (modPlayer.playAdrenalineBurnoutSound)
{
modPlayer.playAdrenalineBurnoutSound = false;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineBurnout1"), (int)player.position.X, (int)player.position.Y);
}
modPlayer.adrenalineDmgDown--;
if (modPlayer.adrenalineDmgDown < 0)
{
if (modPlayer.playFullAdrenalineBurnoutSound)
{
modPlayer.playFullAdrenalineBurnoutSound = false;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineBurnout2"), (int)player.position.X, (int)player.position.Y);
}
modPlayer.adrenalineDmgDown = 0;
}
modPlayer.adrenalineMaxTimer = 0;
}
}
// Reset Adrenaline burnout variables
else if (!modPlayer.adrenalineMode && modPlayer.adrenaline <= 0)
{
modPlayer.playAdrenalineBurnoutSound = true;
modPlayer.playFullAdrenalineBurnoutSound = true;
modPlayer.adrenalineDmgDown = 600;
modPlayer.adrenalineMaxTimer = 300;
modPlayer.adrenalineDmgMult = 1f;
}
// Reduce Adrenaline Mode damage based on burnout
modPlayer.adrenalineDmgMult = 0.1f * (float)(modPlayer.adrenalineDmgDown / 60);
if (modPlayer.adrenalineDmgMult < 0.33f)
modPlayer.adrenalineDmgMult = 0.33f;
// Amount of Adrenaline gained per 'tick'
int adrenalineGain = 0;
bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>());
+59 -57
View File
@@ -24,6 +24,8 @@ namespace CalamityMod.NPCs
public static void AquaticScourgeAI(NPC npc, Mod mod, bool head)
{
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
// Adjust hostility and stats
if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.99 || CalamityWorld.bossRushActive ||
@@ -52,7 +54,7 @@ namespace CalamityMod.NPCs
// Circular movement
bool doSpiral = false;
if (head && calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && (CalamityWorld.revenge || CalamityWorld.bossRushActive))
if (head && calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && revenge)
{
float ai3 = 600f;
calamityGlobalNPC.newAI[3] += 1f;
@@ -151,7 +153,7 @@ namespace CalamityMod.NPCs
if (Main.player[npc.target].gravDir == -1f)
npc.localAI[0] += 2f;
if (npc.localAI[0] >= (CalamityWorld.bossRushActive ? 300f : (CalamityWorld.revenge ? 360f : 420f)))
if (npc.localAI[0] >= (CalamityWorld.bossRushActive ? 300f : (revenge ? 360f : 420f)))
{
int npcPosX = (int)(npc.position.X + (float)(npc.width / 2)) / 16;
int npcPosY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16;
@@ -181,7 +183,7 @@ namespace CalamityMod.NPCs
double offsetAngleBoom;
int iBoom;
int damageBoom = Main.expertMode ? 23 : 28;
float velocity = CalamityWorld.revenge ? 7.5f : 6.5f;
float velocity = revenge ? 7.5f : 6.5f;
if (CalamityWorld.bossRushActive)
velocity = 11f;
@@ -382,7 +384,7 @@ namespace CalamityMod.NPCs
if (calamityGlobalNPC.newAI[0] == 1f)
{
num188 = CalamityWorld.revenge ? 15f : 13f;
num188 = revenge ? 15f : 13f;
num189 = 0.16f;
if (notOcean)
{
@@ -597,6 +599,7 @@ namespace CalamityMod.NPCs
bool provy = CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool calamity = modPlayer.ZoneCalamity;
// Reset defense
@@ -640,11 +643,12 @@ namespace CalamityMod.NPCs
speed = 12f;
else if (!calamity)
speed = 7f;
else if (CalamityWorld.death)
else if (death)
speed = 6f;
else if (revenge)
speed = 5.5f;
speed += 2f * (1f - lifeRatio);
float speedBoost = death ? 2f : 2f * (1f - lifeRatio);
speed += speedBoost;
// Variables for target location relative to npc location
float xDistance = player.Center.X - vectorCenter.X;
@@ -779,7 +783,7 @@ namespace CalamityMod.NPCs
if (npc.ai[1] % 30f == 29f)
shootProjectile = true;
}
else if (lifeRatio < 0.5f || CalamityWorld.death)
else if (lifeRatio < 0.5f || death)
{
if (npc.ai[1] % 35f == 34f)
shootProjectile = true;
@@ -798,7 +802,8 @@ namespace CalamityMod.NPCs
projectileSpeed += 1f;
if (!calamity)
projectileSpeed += 2f;
projectileSpeed += 3f * (1f - lifeRatio);
float projectileSpeedBoost = death ? 3f : 3f * (1f - lifeRatio);
projectileSpeed += projectileSpeedBoost;
float num742 = CalamityWorld.bossRushActive ? 6f : 4f;
float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vectorCenter.X;
@@ -900,10 +905,11 @@ namespace CalamityMod.NPCs
npc.chaseable = false;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[0] += 1f + 2f * (1f - lifeRatio);
float shootBoost = death ? 2f : 2f * (1f - lifeRatio);
npc.localAI[0] += 1f + shootBoost;
if (calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
npc.localAI[0] += 2f;
if (CalamityWorld.death || !calamity)
if (death || !calamity)
npc.localAI[0] += 1f;
if (npc.localAI[0] >= 120f)
@@ -1010,6 +1016,7 @@ namespace CalamityMod.NPCs
}
// Variables for increasing difficulty
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool dayTime = Main.dayTime && !CalamityWorld.bossRushActive;
@@ -1242,11 +1249,10 @@ namespace CalamityMod.NPCs
{
if (!brotherAlive)
{
npc.localAI[1] += 1f * (1f - lifeRatio);
float shootBoost = death ? 1f : 1f * (1f - lifeRatio);
npc.localAI[1] += shootBoost;
if (revenge)
npc.localAI[1] += 0.5f;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
npc.localAI[1] += 0.5f;
}
if (npc.localAI[1] > 180f)
@@ -1368,8 +1374,6 @@ namespace CalamityMod.NPCs
{
if (revenge)
npc.localAI[1] += 0.5f;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
npc.localAI[1] += 0.5f;
if (calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
npc.localAI[1] += 0.5f;
if (expertMode)
@@ -1948,21 +1952,22 @@ namespace CalamityMod.NPCs
// Percent life remaining
float lifeRatio = (float)npc.life / (float)npc.lifeMax;
// Phases
bool phase2 = lifeRatio < 0.75f || CalamityWorld.bossRushActive;
bool phase3 = lifeRatio < 0.5f || CalamityWorld.bossRushActive;
// Variables
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
int shootBuff = (int)(2f * (1f - lifeRatio));
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
int shootBuff = death ? 1 : (int)(2f * (1f - lifeRatio));
float shootTimer = 1f + ((float)shootBuff);
bool dayTime = Main.dayTime;
Player player = Main.player[npc.target];
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
// Despawn
if (!player.active || player.dead || dayTime)
// Phases
bool phase2 = lifeRatio < 0.75f || death;
bool phase3 = lifeRatio < 0.5f || death;
// Despawn
if (!player.active || player.dead || dayTime)
{
npc.TargetClosest(false);
player = Main.player[npc.target];
@@ -2102,8 +2107,9 @@ namespace CalamityMod.NPCs
// Walk
else if (npc.ai[0] == 2f)
{
// Set walking speed
float num823 = (CalamityWorld.bossRushActive ? 8f : 5f) + (3f * (1f - lifeRatio));
// Set walking speed
float speedBoost = death ? 3f : 3f * (1f - lifeRatio);
float num823 = (CalamityWorld.bossRushActive ? 8f : 5f) + speedBoost;
// Set walking direction
if (Math.Abs(npc.Center.X - player.Center.X) < 200f)
@@ -2195,7 +2201,8 @@ namespace CalamityMod.NPCs
// Set jump velocity, reset and set AI to next phase (Stomp)
npc.TargetClosest(true);
float velocityX = (CalamityWorld.bossRushActive ? 9f : 6f) + (6f * (1f - lifeRatio));
float velocityBoost = death ? 6f : 6f * (1f - lifeRatio);
float velocityX = (CalamityWorld.bossRushActive ? 9f : 6f) + velocityBoost;
npc.velocity.X = velocityX * (float)npc.direction;
if (revenge)
@@ -2261,7 +2268,8 @@ namespace CalamityMod.NPCs
if (player.position.Y > npc.position.Y + (float)npc.height)
{
float fallSpeed = 0.8f + (0.8f * (1f - lifeRatio));
float fallSpeedBoost = death ? 0.8f : 0.8f * (1f - lifeRatio);
float fallSpeed = 0.8f + fallSpeedBoost;
npc.velocity.Y += fallSpeed;
}
}
@@ -2272,7 +2280,8 @@ namespace CalamityMod.NPCs
else if (npc.direction > 0)
npc.velocity.X += 0.2f;
float num626 = (CalamityWorld.bossRushActive ? 12f : 9f) + (6f * (1f - lifeRatio));
float velocityBoost = death ? 6f : 6f * (1f - lifeRatio);
float num626 = (CalamityWorld.bossRushActive ? 12f : 9f) + velocityBoost;
if (npc.velocity.X < -num626)
npc.velocity.X = -num626;
if (npc.velocity.X > num626)
@@ -2429,6 +2438,7 @@ namespace CalamityMod.NPCs
// Difficulty variables
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
// Emit light
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);
@@ -2599,11 +2609,6 @@ namespace CalamityMod.NPCs
// Speed and turn speed
float speedLimit = revenge ? 7f : 6f;
float turnSpeedLimit = revenge ? 0.11f : 0.1f;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
speedLimit = 8f;
turnSpeedLimit = 0.12f;
}
if (CalamityWorld.bossRushActive)
{
speedLimit *= 1.5f;
@@ -2611,8 +2616,8 @@ namespace CalamityMod.NPCs
}
// Speed and turn speed boosts based on remaining HP
float speedBoost = speedLimit * (1f - (float)mainDeusHPRatio);
float turnSpeedBoost = turnSpeedLimit * (1f - (float)mainDeusHPRatio);
float speedBoost = death ? speedLimit : speedLimit * (1f - (float)mainDeusHPRatio);
float turnSpeedBoost = death ? turnSpeedLimit : turnSpeedLimit * (1f - (float)mainDeusHPRatio);
if (Main.player[npc.target].gravDir == -1f)
{
speedBoost = speedLimit;
@@ -2778,13 +2783,13 @@ namespace CalamityMod.NPCs
if (npc.type == ModContent.NPCType<AstrumDeusBodySpectral>() && Main.netMode != NetmodeID.MultiplayerClient)
{
int shootTime = 4;
if ((double)npc.life <= (double)npc.lifeMax * 0.65 || CalamityWorld.bossRushActive || Main.player[npc.target].gravDir == -1f)
if ((double)npc.life <= (double)npc.lifeMax * 0.65 || death || Main.player[npc.target].gravDir == -1f)
{
shootTime += CalamityWorld.death ? 4 : 2;
shootTime += death ? 4 : 2;
}
if ((double)npc.life <= (double)npc.lifeMax * 0.3 || CalamityWorld.bossRushActive || Main.player[npc.target].gravDir == -1f)
if ((double)npc.life <= (double)npc.lifeMax * 0.3 || death || Main.player[npc.target].gravDir == -1f)
{
shootTime += CalamityWorld.death ? 6 : 2;
shootTime += death ? 6 : 2;
}
npc.localAI[0] += (float)Main.rand.Next(shootTime);
if (npc.localAI[0] >= (float)Main.rand.Next(1400, 20000))
@@ -2794,14 +2799,14 @@ namespace CalamityMod.NPCs
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
{
float num941 = revenge ? 14f : 13f;
if (CalamityWorld.death)
{
num941 = 16f;
}
if (CalamityWorld.bossRushActive)
{
num941 = 24f;
}
else if (death)
{
num941 = 16f;
}
if (Main.player[npc.target].gravDir == -1f)
{
num941 *= 2f;
@@ -2885,8 +2890,8 @@ namespace CalamityMod.NPCs
if (head)
{
// Spawn mine probes
float firstProbeSpawnThreshold = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.9f : 0.66f);
float secondProbeSpawnThreshold = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.8f : 0.33f);
float firstProbeSpawnThreshold = death ? 0.9f : 0.66f;
float secondProbeSpawnThreshold = death ? 0.8f : 0.33f;
if (deusHPRatio <= firstProbeSpawnThreshold)
{
@@ -2922,13 +2927,10 @@ namespace CalamityMod.NPCs
// Velocity variables
float speedAdd = expertMode ? 0.06f : 0.045f;
float turnSpeedAdd = expertMode ? 0.04f : 0.03f;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
speedAdd *= 1.25f;
turnSpeedAdd *= 1.25f;
}
float newSpeed = 0.12f + speedAdd * (1f - deusHPRatio);
float newTurnSpeed = 0.08f + turnSpeedAdd * (1f - deusHPRatio);
float newSpeedBoost = death ? speedAdd : speedAdd * (1f - deusHPRatio);
float newTurnSpeedBoost = death ? turnSpeedAdd : turnSpeedAdd * (1f - deusHPRatio);
float newSpeed = 0.12f + newSpeedBoost;
float newTurnSpeed = 0.08f + newTurnSpeedBoost;
// Movement variables
int num180 = (int)(npc.position.X / 16f) - 1;
@@ -3186,6 +3188,7 @@ namespace CalamityMod.NPCs
int lifePercentage = (int)(100.0 * lifeRatio);
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
CalamityGlobalNPC.voidBoss = npc.whoAmI;
Vector2 vector = npc.Center;
@@ -3280,8 +3283,6 @@ namespace CalamityMod.NPCs
{
calamityGlobalNPC.newAI[1] += expertMode ? 2f : 1f;
calamityGlobalNPC.newAI[1] += calamityGlobalNPC.newAI[2];
if (CalamityWorld.death || CalamityWorld.bossRushActive)
calamityGlobalNPC.newAI[1] += 1f;
if (calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
calamityGlobalNPC.newAI[1] += 2f;
@@ -3312,7 +3313,7 @@ namespace CalamityMod.NPCs
if (revenge)
{
int damage = expertMode ? 50 : 60;
if (lifePercentage < 50 || CalamityWorld.death || CalamityWorld.bossRushActive || !player.ZoneDungeon)
if (lifePercentage < 50 || death || !player.ZoneDungeon)
{
for (int i = 0; i < 12; i++)
{
@@ -3413,6 +3414,7 @@ namespace CalamityMod.NPCs
// Variables
Player player = Main.player[npc.target];
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
Vector2 vector = npc.Center;
// Percent life remaining
@@ -3421,16 +3423,16 @@ namespace CalamityMod.NPCs
// Phases
float mult = 1f +
(revenge ? 0.25f : 0f) +
((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.25f : 0f);
(death ? 0.25f : 0f);
bool phase2 = lifeRatio < 0.5f * mult;
bool phase3 = lifeRatio < 0.1f * mult;
// Max spawn amount
int num1305 = revenge ? 4 : 3;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
if (death)
num1305 = 5;
if (phase2)
num1305 = 2;
num1305 = death ? 3 : 2;
// Don't collide with tiles, disable gravity
npc.noTileCollide = false;
+292 -255
View File
File diff suppressed because it is too large. Load diff
+12 -20
View File
@@ -73,7 +73,8 @@ namespace CalamityMod.NPCs.Crabulon
{
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 1f);
Player player = Main.player[npc.target];
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
if (!player.active || player.dead)
@@ -113,12 +114,12 @@ namespace CalamityMod.NPCs.Crabulon
npc.localAI[3] += 2f;
num352 += 3;
}
if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive)
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
{
npc.localAI[3] += 1f;
num352 += 2;
}
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive)
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
{
npc.localAI[3] += 2f;
num352 += 3;
@@ -148,21 +149,16 @@ namespace CalamityMod.NPCs.Crabulon
num354 += 3;
num353 += 3f;
}
if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive)
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
{
num354++;
num353 += 1f;
}
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive)
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
{
num354++;
num353 += 1f;
}
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
num354 += 3;
num353 += 1f;
}
vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
num349 = player.position.X + (float)player.width * 0.5f - vector34.X;
num350 = player.position.Y + (float)player.height * 0.5f - vector34.Y;
@@ -214,9 +210,9 @@ namespace CalamityMod.NPCs.Crabulon
{
float num823 = 1.25f;
bool flag51 = false;
if ((double)npc.life < (double)npc.lifeMax * 0.5)
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
num823 = 1.5f;
if ((double)npc.life < (double)npc.lifeMax * 0.1)
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
num823 = 2f;
if (CalamityWorld.bossRushActive)
num823 = 12f;
@@ -333,11 +329,11 @@ namespace CalamityMod.NPCs.Crabulon
break;
}
}
if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive)
if (npc.life < npc.lifeMax / 2 || death)
{
npc.ai[1] += (!revenge ? 4f : 1f);
}
if (npc.life < npc.lifeMax / 4 || CalamityWorld.bossRushActive)
if (npc.life < npc.lifeMax / 4 || death)
{
npc.ai[1] += (!revenge ? 4f : 1f);
}
@@ -467,15 +463,11 @@ namespace CalamityMod.NPCs.Crabulon
{
num626 += 3f;
}
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
num626 += 2f;
}
if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive)
if (npc.life < npc.lifeMax / 2 || death)
{
num626 += 1f;
}
if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive)
if (npc.life < npc.lifeMax / 10 || death)
{
num626 += 1f;
}
+22 -18
View File
@@ -112,7 +112,8 @@ namespace CalamityMod.NPCs.Cryogen
bool isChill = player.ZoneSnow;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
double multAdd = revenge ? 0.1 : 0D;
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
double multAdd = revenge ? 0.1 : 0D;
npc.TargetClosest(true);
if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (npc.ai[0] < 4f || CalamityWorld.bossRushActive)) //spawn shield for phase 0 1 2 3, not 4 5 6
@@ -176,9 +177,6 @@ namespace CalamityMod.NPCs.Cryogen
if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !revenge || (double)npc.life >= (double)npc.lifeMax * 0.15))
{
time++;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
time++;
if (time >= 600)
{
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
@@ -236,7 +234,7 @@ namespace CalamityMod.NPCs.Cryogen
float num1244 = player.Center.Y - vector142.Y;
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
float num1246 = isChill ? 4f : 8f;
if (CalamityWorld.death)
if (death)
{
num1246 = isChill ? 5f : 10f;
}
@@ -250,7 +248,8 @@ namespace CalamityMod.NPCs.Cryogen
npc.velocity.X = (npc.velocity.X * 50f + num1243) / 51f;
npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f;
if ((double)npc.life < (double)npc.lifeMax * (0.83 + multAdd))
double HPMult = death ? 0.95 : 0.83 + multAdd;
if ((double)npc.life < (double)npc.lifeMax * HPMult)
{
npc.ai[0] = 1f;
npc.localAI[0] = 0f;
@@ -290,7 +289,7 @@ namespace CalamityMod.NPCs.Cryogen
float velocity = isChill ? 7.5f : 4f;
float acceleration = isChill ? 0.1f : 0.15f;
if (CalamityWorld.death)
if (death)
velocity = isChill ? 7f : 3.5f;
if (CalamityWorld.bossRushActive)
{
@@ -357,7 +356,8 @@ namespace CalamityMod.NPCs.Cryogen
}
}
if ((double)npc.life < (double)npc.lifeMax * (0.66 + multAdd))
double HPMult = death ? 0.8 : 0.66 + multAdd;
if ((double)npc.life < (double)npc.lifeMax * HPMult)
{
npc.ai[0] = 2f;
npc.localAI[0] = 0f;
@@ -435,7 +435,7 @@ namespace CalamityMod.NPCs.Cryogen
float num1244 = player.Center.Y - vector142.Y;
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
float num1246 = isChill ? 6f : 12f;
if (CalamityWorld.death)
if (death)
{
num1246 = isChill ? 7f : 14f;
}
@@ -449,7 +449,8 @@ namespace CalamityMod.NPCs.Cryogen
npc.velocity.X = (npc.velocity.X * 50f + num1243) / 51f;
npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f;
if ((double)npc.life < (double)npc.lifeMax * (0.49 + multAdd))
double HPMult = death ? 0.7 : 0.49 + multAdd;
if ((double)npc.life < (double)npc.lifeMax * HPMult)
{
npc.ai[0] = 3f;
npc.localAI[0] = 0f;
@@ -501,7 +502,7 @@ namespace CalamityMod.NPCs.Cryogen
float velocity = isChill ? 7.5f : 4f;
float acceleration = isChill ? 0.1f : 0.15f;
if (CalamityWorld.death)
if (death)
velocity = isChill ? 7f : 3.5f;
if (CalamityWorld.bossRushActive)
{
@@ -568,7 +569,8 @@ namespace CalamityMod.NPCs.Cryogen
}
}
if ((double)npc.life < (double)npc.lifeMax * (0.32 + multAdd))
double HPMult = death ? 0.55 : 0.32 + multAdd;
if ((double)npc.life < (double)npc.lifeMax * HPMult)
{
npc.ai[0] = 4f;
npc.localAI[0] = 0f;
@@ -705,7 +707,8 @@ namespace CalamityMod.NPCs.Cryogen
}
}
if ((double)npc.life < (double)npc.lifeMax * (0.15 + multAdd))
double HPMult = death ? 0.4 : 0.15 + multAdd;
if ((double)npc.life < (double)npc.lifeMax * HPMult)
{
Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15);
drawAltTexture = true;
@@ -758,7 +761,8 @@ namespace CalamityMod.NPCs.Cryogen
{
npc.damage = (int)((float)npc.defDamage * 1.5f);
if (revenge && (double)npc.life < (double)npc.lifeMax * 0.15)
double HPMult = death ? 0.25 : 0.15;
if (revenge && (double)npc.life < (double)npc.lifeMax * HPMult)
{
if (npc.ai[1] == 60f)
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (CalamityWorld.bossRushActive ? 30f : (isChill ? 18f : 24f));
@@ -806,7 +810,7 @@ namespace CalamityMod.NPCs.Cryogen
num1374 *= num1376;
iceShard--;
if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd) || CalamityWorld.death || CalamityWorld.bossRushActive)
if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd) || death)
{
if (num1375 < 170f || iceShard > 0)
{
@@ -860,7 +864,7 @@ namespace CalamityMod.NPCs.Cryogen
else
{
time++;
if (time >= 60)
if (time >= 75)
{
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float spread = 45f * 0.0174f;
@@ -908,7 +912,7 @@ namespace CalamityMod.NPCs.Cryogen
float velocity = isChill ? 6f : 3f;
float acceleration = isChill ? 0.2f : 0.3f;
if (CalamityWorld.death)
if (death)
velocity = isChill ? 5f : 2.5f;
if (CalamityWorld.bossRushActive)
{
@@ -959,7 +963,7 @@ namespace CalamityMod.NPCs.Cryogen
}
}
if (!revenge || (double)npc.life >= (double)npc.lifeMax * 0.15)
if (!revenge || (double)npc.life >= (double)npc.lifeMax * (death ? 0.25 : 0.15))
{
if (npc.ai[3] == 0f && npc.life > 0)
{