be.saltwater.jaqel.creature
Class Hero

java.lang.Object
  extended bybe.saltwater.jaqel.creature.Creature
      extended bybe.saltwater.jaqel.creature.Hero

public class Hero
extends Creature

A type of creature that can be controlled by the user. The difference between a hero and a monster is made because the latter only moves when it's located within a certain radius of a hero, and the first can be controlled by the user. Therefore both are stored seperately in the session class.

Author:
Robin Wittevrongel, Bruno Windels
See Also:
CreatureSharedData, be.saltwater.jaqel.session.Session, Monster

Field Summary
 
Fields inherited from class be.saltwater.jaqel.creature.Creature
ORDER_ERROR, ORDER_NOPATH, ORDER_NOTENOUGHMAGIC, ORDER_NOTENOUGHPOINTS, ORDER_NOTYOURTURN, ORDER_NOWEAPON, ORDER_OK, ORDER_TILENOTFREE, ORDER_TILENOTTAKEN
 
Constructor Summary
Hero(CreatureTypeData type_data, Identity identity)
           
 
Method Summary
protected  void addActionsInternal()
          Must be overridden by subclasses to add actions to the scheduler.
 int attackOrder(java.awt.Point where)
           
 int drinkPotionOrder(java.lang.String type, int quantity)
           
 HeroControlComponent getControlComponent()
           
 void setActionPoints(int points)
           
 void setControlComponent(HeroControlComponent component)
           
 int setCurrentWeaponOrder(java.lang.String weapon)
           
 void setHealthPoints(int points)
           
 void setLocation(java.awt.Point location)
           
 
Methods inherited from class be.saltwater.jaqel.creature.Creature
addActions, attachAttribute, attack, attack, createMorph, detachAttribute, findPath, finishTurn, getActionPoints, getBranchGroup, getCreatureAnimation, getCreatureSharedData, getCreatureTypeData, getCurrentWeapon, getCurrentWeaponName, getDrinkCost, getEndLocation, getHealthPoints, getLevel, getLocation, getLocatorGroup, getMorph, getMoveCost, getTurnFinished, getUsedLocatorKeys, move, move, setCurrentWeapon, setGeometryToStand, setLevel, setTurnFinished, withinAttackDistance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hero

public Hero(CreatureTypeData type_data,
            Identity identity)
Method Detail

setControlComponent

public void setControlComponent(HeroControlComponent component)

getControlComponent

public HeroControlComponent getControlComponent()

drinkPotionOrder

public int drinkPotionOrder(java.lang.String type,
                            int quantity)

setCurrentWeaponOrder

public int setCurrentWeaponOrder(java.lang.String weapon)

attackOrder

public int attackOrder(java.awt.Point where)

addActionsInternal

protected void addActionsInternal()
Description copied from class: Creature
Must be overridden by subclasses to add actions to the scheduler. Call setTurnFinished(true) on Creature subclasses that are not controlled by the user.

Specified by:
addActionsInternal in class Creature

setActionPoints

public void setActionPoints(int points)
Overrides:
setActionPoints in class Creature

setHealthPoints

public void setHealthPoints(int points)
Overrides:
setHealthPoints in class Creature

setLocation

public void setLocation(java.awt.Point location)
Overrides:
setLocation in class Creature