com.planet_ink.coffee_mud.Items.Armor
Class StdArmor
java.lang.Object
com.planet_ink.coffee_mud.Items.Basic.StdItem
com.planet_ink.coffee_mud.Items.Basic.StdContainer
com.planet_ink.coffee_mud.Items.Armor.StdArmor
- All Implemented Interfaces:
- Affectable, Behavable, CMObject, Contingent, DBIdentifiable, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, Rider, StatsAffecting, Tickable, Armor, Container, Item, Wearable, 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
| Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable |
Wearable.CODES |
| Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem |
affects, baseGoldValue, basePhyStats, behaviors, cachedImageName, CODES, databaseID, description, destroyed, displayText, dispossessionTime, material, miscText, myContainer, myUses, myWornCode, name, owner, phyStats, properWornBitmap, rawImageName, riding, scripts, secretIdentity, tickStatus, wornLogicalAnd, xtraValues |
| 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.core.interfaces.Tickable |
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MOB, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SPELL_AFFECT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET, TICKMASK_SOLITARY |
| Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable |
DEFAULT_WORN_CODES, DEFAULT_WORN_DEPENDENCYGRID, DEFAULT_WORN_DESCS, DEFAULT_WORN_ORDER, DEFAULT_WORN_WEIGHT_POINTS, DEFAULT_WORN_WEIGHTS, FILTER_ANY, FILTER_UNWORNONLY, FILTER_WORNONLY, HIGHEST_WORN_CODE, IN_INVENTORY, WORN_ABOUT_BODY, WORN_ARMS, WORN_BACK, 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_RIGHT_FINGER, WORN_RIGHT_WRIST, WORN_TORSO, WORN_WAIST, WORN_WIELD |
|
Method Summary |
void |
affectCharStats(MOB affected,
CharStats affectableStats)
This method is called by the recoverCharStats() method on other MOB objects. |
void |
affectPhyStats(Physical affected,
PhyStats affectableStats)
This method is called by the recoverPhyStats() 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 |
recoverPhyStats()
This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to
all surrounding objects with affectPhyStats(Environmental,PhyStats) 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, isInside, isLocked, isOpen, keyName, 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, baseGoldValue, basePhyStats, behaviors, canSaveDatabaseID, canWearComplete, cloneFix, compareProperLocations, compareTo, container, copyOf, databaseID, delBehavior, delEffect, delScript, description, destroy, displayText, effects, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, fitsOn, getCodeNum, getSaveStatIndex, getStat, getStatCodes, getTickStatus, image, initializeClass, isGeneric, isReadable, isSavable, isStat, material, maxRange, minRange, miscTextFormat, name, Name, newInstance, numBehaviors, numberOfItems, numEffects, numScripts, owner, phyStats, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recursiveWeight, removeFromOwnerContainer, riding, sameAs, scripts, setBasePhyStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadable, setReadableText, setRiding, setSavable, setSecretIdentity, setStat, stopTicking, tackOns, text, ultimateContainer, unWear, usesRemaining, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, 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, isInside, isLocked, isOpen, keyName, setCapacity, setContainTypes, setKeyName, setLidsNLocks |
| Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item |
baseGoldValue, container, material, numberOfItems, owner, rawSecretIdentity, recursiveWeight, removeFromOwnerContainer, setBaseValue, setContainer, setMaterial, setOwner, setSecretIdentity, stopTicking, ultimateContainer, usesRemaining |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental |
description, displayText, expirationDate, image, isGeneric, maxRange, minRange, miscTextFormat, name, Name, rawImage, sameAs, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable |
addBehavior, addScript, behaviors, delBehavior, delScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts |
| Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable |
amWearingAt, compareProperLocations, fitsOn, rawLogicalAnd, rawProperLocationBitmap, rawWornCode, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, unWear, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear |
strangeDeviations
public static final long strangeDeviations
- See Also:
- Constant Field Values
deviation20
public static final long deviation20
- See Also:
- Constant Field Values
StdArmor
public StdArmor()
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:
Wearable
- 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 Wearable- Overrides:
canWear in class StdItem
- Parameters:
mob - the player or mob being evaluatedwhere - 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 objectmsg - 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 objectmsg - the CMMsg that needs to be executed- See Also:
CMMsg
recoverPhyStats
public void recoverPhyStats()
- Description copied from interface:
Affectable
- This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to
all surrounding objects with affectPhyStats(Environmental,PhyStats) 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 phyStats() object. When it returns, phyStats() 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:
recoverPhyStats in interface Affectable- Overrides:
recoverPhyStats in class StdItem
- See Also:
Affectable.basePhyStats(),
Affectable.phyStats(),
Affectable.addEffect(Ability),
Behavable.addBehavior(Behavior),
PhyStats
affectPhyStats
public void affectPhyStats(Physical affected,
PhyStats affectableStats)
- Description copied from interface:
StatsAffecting
- This method is called by the recoverPhyStats() method on other Environmental objects. It is used
to transform the Environmental basePhyStats() object into a finished phyStats() object, both of
which are objects implementing the PhyStats interface. See those methods for more information.
- Specified by:
affectPhyStats in interface StatsAffecting- Overrides:
affectPhyStats in class StdItem
- Parameters:
affected - the host of the PhyStats object being affectedaffectableStats - the particular PhyStats object being affected- See Also:
PhyStats,
Environmental,
Affectable.basePhyStats(),
Affectable.phyStats(),
Affectable.recoverPhyStats()
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 affectedaffectableStats - 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.