Support Pokemon style experience gain.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-05-20 16:05:52 +02:00
parent a19965c1c3
commit 6c7c460640
17 changed files with 116 additions and 30 deletions

View File

@@ -17,7 +17,7 @@ TEST_CASE("Able to build, destroy and insert library", "library") {
"default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100));
0.5f, "testGrowthRate"_cnc, 100, 100, 100));
delete lib;
}
@@ -30,7 +30,7 @@ TEST_CASE("Able to insert and retrieve from library", "library") {
"default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100));
0.5f, "testGrowthRate"_cnc, 100, 100, 100));
auto val = lib->Get("foo"_cnc);
REQUIRE(val->GetName() == "foo");
delete lib;

View File

@@ -9,7 +9,7 @@ TEST_CASE("Able to create and destroy species", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
delete species;
}
@@ -20,7 +20,7 @@ TEST_CASE("Able to get default forme", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
auto forme = species->GetDefaultForme();
REQUIRE(forme != nullptr);
@@ -35,7 +35,7 @@ TEST_CASE("Able to get default forme name", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
auto forme = species->GetDefaultForme();
REQUIRE(forme != nullptr);
@@ -51,7 +51,7 @@ TEST_CASE("Able to get species name", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
REQUIRE(species->GetName() == "foo");
@@ -65,7 +65,7 @@ TEST_CASE("Able to get species id", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
REQUIRE(species->GetId() == 1);
@@ -79,7 +79,7 @@ TEST_CASE("Able to get species gender ratio", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
REQUIRE(species->GetGenderRate() == 0.5f);
@@ -93,7 +93,7 @@ TEST_CASE("Able to get species growth rate", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
REQUIRE(species->GetGrowthRate() == "testGrowthRate");
@@ -107,7 +107,7 @@ TEST_CASE("Able to get species capture rate", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
REQUIRE(species->GetCaptureRate() == 100);
@@ -121,7 +121,7 @@ TEST_CASE("Able to get species base happiness", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
REQUIRE(species->GetBaseHappiness() == 100);
@@ -135,14 +135,14 @@ TEST_CASE("Able to set and get evolution", "library") {
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
auto species2 = new PkmnLib::Library::PokemonSpecies(
2, "bar"_cnc,
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
new CreatureLib::Library::LearnableAttacks(100)),
0.5f, "testGrowthRate"_cnc, 100, 100);
0.5f, "testGrowthRate"_cnc, 100, 100, 100);
species->AddEvolution(PkmnLib::Library::EvolutionData::CreateLevelEvolution(16, species2));
auto evolutions = species->GetEvolutions();