Support for new version of CreatureLib.
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:
@@ -14,9 +14,9 @@ TEST_CASE("Able to build, destroy and insert library", "library") {
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
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)),
|
||||
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
||||
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
delete lib;
|
||||
}
|
||||
@@ -27,9 +27,9 @@ TEST_CASE("Able to insert and retrieve from library", "library") {
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
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)),
|
||||
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
||||
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
auto val = lib->Get("foo"_cnc);
|
||||
REQUIRE(val->GetName() == "foo");
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
TEST_CASE("Able to create and destroy species", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
delete species;
|
||||
}
|
||||
@@ -15,9 +16,10 @@ TEST_CASE("Able to create and destroy species", "library") {
|
||||
TEST_CASE("Able to get default forme", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
auto forme = species->GetDefaultForme();
|
||||
@@ -29,9 +31,10 @@ 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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
auto forme = species->GetDefaultForme();
|
||||
@@ -44,9 +47,10 @@ 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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetName() == "foo");
|
||||
@@ -57,9 +61,10 @@ TEST_CASE("Able to get species name", "library") {
|
||||
TEST_CASE("Able to get species id", "library") {
|
||||
auto species = new PkmnLib::Library::PokemonSpecies(
|
||||
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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetId() == 1);
|
||||
@@ -70,9 +75,10 @@ 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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetGenderRate() == 0.5f);
|
||||
@@ -83,9 +89,10 @@ 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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetGrowthRate() == "testGrowthRate");
|
||||
@@ -96,9 +103,10 @@ 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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetCaptureRate() == 100);
|
||||
@@ -109,9 +117,10 @@ 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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
REQUIRE(species->GetBaseHappiness() == 100);
|
||||
@@ -122,15 +131,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"_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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
auto species2 = new PkmnLib::Library::PokemonSpecies(
|
||||
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)),
|
||||
new PkmnLib::Library::PokemonForme("default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100),
|
||||
{"testAbility"_cnc}, {"testHiddenAbility"_cnc},
|
||||
new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100);
|
||||
|
||||
species->AddEvolution(PkmnLib::Library::EvolutionData::CreateLevelEvolution(16, species2));
|
||||
@@ -145,5 +156,4 @@ TEST_CASE("Able to set and get evolution", "library") {
|
||||
delete species2;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -75,7 +75,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
return _resolverCache;
|
||||
}
|
||||
|
||||
static AngelScriptScript* GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* scriptName) {
|
||||
static AngelScriptScript* GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const ConstString& scriptName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, scriptName);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
@@ -84,14 +84,14 @@ static AngelScriptScript* GetScript(PkmnLib::Battling::BattleLibrary* mainLib, c
|
||||
|
||||
TEST_CASE("Invoke non-implemented script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "blankScript");
|
||||
auto script = GetScript(mainLib, "blankScript"_cnc);
|
||||
script->Stack();
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE("Invoke Stack script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "stackScript");
|
||||
auto script = GetScript(mainLib, "stackScript"_cnc);
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
script->Stack();
|
||||
|
||||
@@ -108,7 +108,7 @@ TEST_CASE("Invoke Stack script function") {
|
||||
|
||||
TEST_CASE("Invoke OnRemove script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "onRemoveScript");
|
||||
auto script = GetScript(mainLib, "onRemoveScript"_cnc);
|
||||
script->OnRemove();
|
||||
|
||||
auto ctxPool = script->GetContextPool();
|
||||
@@ -124,7 +124,7 @@ TEST_CASE("Invoke OnRemove script function") {
|
||||
|
||||
TEST_CASE("Invoke Stack script function with implementation in base class") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "doubleInheritanceScript");
|
||||
auto script = GetScript(mainLib, "doubleInheritanceScript"_cnc);
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
script->Stack();
|
||||
|
||||
@@ -141,7 +141,7 @@ TEST_CASE("Invoke Stack script function with implementation in base class") {
|
||||
|
||||
TEST_CASE("Invoke preventAttackScript script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "preventAttackScript");
|
||||
auto script = GetScript(mainLib, "preventAttackScript"_cnc);
|
||||
bool b = false;
|
||||
script->PreventAttack(nullptr, &b);
|
||||
REQUIRE(b);
|
||||
@@ -151,7 +151,7 @@ TEST_CASE("Invoke preventAttackScript script function") {
|
||||
|
||||
TEST_CASE("Invoke StopBeforeAttack script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "stopBeforeAttackScript");
|
||||
auto script = GetScript(mainLib, "stopBeforeAttackScript"_cnc);
|
||||
bool b = false;
|
||||
script->StopBeforeAttack(nullptr, &b);
|
||||
REQUIRE(b);
|
||||
@@ -161,7 +161,7 @@ TEST_CASE("Invoke StopBeforeAttack script function") {
|
||||
|
||||
TEST_CASE("Invoke OnBeforeAttack script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "OnBeforeAttackScript");
|
||||
auto script = GetScript(mainLib, "OnBeforeAttackScript"_cnc);
|
||||
|
||||
script->OnBeforeAttack(nullptr);
|
||||
|
||||
@@ -177,7 +177,7 @@ TEST_CASE("Invoke OnBeforeAttack script function") {
|
||||
|
||||
TEST_CASE("Invoke FailIncomingAttack script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "FailIncomingAttackScript");
|
||||
auto script = GetScript(mainLib, "FailIncomingAttackScript"_cnc);
|
||||
bool b = false;
|
||||
script->FailIncomingAttack(nullptr, nullptr, &b);
|
||||
REQUIRE(b);
|
||||
@@ -187,7 +187,7 @@ TEST_CASE("Invoke FailIncomingAttack script function") {
|
||||
|
||||
TEST_CASE("Invoke OnAttackMiss script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "OnAttackMissScript");
|
||||
auto script = GetScript(mainLib, "OnAttackMissScript"_cnc);
|
||||
|
||||
script->OnAttackMiss(nullptr, nullptr);
|
||||
|
||||
@@ -203,7 +203,7 @@ TEST_CASE("Invoke OnAttackMiss script function") {
|
||||
|
||||
TEST_CASE("Invoke ChangeAttackType script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "ChangeAttackTypeScript");
|
||||
auto script = GetScript(mainLib, "ChangeAttackTypeScript"_cnc);
|
||||
uint8_t b = 0;
|
||||
script->ChangeAttackType(nullptr, nullptr, 0, &b);
|
||||
REQUIRE(b == 1);
|
||||
@@ -213,7 +213,7 @@ TEST_CASE("Invoke ChangeAttackType script function") {
|
||||
|
||||
TEST_CASE("Invoke OnStatusMove script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "OnStatusMoveScript");
|
||||
auto script = GetScript(mainLib, "OnStatusMoveScript"_cnc);
|
||||
|
||||
script->OnStatusMove(nullptr, nullptr, 0);
|
||||
|
||||
@@ -229,7 +229,7 @@ TEST_CASE("Invoke OnStatusMove script function") {
|
||||
|
||||
TEST_CASE("Invoke PreventSecondaryEffects script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "PreventSecondaryEffectsScript");
|
||||
auto script = GetScript(mainLib, "PreventSecondaryEffectsScript"_cnc);
|
||||
bool b = false;
|
||||
script->PreventSecondaryEffects(nullptr, nullptr, 0, &b);
|
||||
REQUIRE(b);
|
||||
@@ -239,7 +239,7 @@ TEST_CASE("Invoke PreventSecondaryEffects script function") {
|
||||
|
||||
TEST_CASE("Invoke OnSecondaryEffect script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "OnSecondaryEffectScript");
|
||||
auto script = GetScript(mainLib, "OnSecondaryEffectScript"_cnc);
|
||||
|
||||
script->OnSecondaryEffect(nullptr, nullptr, 0);
|
||||
|
||||
@@ -255,7 +255,7 @@ TEST_CASE("Invoke OnSecondaryEffect script function") {
|
||||
|
||||
TEST_CASE("Invoke OnAfterHits script function") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "OnAfterHitsScript");
|
||||
auto script = GetScript(mainLib, "OnAfterHitsScript"_cnc);
|
||||
|
||||
script->OnAfterHits(nullptr, nullptr);
|
||||
|
||||
@@ -271,7 +271,7 @@ TEST_CASE("Invoke OnAfterHits script function") {
|
||||
|
||||
TEST_CASE("Handle script exceptions.") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto script = GetScript(mainLib, "throwScript");
|
||||
auto script = GetScript(mainLib, "throwScript"_cnc);
|
||||
bool b = false;
|
||||
bool hasThrown = false;
|
||||
try{
|
||||
|
||||
@@ -40,7 +40,7 @@ TEST_CASE("Build script resolver, then create object") {
|
||||
lib->CreateScript("testScript1" , _scripts["testScript1"]);
|
||||
lib->FinalizeModule();
|
||||
|
||||
auto obj = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto obj = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
|
||||
delete obj;
|
||||
delete lib;
|
||||
@@ -53,7 +53,7 @@ TEST_CASE("Build script resolver, create object, invoke addition method") {
|
||||
lib->FinalizeModule();
|
||||
|
||||
auto obj =
|
||||
dynamic_cast<AngelScriptScript*>(lib->LoadScript(ScriptCategory::Creature, "testScript1"));
|
||||
dynamic_cast<AngelScriptScript*>(lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc));
|
||||
auto ctxPool = obj->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
|
||||
static ScriptData GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* funcName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
auto ctxPool = script->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
@@ -43,7 +43,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
|
||||
static ScriptData GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* funcName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
auto ctxPool = script->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
@@ -39,7 +39,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
|
||||
static ScriptData GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* funcName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
auto ctxPool = script->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
@@ -43,7 +43,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
|
||||
static ScriptData GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* funcName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
auto ctxPool = script->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
@@ -41,7 +41,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
|
||||
static ScriptData GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* funcName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
auto ctxPool = script->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
@@ -42,7 +42,7 @@ static AngelScripResolver* GetScriptResolver(PkmnLib::Battling::BattleLibrary* m
|
||||
|
||||
static ScriptData GetScript(PkmnLib::Battling::BattleLibrary* mainLib, const char* funcName) {
|
||||
auto lib = GetScriptResolver(mainLib);
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1");
|
||||
auto s = lib->LoadScript(ScriptCategory::Creature, "testScript1"_cnc);
|
||||
auto script = dynamic_cast<AngelScriptScript*>(s);
|
||||
auto ctxPool = script->GetContextPool();
|
||||
auto ctx = ctxPool->RequestContext();
|
||||
|
||||
@@ -8,33 +8,33 @@ PkmnLib::Library::SpeciesLibrary* TestLibrary::BuildSpeciesLibrary() {
|
||||
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)),
|
||||
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
||||
{"testHiddenAbility"_cnc}, 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)),
|
||||
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
||||
{"testHiddenAbility"_cnc}, 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)),
|
||||
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
||||
{"testHiddenAbility"_cnc}, 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)),
|
||||
"default"_cnc, 1.0f, 1.0f, 100, {0, 4},
|
||||
CreatureLib::Core::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
||||
{"testHiddenAbility"_cnc}, new CreatureLib::Library::LearnableAttacks(100)),
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
|
||||
return lib;
|
||||
|
||||
Reference in New Issue
Block a user