nw::CreatureStats

struct CreatureStats

Public Functions

CreatureStats()
CreatureStats(nw::MemoryResource *allocator)
bool from_json(const nlohmann::json &archive)
nlohmann::json to_json() const
bool add_feat(Feat id)

Attempts to add a feat to a creature, returning true if successful.

const Vector<Feat> &feats() const noexcept

Gets the feat array.

int get_ability_score(Ability id) const

Gets an ability score.

int get_skill_rank(Skill id) const

Gets a skill rank.

bool has_feat(Feat id) const noexcept

Determines if creature has a feat.

void remove_feat(Feat id)

Removes a feat

Todo:

This function removes the feat, as likely the game does. But should it remove feats that require this feat?

bool set_ability_score(Ability id, int value)

Sets an ability score, returning true if successful.

bool set_skill_rank(Skill id, int value)

Sets a skill rank, returning true if successful.

Public Members

Saves save_bonus
std::array<uint8_t, 6> abilities_
Vector<Feat> feats_
Vector<uint8_t> skills_

Friends

friend bool deserialize(CreatureStats &self, const GffStruct &archive)
friend bool serialize(const CreatureStats &self, GffBuilderStruct &archive)