OGS Java API Spec

ogs.core
Class Skill

java.lang.Object
  |
  +--ogs.support.Object
        |
        +--ogs.core.Feature
              |
              +--ogs.core.Skill
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
Diplomacy, Spot

public abstract class Skill
extends Feature

A feature that is checked for success or failure. 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.


Field Summary
 
Fields inherited from class ogs.support.Object
listeners
 
Constructor Summary
Skill()
           
 
Method Summary
abstract  boolean applyArmorCheckPenalty()
          Determine if an armor check penalty applies when this skill is used.
 boolean attachObject(Object object)
          Attach this skill to a creature.
 int getCurrentPoints(boolean cclassSkill)
          Determine the current points allocated to this skill.
 int getCurrentRanks()
          Determine the current rank of this skill.
abstract  int getKeyAbility()
          Determine the key ability for this type of skill.
 int getMaximumPoints()
          Determine the maximum points assigned to this skill.
static int getMaximumPoints(int xpLevel)
          Determine the maximum number of points that can be allocated to a skill at a given experience level.
static int getMaximumPointsLevel(int points)
          Determine the experience level for a given number of maximum skill points or ranks in a class skill.
 int getMaximumRanks()
          Determine the maximum rank for this skill.
 Modifiers getModifiers()
          Determine the list of modifiers for checks of this skill.
 void setCurrentPoints(int skillPoints, boolean cclassSkill)
          Change the current points allocated to this skill.
 void setMaximumPoints(int skillPoints)
          Change the maximum points assigned to this skill.
abstract  boolean useUntrained()
          Determine if this type of skill can be used untrained.
 
Methods inherited from class ogs.core.Feature
canAttach, canDetach, detachObject, getObject
 
Methods inherited from class ogs.support.Object
addListener, handleEvent, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Skill

public Skill()
Method Detail

getMaximumPoints

public static int getMaximumPoints(int xpLevel)
Determine the maximum number of points that can be allocated to a skill at a given experience level. 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:
Skill

getMaximumPointsLevel

public static int getMaximumPointsLevel(int points)
Determine the experience level for a given number of maximum skill points or ranks in a class skill.

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

getKeyAbility

public abstract int getKeyAbility()
Determine the key ability for this type of skill. The modifier of the key ability is always added to the skill check. Derived classes must implement this method to return the appropriate type of ability.

Returns:
Type of ability: STR, DEX, CON, INT, WIS, or CHA.

useUntrained

public abstract boolean useUntrained()
Determine if this type of skill can be used untrained. Untrained skills can be used even if a creature has no ranks in the skill. Subclasses must override this method if the skill is an untrained skill.


applyArmorCheckPenalty

public abstract boolean applyArmorCheckPenalty()
Determine if an armor check penalty applies when this skill is used. Subclasses must override this method if an armor check penalty is added to skill checks.


attachObject

public boolean attachObject(Object object)
Attach this skill to a creature. This method adds the modifier from the key ability of the creature (if it exists) to the check modifiers for this skill. This method will return false if the object is not an instance of a class derived from the Creature class.

Overrides:
attachObject in class Feature
Parameters:
object - An instance of a Creature subclass.
Returns:
True if skill is attached to creature.

getMaximumPoints

public int getMaximumPoints()
Determine the maximum points assigned to this skill. 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.

setMaximumPoints

public void setMaximumPoints(int skillPoints)
Change the maximum points assigned to this skill.

Parameters:
skillPoints - Maximum skill points.

getMaximumRanks

public int getMaximumRanks()
Determine the maximum rank for this skill. 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.

getCurrentPoints

public int getCurrentPoints(boolean cclassSkill)
Determine the current points allocated to this skill. 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.

setCurrentPoints

public void setCurrentPoints(int skillPoints,
                             boolean cclassSkill)
Change the current points allocated to this skill. The current points can be changed as a cclass skill or a cross-cclass skill. If the total of all skill points

Parameters:
skillPoints - Current skill points.
cclassSkill - True if points are for a cclass skill or false if points are for a cross-class skill.
Throws:
RuntimeException - If the maximum skill rank is exceeded.

getCurrentRanks

public int getCurrentRanks()
Determine the current rank of this skill. 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.

getModifiers

public Modifiers getModifiers()
Determine the list of modifiers for checks of this skill.

Returns:
A list of modifiers for this skill.

OGS Java API Spec