Merged the two Scarf cooldowns

Also removed CotBG stuff from Flesh Totem cooldown
This commit is contained in:
CongratsIsTrash committed 2024-09-30 22:59:31 -04:00
1 parent 7d76a3a560
commit 5559ac6d4c
10 files changed
+54 -84

No files matched your search

+1 -2
View File
@@ -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;
+3 -11
View File
@@ -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<THELORDE>()))
Player.AddBuff(ModContent.BuffType<NOU>(), 15, true);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

-19
View File
@@ -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);
}
}
-18
View File
@@ -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);
}
}
+4 -32
View File
@@ -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);
}
}
+45
View File
@@ -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;
}
}
}
}
+1 -2
View File
@@ -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