Adds more script hooks
This commit is contained in:
parent
f6415fba27
commit
583bde3768
|
@ -77,10 +77,15 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice *choice) {
|
|||
}
|
||||
|
||||
//HOOK: check if attack fails
|
||||
bool fail = false;
|
||||
HOOK(FailAttack, attack, attack, fail);
|
||||
if (fail){
|
||||
//TODO: Fail handling.
|
||||
return;
|
||||
}
|
||||
|
||||
//HOOK: Check if attack stops after decreasing PP
|
||||
|
||||
//HOOK: On Before Attack
|
||||
HOOK(StopBeforeAttack, attack, attack);
|
||||
HOOK(OnBeforeAttack, attack, attack);
|
||||
|
||||
for (auto& kv: attack->GetTargets()){
|
||||
HandleAttackForTarget(attack, kv.first, kv.second);
|
||||
|
|
|
@ -29,6 +29,9 @@ namespace CreatureLib::Battling{
|
|||
|
||||
virtual void ChangeAttack(AttackTurnChoice* choice, std::string& attack){};
|
||||
virtual void PreventAttack(ExecutingAttack* attack,bool& result){};
|
||||
virtual void FailAttack(ExecutingAttack* attack, bool& failed){};
|
||||
virtual void StopBeforeAttack(ExecutingAttack* attack){};
|
||||
virtual void OnBeforeAttack(ExecutingAttack* attack){};
|
||||
|
||||
virtual void FailIncomingAttack(ExecutingAttack* attack, Creature* target, bool& result){};
|
||||
virtual void IsInvulnerable(ExecutingAttack* attack, Creature* target , bool& result){};
|
||||
|
|
Loading…
Reference in New Issue