2020-01-02 17:02:40 +00:00
|
|
|
#ifndef PKMNLIB_POKEMON_HPP
|
|
|
|
#define PKMNLIB_POKEMON_HPP
|
|
|
|
|
2020-02-08 18:22:29 +00:00
|
|
|
#include <CreatureLib/Battling/Models/Creature.hpp>
|
2020-01-02 17:02:40 +00:00
|
|
|
#include <utility>
|
2020-01-05 14:18:30 +00:00
|
|
|
#include "../../Library/Statistic.hpp"
|
2020-01-02 17:02:40 +00:00
|
|
|
#include "../Library/BattleLibrary.hpp"
|
|
|
|
#include "LearnedMove.hpp"
|
|
|
|
|
|
|
|
namespace PkmnLib::Battling {
|
|
|
|
class Pokemon : public CreatureLib::Battling::Creature {
|
|
|
|
private:
|
2020-04-06 18:03:44 +00:00
|
|
|
CreatureLib::Library::StatisticSet<uint8_t> _individualValues;
|
|
|
|
CreatureLib::Library::StatisticSet<uint8_t> _effortValues;
|
2020-01-02 17:02:40 +00:00
|
|
|
|
2020-04-17 16:39:04 +00:00
|
|
|
const PkmnLib::Library::Nature* _nature;
|
2020-01-02 19:26:01 +00:00
|
|
|
|
2020-01-05 14:18:30 +00:00
|
|
|
const BattleLibrary* GetLibrary() const { return reinterpret_cast<const BattleLibrary*>(_library); }
|
2020-01-02 19:26:01 +00:00
|
|
|
|
2020-01-02 17:02:40 +00:00
|
|
|
public:
|
|
|
|
Pokemon(const BattleLibrary* library, const Library::PokemonSpecies* species,
|
|
|
|
const Library::PokemonForme* forme, uint8_t level, uint32_t experience, uint32_t uid,
|
|
|
|
CreatureLib::Library::Gender gender, uint8_t coloring, const Library::Item* heldItem,
|
2020-04-06 18:03:44 +00:00
|
|
|
const std::string& nickname, const CreatureLib::Library::TalentIndex& talent,
|
2020-04-18 11:43:05 +00:00
|
|
|
const List<CreatureLib::Battling::LearnedAttack*>& moves,
|
2020-04-06 18:03:44 +00:00
|
|
|
CreatureLib::Library::StatisticSet<uint8_t> individualValues,
|
2020-04-17 16:39:04 +00:00
|
|
|
CreatureLib::Library::StatisticSet<uint8_t> effortValues, const PkmnLib::Library::Nature* nature)
|
2020-01-02 17:02:40 +00:00
|
|
|
: CreatureLib::Battling::Creature(library, species, forme, level, experience, uid, gender, coloring,
|
2020-04-21 12:56:42 +00:00
|
|
|
heldItem, nickname, talent, moves),
|
2020-01-02 19:26:01 +00:00
|
|
|
_individualValues(individualValues), _effortValues(effortValues), _nature(nature) {}
|
|
|
|
|
2020-01-26 14:18:04 +00:00
|
|
|
const Library::PokemonForme* GetForme() const {
|
|
|
|
return dynamic_cast<const Library::PokemonForme*>(GetVariant());
|
2020-01-05 14:18:30 +00:00
|
|
|
}
|
2020-01-26 14:18:04 +00:00
|
|
|
|
2020-04-18 11:43:05 +00:00
|
|
|
inline bool IsShiny() const noexcept { return _coloring == 1; }
|
2020-02-02 12:57:41 +00:00
|
|
|
|
2020-04-18 11:43:05 +00:00
|
|
|
const Arbutils::Collections::List<LearnedMove*>& GetMoves() const {
|
|
|
|
return reinterpret_cast<const Arbutils::Collections::List<LearnedMove*>&>(_attacks);
|
2020-02-01 15:56:09 +00:00
|
|
|
}
|
|
|
|
|
2020-04-18 11:43:05 +00:00
|
|
|
inline const Library::Nature* GetNature() const noexcept { return _nature; }
|
|
|
|
inline uint8_t GetIndividualValue(CreatureLib::Library::Statistic stat) const {
|
2020-04-06 18:03:44 +00:00
|
|
|
return _individualValues.GetStat(stat);
|
|
|
|
}
|
2020-04-18 11:43:05 +00:00
|
|
|
inline uint8_t GetEffortValue(CreatureLib::Library::Statistic stat) const {
|
|
|
|
return _effortValues.GetStat(stat);
|
|
|
|
}
|
2020-01-02 17:02:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PKMNLIB_POKEMON_HPP
|