spellcast.enchantment
Interface Enchantment

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AmnesiaEnchantment, BlindEnchantment, CharmPersonEnchantment, ConfusionEnchantment, DelayedEffectEnchantment, DiseasedEnchantment, EnchantmentImpl, FearEnchantment, HasteEnchantment, InvisibleEnchantment, ParalysisEnchantment, PermanencyEnchantment, PoisonedEnchantment, ProtectionFromEvilEnchantment, ResistColdEnchantment, ResistHeatEnchantment, TimeStopEnchantment

public interface Enchantment
extends java.io.Serializable

An Enchantment is something that affects IBeing. It is normally the result of casting a spell.

Version:
$Revision: 1.1 $
Author:
Barrie Treloar

Method Summary
 IBeing getCaster()
          The caster of the Enchantment.
 java.lang.String getDescription()
          Return the description of this Enchantment.
 int getDuration()
          Return the duration left on this Enchantment before it expires.
 Id getId()
          The Id of this Enchantment.
 java.lang.String getName()
          Return the name of this Enchantment.
 IBeing getTarget()
          The target of the Enchantment.
 boolean isPermanent()
          isPermanent indicates whether the Enchantment is permanently enabled.
 boolean isResistant(DamageType damageType)
          isResistant checks to see if the Enchantment will resist the specified DamageType.
 void setPermanent(boolean isPermanent)
          setPermanent sets the permanency value of this Enchantment to the value specified.
 boolean turnComplete()
          Notify the Enchantment that a turn has been completed and to update itself accordingly.
 

Method Detail

getName

java.lang.String getName()
Return the name of this Enchantment.

Returns:
the name of this Enchantment.

getDescription

java.lang.String getDescription()
Return the description of this Enchantment.

Returns:
the description of this Enchantment.

getDuration

int getDuration()
Return the duration left on this Enchantment before it expires. If the Enchantment is permanent then this value has no meaning.

Returns:
the duration left on this Enchantment.

getId

Id getId()
The Id of this Enchantment.

Returns:
the Id of this Enchantment.

isPermanent

boolean isPermanent()
isPermanent indicates whether the Enchantment is permanently enabled. This means that the effect of the permanent spell on the first turn of its permenancy is repeated eternally.

Returns:
true if enchantment has been made permanent, false otherwise.

setPermanent

void setPermanent(boolean isPermanent)
setPermanent sets the permanency value of this Enchantment to the value specified. Only enchantments may have their permanency set to true. If the value specified is true and the Enchantment is not an enchantment then this method silently ignores the value and does not set the permanency to true.

Parameters:
isPermanent - indicates what to set the permanency value to. True indicates an enchantment is permanent, false indicates it is not permanent. Only an enchantment can have its permanency set to true.

isResistant

boolean isResistant(DamageType damageType)
isResistant checks to see if the Enchantment will resist the specified DamageType.

Parameters:
damageType - the DamageType to check against for resistance.
Returns:
true if the Enchantment can resist the specified DamageType, false otherwise.

turnComplete

boolean turnComplete()
Notify the Enchantment that a turn has been completed and to update itself accordingly. If the Enchantment has worn off then return true, otherwise return false.

Returns:
true if the Enchantment has worn off, false otherwise.

getCaster

IBeing getCaster()
The caster of the Enchantment.

Returns:
the caster of the Enchantment.

getTarget

IBeing getTarget()
The target of the Enchantment.

Returns:
the target of the Enchantment.


Copyright © 2001-2005 Spellcast. All Rights Reserved.