net.sf.colossus.game
Class Creature

java.lang.Object
  extended by net.sf.colossus.game.Creature
Direct Known Subclasses:
CreatureServerSide

public class Creature
extends java.lang.Object

A particular creature in a game. This represents a creature in a game, such as a specific Cyclops as part of a legion. TODO it should include the state for battles, i.e. the damage taken so far. Currently that happens only on the server side.


Field Summary
private  BattleHex currentHex
           
private  int hits
          Damage taken
static java.util.Comparator<Creature> IMPORTANCE_ORDER
          Implements an order on Critters by some definition of importance.
protected  Legion legion
           
private static java.util.logging.Logger LOGGER
           
private  BattleHex startingHex
           
private  boolean struck
           
private  CreatureType type
           
 
Constructor Summary
Creature(CreatureType type, Legion legion)
           
 
Method Summary
 void commitMove()
           
 BattleHex getCurrentHex()
           
 java.lang.String getDescription()
           
 int getHits()
           
 java.lang.String[] getImageNames()
           
 Legion getLegion()
           
 java.lang.String getMarkerId()
           
 int getMaxCount()
           
 java.lang.String getName()
           
 Player getPlayer()
           
 java.lang.String getPluralName()
           
 int getPointValue()
           
 int getPower()
           
 int getSkill()
           
 BattleHex getStartingHex()
           
 int getStrikingPower(Creature target, int myElevation, int targetElevation, HazardTerrain myHexTerrain, HazardTerrain targetHexTerrain, HazardHexside myHexside, HazardHexside targetHexside)
          Calculates the Striking Power of this Creature when striking directly at target under the circumstances in parameters.
 int getStrikingSkill(Creature target, int myElevation, int targetElevation, HazardTerrain myHexTerrain, HazardTerrain targetHexTerrain, HazardHexside myHexside, HazardHexside targetHexside)
          Calculates the Striking Skill of this Creature when striking directly at target under the circumstances in parameters.
 CreatureType getType()
           
 boolean hasMoved()
           
 boolean hasStruck()
           
 void heal()
           
 boolean isDead()
           
 boolean isDemiLord()
           
 boolean isFlier()
           
 boolean isImmortal()
           
 boolean isLord()
           
 boolean isLordOrDemiLord()
           
 boolean isNativeBramble()
          Deprecated. all isNative are obsolete, one should use isNativeTerrain() instead, with no explicit reference to the name. This will ease adding new HazardTerrain in variant.
 boolean isNativeDune()
           
 boolean isNativeHexside(HazardHexside hazard)
           
 boolean isNativeRiver()
           
 boolean isNativeSlope()
           
 boolean isNativeStone()
          Deprecated. all isNative are obsolete, one should use isNativeTerrain() instead, with no explicit reference to the name. This will ease adding new HazardTerrain in variant.
 boolean isNativeTerrain(HazardTerrain t)
           
 boolean isNativeVolcano()
          Deprecated. all isNative are obsolete, one should use isNativeTerrain() instead, with no explicit reference to the name. This will ease adding new HazardTerrain in variant.
 boolean isRangestriker()
           
 boolean isSummonable()
           
 boolean isTitan()
           
 boolean isWaterDwelling()
          Deprecated. 
 void moveToHex(BattleHex hex)
           
 void setCurrentHex(BattleHex hex)
           
 void setDead(boolean dead)
           
 void setHits(int hits)
           
 void setMoved(boolean moved)
           
 void setStartingHex(BattleHex hex)
           
 void setStruck(boolean struck)
           
 boolean useMagicMissile()
           
 int wound(int damage)
          Apply damage to this critter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORTANCE_ORDER

public static final java.util.Comparator<Creature> IMPORTANCE_ORDER
Implements an order on Critters by some definition of importance. The order is: - titans first - then sorted by points value - then sorted by rangestriker or not - then sorted by flyer or not - then by name


LOGGER

private static final java.util.logging.Logger LOGGER

type

private final CreatureType type

legion

protected Legion legion

currentHex

private BattleHex currentHex

startingHex

private BattleHex startingHex

hits

private int hits
Damage taken


struck

private boolean struck
Constructor Detail

Creature

public Creature(CreatureType type,
                Legion legion)
Method Detail

getType

public CreatureType getType()

getStrikingPower

