|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Common.DefaultCharState
public class DefaultCharState
| Field Summary | |
|---|---|
protected int |
annoyanceTicker
|
protected int |
botherCycle
|
protected long |
Fatigue
|
protected int[] |
states
|
protected int |
ticksHungry
|
protected int |
ticksThirsty
|
| Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CharState |
|---|
ADJUST_FACTOR, ANNOYANCE_DEFAULT_TICKS, DEATH_HUNGER_TICKS, DEATH_THIRST_TICKS, FATIGUED_MILLIS, REST_PER_TICK, STAT_HITPOINTS, STAT_HUNGER, STAT_MANA, STAT_MOVE, STAT_NUM_BASE_STATS, STAT_NUMSTATS, STAT_THIRST |
| Constructor Summary | |
|---|---|
DefaultCharState()
|
|
| 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 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 |
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. |
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. |
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. |
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 |
CMObject |
newInstance()
Returns a new instance of this class. |
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 |
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] states
protected long Fatigue
protected int botherCycle
protected int ticksHungry
protected int ticksThirsty
protected int annoyanceTicker
| Constructor Detail |
|---|
public DefaultCharState()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectpublic CMObject newInstance()
CMObject
newInstance in interface CMObjectpublic void initializeClass()
CMObject
initializeClass in interface CMObjectpublic void setAllValues(int def)
CharState
setAllValues in interface CharStatedef - the value to give to allpublic void copyInto(CharState intoState)
CharState
copyInto in interface CharStateintoState - another CharState object.public int getHitPoints()
CharState
getHitPoints in interface CharStatepublic void setHitPoints(int newVal)
CharState
setHitPoints in interface CharStatenewVal - number of hit points
public boolean adjHitPoints(int byThisMuch,
CharState max)
CharState
adjHitPoints in interface CharStatebyThisMuch - a positive or negative change in valuemax - the highest amount to allow the hit points number to reach
public long getFatigue()
CharState
getFatigue in interface CharStatepublic void setFatigue(long newVal)
CharState
setFatigue in interface CharStatenewVal - number of fatigue points
public boolean adjFatigue(long byThisMuch,
CharState max)
CharState
adjFatigue in interface CharStatebyThisMuch - a positive or negative change in valuemax - the highest amount to allow the fatigue number to reach
public int getHunger()
CharState
getHunger in interface CharStatepublic void setHunger(int newVal)
CharState
setHunger in interface CharStatenewVal - number of hunger points
public boolean adjHunger(int byThisMuch,
int max)
CharState
adjHunger in interface CharStatebyThisMuch - a positive or negative change in valuemax - the highest amount to allow the hunger number to reach
public int maxHunger(int baseWeight)
CharState
maxHunger in interface CharStatebaseWeight - the base weight of the mob
public int getThirst()
CharState
getThirst in interface CharStatepublic void setThirst(int newVal)
CharState
setThirst in interface CharStatenewVal - number of thirst points
public boolean adjThirst(int byThisMuch,
int max)
CharState
adjThirst in interface CharStatebyThisMuch - a positive or negative change in valuemax - the highest amount to allow the thirst number to reach
public int maxThirst(int baseWeight)
CharState
maxThirst in interface CharStatebaseWeight - the base weight of the mob
public java.lang.String getCombatStats()
CharState
getCombatStats in interface CharStatepublic int getMana()
CharState
getMana in interface CharStatepublic void setMana(int newVal)
CharState
setMana in interface CharStatenewVal - number of mana points
public boolean adjMana(int byThisMuch,
CharState max)
CharState
adjMana in interface CharStatebyThisMuch - a positive or negative change in valuemax - the highest amount to allow the mana number to reach
public int getMovement()
CharState
getMovement in interface CharStatepublic void setMovement(int newVal)
CharState
setMovement in interface CharStatenewVal - number of movement points
public boolean adjMovement(int byThisMuch,
CharState max)
CharState
adjMovement in interface CharStatebyThisMuch - a positive or negative change in valuemax - the highest amount to allow the movement number to reach
public void recoverTick(MOB mob,
CharState maxState)
CharState
recoverTick in interface CharStatemob - the mob recoveringmaxState - The CharState objects which represents the maximum values for these fieldsMOB
public void expendEnergy(MOB mob,
CharState maxState,
boolean expendMovement)
CharState
expendEnergy in interface CharStatemob - the mob expendingmaxState - The CharState objects which represents the maximum values for these fieldsexpendMovement - whether to skip movement expendingMOBpublic int getSaveStatIndex()
CMModifiable
getSaveStatIndex in interface CMModifiableCMModifiable.getStatCodes(),
CMModifiable.getStat(String),
CMModifiable.setStat(String, String)public java.lang.String[] getStatCodes()
CMModifiable
getStatCodes in interface CMModifiableCMModifiable.getStat(String),
CMModifiable.setStat(String, String)public boolean isStat(java.lang.String code)
CMModifiable
isStat in interface CMModifiablecode - the name of the field to read.
CMModifiable.getStatCodes()protected int getCodeNum(java.lang.String code)
public boolean sameAs(CharState E)
CharState
sameAs in interface CharStateE - the object to compare this one to
CMModifiable.getStatCodes(),
CMModifiable.getStat(String)
public void setStat(java.lang.String code,
java.lang.String val)
CMModifiable
setStat in interface CMModifiablecode - the name of the field to setval - the value to set the field toCMModifiable.getStatCodes()public java.lang.String getStat(java.lang.String code)
CMModifiable
getStat in interface CMModifiablecode - the name of the field to read.
CMModifiable.getStatCodes()public CMObject copyOf()
CMObject
copyOf in interface CMObjectpublic int compareTo(CMObject o)
compareTo in interface java.lang.Comparable<CMObject>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||