Flesh Totem CD done in OnHit to work with dodges

This commit is contained in:
Altixal committed 2023-03-15 23:23:04 +07:00
1 parent 0e6c3ea144
commit 57880dd7d1
1 file changed
+8 -3
+8 -3
View File
@@ -4546,11 +4546,9 @@ namespace CalamityMod.CalPlayer
contactDamageReduction += 0.5;
}
// Can't have any cooldowns here because dodges grrrrr....
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID))
{
Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, coreOfTheBloodGod ? "bloodgod" : "default");
contactDamageReduction += 0.5;
}
if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID))
contactDamageReduction += 0.5;
@@ -4950,6 +4948,13 @@ namespace CalamityMod.CalPlayer
#endregion
#region On Hit
public override void OnHitByNPC(NPC npc, int damage, bool crit)
{
// ModifyHit (Flesh Totem effect happens here) -> Hurt (includes dodges) -> OnHit
// As such, to avoid cooldowns proccing from dodge hits, do it here
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && damage > 0)
Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, coreOfTheBloodGod ? "bloodgod" : "default");
}
public override void OnHitByProjectile(Projectile proj, int damage, bool crit)
{
if (sulfurSet && !proj.friendly && damage > 0)