Updates CreatureLib, implements ConstStrings.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -10,28 +10,28 @@ TEST_CASE("Able to build and destroy empty library", "library") {
|
||||
|
||||
TEST_CASE("Able to build, destroy and insert library", "library") {
|
||||
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
||||
lib->Insert("foo",
|
||||
lib->Insert("foo"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
delete lib;
|
||||
}
|
||||
|
||||
TEST_CASE("Able to insert and retrieve from library", "library") {
|
||||
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
||||
lib->Insert("foo",
|
||||
lib->Insert("foo"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
auto val = lib->Get("foo");
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
auto val = lib->Get("foo"_cnc);
|
||||
REQUIRE(val->GetName() == "foo");
|
||||
delete lib;
|
||||
}
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
|
||||
TEST_CASE("Able to create and destroy species", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
delete species;
|
||||
}
|
||||
|
||||
TEST_CASE("Able to get default forme", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
auto forme = species->GetDefaultForme();
|
||||
REQUIRE(forme != nullptr);
|
||||
@@ -28,11 +28,11 @@ TEST_CASE("Able to get default forme", "library") {
|
||||
|
||||
TEST_CASE("Able to get default forme name", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
auto forme = species->GetDefaultForme();
|
||||
REQUIRE(forme != nullptr);
|
||||
@@ -43,11 +43,11 @@ TEST_CASE("Able to get default forme name", "library") {
|
||||
|
||||
TEST_CASE("Able to get species name", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetName() == "foo");
|
||||
|
||||
@@ -56,11 +56,11 @@ TEST_CASE("Able to get species name", "library") {
|
||||
|
||||
TEST_CASE("Able to get species id", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetId() == 1);
|
||||
|
||||
@@ -69,11 +69,11 @@ TEST_CASE("Able to get species id", "library") {
|
||||
|
||||
TEST_CASE("Able to get species gender ratio", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetGenderRate() == 0.5f);
|
||||
|
||||
@@ -82,11 +82,11 @@ TEST_CASE("Able to get species gender ratio", "library") {
|
||||
|
||||
TEST_CASE("Able to get species growth rate", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetGrowthRate() == "testGrowthRate");
|
||||
|
||||
@@ -95,11 +95,11 @@ TEST_CASE("Able to get species growth rate", "library") {
|
||||
|
||||
TEST_CASE("Able to get species capture rate", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetCaptureRate() == 100);
|
||||
|
||||
@@ -108,11 +108,11 @@ TEST_CASE("Able to get species capture rate", "library") {
|
||||
|
||||
TEST_CASE("Able to get species base happiness", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetBaseHappiness() == 100);
|
||||
|
||||
@@ -121,17 +121,17 @@ TEST_CASE("Able to get species base happiness", "library") {
|
||||
|
||||
TEST_CASE("Able to set and get evolution", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
1, "foo",
|
||||
1, "foo"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
auto species2 = new PkmnLib::Library::PokemonSpecies(
|
||||
2, "bar",
|
||||
2, "bar"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0}, CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"}, {"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100);
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
species->AddEvolution(PkmnLib::Library::EvolutionData::CreateLevelEvolution(16, species2));
|
||||
auto evolutions = species->GetEvolutions();
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
TEST_CASE("Low level, no IVs, no EVs, neutral nature, no stat boosts stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 10).WithNature("neutralNature")->Build();
|
||||
auto pkmn =
|
||||
CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 10).WithNature("neutralNature")->Build();
|
||||
CHECK(pkmn->GetFlatStat(PkmnLib::Library::Statistic::HealthPoints) == 40);
|
||||
CHECK(pkmn->GetCurrentHealth() == 40);
|
||||
CHECK(pkmn->GetFlatStat(PkmnLib::Library::Statistic::PhysicalAttack) == 25);
|
||||
@@ -18,7 +19,8 @@ TEST_CASE("Low level, no IVs, no EVs, neutral nature, no stat boosts stat test")
|
||||
}
|
||||
|
||||
TEST_CASE("High level, no IVs, no EVs, neutral nature, no stat boosts stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 100).WithNature("neutralNature")->Build();
|
||||
auto pkmn =
|
||||
CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100).WithNature("neutralNature")->Build();
|
||||
CHECK(pkmn->GetFlatStat(PkmnLib::Library::Statistic::HealthPoints) == 310);
|
||||
CHECK(pkmn->GetCurrentHealth() == 310);
|
||||
CHECK(pkmn->GetFlatStat(PkmnLib::Library::Statistic::PhysicalAttack) == 205);
|
||||
@@ -30,7 +32,7 @@ TEST_CASE("High level, no IVs, no EVs, neutral nature, no stat boosts stat test"
|
||||
}
|
||||
|
||||
TEST_CASE("Low level, max IVs, no EVs, neutral nature, no stat boosts stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 10)
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 10)
|
||||
.WithNature("neutralNature")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->Build();
|
||||
@@ -45,7 +47,7 @@ TEST_CASE("Low level, max IVs, no EVs, neutral nature, no stat boosts stat test"
|
||||
}
|
||||
|
||||
TEST_CASE("High level, max IVs, no EVs, neutral nature, no stat boosts stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 100)
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100)
|
||||
.WithNature("neutralNature")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->Build();
|
||||
@@ -60,7 +62,7 @@ TEST_CASE("High level, max IVs, no EVs, neutral nature, no stat boosts stat test
|
||||
}
|
||||
|
||||
TEST_CASE("High level, max IVs, max EVs, neutral nature, no stat boosts stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 100)
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100)
|
||||
.WithNature("neutralNature")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->WithEffortValues(255, 255, 255, 255, 255, 255)
|
||||
@@ -76,7 +78,7 @@ TEST_CASE("High level, max IVs, max EVs, neutral nature, no stat boosts stat tes
|
||||
}
|
||||
|
||||
TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, no stat boosts stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 100)
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100)
|
||||
.WithNature("buffsAttackNerfsSpeed")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->WithEffortValues(255, 255, 255, 255, 255, 255)
|
||||
@@ -92,7 +94,7 @@ TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, no st
|
||||
}
|
||||
|
||||
TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, Attack boosted +6 stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 100)
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100)
|
||||
.WithNature("buffsAttackNerfsSpeed")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->WithEffortValues(255, 255, 255, 255, 255, 255)
|
||||
@@ -111,11 +113,11 @@ TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, Attac
|
||||
}
|
||||
|
||||
TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, Attack boosted -6 stat test") {
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1", 100)
|
||||
.WithNature("buffsAttackNerfsSpeed")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->WithEffortValues(255, 255, 255, 255, 255, 255)
|
||||
->Build();
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100)
|
||||
.WithNature("buffsAttackNerfsSpeed")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->WithEffortValues(255, 255, 255, 255, 255, 255)
|
||||
->Build();
|
||||
|
||||
pkmn->ChangeStatBoost(PkmnLib::Library::Statistic::PhysicalAttack, -6);
|
||||
|
||||
@@ -129,5 +131,4 @@ TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, Attac
|
||||
delete pkmn;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
TEST_CASE("Create and delete Pokemon"){
|
||||
auto lib = TestLibrary::GetLibrary();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies", 1).Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1).Build();
|
||||
delete mon;
|
||||
}
|
||||
|
||||
TEST_CASE("Get Nature from Pokemon"){
|
||||
auto lib = TestLibrary::GetLibrary();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies", 1)
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1)
|
||||
.WithNature("neutralNature")
|
||||
->Build();
|
||||
auto nature = mon->GetNature();
|
||||
|
||||
@@ -68,7 +68,7 @@ TEST_CASE("Validate Pokemon Species in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testSpecies");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgObject(1, (void*)mon->GetSpecies());
|
||||
|
||||
@@ -81,7 +81,7 @@ TEST_CASE("Validate Pokemon Forme in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testForme");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).WithForme("default")->Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).WithForme("default"_cnc)->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgObject(1, (void*)mon->GetForme());
|
||||
|
||||
@@ -94,7 +94,7 @@ TEST_CASE("Validate Pokemon Level in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testLevel");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).WithForme("default")->Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).WithForme("default"_cnc)->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgByte(1, mon->GetLevel());
|
||||
|
||||
@@ -107,7 +107,7 @@ TEST_CASE("Validate Pokemon Experience in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testExperience");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).WithForme("default")->Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).WithForme("default"_cnc)->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgDWord(1, mon->GetExperience());
|
||||
|
||||
@@ -120,8 +120,8 @@ TEST_CASE("Validate Pokemon Gender in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGender");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
@@ -136,8 +136,8 @@ TEST_CASE("Validate Pokemon Shininess in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testShiny");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
@@ -152,9 +152,9 @@ TEST_CASE("Validate Pokemon HeldItem in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testHeldItem");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
->WithHeldItem("testItem")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithHeldItem("testItem"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
@@ -169,8 +169,8 @@ TEST_CASE("Validate Pokemon CurrentHealth in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCurrentHealth");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
@@ -185,8 +185,8 @@ TEST_CASE("Validate Pokemon Nickname in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testNickname");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
@@ -202,8 +202,8 @@ TEST_CASE("Validate Pokemon Active Ability in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testActiveAbility");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, (void*)mon);
|
||||
@@ -219,8 +219,8 @@ TEST_CASE("Validate Pokemon IsFainted in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testIsFainted");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
@@ -234,8 +234,8 @@ TEST_CASE("Validate Pokemon IsFainted in Script") {
|
||||
TEST_CASE("Validate Pokemon GetTypes in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
for (size_t i = 0; i < mon->GetTypes().size(); i++) {
|
||||
@@ -254,8 +254,8 @@ TEST_CASE("Validate Pokemon GetTypes in Script") {
|
||||
TEST_CASE("Validate Pokemon HasType in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
for (size_t i = 0; i < mon->GetTypes().size(); i++) {
|
||||
@@ -273,8 +273,8 @@ TEST_CASE("Validate Pokemon HasType in Script") {
|
||||
TEST_CASE("Validate Pokemon Damage in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
auto data = GetScript(mainLib, "testDamage");
|
||||
@@ -292,8 +292,8 @@ TEST_CASE("Validate Pokemon Damage in Script") {
|
||||
TEST_CASE("Validate Pokemon Heal in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
mon->Damage(50, CreatureLib::Battling::DamageSource::AttackDamage);
|
||||
@@ -311,10 +311,10 @@ TEST_CASE("Validate Pokemon Heal in Script") {
|
||||
TEST_CASE("Validate Pokemon GetMoves in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
->LearnMove("testMove", CreatureLib::Battling::AttackLearnMethod::Level)
|
||||
->LearnMove("testMove2", CreatureLib::Battling::AttackLearnMethod::Unknown)
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->LearnMove("testMove"_cnc, CreatureLib::Battling::AttackLearnMethod::Level)
|
||||
->LearnMove("testMove2"_cnc, CreatureLib::Battling::AttackLearnMethod::Unknown)
|
||||
->Build();
|
||||
|
||||
for (size_t i = 0; i < mon->GetMoves().size(); i++) {
|
||||
|
||||
@@ -58,7 +58,7 @@ TEST_CASE("Validate Forme Name in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
auto name = forme->GetName();
|
||||
data.Context->SetArgAddress(1, &name);
|
||||
@@ -73,7 +73,7 @@ TEST_CASE("Validate Forme Weight in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testWeight");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgFloat(1, forme->GetWeight());
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_CASE("Validate Forme Height in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testHeight");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgFloat(1, forme->GetHeight());
|
||||
|
||||
@@ -101,7 +101,7 @@ TEST_CASE("Validate Forme Base Experience in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBaseExperience");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgDWord(1, forme->GetBaseExperience());
|
||||
|
||||
@@ -115,7 +115,7 @@ TEST_CASE("Validate Forme Type Count in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testTypeCount");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgDWord(1, forme->GetTypeCount());
|
||||
|
||||
@@ -129,7 +129,7 @@ TEST_CASE("Validate Forme GetType in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGetType");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgByte(1, forme->GetType(0));
|
||||
|
||||
@@ -148,7 +148,7 @@ TEST_CASE("Validate Forme GetStatistic in Script") {
|
||||
auto stat = static_cast<CreatureLib::Core::Statistic>(statInt);
|
||||
|
||||
auto data = GetScript(mainLib, "testGetStatistic");
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgDWord(1, static_cast<asDWORD>(stat));
|
||||
data.Context->SetArgDWord(2, forme->GetStatistic(stat));
|
||||
@@ -161,7 +161,7 @@ TEST_CASE("Validate Forme GetAbility in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto data = GetScript(mainLib, "testGetAbility");
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
auto ability = forme->GetAbility(0);
|
||||
data.Context->SetArgAddress(1, &ability);
|
||||
|
||||
@@ -54,7 +54,7 @@ TEST_CASE("Validate Item Name in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
auto name = item->GetName();
|
||||
data.Context->SetArgAddress(1, &name);
|
||||
@@ -67,7 +67,7 @@ TEST_CASE("Validate Item Category in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCategory");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
data.Context->SetArgDWord(1, static_cast<int32_t >(item->GetCategory()));
|
||||
|
||||
@@ -79,7 +79,7 @@ TEST_CASE("Validate Item Battle Category in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBattleCategory");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
data.Context->SetArgDWord(1, static_cast<int32_t >(item->GetBattleCategory()));
|
||||
|
||||
@@ -91,7 +91,7 @@ TEST_CASE("Validate Item Price in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testPrice");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
data.Context->SetArgDWord(1, static_cast<int32_t >(item->GetPrice()));
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ TEST_CASE("Validate Move Name in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, (void*)move);
|
||||
auto name = move->GetName();
|
||||
data.Context->SetArgAddress(1, &name);
|
||||
@@ -71,7 +71,7 @@ TEST_CASE("Validate Move Type in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testType");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetType());
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST_CASE("Validate Move Category in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCategory");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgDWord(1, (asDWORD)move->GetCategory());
|
||||
@@ -98,7 +98,7 @@ TEST_CASE("Validate Move BasePower in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBasePower");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetBasePower());
|
||||
|
||||
@@ -110,7 +110,7 @@ TEST_CASE("Validate Move Accuracy in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testAccuracy");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetAccuracy());
|
||||
|
||||
@@ -122,7 +122,7 @@ TEST_CASE("Validate Move BaseUsages in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBaseUsages");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetBaseUsages());
|
||||
|
||||
@@ -134,7 +134,7 @@ TEST_CASE("Validate Move Target in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testTarget");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgDWord(1, (uint32_t)move->GetTarget());
|
||||
|
||||
@@ -146,7 +146,7 @@ TEST_CASE("Validate Move Priority in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testPriority");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetPriority());
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ TEST_CASE("Validate Species Name in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
auto name = species->GetName();
|
||||
@@ -72,7 +72,7 @@ TEST_CASE("Validate Species Id in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testId");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgWord(1, species->GetId());
|
||||
@@ -87,7 +87,7 @@ TEST_CASE("Validate Species Gender Rate in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGenderRate");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgFloat(1, species->GetGenderRate());
|
||||
@@ -102,7 +102,7 @@ TEST_CASE("Validate Species Capture Rate in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCaptureRate");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgByte(1, species->GetCaptureRate());
|
||||
@@ -117,12 +117,15 @@ TEST_CASE("Validate Species Get Forme in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGetForme");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgObject(1, const_cast<PkmnLib::Library::PokemonForme*>(species->GetForme("default")));
|
||||
data.Context->SetArgObject(1, const_cast<PkmnLib::Library::PokemonForme*>(species->GetForme("default"_cnc)));
|
||||
|
||||
auto result = data.Context->Execute();
|
||||
if (result == asEXECUTION_EXCEPTION){
|
||||
FAIL(data.Context->GetExceptionString());
|
||||
}
|
||||
REQUIRE(result == asEXECUTION_FINISHED);
|
||||
auto v = (bool)data.Context->GetReturnWord();
|
||||
REQUIRE(v);
|
||||
@@ -132,7 +135,7 @@ TEST_CASE("Validate Species Get Default Forme in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGetDefaultForme");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgObject(1, const_cast<PkmnLib::Library::PokemonForme*>(species->GetDefaultForme()));
|
||||
|
||||
|
||||
@@ -1,56 +1,57 @@
|
||||
#include "TestLibrary.hpp"
|
||||
#include <Arbutils/ConstString.hpp>
|
||||
|
||||
PkmnLib::Battling::BattleLibrary* TestLibrary::_library = nullptr;
|
||||
PkmnLib::Library::SpeciesLibrary* TestLibrary::BuildSpeciesLibrary() {
|
||||
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
||||
lib->Insert("testSpecies",
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
1, "testSpecies",
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
lib->Insert("testSpecies2",
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies2",
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
lib->Insert("statTestSpecies1",
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
3, "statTestSpecies1",
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
lib->Insert("testSpecies3",
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies3",
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0, 4},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
|
||||
lib->Insert("testSpecies"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
1, "testSpecies"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
lib->Insert("testSpecies2"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies2"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
lib->Insert("statTestSpecies1"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
3, "statTestSpecies1"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
lib->Insert("testSpecies3"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies3"_cnc,
|
||||
new PkmnLib::Library::PokemonForme(
|
||||
"default", 1.0f, 1.0f, 100, {0, 4},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"},
|
||||
{"testHiddenAbility"}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
|
||||
return lib;
|
||||
}
|
||||
PkmnLib::Library::MoveLibrary* TestLibrary::BuildMoveLibrary() {
|
||||
auto lib = new PkmnLib::Library::MoveLibrary();
|
||||
lib->Insert("testMove",
|
||||
new PkmnLib::Library::MoveData("testMove", 0, PkmnLib::Library::MoveCategory::Physical, 50, 100, 20,
|
||||
CreatureLib::Library::AttackTarget::Adjacent, 0, {}));
|
||||
lib->Insert("testMove2",
|
||||
new PkmnLib::Library::MoveData("testMove2", 0, PkmnLib::Library::MoveCategory::Special, 30, 100, 10,
|
||||
CreatureLib::Library::AttackTarget::Adjacent, 0, {}));
|
||||
lib->Insert("testMove"_cnc,
|
||||
new PkmnLib::Library::MoveData("testMove", 0, PkmnLib::Library::MoveCategory::Physical, 50, 100, 20,
|
||||
CreatureLib::Library::AttackTarget::Adjacent, 0, {}));
|
||||
lib->Insert("testMove2"_cnc,
|
||||
new PkmnLib::Library::MoveData("testMove2", 0, PkmnLib::Library::MoveCategory::Special, 30, 100, 10,
|
||||
CreatureLib::Library::AttackTarget::Adjacent, 0, {}));
|
||||
return lib;
|
||||
}
|
||||
PkmnLib::Library::ItemLibrary* TestLibrary::BuildItemLibrary() {
|
||||
auto lib = new PkmnLib::Library::ItemLibrary();
|
||||
lib->Insert("testItem", new PkmnLib::Library::Item("testItem", CreatureLib::Library::ItemCategory::MiscItem,
|
||||
CreatureLib::Library::BattleItemCategory::None, 0, {}, 0));
|
||||
lib->Insert("testItem"_cnc, new PkmnLib::Library::Item("testItem"_cnc, CreatureLib::Library::ItemCategory::MiscItem,
|
||||
CreatureLib::Library::BattleItemCategory::None, 0, {}, 0));
|
||||
return lib;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
static CreatureLib::Library::GrowthRateLibrary* BuildGrowthRateLibrary() {
|
||||
auto lib = new CreatureLib::Library::GrowthRateLibrary();
|
||||
lib->AddGrowthRate("testGrowthRate", new CreatureLib::Library::LookupGrowthRate());
|
||||
lib->AddGrowthRate("testGrowthRate"_cnc, new CreatureLib::Library::LookupGrowthRate());
|
||||
return lib;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user