diff --git a/src/ScriptResolving/AngelScript/AngelScriptScript.cpp b/src/ScriptResolving/AngelScript/AngelScriptScript.cpp index ff78c2d..cdbaafc 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptScript.cpp +++ b/src/ScriptResolving/AngelScript/AngelScriptScript.cpp @@ -126,6 +126,15 @@ void AngelScriptScript::BlockCritical(CreatureLib::Battling::ExecutingAttack* at }) } +void AngelScriptScript::ModifyStatBoostChange(CreatureLib::Battling::Creature* target, + CreatureLib::Library::Statistic stat, int8_t* diffAmount) { + CALL_HOOK(ModifyStatBoostChange, { + ctx->SetArgObject(0, (void*)target); + ctx->SetArgByte(1, (u8)stat); + ctx->SetArgAddress(2, diffAmount); + }) +} + void AngelScriptScript::PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* outResult) { diff --git a/src/ScriptResolving/AngelScript/AngelScriptScript.hpp b/src/ScriptResolving/AngelScript/AngelScriptScript.hpp index f856953..a2aea86 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptScript.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptScript.hpp @@ -79,6 +79,8 @@ public: void ChangeEffectiveness(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target, uint8_t hitNumber, float* effectiveness) override; + void ModifyStatBoostChange(CreatureLib::Battling::Creature* target, CreatureLib::Library::Statistic stat, + int8_t* diffAmount) override; void PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* outResult) override; diff --git a/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp b/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp index 2c6bb6d..bc5b664 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp @@ -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(ModifyStatBoostChange, + "void ModifyStatBoostChange(Pokemon@ target, Statistic stat, int8& amount)"); SCRIPT_HOOK_FUNCTION( PreventSecondaryEffects, "void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult)"); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp index f7b2c8a..4a5e6bf 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp @@ -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 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){}; void OnAfterHits(ExecutingMove@ attack, Pokemon@ target){};