Add BlockWeather hook to Angelscript as well.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-19 15:06:13 +01:00
parent b2accd720e
commit 496ebfdfa1
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
4 changed files with 9 additions and 0 deletions

View File

@ -338,3 +338,9 @@ void AngelScriptScript::OnFaint(CreatureLib::Battling::Creature* creature, Creat
ctx->SetArgWord(1, static_cast<asWORD>(source));
})
}
void AngelScriptScript::BlockWeather(CreatureLib::Battling::Battle* battle, bool* blockWeather) {
CALL_HOOK(BlockWeather, {
ctx->SetArgObject(0, (void*)battle);
ctx->SetArgAddress(1, blockWeather);
})
}

View File

@ -136,6 +136,7 @@ public:
bool* shareExperience) override;
void OnFaint(CreatureLib::Battling::Creature* creature, CreatureLib::Battling::DamageSource source) override;
void BlockWeather(CreatureLib::Battling::Battle* battle, bool* blockWeather) override;
};
#undef CALL_HOOK

View File

@ -166,6 +166,7 @@ public:
SCRIPT_HOOK_FUNCTION(OnEndTurn, "void OnEndTurn()");
SCRIPT_HOOK_FUNCTION(OnFaint, "void OnFaint(Pokemon@ pokemon, DamageSource damageSource)");
SCRIPT_HOOK_FUNCTION(BlockWeather, "void BlockWeather(Battle@ battle, bool& result)");
};
#undef SCRIPT_HOOK_FUNCTION

View File

@ -60,6 +60,7 @@ shared abstract class PkmnScript {
void ModifyExperienceGain(Pokemon@ faintedMon, Pokemon@ winningMon, uint32& critStage){};
void DoesShareExperience(Pokemon@ faintedMon, Pokemon@ winningMon, bool& shareExperience){};
void BlockWeather(Battle@ battle, bool& blockWeather){};
}
)");
Ensure(r >= 0);