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
|
||||
Reference in New Issue
Block a user