|
||||||||||
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.commands.EventImpl wyvern.kernel.commands.TargetedEvent wyvern.kernel.monsters.DeathEvent
Death is a special occurrence that needs to be hookable and vetoable, so we create an event for it. The event is its own handler, and is placed in the monster/player's queue. The agent is the thing being killed, and the event should always have an "attacker" property that's the thing killing the agent.
Field Summary |
Fields inherited from class wyvern.kernel.commands.TargetedEvent |
cloneError_, location_, quantity_, target_, targetName_ |
Fields inherited from class wyvern.kernel.commands.EventImpl |
agent_, appendToFile_, argString_, argStringParsed_, argv_, argvParsed_, delay_, failureMessage_, filterObjects_, filters_, handler_, map_, modified_, originalText_, playerOriginated_, redirectFile_, redirecting_, sendToAgent_, successMessage_, verb_, vetoed_, wizParsed_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
DeathEvent()
Constructs a new DeathEvent; the agent must be set manually using setAgent(). |
|
DeathEvent(Commandable agent)
Constructs a new DeathEvent |
Method Summary | |
CommandEvent |
createEvent(CommandEvent initial)
Creates a new event. |
boolean |
execute(CommandEvent event)
Executes the event, killing the agent by calling their kill() function. |
Command |
getHandler()
Handle our own execution. |
void |
initialize()
Sets up the parameters. |
boolean |
knowsCommand(java.lang.String command)
We handle the command. |
Methods inherited from class wyvern.kernel.commands.TargetedEvent |
getCloneErrorMsg, getLocation, getQuantity, getTarget, getTargetName, hasTarget, isQuantified, isTargetSpecifiedByHashcode, setLocation, setQuantified, setQuantity, setTarget, setTargetName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DeathEvent()
public DeathEvent(Commandable agent)
Method Detail |
public void initialize()
public Command getHandler()
getHandler
in interface CommandEvent
getHandler
in class EventImpl
public boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent initial)
createEvent
in interface Command
initial
- 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 boolean execute(CommandEvent event)
execute
in interface Command
event
- the event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |