Implements ScriptSource changes, Updates OnEndTurn.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-10-29 19:35:31 +02:00
parent 309439918c
commit 2ae73b816b
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
5 changed files with 6 additions and 8 deletions

View File

@ -31,8 +31,8 @@ namespace PkmnLib::Battling {
}
size_t ScriptCount() const override { return CreatureLib::Battling::Battle::ScriptCount() + 1; }
void GetActiveScripts(ArbUt::List<CreatureLib::Battling::ScriptWrapper>& scripts) override {
CreatureLib::Battling::Battle::GetActiveScripts(scripts);
void GetOwnScripts(ArbUt::List<CreatureLib::Battling::ScriptWrapper>& scripts) override {
CreatureLib::Battling::Battle::GetOwnScripts(scripts);
scripts.Append(CreatureLib::Battling::ScriptWrapper(
CreatureLib::Battling::ScriptWrapper::FromScript(&_weatherScript)));
}

View File

@ -293,9 +293,7 @@ void AngelScriptScript::PreventOpponentSwitch(const CreatureLib::Battling::Switc
ctx->SetArgAddress(1, outResult);
})
}
void AngelScriptScript::OnEndTurn(CreatureLib::Battling::Creature* creature) {
CALL_HOOK(OnEndTurn, { ctx->SetArgObject(0, (void*)creature); })
}
void AngelScriptScript::OnEndTurn() { CALL_HOOK(OnEndTurn, {}) }
void AngelScriptScript::ModifyNumberOfHits(CreatureLib::Battling::AttackTurnChoice* choice,
u8* numberOfHits){CALL_HOOK(ModifyNumberOfHits,
{

View File

@ -114,7 +114,7 @@ public:
void PreventRunAway(const CreatureLib::Battling::FleeTurnChoice* choice, bool* result) override;
void PreventOpponentRunAway(const CreatureLib::Battling::FleeTurnChoice* choice, bool* result) override;
void PreventOpponentSwitch(const CreatureLib::Battling::SwitchTurnChoice* choice, bool* outResult) override;
void OnEndTurn(CreatureLib::Battling::Creature* creature) override;
void OnEndTurn() override;
////////////////////
// PkmnLib methods//

View File

@ -144,7 +144,7 @@ public:
SCRIPT_HOOK_FUNCTION(PreventOpponentRunAway, "void PreventOpponentRunAway(FleeTurnChoice@ choice, bool& result)");
SCRIPT_HOOK_FUNCTION(PreventOpponentSwitch, "void PreventOpponentSwitch(SwitchTurnChoice@ choice, bool& result)");
SCRIPT_HOOK_FUNCTION(OnEndTurn, "void OnEndTurn(Pokemon@ pokemon)");
SCRIPT_HOOK_FUNCTION(OnEndTurn, "void OnEndTurn()");
};
#undef SCRIPT_HOOK_FUNCTION

View File

@ -45,7 +45,7 @@ shared abstract class PkmnScript {
void PreventRunAway(FleeTurnChoice@ choice, bool& result){};
void PreventOpponentRunAway(FleeTurnChoice@ choice, bool& result){};
void PreventOpponentSwitch(SwitchTurnChoice@ choice, bool& result){};
void OnEndTurn(Pokemon@ pokemon){};
void OnEndTurn(){};
// PkmnLib methods
void ModifyCriticalStage(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& critStage){};