|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.skills.NagaShift
Handles the "shift" command for Nagas, allowing them to polymorph into various predefined shapes.
Field Summary | |
static java.lang.String[] |
ARCHETYPES
The archetypes for the shapes, from which we can determine a bunch of other information like HP, SP and so on. |
static java.lang.String[] |
IMAGES
The images to use for each shape if the naga is facing east or west. |
static int[] |
LEVELS
These are the levels at which nagas can become their shapes. |
static java.lang.String[] |
SHAPE_NAMES
|
static java.lang.String[] |
SHAPES
These are all the shapes nagas can become. |
static int[] |
SIZES
The sizes of the shapes. 1 means 1x1, 2 means 1x2 or 2x1 depending on direction, and 4 means 2x2. |
Constructor Summary | |
NagaShift()
|
Method Summary | |
void |
computeEncumbrance(Commandable agent)
Recomputes the agent's encumbrance |
void |
computeShiftedHP(Commandable agent,
Archetype arch)
Figures out how many HP the agent should have in the new form, and sets their transient HP value accordingly. |
void |
computeShiftedWC(Commandable agent,
Archetype arch)
Figures out the new WC for the shape. |
java.lang.Object |
createClone()
Produces a clone of the property for the caller. |
CommandEvent |
createEvent(CommandEvent initial)
Creates the command event. |
boolean |
equals(java.lang.Object o)
|
boolean |
execute(CommandEvent event)
Executes the event. |
Rectangle |
findSpace(Commandable agent,
int index)
Locates a spot to put the agent after the polymorph. |
int |
hashCode()
|
void |
hookEvent(java.lang.String hookName,
CommandEvent event)
Turns "turn" into "move" if they're in a long form. |
void |
killTimer()
Kills the sp-drain timer. |
boolean |
knowsCommand(java.lang.String command)
Returns true if we want to handle this command. |
void |
methodCalled(java.lang.String hookName,
MethodHookable target,
java.lang.Object data)
Called when the player is done initializing. |
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 |
restore(Commandable agent)
Restores the naga to natural form. |
void |
restoreBodyParts(Commandable agent)
Changes the agent back to their original form. |
void |
restoreStats(Commandable agent)
Restores the agent's stats to the non-shifted versions. |
void |
rewearArmor(Commandable agent)
Removes any worn armor and tries to wear it again. |
void |
rewieldWeapon(Commandable agent)
Unwields any weapon and tries to wield it again. |
void |
setBodyParts(Commandable agent,
PartsList body)
Changes the agent's body parts to those of the new shape. |
void |
setTimer()
Starts the sp-drain timer. |
boolean |
shift(Commandable agent,
CommandEvent event)
Shifts the naga into the specified shape. |
boolean |
shift(Commandable agent,
java.lang.String shape)
Shifts the naga into a specific shape. |
void |
timerExpired()
Spell-drain timer went off. |
java.lang.String |
toString()
|
void |
unshift()
Forces a shift back into a naga, or failing that, a frog. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String[] SHAPES
public static final java.lang.String[] SHAPE_NAMES
public static final int[] LEVELS
public static final java.lang.String[] IMAGES
public static final int[] SIZES
public static final java.lang.String[] ARCHETYPES
Constructor Detail |
public NagaShift()
Method Detail |
public boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the command the player typed
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
public boolean shift(Commandable agent, CommandEvent event)
event
- the command event
public boolean shift(Commandable agent, java.lang.String shape)
agent
- the playershape
- the shape to shift intopublic Rectangle findSpace(Commandable agent, int index)
agent
- the agent to shiftindex
- the index into the shape tables
public void setBodyParts(Commandable agent, PartsList body)
agent
- the playerbody
- the new body to usepublic void rewearArmor(Commandable agent)
agent
- the playerpublic void rewieldWeapon(Commandable agent)
agent
- the playerpublic void restoreBodyParts(Commandable agent)
agent
- the player. Their old body is set in the
permanent property "body-parts".public void computeShiftedHP(Commandable agent, Archetype arch)
agent
- the playerarch
- the polymorph archetypepublic void computeShiftedWC(Commandable agent, Archetype arch)
public boolean restore(Commandable agent)
agent
- the naga to restore
public void restoreStats(Commandable agent)
public void computeEncumbrance(Commandable agent)
public void notifyAdd(PropertyList obj)
notifyAdd
in interface AddRemoveNotify
obj
- the GameObject whose property list we're being
added to (in this case, the naga player)public void notifyRemove(PropertyList obj)
notifyRemove
in interface AddRemoveNotify
obj
- the GameObject whose property list we're being
removed from (in this case, the naga player)public void methodCalled(java.lang.String hookName, MethodHookable target, java.lang.Object data)
methodCalled
in interface MethodHookCallback
hookName
- the name of the hook being runtarget
- 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.public void hookEvent(java.lang.String hookName, CommandEvent event)
hookEvent
in interface HookCallback
hookName
- the name of the hook, such as "movePreHook".event
- the CommandEvent encapsulating the event parameterspublic void timerExpired()
timerExpired
in interface Timed
public void unshift()
public void killTimer()
public void setTimer()
public java.lang.String toString()
public java.lang.Object createClone()
MutableProperty
createClone
in interface MutableProperty
public boolean equals(java.lang.Object o)
public int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |