fix: Fixes Feint so it properly reduces damage (#1657)

This commit is contained in:
Kamron Batman 2024-01-11 00:01:52 -08:00 committed by GitHub
parent 49118556d3
commit 0ffea2e912
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 58 deletions

View file

@ -1385,11 +1385,6 @@ public abstract partial class BaseWeapon : Item, IWeapon, IFactionItem, ICraftab
bonus += duelWield.BonusSwingSpeed;
}
if (Feint.Registry.TryGetValue(m, out var feint))
{
bonus -= feint.SwingSpeedReduction;
}
var context = TransformationSpellHelper.GetContext(m);
if (context?.Spell is ReaperFormSpell spell)
@ -1985,6 +1980,12 @@ public abstract partial class BaseWeapon : Item, IWeapon, IFactionItem, ICraftab
move = null;
}
if (Feint.GetDamageReduction(attacker, defender, out var feintReduction))
{
// example: 35 damage * 50 / 100 = 17 damage
damage -= damage * feintReduction / 100;
}
var ignoreArmor = a is ArmorIgnore ||
move?.IgnoreArmor(attacker) == true ||
Bladeweave.BladeWeaving(attacker, out var bladeweavingAbi) &&