|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.Heart
Handles heartbeat timer every 5 seconds, computing regeration of all the player's time-sensitive stats (health, mana, food, etc.)
You could, if you wanted, replace a player's Heart with a subclass of this one, and give them different recovery rates for various stats.
Field Summary | |
protected int |
beats_
|
protected PlayerImpl |
player_
|
Constructor Summary | |
Heart(PlayerImpl p)
Constructs a new Heart for the specified Player. |
Method Summary | |
void |
beat()
Called by PlayerImpl.heartBeat(). |
protected void |
computeFood()
Maybe deducts from food level. |
protected void |
computeHitPointRegen()
Maybe updates HP. |
protected void |
computeShoutPoints()
Computes how many shout points to give to the player. |
protected void |
computeSpellPointRegen()
Maybe increases mana |
int |
getBeats()
Returns the number of heartbeats the player has had since they logged in. |
PlayerImpl |
getPlayer()
|
void |
setPlayer(PlayerImpl p)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient int beats_
protected PlayerImpl player_
Constructor Detail |
public Heart(PlayerImpl p)
Method Detail |
public PlayerImpl getPlayer()
public void setPlayer(PlayerImpl p)
public int getBeats()
public void beat()
protected void computeHitPointRegen()
protected void computeFood()
protected void computeSpellPointRegen()
protected void computeShoutPoints()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |