Support for (un)suppressing weather, adds hook to block weather changes.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-11-19 14:56:29 +01:00
parent ea3bc7ee33
commit b2accd720e
5 changed files with 33 additions and 4 deletions

View File

@@ -191,8 +191,8 @@ void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) {
asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod(
"Battle", "void SetWeather(const constString &in name) const",
asMETHODPR(PkmnLib::Battling::Battle, SetWeather, (const ArbUt::StringView&), void), asCALL_THISCALL);
"Battle", "bool SetWeather(const constString &in name) const",
asMETHODPR(PkmnLib::Battling::Battle, SetWeather, (const ArbUt::StringView&), bool), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Battle", "void ClearWeather(const constString &in name) const",
asMETHODPR(PkmnLib::Battling::Battle, ClearWeather, (), void), asCALL_THISCALL);
@@ -201,6 +201,12 @@ void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) {
"Battle", "const constString& GetWeatherName() const",
asMETHODPR(PkmnLib::Battling::Battle, GetWeatherName, (), const ArbUt::StringView&), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Battle", "void SuppressWeather() const",
asMETHOD(PkmnLib::Battling::Battle, SuppressWeather), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Battle", "void UnsuppressWeather() const",
asMETHOD(PkmnLib::Battling::Battle, UnsuppressWeather), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Battle", "BattleSide@ GetBattleSide(uint8 index)",
asFUNCTION(GetBattleSideWrapper), asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);