From d002e1c95ed30f2ffdcbd1deea4d6ed2cea2847e Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:05:20 +0700 Subject: [PATCH] Parries cancel hits Note that Cancelled HurtInfo automatically do not run hooks --- CalPlayer/CalamityPlayerHitHurt.cs | 9 +++------ .../en-US/Mods.CalamityMod.Items.Accessories.hjson | 4 ++-- NPCs/Providence/Providence.cs | 3 +++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 8de6d43790..3f175fd86a 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -896,8 +896,6 @@ namespace CalamityMod.CalPlayer #region Modify Hit By Proj public override void ModifyHitByProjectile(Projectile proj, ref Player.HurtModifiers modifiers) { - // TODO -- Evolution dodge isn't actually a dodge and you'll still get hit for 1. - // This should probably be changed so that when the evolution reflects it gives you 1 frame of guaranteed free dodging everything. if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { double dodgeDamageGateValuePercent = 0.05; @@ -929,7 +927,7 @@ namespace CalamityMod.CalPlayer int evolutionIFrames = Player.ComputeReflectIFrames(); Player.GiveUniversalIFrames(evolutionIFrames, true); - modifiers.SetMaxDamage(1); + modifiers.Cancel(); evolutionLifeRegenCounter = 300; projTypeJustHitBy = proj.type; @@ -1506,8 +1504,7 @@ namespace CalamityMod.CalPlayer theBeeCooldown = TheBee.CooldownLength; } - // TODO: If possible, find a way to make it so parries don't activate the hit - if (rOfResilienceCooldown == 0 && rOfResilienceEffect > 0 && hurtInfo.Damage > 1) + if (rOfResilienceCooldown == 0 && rOfResilienceEffect > 0) { int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600); rOfResilienceCooldown = cooldownTime; @@ -1812,7 +1809,7 @@ namespace CalamityMod.CalPlayer blazingCoreEmpoweredParry = true; - modifiers.SetMaxDamage(1); //ONLY REDUCE DAMAGE IF NOT ON COOLDOWN + modifiers.Cancel(); modifiers.DisableSound(); //prevents hurt sound from playing, had no idea this was a thing } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 2c8039e145..d25aca3d4c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -310,7 +310,7 @@ BlazingCore: { The searing core of the Profaned Goddess Pressing [KEY] will activate a parry, encasing you in luminous profaned crystal Being hit shortly after encasement will shatter the crystal - Upon shattering, holy stars spiral outwards and you only take 1 damage + Upon shattering, holy stars spiral outwards and damage taken is negated After shattering, this damage reduction effect goes on cooldown Damage parried whilst on cooldown summons additional healing stars, and will not be reduced {$Common.AbyssLightLevel2} @@ -1863,7 +1863,7 @@ TheEvolution: { DisplayName: The Evolution Tooltip: ''' - Reflects projectiles that hit you, reducing their damage to 1 and dealing 10x damage to enemies + Reflects projectiles that hit you, negating their damage and dealing 10x damage to enemies 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 diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 94546146a0..28c8278993 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -2929,6 +2929,9 @@ namespace CalamityMod.NPCs.Providence // Shortcut function for applying Burden Breaker-like negative healing to GFB Providence public static void ApplyGFBDamage(Projectile proj, int BaseDuration, int NegativeHealValue) { + if (!Main.zenithWorld) + return; + int index = Player.FindClosest(proj.position, proj.width, proj.height); Player player = Main.player[index]; if (player is null)