Initial setup for script hooks (likely to be revamped)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -78,12 +78,15 @@ void TurnHandler::ExecuteAttackChoice(const AttackTurnChoice *choice) {
|
||||
|
||||
void TurnHandler::HandleAttackForTarget(ExecutingAttack &attack, Creature *target, ExecutingAttack::TargetData &targetData) {
|
||||
//HOOK: Check if attack fails on target
|
||||
target->ExecuteScripts(Hook::IncomingAttackFails, {std::any(attack), std::any(target)});
|
||||
|
||||
//HOOK: Check if target is invulnerable
|
||||
target->ExecuteScripts(Hook::IsInvulnerable, {std::any(attack), std::any(target)});
|
||||
|
||||
|
||||
if (!targetData.IsHit()){
|
||||
//HOOK: On attack miss.
|
||||
target->ExecuteScripts(Hook::AttackMiss, {std::any(attack), std::any(target)});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user