OGS Java API Spec

ogs.core
Class Abilities

java.lang.Object
  |
  +--ogs.core.Abilities

public class Abilities
extends Object

A set of ability scores. A set of ability scores normally consists of one score for each ability. Some entities however may not possess all six abilities. Certain creatures for example may lack Intelligence, Constitution, Strength, or some other ability by their very nature.


Constructor Summary
Abilities()
          Create a new set of ability scores.
Abilities(Ability.Method method)
          Create a new set of ability scores using a method.
 
Method Summary
 boolean canRerollAverage()
          Determine if this set of abilities can be rerolled using the average method.
 boolean canRerollHighPowered()
          Determine if this set of abilities can be rerolled using the high-powered method.
 boolean canRerollStandard()
          Determine if this set of abilities can be rerolled using the standard method.
 Ability getAbility(int abilityType)
          Determine the ability for a given type.
 Iterator getIterator()
          Determine the iterator for this set of abilities.
 boolean isComplete()
          Determine if this set is a complete set of abilities.
 void removeAbility(int abilityType)
          Remove an ability from this set of abilities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Abilities

public Abilities()
Create a new set of ability scores. This constructor uses the standard method to create a complete set of all six ability scores.


Abilities

public Abilities(Ability.Method method)
Create a new set of ability scores using a method. This constructor uses the provided method to create a complete set of all six ability scores.

Parameters:
method - A method for generating ability scores.
Method Detail

getIterator

public Iterator getIterator()
Determine the iterator for this set of abilities.

Returns:
Iterator for this set of abilities.

getAbility

public Ability getAbility(int abilityType)
Determine the ability for a given type. If an ability for the type does not exist in this set, this operator returns null.

Parameters:
abilityType - Type of ability.
Returns:
An ability or null if the ability does not exist.

removeAbility

public void removeAbility(int abilityType)
Remove an ability from this set of abilities.

Parameters:
abilityType - Type of ability to be removed.

isComplete

public boolean isComplete()
Determine if this set is a complete set of abilities. A complete set of abilities contains all six ability scores.

Returns:
True if this set is a complete set of abilities.

canRerollStandard

public boolean canRerollStandard()
Determine if this set of abilities can be rerolled using the standard method. Abilities that are rolled using the standard method can be rerolled if the total ability modifier is 0 or less or all scores are 13 or less.

Returns:
True if abilities can be rerolled.

canRerollAverage

public boolean canRerollAverage()
Determine if this set of abilities can be rerolled using the average method. Abilities that are rolled using the average method can be rerolled if the total ability modifier is -3 or less or all scores are 11 or less.

Returns:
True if abilities can be rerolled.

canRerollHighPowered

public boolean canRerollHighPowered()
Determine if this set of abilities can be rerolled using the high-powered method. Abilities that are rolled using the high-powered method can be rerolled if the total ability modifier is +1 or less or all scores are 14 or less.

Returns:
True if abilities can be rerolled.

OGS Java API Spec