minny.zephyrus.spells
Class Spell

java.lang.Object
  extended by minny.zephyrus.player.LevelManager
      extended by minny.zephyrus.spells.Spell
Direct Known Subclasses:
Armour, Blink, Bolt, Butcher, Confuse, Dig, Enderchest, Explode, Feed, Fireball, Fly, Frenzy, Grow, Heal, Phase, Punch, Repair, Summon, SuperHeat, Vanish

public abstract class Spell
extends LevelManager

Zephyrus

Author:
minnymin3

Field Summary
 
Fields inherited from class minny.zephyrus.player.LevelManager
plugin
 
Constructor Summary
Spell(Zephyrus plugin)
           
 
Method Summary
abstract  java.lang.String bookText()
          The text that appears in the SpellTome
 boolean canBind()
          Weather or not the spell can be bound to a wand
 boolean canRun(org.bukkit.entity.Player player)
          The boolean dictating if the spell can be run
 void dropSpell(org.bukkit.block.Block bookshelf, java.lang.String name, java.lang.String desc)
          The method for destroying a bookshelf and dropping a spelltome
 java.lang.String failMessage()
          The message that is sent to the player when canRun returns false
 boolean hasPermission(org.bukkit.entity.Player player, Spell spell)
          Checks if the player has permission to cast the spell.
 boolean isLearned(org.bukkit.entity.Player p, java.lang.String name)
          If the spell is learned
abstract  int manaCost()
          The mana cost multiplied by the configurable mana multiplier
abstract  java.lang.String name()
          Defines the name of the spell
 void notEnoughMana(org.bukkit.entity.Player p)
           
abstract  int reqLevel()
          The level required to craft the spell
 Spell reqSpell()
          A spell that is required for crafting this spell
abstract  void run(org.bukkit.entity.Player player)
          The method called when the spell is cast
abstract  java.util.Set<org.bukkit.inventory.ItemStack> spellItems()
          A Set containing all the items required to craft the spell
 
Methods inherited from class minny.zephyrus.player.LevelManager
displayLevel, displayMana, drainMana, getLevel, getLevel, getLevelProgress, getMana, levelProgress, levelUp, loadMana, resetMana, saveMana
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spell

public Spell(Zephyrus plugin)
Method Detail

name

public abstract java.lang.String name()
Defines the name of the spell


bookText

public abstract java.lang.String bookText()
The text that appears in the SpellTome


reqLevel

public abstract int reqLevel()
The level required to craft the spell


manaCost

public abstract int manaCost()
The mana cost multiplied by the configurable mana multiplier


run

public abstract void run(org.bukkit.entity.Player player)
The method called when the spell is cast


spellItems

public abstract java.util.Set<org.bukkit.inventory.ItemStack> spellItems()
A Set containing all the items required to craft the spell


canBind

public boolean canBind()
Weather or not the spell can be bound to a wand


reqSpell

public Spell reqSpell()
A spell that is required for crafting this spell


canRun

public boolean canRun(org.bukkit.entity.Player player)
The boolean dictating if the spell can be run


failMessage

public java.lang.String failMessage()
The message that is sent to the player when canRun returns false


isLearned

public boolean isLearned(org.bukkit.entity.Player p,
                         java.lang.String name)
If the spell is learned


notEnoughMana

public void notEnoughMana(org.bukkit.entity.Player p)

hasPermission

public boolean hasPermission(org.bukkit.entity.Player player,
                             Spell spell)
Checks if the player has permission to cast the spell. Returns false if OpKnowledge is false in the config

Parameters:
player - The target player
spell - The target spell

dropSpell

public void dropSpell(org.bukkit.block.Block bookshelf,
                      java.lang.String name,
                      java.lang.String desc)
The method for destroying a bookshelf and dropping a spelltome