public abstract class Spell { String schoolName; String spellName= "The Spell"; String description; int manaCost; int level = 0; String target; String[] targets; public abstract void cast(Fod game, int playerNr, String arg); public abstract String getSpellName(); public abstract String getSchoolName(); public abstract String getDescription(); public abstract int getManaCost(); public abstract int getLevel(); public abstract String[] getTargetProfile(); public abstract String getTarget(); public abstract String setTarget(String t); public void prepare(String target,ClientThread ct){ if(ct.mana.getValue() >= getManaCost()){ setTarget(target); ct.mana.setValue(ct.mana.getValue()-getManaCost()); ct.spellBook.spellCasts.addElement(toForm()); ct.message("You cast "+getSpellName()); }else{ ct.message("You dont have enough mana for this spell"); } } public String toForm(){ return getSpellName()+"#"+getTarget(); } public String toString(){ return getSpellName()+" "+getDescription(); } }