com.planet_ink.coffee_mud.Items.Armor
Class StdArmor

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
      extended by com.planet_ink.coffee_mud.Items.Basic.StdContainer
          extended by com.planet_ink.coffee_mud.Items.Armor.StdArmor
All Implemented Interfaces:
Behavable, CMModifiable, CMObject, Environmental, MsgListener, Rider, StatsAffecting, Tickable, Armor, Container, Item, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
BandedArmor, ChainMailArmor, ChainMailVest, Dress, DrowChainMailArmor, EternityBarkArmor, EternityLeafArmor, FieldPlate, FullPlate, GenArmor, GlovesSpeed, GlowingMageArmor, GreatHelm, Hat, Hat_Intelligence, Helmet, HideArmor, Hood, LeatherArmor, LeatherBoots, LeatherBracers, LeatherCap, LeatherGauntlets, MetalBracers, MichaelsMithrilChain, PaddedArmor, Pants, RingMail, Robes, ScaleMail, Shoes, SplintMail, StdShield, SteelGauntlets, StuddedLeatherArmor, ThreadbareRobes, WalkingBoots

public class StdArmor
extends StdContainer
implements Armor


Field Summary
static long deviation20
           
static long strangeDeviations
           
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdContainer
capacity, containType, hasALid, hasALock, isLocked, isOpen
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
affects, baseEnvStats, baseGoldValue, behaviors, CODES, databaseID, description, destroyed, displayText, dispossessionTime, envStats, imageName, material, miscText, myContainer, myUses, myWornCode, name, owner, properWornBitmap, riding, scripts, secretIdentity, tickStatus, wornLogicalAnd, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Armor
LAYERMASK_MULTIWEAR, LAYERMASK_SEETHROUGH
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Container
CONTAIN_ANYTHING, CONTAIN_BODIES, CONTAIN_CAGED, CONTAIN_CLOTHES, CONTAIN_COINS, CONTAIN_DAGGERS, CONTAIN_DESCS, CONTAIN_DRINKABLES, CONTAIN_FOOTWEAR, CONTAIN_KEYS, CONTAIN_LIQUID, CONTAIN_ONEHANDWEAPONS, CONTAIN_OTHERWEAPONS, CONTAIN_READABLES, CONTAIN_SCROLLS, CONTAIN_SMOKEABLES, CONTAIN_SSCOMPONENTS, CONTAIN_SWORDS
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
IN_INVENTORY, WORN_ABOUT_BODY, WORN_ARMS, WORN_BACK, WORN_CODES, WORN_DEPENDENCYGRID, WORN_DESCS, WORN_EARS, WORN_EYES, WORN_FEET, WORN_FLOATING_NEARBY, WORN_HANDS, WORN_HEAD, WORN_HELD, WORN_LEFT_FINGER, WORN_LEFT_WRIST, WORN_LEGS, WORN_MOUTH, WORN_NECK, WORN_ORDER, WORN_RIGHT_FINGER, WORN_RIGHT_WRIST, WORN_TORSO, WORN_WAIST, WORN_WEIGHT_POINTS, WORN_WEIGHTS, WORN_WIELD, WORNREQ_ANY, WORNREQ_UNWORNONLY, WORNREQ_WORNONLY
 
Constructor Summary
StdArmor()
           
 
Method Summary
 void affectCharStats(MOB affected, CharStats affectableStats)
          This method is called by the recoverCharStats() method on other MOB objects.
 void affectEnvStats(Environmental affected, EnvStats affectableStats)
          This method is called by the recoverEnvStats() method on other Environmental objects.
protected  java.lang.String armorHealth()
           
 boolean canWear(MOB mob, long where)
          Returns whether it is practical for the given mob to wear this Item on the given worn location as given by the wornCode.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 short getClothingLayer()
           
 short getLayerAttributes()
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 void recoverEnvStats()
          This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method.
 java.lang.String secretIdentity()
          This method returns the calculated and expanded description of the properties of the item as would be discovered through the Identify spell.
 void setClothingLayer(short newLayer)
           
 void setLayerAttributes(short newAttributes)
           
 void setUsesRemaining(int newUses)
          Sets the uses remaining field, which is a general numeric value whose meaning differs for different Item types.
 boolean subjectToWearAndTear()
          Whether the usesRemaining() number above is used to determine the percentage health of the item.
 int value()
          The default value of the item, represented in the base CoffeeMud currency.
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdContainer
canContain, capacity, containTypes, emptyPlease, getContents, hasALid, hasALock, isLocked, isOpen, keyName, reallyGetContents, setCapacity, setContainTypes, setKeyName, setLidsNLocks, setMiscText, tick
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
abilityImbuesMagic, addBehavior, addEffect, addNonUninvokableEffect, addScript, affectCharState, alreadyWornMsg, amDestroyed, amWearingAt, baseEnvStats, baseGoldValue, canWearComplete, cloneEffects, cloneFix, compareProperLocations, compareTo, container, copyOf, databaseID, delBehavior, delEffect, delScript, description, destroy, displayText, envStats, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, finalize, fitsOn, getCodeNum, getSaveStatIndex, getStat, getStatCodes, getTickStatus, image, initializeClass, isGeneric, isStat, material, maxRange, minRange, miscTextFormat, name, Name, newInstance, numBehaviors, numberOfItems, numEffects, numScripts, owner, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recursiveWeight, removeFromOwnerContainer, riding, sameAs, savable, setBaseEnvStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadableText, setRiding, setSecretIdentity, setStat, stopTicking, tackOns, text, ultimateContainer, unWear, usesRemaining, wearAt, wearEvenIfImpossible, wearIfPossible, whereCantWear
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Container
canContain, capacity, containTypes, emptyPlease, getContents, hasALid, hasALock, isLocked, isOpen, keyName, setCapacity, setContainTypes, setKeyName, setLidsNLocks
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
amWearingAt, baseGoldValue, compareProperLocations, container, databaseID, fitsOn, material, numberOfItems, owner, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recursiveWeight, removeFromOwnerContainer, setBaseValue, setContainer, setDatabaseID, setMaterial, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadableText, setSecretIdentity, stopTicking, ultimateContainer, unWear, usesRemaining, wearAt, wearEvenIfImpossible, wearIfPossible, whereCantWear
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 

