Support Pokemon style experience gain.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-05-20 16:05:52 +02:00
parent a19965c1c3
commit 6c7c460640
17 changed files with 116 additions and 30 deletions

View File

@@ -24,9 +24,10 @@ namespace PkmnLib::Battling {
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)
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),
heldItem, nickname, talent, moves, allowedExperienceGain),
_individualValues(individualValues), _effortValues(effortValues), _nature(nature) {}
const Library::PokemonForme* GetForme() const {
@@ -46,6 +47,10 @@ namespace PkmnLib::Battling {
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);
}
};
}