#include <Creature.h>
Inheritance diagram for ogs::core::Creature:
Public Types | |
typedef std::list< BodyPart > | Body |
A list of body parts. | |
Public Member Functions | |
const Die & | getHitDice () const |
Determine the hit dice for this creature. | |
Die & | getHitDice () |
Determine the hit dice for this creature. | |
const Modifiers & | getInitiative () const |
Determine the initiative modifiers for this creature. | |
Modifiers & | getInitiative () |
Determine the initiative modifiers for this creature. | |
Die::Value | rollInitiative () const |
Roll initiative. | |
const Saves & | getSaves () const |
Determine the saving throws for this creature. | |
Saves & | getSaves () |
Determine the saving throws for this creature. | |
const Abilities & | getAbilities () const |
Determine the abilities for this character. | |
Abilities & | getAbilities () |
Determine the abilities for this character. | |
Skills | getSkills () const |
Determine the skills for this creature. | |
bool | addSkill (Skill &skill) |
Add a skill to this creature. | |
bool | removeSkill (Skill &skill) |
Remove a skill from this creature. | |
Feats | getFeats () const |
Determine the feats for this creature. | |
bool | addFeat (Feat &feat) |
Add a feat to this creature. | |
bool | removeFeat (Feat &feat) |
Remove a feat from this creature. | |
Body | getBody () const |
Determine the body parts of this creature. | |
bool | equipItem (Item &item) |
Equip an item on this body. | |
bool | equipItem (Item &item, BodyPart &part) |
Equip an item on a part of this body. | |
bool | unequipItem (Item &item) |
Remove an equipped item from this body. | |
Character * | getCharacter () const |
Determine if this creature is a character. | |
Protected Types | |
typedef std::vector< BodyPart::Type > | Parts |
An array of body part types. | |
Protected Member Functions | |
Creature (Die hitDice, Abilities abilities, Size::Type size=Size::MEDIUM, Parts parts=Parts()) | |
Create a new creature. |
|
This class does not know what sort of bodies that derived classes may have and derived classes do not have access to "this" creature in initializer lists. So derived classes provide the Creature constructor with an array of body part types which it can then turn into a body using "this" creature. |
|
This constructor is protected so only derived classes can call it. The new creature has no skills, no feats, and no hit dice. Ability scores rolled using the standard method and no character is associated with the creature.
|
|
|
|
This function adds the skill only if another skill of the same type is not already present.
|
|
If the item can not be equipped on the specified part of the body, this function will return false.
|
|
This function will cycle through all body parts until it finds one where the item can be equipped. If it cannot find a part, this function will return false.
|
|
This function allows the caller to add and remove modifiers to the ability scores of this creature.
|
|
|
|
|
|
If this creature is a character, a pointer to the Character object is returned. Otherwise, a null pointer is returned.
|
|
|
|
This function allows the caller to change the hit dice of this creature.
|
|
|
|
This function allows the caller to add and remove modifiers to intiative rolls for this creature.
|
|
|
|
This function allows the caller to add and remove modifiers to saving throws for this creature.
|
|
|
|
|
|
|
|
|
|
This function rolls 1d20 and adds the initiative modifiers of this creature to the result to produce an initiative roll.
|
|
If the item is not currently equipped or cannot be removed (such as cursed items), this function will return false.
|