com.planet_ink.coffee_mud.Items.interfaces
Interface Item

All Superinterfaces:
Affectable, Behavable, java.lang.Cloneable, CMModifiable, CMObject, java.lang.Comparable<CMObject>, DBIdentifiable, Environmental, MsgListener, Rider, StatsAffecting, Tickable, Wearable
All Known Subinterfaces:
Ammunition, Armor, ClanItem, Coins, Container, DeadBody, DeckOfCards, Food, HandOfCards, InnKey, Key, Light, MagicDust, Map, MiscMagic, MusicalInstrument, PackagedItems, Pill, PlayingCard, Potion, RawMaterial, Recipe, Scroll, Shield, ShipComponent, ShipComponent.ShipEngine, ShipComponent.ShipEnviroControl, ShipComponent.ShipPanel, ShipComponent.ShipPowerSource, ShipComponent.ShipSensor, ShipComponent.ShipWeapon, Software, SpellHolder, Wand, Weapon
All Known Implementing Classes:
ArchonJournal, ArchonStaff, Arquebus, Backpack, BagOfEndlessness, BagOfHolding, BandedArmor, BardMap, BattleAxe, Bed, Boat, Broom, Cestus, ChainMailArmor, ChainMailVest, Chair, Claymore, CloseableContainer, Corpse, Dagger, DaggerOfVenom, Dirk, DragonClaw, Dress, DrowChainMailArmor, DrowDagger, DrowMace, DrowQuarterstaff, DrowSword, DruidicMonument, EternityBarkArmor, EternityLeafArmor, EternityLeafShield, EternityQuarterstaff, FieldPlate, FlamingSword, FullPlate, Gem, GenAmmunition, GenArmor, GenBattery, GenBed, GenBelt, GenBoat, GenBoffWeapon, GenBook, GenBow, GenCage, GenCaged, GenCageRideable, GenChair, GenCigar, GenClanApron, GenClanCard, GenClanCommonContainer, GenClanCommonItem, GenClanContainer, GenClanDonationList, GenClanFlag, GenClanItem, GenClanPamphlet, GenClanSpecialItem, GenCloak, GenCoins, GenContainer, GenCorpse, GenDress, GenDrink, GenElecContainer, GenElecItem, GenFatWallpaper, GenFood, GenFoodResource, GenFountain, GenHandBow, GenInstrument, GenItem, GenJournal, GenKey, GenLantern, GenLasso, GenLawBook, GenLightSource, GenLimb, GenLiquidResource, GenMap, GenMirror, GenMobilePortal, GenMultiPotion, GenNet, GenPackagedItems, GenPants, GenPerfume, GenPiano, GenPill, GenPipe, GenPortal, GenPotion, GenPowder, GenReadable, GenRecipe, GenResource, GenRideable, GenScroll, GenShield, GenShipComponent, GenShipContainer, GenShipItem, GenShirt, GenShoes, GenSling, GenSpear, GenSSBattery, GenSSConsole, GenSSEngine, GenSSEnviro, GenSSPanel, GenSSPortal, GenStaff, GenSuperPill, GenTable, GenTitle, GenTub, GenWallpaper, GenWand, GenWater, GenWeapon, Glaive, GlovesSpeed, GlowingMageArmor, GoodyBag, GreatHelm, Halberd, Hat, Hat_Intelligence, Helmet, HerbChest, HideArmor, HolyAvenger, Hood, Ingredients, Javelin, Katana, Lantern, LargeChest, LargeSack, LeatherArmor, LeatherBoots, LeatherBracers, LeatherCap, LeatherGauntlets, LifeFountain, LightSource, LockableContainer, Longsword, Mace, ManualAdvancement, ManualArchon, ManualClasses, MetalBracers, MichaelsMithrilChain, Natural, NeedleChest, OilFlask, PaddedArmor, Pan, Pants, Parchment, PortableHole, Pot, PracticePoint, Quarterstaff, QuestPoint, Rapier, Ration, Ring, Ring_Ornamental, Ring_Protection, RingMail, RingOfColdProtection, RingOfElectricity, RingOfFortitude, RingOfJustice, RingOfMagicResistance, Robes, Ruler, Sabre, ScaleMail, Scimitar, ScrollSpell, ShieldWeapon, Shirt, Shoes, Shortsword, Sickle, SmallChest, SmallDagger, SmallMace, SmallSack, SplintMail, Spring, Staff, StdArmor, StdBoffWeapon, StdBook, StdBow, StdCage, StdCageRideable, StdClanApron, StdClanCard, StdClanCommonContainer, StdClanCommonItem, StdClanContainer, StdClanDonationList, StdClanFlag, StdClanItem, StdClanPamphlet, StdClanSpecialItem, StdCoins, StdContainer, StdDeckOfCards, StdDrink, StdElecContainer, StdElecItem, StdFood, StdHandOfCards, StdInnKey, StdItem, StdJournal, StdKey, StdLasso, StdLawBook, StdLimb, StdMap, StdNet, StdPerfume, StdPill, StdPlayingCard, StdPortal, StdPotion, StdPowder, StdProgram, StdRideable, StdScroll, StdShield, StdShipComponent, StdShipConsole, StdShipContainer, StdShipItem, StdSling, StdSmokable, StdSpear, StdTitle, StdTub, StdWand, StdWeapon, SteelGauntlets, Stiletto, StuddedLeatherArmor, Sword, ThreadbareRobes, ThrowingStone, Torch, TrainingSession, TrappedChest, TwoHandedSword, WalkingBoots, Wand_Advancement, Wand_Fire, Wand_Nourishment, WandArchon, WarHammer, Waterskin, Whip, Wineskin

