|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbe.saltwater.jaqel.creature.Creature
Defines characters which can execute CreatureAction objects. A creature has serveral "points" which can be set and get. Points that are needed by identity (e.g. in the shop), are stored in CreatureSharedData. A creature also has locators. These are indicators that can move when the creature moves. You can attach and detach CreatureAttribute objects to these locators with attachAttribute() and detachAttribute(). If you attach an attribute to an non-existent locator, the attribute will not move. See the animation files for what locator names are valid.
CreatureSharedData,
be.saltwater.jaqel.session.Identity| Field Summary | |
static int |
ORDER_ERROR
the order couldn't be completed for some unknown reason |
static int |
ORDER_NOPATH
the order couldn't be completed because there is no path to the given point |
static int |
ORDER_NOTENOUGHMAGIC
|
static int |
ORDER_NOTENOUGHPOINTS
the order couldn't be completed because this hero does not have enough action or other points |
static int |
ORDER_NOTYOURTURN
|
static int |
ORDER_NOWEAPON
|
static int |
ORDER_OK
the order was processed correctly |
static int |
ORDER_TILENOTFREE
the order couldn't be completed because the tile is taken (e.g. in a move order) |
static int |
ORDER_TILENOTTAKEN
the order couldn't be completed because the tile is not taken (e.g. in an attack order) |
| Constructor Summary | |
Creature(CreatureTypeData type_data,
CreatureSharedData points)
Constructs a creature (abstract). |
|
| Method Summary | |
void |
addActions()
Called by Level when it's this creatures turn. |
protected abstract void |
addActionsInternal()
Must be overridden by subclasses to add actions to the scheduler. |
void |
attachAttribute(CreatureAttribute attr,
java.lang.String location)
Attach an attribute, such as a weapon, to a certain locator in this creature. |
int |
attack(Creature c,
int times)
|
int |
attack(java.awt.Point where,
int times)
Add an action to the CreatureActionScheduler to attack another creature in the maze. |
javax.media.j3d.Morph |
createMorph(javax.media.j3d.GeometryArray[] keyframes)
Get the Morph object that contains the graphical representation for this creature. |
void |
detachAttribute(CreatureAttribute attr)
Detaches the given attribute from any locator in this creature. |
java.util.List |
findPath(java.awt.Point endPoint,
boolean approach)
An algorithm that looks for the shortest way to a certain tile in the Maze and returns an ArrayList of points, referring to the tiles upon which the Creature has to walk. |
void |
finishTurn()
|
int |
getActionPoints()
|
javax.media.j3d.BranchGroup |
getBranchGroup()
|
CreatureAnimation |
getCreatureAnimation(java.lang.String key)
Get the creature animation with the given name (walk, fight, ...) of this creature. |
CreatureSharedData |
getCreatureSharedData()
|
CreatureTypeData |
getCreatureTypeData()
Returns the type data of this creature. |
Weapon |
getCurrentWeapon()
|
java.lang.String |
getCurrentWeaponName()
|
int |
getDrinkCost()
|
java.awt.Point |
getEndLocation()
Get the location of the creature when all his actions that are currently queued in the action scheduler are finished. |
int |
getHealthPoints()
|
Level |
getLevel()
|
java.awt.Point |
getLocation()
Get the creature's current location in the maze. |
javax.media.j3d.TransformGroup |
getLocatorGroup(java.lang.String key)
Get the TransformGroup of the given locator, or return null if not in use. |
javax.media.j3d.Morph |
getMorph()
|
int |
getMoveCost()
|
boolean |
getTurnFinished()
Will this creature add any more actions? |
java.util.Iterator |
getUsedLocatorKeys()
Returns the iterator of all the keys of the locators that are currently in use (i.e. there is some attribute attached to them) by this creature. |
int |
move(java.util.List path)
|
int |
move(java.awt.Point where,
boolean approach)
Add an action to the CreatureActionScheduler to move the creature to a location in the Maze. |
void |
setActionPoints(int actionPoints)
|
boolean |
setCurrentWeapon(java.lang.String weapon)
|
void |
setGeometryToStand()
Set the visual representation to the one for standing still. |
void |
setHealthPoints(int healthPoints)
|
void |
setLevel(Level level)
|
void |
setLocation(java.awt.Point location)
|
protected void |
setTurnFinished(boolean f)
Set the flag that indicates that this Creature object will (and can't) add any more CreatureAction objects to the scheduler within it's current turn. |
boolean |
withinAttackDistance(Creature c)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ORDER_OK
public static final int ORDER_ERROR
public static final int ORDER_NOPATH
public static final int ORDER_NOTENOUGHPOINTS
public static final int ORDER_TILENOTTAKEN
public static final int ORDER_TILENOTFREE
public static final int ORDER_NOWEAPON
public static final int ORDER_NOTYOURTURN
public static final int ORDER_NOTENOUGHMAGIC
| Constructor Detail |
public Creature(CreatureTypeData type_data,
CreatureSharedData points)
points - The CreatureSharedData object of the creature.| Method Detail |
public void setLocation(java.awt.Point location)
public void setLevel(Level level)
public java.awt.Point getLocation()
public java.awt.Point getEndLocation()
public int move(java.awt.Point where,
boolean approach)
public int move(java.util.List path)
public int attack(java.awt.Point where,
int times)
public int attack(Creature c,
int times)
public boolean withinAttackDistance(Creature c)
public java.util.List findPath(java.awt.Point endPoint,
boolean approach)
public Level getLevel()
public CreatureSharedData getCreatureSharedData()
public int getActionPoints()
public void setActionPoints(int actionPoints)
public int getHealthPoints()
public void setHealthPoints(int healthPoints)
public javax.media.j3d.BranchGroup getBranchGroup()
public void attachAttribute(CreatureAttribute attr,
java.lang.String location)
public void detachAttribute(CreatureAttribute attr)
public CreatureTypeData getCreatureTypeData()
public java.util.Iterator getUsedLocatorKeys()
public javax.media.j3d.TransformGroup getLocatorGroup(java.lang.String key)
public CreatureAnimation getCreatureAnimation(java.lang.String key)
public javax.media.j3d.Morph createMorph(javax.media.j3d.GeometryArray[] keyframes)
public javax.media.j3d.Morph getMorph()
public void setGeometryToStand()
public void addActions()
protected abstract void addActionsInternal()
protected void setTurnFinished(boolean f)
public boolean getTurnFinished()
public void finishTurn()
public boolean setCurrentWeapon(java.lang.String weapon)
public java.lang.String getCurrentWeaponName()
public Weapon getCurrentWeapon()
public int getMoveCost()
public int getDrinkCost()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||