Adds OnFaintingOpponent script hook to Angelscript.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-21 13:37:26 +01:00
parent b0f9daef60
commit 67df06ef04
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
4 changed files with 13 additions and 0 deletions

View File

@ -365,3 +365,11 @@ void AngelScriptScript::OnIncomingHit(const CreatureLib::Battling::ExecutingAtta
ctx->SetArgByte(2, hitNumber);
})
}
void AngelScriptScript::OnFaintingOpponent(const CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, u8 hitNumber) {
CALL_HOOK(OnFaintingOpponent, {
ctx->SetArgObject(0, (void*)attack);
ctx->SetArgObject(1, (void*)target);
ctx->SetArgByte(2, hitNumber);
})
}

View File

@ -84,6 +84,8 @@ public:
void OnIncomingHit(const CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hitNumber) override;
void OnFaintingOpponent(const CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, u8 hitNumber) override;
void OnSecondaryEffect(const CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hitNumber) override;

View File

@ -116,6 +116,8 @@ public:
PreventSecondaryEffects,
"void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult)");
SCRIPT_HOOK_FUNCTION(OnIncomingHit, "void OnIncomingHit(ExecutingMove@ attack, Pokemon@ target, uint8 hit)");
SCRIPT_HOOK_FUNCTION(OnFaintingOpponent,
"void OnFaintingOpponent(ExecutingMove@ attack, Pokemon@ target, uint8 hit)");
SCRIPT_HOOK_FUNCTION(OnSecondaryEffect,
"void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit)");
SCRIPT_HOOK_FUNCTION(OnAfterHits, "void OnAfterHits(ExecutingMove@ attack, Pokemon@ target)");

View File

@ -28,6 +28,7 @@ shared abstract class PkmnScript {
void ChangeEffectiveness(ExecutingMove@ attack, Pokemon@ target, uint8 hit, float& effectiveness){};
void BlockCritical(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& blockCritical){};
void OnIncomingHit(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
void OnFaintingOpponent(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult){};
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
void OnAfterHits(ExecutingMove@ attack, Pokemon@ target){};