2020-01-02 17:02:40 +00:00
|
|
|
#ifndef PKMNLIB_CREATEPOKEMON_HPP
|
|
|
|
#define PKMNLIB_CREATEPOKEMON_HPP
|
|
|
|
|
|
|
|
#include <utility>
|
2020-01-05 14:18:30 +00:00
|
|
|
#include "Pokemon.hpp"
|
2020-01-02 17:02:40 +00:00
|
|
|
namespace PkmnLib::Battling {
|
|
|
|
class CreatePokemon {
|
|
|
|
private:
|
2020-06-02 18:37:21 +00:00
|
|
|
ArbUt::BorrowedPtr<const BattleLibrary> _library;
|
2020-07-04 13:50:30 +00:00
|
|
|
ArbUt::StringView _species = ""_cnc;
|
|
|
|
ArbUt::StringView _forme = "default"_cnc;
|
2020-01-02 17:02:40 +00:00
|
|
|
uint8_t _level;
|
|
|
|
std::string _nickname = "";
|
|
|
|
|
2020-07-04 13:50:30 +00:00
|
|
|
ArbUt::StringView _ability = ""_cnc;
|
|
|
|
ArbUt::StringView _nature;
|
2020-01-02 17:02:40 +00:00
|
|
|
CreatureLib::Library::Gender _gender = static_cast<CreatureLib::Library::Gender>(-1);
|
2020-07-04 13:50:30 +00:00
|
|
|
ArbUt::StringView _heldItem = ""_cnc;
|
2020-01-02 17:02:40 +00:00
|
|
|
uint32_t _identifier = 0;
|
2020-04-22 12:02:53 +00:00
|
|
|
|
|
|
|
struct ToLearnMethod {
|
2020-05-27 15:26:25 +00:00
|
|
|
ArbUt::BorrowedPtr<const Library::MoveData> Move;
|
2020-04-22 12:02:53 +00:00
|
|
|
CreatureLib::Battling::AttackLearnMethod LearnMethod;
|
|
|
|
ToLearnMethod() : Move(nullptr), LearnMethod(CreatureLib::Battling::AttackLearnMethod::Unknown){};
|
2020-05-27 15:26:25 +00:00
|
|
|
ToLearnMethod(ArbUt::BorrowedPtr<const Library::MoveData> move,
|
|
|
|
CreatureLib::Battling::AttackLearnMethod method)
|
2020-04-25 08:55:23 +00:00
|
|
|
: Move(move), LearnMethod(method){};
|
2020-04-22 12:02:53 +00:00
|
|
|
};
|
2020-05-27 15:26:25 +00:00
|
|
|
ArbUt::List<ToLearnMethod> _attacks;
|
2020-04-22 12:16:53 +00:00
|
|
|
uint8_t _currentMove = 0;
|
2020-01-02 17:02:40 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-02-01 15:56:09 +00:00
|
|
|
bool _shininessSet = false;
|
|
|
|
bool _isShiny = false;
|
2020-05-20 14:05:52 +00:00
|
|
|
bool _allowedExperienceGain = true;
|
2020-02-01 15:56:09 +00:00
|
|
|
|
2020-01-02 17:02:40 +00:00
|
|
|
public:
|
2020-07-04 13:50:30 +00:00
|
|
|
CreatePokemon(const BattleLibrary* library, const ArbUt::StringView& species, uint8_t level)
|
2020-04-25 08:55:23 +00:00
|
|
|
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) {
|
2020-04-22 12:02:53 +00:00
|
|
|
}
|
2020-01-02 17:02:40 +00:00
|
|
|
|
2020-07-04 13:50:30 +00:00
|
|
|
CreatePokemon WithForme(const ArbUt::StringView& forme);
|
2020-04-22 12:41:20 +00:00
|
|
|
CreatePokemon WithGender(CreatureLib::Library::Gender gender);
|
|
|
|
CreatePokemon IsShiny(bool value);
|
2020-07-04 13:50:30 +00:00
|
|
|
CreatePokemon WithHeldItem(const ArbUt::StringView& item);
|
|
|
|
CreatePokemon LearnMove(const ArbUt::StringView& move, CreatureLib::Battling::AttackLearnMethod method);
|
2020-02-01 15:56:09 +00:00
|
|
|
|
2020-05-27 15:26:25 +00:00
|
|
|
CreatePokemon WithRandomIndividualValues(ArbUt::Random rand = ArbUt::Random());
|
2020-04-22 12:41:20 +00:00
|
|
|
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-04-25 08:55:23 +00:00
|
|
|
uint8_t speed);
|
2020-04-22 12:41:20 +00:00
|
|
|
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,
|
2020-04-25 08:55:23 +00:00
|
|
|
uint8_t speed);
|
2020-01-05 14:18:30 +00:00
|
|
|
|
2020-07-04 13:50:30 +00:00
|
|
|
CreatePokemon WithNature(const ArbUt::StringView& nature);
|
2020-05-20 14:05:52 +00:00
|
|
|
CreatePokemon IsAllowedExperienceGain(bool value);
|
2020-01-02 17:02:40 +00:00
|
|
|
|
|
|
|
Pokemon* Build();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PKMNLIB_CREATEPOKEMON_HPP
|