|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--monrovia.server.platform.GameObject | +--monrovia.server.platform.Creature | +--monrovia.server.platform.map.PlayerCreature | +--monrovia.game.creatures.GameCreature
GameCreature class implements the game specific properties required of all the creatures in the game
Field Summary | |
protected GameCreature |
mAttackTarget
|
protected static java.lang.String |
mMsgCrit
|
protected static java.lang.String |
mMsgFleeFalse
|
protected static java.lang.String |
mMsgFleeTrue
|
protected static java.lang.String |
mMsgHit
|
protected static java.lang.String |
mMsgMiss
|
protected static java.lang.String |
mMsgYouCrit
|
protected static java.lang.String |
mMsgYouFleeFalse
|
protected static java.lang.String |
mMsgYouFleeTrue
|
protected static java.lang.String |
mMsgYouHit
|
protected static java.lang.String |
mMsgYouMiss
|
Constructor Summary | |
GameCreature()
Default constructor |
Method Summary | |
void |
addEnemy(GameCreature pCreature)
Add an enemy and if no attack target exists set it to be this |
void |
addParameters(ParameterMap pParameters)
This method will be called to initialize the parameters. |
boolean |
canMove()
Can we move, or are we being held harshly |
void |
checkParameters(ParameterMap pParameters)
This method will be called to check the parameters. |
protected int |
d(int pInt)
Calculate d(n) of an integer (dice side) |
boolean |
doDamage(GameCreature pCreature)
Do damage to this creature |
void |
escaped()
Escaped is called, when the creature has escaped and the enemies should be notified of the escape |
java.util.List |
getOptionalParameters()
Returns a list of optional parameters. |
int |
getParam(java.lang.String pString)
Type conversion help |
Stat[] |
getStatistics()
Returns the statistics for this creature |
boolean |
isMoving()
Are we moving this round |
void |
removeEnemy(GameCreature pCreature)
Remove an enemy and if no attack target exists set it to be the first one |
void |
resetObject()
Resets this creature |
void |
setMoving(boolean pMoving)
Set this creature moving status this round |
void |
setParam(java.lang.String pString,
int pInt)
Type conversion help |
void |
setTarget(GameCreature pCreature)
Set the target for attacks |
boolean |
tryFlee(GameCreature pCreature)
Checks if flight attempt is successful |
void |
update()
Update should be called at the end of each round by the platform to update hit points etc. |
Methods inherited from class monrovia.server.platform.map.PlayerCreature |
addMessage, addStatUpdate, addStatUpdate, die, exit, getMessages, initialize, isPlayer, isSavePoint, reconnect, sendUpdate, setPlayer, setSavePoint, setSenders |
Methods inherited from class monrovia.server.platform.Creature |
findFreePointNear, getCommandMessage, getIconID, getNeededParameters, getStartArea, getStartPoint, isAlive, setAlive, setCommandMessage |
Methods inherited from class monrovia.server.platform.GameObject |
addParameter, clearCommandMarks, create, getArea, getCommandMark, getGI, getID, getLocation, getName, getParameter, removeParameter, resetParameters, setCommandMark, setParameter, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final java.lang.String mMsgHit
protected static final java.lang.String mMsgCrit
protected static final java.lang.String mMsgMiss
protected static final java.lang.String mMsgFleeTrue
protected static final java.lang.String mMsgFleeFalse
protected static final java.lang.String mMsgYouHit
protected static final java.lang.String mMsgYouCrit
protected static final java.lang.String mMsgYouMiss
protected static final java.lang.String mMsgYouFleeTrue
protected static final java.lang.String mMsgYouFleeFalse
protected GameCreature mAttackTarget
Constructor Detail |
public GameCreature()
Method Detail |
public void resetObject()
resetObject
in class GameObject
public void addParameters(ParameterMap pParameters)
GameObject
addParameters
in class PlayerCreature
monrovia.server.platform.GameObject
pParameters
- Add the parameters herepublic java.util.List getOptionalParameters()
GameObject
getOptionalParameters
in class Creature
public void checkParameters(ParameterMap pParameters) throws StorageException
GameObject
checkParameters
in class Creature
monrovia.server.platform.GameObject
pParameters
- Check that the parameters are OKStorageException
- Throw this if you find an error.public Stat[] getStatistics()
getStatistics
in class Creature
public void setTarget(GameCreature pCreature)
public void addEnemy(GameCreature pCreature)
public void removeEnemy(GameCreature pCreature)
public void setMoving(boolean pMoving)
public boolean isMoving()
public boolean canMove()
public void escaped()
public void update()
update
in class Creature
public boolean doDamage(GameCreature pCreature)
pCreature
- the creature, that does the damagepublic boolean tryFlee(GameCreature pCreature)
pCreature
- the creature that attempts to flee from the
creature that is being calledpublic int getParam(java.lang.String pString)
public void setParam(java.lang.String pString, int pInt)
protected int d(int pInt)
pInt
- number to calculate d(n) of
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |