diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index 7410b99835..f8b0ad844e 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -51,8 +51,7 @@ namespace CalamityMod.CalPlayer } // Neither scarf can be used if either is on cooldown - // TODO -- Why do the two scarves not use the same cooldown? They're both called "Scarf Cooldown". - if (playerDashing && DashID == CounterScarfDash.ID && Player.dashDelay < 0 && dodgeScarf && !(Player.HasCooldown(Cooldowns.CounterScarf.ID) || Player.HasCooldown(Cooldowns.EvasionScarf.ID))) + if (playerDashing && DashID == CounterScarfDash.ID && Player.dashDelay < 0 && dodgeScarf && !Player.HasCooldown(Cooldowns.ScarfCooldown.ID)) { CounterScarfDodge(); return true; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 170332948f..12450ee6d0 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -113,16 +113,8 @@ namespace CalamityMod.CalPlayer private void CounterScarfDodge() { - if (evasionScarf) - { - int duration = CalamityUtils.SecondsToFrames(30); - Player.AddCooldown(Cooldowns.EvasionScarf.ID, duration); - } - else - { - int duration = CalamityUtils.SecondsToFrames(30); - Player.AddCooldown(Cooldowns.CounterScarf.ID, duration); - } + int duration = CalamityUtils.SecondsToFrames(30); + Player.AddCooldown(ScarfCooldown.ID, duration, true, evasionScarf ? "evasionscarf" : "counterscarf"); // 17APR2024: Ozzatron: Counter Scarf is a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace. int counterScarfIFrames = Player.ComputeDodgeIFrames(); @@ -1238,7 +1230,7 @@ namespace CalamityMod.CalPlayer // ModifyHit (Flesh Totem effect happens here) -> Hurt (includes dodges) -> OnHit // As such, to avoid cooldowns proccing from dodge hits, do it here if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0) - Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, "default"); + Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20)); if (NPC.AnyNPCs(ModContent.NPCType())) Player.AddBuff(ModContent.BuffType(), 15, true); diff --git a/Cooldowns/BloodGodTotem.png b/Cooldowns/BloodGodTotem.png deleted file mode 100644 index c833d47380..0000000000 Binary files a/Cooldowns/BloodGodTotem.png and /dev/null differ diff --git a/Cooldowns/BloodGodTotemOutline.png b/Cooldowns/BloodGodTotemOutline.png deleted file mode 100644 index 53801a79de..0000000000 Binary files a/Cooldowns/BloodGodTotemOutline.png and /dev/null differ diff --git a/Cooldowns/BloodGodTotemOverlay.png b/Cooldowns/BloodGodTotemOverlay.png deleted file mode 100644 index 55a71cfc5d..0000000000 Binary files a/Cooldowns/BloodGodTotemOverlay.png and /dev/null differ diff --git a/Cooldowns/CounterScarf.cs b/Cooldowns/CounterScarf.cs deleted file mode 100644 index ddb548d6b2..0000000000 --- a/Cooldowns/CounterScarf.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Localization; - -namespace CalamityMod.Cooldowns -{ - public class CounterScarf : CooldownHandler - { - public static new string ID => "CounterScarf"; - - public override bool ShouldDisplay => true; - public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/CounterScarf"; - public override Color OutlineColor => Color.Lerp(new Color(255, 115, 178), new Color(255, 76, 76), (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f) * 0.5f + 0.5f); - public override Color CooldownStartColor => new Color(194, 75, 97); - public override Color CooldownEndColor => new Color(255, 76, 76); - } -} diff --git a/Cooldowns/EvasionScarf.cs b/Cooldowns/EvasionScarf.cs deleted file mode 100644 index 14b4aae1a2..0000000000 --- a/Cooldowns/EvasionScarf.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Localization; - -namespace CalamityMod.Cooldowns -{ - public class EvasionScarf : CooldownHandler - { - public static new string ID => "EvasionScarf"; - public override bool ShouldDisplay => true; - public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/EvasionScarf"; - public override Color OutlineColor => Color.Lerp(new Color(255, 194, 150), new Color(255, 160, 150), (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f) * 0.5f + 0.5f); - public override Color CooldownStartColor => new Color(132, 23, 32); - public override Color CooldownEndColor => new Color(164, 52, 45); - } -} diff --git a/Cooldowns/FleshTotem.cs b/Cooldowns/FleshTotem.cs index 878eb99bb5..8b1fe7812f 100644 --- a/Cooldowns/FleshTotem.cs +++ b/Cooldowns/FleshTotem.cs @@ -9,37 +9,9 @@ namespace CalamityMod.Cooldowns public override bool ShouldDisplay => true; public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/" + skinTexture; - public override Color OutlineColor => outlineColor; - public override Color CooldownStartColor => cooldownColorStart; - public override Color CooldownEndColor => cooldownColorEnd; - - //It's the same cooldown with different skins each time, basically. - public string skinTexture; - public Color outlineColor; - public Color cooldownColorStart; - public Color cooldownColorEnd; - - public FleshTotem() : this("") { } - public FleshTotem(string skin) - { - switch (skin) - { - // TODO -- UNUSED, Core of the Blood God no longer exists. - case "bloodgod": - skinTexture = "BloodGodTotem"; - outlineColor = new Color(255, 162, 205); - cooldownColorStart = new Color(193, 205, 255); - cooldownColorEnd = new Color(255, 193, 219); - break; - - default: - skinTexture = "FleshTotem"; - outlineColor = new Color(157, 248, 234); - cooldownColorStart = new Color(111, 169, 241); - cooldownColorEnd = new Color(111, 169, 241); - break; - } - } + public override string Texture => "CalamityMod/Cooldowns/FleshTotem"; + public override Color OutlineColor => new Color(157, 248, 234); + public override Color CooldownStartColor => new Color(111, 169, 241); + public override Color CooldownEndColor => new Color(111, 169, 241); } } diff --git a/Cooldowns/ScarfCooldown.cs b/Cooldowns/ScarfCooldown.cs new file mode 100644 index 0000000000..2b61a01e4f --- /dev/null +++ b/Cooldowns/ScarfCooldown.cs @@ -0,0 +1,45 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class ScarfCooldown : CooldownHandler + { + public static new string ID => "ScarfCooldown"; + + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/" + skinTexture; + public override Color OutlineColor => outlineColor; + public override Color CooldownStartColor => cooldownColorStart; + public override Color CooldownEndColor => cooldownColorEnd; + + // It's the same cooldown with different skins each time, basically. + public string skinTexture; + public Color outlineColor; + public Color cooldownColorStart; + public Color cooldownColorEnd; + + public ScarfCooldown() : this("") { } + public ScarfCooldown(string skin) + { + switch (skin) + { + case "evasionscarf": + skinTexture = "EvasionScarf"; + outlineColor = Color.Lerp(new Color(255, 194, 150), new Color(255, 160, 150), (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f) * 0.5f + 0.5f); + cooldownColorStart = new Color(132, 23, 32); + cooldownColorEnd = new Color(164, 52, 45); + break; + default: + skinTexture = "CounterScarf"; + outlineColor = Color.Lerp(new Color(255, 115, 178), new Color(255, 76, 76), (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f) * 0.5f + 0.5f); + cooldownColorStart = new Color(194, 75, 97); + cooldownColorEnd = new Color(255, 76, 76); + break; + } + } + } +} diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 4511d4cfa3..63fa289aa0 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -86,12 +86,10 @@ Cooldowns: { BloodflareRangedSet: Bloodflare Soul Cooldown BrimflameFrenzy: Brimflame Frenzy Cooldown ChaosState: Teleportation Cooldown - CounterScarf: Scarf Cooldown DivineBless: Divine Bless Cooldown DivingPlatesBreaking: Abyssal Diving Suit Plates Durability DivingPlatesBroken: Abyssal Diving Suit Broken Plates ParryCooldown: Parry Ability Cooldown - EvasionScarf: Scarf Cooldown FleshTotem: Contact Damage Halving Cooldown GaelsRage: Gael's Greatsword Rage Cooldown GlobalDodge: Dodge Cooldown @@ -116,6 +114,7 @@ Cooldowns: { SandCloak: Sand Cloak Cooldown SandsmokeBombActive: Sandsmoke Bomb Duration SandsmokeBombCooldown: Sandsmoke Bomb Cooldown + ScarfCooldown: Scarf Cooldown SilvaRevive: Silva Revive Cooldown SpeedBlasterBoost: Speed Blaster Boost SpongeDurability: Sponge Barrier Durability