Add support for turning off the random damage modifier.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-08-24 20:57:45 +02:00
parent dfcdfd8343
commit 7fe7c8becf
3 changed files with 25 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ class testScript1 : PkmnScript {
bool testMove(Pokemon@ p, uint index, LearnedMove@ move){ return p.GetMoves()[index] is move; }
bool testHasHeldItem(Pokemon@ p, const constString &in item){ return p.HasHeldItem(item); }
void testSetHeldItem(Pokemon@ p, const constString &in item){ p.SetHeldItem(item); }
void testSetHeldItem2(Pokemon@ p){ p.SetHeldItem("testItem"); }
}}
)"}};
@@ -347,11 +348,26 @@ TEST_CASE("Test Pokemon SetHeldItem in Script") {
data.Context->SetArgAddress(1, &item);
REQUIRE(data.Context->Execute() == asEXECUTION_FINISHED);
REQUIRE((bool)data.Context->GetReturnDWord());
REQUIRE(mon->HasHeldItem("testItem"_cnc));
delete mon;
}
TEST_CASE("Test Pokemon SetHeldItem2 in Script") {
auto mainLib = TestLibrary::GetLibrary();
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
.WithForme("default"_cnc)
.Build();
auto data = GetScript(mainLib, "testSetHeldItem2"_cnc);
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
REQUIRE(data.Context->Execute() == asEXECUTION_FINISHED);
REQUIRE(mon->HasHeldItem("testItem"_cnc));
delete mon;
}
#endif