com.planet_ink.coffee_mud.Common.interfaces
Interface CharState

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

public interface CharState
extends CMCommon, Modifiable

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

See Also:
MOB

Field Summary
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_EXHAUSTED_MILLIS
          constant for how many fatigue points are required to be considered exhausted
static long FATIGUED_MILLIS
          constant for how many fatigue points are required to be considered fatigued
static int REAL_TICK_ADJUST_FACTOR
          constant representing something
static long REST_PER_SIT
          constant for how many fatigue points are lost per tick of rest
static long REST_PER_SLEEP
          constant for how many fatigue points are lost per tick of rest
static java.lang.String[] STAT_DESCS
          stat constant descriptions
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_NUMSTATS
          stat constant for number of other stat constants
static int STAT_THIRST
          stat constant for thirst
static int STAT_TICKSHUNGRY
          stat constant for thirst
static int STAT_TICKSTHIRSTY
          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.
 int adjTicksHungry(boolean bumpUp)
          Used to bump and/or read the number of ticks that this user has been consecutively hungry
 int adjTicksThirsty(boolean bumpUp)
          Used to bump and/or read the number of ticks that this user has been consecutively thirsty
 void copyInto(CharState intoState)
          Copies the internal data of this object into another of kind.
 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 reset()
          Resets all the stats in this object to their factory defaults.
 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, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
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_TICKSHUNGRY

static final int STAT_TICKSHUNGRY
stat constant for thirst

See Also:
Constant Field Values

STAT_TICKSTHIRSTY

static final int STAT_TICKSTHIRSTY
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_DESCS

static final java.lang.String[] STAT_DESCS
stat constant descriptions


ANNOYANCE_DEFAULT_TICKS

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

See Also:
Constant Field Values

REAL_TICK_ADJUST_FACTOR

static final int REAL_TICK_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_SLEEP

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


REST_PER_SIT

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


FATIGUED_MILLIS

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


FATIGUED_EXHAUSTED_MILLIS

static final long FATIGUED_EXHAUSTED_MILLIS
constant for how many fatigue points are required to be considered exhausted

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

adjTicksThirsty

int adjTicksThirsty(boolean bumpUp)
Used to bump and/or read the number of ticks that this user has been consecutively thirsty

Parameters:
bumpUp - true to bump the number by one
Returns:
the ticks of thirstiness

adjTicksHungry

int adjTicksHungry(boolean bumpUp)
Used to bump and/or read the number of ticks that this user has been consecutively hungry

Parameters:
bumpUp - true to bump the number by one
Returns:
the ticks of hungriness

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

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

reset

void reset()
Resets all the stats in this object to their factory defaults.


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:
Modifiable.getStatCodes(), Modifiable.getStat(String)