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

ogs::core::Ability Class Reference

A basic characteristic of an entity. More...

#include <Ability.h>

Inheritance diagram for ogs::core::Ability:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef unsigned short Score
 An ability score.

enum  Type {
  STR = 1, DEX, CON, INT,
  WIS, CHA, NUM = 6
}
 Type of ability. More...


Public Member Functions

 Ability (Type type)
 Create a new ability.

 Ability (Type type, Method &method)
 Create a new ability using a method.

Type getType () const
 Determine the type of this ability.

Score getOriginalScore () const
 Determine the original (unmodified) ability score.

ModifiersgetModifiers ()
 Determine the modifiers added to this ability score.

Score getCurrentScore () const
 Determine the current (modified) ability score.

const ModifiergetModifier () const
 Determine the ability modifier for this ability.

ModifiergetModifier ()
 Determine the ability modifier for this ability.


Static Public Member Functions

bool isValidType (int i)
 Determine if an integer value is a valid ability type.

unsigned getIncreaseCount (XP::Level xpLevel)
 Determine number of ability increases available at a given experience level.

XP::Level getIncreaseCountLevel (unsigned increaseCount)
 Determine experience level required for a given number of ability increases.


Detailed Description

Abilities are most often associated with creatures although certain entities, such as powerful magic items, can also have abilities. The value of an ability is called an ability score. Ability scores are non-negative integer values that can range from 0 up to 20, 30, or even 50 but rarely if ever rise above 100.

An ability score can be modified by adding other modifiers to the unmodified, original score of the ability. The modified, current score is used to determine the ability modifier. Thus, an ability has two kinds of modifiers: zero or more score modifiers that are added to the original score and one ability modifier resulting from the current score.


Member Enumeration Documentation

enum ogs::core::Ability::Type
 

There are only six types of ability scores. Strength, Dexterity, and Constitution are considered "physical" abilities. Intelligence, Wisdom, and Charisma are considered "mental" abilities.

Enumeration values:
STR  An ability that determines physical power and force.

See also:
Strength
DEX  An ability that determines agility and quickness.

A Dexterity modifier is added to ranged attacks with thrown weapons and projectile weapons, defense ratings, and Reflex saving throws.

See also:
Defense

Saves

CON  An ability that determines fitness and vigor.

A Constiution modifier is added to hit die rolls and Fortitude saving throws.

See also:
Saves
INT  An ability that determines reasoning and deduction.
WIS  An ability that determines intuition and judgement.

The Wisdom modifier is added to all Will saving throws.

See also:
Saves
CHA  A ability that determines leadership and charm.
NUM  Number of ability types.


Constructor & Destructor Documentation

Ability::Ability Type  type  ) 
 

The ability score is rolled using the standard method. The ability has no score modifiers and the ability modifier is created with the proper value determined from the ability score.

Parameters:
type A type of ability.
Exceptions:
std::invalid_argument If type is not a valid ability type.

Ability::Ability Type  type,
Method method
 

The ability has no score modifiers and the ability modifier is created with the proper value determined from the ability score.

Parameters:
type A type of ability.
method A method for generating ability scores.
Exceptions:
std::invalid_argument If type is not a valid ability type.


Member Function Documentation

Ability::Score ogs::core::Ability::getCurrentScore  )  const [inline]
 

Returns:
Current score of ability.

unsigned ogs::core::Ability::getIncreaseCount XP::Level  xpLevel  )  [inline, static]
 

Parameters:
xpLevel Experience level of character.
Returns:
Number of ability increases available.

XP::Level Ability::getIncreaseCountLevel unsigned  increaseCount  )  [static]
 

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

Parameters:
increaseCount Number of ability increases needed.
Returns:
Experience level required for increase count.

Modifier & ogs::core::Ability::getModifier  )  [inline]
 

The ability modifier can be added to other modifier lists (such as saving throws and skill checks). Do not change its value directly!

Returns:
Modifier for this ability.

const Modifier & ogs::core::Ability::getModifier  )  const [inline]
 

The ability modifier can be added to other modifier lists (such as saving throws and skill checks).

Returns:
Modifier for this ability.

Modifiers & ogs::core::Ability::getModifiers  )  [inline]
 

Changes made to the object returned by this function will be directly reflected in the current score and ability modifier.

Returns:
A list of modifiers added to this ability score.

Ability::Score ogs::core::Ability::getOriginalScore  )  const [inline]
 

Returns:
Original score of ability.

Ability::Type ogs::core::Ability::getType  )  const [inline]
 

Returns:
Type of this ability (STR, DEX, ...).

bool ogs::core::Ability::isValidType int  i  )  [inline, static]
 

Parameters:
i An integer value.
Returns:
True if integer value is a valid ability type.


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