added lifesteal cooldown visual

This commit is contained in:
ben-tk authored and Cameron Ewell committed 2022-10-31 01:07:22 -04:00
1 parent 8a9a8d000b
commit df50644bb7
5 files changed
+27

No files matched your search

+12
View File
@@ -3414,6 +3414,18 @@ namespace CalamityMod.CalPlayer
break;
}
}
// Add a cooldown display for the vanilla lifesteal cooldown, which is active when negative
if (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();
+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 => CalamityConfig.Instance.VanillaCooldownDisplay && 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