Adds BlockCritical script hook to angelscript.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-21 10:55:54 +01:00
parent 6480d97915
commit 50e2f39919
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
4 changed files with 15 additions and 1 deletions

View File

@ -116,6 +116,16 @@ void AngelScriptScript::ChangeEffectiveness(CreatureLib::Battling::ExecutingAtta
ctx->SetArgAddress(3, effectiveness);
})
}
void AngelScriptScript::BlockCritical(CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* blockCritical) {
CALL_HOOK(BlockCritical, {
ctx->SetArgObject(0, (void*)attack);
ctx->SetArgObject(1, (void*)target);
ctx->SetArgByte(2, hitNumber);
ctx->SetArgAddress(3, blockCritical);
})
}
void AngelScriptScript::PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hitNumber,
bool* outResult) {

View File

@ -74,6 +74,8 @@ public:
void ChangeAttackType(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
uint8_t hitNumber, uint8_t* outType) override;
void BlockCritical(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
uint8_t hitNumber, bool* blockCritical) override;
void ChangeEffectiveness(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
uint8_t hitNumber, float* effectiveness) override;

View File

@ -110,6 +110,8 @@ public:
SCRIPT_HOOK_FUNCTION(
ChangeEffectiveness,
"void ChangeEffectiveness(ExecutingMove@ attack, Pokemon@ target, uint8 hit, float& effectiveness)");
SCRIPT_HOOK_FUNCTION(BlockCritical,
"void BlockCritical(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& blockCritical)");
SCRIPT_HOOK_FUNCTION(
PreventSecondaryEffects,
"void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult)");
@ -169,7 +171,6 @@ public:
SCRIPT_HOOK_FUNCTION(OnFaint, "void OnFaint(Pokemon@ pokemon, DamageSource damageSource)");
SCRIPT_HOOK_FUNCTION(BlockWeather, "void BlockWeather(Battle@ battle, bool& result)");
SCRIPT_HOOK_FUNCTION(OnSwitchIn, "void OnSwitchIn(Pokemon@ pokemon)");
};
#undef SCRIPT_HOOK_FUNCTION

View File

@ -26,6 +26,7 @@ shared abstract class PkmnScript {
void OnAttackMiss(ExecutingMove@ attack, Pokemon@ target){};
void ChangeAttackType(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& outType){};
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 PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult){};
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};