com.planet_ink.coffee_mud.Items.interfaces
Interface Item

All Superinterfaces:
Affectable, Behavable, java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, DBIdentifiable, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, Rider, StatsAffecting, Tickable, Wearable
All Known Subinterfaces:
Ammunition, AmmunitionWeapon, Armor, Book, CagedAnimal, ClanItem, Coins, Computer, Container, DeadBody, DeckOfCards, DoorKey, ElecPanel, Electronics, FalseLimb, Food, FuelConsumer, HandOfCards, InnKey, Light, MagicDust, MiscMagic, MusicalInstrument, PackagedItems, Pill, PlayingCard, Potion, PowerGenerator, PowerSource, RawMaterial, Recipe, RoomMap, SailingShip, Scroll, Shield, ShipEngine, ShipWarComponent, Software, SpellHolder, TechComponent, Technical, Wand, Weapon
All Known Implementing Classes:
Apple, ArchonJournal, ArchonStaff, Arquebus, Asteroid, 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, DwarfStar, EmissionScanProgram, EternityBarkArmor, EternityLeafArmor, EternityLeafShield, EternityQuarterstaff, FieldPlate, FlamingSword, FullPlate, GasGiant, Gem, GenAbsorbantShield, GenAmmunition, GenArmor, GenBagOfEndlessness, GenBed, GenBelt, GenBlaster, GenBoat, GenBoffWeapon, GenBook, GenBow, GenBussardCollector, GenCage, GenCaged, GenCageRideable, GenChair, GenCigar, GenClanApron, GenClanCard, GenClanCommonContainer, GenClanCommonItem, GenClanContainer, GenClanDonationList, GenClanFlag, GenClanItem, GenClanPamphlet, GenClanSpecialItem, GenCloak, GenCoins, GenCompBattery, GenCompEnviroSystem, GenCompGenerator, GenComputerConsole, GenContainer, GenCorpse, GenDeflectionShield, GenDice, GenDisruptor, GenDisruptor2, GenDissertation, GenDress, GenDrink, GenEarring, GenEclipseField, GenElecCompItem, GenElecCompSensor, GenElecContainer, GenElecItem, GenElecPanel, GenElecWeapon, GenEmptyDrink, GenEnergyShield, GenFatWallpaper, GenFood, GenFoodResource, GenFountain, GenFuellessGenerator, GenGrapples, GenGraviticSensor, GenHandBow, GenInstrument, GenIntegrityShield, GenItem, GenJournal, GenKey, GenKineticField, GenLantern, GenLaserGun, GenLasso, GenLawBook, GenLightSource, GenLightSwitch, GenLimb, GenLiquidResource, GenMap, GenMirror, GenMobilePortal, GenMultiPotion, GenMutingField, GenNet, GenPackagedItems, GenPackagedStack, GenPackagedVariety, GenPants, GenPaper, GenPerfume, GenPersonalShield, GenPhaser, GenPhaser2, GenPiano, GenPill, GenPipe, GenPlayerBook, GenPlayingCard, GenPortal, GenPotion, GenPowder, GenReadable, GenRecipe, GenReflectionShield, GenResource, GenRideable, GenRuinedItem, GenSailingShip, GenScroll, GenShield, GenShipDampener, GenShipEngine, GenShipGravityGen, GenShipPanel, GenShipProgram, GenShipShieldGenerator, GenShipThruster, GenShipWeapon, GenShirt, GenShoes, GenSiegeWeapon, GenSling, GenSoftware, GenSolarGenerator, GenSonicGun, GenSpaceBody, GenSpaceDrive, GenSpaceShip, GenSpaceTech, GenSpear, GenStaff, GenStealthShield, GenSuperPill, GenTable, GenTechItem, GenThinArmor, GenTickerShield, GenTitle, GenTriCorder, GenTub, GenWallpaper, GenWand, GenWater, GenWaterPowerGenerator, GenWeapon, GenWindGenerator, Glaive, GlovesSpeed, GlowingMageArmor, GoodyBag, GreatHelm, Halberd, Hat, Hat_Intelligence, HealthScanProgram, Helmet, HerbChest, HideArmor, HoleInTheGround, HolyAvenger, Hood, HorseCart, Ingredients, Javelin, Katana, Lantern, LargeChest, LargeSack, LeatherArmor, LeatherBoots, LeatherBracers, LeatherCap, LeatherGauntlets, LifeFountain, LifeScanProgram, LightSource, LockableContainer, Longsword, Mace, ManualAdvancement, ManualArchon, ManualClasses, MassiveStar, MetalBracers, MichaelsMithrilChain, Moonlet, 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, RocketShipProgram, Ruler, Sabre, ScaleMail, Scimitar, ScrollSpell, SeaMap, ShieldWeapon, ShipTelnetProgram, Shirt, Shoes, Shortsword, Sickle, SmallChest, SmallDagger, SmallMace, SmallSack, SplintMail, Spring, Staff, Star, StdArmor, StdBoardable, StdBoffWeapon, StdBook, StdBow, StdCage, StdCageRideable, StdClanApron, StdClanCard, StdClanCommonContainer, StdClanCommonItem, StdClanContainer, StdClanDonationList, StdClanFlag, StdClanItem, StdClanPamphlet, StdClanSpecialItem, StdCoins, StdCompBattery, StdCompFuelConsumer, StdCompFuellessGenerator, StdCompGenerator, StdCompPanel, StdComputerConsole, StdContainer, StdDeckOfCards, StdDice, StdDissertation, StdDrink, StdElecCompContainer, StdElecCompItem, StdElecCompSensor, StdElecContainer, StdElecItem, StdElecPanel, StdElecWeapon, StdFood, StdGrapples, StdHandOfCards, StdInnKey, StdItem, StdJournal, StdKey, StdLasso, StdLawBook, StdLimb, StdMap, StdNet, StdPaper, StdPerfume, StdPersonalShield, StdPill, StdPlayerBook, StdPlayingCard, StdPortal, StdPotion, StdPowder, StdProgram, StdRideable, StdScroll, StdShield, StdShipDampener, StdShipEngine, StdShipFuellessThruster, StdShipGravityGen, StdShipShieldGenerator, StdShipThruster, StdShipWeapon, StdSiegeWeapon, StdSling, StdSmokable, StdSpaceBody, StdSpaceTech, StdSpear, StdTechItem, StdThinArmor, StdTitle, StdTriCorder, StdTub, StdWand, StdWeapon, SteelGauntlets, Stiletto, StuddedLeatherArmor, Sword, ThreadbareRobes, ThrowingStone, Torch, TrainingSession, TrappedChest, Trident, TwoHandedSword, WalkingBoots, Wand_Advancement, Wand_Fire, Wand_Nourishment, WandArchon, WarHammer, Waterskin, Whip, Wineskin

