com.planet_ink.coffee_mud.Common.interfaces
Interface CharState

All Superinterfaces:
java.lang.Cloneable, CMCommon, CMModifiable, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
DefaultCharState

public interface CharState
extends CMCommon, CMModifiable

An object to access and change fields representing the most variable aspects of a MOB

See Also:
MOB

Field Summary
static int ADJUST_FACTOR
          constant representing something
static int ANNOYANCE_DEFAULT_TICKS
          constant representing how many ticks between hunger/thirst messages
static int DEATH_HUNGER_TICKS
          constant representing how many ticks a MOB can be hungry before death
static int DEATH_THIRST_TICKS
          constant representing how many ticks a MOB can be thirsty before death
static long FATIGUED_MILLIS
          constant for how many fatigue points are required to be considered fatigued
static long REST_PER_TICK
          constant for how many fatigue points are lost per tick of rest
static int STAT_HITPOINTS
          stat constant for hit points
static int STAT_HUNGER
          stat constant for hunger
static int STAT_MANA
          stat constant for mana
static int STAT_MOVE
          stat constant for movement
static int STAT_NUM_BASE_STATS
          stat constant for number of base stat constants
static int STAT_NUMSTATS
          stat constant for number of other stat constants
static int STAT_THIRST
          stat constant for thirst
 
Method Summary
 boolean adjFatigue(long byThisMuch, CharState max)
          Set the number of fatigue points, respecting boundaries.
 boolean adjHitPoints(int byThisMuch, CharState max)
          Set the number of hit points, respecting boundaries.
 boolean adjHunger(int byThisMuch, int maxHunger)
          Set the number of hunger points, respecting boundaries.
 boolean adjMana(int byThisMuch, CharState max)
          Set the number of mana points, respecting boundaries.
 boolean adjMovement(int byThisMuch, CharState max)
          Set the number of movement points, respecting boundaries.
 boolean adjThirst(int byThisMuch, int maxThirst)
          Set the number of thirst points, respecting boundaries.
 void copyInto(CharState intoState)
          Copies the internal data of this object into another of kind.
 void expendEnergy(MOB mob, CharState maxState, boolean expendMovement)
          During movement and combat, this method will be called to allow the movement to be expended and hunger/thirst to occur.
 java.lang.String getCombatStats()
          Get primary combat stats as displayable code string
 long getFatigue()
          Get the number of fatigue points for the player
 int getHitPoints()
          Get the number of hit points for the player
 int getHunger()
          Get the number of hunger points for the player
 int getMana()
          Get the number of mana points for the player
 int getMovement()
          Get the number of movement points for the player
 int getThirst()
          Get the number of thirst points for the player
 int maxHunger(int baseWeight)
          This method is used to recalculate the maximum thirhungerst for a mob, based on their weight and the default maximum hunger
 int maxThirst(int baseWeight)
          This method is used to recalculate the maximum thirst for a mob, based on their weight and the default maximum thirst
 void recoverTick(MOB mob, CharState maxState)
          During rest, and even standing still, this method will be called to allow the fields in this object to recover some of their value.
 boolean sameAs(CharState E)
          Whether this object instance is functionally identical to the object passed in.
 void setAllValues(int def)
          Sets all the values in this object to a single given value
 void setFatigue(long newVal)
          Set the number of fatigue points
 void setHitPoints(int newVal)
          Set the number of hit points
 void setHunger(int newVal)
          Set the number of hunger points
 void setMana(int newVal)
          Set the number of mana points
 void setMovement(int newVal)
          Set the number of movement points
 void setThirst(int newVal)
          Set the number of thirst points
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMModifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 

Field Detail

STAT_HITPOINTS

static final int STAT_HITPOINTS
stat constant for hit points

See Also:
Constant Field Values

STAT_MANA

static final int STAT_MANA
stat constant for mana

See Also:
Constant Field Values

STAT_MOVE

static final int STAT_MOVE
stat constant for movement

See Also:
Constant Field Values

STAT_HUNGER

static final int STAT_HUNGER
stat constant for hunger

See Also:
Constant Field Values

STAT_THIRST

static final int STAT_THIRST
stat constant for thirst

See Also:
Constant Field Values

STAT_NUMSTATS

static final int STAT_NUMSTATS
stat constant for number of other stat constants

See Also:
Constant Field Values

STAT_NUM_BASE_STATS

static final int STAT_NUM_BASE_STATS
stat constant for number of base stat constants

See Also:
Constant Field Values

ANNOYANCE_DEFAULT_TICKS

static final int ANNOYANCE_DEFAULT_TICKS
constant representing how many ticks between hunger/thirst messages

See Also:
Constant Field Values

ADJUST_FACTOR

static final int ADJUST_FACTOR
constant representing something

See Also:
Constant Field Values

DEATH_THIRST_TICKS

static final int DEATH_THIRST_TICKS
constant representing how many ticks a MOB can be thirsty before death

See Also:
Constant Field Values

DEATH_HUNGER_TICKS

static final int DEATH_HUNGER_TICKS
constant representing how many ticks a MOB can be hungry before death

See Also:
Constant Field Values

REST_PER_TICK

