|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.globalse.arena.frag.objects.FRAGObject | +--org.globalse.arena.sword.engine.Item | +--org.globalse.arena.sword.engine.ConsumableItem
A ConsumableItem is an Item that can change the properties of the Adventurer once "consumed" (like health, strength, etc). The ConsumableItem itself is consumed (destroyed) as a result of using it. It could be a loaf of bread, piece of meat, an apple...
FRAGObject
,
Sword
, Serialized Form
Fields inherited from class org.globalse.arena.sword.engine.Item |
weight |
Fields inherited from class org.globalse.arena.frag.objects.FRAGObject |
controller,
gameName,
influenceRange,
objectName,
owner,
position,
visibilityRange |
Constructor Summary | |
ConsumableItem()
|
Method Summary | |
void |
actionEvent(ObjectActionEvent event)
Processes the ObjectActionEvent s that the ObjectManager
receives for this object. |
double |
getCollisionSphere()
Returns the collisionSphere Attribute for this consumableItem |
double |
getHealthBonus()
Returns the amount of health an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
double |
getHealthMaxBonus()
Returns the amount of healthMax (upper limit for health) an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
double |
getInventoryMaxBonus()
Returns the amount of inventoryMaxBonus (upper limit for the inventory) an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
double |
getMagicPowerBonus()
Returns the amount of magic power an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
double |
getManaBonus()
Returns the amount of mana an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
double |
getManaMaxBonus()
Returns the amount of manaMax (upper limit for mana) an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
double |
getStrengthBonus()
Returns the amount of strength an Adventurer gains (loses if the return value is negative) when consuming (using) the item. |
void |
init(java.lang.String gameName,
java.lang.String objectName,
double weight,
java.lang.String type,
double healthBonus,
double healthMaxBonus,
double manaBonus,
double manaMaxBonus,
double magicPowerBonus,
double inventoryMaxBonus,
double strengthBonus)
Initializes a ConsumableItem with the given properties (see below). |
void |
init(java.lang.String gameName,
java.lang.String objectName,
java.lang.String type)
Creates new consumable item and initializes it with the default properties. |
boolean |
isItemUsableBy(java.lang.String owner)
Checks if this item is currently used by someone |
boolean |
useWith(java.lang.String target)
Called when this ConsumableItem is to be used. |
Methods inherited from class org.globalse.arena.sword.engine.Item |
checkCollision,
draw,
getDescription,
getDimensions,
getImage,
getObjectName,
getType,
getVisible,
init,
setVisible |
Methods inherited from class org.globalse.arena.frag.objects.FRAGObject |
checkAndResetMark,
checkMark,
clone,
controlAcquired,
controlLost,
getGameManager,
getInfluenceRange,
getObjectManager,
getPosition,
killed,
mark,
newerVersion,
setInfluenceRange,
setPosition |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ConsumableItem()
Method Detail |
public void init(java.lang.String gameName, java.lang.String objectName, java.lang.String type)
type
- a String that denotes the kind of item (bread, meat, ...)public void init(java.lang.String gameName, java.lang.String objectName, double weight, java.lang.String type, double healthBonus, double healthMaxBonus, double manaBonus, double manaMaxBonus, double magicPowerBonus, double inventoryMaxBonus, double strengthBonus)
weight
- the weight (in kg) of the itemtype
- a String that denotes the kind of item (bread, meat, ...)healthBonus
- the health bonus of the itemhealthMaxBonus
- the healthMax bonus of the itemmanaBonus
- the mana bonus of the itemmanaMaxBonus
- the manaMax bonus of the itemmagicPowerBonus
- the magicPower bonus of the iteminventoryMaxBonus
- the inventoryMax bonus of the itemstrengthBonus
- the strength bonus of the itempublic double getHealthBonus()
public double getHealthMaxBonus()
public double getManaBonus()
public double getManaMaxBonus()
public double getMagicPowerBonus()
public double getInventoryMaxBonus()
public double getStrengthBonus()
public boolean useWith(java.lang.String target)
target
- the target, "consuming" this consumable item (the Adventurer)public void actionEvent(ObjectActionEvent event)
ObjectActionEvent
s that the ObjectManager
receives for this object.event
- the event, that took placeObjectActionEvent
public boolean isItemUsableBy(java.lang.String owner)
owner
- the "suspected" user of the itempublic double getCollisionSphere()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |