Adds new Angelscript script hooks.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
4e215895b7
commit
c89c572aa2
|
@ -285,3 +285,12 @@ void AngelScriptScript::PreventOpponentRunAway(const CreatureLib::Battling::Flee
|
|||
ctx->SetArgAddress(1, result);
|
||||
})
|
||||
}
|
||||
void AngelScriptScript::PreventOpponentSwitch(const CreatureLib::Battling::SwitchTurnChoice* choice, bool* outResult) {
|
||||
CALL_HOOK(PreventOpponentSwitch, {
|
||||
ctx->SetArgObject(0, (void*)choice);
|
||||
ctx->SetArgAddress(1, outResult);
|
||||
})
|
||||
}
|
||||
void AngelScriptScript::OnEndTurn(CreatureLib::Battling::Creature* creature) {
|
||||
CALL_HOOK(OnEndTurn, { ctx->SetArgObject(0, (void*)creature); })
|
||||
}
|
||||
|
|
|
@ -105,6 +105,8 @@ 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;
|
||||
|
||||
////////////////////
|
||||
// PkmnLib methods//
|
||||
|
@ -121,6 +123,7 @@ public:
|
|||
uint32_t* experienceGain) override;
|
||||
void DoesShareExperience(CreatureLib::Battling::Creature* faintedMon, CreatureLib::Battling::Creature* winningMon,
|
||||
bool* shareExperience) override;
|
||||
|
||||
};
|
||||
|
||||
#undef CALL_HOOK
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include "AngelScriptTypeInfo.hpp"
|
|
@ -139,6 +139,9 @@ public:
|
|||
|
||||
SCRIPT_HOOK_FUNCTION(PreventRunAway, "void PreventRunAway(FleeTurnChoice@ choice, bool& result)");
|
||||
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)");
|
||||
};
|
||||
|
||||
#undef SCRIPT_HOOK_FUNCTION
|
||||
|
|
|
@ -42,6 +42,8 @@ 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){};
|
||||
|
||||
// PkmnLib methods
|
||||
void ModifyCriticalStage(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& critStage){};
|
||||
|
|
Loading…
Reference in New Issue