From c55944f716495b08d2937f02f71f3448eb28bc66 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 3 Mar 2022 14:08:19 -0500 Subject: [PATCH] broken holding commit until I eventually get back to this --- CalPlayer/CalamityPlayer.cs | 20 +- CalPlayer/CalamityPlayerMiscEffects.cs | 81 +++--- CalPlayer/CalamityPlayerNetcode.cs | 18 +- CalamityMod.cs | 7 +- .../AbyssEvade.png | Bin .../AbyssEvadeOutline.png | Bin .../AbyssEvadeOverlay.png | Bin .../AbyssalDivingSuitBreakingPlates.png | Bin .../AbyssalDivingSuitBrokenPlates.png | Bin .../AbyssalDivingSuitBrokenPlatesOutline.png | Bin .../AbyssalDivingSuitBrokenPlatesOverlay.png | Bin Cooldowns/AbyssalDivingSuitCooldowns.cs | 68 +++++ .../AbyssalMadness.png | Bin .../AbyssalMadnessActive.png | Bin .../AbyssalMadnessCooldown.cs | 38 ++- .../AbyssalMadnessOutline.png | Bin .../AbyssalMadnessOverlay.png | Bin .../BarBase.png | Bin .../BloodGodTotem.png | Bin .../BloodGodTotemOutline.png | Bin .../BloodGodTotemOverlay.png | Bin .../BloodflareFrenzy.png | Bin Cooldowns/BloodflareFrenzyCooldown.cs | 20 ++ .../BloodflareFrenzyOutline.png | Bin .../BloodflareFrenzyOverlay.png | Bin .../BloodflareSoul.png | Bin Cooldowns/BloodflareSoulCooldown.cs | 23 ++ .../BloodflareSoulOutline.png | Bin .../BloodflareSoulOverlay.png | Bin .../BlunderBooster.png | Bin .../BlunderBoosterOutline.png | Bin .../BlunderBoosterOverlay.png | Bin .../BrimflameFrenzy.png | Bin .../BrimflameFrenzyCooldown.cs | 28 +-- .../BrimflameFrenzyEyes.png | Bin .../BrimflameFrenzyOutline.png | Bin .../BrimflameFrenzyOverlay.png | Bin .../ChaosState.png | Bin .../ChaosStateDisplay.cs | 24 +- .../ChaosStateNR.png | Bin .../ChaosStateNROutline.png | Bin .../ChaosStateNROverlay.png | Bin .../ChaosStateOutline.png | Bin .../ChaosStateOverlay.png | Bin .../ChaosStateVeil.png | Bin .../ChaosStateVeilOutline.png | Bin .../ChaosStateVeilOverlay.png | Bin Cooldowns/Cooldown.cs | 191 ++++++++++++++ Cooldowns/CooldownInstance.cs | 52 ++++ .../CooldownRackUI.cs | 24 +- Cooldowns/CooldownRegistry.cs | 59 +++++ .../CounterScarf.png | Bin Cooldowns/CounterScarfCooldown.cs | 22 ++ .../CounterScarfOutline.png | Bin .../CounterScarfOverlay.png | Bin Cooldowns/DivineBlessCooldown.cs | 29 +++ .../DivineRecharge.png | Bin .../DivineRechargeOutline.png | Bin .../DivineRechargeOverlay.png | Bin .../DraconicElixir.png | Bin Cooldowns/DraconicElixirCooldown.cs | 22 ++ .../DraconicElixirOutline.png | Bin .../DraconicElixirOverlay.png | Bin .../EclipseEvade.png | Bin .../EclipseEvadeOutline.png | Bin .../EclipseEvadeOverlay.png | Bin .../EvasionScarf.png | Bin Cooldowns/EvasionScarfCooldown.cs | 21 ++ .../EvasionScarfOutline.png | Bin .../EvasionScarfOverlay.png | Bin .../FleshTotem.png | Bin .../FleshTotemCooldown.cs | 24 +- .../FleshTotemOutline.png | Bin .../FleshTotemOverlay.png | Bin .../GlobalDodge.png | Bin .../GlobalDodgeCooldown.cs | 24 +- .../GlobalDodgeOutline.png | Bin .../GlobalDodgeOverlay.png | Bin .../GodslayerDash.png | Bin Cooldowns/GodslayerDashCooldown.cs | 21 ++ .../GodslayerDashOutline.png | Bin .../GodslayerDashOverlay.png | Bin .../InkBomb.png | Bin Cooldowns/InkBombCooldown.cs | 21 ++ .../InkBombOutline.png | Bin .../InkBombOverlay.png | Bin .../JetpackCooldown.cs | 23 +- .../LionHeartShield.png | Bin .../LionHeartShieldOutline.png | Bin .../LionHeartShieldOverlay.png | Bin Cooldowns/LionsHeartShieldCooldown.cs | 20 ++ .../NebulousCore.png | Bin Cooldowns/NebulousCoreCooldown.cs | 19 ++ .../NebulousCoreOutline.png | Bin .../NebulousCoreOverlay.png | Bin .../PermafrostConcoction.png | Bin Cooldowns/PermafrostConcoctionCooldown.cs | 20 ++ .../PermafrostConcoctionOutline.png | Bin .../PermafrostConcoctionOverlay.png | Bin .../PlagueBlackout.png | Bin .../PlagueBlackoutCooldown.cs | 25 +- .../PlagueBlackoutOutline.png | Bin .../PlagueBlackoutOverlay.png | Bin .../PlaguedFuelPack.png | Bin .../PlaguedFuelPackOutline.png | Bin .../PlaguedFuelPackOverlay.png | Bin .../PotionSickness.png | Bin Cooldowns/PotionSicknessDisplay.cs | 20 ++ .../PotionSicknessOutline.png | Bin .../PotionSicknessOverlay.png | Bin .../PrismaticLaser.png | Bin Cooldowns/PrismaticLaserCooldown.cs | 23 ++ .../PrismaticLaserOutline.png | Bin .../PrismaticLaserOverlay.png | Bin .../ProfanedSoulArtifact.png | Bin Cooldowns/ProfanedSoulArtifactCooldown.cs | 20 ++ .../ProfanedSoulArtifactOutline.png | Bin .../ProfanedSoulArtifactOverlay.png | Bin .../RelicOfResilience.png | Bin Cooldowns/RelicOfResilienceCooldown.cs | 20 ++ .../RelicOfResilienceOutline.png | Bin .../RelicOfResilienceOverlay.png | Bin .../SandCloak.png | Bin Cooldowns/SandCloakCooldown.cs | 20 ++ .../SandCloakOutline.png | Bin .../SandCloakOverlay.png | Bin .../SilvaRevive.png | Bin Cooldowns/SilvaReviveCooldown.cs | 22 ++ .../SilvaReviveOutline.png | Bin .../SilvaReviveOverlay.png | Bin .../SirenIceShield.png | Bin Cooldowns/SirenIceShieldCooldown.cs | 22 ++ .../SirenIceShieldOutline.png | Bin .../SirenIceShieldOverlay.png | Bin .../TarragonCloak.png | Bin Cooldowns/TarragonCloakCooldown.cs | 20 ++ .../TarragonCloakOutline.png | Bin .../TarragonCloakOverlay.png | Bin .../TarragonImmunity.png | Bin Cooldowns/TarragonImmunityCooldown.cs | 20 ++ .../TarragonImmunityOutline.png | Bin .../TarragonImmunityOverlay.png | Bin .../UniverseSplitter.png | Bin Cooldowns/UniverseSplitterCooldown.cs | 22 ++ .../UniverseSplitterOutline.png | Bin .../UniverseSplitterOverlay.png | Bin Items/Armor/OmegaBlueHelmet.cs | 3 +- .../AbyssalDivingSuitCooldowns.cs | 68 ----- .../BloodflareFrenzyCooldown.cs | 31 --- .../BloodflareSoulCooldown.cs | 33 --- UI/CooldownIndicators/CooldownIndicator.cs | 232 ------------------ UI/CooldownIndicators/CounterScarfCooldown.cs | 31 --- UI/CooldownIndicators/DivineBlessCooldown.cs | 38 --- .../DraconicElixirCooldown.cs | 31 --- UI/CooldownIndicators/EvasionScarfCooldown.cs | 30 --- .../GodslayerDashCooldown.cs | 31 --- UI/CooldownIndicators/InkBombCooldown.cs | 31 --- .../LionsHeartShieldCooldown.cs | 30 --- UI/CooldownIndicators/NebulousCoreCooldown.cs | 29 --- .../PermafrostConcoctionCooldown.cs | 30 --- .../PotionSicknessDisplay.cs | 30 --- .../PrismaticLaserCooldown.cs | 32 --- .../ProfanedSoulArtifactCooldown.cs | 30 --- .../RelicOfResilienceCooldown.cs | 30 --- UI/CooldownIndicators/SandCloakCooldown.cs | 30 --- UI/CooldownIndicators/SilvaReviveCooldown.cs | 31 --- .../SirenIceShieldCooldown.cs | 31 --- .../TarragonCloakCooldown.cs | 31 --- .../TarragonImmunityCooldown.cs | 31 --- .../UniverseSplitterCooldown.cs | 31 --- 170 files changed, 960 insertions(+), 1148 deletions(-) rename {UI/CooldownIndicators => Cooldowns}/AbyssEvade.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssEvadeOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssEvadeOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalDivingSuitBreakingPlates.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalDivingSuitBrokenPlates.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalDivingSuitBrokenPlatesOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalDivingSuitBrokenPlatesOverlay.png (100%) create mode 100644 Cooldowns/AbyssalDivingSuitCooldowns.cs rename {UI/CooldownIndicators => Cooldowns}/AbyssalMadness.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalMadnessActive.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalMadnessCooldown.cs (72%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalMadnessOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/AbyssalMadnessOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BarBase.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodGodTotem.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodGodTotemOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodGodTotemOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodflareFrenzy.png (100%) create mode 100644 Cooldowns/BloodflareFrenzyCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/BloodflareFrenzyOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodflareFrenzyOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodflareSoul.png (100%) create mode 100644 Cooldowns/BloodflareSoulCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/BloodflareSoulOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BloodflareSoulOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BlunderBooster.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BlunderBoosterOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BlunderBoosterOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BrimflameFrenzy.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BrimflameFrenzyCooldown.cs (56%) rename {UI/CooldownIndicators => Cooldowns}/BrimflameFrenzyEyes.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BrimflameFrenzyOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/BrimflameFrenzyOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosState.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateDisplay.cs (67%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateNR.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateNROutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateNROverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateVeil.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateVeilOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ChaosStateVeilOverlay.png (100%) create mode 100644 Cooldowns/Cooldown.cs create mode 100644 Cooldowns/CooldownInstance.cs rename {UI/CooldownIndicators => Cooldowns}/CooldownRackUI.cs (78%) create mode 100644 Cooldowns/CooldownRegistry.cs rename {UI/CooldownIndicators => Cooldowns}/CounterScarf.png (100%) create mode 100644 Cooldowns/CounterScarfCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/CounterScarfOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/CounterScarfOverlay.png (100%) create mode 100644 Cooldowns/DivineBlessCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/DivineRecharge.png (100%) rename {UI/CooldownIndicators => Cooldowns}/DivineRechargeOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/DivineRechargeOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/DraconicElixir.png (100%) create mode 100644 Cooldowns/DraconicElixirCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/DraconicElixirOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/DraconicElixirOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/EclipseEvade.png (100%) rename {UI/CooldownIndicators => Cooldowns}/EclipseEvadeOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/EclipseEvadeOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/EvasionScarf.png (100%) create mode 100644 Cooldowns/EvasionScarfCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/EvasionScarfOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/EvasionScarfOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/FleshTotem.png (100%) rename {UI/CooldownIndicators => Cooldowns}/FleshTotemCooldown.cs (64%) rename {UI/CooldownIndicators => Cooldowns}/FleshTotemOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/FleshTotemOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/GlobalDodge.png (100%) rename {UI/CooldownIndicators => Cooldowns}/GlobalDodgeCooldown.cs (69%) rename {UI/CooldownIndicators => Cooldowns}/GlobalDodgeOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/GlobalDodgeOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/GodslayerDash.png (100%) create mode 100644 Cooldowns/GodslayerDashCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/GodslayerDashOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/GodslayerDashOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/InkBomb.png (100%) create mode 100644 Cooldowns/InkBombCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/InkBombOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/InkBombOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/JetpackCooldown.cs (67%) rename {UI/CooldownIndicators => Cooldowns}/LionHeartShield.png (100%) rename {UI/CooldownIndicators => Cooldowns}/LionHeartShieldOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/LionHeartShieldOverlay.png (100%) create mode 100644 Cooldowns/LionsHeartShieldCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/NebulousCore.png (100%) create mode 100644 Cooldowns/NebulousCoreCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/NebulousCoreOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/NebulousCoreOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PermafrostConcoction.png (100%) create mode 100644 Cooldowns/PermafrostConcoctionCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/PermafrostConcoctionOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PermafrostConcoctionOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PlagueBlackout.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PlagueBlackoutCooldown.cs (56%) rename {UI/CooldownIndicators => Cooldowns}/PlagueBlackoutOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PlagueBlackoutOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PlaguedFuelPack.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PlaguedFuelPackOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PlaguedFuelPackOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PotionSickness.png (100%) create mode 100644 Cooldowns/PotionSicknessDisplay.cs rename {UI/CooldownIndicators => Cooldowns}/PotionSicknessOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PotionSicknessOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PrismaticLaser.png (100%) create mode 100644 Cooldowns/PrismaticLaserCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/PrismaticLaserOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/PrismaticLaserOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ProfanedSoulArtifact.png (100%) create mode 100644 Cooldowns/ProfanedSoulArtifactCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/ProfanedSoulArtifactOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/ProfanedSoulArtifactOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/RelicOfResilience.png (100%) create mode 100644 Cooldowns/RelicOfResilienceCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/RelicOfResilienceOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/RelicOfResilienceOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/SandCloak.png (100%) create mode 100644 Cooldowns/SandCloakCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/SandCloakOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/SandCloakOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/SilvaRevive.png (100%) create mode 100644 Cooldowns/SilvaReviveCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/SilvaReviveOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/SilvaReviveOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/SirenIceShield.png (100%) create mode 100644 Cooldowns/SirenIceShieldCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/SirenIceShieldOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/SirenIceShieldOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/TarragonCloak.png (100%) create mode 100644 Cooldowns/TarragonCloakCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/TarragonCloakOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/TarragonCloakOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/TarragonImmunity.png (100%) create mode 100644 Cooldowns/TarragonImmunityCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/TarragonImmunityOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/TarragonImmunityOverlay.png (100%) rename {UI/CooldownIndicators => Cooldowns}/UniverseSplitter.png (100%) create mode 100644 Cooldowns/UniverseSplitterCooldown.cs rename {UI/CooldownIndicators => Cooldowns}/UniverseSplitterOutline.png (100%) rename {UI/CooldownIndicators => Cooldowns}/UniverseSplitterOverlay.png (100%) delete mode 100644 UI/CooldownIndicators/AbyssalDivingSuitCooldowns.cs delete mode 100644 UI/CooldownIndicators/BloodflareFrenzyCooldown.cs delete mode 100644 UI/CooldownIndicators/BloodflareSoulCooldown.cs delete mode 100644 UI/CooldownIndicators/CooldownIndicator.cs delete mode 100644 UI/CooldownIndicators/CounterScarfCooldown.cs delete mode 100644 UI/CooldownIndicators/DivineBlessCooldown.cs delete mode 100644 UI/CooldownIndicators/DraconicElixirCooldown.cs delete mode 100644 UI/CooldownIndicators/EvasionScarfCooldown.cs delete mode 100644 UI/CooldownIndicators/GodslayerDashCooldown.cs delete mode 100644 UI/CooldownIndicators/InkBombCooldown.cs delete mode 100644 UI/CooldownIndicators/LionsHeartShieldCooldown.cs delete mode 100644 UI/CooldownIndicators/NebulousCoreCooldown.cs delete mode 100644 UI/CooldownIndicators/PermafrostConcoctionCooldown.cs delete mode 100644 UI/CooldownIndicators/PotionSicknessDisplay.cs delete mode 100644 UI/CooldownIndicators/PrismaticLaserCooldown.cs delete mode 100644 UI/CooldownIndicators/ProfanedSoulArtifactCooldown.cs delete mode 100644 UI/CooldownIndicators/RelicOfResilienceCooldown.cs delete mode 100644 UI/CooldownIndicators/SandCloakCooldown.cs delete mode 100644 UI/CooldownIndicators/SilvaReviveCooldown.cs delete mode 100644 UI/CooldownIndicators/SirenIceShieldCooldown.cs delete mode 100644 UI/CooldownIndicators/TarragonCloakCooldown.cs delete mode 100644 UI/CooldownIndicators/TarragonImmunityCooldown.cs delete mode 100644 UI/CooldownIndicators/UniverseSplitterCooldown.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e892546835..2fc0b260aa 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6,13 +6,13 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; +using CalamityMod.Cooldowns; using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor; -using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Dyes; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; @@ -60,7 +60,6 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.Skies; using CalamityMod.Tiles; using CalamityMod.UI; -using CalamityMod.UI.CooldownIndicators; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -281,7 +280,7 @@ namespace CalamityMod.CalPlayer private const int DashDisableCooldown = 12; public bool disableAllDodges = false; - public List Cooldowns = new List(); + public Dictionary Cooldowns = new Dictionary(16); public bool canFireAtaxiaRangedProjectile = false; public bool canFireAtaxiaRogueProjectile = false; @@ -2153,8 +2152,13 @@ namespace CalamityMod.CalPlayer #region UpdateDead public override void UpdateDead() { - //Clear all the cooldowns - Cooldowns.RemoveAll(cooldown => cooldown.ResetOnDeath); + // Remove all cooldowns which do not persist through death. + if (Cooldowns.Count > 0) + { + var cooldownEntriesToRemove = Cooldowns.Where((kv) => !kv.Value.source.PersistsThroughDeath); + foreach (var kv in cooldownEntriesToRemove) + Cooldowns.Remove(kv.Key); + } #region Debuffs totalDefenseDamage = 0; @@ -3853,13 +3857,13 @@ namespace CalamityMod.CalPlayer { if (!Cooldowns.Exists(cooldown => cooldown.GetType() == typeof(DivingPlatesBreaking))) { - CooldownIndicator durability = new DivingPlatesBreaking(3, player); + Cooldown durability = new DivingPlatesBreaking(3, player); durability.TimeLeft = abyssalDivingSuitPlateHits; Cooldowns.Add(durability); } else { - CooldownIndicator durability = Cooldowns.Find(cooldown => cooldown.GetType() == typeof(DivingPlatesBreaking)); + Cooldown durability = Cooldowns.Find(cooldown => cooldown.GetType() == typeof(DivingPlatesBreaking)); durability.TimeLeft = abyssalDivingSuitPlateHits; } @@ -7001,7 +7005,7 @@ namespace CalamityMod.CalPlayer if (abyssalDivingSuitPlateHits < 3) abyssalDivingSuitPlateHits++; - CooldownIndicator durability = Cooldowns.Find(cooldown => cooldown.GetType() == typeof(DivingPlatesBreaking)); + Cooldown durability = Cooldowns.Find(cooldown => cooldown.GetType() == typeof(DivingPlatesBreaking)); durability.TimeLeft = abyssalDivingSuitPlateHits; if (abyssalDivingSuitPlateHits >= 3) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index d5f58a4320..ab09d49869 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,10 +1,10 @@ using CalamityMod.Buffs.Alcohol; -using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; +using CalamityMod.Cooldowns; using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Dusts; @@ -24,7 +24,6 @@ using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; @@ -33,15 +32,12 @@ using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.Other; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Environment; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.UI; -using CalamityMod.UI.CooldownIndicators; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -51,7 +47,6 @@ using System.Linq; using Terraria; using Terraria.GameContent.Events; using Terraria.GameInput; -using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -62,7 +57,7 @@ namespace CalamityMod.CalPlayer public partial class CalamityPlayer : ModPlayer { #region Post Update Misc Effects - public override void PostUpdateMiscEffects() + public override void PostUpdateMiscEffects() { // No category @@ -166,15 +161,15 @@ namespace CalamityMod.CalPlayer player.rangedCrit = 4; } - if (player.ActiveItem().type == ModContent.ItemType()) - heldGaelsLastFrame = true; + if (player.ActiveItem().type == ModContent.ItemType()) + heldGaelsLastFrame = true; - // De-equipping Gael's Greatsword deletes all rage. - else if (heldGaelsLastFrame) - { - heldGaelsLastFrame = false; - rage = 0f; - } + // De-equipping Gael's Greatsword deletes all rage. + else if (heldGaelsLastFrame) + { + heldGaelsLastFrame = false; + rage = 0f; + } } #endregion @@ -505,11 +500,11 @@ namespace CalamityMod.CalPlayer { if (DoGCartSegments[i] is null) { - DoGCartSegments[i] = new DoGCartSegment - { - Center = player.Center - idealRotation.ToRotationVector2() * i * 20f - }; - } + DoGCartSegments[i] = new DoGCartSegment + { + Center = player.Center - idealRotation.ToRotationVector2() * i * 20f + }; + } } Vector2 startingStickPosition = player.Center + stickOffset + new Vector2(direction * (float)Math.Cos(SmoothenedMinecartRotation * 2f) * -34f, 12f); @@ -581,7 +576,7 @@ namespace CalamityMod.CalPlayer // Summon bullseyes on nearby targets. if (spiritOrigin) - { + { int bullseyeType = ModContent.ProjectileType(); List alreadyTargetedNPCs = new List(); for (int i = 0; i < Main.maxProjectiles; i++) @@ -946,28 +941,38 @@ namespace CalamityMod.CalPlayer } } - // Cooldowns and timers + // Tick all cooldowns. + // Depending on the code for each individual cooldown, this isn't guaranteed to do anything. + // It may not tick down the timer or not do anything at all. + IList expiredCooldowns = new List(16); + var cdIterator = Cooldowns.Values.GetEnumerator(); + while(cdIterator.MoveNext()) + { + CooldownInstance instance = cdIterator.Current; + Cooldown cd = instance.source; - foreach (CooldownIndicator cd in Cooldowns) - { + // If applicable, tick down this cooldown instance's timer. if (cd.CanTickDown) - cd.TimeLeft--; + --instance.timeLeft; - cd.CooldownEffects(); + // Tick always runs, even if the timer does not decrement. + cd.Tick(instance); - if (cd.TimeLeft < 0) + // Run on-completion code, play sounds and remove finished cooldowns. + if (instance.timeLeft < 0) { + cd.OnCompleted(instance); Main.PlaySound(cd.EndSound); - cd.OnCooldownEnd(); + expiredCooldowns.Add(cd.ID); - if (cd.SyncID != "" && Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - player.Calamity().SyncCooldown(false, cd.SyncID); - } + // TODO -- netcode for when cooldowns disappear } - } + } + cdIterator.Dispose(); - Cooldowns.RemoveAll(cooldown => cooldown.TimeLeft < 0); + // Remove all expired cooldowns. + foreach (string cdID in expiredCooldowns) + Cooldowns.Remove(cdID); if (spiritOriginBullseyeShootCountdown > 0) spiritOriginBullseyeShootCountdown--; @@ -1057,8 +1062,8 @@ namespace CalamityMod.CalPlayer hellbornBoost--; if (persecutedEnchantSummonTimer < 1800) persecutedEnchantSummonTimer++; - else - { + else + { persecutedEnchantSummonTimer = 0; if (Main.myPlayer == player.whoAmI && persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) { @@ -3367,8 +3372,8 @@ namespace CalamityMod.CalPlayer { if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(player.AverageDamage() * 70), 0f, player.whoAmI); - } - else if (player.whoAmI == Main.myPlayer) + } + else if (player.whoAmI == Main.myPlayer) { int shieldType = ModContent.ProjectileType(); for (int i = 0; i < Main.maxProjectiles; i++) diff --git a/CalPlayer/CalamityPlayerNetcode.cs b/CalPlayer/CalamityPlayerNetcode.cs index 05f2ea1cbc..c782626d50 100644 --- a/CalPlayer/CalamityPlayerNetcode.cs +++ b/CalPlayer/CalamityPlayerNetcode.cs @@ -1,4 +1,4 @@ -using CalamityMod.UI.CooldownIndicators; +using CalamityMod.Cooldowns; using System; using System.IO; using Terraria; @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.CalPlayer { - public partial class CalamityPlayer : ModPlayer + public partial class CalamityPlayer : ModPlayer { #region Standard Syncs internal const int GlobalSyncPacketTimer = 15; @@ -157,15 +157,15 @@ namespace CalamityMod.CalPlayer //Already being synced when it gets created and then when it expires if (cooldownID == "") { - foreach (string key in CooldownIndicator.IDtoType.Keys) + foreach (string key in Cooldown.IDtoType.Keys) { ModPacket packet = mod.GetPacket(); packet.Write((byte)CalamityModMessageType.CooldownSync); packet.Write(player.whoAmI); packet.Write(key); int timer = 0; - if (Cooldowns.Exists(cooldown => cooldown.GetType() == CooldownIndicator.IDtoType[key])) - timer = Cooldowns.Find(cooldown => cooldown.GetType() == CooldownIndicator.IDtoType[key]).TimeLeft; + if (Cooldowns.Exists(cooldown => cooldown.GetType() == Cooldown.IDtoType[key])) + timer = Cooldowns.Find(cooldown => cooldown.GetType() == Cooldown.IDtoType[key]).TimeLeft; packet.Write(timer); player.SendPacket(packet, server); } @@ -178,8 +178,8 @@ namespace CalamityMod.CalPlayer packet.Write(player.whoAmI); packet.Write(cooldownID); int timer = 0; - if (Cooldowns.Exists(cooldown => cooldown.GetType() == CooldownIndicator.IDtoType[cooldownID])) - timer = Cooldowns.Find(cooldown => cooldown.GetType() == CooldownIndicator.IDtoType[cooldownID]).TimeLeft; + if (Cooldowns.Exists(cooldown => cooldown.GetType() == Cooldown.IDtoType[cooldownID])) + timer = Cooldowns.Find(cooldown => cooldown.GetType() == Cooldown.IDtoType[cooldownID]).TimeLeft; packet.Write(timer); player.SendPacket(packet, server); } @@ -338,7 +338,7 @@ namespace CalamityMod.CalPlayer { string syncID = reader.ReadString(); int timer = reader.ReadInt32(); - Type cooldownType = CooldownIndicator.IDtoType[syncID]; + Type cooldownType = Cooldown.IDtoType[syncID]; // If this cooldown is present, edit the existing cooldown's timer. if (Cooldowns.Exists(cooldown => cooldown.GetType() == cooldownType)) @@ -346,7 +346,7 @@ namespace CalamityMod.CalPlayer // Otherwise create a new cooldown with this timer. else if (timer > 0) - Cooldowns.Add((CooldownIndicator)Activator.CreateInstance(cooldownType, timer, player)); + Cooldowns.Add((Cooldown)Activator.CreateInstance(cooldownType, timer, player)); if (Main.netMode == NetmodeID.Server) SyncCooldown(true); diff --git a/CalamityMod.cs b/CalamityMod.cs index 30702657c0..82a106367e 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -2,6 +2,7 @@ using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; +using CalamityMod.Cooldowns; using CalamityMod.DataStructures; using CalamityMod.Effects; using CalamityMod.Events; @@ -74,7 +75,7 @@ using Terraria.UI; namespace CalamityMod { - public class CalamityMod : Mod + public class CalamityMod : Mod { // CONSIDER -- I have been advised by Jopo that Mods should never contain static variables // TODO -- 1.4 fixes the crit reforge price calculation bug, so GetWeaponCrit everywhere can go. @@ -217,7 +218,7 @@ namespace CalamityMod GeneralParticleHandler.Load(); } - CooldownIndicator.Load(); + Cooldown.Load(); BossRushEvent.Load(); BossHealthBarManager.Load(this); DraedonStructures.Load(); @@ -397,7 +398,7 @@ namespace CalamityMod CustomLavaManagement.Unload(); BossHealthBarManager.Unload(); DraedonStructures.Unload(); - CooldownIndicator.Unload(); + Cooldown.Unload(); TileFraming.Unload(); diff --git a/UI/CooldownIndicators/AbyssEvade.png b/Cooldowns/AbyssEvade.png similarity index 100% rename from UI/CooldownIndicators/AbyssEvade.png rename to Cooldowns/AbyssEvade.png diff --git a/UI/CooldownIndicators/AbyssEvadeOutline.png b/Cooldowns/AbyssEvadeOutline.png similarity index 100% rename from UI/CooldownIndicators/AbyssEvadeOutline.png rename to Cooldowns/AbyssEvadeOutline.png diff --git a/UI/CooldownIndicators/AbyssEvadeOverlay.png b/Cooldowns/AbyssEvadeOverlay.png similarity index 100% rename from UI/CooldownIndicators/AbyssEvadeOverlay.png rename to Cooldowns/AbyssEvadeOverlay.png diff --git a/UI/CooldownIndicators/AbyssalDivingSuitBreakingPlates.png b/Cooldowns/AbyssalDivingSuitBreakingPlates.png similarity index 100% rename from UI/CooldownIndicators/AbyssalDivingSuitBreakingPlates.png rename to Cooldowns/AbyssalDivingSuitBreakingPlates.png diff --git a/UI/CooldownIndicators/AbyssalDivingSuitBrokenPlates.png b/Cooldowns/AbyssalDivingSuitBrokenPlates.png similarity index 100% rename from UI/CooldownIndicators/AbyssalDivingSuitBrokenPlates.png rename to Cooldowns/AbyssalDivingSuitBrokenPlates.png diff --git a/UI/CooldownIndicators/AbyssalDivingSuitBrokenPlatesOutline.png b/Cooldowns/AbyssalDivingSuitBrokenPlatesOutline.png similarity index 100% rename from UI/CooldownIndicators/AbyssalDivingSuitBrokenPlatesOutline.png rename to Cooldowns/AbyssalDivingSuitBrokenPlatesOutline.png diff --git a/UI/CooldownIndicators/AbyssalDivingSuitBrokenPlatesOverlay.png b/Cooldowns/AbyssalDivingSuitBrokenPlatesOverlay.png similarity index 100% rename from UI/CooldownIndicators/AbyssalDivingSuitBrokenPlatesOverlay.png rename to Cooldowns/AbyssalDivingSuitBrokenPlatesOverlay.png diff --git a/Cooldowns/AbyssalDivingSuitCooldowns.cs b/Cooldowns/AbyssalDivingSuitCooldowns.cs new file mode 100644 index 0000000000..3f8ad788b5 --- /dev/null +++ b/Cooldowns/AbyssalDivingSuitCooldowns.cs @@ -0,0 +1,68 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using static CalamityMod.CalamityUtils; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class DivingPlatesBreaking : Cooldown + { + private static Color phase0Color = new Color(147, 218, 183); + private static Color phase1Color = new Color(233, 190, 134); + private static Color phase2Color = new Color(220, 111, 94); + private static Color ringColorLerpStart = new Color(160, 174, 174); + private static Color ringColorLerpEnd = new Color(192, 11, 107); + + public override bool CanTickDown(CooldownInstance instance) => !instance.player.Calamity().abyssalDivingSuit; + public override bool ShouldDisplay(CooldownInstance instance) => instance.player.Calamity().abyssalDivingSuit; + public override string DisplayName(CooldownInstance instance) => "Abyssal Diving Suit Plates Durability"; + public override string Texture => "CalamityMod/Cooldowns/AbyssalDivingSuitBreakingPlates"; + public override string OutlineTexture => "CalamityMod/Cooldowns/AbyssalDivingSuitBrokenPlatesOutline"; + public override string OverlayTexture => "CalamityMod/Cooldowns/AbyssalDivingSuitBrokenPlatesOverlay"; + public override Color GetOutlineColor(CooldownInstance instance) + { + if (instance.timeLeft == 0) + return phase0Color; + else if (instance.timeLeft == 1) + return phase1Color; + return phase2Color; + } + public override Color GetCooldownStartColor(CooldownInstance instance) => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + public override Color GetCooldownEndColor(CooldownInstance instance) => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + + public override bool UseCustomCompactDraw => true; + + public override void DrawCompact(CooldownInstance instance, SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + Texture2D sprite = GetTexture(Texture); + Texture2D outline = GetTexture(OutlineTexture); + Color outlineColor = GetOutlineColor(instance); + Color startColor = GetCooldownStartColor(instance); + + //Draw the outline + spriteBatch.Draw(outline, position, null, outlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); + //Draw the icon + spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + DrawBorderStringEightWay(spriteBatch, Main.fontMouseText, (3 - instance.timeLeft).ToString(), position + new Vector2(-3, -3) * scale, startColor, Color.Black, scale); + } + } + + public class DivingPlatesBroken : Cooldown + { + private static Color outlineColor = new Color(194, 173, 146); + private static Color ringColorLerpStart = new Color(91, 121, 150); + private static Color ringColorLerpEnd = new Color(30, 50, 77); + + public override string ID => "AbyssalDivingBrokenPlates"; + public override bool ShouldDisplay(CooldownInstance instance) => true; + public override string DisplayName(CooldownInstance instance) => "Abyssal Diving Suit Broken Plates"; + public override string Texture => "CalamityMod/Cooldowns/AbyssalDivingSuitBrokenPlates"; + public override Color GetOutlineColor(CooldownInstance instance) => outlineColor; + public override Color GetCooldownStartColor(CooldownInstance instance) => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + public override Color GetCooldownEndColor(CooldownInstance instance) => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + + public override void OnCompleted(CooldownInstance instance) => instance.player.Calamity().abyssalDivingSuitPlateHits = 0; + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/AbyssalMadness.png b/Cooldowns/AbyssalMadness.png similarity index 100% rename from UI/CooldownIndicators/AbyssalMadness.png rename to Cooldowns/AbyssalMadness.png diff --git a/UI/CooldownIndicators/AbyssalMadnessActive.png b/Cooldowns/AbyssalMadnessActive.png similarity index 100% rename from UI/CooldownIndicators/AbyssalMadnessActive.png rename to Cooldowns/AbyssalMadnessActive.png diff --git a/UI/CooldownIndicators/AbyssalMadnessCooldown.cs b/Cooldowns/AbyssalMadnessCooldown.cs similarity index 72% rename from UI/CooldownIndicators/AbyssalMadnessCooldown.cs rename to Cooldowns/AbyssalMadnessCooldown.cs index a3ab177088..3a2bec5006 100644 --- a/UI/CooldownIndicators/AbyssalMadnessCooldown.cs +++ b/Cooldowns/AbyssalMadnessCooldown.cs @@ -1,36 +1,32 @@ -using CalamityMod.DataStructures; +using CalamityMod.Cooldowns; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; -using System.Linq; using Terraria; using Terraria.Audio; using Terraria.Graphics.Shaders; using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class OmegaBlueCooldown : CooldownIndicator + public class OmegaBlueCooldown : Cooldown { - public override string SyncID => "OmegaBlue"; - public override bool DisplayMe => true; - public override string Name => TimeLeft > 1500 ? "Abyssal Madness" : "Abyssal Madness Cooldown"; + public override string ID => "OmegaBlue"; + public override bool ShouldDisplay(CooldownInstance instance) => true; + public override string DisplayName(CooldownInstance instance) => instance.timeLeft > 1500 ? "Abyssal Madness" : "Abyssal Madness Cooldown"; public override string Texture => TimeLeft > 1500 ? "CalamityMod/UI/CooldownIndicators/AbyssalMadnessActive" : "CalamityMod/UI/CooldownIndicators/AbyssalMadness"; - public override string TextureOutline => "CalamityMod/UI/CooldownIndicators/AbyssalMadnessOutline"; - public override string TextureOverlay => "CalamityMod/UI/CooldownIndicators/AbyssalMadnessOverlay"; + public override string OutlineTexture => "CalamityMod/UI/CooldownIndicators/AbyssalMadnessOutline"; + public override string OverlayTexture => "CalamityMod/UI/CooldownIndicators/AbyssalMadnessOverlay"; public override Color OutlineColor => TimeLeft > 1500 ? new Color(231, 164, 1) : new Color(72, 135, 205); - public override Color CooldownColorStart => TimeLeft > 1500 ? Color.Lerp(new Color(98, 110, 179), new Color(216, 176, 80), (TimeLeft - 1500) / 300f) : new Color(98, 110, 179); - public override Color CooldownColorEnd => TimeLeft > 1500 ? Color.Lerp(new Color(179, 132, 98), new Color(216, 176, 80), (TimeLeft - 1500) / 300f) : new Color(179, 132, 98); + public override Color CooldownStartColor => TimeLeft > 1500 ? Color.Lerp(new Color(98, 110, 179), new Color(216, 176, 80), (TimeLeft - 1500) / 300f) : new Color(98, 110, 179); + public override Color CooldownEndColor => TimeLeft > 1500 ? Color.Lerp(new Color(179, 132, 98), new Color(216, 176, 80), (TimeLeft - 1500) / 300f) : new Color(179, 132, 98); public override LegacySoundStyle EndSound => AfflictedPlayer.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/OmegaBlueRecharge"); public OmegaBlueCooldown(int duration, Player player) : base(duration, player) { } - public override void OnCooldownEnd() + public override void OnCompleted() { for (int i = 0; i < 66; i++) { @@ -50,18 +46,18 @@ namespace CalamityMod.UI.CooldownIndicators //Use the adjusted completion GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity); GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion); - GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownColorStart); - GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownColorEnd); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor); GameShaders.Misc["CalamityMod:CircularBarShader"].Apply(); } - public override bool UseCustomDrawCompact => true; + public override bool UseCustomCompactDraw => true; - public override void CustomDrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) { Texture2D sprite = GetTexture(Texture); - Texture2D outline = GetTexture(TextureOutline); - Texture2D overlay = GetTexture(TextureOverlay); + Texture2D outline = GetTexture(OutlineTexture); + Texture2D overlay = GetTexture(OverlayTexture); //Draw the outline spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); diff --git a/UI/CooldownIndicators/AbyssalMadnessOutline.png b/Cooldowns/AbyssalMadnessOutline.png similarity index 100% rename from UI/CooldownIndicators/AbyssalMadnessOutline.png rename to Cooldowns/AbyssalMadnessOutline.png diff --git a/UI/CooldownIndicators/AbyssalMadnessOverlay.png b/Cooldowns/AbyssalMadnessOverlay.png similarity index 100% rename from UI/CooldownIndicators/AbyssalMadnessOverlay.png rename to Cooldowns/AbyssalMadnessOverlay.png diff --git a/UI/CooldownIndicators/BarBase.png b/Cooldowns/BarBase.png similarity index 100% rename from UI/CooldownIndicators/BarBase.png rename to Cooldowns/BarBase.png diff --git a/UI/CooldownIndicators/BloodGodTotem.png b/Cooldowns/BloodGodTotem.png similarity index 100% rename from UI/CooldownIndicators/BloodGodTotem.png rename to Cooldowns/BloodGodTotem.png diff --git a/UI/CooldownIndicators/BloodGodTotemOutline.png b/Cooldowns/BloodGodTotemOutline.png similarity index 100% rename from UI/CooldownIndicators/BloodGodTotemOutline.png rename to Cooldowns/BloodGodTotemOutline.png diff --git a/UI/CooldownIndicators/BloodGodTotemOverlay.png b/Cooldowns/BloodGodTotemOverlay.png similarity index 100% rename from UI/CooldownIndicators/BloodGodTotemOverlay.png rename to Cooldowns/BloodGodTotemOverlay.png diff --git a/UI/CooldownIndicators/BloodflareFrenzy.png b/Cooldowns/BloodflareFrenzy.png similarity index 100% rename from UI/CooldownIndicators/BloodflareFrenzy.png rename to Cooldowns/BloodflareFrenzy.png diff --git a/Cooldowns/BloodflareFrenzyCooldown.cs b/Cooldowns/BloodflareFrenzyCooldown.cs new file mode 100644 index 0000000000..2873ef0ecc --- /dev/null +++ b/Cooldowns/BloodflareFrenzyCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class BloodflareFrenzyCooldown : Cooldown + { + public override string ID => "BloodflareFrenzy"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Blood Frenzy Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/BloodflareFrenzy"; + public override Color OutlineColor => new Color(229, 171, 124); + public override Color CooldownStartColor => Color.Lerp(new Color(149, 127, 109), new Color(220, 101, 101), 1 - Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(149, 127, 109), new Color(220, 101, 101), 1 - Completion); + + public BloodflareFrenzyCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/BloodflareFrenzyOutline.png b/Cooldowns/BloodflareFrenzyOutline.png similarity index 100% rename from UI/CooldownIndicators/BloodflareFrenzyOutline.png rename to Cooldowns/BloodflareFrenzyOutline.png diff --git a/UI/CooldownIndicators/BloodflareFrenzyOverlay.png b/Cooldowns/BloodflareFrenzyOverlay.png similarity index 100% rename from UI/CooldownIndicators/BloodflareFrenzyOverlay.png rename to Cooldowns/BloodflareFrenzyOverlay.png diff --git a/UI/CooldownIndicators/BloodflareSoul.png b/Cooldowns/BloodflareSoul.png similarity index 100% rename from UI/CooldownIndicators/BloodflareSoul.png rename to Cooldowns/BloodflareSoul.png diff --git a/Cooldowns/BloodflareSoulCooldown.cs b/Cooldowns/BloodflareSoulCooldown.cs new file mode 100644 index 0000000000..25fae8032c --- /dev/null +++ b/Cooldowns/BloodflareSoulCooldown.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; + +namespace CalamityMod.Cooldowns +{ + public class BloodflareSoulCooldown : Cooldown + { + public override string SyncID => "BloodflareSoul"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Bloodflare Soul Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/BloodflareSoul"; + public override Color OutlineColor => new Color(255, 205, 219); + public override Color CooldownStartColor => new Color(216, 60, 90); + public override Color CooldownEndColor => new Color(251, 106, 150); + + public override LegacySoundStyle EndSound => AfflictedPlayer.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/BloodflareRangerRecharge"); + + public BloodflareSoulCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/BloodflareSoulOutline.png b/Cooldowns/BloodflareSoulOutline.png similarity index 100% rename from UI/CooldownIndicators/BloodflareSoulOutline.png rename to Cooldowns/BloodflareSoulOutline.png diff --git a/UI/CooldownIndicators/BloodflareSoulOverlay.png b/Cooldowns/BloodflareSoulOverlay.png similarity index 100% rename from UI/CooldownIndicators/BloodflareSoulOverlay.png rename to Cooldowns/BloodflareSoulOverlay.png diff --git a/UI/CooldownIndicators/BlunderBooster.png b/Cooldowns/BlunderBooster.png similarity index 100% rename from UI/CooldownIndicators/BlunderBooster.png rename to Cooldowns/BlunderBooster.png diff --git a/UI/CooldownIndicators/BlunderBoosterOutline.png b/Cooldowns/BlunderBoosterOutline.png similarity index 100% rename from UI/CooldownIndicators/BlunderBoosterOutline.png rename to Cooldowns/BlunderBoosterOutline.png diff --git a/UI/CooldownIndicators/BlunderBoosterOverlay.png b/Cooldowns/BlunderBoosterOverlay.png similarity index 100% rename from UI/CooldownIndicators/BlunderBoosterOverlay.png rename to Cooldowns/BlunderBoosterOverlay.png diff --git a/UI/CooldownIndicators/BrimflameFrenzy.png b/Cooldowns/BrimflameFrenzy.png similarity index 100% rename from UI/CooldownIndicators/BrimflameFrenzy.png rename to Cooldowns/BrimflameFrenzy.png diff --git a/UI/CooldownIndicators/BrimflameFrenzyCooldown.cs b/Cooldowns/BrimflameFrenzyCooldown.cs similarity index 56% rename from UI/CooldownIndicators/BrimflameFrenzyCooldown.cs rename to Cooldowns/BrimflameFrenzyCooldown.cs index 6c7e4b9c25..8729dd5203 100644 --- a/UI/CooldownIndicators/BrimflameFrenzyCooldown.cs +++ b/Cooldowns/BrimflameFrenzyCooldown.cs @@ -1,28 +1,20 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; using Terraria; using Terraria.Audio; -using Terraria.Graphics.Shaders; using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -using Terraria.ModLoader; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class BrimflameFrenzyCooldown : CooldownIndicator + public class BrimflameFrenzyCooldown : Cooldown { public override string SyncID => "BrimflameFrenzy"; - public override bool DisplayMe => true; - public override string Name => "Brimflame Frenzy Cooldown"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Brimflame Frenzy Cooldown"; public override string Texture => "CalamityMod/UI/CooldownIndicators/BrimflameFrenzy"; public override Color OutlineColor => new Color(211, 124, 93); - public override Color CooldownColorStart => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - Completion); + public override Color CooldownStartColor => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - Completion); public override LegacySoundStyle EndSound => AfflictedPlayer.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/BrimflameRecharge"); @@ -30,12 +22,12 @@ namespace CalamityMod.UI.CooldownIndicators { } - public override bool UseCustomDraw => true; + public override bool UseCustomExpandedDraw => true; //Add red eyes to the icon - public override void CustomDraw(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) { - base.CustomDraw(spriteBatch, position, opacity, scale); + base.DrawExpanded(spriteBatch, position, opacity, scale); Texture2D sprite = GetTexture(Texture + "Eyes"); //Draw the icon diff --git a/UI/CooldownIndicators/BrimflameFrenzyEyes.png b/Cooldowns/BrimflameFrenzyEyes.png similarity index 100% rename from UI/CooldownIndicators/BrimflameFrenzyEyes.png rename to Cooldowns/BrimflameFrenzyEyes.png diff --git a/UI/CooldownIndicators/BrimflameFrenzyOutline.png b/Cooldowns/BrimflameFrenzyOutline.png similarity index 100% rename from UI/CooldownIndicators/BrimflameFrenzyOutline.png rename to Cooldowns/BrimflameFrenzyOutline.png diff --git a/UI/CooldownIndicators/BrimflameFrenzyOverlay.png b/Cooldowns/BrimflameFrenzyOverlay.png similarity index 100% rename from UI/CooldownIndicators/BrimflameFrenzyOverlay.png rename to Cooldowns/BrimflameFrenzyOverlay.png diff --git a/UI/CooldownIndicators/ChaosState.png b/Cooldowns/ChaosState.png similarity index 100% rename from UI/CooldownIndicators/ChaosState.png rename to Cooldowns/ChaosState.png diff --git a/UI/CooldownIndicators/ChaosStateDisplay.cs b/Cooldowns/ChaosStateDisplay.cs similarity index 67% rename from UI/CooldownIndicators/ChaosStateDisplay.cs rename to Cooldowns/ChaosStateDisplay.cs index 1646451639..453d4d86ab 100644 --- a/UI/CooldownIndicators/ChaosStateDisplay.cs +++ b/Cooldowns/ChaosStateDisplay.cs @@ -1,26 +1,16 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class ChaosStateDisplay : CooldownIndicator + public class ChaosStateDisplay : Cooldown { - public override bool DisplayMe => CalamityConfig.Instance.VanillaCooldownDisplay && AfflictedPlayer.chaosState; - public override string Name => "Teleportation Cooldown"; + public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && AfflictedPlayer.chaosState; + public override string DisplayName => "Teleportation Cooldown"; public override string Texture => "CalamityMod/UI/CooldownIndicators/ChaosState" + skinTexture; public override Color OutlineColor => outlineColor; - public override Color CooldownColorStart => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); - public override Color CooldownColorEnd => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); + public override Color CooldownStartColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); + public override Color CooldownEndColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); //It's the same cooldown with different skins each time, basically. public string skinTexture; diff --git a/UI/CooldownIndicators/ChaosStateNR.png b/Cooldowns/ChaosStateNR.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateNR.png rename to Cooldowns/ChaosStateNR.png diff --git a/UI/CooldownIndicators/ChaosStateNROutline.png b/Cooldowns/ChaosStateNROutline.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateNROutline.png rename to Cooldowns/ChaosStateNROutline.png diff --git a/UI/CooldownIndicators/ChaosStateNROverlay.png b/Cooldowns/ChaosStateNROverlay.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateNROverlay.png rename to Cooldowns/ChaosStateNROverlay.png diff --git a/UI/CooldownIndicators/ChaosStateOutline.png b/Cooldowns/ChaosStateOutline.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateOutline.png rename to Cooldowns/ChaosStateOutline.png diff --git a/UI/CooldownIndicators/ChaosStateOverlay.png b/Cooldowns/ChaosStateOverlay.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateOverlay.png rename to Cooldowns/ChaosStateOverlay.png diff --git a/UI/CooldownIndicators/ChaosStateVeil.png b/Cooldowns/ChaosStateVeil.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateVeil.png rename to Cooldowns/ChaosStateVeil.png diff --git a/UI/CooldownIndicators/ChaosStateVeilOutline.png b/Cooldowns/ChaosStateVeilOutline.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateVeilOutline.png rename to Cooldowns/ChaosStateVeilOutline.png diff --git a/UI/CooldownIndicators/ChaosStateVeilOverlay.png b/Cooldowns/ChaosStateVeilOverlay.png similarity index 100% rename from UI/CooldownIndicators/ChaosStateVeilOverlay.png rename to Cooldowns/ChaosStateVeilOverlay.png diff --git a/Cooldowns/Cooldown.cs b/Cooldowns/Cooldown.cs new file mode 100644 index 0000000000..5f33629b70 --- /dev/null +++ b/Cooldowns/Cooldown.cs @@ -0,0 +1,191 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ModLoader; + +namespace CalamityMod.Cooldowns +{ + public abstract class Cooldown + { + // Do not ever change this value. It is set when a cooldown is registered. + internal ushort netID; + + /// + /// Unique string ID of the cooldown. You can set this to whatever you want. + /// + public virtual string ID => ""; + + /// + /// This method runs once every frame while the cooldown is active. + /// + public virtual void Tick(CooldownInstance instance) { } + + /// + /// This method runs when the cooldown ends naturally. It is not called if the cooldown is deleted because the player died. + /// + public virtual void OnCompleted(CooldownInstance instance) { } + + /// + /// Determines whether the cooldown can currently tick down.
+ /// For example, this is useful for cooldowns that don't tick down if there are any bosses alive.
+ /// You can also use it so that cooldowns which persist through death do not tick down while the player is dead. + ///
+ public virtual bool CanTickDown(CooldownInstance instance) => true; + + /// + /// Set this to true to make this cooldown remain even when the player dies.
+ /// All cooldowns with PersistsThroughDeath set to false disappear immediately when the player dies. + ///
+ public virtual bool PersistsThroughDeath => false; + + /// + /// When the cooldown ends, this sound is played. Leave at null for no sound. + /// + public virtual LegacySoundStyle EndSound => null; + + /// + /// Whether or not this cooldown should appear in the cooldown rack UI. + /// + public virtual bool ShouldDisplay(CooldownInstance instance) => true; + + /// + /// The name of the cooldown, appears when the player hovers over the indicator + /// + public virtual string DisplayName(CooldownInstance instance) => ""; + + /// + /// The texture of the cooldown indicator.
+ /// These must be 20x20 pixels when at 2x2 scale. + ///
+ public virtual string Texture => ""; + /// + /// This texture is overlaid atop the cooldown when the cooldown rack is rendering in compact mode. + /// + public virtual string OverlayTexture => $"{Texture}Overlay"; + /// + /// This outline texture is rendered around the base icon texture. + /// + public virtual string OutlineTexture => $"{Texture}Outline"; + + internal static string DefaultChargeBarTexture = "CalamityMod/Cooldowns/BarBase"; + /// + /// The texture of this cooldown's "charge bar", or the circle rendered by shaders.
+ /// This is only used when the cooldown rack is rendering in expanded mode and when UseCustomExpandedDraw is set to false.
+ /// These must be 44x44 pixels when at 2x2 scale. + ///
+ public virtual string ChargeBarTexture => DefaultChargeBarTexture; + /// + /// The background texture of this cooldown's "charge bar", or the circle rendered by shaders.
+ /// This is only used when the cooldown rack is rendering in expanded mode and when UseCustomExpandedDraw is set to false.
+ /// Leave it as the default to have nothing render underneath the charge bar itself.
+ /// These must be 44x44 pixels when at 2x2 scale. + ///
+ public virtual string ChargeBarBackTexture => DefaultChargeBarTexture; + + /// + /// The color used for the icon outline when rendering in expanded mode.
+ /// In compact mode, this color is used for the overlay that goes above the icon. + ///
+ public virtual Color GetOutlineColor(CooldownInstance instance) => Color.White; + /// + /// The color used for the start of the circular cooldown timer rendered by shaders.
+ /// This color is only used when drawing in expanded mode and is ignored if a charge bar texture is provided. + ///
+ public virtual Color GetCooldownStartColor(CooldownInstance instance) => Color.Gray; + + /// + /// The color used for the end of the circular cooldown timer rendered by shaders.
+ /// This color is only used when drawing in expanded mode and is ignored if a charge bar texture is provided. + ///
+ public virtual Color GetCooldownEndColor(CooldownInstance instance) => Color.White; + + /// + /// Set this to true to disable default drawing and instead call the function DrawExpanded.
+ /// This only applies when the cooldown rack is rendering in expanded mode. + ///
+ public virtual bool UseCustomExpandedDraw => false; + + /// + /// This method is called to render the cooldown when the cooldown rack is in expanded mode and UseCustomExpandedDraw is set to true. + /// + public virtual void DrawExpanded(CooldownInstance instance, SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + Texture2D sprite = ModContent.GetTexture(Texture); + Texture2D outline = ModContent.GetTexture(OutlineTexture); + Texture2D barBase = ModContent.GetTexture(ChargeBarTexture); + Color outlineColor = GetOutlineColor(instance); + + //Draw the ring + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + ApplyBarShaders(instance, opacity); + + spriteBatch.Draw(barBase, position, null, Color.White * opacity, 0, barBase.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Main.UIScaleMatrix); + + //Draw the outline + spriteBatch.Draw(outline, position, null, outlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + //Draw the icon + spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + } + + /// + /// Set this to true to disable default drawing and instead call the function DrawCompact.
+ /// This only applies when the cooldown rack is rendering in compact mode. + ///
+ public virtual bool UseCustomCompactDraw => false; + + /// + /// This method is called to render the cooldown when the cooldown rack is in compact mode and UseCustomCompactDraw is set to true. + /// + public virtual void DrawCompact(CooldownInstance instance, SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + Texture2D sprite = ModContent.GetTexture(Texture); + Texture2D outline = ModContent.GetTexture(OutlineTexture); + Texture2D overlay = ModContent.GetTexture(OverlayTexture); + Color outlineColor = GetOutlineColor(instance); + + //Draw the outline + spriteBatch.Draw(outline, position, null, outlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + //Draw the icon + spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + //Draw the small overlay + int lostHeight = (int)Math.Ceiling(overlay.Height * (1 - instance.Completion)); + Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight); + spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, outlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + } + + /// + /// Renders the circular cooldown timer with a radial shader. This method is only called if UseCustomDraw is set to false.
+ /// If the charge bar texture is defined, it is used. Otherwise it renders a flat ring which slides from the start color to the end color. + ///
+ public virtual void ApplyBarShaders(CooldownInstance instance, float opacity) + { + if (ChargeBarTexture == DefaultChargeBarTexture) + { + Color startColor = GetCooldownStartColor(instance); + Color endColor = GetCooldownEndColor(instance); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(1 - instance.Completion); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(startColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(endColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].Apply(); + } + else + { + GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].SetShaderTexture(ModContent.GetTexture(ChargeBarBackTexture)); + GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].UseOpacity(opacity); + GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].UseSaturation(1 - instance.Completion); + GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].Apply(); + } + } + } +} diff --git a/Cooldowns/CooldownInstance.cs b/Cooldowns/CooldownInstance.cs new file mode 100644 index 0000000000..5749f00cd6 --- /dev/null +++ b/Cooldowns/CooldownInstance.cs @@ -0,0 +1,52 @@ +using System.IO; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public struct CooldownInstance + { + /// + /// The netID of the cooldown represented by this cooldown instance.
+ /// This is used to look up gameplay behavior and rendering behavior as the cooldown instance is used in the game engine. + ///
+ internal ushort netID; + + /// + /// The player that the cooldown is applying to + /// + public Player player; + + /// + /// The total, original duration of the cooldown. This value is in frames, 60 per second. + /// + public int duration; + + /// + /// The remaining duration of the cooldown. This value is in frames, 60 per second. + /// + public int timeLeft; + + /// + /// A ratio of how "completed" an instance of a cooldown is. + /// + public float Completion => duration != 0 ? timeLeft / (float)duration : 0; + + internal void Write(BinaryWriter writer) + { + writer.Write(netID); + byte playerIDByte = (byte)player.whoAmI; + writer.Write(playerIDByte); + writer.Write(duration); + writer.Write(timeLeft); + } + + internal void Read(BinaryReader reader) + { + netID = reader.ReadUInt16(); + byte playerIDByte = reader.ReadByte(); + player = Main.player[playerIDByte]; + duration = reader.ReadInt32(); + timeLeft = reader.ReadInt32(); + } + } +} diff --git a/UI/CooldownIndicators/CooldownRackUI.cs b/Cooldowns/CooldownRackUI.cs similarity index 78% rename from UI/CooldownIndicators/CooldownRackUI.cs rename to Cooldowns/CooldownRackUI.cs index f972984424..17edafc2b1 100644 --- a/UI/CooldownIndicators/CooldownRackUI.cs +++ b/Cooldowns/CooldownRackUI.cs @@ -1,5 +1,3 @@ -using CalamityMod.CalPlayer; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -7,13 +5,13 @@ using System.Collections.Generic; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { public class CooldownRackUI { public static int MaxLargeIcons = 10; - public static bool CompactIcons => Main.LocalPlayer.Calamity().Cooldowns.FindAll(cooldown => cooldown.DisplayMe).Count > MaxLargeIcons || CalamityConfig.Instance.CooldownDisplay == 1; + public static bool CompactIcons => Main.LocalPlayer.Calamity().Cooldowns.FindAll(cooldown => cooldown.ShouldDisplay).Count > MaxLargeIcons || CalamityConfig.Instance.CooldownDisplay == 1; public static Vector2 Spacing => CompactIcons ? Vector2.UnitX * Main.UIScale * 28f : Vector2.UnitX * Main.UIScale * 46f; @@ -26,7 +24,7 @@ namespace CalamityMod.UI.CooldownIndicators if (Main.playerInventory || CalamityConfig.Instance.CooldownDisplay < 1) return; - List cooldownsToDraw = Main.LocalPlayer.Calamity().Cooldowns.FindAll(cooldown => cooldown.DisplayMe); + List cooldownsToDraw = Main.LocalPlayer.Calamity().Cooldowns.FindAll(cooldown => cooldown.ShouldDisplay); if (cooldownsToDraw.Count == 0) return; @@ -39,7 +37,7 @@ namespace CalamityMod.UI.CooldownIndicators string mouseHover = ""; - foreach (CooldownIndicator cd in cooldownsToDraw) + foreach (Cooldown cd in cooldownsToDraw) { float iconOpacity = (float)Math.Sin(Main.GlobalTime) * 0.1f + 0.6f; @@ -48,16 +46,16 @@ namespace CalamityMod.UI.CooldownIndicators if (iconRectangle.Intersects(mouse)) { - mouseHover = cd.Name; + mouseHover = cd.DisplayName; iconOpacity = MathHelper.Clamp((float)Math.Sin(Main.GlobalTime % MathHelper.Pi) * 2f, 0, 1) * 0.1f + 0.9f; } - if ((cd.UseCustomDraw && !CompactIcons) || (cd.UseCustomDrawCompact && CompactIcons)) + if ((cd.UseCustomExpandedDraw && !CompactIcons) || (cd.UseCustomCompactDraw && CompactIcons)) { if (CompactIcons) - cd.CustomDrawCompact(spriteBatch, displayPosition, iconOpacity, uiScale); + cd.DrawCompact(spriteBatch, displayPosition, iconOpacity, uiScale); else - cd.CustomDraw(spriteBatch, displayPosition, iconOpacity, uiScale); + cd.DrawExpanded(spriteBatch, displayPosition, iconOpacity, uiScale); } else @@ -75,10 +73,10 @@ namespace CalamityMod.UI.CooldownIndicators } - public static void DrawIndividualIcon(CooldownIndicator cooldown, SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + public static void DrawIndividualIcon(Cooldown cooldown, SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) { Texture2D sprite = ModContent.GetTexture(cooldown.Texture); - Texture2D outline = ModContent.GetTexture(cooldown.TextureOutline); + Texture2D outline = ModContent.GetTexture(cooldown.OutlineTexture); Texture2D barBase = ModContent.GetTexture(cooldown.ChargeBarTexture); //Draw the ring @@ -103,7 +101,7 @@ namespace CalamityMod.UI.CooldownIndicators //Draw the small overlay if (CompactIcons) { - Texture2D overlay = ModContent.GetTexture(cooldown.TextureOverlay); + Texture2D overlay = ModContent.GetTexture(cooldown.OverlayTexture); int lostHeight = (int)Math.Ceiling(overlay.Height * (1 - cooldown.Completion)); Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight); diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs new file mode 100644 index 0000000000..11f6a8a595 --- /dev/null +++ b/Cooldowns/CooldownRegistry.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; + +namespace CalamityMod.Cooldowns +{ + public static class CooldownRegistry + { + // Indexed by ushort netID. Contains every registered cooldown. + // Cooldowns are given netIDs when they are registered. + // Cooldowns are useless until they are registered. + public static Cooldown[] registry; + private const ushort defaultSize = 256; + private static ushort nextCDNetID = 0; + + private static Dictionary nameToNetID = null; + + public static void Load() + { + registry = new Cooldown[defaultSize]; + nameToNetID = new Dictionary(defaultSize); + } + + public static void Unload() + { + registry = null; + nameToNetID?.Clear(); + nameToNetID = null; + } + + /// + /// Registers a cooldown for use in netcode. Cooldowns are useless until this has been done. + /// + /// + /// + public static bool Register(Cooldown cd) + { + int currentMaxID = registry.Length; + + // This case only happens when you cap out at 65,536 cooldown registrations (which should never occur). + // It just stops you from registering more cooldowns. + if (nextCDNetID == currentMaxID) + return false; + + cd.netID = nextCDNetID; + nameToNetID[cd.ID] = cd.netID; + ++nextCDNetID; + + // If the end of the array is reached, double its size. + if (nextCDNetID == currentMaxID && currentMaxID < ushort.MaxValue) + { + Cooldown[] largerArray = new Cooldown[currentMaxID * 2]; + for (int i = 0; i < currentMaxID; ++i) + largerArray[i] = registry[i]; + + registry = largerArray; + } + return true; + } + } +} diff --git a/UI/CooldownIndicators/CounterScarf.png b/Cooldowns/CounterScarf.png similarity index 100% rename from UI/CooldownIndicators/CounterScarf.png rename to Cooldowns/CounterScarf.png diff --git a/Cooldowns/CounterScarfCooldown.cs b/Cooldowns/CounterScarfCooldown.cs new file mode 100644 index 0000000000..71bf618801 --- /dev/null +++ b/Cooldowns/CounterScarfCooldown.cs @@ -0,0 +1,22 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class CounterScarfCooldown : Cooldown + { + public override string SyncID => "CounterScarf"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Scarf Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/CounterScarf"; + public override Color OutlineColor => Color.Lerp(new Color(255, 115, 178), new Color(255, 76, 76), (float)Math.Sin(Main.GlobalTime * 2f) * 0.5f + 0.5f); + public override Color CooldownStartColor => new Color(194, 75, 97); + public override Color CooldownEndColor => new Color(255, 76, 76); + + + public CounterScarfCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/CounterScarfOutline.png b/Cooldowns/CounterScarfOutline.png similarity index 100% rename from UI/CooldownIndicators/CounterScarfOutline.png rename to Cooldowns/CounterScarfOutline.png diff --git a/UI/CooldownIndicators/CounterScarfOverlay.png b/Cooldowns/CounterScarfOverlay.png similarity index 100% rename from UI/CooldownIndicators/CounterScarfOverlay.png rename to Cooldowns/CounterScarfOverlay.png diff --git a/Cooldowns/DivineBlessCooldown.cs b/Cooldowns/DivineBlessCooldown.cs new file mode 100644 index 0000000000..af7fa1b3da --- /dev/null +++ b/Cooldowns/DivineBlessCooldown.cs @@ -0,0 +1,29 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class DivineBlessCooldown : Cooldown + { + public override string SyncID => "DivineBless"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Divine Bless Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/DivineRecharge"; + public override Color OutlineColor => new Color(233, 192, 68); + public override Color CooldownStartColor => new Color(177, 105, 33); + public override Color CooldownEndColor => new Color(233, 192, 68); + + + public DivineBlessCooldown(int duration, Player player) : base(duration, player) + { + } + + public override void OnCompleted() + { + if (AfflictedPlayer.whoAmI == Main.myPlayer) + Projectile.NewProjectile(AfflictedPlayer.Center, Vector2.Zero, ProjectileType(), 0, 0f, AfflictedPlayer.whoAmI); + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/DivineRecharge.png b/Cooldowns/DivineRecharge.png similarity index 100% rename from UI/CooldownIndicators/DivineRecharge.png rename to Cooldowns/DivineRecharge.png diff --git a/UI/CooldownIndicators/DivineRechargeOutline.png b/Cooldowns/DivineRechargeOutline.png similarity index 100% rename from UI/CooldownIndicators/DivineRechargeOutline.png rename to Cooldowns/DivineRechargeOutline.png diff --git a/UI/CooldownIndicators/DivineRechargeOverlay.png b/Cooldowns/DivineRechargeOverlay.png similarity index 100% rename from UI/CooldownIndicators/DivineRechargeOverlay.png rename to Cooldowns/DivineRechargeOverlay.png diff --git a/UI/CooldownIndicators/DraconicElixir.png b/Cooldowns/DraconicElixir.png similarity index 100% rename from UI/CooldownIndicators/DraconicElixir.png rename to Cooldowns/DraconicElixir.png diff --git a/Cooldowns/DraconicElixirCooldown.cs b/Cooldowns/DraconicElixirCooldown.cs new file mode 100644 index 0000000000..604e706b9b --- /dev/null +++ b/Cooldowns/DraconicElixirCooldown.cs @@ -0,0 +1,22 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class DraconicElixirCooldown : Cooldown + { + public override string SyncID => "DraconicElixir"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Draconic Surge Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/DraconicElixir"; + public override Color OutlineColor => Color.Lerp(new Color(141, 199, 90), new Color(221, 187, 106), (float)Math.Sin(Main.GlobalTime) * 0.5f + 0.5f); + public override Color CooldownStartColor => new Color(165, 22, 46); + public override Color CooldownEndColor => new Color(216, 103, 43); + + + public DraconicElixirCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/DraconicElixirOutline.png b/Cooldowns/DraconicElixirOutline.png similarity index 100% rename from UI/CooldownIndicators/DraconicElixirOutline.png rename to Cooldowns/DraconicElixirOutline.png diff --git a/UI/CooldownIndicators/DraconicElixirOverlay.png b/Cooldowns/DraconicElixirOverlay.png similarity index 100% rename from UI/CooldownIndicators/DraconicElixirOverlay.png rename to Cooldowns/DraconicElixirOverlay.png diff --git a/UI/CooldownIndicators/EclipseEvade.png b/Cooldowns/EclipseEvade.png similarity index 100% rename from UI/CooldownIndicators/EclipseEvade.png rename to Cooldowns/EclipseEvade.png diff --git a/UI/CooldownIndicators/EclipseEvadeOutline.png b/Cooldowns/EclipseEvadeOutline.png similarity index 100% rename from UI/CooldownIndicators/EclipseEvadeOutline.png rename to Cooldowns/EclipseEvadeOutline.png diff --git a/UI/CooldownIndicators/EclipseEvadeOverlay.png b/Cooldowns/EclipseEvadeOverlay.png similarity index 100% rename from UI/CooldownIndicators/EclipseEvadeOverlay.png rename to Cooldowns/EclipseEvadeOverlay.png diff --git a/UI/CooldownIndicators/EvasionScarf.png b/Cooldowns/EvasionScarf.png similarity index 100% rename from UI/CooldownIndicators/EvasionScarf.png rename to Cooldowns/EvasionScarf.png diff --git a/Cooldowns/EvasionScarfCooldown.cs b/Cooldowns/EvasionScarfCooldown.cs new file mode 100644 index 0000000000..7a7382c553 --- /dev/null +++ b/Cooldowns/EvasionScarfCooldown.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class EvasionScarfCooldown : Cooldown + { + public override string SyncID => "EvasionScarf"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Scarf Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/EvasionScarf"; + public override Color OutlineColor => Color.Lerp(new Color(255, 194, 150), new Color(255, 160, 150), (float)Math.Sin(Main.GlobalTime * 2f) * 0.5f + 0.5f); + public override Color CooldownStartColor => new Color(132, 23, 32); + public override Color CooldownEndColor => new Color(164, 52, 45); + + public EvasionScarfCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/EvasionScarfOutline.png b/Cooldowns/EvasionScarfOutline.png similarity index 100% rename from UI/CooldownIndicators/EvasionScarfOutline.png rename to Cooldowns/EvasionScarfOutline.png diff --git a/UI/CooldownIndicators/EvasionScarfOverlay.png b/Cooldowns/EvasionScarfOverlay.png similarity index 100% rename from UI/CooldownIndicators/EvasionScarfOverlay.png rename to Cooldowns/EvasionScarfOverlay.png diff --git a/UI/CooldownIndicators/FleshTotem.png b/Cooldowns/FleshTotem.png similarity index 100% rename from UI/CooldownIndicators/FleshTotem.png rename to Cooldowns/FleshTotem.png diff --git a/UI/CooldownIndicators/FleshTotemCooldown.cs b/Cooldowns/FleshTotemCooldown.cs similarity index 64% rename from UI/CooldownIndicators/FleshTotemCooldown.cs rename to Cooldowns/FleshTotemCooldown.cs index ca9ad9b492..dc1ae80492 100644 --- a/UI/CooldownIndicators/FleshTotemCooldown.cs +++ b/Cooldowns/FleshTotemCooldown.cs @@ -1,27 +1,17 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class FleshTotemCooldown : CooldownIndicator + public class FleshTotemCooldown : Cooldown { public override string SyncID => "FleshTotem"; - public override bool DisplayMe => true; - public override string Name => "Contact Damage Halving Cooldown"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Contact Damage Halving Cooldown"; public override string Texture => "CalamityMod/UI/CooldownIndicators/" + skinTexture; public override Color OutlineColor => outlineColor; - public override Color CooldownColorStart => cooldownColorStart; - public override Color CooldownColorEnd => cooldownColorEnd; + public override Color CooldownStartColor => cooldownColorStart; + public override Color CooldownEndColor => cooldownColorEnd; //It's the same cooldown with different skins each time, basically. public string skinTexture; diff --git a/UI/CooldownIndicators/FleshTotemOutline.png b/Cooldowns/FleshTotemOutline.png similarity index 100% rename from UI/CooldownIndicators/FleshTotemOutline.png rename to Cooldowns/FleshTotemOutline.png diff --git a/UI/CooldownIndicators/FleshTotemOverlay.png b/Cooldowns/FleshTotemOverlay.png similarity index 100% rename from UI/CooldownIndicators/FleshTotemOverlay.png rename to Cooldowns/FleshTotemOverlay.png diff --git a/UI/CooldownIndicators/GlobalDodge.png b/Cooldowns/GlobalDodge.png similarity index 100% rename from UI/CooldownIndicators/GlobalDodge.png rename to Cooldowns/GlobalDodge.png diff --git a/UI/CooldownIndicators/GlobalDodgeCooldown.cs b/Cooldowns/GlobalDodgeCooldown.cs similarity index 69% rename from UI/CooldownIndicators/GlobalDodgeCooldown.cs rename to Cooldowns/GlobalDodgeCooldown.cs index e62917e12b..c60aed3eba 100644 --- a/UI/CooldownIndicators/GlobalDodgeCooldown.cs +++ b/Cooldowns/GlobalDodgeCooldown.cs @@ -1,27 +1,17 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class GlobalDodgeCooldown : CooldownIndicator + public class GlobalDodgeCooldown : Cooldown { public override string SyncID => "GlobalDodge"; - public override bool DisplayMe => true; - public override string Name => "Dodge Cooldown"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Dodge Cooldown"; public override string Texture => "CalamityMod/UI/CooldownIndicators/" + skinTexture; public override Color OutlineColor => outlineColor; - public override Color CooldownColorStart => cooldownColorStart; - public override Color CooldownColorEnd => cooldownColorEnd; + public override Color CooldownStartColor => cooldownColorStart; + public override Color CooldownEndColor => cooldownColorEnd; //It's the same cooldown with different skins each time, basically. public string skinTexture; diff --git a/UI/CooldownIndicators/GlobalDodgeOutline.png b/Cooldowns/GlobalDodgeOutline.png similarity index 100% rename from UI/CooldownIndicators/GlobalDodgeOutline.png rename to Cooldowns/GlobalDodgeOutline.png diff --git a/UI/CooldownIndicators/GlobalDodgeOverlay.png b/Cooldowns/GlobalDodgeOverlay.png similarity index 100% rename from UI/CooldownIndicators/GlobalDodgeOverlay.png rename to Cooldowns/GlobalDodgeOverlay.png diff --git a/UI/CooldownIndicators/GodslayerDash.png b/Cooldowns/GodslayerDash.png similarity index 100% rename from UI/CooldownIndicators/GodslayerDash.png rename to Cooldowns/GodslayerDash.png diff --git a/Cooldowns/GodslayerDashCooldown.cs b/Cooldowns/GodslayerDashCooldown.cs new file mode 100644 index 0000000000..7e019d1159 --- /dev/null +++ b/Cooldowns/GodslayerDashCooldown.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class GodslayerDashCooldown : Cooldown + { + public override string SyncID => "GodslayerDash"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Godslayer Dash Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/GodslayerDash"; + public override Color OutlineColor => Color.Lerp(new Color(173, 66, 203), new Color(252, 109, 202), Completion); + public override Color CooldownStartColor => new Color(252, 109, 202); + public override Color CooldownEndColor => new Color(119, 254, 254); + + + public GodslayerDashCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/GodslayerDashOutline.png b/Cooldowns/GodslayerDashOutline.png similarity index 100% rename from UI/CooldownIndicators/GodslayerDashOutline.png rename to Cooldowns/GodslayerDashOutline.png diff --git a/UI/CooldownIndicators/GodslayerDashOverlay.png b/Cooldowns/GodslayerDashOverlay.png similarity index 100% rename from UI/CooldownIndicators/GodslayerDashOverlay.png rename to Cooldowns/GodslayerDashOverlay.png diff --git a/UI/CooldownIndicators/InkBomb.png b/Cooldowns/InkBomb.png similarity index 100% rename from UI/CooldownIndicators/InkBomb.png rename to Cooldowns/InkBomb.png diff --git a/Cooldowns/InkBombCooldown.cs b/Cooldowns/InkBombCooldown.cs new file mode 100644 index 0000000000..bc74ca39c3 --- /dev/null +++ b/Cooldowns/InkBombCooldown.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class InkBombCooldown : Cooldown + { + public override string SyncID => "InkBomb"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Ink Bomb Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/InkBomb"; + public override Color OutlineColor => new Color(205, 182, 137); + public override Color CooldownStartColor => Color.Lerp(new Color(177, 147, 89), new Color(105, 103, 126), Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(177, 147, 89), new Color(105, 103, 126), Completion); + + + public InkBombCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/InkBombOutline.png b/Cooldowns/InkBombOutline.png similarity index 100% rename from UI/CooldownIndicators/InkBombOutline.png rename to Cooldowns/InkBombOutline.png diff --git a/UI/CooldownIndicators/InkBombOverlay.png b/Cooldowns/InkBombOverlay.png similarity index 100% rename from UI/CooldownIndicators/InkBombOverlay.png rename to Cooldowns/InkBombOverlay.png diff --git a/UI/CooldownIndicators/JetpackCooldown.cs b/Cooldowns/JetpackCooldown.cs similarity index 67% rename from UI/CooldownIndicators/JetpackCooldown.cs rename to Cooldowns/JetpackCooldown.cs index 46e835e4b9..fc4a2c441f 100644 --- a/UI/CooldownIndicators/JetpackCooldown.cs +++ b/Cooldowns/JetpackCooldown.cs @@ -1,26 +1,17 @@ -using CalamityMod.DataStructures; +using CalamityMod.Cooldowns; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class JetpackCooldown : CooldownIndicator + public class JetpackCooldown : Cooldown { - public override bool DisplayMe => true; - public override string Name => "Jet Boost Cooldown"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Jet Boost Cooldown"; public override string Texture => "CalamityMod/UI/CooldownIndicators/" + skinTexture; public override Color OutlineColor => outlineColor; - public override Color CooldownColorStart => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); - public override Color CooldownColorEnd => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); + public override Color CooldownStartColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); + public override Color CooldownEndColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - Completion); //It's the same cooldown with different skins each time, basically. public string skinTexture; diff --git a/UI/CooldownIndicators/LionHeartShield.png b/Cooldowns/LionHeartShield.png similarity index 100% rename from UI/CooldownIndicators/LionHeartShield.png rename to Cooldowns/LionHeartShield.png diff --git a/UI/CooldownIndicators/LionHeartShieldOutline.png b/Cooldowns/LionHeartShieldOutline.png similarity index 100% rename from UI/CooldownIndicators/LionHeartShieldOutline.png rename to Cooldowns/LionHeartShieldOutline.png diff --git a/UI/CooldownIndicators/LionHeartShieldOverlay.png b/Cooldowns/LionHeartShieldOverlay.png similarity index 100% rename from UI/CooldownIndicators/LionHeartShieldOverlay.png rename to Cooldowns/LionHeartShieldOverlay.png diff --git a/Cooldowns/LionsHeartShieldCooldown.cs b/Cooldowns/LionsHeartShieldCooldown.cs new file mode 100644 index 0000000000..7656e33f15 --- /dev/null +++ b/Cooldowns/LionsHeartShieldCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class LionHeartShieldCooldown : Cooldown + { + public override string SyncID => "LionHeartShield"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Energy Shell Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/LionHeartShield"; + public override Color OutlineColor => new Color(232, 239, 239); + public override Color CooldownStartColor => new Color(17, 242, 244); + public override Color CooldownEndColor => Color.White; + + public LionHeartShieldCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/NebulousCore.png b/Cooldowns/NebulousCore.png similarity index 100% rename from UI/CooldownIndicators/NebulousCore.png rename to Cooldowns/NebulousCore.png diff --git a/Cooldowns/NebulousCoreCooldown.cs b/Cooldowns/NebulousCoreCooldown.cs new file mode 100644 index 0000000000..17475a5490 --- /dev/null +++ b/Cooldowns/NebulousCoreCooldown.cs @@ -0,0 +1,19 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class NebulousCoreCooldown : Cooldown + { + public override bool ShouldDisplay => true; + public override string DisplayName => "Nebulous Core Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/NebulousCore"; + public override Color OutlineColor => Color.Lerp(new Color(252, 109, 203), new Color(58, 91, 146), Completion); + public override Color CooldownStartColor => new Color(148, 62, 216); + public override Color CooldownEndColor => new Color(255, 187, 207); + + public NebulousCoreCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/NebulousCoreOutline.png b/Cooldowns/NebulousCoreOutline.png similarity index 100% rename from UI/CooldownIndicators/NebulousCoreOutline.png rename to Cooldowns/NebulousCoreOutline.png diff --git a/UI/CooldownIndicators/NebulousCoreOverlay.png b/Cooldowns/NebulousCoreOverlay.png similarity index 100% rename from UI/CooldownIndicators/NebulousCoreOverlay.png rename to Cooldowns/NebulousCoreOverlay.png diff --git a/UI/CooldownIndicators/PermafrostConcoction.png b/Cooldowns/PermafrostConcoction.png similarity index 100% rename from UI/CooldownIndicators/PermafrostConcoction.png rename to Cooldowns/PermafrostConcoction.png diff --git a/Cooldowns/PermafrostConcoctionCooldown.cs b/Cooldowns/PermafrostConcoctionCooldown.cs new file mode 100644 index 0000000000..914c6e8fe3 --- /dev/null +++ b/Cooldowns/PermafrostConcoctionCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class PermafrostConcoctionCooldown : Cooldown + { + public override string SyncID => "ConcoctionCooldown"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Permafrost's Concoction Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/PermafrostConcoction"; + public override Color OutlineColor => new Color(0, 218, 255); + public override Color CooldownStartColor => new Color(144, 184, 205); + public override Color CooldownEndColor => new Color(232, 246, 254); + + public PermafrostConcoctionCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/PermafrostConcoctionOutline.png b/Cooldowns/PermafrostConcoctionOutline.png similarity index 100% rename from UI/CooldownIndicators/PermafrostConcoctionOutline.png rename to Cooldowns/PermafrostConcoctionOutline.png diff --git a/UI/CooldownIndicators/PermafrostConcoctionOverlay.png b/Cooldowns/PermafrostConcoctionOverlay.png similarity index 100% rename from UI/CooldownIndicators/PermafrostConcoctionOverlay.png rename to Cooldowns/PermafrostConcoctionOverlay.png diff --git a/UI/CooldownIndicators/PlagueBlackout.png b/Cooldowns/PlagueBlackout.png similarity index 100% rename from UI/CooldownIndicators/PlagueBlackout.png rename to Cooldowns/PlagueBlackout.png diff --git a/UI/CooldownIndicators/PlagueBlackoutCooldown.cs b/Cooldowns/PlagueBlackoutCooldown.cs similarity index 56% rename from UI/CooldownIndicators/PlagueBlackoutCooldown.cs rename to Cooldowns/PlagueBlackoutCooldown.cs index d30c04cd30..82644e6efd 100644 --- a/UI/CooldownIndicators/PlagueBlackoutCooldown.cs +++ b/Cooldowns/PlagueBlackoutCooldown.cs @@ -1,27 +1,18 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -namespace CalamityMod.UI.CooldownIndicators +namespace CalamityMod.Cooldowns { - public class PlagueBlackoutCooldown : CooldownIndicator + public class PlagueBlackoutCooldown : Cooldown { public override string SyncID => "PlagueBlackout"; - public override bool DisplayMe => TimeLeft <= 1500; - public override string Name => "Plague Blackout Cooldown"; + public override bool ShouldDisplay => TimeLeft <= 1500; + public override string DisplayName => "Plague Blackout Cooldown"; public override string Texture => "CalamityMod/UI/CooldownIndicators/PlagueBlackout"; public override Color OutlineColor => new Color(174, 237, 122); - public override Color CooldownColorStart => Color.DarkSlateGray; - public override Color CooldownColorEnd => Color.DarkSlateGray; + public override Color CooldownStartColor => Color.DarkSlateGray; + public override Color CooldownEndColor => Color.DarkSlateGray; public override LegacySoundStyle EndSound => AfflictedPlayer.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/PlagueReaperRecharge"); public PlagueBlackoutCooldown(int duration, Player player) : base(duration, player) @@ -29,7 +20,7 @@ namespace CalamityMod.UI.CooldownIndicators Duration = 1500; } - public override void OnCooldownEnd() + public override void OnCompleted() { for (int i = 0; i < 66; i++) { diff --git a/UI/CooldownIndicators/PlagueBlackoutOutline.png b/Cooldowns/PlagueBlackoutOutline.png similarity index 100% rename from UI/CooldownIndicators/PlagueBlackoutOutline.png rename to Cooldowns/PlagueBlackoutOutline.png diff --git a/UI/CooldownIndicators/PlagueBlackoutOverlay.png b/Cooldowns/PlagueBlackoutOverlay.png similarity index 100% rename from UI/CooldownIndicators/PlagueBlackoutOverlay.png rename to Cooldowns/PlagueBlackoutOverlay.png diff --git a/UI/CooldownIndicators/PlaguedFuelPack.png b/Cooldowns/PlaguedFuelPack.png similarity index 100% rename from UI/CooldownIndicators/PlaguedFuelPack.png rename to Cooldowns/PlaguedFuelPack.png diff --git a/UI/CooldownIndicators/PlaguedFuelPackOutline.png b/Cooldowns/PlaguedFuelPackOutline.png similarity index 100% rename from UI/CooldownIndicators/PlaguedFuelPackOutline.png rename to Cooldowns/PlaguedFuelPackOutline.png diff --git a/UI/CooldownIndicators/PlaguedFuelPackOverlay.png b/Cooldowns/PlaguedFuelPackOverlay.png similarity index 100% rename from UI/CooldownIndicators/PlaguedFuelPackOverlay.png rename to Cooldowns/PlaguedFuelPackOverlay.png diff --git a/UI/CooldownIndicators/PotionSickness.png b/Cooldowns/PotionSickness.png similarity index 100% rename from UI/CooldownIndicators/PotionSickness.png rename to Cooldowns/PotionSickness.png diff --git a/Cooldowns/PotionSicknessDisplay.cs b/Cooldowns/PotionSicknessDisplay.cs new file mode 100644 index 0000000000..f7e37f934e --- /dev/null +++ b/Cooldowns/PotionSicknessDisplay.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class PotionSicknessDisplay : Cooldown + { + public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && AfflictedPlayer.potionDelay > 0; + public override string DisplayName => "Healing Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/PotionSickness"; + public override Color OutlineColor => new Color(255, 142, 165); + public override Color CooldownStartColor => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), Completion); + + + public PotionSicknessDisplay(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/PotionSicknessOutline.png b/Cooldowns/PotionSicknessOutline.png similarity index 100% rename from UI/CooldownIndicators/PotionSicknessOutline.png rename to Cooldowns/PotionSicknessOutline.png diff --git a/UI/CooldownIndicators/PotionSicknessOverlay.png b/Cooldowns/PotionSicknessOverlay.png similarity index 100% rename from UI/CooldownIndicators/PotionSicknessOverlay.png rename to Cooldowns/PotionSicknessOverlay.png diff --git a/UI/CooldownIndicators/PrismaticLaser.png b/Cooldowns/PrismaticLaser.png similarity index 100% rename from UI/CooldownIndicators/PrismaticLaser.png rename to Cooldowns/PrismaticLaser.png diff --git a/Cooldowns/PrismaticLaserCooldown.cs b/Cooldowns/PrismaticLaserCooldown.cs new file mode 100644 index 0000000000..2a58488668 --- /dev/null +++ b/Cooldowns/PrismaticLaserCooldown.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Cooldowns +{ + public class PrismaticLaserCooldown : Cooldown + { + public override string SyncID => "PrismaticLaser"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Prismatic Laser Barrage Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/PrismaticLaser"; + public override Color OutlineColor => rainbowMode; + public override Color CooldownStartColor => rainbowMode; + public override Color CooldownEndColor => rainbowMode; + + internal Color rainbowMode => MulticolorLerp(Main.GlobalTime * 0.3f % 1, new Color[] { new Color(103, 244, 251), new Color(255, 167, 236), new Color(255, 225, 136) }); + + public PrismaticLaserCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/PrismaticLaserOutline.png b/Cooldowns/PrismaticLaserOutline.png similarity index 100% rename from UI/CooldownIndicators/PrismaticLaserOutline.png rename to Cooldowns/PrismaticLaserOutline.png diff --git a/UI/CooldownIndicators/PrismaticLaserOverlay.png b/Cooldowns/PrismaticLaserOverlay.png similarity index 100% rename from UI/CooldownIndicators/PrismaticLaserOverlay.png rename to Cooldowns/PrismaticLaserOverlay.png diff --git a/UI/CooldownIndicators/ProfanedSoulArtifact.png b/Cooldowns/ProfanedSoulArtifact.png similarity index 100% rename from UI/CooldownIndicators/ProfanedSoulArtifact.png rename to Cooldowns/ProfanedSoulArtifact.png diff --git a/Cooldowns/ProfanedSoulArtifactCooldown.cs b/Cooldowns/ProfanedSoulArtifactCooldown.cs new file mode 100644 index 0000000000..cfce5d5606 --- /dev/null +++ b/Cooldowns/ProfanedSoulArtifactCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class ProfanedSoulArtifactCooldown : Cooldown + { + public override string SyncID => "PSABurnout"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Soul Artifact Burn Out"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/ProfanedSoulArtifact"; + public override Color OutlineColor => new Color(255, 191, 73); + public override Color CooldownStartColor => new Color(181, 136, 177); + public override Color CooldownEndColor => new Color(255, 194, 161); + + public ProfanedSoulArtifactCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/ProfanedSoulArtifactOutline.png b/Cooldowns/ProfanedSoulArtifactOutline.png similarity index 100% rename from UI/CooldownIndicators/ProfanedSoulArtifactOutline.png rename to Cooldowns/ProfanedSoulArtifactOutline.png diff --git a/UI/CooldownIndicators/ProfanedSoulArtifactOverlay.png b/Cooldowns/ProfanedSoulArtifactOverlay.png similarity index 100% rename from UI/CooldownIndicators/ProfanedSoulArtifactOverlay.png rename to Cooldowns/ProfanedSoulArtifactOverlay.png diff --git a/UI/CooldownIndicators/RelicOfResilience.png b/Cooldowns/RelicOfResilience.png similarity index 100% rename from UI/CooldownIndicators/RelicOfResilience.png rename to Cooldowns/RelicOfResilience.png diff --git a/Cooldowns/RelicOfResilienceCooldown.cs b/Cooldowns/RelicOfResilienceCooldown.cs new file mode 100644 index 0000000000..7b64b0339a --- /dev/null +++ b/Cooldowns/RelicOfResilienceCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class RelicOfResilienceCooldown : Cooldown + { + public override string SyncID => "RelicOfResilience"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Relic of Resilience Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/RelicOfResilience"; + public override Color OutlineColor => new Color(255, 191, 73); + public override Color CooldownStartColor => new Color(122, 66, 59); + public override Color CooldownEndColor => new Color(165, 103, 87); + + public RelicOfResilienceCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/RelicOfResilienceOutline.png b/Cooldowns/RelicOfResilienceOutline.png similarity index 100% rename from UI/CooldownIndicators/RelicOfResilienceOutline.png rename to Cooldowns/RelicOfResilienceOutline.png diff --git a/UI/CooldownIndicators/RelicOfResilienceOverlay.png b/Cooldowns/RelicOfResilienceOverlay.png similarity index 100% rename from UI/CooldownIndicators/RelicOfResilienceOverlay.png rename to Cooldowns/RelicOfResilienceOverlay.png diff --git a/UI/CooldownIndicators/SandCloak.png b/Cooldowns/SandCloak.png similarity index 100% rename from UI/CooldownIndicators/SandCloak.png rename to Cooldowns/SandCloak.png diff --git a/Cooldowns/SandCloakCooldown.cs b/Cooldowns/SandCloakCooldown.cs new file mode 100644 index 0000000000..8f9937c345 --- /dev/null +++ b/Cooldowns/SandCloakCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class SandCloakCooldown : Cooldown + { + public override bool ShouldDisplay => true; + public override string DisplayName => "Sand Cloak Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/SandCloak"; + public override Color OutlineColor => new Color(209, 176, 114); + public override Color CooldownStartColor => new Color(100, 64, 44); + public override Color CooldownEndColor => new Color(132, 95, 54); + + + public SandCloakCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/SandCloakOutline.png b/Cooldowns/SandCloakOutline.png similarity index 100% rename from UI/CooldownIndicators/SandCloakOutline.png rename to Cooldowns/SandCloakOutline.png diff --git a/UI/CooldownIndicators/SandCloakOverlay.png b/Cooldowns/SandCloakOverlay.png similarity index 100% rename from UI/CooldownIndicators/SandCloakOverlay.png rename to Cooldowns/SandCloakOverlay.png diff --git a/UI/CooldownIndicators/SilvaRevive.png b/Cooldowns/SilvaRevive.png similarity index 100% rename from UI/CooldownIndicators/SilvaRevive.png rename to Cooldowns/SilvaRevive.png diff --git a/Cooldowns/SilvaReviveCooldown.cs b/Cooldowns/SilvaReviveCooldown.cs new file mode 100644 index 0000000000..60b299e5fe --- /dev/null +++ b/Cooldowns/SilvaReviveCooldown.cs @@ -0,0 +1,22 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class SilvaReviveCooldown : Cooldown + { + public override bool ShouldDisplay => true; + public override string DisplayName => "Silva Revive Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/SilvaRevive"; + public override Color OutlineColor => new Color(151, 211, 152); + public override Color CooldownStartColor => new Color(226, 188, 74); + public override Color CooldownEndColor => new Color(151, 211, 152); + + public override bool CanTickDown => !CalamityPlayer.areThereAnyDamnBosses && !CalamityPlayer.areThereAnyDamnEvents; + + public SilvaReviveCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/SilvaReviveOutline.png b/Cooldowns/SilvaReviveOutline.png similarity index 100% rename from UI/CooldownIndicators/SilvaReviveOutline.png rename to Cooldowns/SilvaReviveOutline.png diff --git a/UI/CooldownIndicators/SilvaReviveOverlay.png b/Cooldowns/SilvaReviveOverlay.png similarity index 100% rename from UI/CooldownIndicators/SilvaReviveOverlay.png rename to Cooldowns/SilvaReviveOverlay.png diff --git a/UI/CooldownIndicators/SirenIceShield.png b/Cooldowns/SirenIceShield.png similarity index 100% rename from UI/CooldownIndicators/SirenIceShield.png rename to Cooldowns/SirenIceShield.png diff --git a/Cooldowns/SirenIceShieldCooldown.cs b/Cooldowns/SirenIceShieldCooldown.cs new file mode 100644 index 0000000000..2404af9cee --- /dev/null +++ b/Cooldowns/SirenIceShieldCooldown.cs @@ -0,0 +1,22 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class SirenIceShieldCooldown : Cooldown + { + public override string SyncID => "SirenHeartShield"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Ice Shield Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/SirenIceShield"; + public override Color OutlineColor => Color.Lerp(new Color(163, 186, 198), new Color(146, 187, 255), (float)Math.Sin(Main.GlobalTime) * 0.5f + 0.5f); + public override Color CooldownStartColor => new Color(124, 195, 214); + public override Color CooldownEndColor => new Color(147, 230, 253); + + + public SirenIceShieldCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/SirenIceShieldOutline.png b/Cooldowns/SirenIceShieldOutline.png similarity index 100% rename from UI/CooldownIndicators/SirenIceShieldOutline.png rename to Cooldowns/SirenIceShieldOutline.png diff --git a/UI/CooldownIndicators/SirenIceShieldOverlay.png b/Cooldowns/SirenIceShieldOverlay.png similarity index 100% rename from UI/CooldownIndicators/SirenIceShieldOverlay.png rename to Cooldowns/SirenIceShieldOverlay.png diff --git a/UI/CooldownIndicators/TarragonCloak.png b/Cooldowns/TarragonCloak.png similarity index 100% rename from UI/CooldownIndicators/TarragonCloak.png rename to Cooldowns/TarragonCloak.png diff --git a/Cooldowns/TarragonCloakCooldown.cs b/Cooldowns/TarragonCloakCooldown.cs new file mode 100644 index 0000000000..df04565aa2 --- /dev/null +++ b/Cooldowns/TarragonCloakCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class TarragonCloakCooldown : Cooldown + { + public override string SyncID => "TarraCloak"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Tarragon Cloak Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/TarragonCloak"; + public override Color OutlineColor => new Color(158, 204, 173); + public override Color CooldownStartColor => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); + + public TarragonCloakCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/TarragonCloakOutline.png b/Cooldowns/TarragonCloakOutline.png similarity index 100% rename from UI/CooldownIndicators/TarragonCloakOutline.png rename to Cooldowns/TarragonCloakOutline.png diff --git a/UI/CooldownIndicators/TarragonCloakOverlay.png b/Cooldowns/TarragonCloakOverlay.png similarity index 100% rename from UI/CooldownIndicators/TarragonCloakOverlay.png rename to Cooldowns/TarragonCloakOverlay.png diff --git a/UI/CooldownIndicators/TarragonImmunity.png b/Cooldowns/TarragonImmunity.png similarity index 100% rename from UI/CooldownIndicators/TarragonImmunity.png rename to Cooldowns/TarragonImmunity.png diff --git a/Cooldowns/TarragonImmunityCooldown.cs b/Cooldowns/TarragonImmunityCooldown.cs new file mode 100644 index 0000000000..f30b8b1837 --- /dev/null +++ b/Cooldowns/TarragonImmunityCooldown.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Cooldowns +{ + public class TarragonImmunityCooldown : Cooldown + { + public override string SyncID => "TarraImmune"; + public override bool ShouldDisplay => true; + public override string DisplayName => "Tarragon Immunity Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/TarragonImmunity"; + public override Color OutlineColor => new Color(215, 182, 82); + public override Color CooldownStartColor => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); + + public TarragonImmunityCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/TarragonImmunityOutline.png b/Cooldowns/TarragonImmunityOutline.png similarity index 100% rename from UI/CooldownIndicators/TarragonImmunityOutline.png rename to Cooldowns/TarragonImmunityOutline.png diff --git a/UI/CooldownIndicators/TarragonImmunityOverlay.png b/Cooldowns/TarragonImmunityOverlay.png similarity index 100% rename from UI/CooldownIndicators/TarragonImmunityOverlay.png rename to Cooldowns/TarragonImmunityOverlay.png diff --git a/UI/CooldownIndicators/UniverseSplitter.png b/Cooldowns/UniverseSplitter.png similarity index 100% rename from UI/CooldownIndicators/UniverseSplitter.png rename to Cooldowns/UniverseSplitter.png diff --git a/Cooldowns/UniverseSplitterCooldown.cs b/Cooldowns/UniverseSplitterCooldown.cs new file mode 100644 index 0000000000..7245016a77 --- /dev/null +++ b/Cooldowns/UniverseSplitterCooldown.cs @@ -0,0 +1,22 @@ +using Microsoft.Xna.Framework; +using Terraria; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Cooldowns +{ + public class UniverseSplitterCooldown : Cooldown + { + public override bool ShouldDisplay => true; + public override string DisplayName => "Universe Splitter Cooldown"; + public override string Texture => "CalamityMod/UI/CooldownIndicators/UniverseSplitter"; + public override Color OutlineColor => rainbowMode; + public override Color CooldownStartColor => rainbowMode; + public override Color CooldownEndColor => rainbowMode; + + internal Color rainbowMode => MulticolorLerp(Main.GlobalTime * 0.3f % 1, new Color[] { new Color(236, 202, 255), new Color(192, 245, 255), new Color(255, 194, 205) }); + + public UniverseSplitterCooldown(int duration, Player player) : base(duration, player) + { + } + } +} \ No newline at end of file diff --git a/UI/CooldownIndicators/UniverseSplitterOutline.png b/Cooldowns/UniverseSplitterOutline.png similarity index 100% rename from UI/CooldownIndicators/UniverseSplitterOutline.png rename to Cooldowns/UniverseSplitterOutline.png diff --git a/UI/CooldownIndicators/UniverseSplitterOverlay.png b/Cooldowns/UniverseSplitterOverlay.png similarity index 100% rename from UI/CooldownIndicators/UniverseSplitterOverlay.png rename to Cooldowns/UniverseSplitterOverlay.png diff --git a/Items/Armor/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlueHelmet.cs index 76f5534e80..1bf8ceb64b 100644 --- a/Items/Armor/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlueHelmet.cs @@ -5,11 +5,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.UI.CooldownIndicators; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class OmegaBlueHelmet : ModItem { public override void SetStaticDefaults() diff --git a/UI/CooldownIndicators/AbyssalDivingSuitCooldowns.cs b/UI/CooldownIndicators/AbyssalDivingSuitCooldowns.cs deleted file mode 100644 index b44dc02623..0000000000 --- a/UI/CooldownIndicators/AbyssalDivingSuitCooldowns.cs +++ /dev/null @@ -1,68 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class DivingPlatesBreaking : CooldownIndicator - { - public override bool DisplayMe => AfflictedPlayer.Calamity().abyssalDivingSuit; - public override string Name => "Abyssal Diving Suit Plates Durability"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/AbyssalDivingSuitBreakingPlates"; - public override string TextureOutline => "CalamityMod/UI/CooldownIndicators/AbyssalDivingSuitBrokenPlatesOutline"; - public override string TextureOverlay => "CalamityMod/UI/CooldownIndicators/AbyssalDivingSuitBrokenPlatesOverlay"; - public override Color OutlineColor => TimeLeft == 0 ? new Color(147, 218, 183) : TimeLeft == 1 ? new Color(233, 190, 134) : new Color(220, 111, 94); - public override Color CooldownColorStart => Color.Lerp(new Color(160, 174, 174), new Color(192, 11, 107), Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(160, 174, 174), new Color(192, 11, 107), Completion); - public override bool CanTickDown => !AfflictedPlayer.Calamity().abyssalDivingSuit; - - public DivingPlatesBreaking(int duration, Player player) : base(duration, player) - { - } - - public override bool UseCustomDrawCompact => true; - - public override void CustomDrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) - { - Texture2D sprite = GetTexture(Texture); - Texture2D outline = GetTexture(TextureOutline); - - //Draw the outline - spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); - //Draw the icon - spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); - - DrawBorderStringEightWay(spriteBatch, Main.fontMouseText, (3 - TimeLeft).ToString(), position + new Vector2(-3, -3) * scale, CooldownColorStart, Color.Black, scale); - } - } - - public class DivingPlatesBroken : CooldownIndicator - { - public override string SyncID => "AbyssalDivingBrokenPlates"; - public override bool DisplayMe => true; - public override string Name => "Abyssal Diving Suit Broken Plates"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/AbyssalDivingSuitBrokenPlates"; - public override Color OutlineColor => new Color(194, 173, 146); - public override Color CooldownColorStart => Color.Lerp(new Color(91, 121, 150), new Color(30, 50, 77), Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(91, 121, 150), new Color(30, 50, 77), Completion); - - - public DivingPlatesBroken(int duration, Player player) : base(duration, player) - { - } - - public override void OnCooldownEnd() - { - AfflictedPlayer.Calamity().abyssalDivingSuitPlateHits = 0; - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/BloodflareFrenzyCooldown.cs b/UI/CooldownIndicators/BloodflareFrenzyCooldown.cs deleted file mode 100644 index c15c33bca2..0000000000 --- a/UI/CooldownIndicators/BloodflareFrenzyCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -using Terraria.ModLoader; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class BloodflareFrenzyCooldown : CooldownIndicator - { - public override string SyncID => "BloodflareFrenzy"; - public override bool DisplayMe => true; - public override string Name => "Blood Frenzy Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/BloodflareFrenzy"; - public override Color OutlineColor => new Color(229, 171, 124); - public override Color CooldownColorStart => Color.Lerp(new Color(149, 127, 109), new Color(220, 101, 101), 1 - Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(149, 127, 109), new Color(220, 101, 101), 1 - Completion); - - public BloodflareFrenzyCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/BloodflareSoulCooldown.cs b/UI/CooldownIndicators/BloodflareSoulCooldown.cs deleted file mode 100644 index 9c4c34ff71..0000000000 --- a/UI/CooldownIndicators/BloodflareSoulCooldown.cs +++ /dev/null @@ -1,33 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -using Terraria.ModLoader; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class BloodflareSoulCooldown : CooldownIndicator - { - public override string SyncID => "BloodflareSoul"; - public override bool DisplayMe => true; - public override string Name => "Bloodflare Soul Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/BloodflareSoul"; - public override Color OutlineColor => new Color(255, 205, 219); - public override Color CooldownColorStart => new Color(216, 60, 90); - public override Color CooldownColorEnd => new Color(251, 106, 150); - - public override LegacySoundStyle EndSound => AfflictedPlayer.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/BloodflareRangerRecharge"); - - public BloodflareSoulCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/CooldownIndicator.cs b/UI/CooldownIndicators/CooldownIndicator.cs deleted file mode 100644 index d596202011..0000000000 --- a/UI/CooldownIndicators/CooldownIndicator.cs +++ /dev/null @@ -1,232 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using CalamityMod.CalPlayer; -using Terraria.ModLoader; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class CooldownIndicator - { - public static Dictionary IDtoType; - - public static void Load() - { - Type baseCooldownType = typeof(CooldownIndicator); - CalamityMod calamity = ModContent.GetInstance(); - - IDtoType = new Dictionary(); - - foreach (Type type in calamity.Code.GetTypes()) - { - if (type.IsSubclassOf(baseCooldownType) && !type.IsAbstract && type != baseCooldownType) - { - CooldownIndicator instance = (CooldownIndicator)FormatterServices.GetUninitializedObject(type); - if (instance.SyncID != "") - IDtoType[instance.SyncID] = type; - } - } - } - - public static void Unload() - { - IDtoType = null; - } - - - /// - /// The player that the cooldown is applying to - /// - public Player AfflictedPlayer; - - /// - /// The ID of the cooldown for multiplayer syncing. Leave this string empty if you don't need multiplayer syncing - /// - public virtual string SyncID => ""; - - /// - /// Should the cooldown be displayed in the cooldown rack. - /// - public virtual bool DisplayMe => false; - - /// - /// The name of the cooldown, appears when the player hovers over the indicator - /// - public virtual string Name => ""; - /// - /// The texture of the cooldown indicator. For the sake of consistency, please keep the icons 20x20 (in 2x2) - /// - public virtual string Texture => ""; - /// - /// The overlay used above the base texture in compact mode - /// - public virtual string TextureOverlay => Texture + "Overlay"; - /// - /// The outline that goes around the icon - /// - public virtual string TextureOutline => Texture + "Outline"; - /// - /// The length of the cooldown - /// - public int Duration; - /// - /// Frames remaining before the cooldown ends - /// - public int TimeLeft; - - public float Completion => Duration != 0 ? TimeLeft / (float)Duration : 0; - - /// - /// Set this to true to disable default drawing, thus calling CustomDraw() instead. This only applies to the expanded mode of display - /// - public virtual bool UseCustomDraw => false; - /// - /// Use this method if you want to handle the drawing yourself. Only called if UseCustomDraw is set to true. - /// - public virtual void CustomDraw(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) - { - Texture2D sprite = ModContent.GetTexture(Texture); - Texture2D outline = ModContent.GetTexture(TextureOutline); - Texture2D barBase = ModContent.GetTexture(ChargeBarTexture); - - //Draw the ring - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); - ApplyBarShaders(opacity); - - spriteBatch.Draw(barBase, position, null, Color.White * opacity, 0, barBase.Size() * 0.5f, scale, SpriteEffects.None, 0f); - - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Main.UIScaleMatrix); - - //Draw the outline - spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); - - //Draw the icon - spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); - } - - /// - /// Set this to true to disable default drawing, thus calling CustomDraw()/CustomDrawCompact() instead. This only applies to the compact mode of display - /// - public virtual bool UseCustomDrawCompact => false; - /// - /// Use this method if you want to handle the drawing yourself. Only called if UseCustomDrawCompact is set to true. - /// - public virtual void CustomDrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) - { - Texture2D sprite = ModContent.GetTexture(Texture); - Texture2D outline = ModContent.GetTexture(TextureOutline); - Texture2D overlay = ModContent.GetTexture(TextureOverlay); - - //Draw the outline - spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); - - //Draw the icon - spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); - - //Draw the small overlay - int lostHeight = (int)Math.Ceiling(overlay.Height * (1 - Completion)); - Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight); - spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); - } - - /// - /// The texture of the charge bar. If set to a different texture path than the bar base, and if UseCustomDraw is set to false , it will be used as the ring around the cooldown icon - /// Please keep this sprite 44x44 (In 2x2) - /// - public virtual string ChargeBarTexture => "CalamityMod/UI/CooldownIndicators/BarBase"; - - /// - /// The texture under the charge bar. Will be used if ChargeBarTexture is set to an actual texture. Leave this as is to have nothing below the charge bar texture - /// Please keep this sprite 44x44 (In 2x2) - /// - public virtual string ChargeBarBackTexture => "CalamityMod/UI/CooldownIndicators/BarBase"; - - /// - /// Method used to determine the color of the outline around the icon, and the overlay that goes above the icon in compact mode - /// - public virtual Color OutlineColor => Color.White; - /// - /// The color of the bar as it starts going around the icon. Only used if no charge bar texture is provided - /// - public virtual Color CooldownColorStart => Color.Gray; - - /// - /// The color of the bar as it finishes going around the icon. Only used if no charge bar texture is provided - /// - public virtual Color CooldownColorEnd => Color.White; - - /// - /// Apply the shader that creates the bar. Only called if UseCustomDraw is set to false. By default just creates a flat ring with colors going from the start to the end color. - /// - public virtual void ApplyBarShaders(float opacity) - { - if (ChargeBarTexture == "CalamityMod/UI/CooldownIndicators/BarBase") - { - GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity); - GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(1 - Completion); - GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownColorStart); - GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownColorEnd); - GameShaders.Misc["CalamityMod:CircularBarShader"].Apply(); - } - - else - { - GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].SetShaderTexture(ModContent.GetTexture(ChargeBarBackTexture)); - GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].UseOpacity(opacity); - GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].UseSaturation(1 - Completion); - GameShaders.Misc["CalamityMod:CircularBarSpriteShader"].Apply(); - } - } - - /// - /// Determines if the cooldown can tick down. Useful for cooldowns that don't tick down when bosses are alive for example - /// - /// Wether or not the cooldown should tick down - public virtual bool CanTickDown => true; - - /// - /// The sound played when the cooldown time is over - /// - public virtual LegacySoundStyle EndSound => null; - - /// - /// Wether or not the cooldown should get reset when the player dies - /// - public virtual bool ResetOnDeath => true; - - public CooldownIndicator(int duration, Player player) - { - TimeLeft = duration; - Duration = duration; - AfflictedPlayer = player; - - //Sync the cooldown if needed - if (SyncID != "" && Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - player.Calamity().SyncCooldown(false, SyncID); - } - } - - /// - /// What happens when the cooldown is active - /// - public virtual void CooldownEffects() { } - - /// - /// What happens when the cooldown ends. Isn't called if the cooldown is removed by the player dying - /// - public virtual void OnCooldownEnd() { } - } -} diff --git a/UI/CooldownIndicators/CounterScarfCooldown.cs b/UI/CooldownIndicators/CounterScarfCooldown.cs deleted file mode 100644 index cae8f1c7dc..0000000000 --- a/UI/CooldownIndicators/CounterScarfCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class CounterScarfCooldown : CooldownIndicator - { - public override string SyncID => "CounterScarf"; - public override bool DisplayMe => true; - public override string Name => "Scarf Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/CounterScarf"; - public override Color OutlineColor => Color.Lerp(new Color(255, 115, 178), new Color(255, 76, 76), (float)Math.Sin(Main.GlobalTime * 2f) * 0.5f + 0.5f); - public override Color CooldownColorStart => new Color(194, 75, 97); - public override Color CooldownColorEnd => new Color(255, 76, 76); - - - public CounterScarfCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/DivineBlessCooldown.cs b/UI/CooldownIndicators/DivineBlessCooldown.cs deleted file mode 100644 index e4fe6c6061..0000000000 --- a/UI/CooldownIndicators/DivineBlessCooldown.cs +++ /dev/null @@ -1,38 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Typeless; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class DivineBlessCooldown : CooldownIndicator - { - public override string SyncID => "DivineBless"; - public override bool DisplayMe => true; - public override string Name => "Divine Bless Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/DivineRecharge"; - public override Color OutlineColor => new Color(233, 192, 68); - public override Color CooldownColorStart => new Color(177, 105, 33); - public override Color CooldownColorEnd => new Color(233, 192, 68); - - - public DivineBlessCooldown(int duration, Player player) : base(duration, player) - { - } - - public override void OnCooldownEnd() - { - if (AfflictedPlayer.whoAmI == Main.myPlayer) - Projectile.NewProjectile(AfflictedPlayer.Center, Vector2.Zero, ProjectileType(), 0, 0f, AfflictedPlayer.whoAmI); - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/DraconicElixirCooldown.cs b/UI/CooldownIndicators/DraconicElixirCooldown.cs deleted file mode 100644 index f92d82be38..0000000000 --- a/UI/CooldownIndicators/DraconicElixirCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class DraconicElixirCooldown : CooldownIndicator - { - public override string SyncID => "DraconicElixir"; - public override bool DisplayMe => true; - public override string Name => "Draconic Surge Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/DraconicElixir"; - public override Color OutlineColor => Color.Lerp(new Color(141, 199, 90), new Color(221, 187, 106), (float)Math.Sin(Main.GlobalTime) * 0.5f + 0.5f); - public override Color CooldownColorStart => new Color(165, 22, 46); - public override Color CooldownColorEnd => new Color(216, 103, 43); - - - public DraconicElixirCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/EvasionScarfCooldown.cs b/UI/CooldownIndicators/EvasionScarfCooldown.cs deleted file mode 100644 index 32d150c8b3..0000000000 --- a/UI/CooldownIndicators/EvasionScarfCooldown.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class EvasionScarfCooldown : CooldownIndicator - { - public override string SyncID => "EvasionScarf"; - public override bool DisplayMe => true; - public override string Name => "Scarf Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/EvasionScarf"; - public override Color OutlineColor => Color.Lerp(new Color(255, 194, 150), new Color(255, 160, 150), (float)Math.Sin(Main.GlobalTime * 2f) * 0.5f + 0.5f); - public override Color CooldownColorStart => new Color(132, 23, 32); - public override Color CooldownColorEnd => new Color(164, 52, 45); - - public EvasionScarfCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/GodslayerDashCooldown.cs b/UI/CooldownIndicators/GodslayerDashCooldown.cs deleted file mode 100644 index f04b863af4..0000000000 --- a/UI/CooldownIndicators/GodslayerDashCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class GodslayerDashCooldown : CooldownIndicator - { - public override string SyncID => "GodslayerDash"; - public override bool DisplayMe => true; - public override string Name => "Godslayer Dash Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/GodslayerDash"; - public override Color OutlineColor => Color.Lerp(new Color(173, 66, 203), new Color(252, 109, 202), Completion); - public override Color CooldownColorStart => new Color(252, 109, 202); - public override Color CooldownColorEnd => new Color(119, 254, 254); - - - public GodslayerDashCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/InkBombCooldown.cs b/UI/CooldownIndicators/InkBombCooldown.cs deleted file mode 100644 index ed35add3d8..0000000000 --- a/UI/CooldownIndicators/InkBombCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class InkBombCooldown : CooldownIndicator - { - public override string SyncID => "InkBomb"; - public override bool DisplayMe => true; - public override string Name => "Ink Bomb Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/InkBomb"; - public override Color OutlineColor => new Color(205, 182, 137); - public override Color CooldownColorStart => Color.Lerp(new Color(177, 147, 89), new Color(105, 103, 126), Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(177, 147, 89), new Color(105, 103, 126), Completion); - - - public InkBombCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/LionsHeartShieldCooldown.cs b/UI/CooldownIndicators/LionsHeartShieldCooldown.cs deleted file mode 100644 index 80d5b3d674..0000000000 --- a/UI/CooldownIndicators/LionsHeartShieldCooldown.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class LionHeartShieldCooldown : CooldownIndicator - { - public override string SyncID => "LionHeartShield"; - public override bool DisplayMe => true; - public override string Name => "Energy Shell Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/LionHeartShield"; - public override Color OutlineColor => new Color(232, 239, 239); - public override Color CooldownColorStart => new Color(17, 242, 244); - public override Color CooldownColorEnd => Color.White; - - public LionHeartShieldCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/NebulousCoreCooldown.cs b/UI/CooldownIndicators/NebulousCoreCooldown.cs deleted file mode 100644 index e06edfc4d5..0000000000 --- a/UI/CooldownIndicators/NebulousCoreCooldown.cs +++ /dev/null @@ -1,29 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class NebulousCoreCooldown : CooldownIndicator - { - public override bool DisplayMe => true; - public override string Name => "Nebulous Core Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/NebulousCore"; - public override Color OutlineColor => Color.Lerp(new Color(252, 109, 203), new Color(58, 91, 146), Completion); - public override Color CooldownColorStart => new Color(148, 62, 216); - public override Color CooldownColorEnd => new Color(255, 187, 207); - - public NebulousCoreCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/PermafrostConcoctionCooldown.cs b/UI/CooldownIndicators/PermafrostConcoctionCooldown.cs deleted file mode 100644 index 49e838199e..0000000000 --- a/UI/CooldownIndicators/PermafrostConcoctionCooldown.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class PermafrostConcoctionCooldown : CooldownIndicator - { - public override string SyncID => "ConcoctionCooldown"; - public override bool DisplayMe => true; - public override string Name => "Permafrost's Concoction Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/PermafrostConcoction"; - public override Color OutlineColor => new Color(0, 218, 255); - public override Color CooldownColorStart => new Color(144, 184, 205); - public override Color CooldownColorEnd => new Color(232, 246, 254); - - public PermafrostConcoctionCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/PotionSicknessDisplay.cs b/UI/CooldownIndicators/PotionSicknessDisplay.cs deleted file mode 100644 index 26d262fda3..0000000000 --- a/UI/CooldownIndicators/PotionSicknessDisplay.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class PotionSicknessDisplay : CooldownIndicator - { - public override bool DisplayMe => CalamityConfig.Instance.VanillaCooldownDisplay && AfflictedPlayer.potionDelay > 0; - public override string Name => "Healing Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/PotionSickness"; - public override Color OutlineColor => new Color(255, 142, 165); - public override Color CooldownColorStart => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), Completion); - - - public PotionSicknessDisplay(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/PrismaticLaserCooldown.cs b/UI/CooldownIndicators/PrismaticLaserCooldown.cs deleted file mode 100644 index c331f45c12..0000000000 --- a/UI/CooldownIndicators/PrismaticLaserCooldown.cs +++ /dev/null @@ -1,32 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class PrismaticLaserCooldown : CooldownIndicator - { - public override string SyncID => "PrismaticLaser"; - public override bool DisplayMe => true; - public override string Name => "Prismatic Laser Barrage Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/PrismaticLaser"; - public override Color OutlineColor => rainbowMode; - public override Color CooldownColorStart => rainbowMode; - public override Color CooldownColorEnd => rainbowMode; - - internal Color rainbowMode => MulticolorLerp(Main.GlobalTime * 0.3f % 1, new Color[] { new Color(103, 244, 251), new Color(255, 167, 236), new Color(255, 225, 136) }); - - public PrismaticLaserCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/ProfanedSoulArtifactCooldown.cs b/UI/CooldownIndicators/ProfanedSoulArtifactCooldown.cs deleted file mode 100644 index 18708ba7f5..0000000000 --- a/UI/CooldownIndicators/ProfanedSoulArtifactCooldown.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class ProfanedSoulArtifactCooldown : CooldownIndicator - { - public override string SyncID => "PSABurnout"; - public override bool DisplayMe => true; - public override string Name => "Soul Artifact Burn Out"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/ProfanedSoulArtifact"; - public override Color OutlineColor => new Color(255, 191, 73); - public override Color CooldownColorStart => new Color(181, 136, 177); - public override Color CooldownColorEnd => new Color(255, 194, 161); - - public ProfanedSoulArtifactCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/RelicOfResilienceCooldown.cs b/UI/CooldownIndicators/RelicOfResilienceCooldown.cs deleted file mode 100644 index aa5bc53ac6..0000000000 --- a/UI/CooldownIndicators/RelicOfResilienceCooldown.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class RelicOfResilienceCooldown : CooldownIndicator - { - public override string SyncID => "RelicOfResilience"; - public override bool DisplayMe => true; - public override string Name => "Relic of Resilience Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/RelicOfResilience"; - public override Color OutlineColor => new Color(255, 191, 73); - public override Color CooldownColorStart => new Color(122, 66, 59); - public override Color CooldownColorEnd => new Color(165, 103, 87); - - public RelicOfResilienceCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/SandCloakCooldown.cs b/UI/CooldownIndicators/SandCloakCooldown.cs deleted file mode 100644 index fe40ab47a1..0000000000 --- a/UI/CooldownIndicators/SandCloakCooldown.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class SandCloakCooldown : CooldownIndicator - { - public override bool DisplayMe => true; - public override string Name => "Sand Cloak Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/SandCloak"; - public override Color OutlineColor => new Color(209, 176, 114); - public override Color CooldownColorStart => new Color(100, 64, 44); - public override Color CooldownColorEnd => new Color(132, 95, 54); - - - public SandCloakCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/SilvaReviveCooldown.cs b/UI/CooldownIndicators/SilvaReviveCooldown.cs deleted file mode 100644 index 2cdeca8001..0000000000 --- a/UI/CooldownIndicators/SilvaReviveCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class SilvaReviveCooldown : CooldownIndicator - { - public override bool DisplayMe => true; - public override string Name => "Silva Revive Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/SilvaRevive"; - public override Color OutlineColor => new Color(151, 211, 152); - public override Color CooldownColorStart => new Color(226, 188, 74); - public override Color CooldownColorEnd => new Color(151, 211, 152); - - public override bool CanTickDown => !CalamityPlayer.areThereAnyDamnBosses && !CalamityPlayer.areThereAnyDamnEvents; - - public SilvaReviveCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/SirenIceShieldCooldown.cs b/UI/CooldownIndicators/SirenIceShieldCooldown.cs deleted file mode 100644 index 705836f979..0000000000 --- a/UI/CooldownIndicators/SirenIceShieldCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class SirenIceShieldCooldown : CooldownIndicator - { - public override string SyncID => "SirenHeartShield"; - public override bool DisplayMe => true; - public override string Name => "Ice Shield Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/SirenIceShield"; - public override Color OutlineColor => Color.Lerp(new Color(163, 186, 198), new Color(146, 187, 255), (float)Math.Sin(Main.GlobalTime) * 0.5f + 0.5f); - public override Color CooldownColorStart => new Color(124, 195, 214); - public override Color CooldownColorEnd => new Color(147, 230, 253); - - - public SirenIceShieldCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/TarragonCloakCooldown.cs b/UI/CooldownIndicators/TarragonCloakCooldown.cs deleted file mode 100644 index c726e53aca..0000000000 --- a/UI/CooldownIndicators/TarragonCloakCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -using Terraria.ModLoader; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class TarragonCloakCooldown : CooldownIndicator - { - public override string SyncID => "TarraCloak"; - public override bool DisplayMe => true; - public override string Name => "Tarragon Cloak Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/TarragonCloak"; - public override Color OutlineColor => new Color(158, 204, 173); - public override Color CooldownColorStart => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); - - public TarragonCloakCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/TarragonImmunityCooldown.cs b/UI/CooldownIndicators/TarragonImmunityCooldown.cs deleted file mode 100644 index d5f2dadd75..0000000000 --- a/UI/CooldownIndicators/TarragonImmunityCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; -using Terraria.ModLoader; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class TarragonImmunityCooldown : CooldownIndicator - { - public override string SyncID => "TarraImmune"; - public override bool DisplayMe => true; - public override string Name => "Tarragon Immunity Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/TarragonImmunity"; - public override Color OutlineColor => new Color(215, 182, 82); - public override Color CooldownColorStart => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); - public override Color CooldownColorEnd => Color.Lerp(new Color(171, 106, 49), new Color(215, 182, 82), 1 - Completion); - - public TarragonImmunityCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file diff --git a/UI/CooldownIndicators/UniverseSplitterCooldown.cs b/UI/CooldownIndicators/UniverseSplitterCooldown.cs deleted file mode 100644 index 012925bcf2..0000000000 --- a/UI/CooldownIndicators/UniverseSplitterCooldown.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using CalamityMod.CalPlayer; - -namespace CalamityMod.UI.CooldownIndicators -{ - public class UniverseSplitterCooldown : CooldownIndicator - { - public override bool DisplayMe => true; - public override string Name => "Universe Splitter Cooldown"; - public override string Texture => "CalamityMod/UI/CooldownIndicators/UniverseSplitter"; - public override Color OutlineColor => rainbowMode; - public override Color CooldownColorStart => rainbowMode; - public override Color CooldownColorEnd => rainbowMode; - - internal Color rainbowMode => MulticolorLerp(Main.GlobalTime * 0.3f % 1, new Color[] { new Color(236, 202, 255), new Color(192, 245, 255), new Color(255, 194, 205) }); - - public UniverseSplitterCooldown(int duration, Player player) : base(duration, player) - { - } - } -} \ No newline at end of file