diff --git a/src/Battling/Flow/TurnHandler.cpp b/src/Battling/Flow/TurnHandler.cpp index 20c1f18..d603cd9 100644 --- a/src/Battling/Flow/TurnHandler.cpp +++ b/src/Battling/Flow/TurnHandler.cpp @@ -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; diff --git a/src/Battling/ScriptHandling/BattleScript.hpp b/src/Battling/ScriptHandling/BattleScript.hpp index 8304f27..899f726 100644 --- a/src/Battling/ScriptHandling/BattleScript.hpp +++ b/src/Battling/ScriptHandling/BattleScript.hpp @@ -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){};