OGS Java API Spec

ogs.magic
Class Spell

java.lang.Object
  |
  +--ogs.support.Object
        |
        +--ogs.magic.Spell
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
Abjuration, Conjuration, Divination, Enchantment, Evocation, Illusion, Necromancy, Transmutation, Universal

public abstract class Spell
extends Object

A magical effect produced by an entity. All spells have the following properties in common: school, descriptors, components, and range. Some of these properties can be modified by metamagic feats for a particular instance of a spell.


Field Summary
 
Fields inherited from class ogs.support.Object
listeners
 
Constructor Summary
Spell()
           
 
Method Summary
 boolean addMetamagicFeat(MetamagicFeat metamagicFeat)
          Add a metamagic feat to this spell.
abstract  Vector getComponents()
          Determine the components needed to cast this spell.
 Descriptors getDescriptors()
          Determine the descriptors for this type of spell.
 int getMetamagicSlots()
          Determine the metamagic slots for this spell.
abstract  Range getRange()
          Determine the range of this spell.
abstract  School getSchool()
          Determine the school (and subschool if applicable) for this type of spell.
 
Methods inherited from class ogs.support.Object
addListener, handleEvent, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spell

public Spell()
Method Detail

getSchool

public abstract School getSchool()
Determine the school (and subschool if applicable) for this type of spell. This method should return the same school for all instances of the same spell class. In other words, it should behave as though it were a static method.

Returns:
School (and subschool if applicable) of this spell.

getDescriptors

public Descriptors getDescriptors()
Determine the descriptors for this type of spell. This method should return the same descriptors for all instances of the same spell class. In other words, it should behave as though it were a static method.

Returns:
A set of descriptors for this spell.

getComponents

public abstract Vector getComponents()
Determine the components needed to cast this spell. The components of a spell may vary amongst instances of the same spell class due to metamagic feats.

Returns:
An array of components for this spell.

getRange

public abstract Range getRange()
Determine the range of this spell. The range of a spell may vary amongst instances of the same spell class due to metamagic feats.

Returns:
Range of this spell.

addMetamagicFeat

public boolean addMetamagicFeat(MetamagicFeat metamagicFeat)
Add a metamagic feat to this spell.

Parameters:
metamagicFeat - The metamagic feat to add to this spell.
Returns:
True if the feat was successfully added to this spell.

getMetamagicSlots

public int getMetamagicSlots()
Determine the metamagic slots for this spell. The metamagic slots is the total slots taken up by all metamagic feats that are attached to this spell.

Returns:
Metamagic slots.

OGS Java API Spec