public int getStrikingPower(Creature target,
                            int myElevation,
                            int targetElevation,
                            HazardTerrain myHexTerrain,
                            HazardTerrain targetHexTerrain,
                            HazardHexside myHexside,
                            HazardHexside targetHexside)
Calculates the Striking Power of this Creature when striking directly at target under the circumstances in parameters.

Parameters:
target - The Creature that is struck by the current Creature
myElevation - Height of the Hex on which stands the current Creature
targetElevation - Height of the hex on which stands the target Creature
myHexTerrain - Type of Hazard of the current Hex
targetHexTerrain - Type of Hazard of the target hex
myHexside - Type of hexside hazard between the current hex and the target hex
targetHexside - Type of hexside hazard between the target hex and the current hex
Returns:
The Power Factor of the current Creature when all modifiers are factored in

getStrikingSkill

public int getStrikingSkill(Creature target,
                            int myElevation,
                            int targetElevation,
                            HazardTerrain myHexTerrain,
                            HazardTerrain targetHexTerrain,
                            HazardHexside myHexside,
                            HazardHexside targetHexside)
Calculates the Striking Skill of this Creature when striking directly at target under the circumstances in parameters.

Parameters:
target - The Creature that is struck by the current Creature
myElevation - Height of the Hex on which stands the current Creature
targetElevation - Height of the hex on which stands the target Creature
myHexTerrain - Type of Hazard of the current Hex
targetHexTerrain - Type of Hazard of the target hex
myHexside - Type of hexside hazard between the current hex and the target hex
targetHexside - Type of hexside hazard between the target hex and the current hex
Returns:
The Skill Factor of the current Creature when all modifiers are factored in

getLegion

public Legion getLegion()

getPlayer

public Player getPlayer()

getPower

public int getPower()

getMarkerId

public java.lang.String getMarkerId()

isTitan

public boolean isTitan()

getCurrentHex

public BattleHex getCurrentHex()

getDescription

public java.lang.String getDescription()

getStartingHex

public BattleHex getStartingHex()

setCurrentHex

public void setCurrentHex(BattleHex hex)

setStartingHex

public void setStartingHex(BattleHex hex)

getName

public java.lang.String getName()

moveToHex

public void moveToHex(BattleHex hex)

isDemiLord

public boolean isDemiLord()

isFlier

public boolean isFlier()

isImmortal

public boolean isImmortal()

isLord

public boolean isLord()

isLordOrDemiLord

public boolean isLordOrDemiLord()

isNativeHexside

public boolean isNativeHexside(HazardHexside hazard)

isNativeTerrain

public boolean isNativeTerrain(HazardTerrain t)

isRangestriker

public boolean isRangestriker()

isSummonable

public boolean isSummonable()

getPointValue

public int getPointValue()

getSkill

public int getSkill()

getHits

public int getHits()

hasStruck

public boolean hasStruck()

setHits

public void setHits(int hits)

setStruck

public void setStruck(boolean struck)

isDead

public boolean isDead()

setDead

public void setDead(boolean dead)

hasMoved

public boolean hasMoved()

setMoved

public void setMoved(boolean moved)

getImageNames

public java.lang.String[] getImageNames()

getMaxCount

public int getMaxCount()

getPluralName

public java.lang.String getPluralName()

heal

public void heal()

isNativeBramble

@Deprecated
public boolean isNativeBramble()
Deprecated. all isNative are obsolete, one should use isNativeTerrain() instead, with no explicit reference to the name. This will ease adding new HazardTerrain in variant.


isNativeDune

public boolean isNativeDune()

isNativeRiver

public boolean isNativeRiver()

isNativeSlope

public boolean isNativeSlope()

isNativeStone

@Deprecated
public boolean isNativeStone()
Deprecated. all isNative are obsolete, one should use isNativeTerrain() instead, with no explicit reference to the name. This will ease adding new HazardTerrain in variant.


isNativeVolcano

@Deprecated
public boolean isNativeVolcano()
Deprecated. all isNative are obsolete, one should use isNativeTerrain() instead, with no explicit reference to the name. This will ease adding new HazardTerrain in variant.


isWaterDwelling

@Deprecated
public boolean isWaterDwelling()
Deprecated. 


useMagicMissile

public boolean useMagicMissile()

wound

public int wound(int damage)
Apply damage to this critter. Return the amount of excess damage done, which may sometimes carry to another target.


commitMove

public void commitMove()