58 lines
2.6 KiB
C++
58 lines
2.6 KiB
C++
#ifndef PKMNLIB_POKEMON_HPP
|
|
#define PKMNLIB_POKEMON_HPP
|
|
|
|
#include <CreatureLib/Battling/Models/Creature.hpp>
|
|
#include <utility>
|
|
#include "../../Library/Statistic.hpp"
|
|
#include "../Library/BattleLibrary.hpp"
|
|
#include "LearnedMove.hpp"
|
|
|
|
namespace PkmnLib::Battling {
|
|
class Pokemon : public CreatureLib::Battling::Creature {
|
|
private:
|
|
CreatureLib::Library::StatisticSet<uint8_t> _individualValues;
|
|
CreatureLib::Library::StatisticSet<uint8_t> _effortValues;
|
|
|
|
const PkmnLib::Library::Nature* _nature;
|
|
|
|
const BattleLibrary* GetLibrary() const { return reinterpret_cast<const BattleLibrary*>(_library); }
|
|
|
|
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,
|
|
const std::string& nickname, const CreatureLib::Library::TalentIndex& talent,
|
|
const List<CreatureLib::Battling::LearnedAttack*>& moves,
|
|
CreatureLib::Library::StatisticSet<uint8_t> individualValues,
|
|
CreatureLib::Library::StatisticSet<uint8_t> effortValues, const PkmnLib::Library::Nature* nature,
|
|
bool allowedExperienceGain = true)
|
|
: CreatureLib::Battling::Creature(library, species, forme, level, experience, uid, gender, coloring,
|
|
heldItem, nickname, talent, moves, allowedExperienceGain),
|
|
_individualValues(individualValues), _effortValues(effortValues), _nature(nature) {}
|
|
|
|
const Library::PokemonForme* GetForme() const {
|
|
return dynamic_cast<const Library::PokemonForme*>(GetVariant());
|
|
}
|
|
|
|
inline bool IsShiny() const noexcept { return _coloring == 1; }
|
|
|
|
const Arbutils::Collections::List<LearnedMove*>& GetMoves() const {
|
|
return reinterpret_cast<const Arbutils::Collections::List<LearnedMove*>&>(_attacks);
|
|
}
|
|
|
|
inline const Library::Nature* GetNature() const noexcept { return _nature; }
|
|
inline uint8_t GetIndividualValue(CreatureLib::Library::Statistic stat) const {
|
|
return _individualValues.GetStat(stat);
|
|
}
|
|
inline uint8_t GetEffortValue(CreatureLib::Library::Statistic stat) const {
|
|
return _effortValues.GetStat(stat);
|
|
}
|
|
|
|
inline const PkmnLib::Library::PokemonSpecies* GetPokemonSpecies() const noexcept {
|
|
return dynamic_cast<const Library::PokemonSpecies*>(_species);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif // PKMNLIB_POKEMON_HPP
|