Updates CreatureLib, implements ConstStrings.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
d57b5852f1
commit
40a003429e
|
@ -1,7 +1,6 @@
|
|||
#include "CreatePokemon.hpp"
|
||||
|
||||
PkmnLib::Battling::CreatePokemon*
|
||||
PkmnLib::Battling::CreatePokemon::WithRandomIndividualValues(CreatureLib::Core::Random rand) {
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithRandomIndividualValues(Arbutils::Random rand) {
|
||||
_ivHp = rand.Get(0, 32);
|
||||
_ivAttack = rand.Get(0, 32);
|
||||
_ivDefense = rand.Get(0, 32);
|
||||
|
@ -38,9 +37,9 @@ PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithEffortVa
|
|||
}
|
||||
|
||||
PkmnLib::Battling::Pokemon* PkmnLib::Battling::CreatePokemon::Build() {
|
||||
auto rand = CreatureLib::Core::Random();
|
||||
auto rand = Arbutils::Random();
|
||||
const PkmnLib::Library::PokemonSpecies* species = nullptr;
|
||||
if (!this->_library->GetSpeciesLibrary()->TryGet(this->_species.c_str(), species)) {
|
||||
if (!this->_library->GetSpeciesLibrary()->TryGet(this->_species, species)) {
|
||||
std::stringstream err;
|
||||
err << "Invalid species '" << _species << "'.";
|
||||
throw CreatureException(err.str());
|
||||
|
@ -66,9 +65,9 @@ PkmnLib::Battling::Pokemon* PkmnLib::Battling::CreatePokemon::Build() {
|
|||
gender = species->GetRandomGender(rand);
|
||||
}
|
||||
const Library::Item* heldItem = nullptr;
|
||||
if (!this->_heldItem.empty()) {
|
||||
if (!_library->GetItemLibrary()->TryGet(this->_heldItem.c_str(), heldItem)) {
|
||||
throw CreatureException("Unknown Item: " + this->_heldItem);
|
||||
if (!this->_heldItem.Empty()) {
|
||||
if (!_library->GetItemLibrary()->TryGet(this->_heldItem, heldItem)) {
|
||||
throw CreatureException("Unknown Item: " + this->_heldItem.std_str());
|
||||
}
|
||||
}
|
||||
auto experience = _library->GetGrowthRateLibrary()->CalculateExperience(species->GetGrowthRate(), _level);
|
||||
|
@ -123,7 +122,8 @@ PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithEffortVa
|
|||
_evSpeed = speed;
|
||||
return this;
|
||||
}
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithForme(const std::string& forme) {
|
||||
PkmnLib::Battling::CreatePokemon*
|
||||
PkmnLib::Battling::CreatePokemon::WithForme(const Arbutils::CaseInsensitiveConstString& forme) {
|
||||
_forme = forme;
|
||||
return this;
|
||||
}
|
||||
|
@ -136,15 +136,16 @@ PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::IsShiny(bool
|
|||
_isShiny = value;
|
||||
return this;
|
||||
}
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithHeldItem(const std::string& item) {
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithHeldItem(const Arbutils::CaseInsensitiveConstString& item) {
|
||||
_heldItem = item;
|
||||
return this;
|
||||
}
|
||||
PkmnLib::Battling::CreatePokemon*
|
||||
PkmnLib::Battling::CreatePokemon::LearnMove(const std::string& moveName, CreatureLib::Battling::AttackLearnMethod method) {
|
||||
PkmnLib::Battling::CreatePokemon::LearnMove(const Arbutils::CaseInsensitiveConstString& moveName,
|
||||
CreatureLib::Battling::AttackLearnMethod method) {
|
||||
const PkmnLib::Library::MoveData* move;
|
||||
if (!_library->GetMoveLibrary()->TryGet(moveName.c_str(), move)){
|
||||
throw CreatureException("Invalid Move given: " + moveName);
|
||||
if (!_library->GetMoveLibrary()->TryGet(moveName, move)) {
|
||||
throw CreatureException("Invalid Move given: " + moveName.std_str());
|
||||
}
|
||||
if (_attacks.size() >= _library->GetSettings()->GetMaximalMoves()) {
|
||||
throw CreatureException("This pokemon already has the maximal allowed moves.");
|
||||
|
|
|
@ -7,15 +7,15 @@ namespace PkmnLib::Battling {
|
|||
class CreatePokemon {
|
||||
private:
|
||||
const BattleLibrary* _library;
|
||||
std::string _species;
|
||||
std::string _forme = "default";
|
||||
Arbutils::CaseInsensitiveConstString _species;
|
||||
Arbutils::CaseInsensitiveConstString _forme = "default"_cnc;
|
||||
uint8_t _level;
|
||||
std::string _nickname = "";
|
||||
|
||||
std::string _ability = "";
|
||||
uint8_t _nature = 255;
|
||||
CreatureLib::Library::Gender _gender = static_cast<CreatureLib::Library::Gender>(-1);
|
||||
std::string _heldItem = "";
|
||||
Arbutils::CaseInsensitiveConstString _heldItem = ""_cnc;
|
||||
uint32_t _identifier = 0;
|
||||
std::vector<std::tuple<const Library::MoveData*, CreatureLib::Battling::AttackLearnMethod>> _attacks = {};
|
||||
|
||||
|
@ -37,16 +37,16 @@ namespace PkmnLib::Battling {
|
|||
bool _isShiny = false;
|
||||
|
||||
public:
|
||||
CreatePokemon(const BattleLibrary* library, std::string species, uint8_t level)
|
||||
: _library(library), _species(std::move(species)), _level(level) {}
|
||||
CreatePokemon(const BattleLibrary* library, const Arbutils::CaseInsensitiveConstString& species, uint8_t level)
|
||||
: _library(library), _species(species), _level(level) {}
|
||||
|
||||
CreatePokemon* WithForme(const std::string& forme);
|
||||
CreatePokemon* WithForme(const Arbutils::CaseInsensitiveConstString& forme);
|
||||
CreatePokemon* WithGender(CreatureLib::Library::Gender gender);
|
||||
CreatePokemon* IsShiny(bool value);
|
||||
CreatePokemon* WithHeldItem(const std::string& item);
|
||||
CreatePokemon* LearnMove(const std::string& move, CreatureLib::Battling::AttackLearnMethod method);
|
||||
CreatePokemon* WithHeldItem(const Arbutils::CaseInsensitiveConstString& item);
|
||||
CreatePokemon* LearnMove(const Arbutils::CaseInsensitiveConstString& move, CreatureLib::Battling::AttackLearnMethod method);
|
||||
|
||||
CreatePokemon* WithRandomIndividualValues(CreatureLib::Core::Random rand = CreatureLib::Core::Random());
|
||||
CreatePokemon* WithRandomIndividualValues(Arbutils::Random rand = Arbutils::Random());
|
||||
CreatePokemon* WithIndividualValue(CreatureLib::Core::Statistic stat, uint8_t value);
|
||||
CreatePokemon* WithIndividualValues(uint8_t hp, uint8_t att, uint8_t def, uint8_t spAtt, uint8_t spDef,
|
||||
uint8_t speed);
|
||||
|
|
|
@ -7,9 +7,9 @@ namespace PkmnLib::Library {
|
|||
uint8_t _flingPower;
|
||||
|
||||
public:
|
||||
Item(std::string name, CreatureLib::Library::ItemCategory category,
|
||||
Item(const Arbutils::CaseInsensitiveConstString& name, CreatureLib::Library::ItemCategory category,
|
||||
CreatureLib::Library::BattleItemCategory battleCategory, int32_t price,
|
||||
std::unordered_set<std::string> flags, uint8_t flingPower)
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> flags, uint8_t flingPower)
|
||||
: CreatureLib::Library::Item(name, category, battleCategory, price, flags), _flingPower(flingPower) {}
|
||||
|
||||
inline uint8_t GetFlingPower() const { return _flingPower; }
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
namespace PkmnLib::Library {
|
||||
class ItemLibrary : public CreatureLib::Library::ItemLibrary {
|
||||
public:
|
||||
inline bool TryGet(const char* name, const Item*& item) const{
|
||||
inline bool TryGet(const Arbutils::CaseInsensitiveConstString& name, const Item*& item) const {
|
||||
return CreatureLib::Library::ItemLibrary::TryGet(name, (const CreatureLib::Library::Item*&)item);
|
||||
}
|
||||
|
||||
inline const Item* Get(const char* name) const{
|
||||
inline const Item* Get(const Arbutils::CaseInsensitiveConstString& name) const {
|
||||
return reinterpret_cast<const Item*>(CreatureLib::Library::ItemLibrary::Get(name));
|
||||
}
|
||||
const Item* operator[](const char* name) const { return Get(name); }
|
||||
const Item* operator[](const Arbutils::CaseInsensitiveConstString& name) const { return Get(name); }
|
||||
|
||||
void Insert(const char* name, const Item* item) {
|
||||
void Insert(const Arbutils::CaseInsensitiveConstString& name, const Item* item) {
|
||||
CreatureLib::Library::ItemLibrary::Insert(name, item);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
PkmnLib::Library::MoveData::MoveData(const std::string& name, uint8_t type,
|
||||
PkmnLib::Library::MoveCategory category, uint8_t power, uint8_t accuracy,
|
||||
uint8_t baseUsage, CreatureLib::Library::AttackTarget target, int8_t priority,
|
||||
std::unordered_set<std::string> flags)
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> flags)
|
||||
: AttackData(name, type, static_cast<CreatureLib::Library::AttackCategory>(category), power, accuracy, baseUsage,
|
||||
target, priority, std::move(flags)) {}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace PkmnLib::Library {
|
|||
public:
|
||||
MoveData(const std::string& name, uint8_t type, PkmnLib::Library::MoveCategory category, uint8_t power,
|
||||
uint8_t accuracy, uint8_t baseUsage, CreatureLib::Library::AttackTarget target, int8_t priority,
|
||||
std::unordered_set<std::string> flags);
|
||||
std::unordered_set<Arbutils::CaseInsensitiveConstString> flags);
|
||||
|
||||
PkmnLib::Library::MoveCategory GetCategory() const;
|
||||
};
|
||||
|
|
|
@ -8,12 +8,12 @@ namespace PkmnLib::Library {
|
|||
public:
|
||||
MoveLibrary(size_t initialCapacity = 32) : CreatureLib::Library::AttackLibrary(initialCapacity) {}
|
||||
|
||||
virtual const MoveData* operator[](const char* name) const { return Get(name); }
|
||||
virtual const MoveData* operator[](const Arbutils::CaseInsensitiveConstString& name) const { return Get(name); }
|
||||
|
||||
inline bool TryGet(const char* name, const MoveData*& move) const {
|
||||
inline bool TryGet(const Arbutils::CaseInsensitiveConstString& name, const MoveData*& move) const {
|
||||
return CreatureLib::Library::AttackLibrary::TryGet(name, (const CreatureLib::Library::AttackData*&)move);
|
||||
}
|
||||
const MoveData* Get(const char* name) const {
|
||||
const MoveData* Get(const Arbutils::CaseInsensitiveConstString& name) const {
|
||||
return dynamic_cast<const MoveData*>(CreatureLib::Library::AttackLibrary::Get(name));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define PKMNLIB_NATURELIBRARY_HPP
|
||||
|
||||
#include <CreatureLib/Core/Exceptions/CreatureException.hpp>
|
||||
#include <CreatureLib/Core/Random.hpp>
|
||||
#include <Arbutils/Random.hpp>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "Nature.hpp"
|
||||
|
@ -50,7 +50,7 @@ namespace PkmnLib::Library {
|
|||
return _keyLookup.at(name);
|
||||
}
|
||||
|
||||
uint8_t GetRandomNature(CreatureLib::Core::Random rand = CreatureLib::Core::Random()) const{
|
||||
uint8_t GetRandomNature(Arbutils::Random rand = Arbutils::Random()) const{
|
||||
return rand.Get(_current);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -11,8 +11,10 @@ namespace PkmnLib::Library {
|
|||
std::vector<EvolutionData> _evolutions;
|
||||
|
||||
public:
|
||||
PokemonSpecies(uint16_t id, const std::string& name, const PokemonForme* defaultVariant, float genderRatio,
|
||||
const std::string& growthRate, uint8_t captureRate, uint8_t baseHappiness)
|
||||
PokemonSpecies(uint16_t id, const Arbutils::CaseInsensitiveConstString& name,
|
||||
const PokemonForme* defaultVariant, float genderRatio,
|
||||
const Arbutils::CaseInsensitiveConstString& growthRate, uint8_t captureRate,
|
||||
uint8_t baseHappiness)
|
||||
: CreatureSpecies(id, name, defaultVariant, genderRatio, growthRate, captureRate),
|
||||
_baseHappiness(baseHappiness) {}
|
||||
|
||||
|
@ -21,20 +23,20 @@ namespace PkmnLib::Library {
|
|||
inline uint8_t GetBaseHappiness() const { return _baseHappiness; }
|
||||
|
||||
inline const PokemonForme* GetDefaultForme() const {
|
||||
return reinterpret_cast<const PokemonForme*>(CreatureSpecies::GetVariant("default"));
|
||||
return reinterpret_cast<const PokemonForme*>(CreatureSpecies::GetVariant("default"_cnc));
|
||||
}
|
||||
|
||||
inline bool HasForme(const std::string& key) const { return HasVariant(key); }
|
||||
inline bool HasForme(const Arbutils::CaseInsensitiveConstString& key) const { return HasVariant(key); }
|
||||
|
||||
inline bool TryGetForme(const std::string& key, const PokemonForme*& forme) const {
|
||||
inline bool TryGetForme(const Arbutils::CaseInsensitiveConstString& key, const PokemonForme*& forme) const {
|
||||
return TryGetVariant(key, (const CreatureLib::Library::SpeciesVariant*&)forme);
|
||||
}
|
||||
|
||||
inline const PokemonForme* GetForme(const std::string& key) const {
|
||||
inline const PokemonForme* GetForme(const Arbutils::CaseInsensitiveConstString& key) const {
|
||||
return reinterpret_cast<const PokemonForme*>(CreatureSpecies::GetVariant(key));
|
||||
}
|
||||
|
||||
inline void AddEvolution(EvolutionData data) { _evolutions.push_back(data); }
|
||||
inline void AddEvolution(const EvolutionData& data) { _evolutions.push_back(data); }
|
||||
const std::vector<EvolutionData>& GetEvolutions() const { return _evolutions; }
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,18 +7,18 @@
|
|||
namespace PkmnLib::Library {
|
||||
class SpeciesLibrary : public CreatureLib::Library::SpeciesLibrary {
|
||||
public:
|
||||
inline bool TryGet(const char* name, const PokemonSpecies*& outSpecies) const {
|
||||
inline bool TryGet(const Arbutils::CaseInsensitiveConstString& name, const PokemonSpecies*& outSpecies) const {
|
||||
return CreatureLib::Library::SpeciesLibrary::TryGet(
|
||||
name, (const CreatureLib::Library::CreatureSpecies*&)outSpecies);
|
||||
}
|
||||
|
||||
inline const PokemonSpecies* Get(const char* name) const {
|
||||
inline const PokemonSpecies* Get(const Arbutils::CaseInsensitiveConstString& name) const {
|
||||
return dynamic_cast<const PokemonSpecies*>(CreatureLib::Library::SpeciesLibrary::Get(name));
|
||||
}
|
||||
|
||||
const PokemonSpecies* operator[](const char* name) const { return Get(name); }
|
||||
const PokemonSpecies* operator[](const Arbutils::CaseInsensitiveConstString& name) const { return Get(name); }
|
||||
|
||||
void Insert(const char* name, const PokemonSpecies* species) {
|
||||
void Insert(const Arbutils::CaseInsensitiveConstString& name, const PokemonSpecies* species) {
|
||||
CreatureLib::Library::SpeciesLibrary::Insert(name, species);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PKMNLIB_TIMEOFDAY_HPP
|
||||
#define PKMNLIB_TIMEOFDAY_HPP
|
||||
|
||||
#include <CreatureLib/Core/Enum.hpp>
|
||||
#include <Arbutils/Enum.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
|
|
|
@ -113,11 +113,13 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
|
|||
r = engine->RegisterObjectMethod("Pokemon", "bool HasHeldItem(const string &in name) const",
|
||||
asMETHOD(PkmnLib::Battling::Pokemon, HasHeldItem), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Pokemon", "void SetHeldItem(const string &in name)",
|
||||
asMETHODPR(PkmnLib::Battling::Pokemon, SetHeldItem, (const std::string&), void),
|
||||
r = engine->RegisterObjectMethod(
|
||||
"Pokemon", "void SetHeldItem(const string &in name)",
|
||||
asMETHODPR(PkmnLib::Battling::Pokemon, SetHeldItem, (const Arbutils::CaseInsensitiveConstString&), void),
|
||||
asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Pokemon", "void SetHeldItem(const Item@ item)",
|
||||
r = engine->RegisterObjectMethod(
|
||||
"Pokemon", "void SetHeldItem(const Item@ item)",
|
||||
asMETHODPR(PkmnLib::Battling::Pokemon, SetHeldItem, (const CreatureLib::Library::Item*), void),
|
||||
asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
|
|
|
@ -40,6 +40,11 @@ void RegisterSpeciesTypes::RegisterStatisticEnum(asIScriptEngine* engine) {
|
|||
assert(r >= 0);
|
||||
}
|
||||
|
||||
static const PkmnLib::Library::PokemonForme* GetFormeWrapper(const std::string& s,
|
||||
const PkmnLib::Library::PokemonSpecies* species) {
|
||||
return species->GetForme(Arbutils::CaseInsensitiveConstString(s.c_str(), s.length()));
|
||||
}
|
||||
|
||||
void RegisterSpeciesTypes::RegisterSpeciesType(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("Species", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
assert(r >= 0);
|
||||
|
@ -59,13 +64,11 @@ void RegisterSpeciesTypes::RegisterSpeciesType(asIScriptEngine* engine) {
|
|||
asMETHOD(PkmnLib::Library::PokemonSpecies, GetRandomGender), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Species", "const Forme@ GetForme(string key) const",
|
||||
asMETHOD(PkmnLib::Library::PokemonSpecies, GetForme), asCALL_THISCALL);
|
||||
asFUNCTION(GetFormeWrapper), asCALL_CDECL_OBJLAST);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Species", "const Forme@ GetDefaultForme() const",
|
||||
asMETHOD(PkmnLib::Library::PokemonSpecies, GetDefaultForme), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
|
||||
|
||||
}
|
||||
void RegisterSpeciesTypes::RegisterFormeType(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("Forme", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
|
@ -94,7 +97,6 @@ void RegisterSpeciesTypes::RegisterFormeType(asIScriptEngine* engine) {
|
|||
r = engine->RegisterObjectMethod("Forme", "const string& GetAbility(int index) const",
|
||||
asMETHOD(PkmnLib::Library::PokemonForme, GetTalent), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
|
||||
}
|
||||
void RegisterSpeciesTypes::RegisterSpeciesLibrary(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("SpeciesLibrary", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
|
|
|
@ -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,7 +113,7 @@ 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)
|
||||
auto pkmn = CreatePokemon(TestLibrary::GetLibrary(), "statTestSpecies1"_cnc, 100)
|
||||
.WithNature("buffsAttackNerfsSpeed")
|
||||
->WithIndividualValues(31, 31, 31, 31, 31, 31)
|
||||
->WithEffortValues(255, 255, 255, 255, 255, 255)
|
||||
|
@ -129,5 +131,4 @@ TEST_CASE("High level, max IVs, max EVs, nature buffs attack, nerfs speed, Attac
|
|||
delete pkmn;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -5,13 +5,13 @@
|
|||
|
||||
TEST_CASE("Create and delete Pokemon"){
|
||||
auto lib = TestLibrary::GetLibrary();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies", 1).Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1).Build();
|
||||
delete mon;
|
||||
}
|
||||
|
||||
TEST_CASE("Get Nature from Pokemon"){
|
||||
auto lib = TestLibrary::GetLibrary();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies", 1)
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1)
|
||||
.WithNature("neutralNature")
|
||||
->Build();
|
||||
auto nature = mon->GetNature();
|
||||
|
|
|
@ -68,7 +68,7 @@ TEST_CASE("Validate Pokemon Species in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testSpecies");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgObject(1, (void*)mon->GetSpecies());
|
||||
|
||||
|
@ -81,7 +81,7 @@ TEST_CASE("Validate Pokemon Forme in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testForme");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).WithForme("default")->Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).WithForme("default"_cnc)->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgObject(1, (void*)mon->GetForme());
|
||||
|
||||
|
@ -94,7 +94,7 @@ TEST_CASE("Validate Pokemon Level in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testLevel");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).WithForme("default")->Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).WithForme("default"_cnc)->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgByte(1, mon->GetLevel());
|
||||
|
||||
|
@ -107,7 +107,7 @@ TEST_CASE("Validate Pokemon Experience in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testExperience");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30).WithForme("default")->Build();
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30).WithForme("default"_cnc)->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
data.Context->SetArgDWord(1, mon->GetExperience());
|
||||
|
||||
|
@ -120,8 +120,8 @@ TEST_CASE("Validate Pokemon Gender in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGender");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
|
@ -136,8 +136,8 @@ TEST_CASE("Validate Pokemon Shininess in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testShiny");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
|
@ -152,9 +152,9 @@ TEST_CASE("Validate Pokemon HeldItem in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testHeldItem");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
->WithHeldItem("testItem")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithHeldItem("testItem"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
|
@ -169,8 +169,8 @@ TEST_CASE("Validate Pokemon CurrentHealth in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCurrentHealth");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
|
@ -185,8 +185,8 @@ TEST_CASE("Validate Pokemon Nickname in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testNickname");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
|
@ -202,8 +202,8 @@ TEST_CASE("Validate Pokemon Active Ability in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testActiveAbility");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, (void*)mon);
|
||||
|
@ -219,8 +219,8 @@ TEST_CASE("Validate Pokemon IsFainted in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testIsFainted");
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Battling::Pokemon*>(mon));
|
||||
|
@ -234,8 +234,8 @@ TEST_CASE("Validate Pokemon IsFainted in Script") {
|
|||
TEST_CASE("Validate Pokemon GetTypes in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
for (size_t i = 0; i < mon->GetTypes().size(); i++) {
|
||||
|
@ -254,8 +254,8 @@ TEST_CASE("Validate Pokemon GetTypes in Script") {
|
|||
TEST_CASE("Validate Pokemon HasType in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
for (size_t i = 0; i < mon->GetTypes().size(); i++) {
|
||||
|
@ -273,8 +273,8 @@ TEST_CASE("Validate Pokemon HasType in Script") {
|
|||
TEST_CASE("Validate Pokemon Damage in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
auto data = GetScript(mainLib, "testDamage");
|
||||
|
@ -292,8 +292,8 @@ TEST_CASE("Validate Pokemon Damage in Script") {
|
|||
TEST_CASE("Validate Pokemon Heal in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->WithGender(CreatureLib::Library::Gender::Male)
|
||||
->Build();
|
||||
mon->Damage(50, CreatureLib::Battling::DamageSource::AttackDamage);
|
||||
|
@ -311,10 +311,10 @@ TEST_CASE("Validate Pokemon Heal in Script") {
|
|||
TEST_CASE("Validate Pokemon GetMoves in Script") {
|
||||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3", 30)
|
||||
.WithForme("default")
|
||||
->LearnMove("testMove", CreatureLib::Battling::AttackLearnMethod::Level)
|
||||
->LearnMove("testMove2", CreatureLib::Battling::AttackLearnMethod::Unknown)
|
||||
auto mon = PkmnLib::Battling::CreatePokemon(mainLib, "testSpecies3"_cnc, 30)
|
||||
.WithForme("default"_cnc)
|
||||
->LearnMove("testMove"_cnc, CreatureLib::Battling::AttackLearnMethod::Level)
|
||||
->LearnMove("testMove2"_cnc, CreatureLib::Battling::AttackLearnMethod::Unknown)
|
||||
->Build();
|
||||
|
||||
for (size_t i = 0; i < mon->GetMoves().size(); i++) {
|
||||
|
|
|
@ -58,7 +58,7 @@ TEST_CASE("Validate Forme Name in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
auto name = forme->GetName();
|
||||
data.Context->SetArgAddress(1, &name);
|
||||
|
@ -73,7 +73,7 @@ TEST_CASE("Validate Forme Weight in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testWeight");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgFloat(1, forme->GetWeight());
|
||||
|
||||
|
@ -87,7 +87,7 @@ TEST_CASE("Validate Forme Height in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testHeight");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgFloat(1, forme->GetHeight());
|
||||
|
||||
|
@ -101,7 +101,7 @@ TEST_CASE("Validate Forme Base Experience in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBaseExperience");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgDWord(1, forme->GetBaseExperience());
|
||||
|
||||
|
@ -115,7 +115,7 @@ TEST_CASE("Validate Forme Type Count in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testTypeCount");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgDWord(1, forme->GetTypeCount());
|
||||
|
||||
|
@ -129,7 +129,7 @@ TEST_CASE("Validate Forme GetType in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGetType");
|
||||
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgByte(1, forme->GetType(0));
|
||||
|
||||
|
@ -148,7 +148,7 @@ TEST_CASE("Validate Forme GetStatistic in Script") {
|
|||
auto stat = static_cast<CreatureLib::Core::Statistic>(statInt);
|
||||
|
||||
auto data = GetScript(mainLib, "testGetStatistic");
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
data.Context->SetArgDWord(1, static_cast<asDWORD>(stat));
|
||||
data.Context->SetArgDWord(2, forme->GetStatistic(stat));
|
||||
|
@ -161,7 +161,7 @@ TEST_CASE("Validate Forme GetAbility in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
|
||||
auto data = GetScript(mainLib, "testGetAbility");
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2")->GetDefaultForme();
|
||||
auto forme = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc)->GetDefaultForme();
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonForme*>(forme));
|
||||
auto ability = forme->GetAbility(0);
|
||||
data.Context->SetArgAddress(1, &ability);
|
||||
|
|
|
@ -54,7 +54,7 @@ TEST_CASE("Validate Item Name in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
auto name = item->GetName();
|
||||
data.Context->SetArgAddress(1, &name);
|
||||
|
@ -67,7 +67,7 @@ TEST_CASE("Validate Item Category in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCategory");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
data.Context->SetArgDWord(1, static_cast<int32_t >(item->GetCategory()));
|
||||
|
||||
|
@ -79,7 +79,7 @@ TEST_CASE("Validate Item Battle Category in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBattleCategory");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
data.Context->SetArgDWord(1, static_cast<int32_t >(item->GetBattleCategory()));
|
||||
|
||||
|
@ -91,7 +91,7 @@ TEST_CASE("Validate Item Price in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testPrice");
|
||||
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem");
|
||||
auto item = mainLib->GetItemLibrary()->Get("testItem"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::Item*>(item));
|
||||
data.Context->SetArgDWord(1, static_cast<int32_t >(item->GetPrice()));
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ TEST_CASE("Validate Move Name in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, (void*)move);
|
||||
auto name = move->GetName();
|
||||
data.Context->SetArgAddress(1, &name);
|
||||
|
@ -71,7 +71,7 @@ TEST_CASE("Validate Move Type in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testType");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetType());
|
||||
|
||||
|
@ -83,7 +83,7 @@ TEST_CASE("Validate Move Category in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCategory");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgDWord(1, (asDWORD)move->GetCategory());
|
||||
|
@ -98,7 +98,7 @@ TEST_CASE("Validate Move BasePower in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBasePower");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetBasePower());
|
||||
|
||||
|
@ -110,7 +110,7 @@ TEST_CASE("Validate Move Accuracy in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testAccuracy");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetAccuracy());
|
||||
|
||||
|
@ -122,7 +122,7 @@ TEST_CASE("Validate Move BaseUsages in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testBaseUsages");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetBaseUsages());
|
||||
|
||||
|
@ -134,7 +134,7 @@ TEST_CASE("Validate Move Target in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testTarget");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgDWord(1, (uint32_t)move->GetTarget());
|
||||
|
||||
|
@ -146,7 +146,7 @@ TEST_CASE("Validate Move Priority in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testPriority");
|
||||
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove");
|
||||
auto move = mainLib->GetMoveLibrary()->Get("testMove"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::MoveData*>(move));
|
||||
data.Context->SetArgByte(1, move->GetPriority());
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ TEST_CASE("Validate Species Name in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testName");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
auto name = species->GetName();
|
||||
|
@ -72,7 +72,7 @@ TEST_CASE("Validate Species Id in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testId");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgWord(1, species->GetId());
|
||||
|
@ -87,7 +87,7 @@ TEST_CASE("Validate Species Gender Rate in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGenderRate");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgFloat(1, species->GetGenderRate());
|
||||
|
@ -102,7 +102,7 @@ TEST_CASE("Validate Species Capture Rate in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testCaptureRate");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgByte(1, species->GetCaptureRate());
|
||||
|
@ -117,12 +117,15 @@ TEST_CASE("Validate Species Get Forme in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGetForme");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(
|
||||
0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgObject(1, const_cast<PkmnLib::Library::PokemonForme*>(species->GetForme("default")));
|
||||
data.Context->SetArgObject(1, const_cast<PkmnLib::Library::PokemonForme*>(species->GetForme("default"_cnc)));
|
||||
|
||||
auto result = data.Context->Execute();
|
||||
if (result == asEXECUTION_EXCEPTION){
|
||||
FAIL(data.Context->GetExceptionString());
|
||||
}
|
||||
REQUIRE(result == asEXECUTION_FINISHED);
|
||||
auto v = (bool)data.Context->GetReturnWord();
|
||||
REQUIRE(v);
|
||||
|
@ -132,7 +135,7 @@ TEST_CASE("Validate Species Get Default Forme in Script") {
|
|||
auto mainLib = TestLibrary::GetLibrary();
|
||||
auto data = GetScript(mainLib, "testGetDefaultForme");
|
||||
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2");
|
||||
auto species = mainLib->GetSpeciesLibrary()->Get("testSpecies2"_cnc);
|
||||
data.Context->SetArgObject(0, const_cast<PkmnLib::Library::PokemonSpecies*>(species));
|
||||
data.Context->SetArgObject(1, const_cast<PkmnLib::Library::PokemonForme*>(species->GetDefaultForme()));
|
||||
|
||||
|
|
|
@ -1,56 +1,57 @@
|
|||
#include "TestLibrary.hpp"
|
||||
#include <Arbutils/ConstString.hpp>
|
||||
|
||||
PkmnLib::Battling::BattleLibrary* TestLibrary::_library = nullptr;
|
||||
PkmnLib::Library::SpeciesLibrary* TestLibrary::BuildSpeciesLibrary() {
|
||||
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
||||
lib->Insert("testSpecies",
|
||||
lib->Insert("testSpecies"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
1, "testSpecies",
|
||||
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)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
lib->Insert("testSpecies2",
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
lib->Insert("testSpecies2"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies2",
|
||||
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)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
lib->Insert("statTestSpecies1",
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
lib->Insert("statTestSpecies1"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
3, "statTestSpecies1",
|
||||
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)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
lib->Insert("testSpecies3",
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
lib->Insert("testSpecies3"_cnc,
|
||||
new PkmnLib::Library::PokemonSpecies(
|
||||
2, "testSpecies3",
|
||||
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)),
|
||||
0.5f, "testGrowthRate", 100, 100));
|
||||
|
||||
0.5f, "testGrowthRate"_cnc, 100, 100));
|
||||
|
||||
return lib;
|
||||
}
|
||||
PkmnLib::Library::MoveLibrary* TestLibrary::BuildMoveLibrary() {
|
||||
auto lib = new PkmnLib::Library::MoveLibrary();
|
||||
lib->Insert("testMove",
|
||||
lib->Insert("testMove"_cnc,
|
||||
new PkmnLib::Library::MoveData("testMove", 0, PkmnLib::Library::MoveCategory::Physical, 50, 100, 20,
|
||||
CreatureLib::Library::AttackTarget::Adjacent, 0, {}));
|
||||
lib->Insert("testMove2",
|
||||
lib->Insert("testMove2"_cnc,
|
||||
new PkmnLib::Library::MoveData("testMove2", 0, PkmnLib::Library::MoveCategory::Special, 30, 100, 10,
|
||||
CreatureLib::Library::AttackTarget::Adjacent, 0, {}));
|
||||
return lib;
|
||||
}
|
||||
PkmnLib::Library::ItemLibrary* TestLibrary::BuildItemLibrary() {
|
||||
auto lib = new PkmnLib::Library::ItemLibrary();
|
||||
lib->Insert("testItem", new PkmnLib::Library::Item("testItem", CreatureLib::Library::ItemCategory::MiscItem,
|
||||
lib->Insert("testItem"_cnc, new PkmnLib::Library::Item("testItem"_cnc, CreatureLib::Library::ItemCategory::MiscItem,
|
||||
CreatureLib::Library::BattleItemCategory::None, 0, {}, 0));
|
||||
return lib;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
static CreatureLib::Library::GrowthRateLibrary* BuildGrowthRateLibrary() {
|
||||
auto lib = new CreatureLib::Library::GrowthRateLibrary();
|
||||
lib->AddGrowthRate("testGrowthRate", new CreatureLib::Library::LookupGrowthRate());
|
||||
lib->AddGrowthRate("testGrowthRate"_cnc, new CreatureLib::Library::LookupGrowthRate());
|
||||
return lib;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue