OGS Java API Spec

ogs.core
Class Creature

java.lang.Object
  |
  +--ogs.support.Object
        |
        +--ogs.core.Entity
              |
              +--ogs.core.Creature
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
Humanoid, Undead

public abstract class Creature
extends Entity

A creature is a living entity. A living entity is defined as an animate and/or sentient entity. The Creature class is an abstract base class that represents the common characteristics shared by all creatures.


Field Summary
static int BURROW
          An integer constant representing modes of movement such as burrowing through earth.
static int CLIMB
          An integer constant representing modes of movement such as climbing or swinging.
static int FLY
          An integer constant representing modes of movement such as flying through air.
static int SWIM
          An integer constant representing modes of movement such as swimming through water.
static int WALK
          An integer constant representing modes of movement such as walking, running, or crawling.
 
Fields inherited from class ogs.core.Entity
currentHealth, defense, maximumHealth, size, weight
 
Fields inherited from class ogs.support.Object
listeners
 
Constructor Summary
protected Creature()
          Create a new creature.
 
Method Summary
 void addFeat(Feat feat)
          Add a feat to this creature.
 void addSkill(Skill skill)
          Add a skill to this creature.
 Abilities getAbilities()
          Determine the ability scores for this creature.
 Collection getBody()
          Determine the body parts that compose the body of this creature.
 Collection getFeats()
          Determine the current list of feats.
 Modifiers getInitiative()
          Determine the initiative modifiers for this creature.
 Saves getSaves()
          Determine the saving throw modifiers for this creature.
 Collection getSkills()
          Determine the current skills of this creature.
 double getSpeed(int whichOne)
          Determine the speed (movement rate) of this creature.
 void removeFeat(Feat feat)
          Remove a feat from this creature.
 void removeSkill(Skill skill)
          Remove a skill from this creature.
 void setSpeed(int whichOne, double speed)
          Change the speed (movement rate) for this creature.
 
Methods inherited from class ogs.core.Entity
getCurrentHealth, getDefense, getMaximumHealth, getSize, getWeight, setCurrentHealth, setMaximumHealth, setWeight
 
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

WALK

public static final int WALK
An integer constant representing modes of movement such as walking, running, or crawling. This constant is used in the #getSpeed() and #setSpeed() methods.

See Also:
Constant Field Values

CLIMB

public static final int CLIMB
An integer constant representing modes of movement such as climbing or swinging. This constant is used in the #getSpeed() and #setSpeed() methods.

See Also:
Constant Field Values

SWIM

public static final int SWIM
An integer constant representing modes of movement such as swimming through water. This constant is used in the #getSpeed() and #setSpeed() methods.

See Also:
Constant Field Values

FLY

public static final int FLY
An integer constant representing modes of movement such as flying through air. This constant is used in the #getSpeed() and #setSpeed() methods.

See Also:
Constant Field Values

BURROW

public static final int BURROW
An integer constant representing modes of movement such as burrowing through earth. This constant is used in the #getSpeed() and #setSpeed() methods.

See Also:
Constant Field Values
Constructor Detail

Creature

protected Creature()
Create a new creature. One of the Creature constructors must always be called first in constructors of subclasses. This method adds modifiers to appropriate targets. Dexterity modifier is added to initiative, defense, and Reflex save; Constitution modifier added to Fortitude save; and Wisdom modifier added to Will save.

Method Detail

getAbilities

public Abilities getAbilities()
Determine the ability scores for this creature.

Returns:
A set of ability scores.

getSaves

public Saves getSaves()
Determine the saving throw modifiers for this creature.

Returns:
A set of saving throw modifiers.

getSpeed

public double getSpeed(int whichOne)
Determine the speed (movement rate) of this creature. Units for this movement rate are locale dependent.

Parameters:
whichOne - One of the five speed constants: WALK, CLIMB, FLY, SWIM, BURROW.
Returns:
A speed or 0.0 if whichOne is invalid.

setSpeed

public void setSpeed(int whichOne,
                     double speed)
Change the speed (movement rate) for this creature.

Parameters:
whichOne - One of the five speed constants: WALK, CLIMB, FLY, SWIM, BURROW.
speed - Movement rate.

getInitiative

public Modifiers getInitiative()
Determine the initiative modifiers for this creature.


getSkills

public Collection getSkills()
Determine the current skills of this creature.

Returns:
current list of skills

addSkill

public void addSkill(Skill skill)
Add a skill to this creature.

Parameters:
skill - new skill

removeSkill

public void removeSkill(Skill skill)
Remove a skill from this creature.

Parameters:
skill - old skil

getFeats

public Collection getFeats()
Determine the current list of feats.

Returns:
current list of feats

addFeat

public void addFeat(Feat feat)
Add a feat to this creature.

Parameters:
feat - new feat

removeFeat

public void removeFeat(Feat feat)
Remove a feat from this creature.

Parameters:
feat - old feat

getBody

public Collection getBody()
Determine the body parts that compose the body of this creature.

Returns:
A collection of body parts for this creature.

OGS Java API Spec