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

ogs::core::Skill Class Reference

A feature that is checked for success or failure. More...

#include <Skill.h>

Inheritance diagram for ogs::core::Skill:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef int Type
 An integer type that represents a specific type of skill.

typedef unsigned short int Points
 An unsigned integer that represents a number of points invested on increasing the ranks of a skill.

typedef unsigned short int Ranks
 An unsigned integer that represents a number of ranks that are added to checks of a skill.


Public Member Functions

 Skill (Type type, Ability::Type keyAbility, bool useUntrained, bool useArmorPenalty, Points cclassPoints=0)
 Create a new skill.

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

Ability::Type getKeyAbility () const
 Determine the key ability for this type of skill.

bool useUntrained () const
 Determine if this type of ability can be used untrained.

bool useArmorPenalty () const
 Determine if an armor check penalty applies to checks for this skill.

Points getMaximumPoints () const
 Determine the maximum points assigned to this skill.

void setMaximumPoints (Points points)
 Change the maximum number of points that can be invested in this skill.

Ranks getMaximumRanks () const
 Determine the maximum rank for this skill.

Points getCurrentPoints (bool cclassSkill=true) const
 Determine the current points allocated to this skill.

void setCurrentPoints (Points points, bool cclassSkill=true)
 Change the current points allocated to this skill.

Ranks getCurrentRanks () const
 Determine the current rank of this skill.

ModifiersgetModifiers ()
 Determine the modifiers added to checks for this skill.


Static Public Member Functions

Points getMaximumPoints (XP::Level xpLevel)
 Determine the maximum number of points that can be allocated to a skill at a given experience level.

XP::Level getMaximumPointsLevel (Points points)
 Determine the experience level for a given number of maximum skill points or ranks in a class skill.


Protected Member Functions

bool checkMaximumRanks (Points points, bool cclassSkill)
 Determine if a change in skill points will exceed the maximum ranks.


Static Protected Member Functions

Ranks getRanks (Points cclassPoints, Points xclassPoints)
 Determine ranks from cclass skill points and cross-cclass skill * points.


Detailed Description

A skill is checked is checked using basic task resolution The modifiers of the skill are added to the roll of 1d20 and compared to a difficulty check (DC) or to the roll of another skill. The latter case is called an oppposed skill check.

A skill can be reinforced by spending points on it. Skill points are gained each time the character increases in level. Skill points increase the skill rank. A skill rank is essentially the base modifier added to skill checks. Skill ranks are also determined by character classes.

A skill can be related to a character class (cclass) in one of three ways. A cross-cclass skill is a skill that be used by any cclass but each point spent on the skill equals half a rank. A cclass skill is a skill that has one rank for each point spent on it. An exclusive skill is a cclass skill that can only be used by certain cclasses A campaign determines the relationships between cclasses and skills.


Constructor & Destructor Documentation

Skill::Skill Type  type,
Ability::Type  keyAbility,
bool  useUntrained,
bool  useArmorPenalty,
Points  cclassPoints = 0
 

The new skill has no skill points, no ranks, and no modifiers.

Parameters:
type Type of new skill.
keyAbility Key ability of new skill.
useUntrained True if new skill can be used untrained.
useArmorPenalty True if armor penalty applies to skill checks.
cclassPoints Points spent on cclass skill.
Returns:
A new skill.
See also:
ogs::skills::SkillFactory

ogs::skills::CommonSkills


Member Function Documentation

bool Skill::checkMaximumRanks Points  points,
bool  cclassSkill
[protected]
 

Returns:
True if change will not exceed maximum rank.

Skill::Points ogs::core::Skill::getCurrentPoints bool  cclassSkill = true  )  const [inline]
 

For single cclass characters, all of these points are either cclass points or cross-cclass points. For multicclass characters, a skill can have points as a cclass skill and a cross-cclass skill.

Parameters:
cclassSkill True to determine the cclass skill points or false to determine the cross-class skill points.
Returns:
Current skill points.

Skill::Ranks ogs::core::Skill::getCurrentRanks  )  const [inline]
 

The current rank is equal to the number of cclass skill points plus one-half of the cross-cclass skill points.

Returns:
Current skill rank.

Ability::Type ogs::core::Skill::getKeyAbility  )  const [inline]
 

The modifier of the key ability is always added to the skill check.

Returns:
Type of key ability.

Skill::Points ogs::core::Skill::getMaximumPoints  )  const [inline]
 

Maximum points determine the maximum skill rank. For single cclass characters, the maximum rank is equal to maximum points for cclass skills or half this number (rounded down) for cross-cclass skills. For multi-cclass characters, a skill is a cclass skill if at least one of the cclasses uses the skill as a cclass skill. Otherwise, the skill is a cross-cclass skill.

Returns:
Maximum skill points.

Skill::Points ogs::core::Skill::getMaximumPoints XP::Level  xpLevel  )  [inline, static]
 

This value is also the maximum number of ranks in a class skill. For cross-class skills, the maximum number of ranks is one-half this value.

Parameters:
xpLevel Experience level of character.
Returns:
Maximum number of points allocated to a skill.
See also:
ogs.core.Skill

XP::Level ogs::core::Skill::getMaximumPointsLevel Points  points  )  [inline, static]
 

Parameters:
points Maximum number of points allocated to a skill.
Returns:
Equivalent experience level of character.

Skill::Ranks ogs::core::Skill::getMaximumRanks  )  const [inline]
 

If a skill has any cclass points, it is considered a cclass skill and the maximum rank is the same as the maximu points. Otherwise, the skill is a cross-cclass skill and the maximum rank is one-half the maximum points

Returns:
Maximum rank for this skill.

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

Returns:
List of modifiers.

Skill::Ranks ogs::core::Skill::getRanks Points  cclassPoints,
Points  xclassPoints
[inline, static, protected]
 

This function is just a convenient helper function.

Parameters:
cclassPoints Points spent for cclass skill.
xclassPoints Points spent for cross-cclass skill.

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

Returns:
Type of this skill.

void Skill::setCurrentPoints Points  points,
bool  cclassSkill = true
 

The current points can be changed as a cclass skill or a cross-cclass skill. This function does nothing if the current points exceed the maximum points for this skill.

Parameters:
points Current number of skill points.
cclassSkill True if points are for a cclass skill or false if points are for a cross-class skill.
Todo:
Notify observers.

void Skill::setMaximumPoints Points  points  ) 
 

This function does nothing if the maximum points is less than the current points invested in this skill.

Parameters:
points Maximum skill points invested in this skill.
Todo:
Notify observers.

bool ogs::core::Skill::useArmorPenalty  )  const [inline]
 

Returns:
True if an armor check penalty applies.

bool ogs::core::Skill::useUntrained  )  const [inline]
 

Untrained skills can be used even if a creature has no ranks in the skill.

Returns:
True if this skill can be used untrained.


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