Loads of work on capturing pokemon
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-03-26 16:23:24 +01:00
parent 1b14f31bd7
commit 09638c8d14
12 changed files with 110 additions and 13 deletions

View File

@@ -6,7 +6,9 @@
#include "../TestLibrary/TestLibrary.hpp"
#define AS_CLASS(name, contents) \
{ #name, "namespace Pokemon{ [Pokemon effect=" #name "] shared class " #name " : PkmnScript { " contents "}}" }
{ \
#name, "namespace Pokemon{ [Pokemon effect=" #name "] shared class " #name " : PkmnScript { " contents "}}" \
}
static std::unordered_map<const char*, const char*> _scripts = std::unordered_map<const char*, const char*>{
AS_CLASS(blankScript, ),
@@ -387,7 +389,8 @@ TEST_CASE("Add Volatile with return script function") {
auto resolver = dynamic_cast<AngelScriptResolver*>(PkmnLib::Battling::BattleLibrary::CreateScriptResolver());
auto mainLib = new PkmnLib::Battling::BattleLibrary(
TestLibrary::BuildStaticLibrary(), statCalc, new PkmnLib::Battling::DamageLibrary(),
new PkmnLib::Battling::ExperienceLibrary(), resolver, new PkmnLib::Battling::MiscLibrary(GetTime));
new PkmnLib::Battling::ExperienceLibrary(), resolver, new PkmnLib::Battling::MiscLibrary(GetTime),
new PkmnLib::Battling::CaptureLibrary());
resolver->Initialize(mainLib);
for (auto kv : _scripts) {
resolver->CreateScript(kv.first, kv.second);

View File

@@ -27,7 +27,8 @@ public:
auto scriptResolver = PkmnLib::Battling::BattleLibrary::CreateScriptResolver();
auto lib = new PkmnLib::Battling::BattleLibrary(
BuildStaticLibrary(), statCalc, new PkmnLib::Battling::DamageLibrary(false),
new PkmnLib::Battling::ExperienceLibrary(), scriptResolver, new PkmnLib::Battling::MiscLibrary(GetTime));
new PkmnLib::Battling::ExperienceLibrary(), scriptResolver, new PkmnLib::Battling::MiscLibrary(GetTime),
new PkmnLib::Battling::CaptureLibrary());
scriptResolver->Initialize(lib);
return lib;
}