|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.combat.WieldCommand
The Wield command.
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Adds commands. |
static void |
checkUnwieldOtherWeapon(Commandable agent,
CommandEvent event)
Determines whether the agent needs to unwield something else in order to wield this weapon. |
CommandEvent |
createEvent(CommandEvent initial)
Creates a wield- or unwield-event encapsulating the weapon & agent. |
CommandEvent |
createUnwieldEvent(CommandEvent initial)
Creates an event for unwielding a weapon. |
static CommandEvent |
createWieldEvent(CommandEvent initial)
Creates a WieldEvent encapsulating the weapon & agent. |
boolean |
execute(CommandEvent ev)
Executes the wield. |
boolean |
executeUnwield(Commandable agent,
TargetedEvent event)
Un-wields a weapon. |
boolean |
executeWield(Commandable agent,
TargetedEvent event)
Wields a weapon. |
static void |
findBodyParts(Weapon weapon,
Monster agent,
TargetedEvent event)
Finds the body part(s) that will wield the weapon and stuffs references to them into the event. |
static void |
forceUnwield(Weapon weapon,
Commandable agent)
Removes the weapon from the agent's attacks. |
static java.lang.String |
getHandString(Commandable agent)
Returns "hand", "claw" or something appropriate for the monster. |
static java.lang.String |
getHandString(Commandable agent,
boolean plural)
Returns the singular or plural gripping-appendage name for the monster. |
static WieldCommand |
getImpl()
|
boolean |
knowsCommand(java.lang.String command)
Built-in commands always return true, so that *someone* handles the command. |
static java.util.List |
searchParts(Commandable agent,
java.lang.Class[] types)
Searches for available parts to hold the specified types. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static WieldCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
addCommands
in interface BuiltInCommand
commands
- the Map we're registering withlist
- the CommandList the Command is being added to.public boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the command to check
public CommandEvent createEvent(CommandEvent initial)
createEvent
in interface Command
initial
- the event containing the original text
public static CommandEvent createWieldEvent(CommandEvent initial)
initial
- the initial event
public static void checkUnwieldOtherWeapon(Commandable agent, CommandEvent event)
public CommandEvent createUnwieldEvent(CommandEvent initial)
initial
- the initial event
public static void findBodyParts(Weapon weapon, Monster agent, TargetedEvent event)
Sets some properties on the event:
weapon
- the weapon to wieldagent
- the wielderevent
- the event to stuffpublic static java.util.List searchParts(Commandable agent, java.lang.Class[] types)
agent
- the agent whose body to searchtypes
- the slot classes to search for
public boolean execute(CommandEvent ev)
execute
in interface Command
ev
- the wield event
public boolean executeWield(Commandable agent, TargetedEvent event)
agent
- the agent to wield the weaponevent
- the event containing the wield parameterspublic boolean executeUnwield(Commandable agent, TargetedEvent event)
agent
- the agent to wield the weaponevent
- the event containing the wield parameterspublic static void forceUnwield(Weapon weapon, Commandable agent)
weapon
- the weapon to unwieldagent
- the agent to make unwield the weaponpublic static java.lang.String getHandString(Commandable agent)
public static java.lang.String getHandString(Commandable agent, boolean plural)
agent
- the Monster to checkplural
- true to retrieve the plural form of the name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |