wyvern.lib
Interface Armor

All Superinterfaces:
Broadcaster, Damageable, GameObject, MethodHookable, PropertyList
All Known Implementing Classes:
ArmorImpl

public interface Armor
extends GameObject, Damageable

Armor - cloaks, boots, body armor, etc.

Version:
1.0, Nov 10, 2000
Author:
Steve Yegge

Field Summary
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Method Summary
 java.lang.String canWear(Commandable agent)
          Called to see if the specified agent can wear this armor.
 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.Class[] getRequiredSlots()
          Returns a list of the slots that this armor requires in order to be worn.
 boolean isWorn()
          Returns true if this armor is currently being worn.
 void setWorn(boolean worn, Commandable agent)
          Notifies the armor it's being worn.
 
Methods inherited from interface wyvern.lib.GameObject
addContainerChangeListener, addMapChangeListener, addMapMotionListener, addMotionTracker, addObjectTracker, addPrefix, addSuffix, bless, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, destroy, externalize, getAlpha, getAppearance, getArchetype, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getImageDescriptors, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getTile, getValue, getWeight, inContainer, initialize, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeMapChangeListener, removeMapMotionListener, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDirection, setImage, setImage, setLayer, setLocations, setMap, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from interface wyvern.lib.MethodHookable
addMethodHook, removeMethodHook, runMethodHook
 
Methods inherited from interface wyvern.lib.Broadcaster
broadcast, broadcast, broadcast, broadcast, broadcast
 
Methods inherited from interface wyvern.lib.properties.Damageable
adjustHP, getHP, getMaxHP, kill
 

Method Detail

setWorn

public void setWorn(boolean worn,
                    Commandable agent)
Notifies the armor it's being worn. This is NOT the proper way to have a player or monster wear a piece of armor - it notifes the armor, but not the player. You should use the WearCommand utility methods to put armor on a monster or player.

Parameters:
worn - true if worn, false if not
agent - the person wearing/unwearing it

isWorn

public boolean isWorn()
Returns true if this armor is currently being worn.

Returns:
true if worn

getRequiredSlots

public java.lang.Class[] getRequiredSlots()
Returns a list of the slots that this armor requires in order to be worn. Often the list has only one element; for example, a Helmet only needs one HelmetSlot. But some pieces of armor require 2 or more free slots on different body parts.


getAC

public int getAC(DamageType dtype)
Returns the AC versus a specified DamageType.

Parameters:
dtype - the DamageType to defend against
Returns:
the ac against that DamageType

forceRemoval

public void forceRemoval()
Removes the armor from its wearer, removing the armor from any defense-list on the wearer as well. This is the proper way to remove a piece of armor from a wearer.


canWear

public java.lang.String canWear(Commandable agent)
Called to see if the specified agent can wear this armor. Gives the armor a chance to provide arbitrarily complex checking to see if the agent can wear it.

Parameters:
agent - the player or monster trying to wear the armor
Returns:
null if they can wear it. If they can't wear it, returns a message to send to the wearer explaining why not. For example: "You must be a Naga Monk to wear this armor."