|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.LockPickCommand
Implements the "pick-locks" thieving skill.
Nested Class Summary | |
static class |
LockPickCommand.LockablePredicate
A predicate that checks whether an object is lockable. |
static class |
LockPickCommand.LockedPredicate
A predicate that checks whether an object is locked. |
Field Summary | |
static int |
PICK_LOCK_DELAY
This is how long it takes to attempt to pick a lock. |
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Adds commands. |
CommandEvent |
createEvent(CommandEvent initial)
Creates a pick-lock event. |
void |
damagePick(Commandable agent,
GameObject lockpick)
Does damage to the lock pick, possibly destroying it. |
GameObject |
determineTarget(java.lang.String arg,
TargetedEvent event)
Parses the args and gets the appropriate object to operate on. |
boolean |
execute(CommandEvent e)
Executes the pick-lock event. |
protected void |
fail(Commandable agent,
TargetedEvent event)
Agent fails to pick the lock. |
static LockPickCommand |
getImpl()
|
GameObject |
getNoArgTarget(TargetedEvent event)
Find the nearest object with a pickable lock. |
static int |
getPickChance(int skill,
Lock lock)
Returns the agent's chance of picking this lock. |
GameObject |
getSpecificTarget(int dir,
TargetedEvent event)
Looks in specified direction for a lock. |
boolean |
knowsCommand(java.lang.String command)
Built-in commands always return true, so that *someone* handles it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PICK_LOCK_DELAY
Method Detail |
public static LockPickCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
addCommands
in interface BuiltInCommand
commands
- the map to add ourself tolist
- the command list we're registering in, from which
we can derive the command agent (i.e. player or monster) and other
information.public boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the complete original text of the command.
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).
Command.createEvent(wyvern.lib.CommandEvent)
public GameObject getNoArgTarget(TargetedEvent event)
event
- the targeted event
public GameObject determineTarget(java.lang.String arg, TargetedEvent event)
arg
- the argument stringevent
- the OpenEvent or LockEvent
public GameObject getSpecificTarget(int dir, TargetedEvent event)
dir
- a valid Direction constantevent
- the event for this command
public boolean execute(CommandEvent e)
execute
in interface Command
e
- the CommandEvent to execute
Command.execute(wyvern.lib.CommandEvent)
public static int getPickChance(int skill, Lock lock)
skill
- the agent's pick-locks skill level, including
any bonus from the lock pick itself.lock
- the Lock to pick
protected void fail(Commandable agent, TargetedEvent event)
agent
- the person picking the lockevent
- the eventpublic void damagePick(Commandable agent, GameObject lockpick)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |