org.globalse.arena.sword.engine
Class Spell

java.lang.Object
  |
  +--org.globalse.arena.frag.objects.FRAGObject
        |
        +--org.globalse.arena.sword.engine.Item
              |
              +--org.globalse.arena.sword.engine.Spell

public class Spell
extends Item

A Spell is an Item that can modify the properties of other adventurers when used on them. For example, a spell could decrease the mana of another adventurer by a certain amount

See Also:
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
Spell()
           
 
Method Summary
 double getHealthBonus()
          Returns the amount of health an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 double getHealthMaxBonus()
          Returns the amount of healthMax (upper limit for health) an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 double getInventoryMaxBonus()
          Returns the amount of inventoryMaxBonus (upper limit for the inventory) an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 double getMagicPowerBonus()
          Returns the amount of magic power an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 double getMagicPowerNeeded()
          Returns the amount of magic power needed that the adventurer should have in order to cast a certain spell.
 double getManaBonus()
          Returns the amount of mana an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 double getManaMaxBonus()
          Returns the amount of manaMax (upper limit for mana) an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 double getManaNeeded()
          Returns the amount of mana needed that the adventurer should have in order to cast a certain spell.
 double getStrengthBonus()
          Returns the amount of strength an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
 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, double manaNeeded, double magicPowerNeeded)
          Initializes a Spell with the given properties (see below).
 boolean isItemUsableBy(java.lang.String owner)
          Checks whether this spell belongs currently to someone
 boolean useWith(java.lang.String target)
          Is used when an Adventurer casts this spell on other Adventurers, modifying their properties (like health, mana, etc) depending on the type of spell that is used
 
Methods inherited from class org.globalse.arena.sword.engine.Item
actionEvent, checkCollision, draw, getCollisionSphere, 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

Spell

public Spell()
Method Detail

init

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,
                 double manaNeeded,
                 double magicPowerNeeded)
Initializes a Spell with the given properties (see below).
Parameters:
weight - the weight (in kg) of the item
type - a String that denotes the kind of item (sword, apple, ring, ...)
healthBonus - the health bonus of the item
healthMaxBonus - the healthMax bonus of the item
manaBonus - the mana bonus of the item
manaMaxBonus - the manaMax bonus of the item
magicPowerBonus - the magicPower bonus of the item
inventoryMaxBonus - the inventoryMax bonus of the item
strengthBonus - the inventoryMax bonus of the item
magicPowerNeeded - the magic power needed to cast certain spell
manaNeeded - the mana needed to cast certain spell

getHealthBonus

public double getHealthBonus()
Returns the amount of health an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the healthBonus of the Spell

getHealthMaxBonus

public double getHealthMaxBonus()
Returns the amount of healthMax (upper limit for health) an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the healthMaxBonus of the Spell

getManaBonus

public double getManaBonus()
Returns the amount of mana an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the manaBonus of the Spell

getManaMaxBonus

public double getManaMaxBonus()
Returns the amount of manaMax (upper limit for mana) an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the manaMax of the Spell

getMagicPowerBonus

public double getMagicPowerBonus()
Returns the amount of magic power an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the healthBonus of the Spell

getInventoryMaxBonus

public double getInventoryMaxBonus()
Returns the amount of inventoryMaxBonus (upper limit for the inventory) an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the inventoryMaxBonus of the Spell

getMagicPowerNeeded

public double getMagicPowerNeeded()
Returns the amount of magic power needed that the adventurer should have in order to cast a certain spell.
Returns:
the magic power needed to cast certain spell

getManaNeeded

public double getManaNeeded()
Returns the amount of mana needed that the adventurer should have in order to cast a certain spell.
Returns:
the magic power needed to cast certain spell

getStrengthBonus

public double getStrengthBonus()
Returns the amount of strength an Adventurer gains (loses if the return value is negative) when the Spell is used on him.
Returns:
the mana needed to cast certain spell

isItemUsableBy

public boolean isItemUsableBy(java.lang.String owner)
Checks whether this spell belongs currently to someone
Returns:
true if yes, otherwise no
Overrides:
isItemUsableBy in class Item

useWith

public boolean useWith(java.lang.String target)
Is used when an Adventurer casts this spell on other Adventurers, modifying their properties (like health, mana, etc) depending on the type of spell that is used
Returns:
true if everything ok, false if the target object is no Adventurer
Overrides:
useWith in class Item



This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)