OGS Java API Spec

ogs.core
Class Feat

java.lang.Object
  |
  +--ogs.support.Object
        |
        +--ogs.core.Feature
              |
              +--ogs.core.Feat
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
Alertness, ArmorProficiency, ImprovedInitiative, ImprovedSave, MetamagicFeat, ShieldProficiency, Toughness, WeaponProficiency

public abstract class Feat
extends Feature

A feat is a feature that provides a special power, property, or other improvement.


Field Summary
static int COMBAT
          A combat-use feat.
static int CUMULATIVE
          Indicates the the feat may be taken more than once with cumulative effects.
static int EXCLUSIVE
          Indicates that the feat may be taken only once.
static int GENERAL
          A general-purpose feat.
static int MAGIC
          A magic-related feat.
static int REPEATABLE
          Indicates that the feat may be taken more than once with distinct effects.
static int SPECIAL
          A feat that does not belong to one of the other groups.
 
Fields inherited from class ogs.support.Object
listeners
 
Constructor Summary
Feat()
           
 
Method Summary
protected  boolean canAttach(Object object)
          Determine if this feat can be attached to an object.
protected  boolean findFeat(Object creatureObject, Class featClass)
          Determine if a creature has a feat.
abstract  int getCompatibility()
          Determine the compatibility of this type of feat.
abstract  int getGroup()
          Determine the group of this type of feat.
static int getSlots(int xpLevel)
          Determine number of slots available for feats at a given experience level.
static int getSlotsLevel(int slots)
          Determine experience level required for a given number of available slots for feats.
 
Methods inherited from class ogs.core.Feature
attachObject, 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
 

Field Detail

EXCLUSIVE

public static final int EXCLUSIVE
Indicates that the feat may be taken only once. Only one instance of an exclusive feat may be attached to a creature.

See Also:
Constant Field Values

REPEATABLE

public static final int REPEATABLE
Indicates that the feat may be taken more than once with distinct effects. Multiple instances of a repeatable feat may be attached to a creature. Each instance of the feat has a different effect. For example, each time the Exotic Weapon Proficiency is taken, the feat applies to a different exotic weapon.

See Also:
Constant Field Values

CUMULATIVE

public static final int CUMULATIVE
Indicates the the feat may be taken more than once with cumulative effects. Multiple instances of a repeatable feat may be attached to a creature. The effects of each instance are added together. For example, the Toughness feat adds 3 hit points each time it is taken.

See Also:
Constant Field Values

GENERAL

public static final int GENERAL
A general-purpose feat. General feats are feats that can be used by all creatures and cclasses or apply to many different situations.

See Also:
Constant Field Values

COMBAT

public static final int COMBAT
A combat-use feat. Combat feats are feats that are specifically designed for use in combat. The bonus feats granted to fighters are limited to combat feats.

See Also:
Constant Field Values

MAGIC

public static final int MAGIC
A magic-related feat. Magic feats include metamagic feats for enhancing spells and item creation feats for creating magic items. The bonus feats granted to wizards are limited to magic feats.

See Also:
Constant Field Values

SPECIAL

public static final int SPECIAL
A feat that does not belong to one of the other groups. Special feats are feats that can only be selected only by particular cclasses or creatures or used in certain situations.

See Also:
Constant Field Values
Constructor Detail

Feat

public Feat()
Method Detail

getSlots

public static int getSlots(int xpLevel)
Determine number of slots available for feats at a given experience level.

Parameters:
xpLevel - An experience level.
Returns:
Number of slots available for feats.

getSlotsLevel

public static int getSlotsLevel(int slots)
Determine experience level required for a given number of available slots for feats. This method is the inverse of getSlots(int).

Parameters:
slots - Number of slots available for feats.
Returns:
Required experience level.

getCompatibility

public abstract int getCompatibility()
Determine the compatibility of this type of feat.

Returns:
EXCLUSIVE, REPEATBLE, or CUMULATIVE.

getGroup

public abstract int getGroup()
Determine the group of this type of feat.

Returns:
GENERAL, COMBAT, MAGIC, or SPECIAL.

canAttach

protected boolean canAttach(Object object)
Determine if this feat can be attached to an object. Feats can only be attached to creatures. If the object is not a creature, this function will return false.

Overrides:
canAttach in class Feature
Parameters:
object - Object to attach this feature to.
Returns:
True if the feature is attached to the object.

findFeat

protected boolean findFeat(Object creatureObject,
                           Class featClass)
Determine if a creature has a feat. If the specified object is not a creature, this method will return false.

Parameters:
creatureObject - Object (creature) to check for feat.
featClass - Class of feat.
Returns:
True if creature has an instance of the feat.

OGS Java API Spec