Modifier and Type | Field | Description |
---|---|---|
protected static int[] |
DEFAULT_STATES |
|
protected long |
fatigue |
|
protected int[] |
states |
ANNOYANCE_DEFAULT_TICKS, DEATH_HUNGER_TICKS, DEATH_THIRST_TICKS, FATIGUED_EXHAUSTED_MILLIS, FATIGUED_MILLIS, REAL_TICK_ADJUST_FACTOR, REST_PER_SIT, REST_PER_SLEEP, STAT_DESCS, STAT_HITPOINTS, STAT_HUNGER, STAT_MANA, STAT_MOVE, STAT_NUMSTATS, STAT_THIRST, STAT_TICKSHUNGRY, STAT_TICKSTHIRSTY
idConverter
Constructor | Description |
---|---|
DefaultCharState() |
Modifier and Type | Method | Description |
---|---|---|
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 max) |
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 max) |
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
|
int |
compareTo(CMObject o) |
|
void |
copyInto(CharState intoState) |
Copies the internal data of this object into another of kind.
|
CMObject |
copyOf() |
Similar to Cloneable.clone(), but does its best to make sure that
any internal objects to this class are also copyOfed.
|
protected int |
getCodeNum(java.lang.String code) |
|
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 |
getSaveStatIndex() |
Returns the index into the stat codes array where extra savable fields begins.
|
int |
getStat(int statNum) |
Get the value of one of the STAT_ constants from the CharState interface.
|
java.lang.String |
getStat(java.lang.String code) |
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders.
|
java.lang.String[] |
getStatCodes() |
Returns an array of the string names of those fields which are modifiable on this object at run-time by
builders.
|
int |
getThirst() |
Get the number of thirst points for the player
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
void |
initializeClass() |
Called ONCE after all objects are loaded, but before the map is read in
during initialization.
|
boolean |
isStat(java.lang.String code) |
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders.
|
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
|
java.lang.String |
name() |
The displayable name of this object.
|
CMObject |
newInstance() |
Returns a new instance of this class.
|
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 |
setStat(int statNum,
int value) |
Set the value of one of the STAT_ constants from the CharState interface.
|
void |
setStat(java.lang.String code,
java.lang.String val) |
An alternative means of setting the values of those fields on this object which are modifiable at
run-time by builders.
|
void |
setThirst(int newVal) |
Set the number of thirst points
|
protected static final int[] DEFAULT_STATES
protected int[] states
protected long fatigue
public java.lang.String ID()
CMObject
public java.lang.String name()
CMObject
name
in interface CMObject
Environmental.Name()
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public void setAllValues(int def)
CharState
setAllValues
in interface CharState
def
- the value to give to allpublic void reset()
CharState
public void copyInto(CharState intoState)
CharState
public int getHitPoints()
CharState
getHitPoints
in interface CharState
public void setHitPoints(int newVal)
CharState
setHitPoints
in interface CharState
newVal
- number of hit pointspublic boolean adjHitPoints(int byThisMuch, CharState max)
CharState
adjHitPoints
in interface CharState
byThisMuch
- a positive or negative change in valuemax
- the highest amount to allow the hit points number to reachpublic long getFatigue()
CharState
getFatigue
in interface CharState
public void setFatigue(long newVal)
CharState
setFatigue
in interface CharState
newVal
- number of fatigue pointspublic boolean adjFatigue(long byThisMuch, CharState max)
CharState
adjFatigue
in interface CharState
byThisMuch
- a positive or negative change in valuemax
- the highest amount to allow the fatigue number to reachpublic int getHunger()
CharState
public void setHunger(int newVal)
CharState
public int adjTicksHungry(boolean bumpUp)
CharState
adjTicksHungry
in interface CharState
bumpUp
- true to bump the number by onepublic boolean adjHunger(int byThisMuch, int max)
CharState
public int maxHunger(int baseWeight)
CharState
public int getThirst()
CharState
public void setThirst(int newVal)
CharState
public int adjTicksThirsty(boolean bumpUp)
CharState
adjTicksThirsty
in interface CharState
bumpUp
- true to bump the number by onepublic boolean adjThirst(int byThisMuch, int max)
CharState
public int maxThirst(int baseWeight)
CharState
public java.lang.String getCombatStats()
CharState
getCombatStats
in interface CharState
public int getMana()
CharState
public void setMana(int newVal)
CharState
public boolean adjMana(int byThisMuch, CharState max)
CharState
public int getMovement()
CharState
getMovement
in interface CharState
public void setMovement(int newVal)
CharState
setMovement
in interface CharState
newVal
- number of movement pointspublic boolean adjMovement(int byThisMuch, CharState max)
CharState
adjMovement
in interface CharState
byThisMuch
- a positive or negative change in valuemax
- the highest amount to allow the movement number to reachpublic int getStat(int statNum)
CharState
public void setStat(int statNum, int value)
CharState
public int getSaveStatIndex()
Modifiable
getSaveStatIndex
in interface Modifiable
Modifiable.getStatCodes()
,
Modifiable.getStat(String)
,
Modifiable.setStat(String, String)
public java.lang.String[] getStatCodes()
Modifiable
getStatCodes
in interface Modifiable
Modifiable.getStat(String)
,
Modifiable.setStat(String, String)
public boolean isStat(java.lang.String code)
Modifiable
isStat
in interface Modifiable
code
- the name of the field to read.Modifiable.getStatCodes()
protected int getCodeNum(java.lang.String code)
public boolean sameAs(CharState E)
CharState
sameAs
in interface CharState
E
- the object to compare this one toModifiable.getStatCodes()
,
Modifiable.getStat(String)
public void setStat(java.lang.String code, java.lang.String val)
Modifiable
setStat
in interface Modifiable
code
- the name of the field to setval
- the value to set the field toModifiable.getStatCodes()
public java.lang.String getStat(java.lang.String code)
Modifiable
getStat
in interface Modifiable
code
- the name of the field to read.Modifiable.getStatCodes()
public CMObject copyOf()
CMObject