com.planeth.gtroids.stats
Class ObjectStats

java.lang.Object
  extended bycom.planeth.gtroids.stats.ObjectStats

public class ObjectStats
extends java.lang.Object

Handles all object stats like health, team, etc.

Author:
Andreas Grässer, gal@planet-h.com.
created Jun 11, 2005

Constructor Summary
ObjectStats()
          Constructor for ObjectStats.
 
Method Summary
 int getDamagePoints()
          Returns the damagePoints (for hitting an another object)
 int getHealthPercent()
          Returns the percentage of the currentHealthPoints (to the max)
 int getPointsForHit()
          Returns the pointsForHit.
 int getPointsForKill()
          Returns the pointsForKill.
 int getTeam()
          Returns the team
 void hitWith(int damagePoints)
          Hits the Object with the passed damagePoints
 void init(int healthPoints, int pointsForKill)
          Initializes the ObjectStats
 boolean isAlive()
          Returns true, if the object is alive
 boolean isBonus()
          Returns true, if the object is a bonus item
 boolean isEnemy(ObjectStats otherStats)
          Returns true, if the passed object is an enemy
 boolean isGodMode()
          Returns true, if the object is in godMode.
 boolean isNeutral()
          Returns true, if the object is neutral (no team)
 boolean isPlayer()
          Returns true, if the object is a player
 boolean isShieldEnabled()
          Returns true, if the shield is enabled
 void paint(java.awt.Graphics g, Vector2D pos)
          Paints the stats into the passed Graphics
 void setHealthToMax()
          Sets the healthPoints back to the max (cure)
 void setShieldEnabled(boolean shieldEnabled)
          If set to true, the immortal shield gets enabled
 void setTeam(int team)
          Sets the team
 void toggleGodMode()
          Toggles the godMode (on/off)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectStats

public ObjectStats()
Constructor for ObjectStats.

Method Detail

init

public void init(int healthPoints,
                 int pointsForKill)
Initializes the ObjectStats

Parameters:
healthPoints - the initial healthPts
pointsForKill - the points, what the player gets, if he kills the object

paint

public void paint(java.awt.Graphics g,
                  Vector2D pos)
Paints the stats into the passed Graphics

Parameters:
g - Graphics to paint into
pos - the position to paint the stats

getHealthPercent

public int getHealthPercent()
Returns the percentage of the currentHealthPoints (to the max)

Returns:
Returns the percentage of the currentHealthPoints (to the max)

setHealthToMax

public void setHealthToMax()
Sets the healthPoints back to the max (cure)


hitWith

public void hitWith(int damagePoints)
Hits the Object with the passed damagePoints

Parameters:
damagePoints - the damagePoints to use for the impact

isAlive

public boolean isAlive()
Returns true, if the object is alive

Returns:
Returns true, if the object is alive

isEnemy

public boolean isEnemy(ObjectStats otherStats)
Returns true, if the passed object is an enemy

Parameters:
otherStats - object to check with
Returns:
Returns true, if the passed object is an enemy

isNeutral

public boolean isNeutral()
Returns true, if the object is neutral (no team)

Returns:
Returns true, if the object is neutral (no team)

isPlayer

public boolean isPlayer()
Returns true, if the object is a player

Returns:
Returns true, if the object is a player

isBonus

public boolean isBonus()
Returns true, if the object is a bonus item

Returns:
Returns true, if the object is a bonus item

getDamagePoints

public int getDamagePoints()
Returns the damagePoints (for hitting an another object)

Returns:
Returns the damagePoints.

getTeam

public int getTeam()
Returns the team

Returns:
Returns the team.

setTeam

public void setTeam(int team)
Sets the team

Parameters:
team - The team to set.

getPointsForHit

public int getPointsForHit()
Returns the pointsForHit.
This value is added to the players points account, if he hits, but not kills the enemy.

Returns:
Returns the pointsForHit.

getPointsForKill

public int getPointsForKill()
Returns the pointsForKill.
This value is added to the players points account, if he kills the enemy.

Returns:
Returns the pointsForKill.

isGodMode

public boolean isGodMode()
Returns true, if the object is in godMode.

Returns:
Returns true, if the object is in godMode.

toggleGodMode

public void toggleGodMode()
Toggles the godMode (on/off)


isShieldEnabled

public boolean isShieldEnabled()
Returns true, if the shield is enabled

Returns:
Returns true, if the shield is enabled

setShieldEnabled

public void setShieldEnabled(boolean shieldEnabled)
If set to true, the immortal shield gets enabled

Parameters:
shieldEnabled - The shieldEnabled to set.