added areThereAnyDamnEvents. RoD and friends now only boost chaos state while a boss or event is active
This commit is contained in:
1 parent
b8c81583ca
commit
c152d137cc
4 files changed
+44
-16
No files matched your search
+18
-12
@@ -85,6 +85,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
#region No Category
|
||||
public static bool areThereAnyDamnBosses = false;
|
||||
public static bool areThereAnyDamnEvents = false;
|
||||
public bool drawBossHPBar = true;
|
||||
public bool shouldDrawSmallText = true;
|
||||
private const int saveVersion = 0;
|
||||
@@ -96,7 +97,8 @@ namespace CalamityMod.CalPlayer
|
||||
public int actualMaxLife = 0;
|
||||
public int deathModeUnderworldTime = 0;
|
||||
public int deathModeBlizzardTime = 0;
|
||||
public static int chaosStateDuration = 600;
|
||||
public static int chaosStateDuration = 360;
|
||||
public static int chaosStateDurationBoss = 600;
|
||||
public bool killSpikyBalls = false;
|
||||
public Projectile lastProjectileHit;
|
||||
public double acidRoundMultiplier = 1D;
|
||||
@@ -2516,12 +2518,14 @@ namespace CalamityMod.CalPlayer
|
||||
player.Teleport(teleportLocation, 4, 0);
|
||||
NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0);
|
||||
|
||||
int duration = chaosStateDuration;
|
||||
if (areThereAnyDamnBosses || areThereAnyDamnEvents)
|
||||
duration = chaosStateDurationBoss;
|
||||
if (eScarfCooldown)
|
||||
player.AddBuff(BuffID.ChaosState, (int)(chaosStateDuration * 1.5), true);
|
||||
else if (scarfCooldown)
|
||||
player.AddBuff(BuffID.ChaosState, chaosStateDuration * 2, true);
|
||||
else
|
||||
player.AddBuff(BuffID.ChaosState, chaosStateDuration, true);
|
||||
duration = (int)(chaosStateDuration * 1.5);
|
||||
else if (scarfCooldown)
|
||||
duration = chaosStateDuration * 2;
|
||||
player.AddBuff(BuffID.ChaosState, duration, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2569,12 +2573,14 @@ namespace CalamityMod.CalPlayer
|
||||
player.Teleport(teleportLocation, 1, 0);
|
||||
NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0);
|
||||
|
||||
if (eScarfCooldown)
|
||||
player.AddBuff(BuffID.ChaosState, (int)(chaosStateDuration * 1.5), true);
|
||||
else if (scarfCooldown)
|
||||
player.AddBuff(BuffID.ChaosState, chaosStateDuration * 2, true);
|
||||
else
|
||||
player.AddBuff(BuffID.ChaosState, chaosStateDuration, true);
|
||||
int duration = chaosStateDuration;
|
||||
if (areThereAnyDamnBosses || areThereAnyDamnEvents)
|
||||
duration = chaosStateDurationBoss;
|
||||
if (eScarfCooldown)
|
||||
duration = (int)(chaosStateDuration * 1.5);
|
||||
else if (scarfCooldown)
|
||||
duration = chaosStateDuration * 2;
|
||||
player.AddBuff(BuffID.ChaosState, duration, true);
|
||||
|
||||
int numDust = 40;
|
||||
Vector2 step = playerToTeleport / numDust;
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace CalamityMod.CalPlayer
|
||||
// Bool for any existing bosses, true if any boss NPC is active
|
||||
CalamityPlayer.areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS();
|
||||
|
||||
// Bool for any existing events, true if any event is active
|
||||
CalamityPlayer.areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents();
|
||||
|
||||
// If any boss NPC is active, apply Zen to the player to reduce spawn rate
|
||||
if (CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
|
||||
@@ -949,12 +949,14 @@ namespace CalamityMod.Items
|
||||
{
|
||||
if (!Collision.SolidCollision(teleportLocation, player.width, player.height))
|
||||
{
|
||||
int duration = CalamityPlayer.chaosStateDuration;
|
||||
if (CalamityPlayer.areThereAnyDamnBosses || CalamityPlayer.areThereAnyDamnEvents)
|
||||
duration = CalamityPlayer.chaosStateDurationBoss;
|
||||
if (modPlayer.eScarfCooldown)
|
||||
player.AddBuff(BuffID.ChaosState, (int)(CalamityPlayer.chaosStateDuration * 1.5), true);
|
||||
duration = (int)(CalamityPlayer.chaosStateDuration * 1.5);
|
||||
else if (modPlayer.scarfCooldown)
|
||||
player.AddBuff(BuffID.ChaosState, CalamityPlayer.chaosStateDuration * 2, true);
|
||||
else
|
||||
player.AddBuff(BuffID.ChaosState, CalamityPlayer.chaosStateDuration, true);
|
||||
duration = CalamityPlayer.chaosStateDuration * 2;
|
||||
player.AddBuff(BuffID.ChaosState, duration, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5828,6 +5828,23 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Any Events
|
||||
public static bool AnyEvents()
|
||||
{
|
||||
if (Main.invasionType > 0)
|
||||
return true;
|
||||
if (player.PillarZone())
|
||||
return true;
|
||||
if (DD2Event.Ongoing)
|
||||
return true;
|
||||
if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.bloodMoon || Main.pumpkinMoon || Main.snowMoon))
|
||||
return true;
|
||||
if (CalamityWorld.rainingAcid && player.InSulphur())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Get Downed Boss Variable
|
||||
public static bool GetDownedBossVariable(int type)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user