|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.AppraiseCommand
Handles expert appraisal of various items. In most cases, players won't be able to tell anything special about an item, but the command implements various skills that allow you to get more info if you have them.
Field Summary | |
static int |
APPRAISE_DELAY
How long it takes to appraise something. |
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Tells the Command to add the commands that it wants to implement into the passed data structure. |
void |
appraiseArmor(Armor armor,
Commandable agent)
Appraises a piece of armor. |
java.lang.String |
appraiseDamage(GameObject item,
Commandable agent,
int level)
Appraises armor or weapon for damage level. |
boolean |
appraiseGem(GameObject item,
Commandable agent)
Attempts to appraise a gem. |
void |
appraiseWeapon(Weapon item,
Commandable agent)
Appraises a weapon. |
int |
computeTotalAC(Armor armor)
Adds up built-in ACs for the armor. |
int |
computeTotalWC(Weapon weapon)
Adds up built-in WCs for the weapon. |
CommandEvent |
createEvent(CommandEvent initial)
Creates an Appraisal event. |
boolean |
execute(CommandEvent ev)
Executes the specified CommandEvent. |
static AppraiseCommand |
getImpl()
|
boolean |
knowsCommand(java.lang.String command)
Returns true if this Command wants to handle the command. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int APPRAISE_DELAY
Method Detail |
public static AppraiseCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
BuiltInCommand
addCommands
in interface BuiltInCommand
commands
- a Map whose keys are commands, and whose values
are Commands that handle those commands.list
- the CommandList the Command is being added to.public boolean knowsCommand(java.lang.String command)
Command
This method exists to allow more than one game object to implement the same command verb, but with different expected arguments.
If two objects register for the same command and the same arguments, the object that was registered most recently gets to handle at the command.
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent initial)
Sets various error messages in the event (you can query them dynamically to see their current values). Looks for an object with a "menu" property nearby.
createEvent
in interface Command
initial
- the initial, raw event
public boolean execute(CommandEvent ev)
Command
execute
in interface Command
ev
- the CommandEvent to execute
public void appraiseWeapon(Weapon item, Commandable agent)
item
- the armor or weaponagent
- the identifierpublic int computeTotalWC(Weapon weapon)
public void appraiseArmor(Armor armor, Commandable agent)
armor
- the armor or weaponagent
- the identifierpublic int computeTotalAC(Armor armor)
public java.lang.String appraiseDamage(GameObject item, Commandable agent, int level)
item
- the armor or weaponagent
- the identifierlevel
- their level in the skill
public boolean appraiseGem(GameObject item, Commandable agent)
item
- the gemagent
- the appraiser
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |