Move experience gain from species to forme.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-22 13:43:02 +02:00
parent d3b0fc1cec
commit 92135a88eb
7 changed files with 27 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ void PkmnLib::Battling::ExperienceLibrary::HandleExperienceGain(
const std::unordered_set<CreatureLib::Battling::Creature*>& opponents) const {
auto fainted = dynamic_cast<Pokemon*>(faintedMon);
auto expGain = fainted->GetPokemonSpecies()->GetExperienceGains();
auto expGain = fainted->GetForme()->GetBaseExperience();
auto level = fainted->GetLevel();
// TODO exp share

View File

@@ -2,6 +2,7 @@
#define PKMNLIB_POKEMONFORME_HPP
#include <CreatureLib/Library/CreatureData/SpeciesVariant.hpp>
#include <cstdint>
namespace PkmnLib::Library {
class PokemonForme : public CreatureLib::Library::SpeciesVariant {

View File

@@ -9,14 +9,13 @@ namespace PkmnLib::Library {
private:
uint8_t _baseHappiness;
Arbutils::Collections::List<const EvolutionData*> _evolutions;
uint16_t _experienceGain;
public:
PokemonSpecies(uint16_t id, const Arbutils::CaseInsensitiveConstString& name, const PokemonForme* defaultForme,
float genderRatio, const Arbutils::CaseInsensitiveConstString& growthRate, uint8_t captureRate,
uint8_t baseHappiness, uint16_t experienceGain) noexcept
uint8_t baseHappiness) noexcept
: CreatureSpecies(id, name, defaultForme, genderRatio, growthRate, captureRate),
_baseHappiness(baseHappiness), _experienceGain(experienceGain) {}
_baseHappiness(baseHappiness) {}
~PokemonSpecies() override {
for (auto evo : _evolutions) {
@@ -42,8 +41,6 @@ namespace PkmnLib::Library {
inline void AddEvolution(const EvolutionData* data) noexcept { _evolutions.Append(data); }
const Arbutils::Collections::List<const EvolutionData*>& GetEvolutions() const noexcept { return _evolutions; }
inline uint16_t GetExperienceGains() const noexcept { return _experienceGain; }
};
}