Adds Angelscript hook to prevent stat boost changes
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8983ba7251
commit
d1efde4328
|
@ -126,6 +126,16 @@ void AngelScriptScript::BlockCritical(CreatureLib::Battling::ExecutingAttack* at
|
|||
})
|
||||
}
|
||||
|
||||
void AngelScriptScript::PreventStatBoostChange(CreatureLib::Battling::Creature* target,
|
||||
CreatureLib::Library::Statistic stat, int8_t diffAmount, bool* prevent) {
|
||||
CALL_HOOK(PreventStatBoostChange, {
|
||||
ctx->SetArgObject(0, (void*)target);
|
||||
ctx->SetArgByte(1, (u8)stat);
|
||||
ctx->SetArgByte(2, diffAmount);
|
||||
ctx->SetArgAddress(3, prevent);
|
||||
})
|
||||
}
|
||||
|
||||
void AngelScriptScript::ModifyStatBoostChange(CreatureLib::Battling::Creature* target,
|
||||
CreatureLib::Library::Statistic stat, int8_t* diffAmount) {
|
||||
CALL_HOOK(ModifyStatBoostChange, {
|
||||
|
|
|
@ -79,6 +79,8 @@ public:
|
|||
void ChangeEffectiveness(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
||||
uint8_t hitNumber, float* effectiveness) override;
|
||||
|
||||
void PreventStatBoostChange(CreatureLib::Battling::Creature* target, CreatureLib::Library::Statistic stat,
|
||||
int8_t diffAmount, bool* prevent) override;
|
||||
void ModifyStatBoostChange(CreatureLib::Battling::Creature* target, CreatureLib::Library::Statistic stat,
|
||||
int8_t* diffAmount) override;
|
||||
void PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack,
|
||||
|
|
|
@ -112,6 +112,8 @@ public:
|
|||
"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(PreventStatBoostChange,
|
||||
"void PreventStatBoostChange(Pokemon@ target, Statistic stat, int8 amount, bool& prevent)");
|
||||
SCRIPT_HOOK_FUNCTION(ModifyStatBoostChange,
|
||||
"void ModifyStatBoostChange(Pokemon@ target, Statistic stat, int8& amount)");
|
||||
SCRIPT_HOOK_FUNCTION(
|
||||
|
|
|
@ -29,6 +29,7 @@ shared abstract class PkmnScript {
|
|||
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 PreventStatBoostChange(Pokemon@ target, Statistic stat, int8 amount, bool& prevent){};
|
||||
void ModifyStatBoostChange(Pokemon@ target, Statistic stat, int8& amount){};
|
||||
void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult){};
|
||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
|
||||
|
|
Loading…
Reference in New Issue