public interface Item
extends Environmental, Rider, DBIdentifiable, Wearable

The interface for all common items, and as a base for RawMaterial, armor, weapons, etc.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
Wearable.CODES
 
Field Summary
 
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
 
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, TICKS_PER_RLMIN, TIME_MILIS_PER_MUDHOUR, TIME_TICK, TIME_TICK_DOUBLE
 
Method Summary
 int baseGoldValue()
          The user/builder-entered value of the item, represented in base CoffeeMud currency.
 Item container()
          Where the item is located.
 int material()
          The resource code representing the material out of which this item is principally made.
 int numberOfItems()
          How many items this Item object represents.
 Environmental owner()
          The Room or MOB representing where this item is located.
 java.lang.String rawSecretIdentity()
          This method returns those secret properties of the item which are entered directly by the builder when the item is designed.
 java.lang.String readableText()
          If the IS_READABLE flag is set for the envStats().sensesMask() flag on this item, then this method will be consulted as representing any writing on the Item.
 int recursiveWeight()
          For a normal item, this method returns the same as envStats().weight().
 void removeFromOwnerContainer()
          This method basically calls setContainer(null), and then removes this item from its owner().
 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 setBaseValue(int newValue)
          Changes the base value of the item, represented in base CoffeeMud currency.
 void setContainer(Item newLocation)
          Change the container where the item is located.
 void setMaterial(int newValue)
          Sets the resource code representing the material out of which this item is principally made.
 void setOwner(Environmental E)
          Sets the Room or MOB representing where this item is located.
 void setReadableText(java.lang.String text)
          Changes the text that is written on the item.
 void setSecretIdentity(java.lang.String newIdentity)
          This method is used to change the string returned by rawSecretIdentity.
 void setUsesRemaining(int newUses)
          Sets the uses remaining field, which is a general numeric value whose meaning differs for different Item types.
 void stopTicking()
          If this Item is current Ticking due to its having Behaviors or other properties which might grant it the ability to Tick, this method will cause that ticking to cease and desist.
 boolean subjectToWearAndTear()
          Whether the usesRemaining() number above is used to determine the percentage health of the item.
 Item ultimateContainer()
          If an item is in a container, which is in a container, etc, this will return the "highest" or ultimate container in which this item is located.
 int usesRemaining()
          Uses remaining is a general use numeric value whose meaning differs for different Item types.
 int value()
          The default value of the item, represented in the base CoffeeMud currency.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.DBIdentifiable
canSaveDatabaseID, databaseID, setDatabaseID
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
amWearingAt, canWear, compareProperLocations, fitsOn, rawLogicalAnd, rawProperLocationBitmap, rawWornCode, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, unWear, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
amDestroyed, description, destroy, displayText, expirationDate, image, isGeneric, maxRange, minRange, miscTextFormat, name, Name, rawImage, sameAs, savable, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, baseEnvStats, delEffect, envStats, fetchEffect, fetchEffect, numEffects, recoverEnvStats, setBaseEnvStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectEnvStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
executeMsg, okMessage
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMModifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, delBehavior, delScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts
 

Method Detail

container

Item container()
Where the item is located. Either null for plain site (or contained on person), or will point to the container object

Returns:
The item in which it is contained, or null.

setContainer

void setContainer(Item newLocation)
Change the container where the item is located. Either null for plain site (or contained on person), or will point to the Container item.

Parameters:
newLocation - Container item in which this item is contained.
See Also:
Container

ultimateContainer

Item ultimateContainer()
If an item is in a container, which is in a container, etc, this will return the "highest" or ultimate container in which this item is located. If an item is in a container which is in plain view, it will simply return container(). As in container(), null means the item is in plain view.

