Adds script hook for overriding incoming damage.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-10-29 18:24:46 +02:00
parent 0b9028ea97
commit 316ac12a01
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,7 @@ uint32_t DamageLibrary::GetDamage(ExecutingAttack* attack, Creature* target, uin
uint32_t damage = static_cast<uint32_t>((((levelMod * static_cast<float>(bp) * statMod) / 50) + 2) *
GetDamageModifier(attack, target, hitIndex, hitData));
HOOK(OverrideDamage, attack, attack, target, hitIndex, &damage);
HOOK(OverrideIncomingDamage, target, attack, target, hitIndex, &damage);
return damage;
}

View File

@ -63,6 +63,8 @@ namespace CreatureLib::Battling {
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] float* modifier){};
virtual void OverrideDamage([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u32* damage){};
virtual void OverrideIncomingDamage([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u32* damage){};
virtual void PreventSecondaryEffects([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber,