CreatureLib/src/Battling/Models/Creature.hpp

79 lines
2.8 KiB
C++

#ifndef CREATURELIB_BATTLECREATURE_HPP
#define CREATURELIB_BATTLECREATURE_HPP
#include "../../GenericTemplates.cpp"
#include "../Library/BattleLibrary.hpp"
#include "LearnedAttack.hpp"
namespace CreatureLib::Battling{
// Forward declare battle class
class Battle;
class BattleSide;
class Creature {
GetProperty(const Library::CreatureSpecies*, Species);
GetProperty(const Library::SpeciesVariant*, Variant);
GetProperty(uint8_t, Level);
GetProperty(uint32_t, Experience);
GetProperty(Core::StatisticSet<uint8_t >, StatExperience);
GetProperty(Core::StatisticSet<uint8_t >, StatPotential);
GetProperty(uint32_t, UniqueIdentifier);
GetProperty(Library::Gender, Gender);
GetProperty(uint8_t, Coloring);
GetProperty(const Library::Item*, HeldItem);
GetProperty(uint32_t, CurrentHealth);
private:
Core::StatisticSet<int8_t > _statBoost;
Core::StatisticSet<uint32_t > _flatStats;
Core::StatisticSet<uint32_t > _boostedStats;
Battle* _battle;
BattleSide* _side;
BattleLibrary* _library;
std::string _nickname = "";
int8_t _talentIndex;
std::vector<LearnedAttack*> _attacks;
public:
Creature(const Library::CreatureSpecies* species, const Library::SpeciesVariant* variant, uint8_t level,
uint32_t experience, Core::StatisticSet<uint8_t > statExp, Core::StatisticSet<uint8_t > statPotential,
uint32_t uid, Library::Gender gender, uint8_t coloring, const Library::Item* heldItem, std::string nickname,
int8_t talent, std::vector<LearnedAttack*> attacks);
const std::string& GetNickname() const;
const std::string& GetTalent() const;
void ChangeLevel(int8_t amount);
void SetBattleData(Battle* battle, BattleSide* side);
Battle* GetBattle() const;
BattleSide* GetBattleSide() const;
bool IsFainted() const;
//region Stat APIs
void SetBattle(Battle* battle);
void SetBattleLibrary(BattleLibrary* library);
void ChangeStatBoost(Core::Statistic stat, int8_t diffAmount);
[[nodiscard]] uint32_t GetFlatStat(Core::Statistic stat) const;
[[nodiscard]] uint32_t GetBoostedStat(Core::Statistic stat) const;
[[nodiscard]] uint32_t GetBaseStat(Core::Statistic stat) const;
[[nodiscard]] uint32_t GetStatPotential(Core::Statistic stat) const;
[[nodiscard]] uint32_t GetStatExperience(Core::Statistic stat) const;
void RecalculateFlatStats();
void RecalculateBoostedStats();
void RecalculateFlatStat(Core::Statistic);
void RecalculateBoostedStat(Core::Statistic);
//endregion
};
}
#endif //CREATURELIB_CREATURE_HPP