Returns:
the highest level container in which this item is found.
See Also:
Container

removeFromOwnerContainer

void removeFromOwnerContainer()
This method basically calls setContainer(null), and then removes this item from its owner(). It effectively removes the item from the map. This is generally assumed to be a temporary condition. To really destroy the item permanently, the destroy() method is used. The unWear() method is also called.

See Also:
Container

numberOfItems

int numberOfItems()
How many items this Item object represents. When an item is Packaged, this method will return a number greater than 1, otherwise it always returns 1.

Returns:
the number of items represented by this object.

secretIdentity

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. 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.

Returns:
a displayable string describing the secret properties of the item.

rawSecretIdentity

java.lang.String rawSecretIdentity()
This method returns those secret properties of the item which are entered directly by the builder when the item is designed. It is the string saved to the database, and is used by the secretIdentity() method to construct a full secret description of the Item.

Returns:
the string entered by the builder as the item secret properties or name.

setSecretIdentity

void setSecretIdentity(java.lang.String newIdentity)
This method is used to change the string returned by rawSecretIdentity. This string is saved to the database as the items secret properties desctiption. The secretIdentity method uses this string to construct its full description.

Parameters:
newIdentity - the secret properties of this item. Empty string means it has none.

subjectToWearAndTear

boolean subjectToWearAndTear()
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.

Returns:
whether this item has a valid condition

usesRemaining

int usesRemaining()
Uses remaining is a general use numeric value whose meaning differs for different Item types. For instance, Wands use it to represent charges, Weapons and Armor use it to represent Condition, Ammunition uses it to represent quantity, etc.

Returns:
the general numeric value of this field.

setUsesRemaining

void setUsesRemaining(int newUses)
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.

Parameters:
newUses - a new general numeric value for this field.

stopTicking

void stopTicking()
If this Item is current Ticking due to its having Behaviors or other properties which might grant it the ability to Tick, this method will cause that ticking to cease and desist. This means that it will lose its periodic thread calls to its tick() method.


value

int value()
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.

Returns:
the adjusted value of the item in the base currency.

baseGoldValue

int baseGoldValue()
The user/builder-entered value of the item, represented in base CoffeeMud currency. It is used as a basis for the value returned by the value() method.

Returns:
the raw user-entered value of item.

setBaseValue

void setBaseValue(int newValue)
Changes the base value of the item, represented in base CoffeeMud currency. The value is saved to the database, and is used by the value() method as a basis.

Parameters:
newValue - the new raw value of the item

material

int material()
The resource code representing the material out of which this item is principally made. The resource codes are composed of an integer where the highest order bits represent the basic material type, and the lower order bits represent the specific material type. These codes are defined in RawMaterial.

Returns:
the RawMaterial code describing what this item is made of.
See Also:
RawMaterial

setMaterial

void setMaterial(int newValue)
Sets the resource code representing the material out of which this item is principally made. The resource codes are composed of an integer where the highest order bits represent the basic material type, and the lower order bits represent the specific material type. These codes are defined in RawMaterial interface.

See Also:
RawMaterial

readableText

java.lang.String readableText()
If the IS_READABLE flag is set for the envStats().sensesMask() flag on this item, then this method will be consulted as representing any writing on the Item. Typically accessed with the READ command. This flag is defined in the EnvStats interface

Returns:
the readable text on the item.
See Also:
EnvStats

setReadableText

void setReadableText(java.lang.String text)
Changes the text that is written on the item. This method does NOT set the IS_READABLE flag on the envStats().sensesMask flag. This flag is defined in the EnvStats interface

Parameters:
text - what is written on the item. Empty string means nothing.
See Also:
EnvStats

recursiveWeight

int recursiveWeight()
For a normal item, this method returns the same as envStats().weight(). For a Container, it returns the weight of the container plus the recursive weight of all items in the container.

Returns:
the total weight of the item and any possible contents.
See Also:
Container

owner

Environmental owner()
The Room or MOB representing where this item is located. Containers are handled by another pointer, container(), so those two methods be used together to determine where a given item is.

Returns:
the mob or room where the item is located
See Also:
MOB, Item

setOwner

void setOwner(Environmental E)
Sets the Room or MOB representing where this item is located. Containers are handled by another pointer, container(), so those two methods be used together to determine where a given item is. This method is called by the addInventory method on mobs and the addItem interface on Rooms. Alone, this method is insufficient to properly determine an items location, so one of the two above should be called instead.

Parameters:
E - the mob or room where the item is located
See Also:
MOB.addInventory(Item), Room.addItem(Item)