|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Manages the list of spells a player or monster knows.
Method Summary | |
void |
addSpell(java.lang.String path)
Adds a spell to the list; used by the map editor. |
boolean |
forgetSpell(java.lang.String path,
Commandable agent)
Forgets a spell. |
int |
getSize()
Returns the number of spells in this list. |
java.lang.String[] |
getSpells()
Returns the spell display names in this list. |
java.lang.String |
getSpellString()
Returns the list of spell display names in the form "spell_1 spell_2 spell_3" (used to implement the client-side spell list) |
boolean |
knowsSpell(java.lang.String path)
Checks whether the player knows this spell. |
void |
learnSpell(java.lang.String path)
Learns a spell. |
boolean |
okToLearn(java.lang.String name,
Commandable agent,
java.lang.StringBuffer reason)
Checks whether player is allowed to learn this spell, taking into account the lore cost of the spell and available lore points. |
Method Detail |
public void learnSpell(java.lang.String path)
path
- the spell class, e.g. wyvern.lib.spells.LightningBolt
or wyvern/wiz/foo/spells/myspell.pypublic boolean forgetSpell(java.lang.String path, Commandable agent)
path
- the class of the spell to forgetagent
- the agent to whom to return the lore points
for the spell, or null if not applicable.
public boolean knowsSpell(java.lang.String path)
path
- the class of the spell to check, OR the
display name of the spell
public boolean okToLearn(java.lang.String name, Commandable agent, java.lang.StringBuffer reason)
name
- the class of the spell to checkagent
- the agent trying to learn the spellreason
- the error message, if any
public java.lang.String[] getSpells()
public int getSize()
public void addSpell(java.lang.String path)
path
- the class of the spell to addpublic java.lang.String getSpellString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |