Removed OnStatusMove hook.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-10 23:21:43 +02:00
parent 2ad441debc
commit 0b045db811
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
4 changed files with 0 additions and 31 deletions

View File

@ -167,15 +167,6 @@ public:
})
}
void OnStatusMove(const CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
uint8_t hitNumber) override {
CALL_HOOK(OnStatusMove, {
ctx->SetArgObject(0, (void*)attack);
ctx->SetArgObject(1, (void*)target);
ctx->SetArgByte(2, hitNumber);
})
}
void PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* outResult) override {
CALL_HOOK(PreventSecondaryEffects, {

View File

@ -90,7 +90,6 @@ public:
SCRIPT_HOOK_FUNCTION(OnAttackMiss, "void OnAttackMiss(ExecutingMove@ attack, Pokemon@ target)");
SCRIPT_HOOK_FUNCTION(ChangeAttackType,
"void ChangeAttackType(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& outType)");
SCRIPT_HOOK_FUNCTION(OnStatusMove, "void OnStatusMove(ExecutingMove@ attack, Pokemon@ target, uint8 hit)");
SCRIPT_HOOK_FUNCTION(
PreventSecondaryEffects,
"void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult)");

View File

@ -18,7 +18,6 @@ shared abstract class PkmnScript {
void IsInvulnerable(ExecutingMove@ attack, Pokemon@ target, bool& result){};
void OnAttackMiss(ExecutingMove@ attack, Pokemon@ target){};
void ChangeAttackType(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& outType){};
void OnStatusMove(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult){};
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
void OnAfterHits(ExecutingMove@ attack, Pokemon@ target){};

View File

@ -58,10 +58,6 @@ void StopBeforeAttack(ExecutingMove@ attack, bool& result) override{
AS_CLASS(
ChangeAttackTypeScript,
R"(void ChangeAttackType(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& outType) override{outType = 1; };)"),
AS_CLASS(
OnStatusMoveScript,
"int value = 0; void OnStatusMove(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override { value++; } "
"int GetValue() { return value; }"),
AS_CLASS(
PreventSecondaryEffectsScript,
R"(void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& result) override{ result = !result; })"),
@ -277,22 +273,6 @@ TEST_CASE("Invoke ChangeAttackType script function") {
delete script;
}
TEST_CASE("Invoke OnStatusMove script function") {
auto mainLib = TestLibrary::GetLibrary();
auto script = GetScript(mainLib, "OnStatusMoveScript"_cnc);
script->OnStatusMove(nullptr, nullptr, 0);
auto ctxPool = script->GetContextPool();
auto ctx = ctxPool->RequestContext();
script->PrepareMethod("GetValue"_cnc, ctx);
REQUIRE(ctx->Execute() == asEXECUTION_FINISHED);
REQUIRE(ctx->GetReturnDWord() == 1);
ctxPool->ReturnContextToPool(ctx);
delete script;
}
TEST_CASE("Invoke PreventSecondaryEffects script function") {
auto mainLib = TestLibrary::GetLibrary();
auto script = GetScript(mainLib, "PreventSecondaryEffectsScript"_cnc);