wyvern.lib.skills
Class RakshasaSkills

java.lang.Object
  extended bywyvern.lib.skills.RakshasaSkills
All Implemented Interfaces:
AddRemoveNotify, Command, MethodHookCallback, MutableProperty

public final class RakshasaSkills
extends java.lang.Object
implements AddRemoveNotify, MethodHookCallback, Command, MutableProperty

Handles some of the special abilities for the Rakshasa race.

Version:
1.0, Jul 11, 2002
Author:
Steve Yegge

Constructor Summary
RakshasaSkills()
           
 
Method Summary
 java.lang.Object createClone()
          Produces a clone of the property for the caller.
 CommandEvent createEvent(CommandEvent event)
          Creates a CommandEvent that encapsulates all the state necessary to perform the command.
 boolean equals(java.lang.Object o)
           
 boolean execute(CommandEvent event)
          Executes the specified CommandEvent.
 int hashCode()
           
 boolean knowsCommand(java.lang.String cmd)
          Returns true if we handle a rakshasa-specific command.
 void methodCalled(java.lang.String hookName, MethodHookable target, java.lang.Object data)
          Notifies the callback that a given method was called on the target object.
 void notifyAdd(PropertyList obj)
          Notifies the property that it's being added.
 void notifyRemove(PropertyList obj)
          Notifies the property that it's being removed.
 boolean showCatCommands(CommandEvent event)
          Shows the cat-specific atmospheres.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RakshasaSkills

public RakshasaSkills()
Method Detail

notifyAdd

public void notifyAdd(PropertyList obj)
Notifies the property that it's being added.

Specified by:
notifyAdd in interface AddRemoveNotify
Parameters:
obj - the GameObject whose property list we're being added to (in this case, the rakshasa player)

notifyRemove

public void notifyRemove(PropertyList obj)
Notifies the property that it's being removed. Unregisters the "shift" command from the player.

Specified by:
notifyRemove in interface AddRemoveNotify
Parameters:
obj - the GameObject whose property list we're being removed from (in this case, the naga player)

methodCalled

public void methodCalled(java.lang.String hookName,
                         MethodHookable target,
                         java.lang.Object data)
Notifies the callback that a given method was called on the target object. The name of the hook is sometimes the same as the name of the method, but it can be different, so it's best to check the documentation for the method in question.

Specified by:
methodCalled in interface MethodHookCallback
Parameters:
hookName - the name of the hook being run
target - the object on which the method was invoked: a GameMap or GameObject.
data - a method-specific data object; can be null. Check the documentation for the method hook to see if any data is passed to the callbacks.

knowsCommand

public boolean knowsCommand(java.lang.String cmd)
Returns true if we handle a rakshasa-specific command.

Specified by:
knowsCommand in interface Command
Parameters:
cmd - the entire command string, including arguments
Returns:
true if we want to handle the command

createEvent

public CommandEvent createEvent(CommandEvent event)
Description copied from interface: Command
Creates a CommandEvent that encapsulates all the state necessary to perform the command. A well-designed CommandEvent exposes all of its "properties" so that hook objects can modify its behavior. For instance, many commands result in some sort of message being sent back to the client. The message should be among the properties that hooks can override.

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.

Specified by:
createEvent in interface Command
Parameters:
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).
Returns:
a CommandEvent subclass encapsulating this command's execution parameters and state. It should copy in the fields from the passed-in event.

execute

public boolean execute(CommandEvent event)
Description copied from interface: Command
Executes the specified CommandEvent. The CommandEvent contains all the parameters and state required to execute the command; the parameters have been filtered through hook objects, so they may not be the same as when the event was created.

Specified by:
execute in interface Command
Parameters:
event - the CommandEvent to execute
Returns:
true if the event completed successfully, else false.

showCatCommands

public boolean showCatCommands(CommandEvent event)
Shows the cat-specific atmospheres.


toString

public java.lang.String toString()

createClone

public java.lang.Object createClone()
Description copied from interface: MutableProperty
Produces a clone of the property for the caller. Note: it's called createClone, not makeClone, because GameObject already has a makeClone. Some GameObjects can be properties (e.g inventories) and we can't do overloaded methods based only on the return type.

Specified by:
createClone in interface MutableProperty

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()