Field Detail

strangeDeviations

public static final long strangeDeviations
See Also:
Constant Field Values

deviation20

public static final long deviation20
See Also:
Constant Field Values
Constructor Detail

StdArmor

public StdArmor()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdContainer
Returns:
the name of this class

setUsesRemaining

public void setUsesRemaining(int newUses)
Description copied from interface: Item
Sets the uses remaining field, which is a general numeric value whose meaning differs for different Item types. See usesRemaining() method above for more information.

Specified by:
setUsesRemaining in interface Item
Overrides:
setUsesRemaining in class StdItem
Parameters:
newUses - a new general numeric value for this field.

getClothingLayer

public short getClothingLayer()
Specified by:
getClothingLayer in interface Armor

setClothingLayer

public void setClothingLayer(short newLayer)
Specified by:
setClothingLayer in interface Armor

getLayerAttributes

public short getLayerAttributes()
Specified by:
getLayerAttributes in interface Armor

setLayerAttributes

public void setLayerAttributes(short newAttributes)
Specified by:
setLayerAttributes in interface Armor

canWear

public boolean canWear(MOB mob,
                       long where)
Description copied from interface: Item
Returns whether it is practical for the given mob to wear this Item on the given worn location as given by the wornCode. The method checks for existing limbs and wear locations, and for items already being worn by the mob, and finally determines if the worn location given by the wornCode is among the available slots.

Specified by:
canWear in interface Item
Overrides:
canWear in class StdItem
Parameters:
mob - the player or mob being evaluated
where - the worn location to check and see if this Item can be worn there.
Returns:
whether this item can be worn by the given player at the given wornCode
See Also:
Item

armorHealth

protected java.lang.String armorHealth()

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Overrides:
okMessage in class StdContainer
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdContainer
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

recoverEnvStats

public void recoverEnvStats()
Description copied from interface: Environmental
This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method. Surrounding objects include the room where the object is located, the Ability objects in the Effects list, the Behaviors in the behaviors list, and race/charclass/area if applicable. Those methods will then make all necessary adjustments to the values in the new envStats() object. When it returns, envStats() will have a totally updated object. This method must be called in code whenever the object is placed on the map, or when anything changes in its environment, such as location, effects, or other states.

Specified by:
recoverEnvStats in interface Environmental
Overrides:
recoverEnvStats in class StdItem
See Also:
Environmental.baseEnvStats(), Environmental.envStats(), Environmental.addEffect(Ability), Behavable.addBehavior(Behavior), EnvStats

affectEnvStats

public void affectEnvStats(Environmental affected,
                           EnvStats affectableStats)
Description copied from interface: StatsAffecting
This method is called by the recoverEnvStats() method on other Environmental objects. It is used to transform the Environmental baseEnvStats() object into a finished envStats() object, both of which are objects implementing the EnvStats interface. See those methods for more information.

Specified by:
affectEnvStats in interface StatsAffecting
Overrides:
affectEnvStats in class StdItem
Parameters:
affected - the host of the EnvStats object being affected
affectableStats - the particular EnvStats object being affected
See Also:
EnvStats, Environmental, Environmental.baseEnvStats(), Environmental.envStats(), Environmental.recoverEnvStats()

affectCharStats

public void affectCharStats(MOB affected,
                            CharStats affectableStats)
Description copied from interface: StatsAffecting
This method is called by the recoverCharStats() method on other MOB objects. It is used to transform the MOB baseCharStats() object into a finished charStats() object, both of which are objects implementing the CharStats interface. See those methods for more information.

Specified by:
affectCharStats in interface StatsAffecting
Overrides:
affectCharStats in class StdItem
Parameters:
affected - the host of the CharStats object being affected
affectableStats - the particular CharStats object being affected
See Also:
CharStats, MOB, MOB.baseCharStats(), MOB.charStats(), MOB.recoverCharStats()

value

public int value()
Description copied from interface: Item
The default value of the item, represented in the base CoffeeMud currency. This method starts with baseGoldValue, which is a user-entered value, and adjusts according to magical enhancements and the condition of the item.

Specified by:
value in interface Item
Overrides:
value in class StdItem
Returns:
the adjusted value of the item in the base currency.

subjectToWearAndTear

public boolean subjectToWearAndTear()
Description copied from interface: Item
Whether the usesRemaining() number above is used to determine the percentage health of the item. If this method returns false, then health or condition is irrelevant to this Item. If true is returned, then usesRemaining is a number from 100 to 0, where 100 means perfect condition, and 0 means imminent disintegration.

Specified by:
subjectToWearAndTear in interface Item
Overrides:
subjectToWearAndTear in class StdItem
Returns:
whether this item has a valid condition

secretIdentity

public java.lang.String secretIdentity()
Description copied from interface: Item
This method returns the calculated and expanded description of the properties of the item as would be discovered through the Identify spell. It starts with its rawSecretIdentity() and adds to it any strings which the Ability objects contained in the Items effects list would generate. An empty string means the item has no secret properties per se.

Specified by:
secretIdentity in interface Item
Overrides:
secretIdentity in class StdItem
Returns:
a displayable string describing the secret properties of the item.