#ifndef PKMNLIB_CREATEPOKEMON_HPP #define PKMNLIB_CREATEPOKEMON_HPP #include "Pokemon.hpp" namespace PkmnLib::Battling { class CreatePokemon { private: ArbUt::BorrowedPtr _library; ArbUt::StringView _species = ""_cnc; ArbUt::StringView _forme = "default"_cnc; level_int_t _level; std::optional _nickname = ""; ArbUt::StringView _ability = ""_cnc; ArbUt::StringView _nature; CreatureLib::Library::Gender _gender = static_cast(-1); ArbUt::StringView _heldItem = ""_cnc; uint32_t _identifier = 0; struct ToLearnMethod { ArbUt::OptionalBorrowedPtr Move; CreatureLib::Battling::AttackLearnMethod LearnMethod; ToLearnMethod(ArbUt::BorrowedPtr move, CreatureLib::Battling::AttackLearnMethod method) : Move(move), LearnMethod(method){}; }; ArbUt::List _attacks; uint8_t _currentMove = 0; uint8_t _ivHp = 0; uint8_t _ivAttack = 0; uint8_t _ivDefense = 0; uint8_t _ivSpAtt = 0; uint8_t _ivSpDef = 0; uint8_t _ivSpeed = 0; uint8_t _evHp = 0; uint8_t _evAttack = 0; uint8_t _evDefense = 0; uint8_t _evSpAtt = 0; uint8_t _evSpDef = 0; uint8_t _evSpeed = 0; bool _shininessSet = false; bool _isShiny = false; bool _allowedExperienceGain = true; public: CreatePokemon(const BattleLibrary* library, const ArbUt::StringView& species, uint8_t level) : _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalAttacks()) {} CreatePokemon& WithForme(const ArbUt::StringView& forme); CreatePokemon& WithGender(CreatureLib::Library::Gender gender); CreatePokemon& IsShiny(bool value); CreatePokemon& WithHeldItem(const ArbUt::StringView& item); CreatePokemon& LearnMove(const ArbUt::StringView& move, CreatureLib::Battling::AttackLearnMethod method); CreatePokemon& WithRandomIndividualValues(ArbUt::Random rand = ArbUt::Random()); CreatePokemon& WithIndividualValue(CreatureLib::Library::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); CreatePokemon& WithEffortValue(CreatureLib::Library::Statistic stat, uint8_t value); CreatePokemon& WithEffortValues(uint8_t hp, uint8_t att, uint8_t def, uint8_t spAtt, uint8_t spDef, uint8_t speed); CreatePokemon& WithNature(const ArbUt::StringView& nature); CreatePokemon& IsAllowedExperienceGain(bool value); CreatePokemon& WithNickname(const std::string& nickname); Pokemon* Build() { auto rand = ArbUt::Random(); return Build(rand); } Pokemon* Build(ArbUt::Random& rand); }; } #endif // PKMNLIB_CREATEPOKEMON_HPP