From 4bb8ed8a22dd4aa51a56ee7fb90397f753a8f20f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 10 Mar 2024 01:33:13 -0600 Subject: [PATCH] The Evolution now has the new Black Belt dodge and cooldown stuff. --- Balancing/BalancingConstants.cs | 5 ++++- CalPlayer/CalamityPlayerHitHurt.cs | 18 ++++++++++++++++-- .../Mods.CalamityMod.Items.Accessories.hjson | 6 ++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 4c1bbea0a5..be8be93f91 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -41,8 +41,11 @@ internal static readonly int AmalgamDodgeCooldownMax = 5400; internal static readonly int MirrorDodgeCooldownMin = 900; internal static readonly int MirrorDodgeCooldownMax = 5400; + internal static readonly int DaedalusReflectCooldown = 5400; - internal static readonly int EvolutionReflectCooldown = 5400; + + internal static readonly int EvolutionReflectCooldownMin = 900; + internal static readonly int EvolutionReflectCooldownMax = 5400; #endregion #region Damage diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index c4cbdb65ff..d4c54bacaa 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -896,9 +896,21 @@ namespace CalamityMod.CalPlayer // This should probably be changed so that when the evolution reflects it gives you 1 frame of guaranteed free dodging everything. if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { + double dodgeDamageGateValuePercent = 0.05; + int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent); + // Reflects count as dodges. They share the timer and can be disabled by Armageddon right click. - if (!disableAllDodges && !Player.HasCooldown(GlobalDodge.ID)) + if (!disableAllDodges && !Player.HasCooldown(GlobalDodge.ID) && proj.damage >= dodgeDamageGateValue) { + double maxCooldownDurationDamagePercent = 0.5; + int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent)); + + // Just in case... + if (maxCooldownDurationDamageValue <= 0) + maxCooldownDurationDamageValue = 1; + + float cooldownDurationScalar = MathHelper.Clamp((proj.damage - dodgeDamageGateValue) / maxCooldownDurationDamageValue, 0f, 1f); + // The Evolution if (evolution) { @@ -913,7 +925,9 @@ namespace CalamityMod.CalPlayer evolutionLifeRegenCounter = 300; projTypeJustHitBy = proj.type; - Player.AddCooldown(GlobalDodge.ID, BalancingConstants.EvolutionReflectCooldown); + int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.EvolutionReflectCooldownMin, BalancingConstants.EvolutionReflectCooldownMax, cooldownDurationScalar); + Player.AddCooldown(GlobalDodge.ID, cooldownDuration); + return; } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index caa3892630..4f8b977360 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1828,8 +1828,10 @@ TheEvolution: { Tooltip: ''' You reflect projectiles when they hit you - Reflected projectiles deal no damage to you - This reflect has a 90 second cooldown which is shared with all other dodges and reflects + Reflected projectiles deal no damage to you + Projectiles that deal less than 5% of your max life in damage will not be reflected + The reflect has a cooldown that ranges between 15 and 90 seconds depending on the reflected projectile's damage + This cooldown is shared with all other dodges and reflects After reflecting something, grants +1 HP/s life regen and accelerated life regen for 5 seconds If the same enemy projectile type hits you again you will resist its damage by 15% '''