|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.MapObject wyvern.lib.classes.Teleporter wyvern.lib.classes.construct.QuestTeleporter
A teleporter that responds to a specific command by teleporting the player through it. For instance, you could create a climbable tree by having it respond to the "climb" command. The command to respond to is stored in a "command" string-property on the teleporter.
Field Summary |
Fields inherited from class wyvern.lib.classes.Teleporter |
FORCE_PLAYERS, MAX_DISTANCE, PLEASE_WAIT_MSG |
Fields inherited from class wyvern.kernel.maps.MapObject |
IN_MAP_EDITOR, listenerList_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
QuestTeleporter()
|
Method Summary | |
void |
apply(Commandable agent)
User applies the teleporter. |
CommandEvent |
createEvent(CommandEvent event)
Creates a CommandEvent that encapsulates all the state necessary to perform the command. |
boolean |
execute(CommandEvent event)
Executes the event by teleporting the player. |
boolean |
knowsCommand(java.lang.String command)
Returns true if this Command wants to handle the command. |
Methods inherited from class wyvern.lib.classes.Teleporter |
checkBounds, checkPerPlayer, checkRelativePath, chooseRandomLocation, getDestination, getDestLoc, getDestMap, getWaitMessage, initialize, loadMap, parseDestination, passedClaim, pathOutIsBlocked, printLoadMessage, setDestination, setDestination, setMap, startTeleport, steppedOn, teleport, teleport, teleport, teleport, toString, tryForcing, validateLevel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public QuestTeleporter()
Method Detail |
public boolean knowsCommand(java.lang.String command)
Command
This method exists to allow more than one game object to implement the same command verb, but with different expected arguments.
If two objects register for the same command and the same arguments, the object that was registered most recently gets to handle at the command.
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent event)
Command
This method is called by the kernel. The kernel passes the event to the pre-hook, then calls Command.execute() (below) to execute the event, and finally calls the post-hook.
createEvent
in interface Command
event
- a "blank" CommandEvent containing only the
command text and the agent who's performing the command. This
initial event is created by the originator of the event (e.g.
the AI or player's command preprocessor).
public void apply(Commandable agent)
If you set a "no-apply-msg" on the object, it will print it to the agent here.
apply
in interface Applyable
apply
in class Teleporter
agent
- the monster or player trying to pass throughpublic boolean execute(CommandEvent event)
execute
in interface Command
event
- the event created by createEvent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |