wyvern.lib.monsters
Class StealAttack
java.lang.Object
wyvern.lib.monsters.DefaultCustomAttack
wyvern.lib.monsters.StealAttack
- All Implemented Interfaces:
- Attack, CustomAttack
- Direct Known Subclasses:
- NymphStealAttack, StealGoldAttack
- public abstract class StealAttack
- extends DefaultCustomAttack
Superclass for the various steal attacks. Has utility methods
for transferring items between inventories and teleporting the
agent away.
- Version:
- 1.0, May 20, 2002
- Author:
- Steve Yegge
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SUCCESS
public static final int SUCCESS
- See Also:
- Constant Field Values
TOO_HEAVY
public static final int TOO_HEAVY
- See Also:
- Constant Field Values
FAILED_RESTORED
public static final int FAILED_RESTORED
- See Also:
- Constant Field Values
FAILED_DROPPED
public static final int FAILED_DROPPED
- See Also:
- Constant Field Values
StealAttack
public StealAttack()
stealObject
public void stealObject(GameObject obj,
Inventory src,
Inventory dest)
- Tries to steal an object from the defender. Uses some
reasonable default messaging if the attempt fails. If
the steal was successful, teleports the attacker away.
- Parameters:
obj
- the object to stealsrc
- the defender inventorydest
- the attacker inventory
transferObject
protected int transferObject(GameObject obj,
Inventory src,
Inventory dest)
- Attempts to transfer an object from one inventory to another.
- Parameters:
obj
- the object to transfersrc
- the defender's inventorydest
- the attacker's inventory
- Returns:
- a result code that tells what happened (e.g. got
it but dropped it because it was too heavy)
teleport
protected void teleport(Commandable attacker)
- Teleports away.