|
OGS Java API Spec | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ogs.support.Object | +--ogs.core.Ability
A basic characteristic of an entity. 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.
Nested Class Summary | |
class |
Ability.AverageMethod
A method that generates average ability scores. |
class |
Ability.HighPoweredMethod
A method that generates "high-powered" ability scores. |
class |
Ability.Method
A function object that generates an ability score. |
class |
Ability.Modifier
The modifier resulting from the current score of an ability. |
class |
Ability.StandardMethod
A method that generates above-average ability scores. |
Field Summary | |
static byte |
CHA
A ability that determines leadership and charm. |
static byte |
CON
An ability that determines fitness and vigor. |
static byte |
DEX
An ability that determines agility and quickness. |
static byte |
INT
An ability that determines reasoning and deduction. |
static byte |
NUM
Number of ability types. |
static byte |
STR
An ability that determines physical power and force. |
static byte |
WIS
An ability that determines intuition and judgement. |
Fields inherited from class ogs.support.Object |
listeners |
Constructor Summary | |
Ability(int abilityType)
Create a new ability score. |
|
Ability(int abilityType,
Ability.Method method)
Create a new ability score using a method. |
Method Summary | |
byte |
getCurrentScore()
Determine the current ability score. |
static int |
getIncreases(int xpLevel)
Determine number of ability increases available at a given experience level. |
static int |
getIncreasesLevel(int increases)
Determine experience level required for a given number of ability increases. |
Ability.Modifier |
getModifier()
Determine the ability modifier for this ability. |
static byte |
getModifier(byte score)
Calculate the ability score modifier for an ability score. |
Modifiers |
getModifiers()
Determine the score modifiers for this ability. |
byte |
getOriginalScore()
Determine the original ability score. |
protected void |
handleEvent(EventObject event)
Updates the current score by adding all modifiers to the original score. |
Methods inherited from class ogs.support.Object |
addListener, notifyListeners, removeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte STR
Strength
,
Constant Field Valuespublic static final byte DEX
Defense
,
Saves
,
Constant Field Valuespublic static final byte CON
Saves
,
Constant Field Valuespublic static final byte INT
public static final byte WIS
Saves
,
Constant Field Valuespublic static final byte CHA
public static final byte NUM
Constructor Detail |
public Ability(int abilityType)
abilityType
- A type of ability.
IllegalArgumentException
- If abilityType is not valid.public Ability(int abilityType, Ability.Method method)
abilityType
- A type of ability.method
- A method for generating an ability score.
IllegalArgumentException
- If abilityType is not valid.Method Detail |
public static byte getModifier(byte score)
score
- An ability score.
public static int getIncreases(int xpLevel)
xpLevel
- Experience level of character.
public static int getIncreasesLevel(int increases)
getIncreases(int)
.method.
increases
- Number of ability increases available.
public byte getOriginalScore()
public byte getCurrentScore()
public Modifiers getModifiers()
public Ability.Modifier getModifier()
protected void handleEvent(EventObject event)
handleEvent
in class Object
event
- An event object (not currently used).
|
OGS Java API Spec | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |