|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.MapObject wyvern.lib.classes.armor.ArmorImpl
Superclass of all armor-derived thingies.
Field Summary |
Fields inherited from class wyvern.kernel.maps.MapObject |
IN_MAP_EDITOR, listenerList_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
ArmorImpl()
|
Method Summary | |
void |
adjustHP(int adjust)
Adjusts the monster's hit points upwards or downwards. |
static void |
applyBonus(Commandable agent,
java.lang.String prop,
int adjust)
Adjusts a single property on the agent by the given amount. |
static void |
applyBonuses(PropertyList obj,
boolean add,
Commandable agent)
Adds or removes the specific magical bonuses for this armor. |
static boolean |
applySpecial(Commandable agent,
java.lang.String stat,
int adjust)
Attempts to locate a special accessor for the passed stat, named "adjust |
java.lang.String |
canWear(Commandable agent)
Called to see if the specified agent can wear this armor. |
java.lang.String |
checkDrop(Commandable agent,
Container dest)
Checks whether the object can be dropped, thrown, given away, put in a bag, or otherwise disposed of by the bearer. |
void |
destroy()
Destroys the armor, unwearing it and removing from inventory/map. |
void |
dropped(Commandable agent)
Notifies us we've been dropped. |
void |
forceRemoval()
Removes the armor from its wearer, removing the armor from any defense-list on the wearer as well. |
int |
getAC(DamageType dtype)
Returns the AC versus a specified DamageType. |
java.lang.String |
getDescription()
Returns the long description for the object. |
int |
getHP()
Returns the object's current hit points. |
int |
getMaxHP()
Returns the object's maximum hit points. |
int |
getValue()
Make giant/tiny armor twice as expensive. |
long |
getWeight()
Returns the weight of this armor. |
void |
initialize()
Initializes the object's default properties. |
boolean |
isWorn()
Returns true if this armor is currently being worn. |
void |
kill(GameObject attacker)
Destroys the armor, unwearing it if necessary, and removes it from the agent's inventory or from the map. |
void |
pickedUp(Commandable agent)
We don't care about this one, although subclasses might. |
void |
setWorn(boolean worn,
Commandable agent)
Notifies the armor it's being worn. |
java.lang.String |
toString()
Returns the name plus "(worn)" if worn. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wyvern.lib.Armor |
getRequiredSlots |
Methods inherited from interface wyvern.lib.MethodHookable |
addMethodHook, removeMethodHook, runMethodHook |
Methods inherited from interface wyvern.lib.Broadcaster |
broadcast, broadcast, broadcast, broadcast, broadcast |
Constructor Detail |
public ArmorImpl()
Method Detail |
public void initialize()
GameObject
initialize
in interface GameObject
initialize
in class MapObject
public void setWorn(boolean worn, Commandable agent)
setWorn
in interface Armor
worn
- true if worn, false if notagent
- the person wearing/unwearing itpublic boolean isWorn()
isWorn
in interface Armor
public java.lang.String toString()
toString
in class MapObject
public void dropped(Commandable agent)
dropped
in interface PickupInterest
agent
- the agent that dropped the objectpublic long getWeight()
getWeight
in interface GameObject
getWeight
in class MapObject
public void pickedUp(Commandable agent)
pickedUp
in interface PickupInterest
agent
- the agent picking up the objectpublic int getAC(DamageType dtype)
getAC
in interface Armor
dtype
- the DamageType to defend against
public static void applyBonuses(PropertyList obj, boolean add, Commandable agent)
Has various side effects:
agent
- the weareradd
- true to add bonuses, false to subtract themobj
- the object applying the bonusespublic static void applyBonus(Commandable agent, java.lang.String prop, int adjust)
public static boolean applySpecial(Commandable agent, java.lang.String stat, int adjust)
agent
- the agent to apply the bonus tostat
- the int property to adjustadjust
- the amount by which to adjust itpublic void forceRemoval()
forceRemoval
in interface Armor
public int getHP()
getHP
in interface Damageable
public int getMaxHP()
getMaxHP
in interface Damageable
public void adjustHP(int adjust)
adjustHP
in interface Damageable
adjust
- a number (possibly negative) to add to the monster's hppublic void kill(GameObject attacker)
kill
in interface Damageable
attacker
- the player/monster/iron-gate/whatever that
did the final blow. Can be null.public void destroy()
Runs a method-hook called "destroy" with no args after the item is removed (if worn) and destroyed.
destroy
in interface GameObject
destroy
in class MapObject
public java.lang.String checkDrop(Commandable agent, Container dest)
checkDrop
in interface GameObject
checkDrop
in class MapObject
agent
- the person trying to drop itdest
- where they're trying to put it
public int getValue()
getValue
in interface GameObject
getValue
in class MapObject
public java.lang.String getDescription()
getDescription
in interface GameObject
getDescription
in class MapObject
public java.lang.String canWear(Commandable agent)
canWear
in interface Armor
agent
- the player or monster trying to wear the armor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |