Adds new script hook to prevent incoming critical hits
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing

This commit is contained in:
2022-02-12 13:03:40 +01:00
parent 6444a8ce1c
commit 8522b93b7f
6 changed files with 24 additions and 0 deletions

View File

@@ -8,6 +8,12 @@
bool PkmnLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hit) const {
bool preventCrit = false;
PKMN_HOOK(PreventIncomingCritical, target, attack, target, hit, &preventCrit);
if (preventCrit) {
return false;
}
uint8_t critStage = 0;
PKMN_HOOK(ModifyCriticalStage, attack, attack, target, hit, &critStage);
Ensure(target->GetBattle().HasValue());