Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ogs::core::Feat Class Reference

A feat is a feature that provides a special power, property, or other improvement.

#include <Feat.h>

Inheritance diagram for ogs::core::Feat:

Inheritance graph
[legend]
Collaboration diagram for ogs::core::Feat:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Compatibility { EXCLUSIVE = 1, REPEATABLE = 2, CUMULATIVE = 3 }
 The compatibility of a feat determine how multiple instances of the same feat interact with each other. More...

enum  Group { GENERAL = 1, COMBAT = 2, MAGIC = 3, SPECIAL = 4 }
 The group that a feat belongs to. More...


Public Member Functions

Compatibility getCompatibility () const
 Determine the compatibility of this feat.

Group getGroup () const
 Determine the group that this feat belongs to.


Static Public Member Functions

unsigned getSlotCount (XP::Level xpLevel)
 Determine number of slots available for feats at a given experience level.

XP::Level getSlotCountLevel (unsigned slotCount)
 Determine experience level required for a given number of available slots for feats.


Protected Member Functions

 Feat (Compatibility compatibility, Group group=GENERAL)
 Create a new feat.

virtual bool canAttach (const Object &object) const
 Determine if this feat can be attached to an object.

CreaturegetCreature ()
 Determine the creature that this feat is attached to.

template<class T> bool findFeat (const Object &object) const
 Determine if a creature has a feat.


Member Enumeration Documentation

enum ogs::core::Feat::Compatibility
 

Enumeration values:
EXCLUSIVE  Indicates that the feat may be taken only once.

Only one instance of an exclusive feat may be attached to a creature.

REPEATABLE  Indicates that the feat may be taken more than once with distinct effects.

Multiple instances of a repeatable feat may be attached to a creature. Each instance of the feat has a different effect. For example, each time the Exotic Weapon Proficiency is taken, the feat applies to a different exotic weapon.

CUMULATIVE  Indicates the the feat may be taken more than once with cumulative effects.

Multiple instances of a repeatable feat may be attached to a creature. The effects of each instance are added together. For example, the Toughness feat adds 3 hit points each time it is taken.

enum ogs::core::Feat::Group
 

Feats can be classified into several different groups.

Enumeration values:
GENERAL  A general-purpose feat.

General feats are feats that can be used by all creatures and cclasses or apply to many different situations.

COMBAT  A combat-use feat.

Combat feats are feats that are specifically designed for use in combat. The bonus feats granted to fighters are limited to combat feats.

MAGIC  A magic-related feat.

Magic feats include metamagic feats for enhancing spells and item creation feats for creating magic items. The bonus feats granted to wizards are limited to magic feats.

SPECIAL  A feat that does not belong to one of the other groups.

Special feats are feats that can only be selected only by particular cclasses or creatures or used in certain situations.


Member Function Documentation

bool Feat::canAttach const Object &  object  )  const [protected, virtual]
 

Feats can only be attached to creatures. If the object is not a creature, this function will return false.

Parameters:
object Object to attach this feature to.
Returns:
True if the feature is attached to the object.

Reimplemented from ogs::core::Feature.

template<class T>
bool ogs::core::Feat::findFeat const Object &  object  )  const [protected]
 

This function only checks for an instance of the template parameter T. If the object is not a creature, this function will return false.

Parameters:
object Object (Creature) to check.
Returns:
True if creature has an instance of T.

Feat::Compatibility ogs::core::Feat::getCompatibility  )  const [inline]
 

Returns:
Compatibility of this feat.

Reimplemented in ogs::feats::BonusFeat, ogs::feats::ImprovedInitiative, ogs::feats::ImprovedSave, and ogs::feats::SingleWeapon< _WeaponType >.

Creature * ogs::core::Feat::getCreature  )  [inline, protected]
 

This function returns the same value as the Feature::getObject() function. It is provided solely for the convenience of derived classes.

Returns:
Creature that this feat is attached to or NULL if not attached.

Feat::Group ogs::core::Feat::getGroup  )  const [inline]
 

Returns:
Group that this feat belongs to.

Reimplemented in ogs::feats::BonusFeat, ogs::feats::ImprovedInitiative, and ogs::feats::ImprovedSave.

unsigned ogs::core::Feat::getSlotCount XP::Level  xpLevel  )  [inline, static]
 

Parameters:
xpLevel Experience level of a character.
Returns:
Number of slots available for feats.

XP::Level Feat::getSlotCountLevel unsigned  slotCount  )  [static]
 

This method is the inverse of the getSlotCount() function.

Parameters:
slotCount Number of slots available for feats.
Returns:
Required experience level of character.


The documentation for this class was generated from the following files:
Generated on Sun Apr 20 03:38:10 2003 for Open Gaming System (OGS) by doxygen1.3