Adds OnIncomingHit script hook.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
aaadbfb4f2
commit
f811fc0654
|
@ -255,6 +255,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
|
|||
}
|
||||
if (damage > 0) {
|
||||
target->Damage(damage, DamageSource::AttackDamage);
|
||||
HOOK(OnIncomingHit, target, attack, target.GetRaw(), hitIndex);
|
||||
|
||||
if (attackData->HasSecondaryEffect() && !user->IsFainted()) {
|
||||
bool preventSecondary = false;
|
||||
|
|
|
@ -81,6 +81,9 @@ namespace CreatureLib::Battling {
|
|||
virtual void OverrideIncomingDamage([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u32* damage){};
|
||||
|
||||
virtual void OnIncomingHit([[maybe_unused]] const ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] u8 hitNumber){};
|
||||
|
||||
virtual void PreventSecondaryEffects([[maybe_unused]] const ExecutingAttack* attack,
|
||||
[[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber,
|
||||
[[maybe_unused]] bool* outResult){};
|
||||
|
|
Loading…
Reference in New Issue