PkmnLib/src/Battling/Pokemon/CreatePokemon.hpp

74 lines
3.0 KiB
C++
Raw Normal View History

#ifndef PKMNLIB_CREATEPOKEMON_HPP
#define PKMNLIB_CREATEPOKEMON_HPP
#include <utility>
2020-01-05 14:18:30 +00:00
#include "Pokemon.hpp"
namespace PkmnLib::Battling {
class CreatePokemon {
private:
const BattleLibrary* _library;
Arbutils::CaseInsensitiveConstString _species = ""_cnc;
Arbutils::CaseInsensitiveConstString _forme = "default"_cnc;
uint8_t _level;
std::string _nickname = "";
Arbutils::CaseInsensitiveConstString _ability = ""_cnc;
2020-04-17 16:20:48 +00:00
Arbutils::CaseInsensitiveConstString _nature;
CreatureLib::Library::Gender _gender = static_cast<CreatureLib::Library::Gender>(-1);
Arbutils::CaseInsensitiveConstString _heldItem = ""_cnc;
uint32_t _identifier = 0;
struct ToLearnMethod {
const Library::MoveData* Move;
CreatureLib::Battling::AttackLearnMethod LearnMethod;
ToLearnMethod() : Move(nullptr), LearnMethod(CreatureLib::Battling::AttackLearnMethod::Unknown){};
};
Arbutils::Collections::List<ToLearnMethod> _attacks;
2020-04-22 12:16:53 +00:00
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;
public:
CreatePokemon(const BattleLibrary* library, const Arbutils::CaseInsensitiveConstString& species, uint8_t level)
: _library(library), _species(species), _level(level) {
_attacks.Resize(library->GetSettings()->GetMaximalMoves(), ToLearnMethod());
}
CreatePokemon WithForme(const Arbutils::CaseInsensitiveConstString& forme);
CreatePokemon WithGender(CreatureLib::Library::Gender gender);
CreatePokemon IsShiny(bool value);
CreatePokemon WithHeldItem(const Arbutils::CaseInsensitiveConstString& item);
CreatePokemon LearnMove(const Arbutils::CaseInsensitiveConstString& move,
CreatureLib::Battling::AttackLearnMethod method);
CreatePokemon WithRandomIndividualValues(Arbutils::Random rand = Arbutils::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,
2020-01-05 14:18:30 +00:00
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);
2020-01-05 14:18:30 +00:00
CreatePokemon WithNature(const Arbutils::CaseInsensitiveConstString& nature);
Pokemon* Build();
};
}
#endif // PKMNLIB_CREATEPOKEMON_HPP