Move experience gain from species to forme.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-22 13:43:02 +02:00
parent d3b0fc1cec
commit 92135a88eb
7 changed files with 27 additions and 31 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, 100));
0.5f, "testGrowthRate"_cnc, 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, 100));
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 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, 100);
0.5f, "testGrowthRate"_cnc, 100, 100);
species->AddEvolution(PkmnLib::Library::EvolutionData::CreateLevelEvolution(16, species2));
auto evolutions = species->GetEvolutions();

View File

@@ -8,34 +8,34 @@ PkmnLib::Library::SpeciesLibrary* TestLibrary::BuildSpeciesLibrary() {
new PkmnLib::Library::PokemonSpecies(
1, "testSpecies"_cnc,
new PkmnLib::Library::PokemonForme(
"default"_cnc, 1.0f, 1.0f, 100, {0},
"default"_cnc, 1.0f, 1.0f, 236, {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, 236));
0.5f, "testGrowthRate"_cnc, 100, 100));
lib->Insert("testSpecies2"_cnc,
new PkmnLib::Library::PokemonSpecies(
2, "testSpecies2"_cnc,
new PkmnLib::Library::PokemonForme(
"default"_cnc, 1.0f, 1.0f, 100, {0},
"default"_cnc, 1.0f, 1.0f, 306, {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, 306));
0.5f, "testGrowthRate"_cnc, 100, 100));
lib->Insert("statTestSpecies1"_cnc,
new PkmnLib::Library::PokemonSpecies(
3, "statTestSpecies1"_cnc,
new PkmnLib::Library::PokemonForme(
"default"_cnc, 1.0f, 1.0f, 100, {0},
"default"_cnc, 1.0f, 1.0f, 236, {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, 236));
0.5f, "testGrowthRate"_cnc, 100, 100));
lib->Insert("testSpecies3"_cnc,
new PkmnLib::Library::PokemonSpecies(
2, "testSpecies3"_cnc,
new PkmnLib::Library::PokemonForme(
"default"_cnc, 1.0f, 1.0f, 100, {0, 4},
"default"_cnc, 1.0f, 1.0f, 236, {0, 4},
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, 236));
0.5f, "testGrowthRate"_cnc, 100, 100));
return lib;
}