public interface Item
extends Rider, DBIdentifiable, Wearable, PhysicalAgent, Readable

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.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_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
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_USUAL_NAMES, DEFAULT_WORN_WEIGHT_POINTS, DEFAULT_WORN_WEIGHTS, FILTER_ANY, FILTER_MOBINVONLY, FILTER_ROOMONLY, 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
 int baseGoldValue()
          The user/builder-entered value of the item, represented in base CoffeeMud currency.
 Container 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.
 ItemPossessor 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.
 int recursiveWeight()
          For a normal item, this method returns the same as phyStats().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(Container 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(ItemPossessor E)
          Sets the Room or MOB representing where this item is located.
 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(Physical stopAtC)
          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.Physical
description, displayText, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, L, maxRange, minRange, miscTextFormat, Name, rawImage, sameAs, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 
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.Contingent
amDestroyed, destroy, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, basePhyStats, delAllEffects, delEffect, eachEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 
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
amBeingWornProperly, 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.Readable
isReadable, readableText, setReadable, setReadableText
 

Method Detail

container

Container 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(Container 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(Physical stopAtC)
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(). If the item is not in a container, it will return itself.

Parameters:
stopAtC - if contained in this object, it will return this object.. default null.
Returns:
the highest level container in which this item is found, or itself
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. This method also makes the item appear destroyed without actually being destroyed. The whole idea is to make the item 'dormant' for storage.


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.

Parameters:
newValue - the resource code
See Also:
RawMaterial

recursiveWeight

int recursiveWeight()
For a normal item, this method returns the same as phyStats().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

ItemPossessor 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(ItemPossessor 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 addItem 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:
ItemCollection.addItem(Item)