Merge branch '1.4' into codebreaker-text

This commit is contained in:
Dominic committed 2022-11-05 16:36:06 -05:00
commit f43db13a2d
10 files changed
+33 -64

No files matched your search

+12
View File
@@ -3422,6 +3422,18 @@ namespace CalamityMod.CalPlayer
}
}
// Add a cooldown display for the vanilla lifesteal cooldown, which is active when negative
if (Player.whoAmI == Main.myPlayer && Player.lifeSteal < 0f)
{
float duration = Player.lifeSteal;
float baseCooldown = Main.expertMode ? 0.5f : 0.6f;
float lifeStealNerf = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f;
duration /= baseCooldown - lifeStealNerf;
duration *= -1f;
if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < (int)duration))
Player.AddCooldown(LifeSteal.ID, (int)duration);
}
ForceVariousEffects();
}
#endregion
+15
View File
@@ -0,0 +1,15 @@
using Microsoft.Xna.Framework;
namespace CalamityMod.Cooldowns
{
public class LifeSteal : CooldownHandler
{
public static new string ID => "LifeSteal";
public override bool ShouldDisplay => instance.player.lifeSteal < 0f;
public override string DisplayName => "Life Steal Cooldown";
public override string Texture => "CalamityMod/Cooldowns/LifeSteal";
public override Color OutlineColor => new Color(255, 142, 165);
public override Color CooldownStartColor => Color.Lerp(new Color(255, 216, 216), new Color(255, 117, 117), instance.Completion);
public override Color CooldownEndColor => Color.Lerp(new Color(255, 216, 216), new Color(255, 117, 117), instance.Completion);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

+6 -4
View File
@@ -5778,18 +5778,20 @@ namespace CalamityMod.NPCs
#endregion
#region Any Events
public static bool AnyEvents(Player player)
public static bool AnyEvents(Player player, bool checkBloodMoon = false)
{
if (Main.invasionType > InvasionID.None)
if (Main.invasionType > InvasionID.None && Main.invasionProgressNearInvasion)
return true;
if (player.PillarZone())
return true;
if (DD2Event.Ongoing)
if (DD2Event.Ongoing && player.ZoneOldOneArmy)
return true;
if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.bloodMoon || Main.pumpkinMoon || Main.snowMoon))
if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.pumpkinMoon || Main.snowMoon))
return true;
if (AcidRainEvent.AcidRainEventIsOngoing && player.InSulphur())
return true;
if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && Main.bloodMoon && checkBloodMoon)
return true;
return false;
}
#endregion
-15
View File
@@ -113,21 +113,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
}
}
public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x))
{
if (projectile.penetrate == -1 && !projectile.minion)
{
projectile.penetrate = 1;
}
else if (projectile.penetrate >= 1)
{
projectile.penetrate = 1;
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
SpriteEffects spriteEffects = SpriteEffects.None;
@@ -132,21 +132,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
}
}
public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x))
{
if (projectile.penetrate == -1 && !projectile.minion)
{
projectile.penetrate = 1;
}
else if (projectile.penetrate >= 1)
{
projectile.penetrate = 1;
}
}
}
public override void FindFrame(int frameHeight)
{
NPC.frameCounter++;
-15
View File
@@ -337,21 +337,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
return false;
}
public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x))
{
if (projectile.penetrate == -1 && !projectile.minion)
{
projectile.penetrate = 1;
}
else if (projectile.penetrate >= 1)
{
projectile.penetrate = 1;
}
}
}
public override bool CheckActive()
{
return false;
-15
View File
@@ -163,21 +163,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
return false;
}
public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x))
{
if (projectile.penetrate == -1 && !projectile.minion)
{
projectile.penetrate = 1;
}
else if (projectile.penetrate >= 1)
{
projectile.penetrate = 1;
}
}
}
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)