static final long REST_PER_TICK
constant for how many fatigue points are lost per tick of rest

See Also:
Constant Field Values

FATIGUED_MILLIS

static final long FATIGUED_MILLIS
constant for how many fatigue points are required to be considered fatigued

See Also:
Constant Field Values
Method Detail

getCombatStats

java.lang.String getCombatStats()
Get primary combat stats as displayable code string

Returns:
primary combat stats as displayable code string

getFatigue

long getFatigue()
Get the number of fatigue points for the player

Returns:
number of fatigue points

setFatigue

void setFatigue(long newVal)
Set the number of fatigue points

Parameters:
newVal - number of fatigue points

adjFatigue

boolean adjFatigue(long byThisMuch,
                   CharState max)
Set the number of fatigue points, respecting boundaries. 0 is always lowest.

Parameters:
byThisMuch - a positive or negative change in value
max - the highest amount to allow the fatigue number to reach
Returns:
whether the highest or lowest boundary was reached

getHitPoints

int getHitPoints()
Get the number of hit points for the player

Returns:
number of hit points

setHitPoints

void setHitPoints(int newVal)
Set the number of hit points

Parameters:
newVal - number of hit points

adjHitPoints

boolean adjHitPoints(int byThisMuch,
                     CharState max)
Set the number of hit points, respecting boundaries. 0 is always lowest.

Parameters:
byThisMuch - a positive or negative change in value
max - the highest amount to allow the hit points number to reach
Returns:
whether the highest or lowest boundary was reached

getHunger

int getHunger()
Get the number of hunger points for the player

Returns:
number of hunger points

setHunger

void setHunger(int newVal)
Set the number of hunger points

Parameters:
newVal - number of hunger points

adjHunger

boolean adjHunger(int byThisMuch,
                  int maxHunger)
Set the number of hunger points, respecting boundaries. 0 is always lowest.

Parameters:
byThisMuch - a positive or negative change in value
maxHunger - the highest amount to allow the hunger number to reach
Returns:
whether the highest or lowest boundary was reached

maxHunger

int maxHunger(int baseWeight)
This method is used to recalculate the maximum thirhungerst for a mob, based on their weight and the default maximum hunger

Parameters:
baseWeight - the base weight of the mob
Returns:
the new maximum hunger to set

getThirst

int getThirst()
Get the number of thirst points for the player

Returns:
number of thirst points

setThirst

void setThirst(int newVal)
Set the number of thirst points

Parameters:
newVal - number of thirst points

adjThirst

boolean adjThirst(int byThisMuch,
                  int maxThirst)
Set the number of thirst points, respecting boundaries. 0 is always lowest.

Parameters:
byThisMuch - a positive or negative change in value
maxThirst - the highest amount to allow the thirst number to reach
Returns:
whether the highest or lowest boundary was reached

maxThirst

int maxThirst(int baseWeight)
This method is used to recalculate the maximum thirst for a mob, based on their weight and the default maximum thirst

Parameters:
baseWeight - the base weight of the mob
Returns:
the new maximum thirst to set

getMana

int getMana()
Get the number of mana points for the player

Returns:
number of mana points

setMana

void setMana(int newVal)
Set the number of mana points

Parameters:
newVal - number of mana points

adjMana

boolean adjMana(int byThisMuch,
                CharState max)
Set the number of mana points, respecting boundaries. 0 is always lowest.

Parameters:
byThisMuch - a positive or negative change in value
max - the highest amount to allow the mana number to reach
Returns:
whether the highest or lowest boundary was reached

getMovement

int getMovement()
Get the number of movement points for the player

Returns:
number of movement points

setMovement

void setMovement(int newVal)
Set the number of movement points

Parameters:
newVal - number of movement points

adjMovement

boolean adjMovement(int byThisMuch,
                    CharState max)
Set the number of movement points, respecting boundaries. 0 is always lowest.

Parameters:
byThisMuch - a positive or negative change in value
max - the highest amount to allow the movement number to reach
Returns:
whether the highest or lowest boundary was reached

recoverTick

void recoverTick(MOB mob,
                 CharState maxState)
During rest, and even standing still, this method will be called to allow the fields in this object to recover some of their value. It is called by the mob tick(Tickable,int) method every Tickable.TIME_TICK milliseconds

Parameters:
mob - the mob recovering
maxState - The CharState objects which represents the maximum values for these fields
See Also:
MOB

expendEnergy

void expendEnergy(MOB mob,
                  CharState maxState,
                  boolean expendMovement)
During movement and combat, this method will be called to allow the movement to be expended and hunger/thirst to occur. It is called by methods executing the appropriate events when they are performed and by the mob tick(Tickable,int) method

Parameters:
mob - the mob expending
maxState - The CharState objects which represents the maximum values for these fields
expendMovement - whether to skip movement expending
See Also:
MOB

setAllValues

void setAllValues(int def)
Sets all the values in this object to a single given value

Parameters:
def - the value to give to all

copyInto

void copyInto(CharState intoState)
Copies the internal data of this object into another of kind.

Parameters:
intoState - another CharState object.

sameAs

boolean sameAs(CharState E)
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
CMModifiable.getStatCodes(), CMModifiable.getStat(String)