Implements missing Script functions.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-22 15:34:24 +02:00
parent b1442f25fb
commit 2e60096d57
5 changed files with 64 additions and 23 deletions

View File

@@ -93,7 +93,7 @@ public:
arr = GetEffectParameters(ctx, parameters);
ctx->SetArgAddress(0, arr);
})
if (arr != nullptr){
if (arr != nullptr) {
arr->Release();
}
}
@@ -102,11 +102,14 @@ public:
void OnRemove() override { CALL_HOOK(OnRemove, ); }
void OnBeforeTurn(const CreatureLib::Battling::BaseTurnChoice* choice) override {
throw NotImplementedException(); // TODO
CALL_HOOK(OnBeforeTurn, { ctx->SetArgObject(0, (void*)choice); })
}
void ChangeAttack(CreatureLib::Battling::AttackTurnChoice* choice, ConstString* outAttack) override {
throw NotImplementedException(); // TODO
CALL_HOOK(ChangeAttack, {
ctx->SetArgObject(0, (void*)choice);
ctx->SetArgAddress(0, outAttack);
})
}
void PreventAttack(CreatureLib::Battling::ExecutingAttack* attack, bool* outResult) override {
@@ -206,7 +209,10 @@ public:
}
void PreventSelfSwitch(const CreatureLib::Battling::SwitchTurnChoice* choice, bool* outResult) override {
throw NotImplementedException(); // TODO
CALL_HOOK(PreventSelfSwitch, {
ctx->SetArgObject(0, (void*)choice);
ctx->SetArgAddress(1, outResult);
})
}
void ModifyEffectChance(const CreatureLib::Battling::ExecutingAttack* attack,