Package net.sf.colossus.game
Class Creature
- java.lang.Object
-
- net.sf.colossus.game.Creature
-
- Direct Known Subclasses:
CreatureServerSide,ShowCreatureDetails.SimulatedCritter
public class Creature extends java.lang.ObjectA 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
Fields Modifier and Type Field Description private BattleHexcurrentHexprivate inthitsDamage takenstatic java.util.Comparator<Creature>IMPORTANCE_ORDERImplements an order on Critters by some definition of importance.protected Legionlegionprivate static java.util.logging.LoggerLOGGERprivate intpoisonDamageprivate intslowedprivate BattleHexstartingHexprivate booleanstruckprivate CreatureTypetype
-
Constructor Summary
Constructors Constructor Description Creature(CreatureType type, Legion legion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPoisonDamage(int damage)voidaddSlowed(int slowValue)intadjustHits(int damage)Apply damage or healing to this critter.voidcommitMove()BattleHexgetCurrentHex()java.lang.StringgetDescription()intgetHits()java.lang.String[]getImageNames()LegiongetLegion()java.lang.StringgetMarkerId()intgetMaxCount()java.lang.StringgetName()PlayergetPlayer()java.lang.StringgetPluralName()intgetPointValue()intgetPoison()intgetPoisonDamage()intgetPower()intgetSkill()intgetSlowed()intgetSlows()BattleHexgetStartingHex()intgetStrikingPower(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.intgetStrikingSkill(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.intgetTitanPower()CreatureTypegetType()booleanhasMoved()booleanhasStruck()voidheal()booleanisDead()booleanisDemiLord()booleanisFlier()booleanisImmortal()booleanisLord()booleanisLordOrDemiLord()booleanisNativeAt(HazardHexside hexside)booleanisNativeIn(HazardTerrain terrain)booleanisRangestriker()booleanisSummonable()booleanisTitan()voidmoveToHex(BattleHex hex)voidsetCurrentHex(BattleHex hex)voidsetDead(boolean dead)voidsetHits(int hits)voidsetMoved(boolean moved)voidsetPoisonDamage(int damage)voidsetSlowed(int slowValue)voidsetStartingHex(BattleHex hex)voidsetStruck(boolean struck)booleanuseMagicMissile()booleanwouldDieFrom(int additionalDamage)
-
-
-
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
-
poisonDamage
private int poisonDamage
-
slowed
private int slowed
-
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 CreaturemyElevation- Height of the Hex on which stands the current CreaturetargetElevation- Height of the hex on which stands the target CreaturemyHexTerrain- Type of Hazard of the current HextargetHexTerrain- Type of Hazard of the target hexmyHexside- Type of hexside hazard between the current hex and the target hextargetHexside- 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 CreaturemyElevation- Height of the Hex on which stands the current CreaturetargetElevation- Height of the hex on which stands the target CreaturemyHexTerrain- Type of Hazard of the current HextargetHexTerrain- Type of Hazard of the target hexmyHexside- Type of hexside hazard between the current hex and the target hextargetHexside- 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()
-
getTitanPower
public int getTitanPower()
-
getMarkerId
public java.lang.String getMarkerId()
-
getName
public java.lang.String getName()
-
isTitan
public boolean isTitan()
-
getDescription
public java.lang.String getDescription()
-
getStartingHex
public BattleHex getStartingHex()
-
setStartingHex
public void setStartingHex(BattleHex hex)
-
getCurrentHex
public BattleHex getCurrentHex()
-
setCurrentHex
public void setCurrentHex(BattleHex hex)
-
moveToHex
public void moveToHex(BattleHex hex)
-
commitMove
public void commitMove()
-
hasMoved
public boolean hasMoved()
-
setMoved
public void setMoved(boolean moved)
-
isDemiLord
public boolean isDemiLord()
-
isFlier
public boolean isFlier()
-
isImmortal
public boolean isImmortal()
-
isLord
public boolean isLord()
-
isLordOrDemiLord
public boolean isLordOrDemiLord()
-
isRangestriker
public boolean isRangestriker()
-
useMagicMissile
public boolean useMagicMissile()
-
isSummonable
public boolean isSummonable()
-
isNativeAt
public boolean isNativeAt(HazardHexside hexside)
-
isNativeIn
public boolean isNativeIn(HazardTerrain terrain)
-
getPointValue
public int getPointValue()
-
getSkill
public int getSkill()
-
getHits
public int getHits()
-
getPoison
public int getPoison()
-
getPoisonDamage
public int getPoisonDamage()
-
getSlowed
public int getSlowed()
-
getSlows
public int getSlows()
-
hasStruck
public boolean hasStruck()
-
setHits
public void setHits(int hits)
-
setPoisonDamage
public void setPoisonDamage(int damage)
-
addPoisonDamage
public void addPoisonDamage(int damage)
-
setSlowed
public void setSlowed(int slowValue)
-
addSlowed
public void addSlowed(int slowValue)
-
setStruck
public void setStruck(boolean struck)
-
isDead
public boolean isDead()
-
setDead
public void setDead(boolean dead)
-
getImageNames
public java.lang.String[] getImageNames()
-
getPluralName
public java.lang.String getPluralName()
-
getMaxCount
public int getMaxCount()
-
heal
public void heal()
-
wouldDieFrom
public boolean wouldDieFrom(int additionalDamage)
-
adjustHits
public int adjustHits(int damage)
Apply damage or healing to this critter. Return the amount of excess damage done, which may sometimes carry to another target.
-
-