Added Creature C Interface, misc fixes and changes for Creature.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -42,7 +42,7 @@ namespace CreatureLib::Battling {
|
||||
bool _onBattleField = false;
|
||||
|
||||
std::string _nickname = "";
|
||||
TalentIndex _talentIndex;
|
||||
CreatureLib::Library::TalentIndex _talentIndex;
|
||||
Script* _activeTalent = nullptr;
|
||||
|
||||
bool _hasOverridenTalent;
|
||||
@@ -61,7 +61,7 @@ namespace CreatureLib::Battling {
|
||||
Creature(const BattleLibrary* library, const Library::CreatureSpecies* species,
|
||||
const Library::SpeciesVariant* variant, uint8_t level, uint32_t experience, uint32_t uid,
|
||||
Library::Gender gender, uint8_t coloring, const Library::Item* heldItem, std::string nickname,
|
||||
const TalentIndex& talent, std::vector<LearnedAttack*> attacks);
|
||||
const Library::TalentIndex& talent, std::vector<LearnedAttack*> attacks);
|
||||
|
||||
virtual ~Creature() {
|
||||
for (auto attack : _attacks) {
|
||||
@@ -82,11 +82,15 @@ namespace CreatureLib::Battling {
|
||||
inline uint32_t GetExperience() const { return _experience; }
|
||||
inline Library::Gender GetGender() const { return _gender; }
|
||||
inline uint8_t GetColoring() const { return _coloring; }
|
||||
inline const bool HasHeldItem(const std::string& name) const {
|
||||
inline bool HasHeldItem(const ConstString& name) const {
|
||||
return _heldItem != nullptr && _heldItem->GetName() == name;
|
||||
}
|
||||
inline bool HasHeldItem(uint32_t nameHash) const {
|
||||
return _heldItem != nullptr && _heldItem->GetName() == nameHash;
|
||||
}
|
||||
inline const Library::Item* GetHeldItem() const { return _heldItem; }
|
||||
void SetHeldItem(const Arbutils::CaseInsensitiveConstString& itemName);
|
||||
void SetHeldItem(const ConstString& itemName);
|
||||
void SetHeldItem(uint32_t itemNameHash);
|
||||
inline void SetHeldItem(const Library::Item* item) { _heldItem = item; };
|
||||
|
||||
inline uint32_t GetCurrentHealth() const { return _currentHealth; }
|
||||
@@ -105,7 +109,7 @@ namespace CreatureLib::Battling {
|
||||
[[nodiscard]] bool HasType(uint8_t type) const;
|
||||
|
||||
uint32_t GetMaxHealth() const { return _boostedStats.GetHealth(); }
|
||||
void ChangeLevel(int8_t amount);
|
||||
void ChangeLevelBy(int8_t amount);
|
||||
void Damage(uint32_t damage, DamageSource source);
|
||||
void Heal(uint32_t amount);
|
||||
void OverrideActiveTalent(const ConstString& talent);
|
||||
@@ -120,15 +124,15 @@ namespace CreatureLib::Battling {
|
||||
void AddVolatileScript(Script* script);
|
||||
void RemoveVolatileScript(const ConstString& name);
|
||||
void RemoveVolatileScript(Script* script);
|
||||
void HasVolatileScript(const ConstString& name) const;
|
||||
bool HasVolatileScript(const ConstString& name) const;
|
||||
|
||||
std::vector<LearnedAttack*>& GetAttacks() { return _attacks; }
|
||||
|
||||
const Library::CreatureSpecies* GetDisplaySpecies() const;
|
||||
const Library::SpeciesVariant* GetDisplayVariant() const;
|
||||
|
||||
const void SetDisplaySpecies(Library::CreatureSpecies* species) { _displaySpecies = species; }
|
||||
const void SetDisplayVariant(Library::SpeciesVariant* variant) { _displayVariant = variant; };
|
||||
const void SetDisplaySpecies(const Library::CreatureSpecies* species) { _displaySpecies = species; }
|
||||
const void SetDisplayVariant(const Library::SpeciesVariant* variant) { _displayVariant = variant; };
|
||||
|
||||
// region Stat APIs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user