|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Items.Basic.StdItem
public class StdItem
| Field Summary | |
|---|---|
protected java.util.Vector |
affects
|
protected EnvStats |
baseEnvStats
|
protected int |
baseGoldValue
|
protected java.util.Vector |
behaviors
|
protected static java.lang.String[] |
CODES
|
protected java.lang.String |
databaseID
|
protected byte[] |
description
|
protected boolean |
destroyed
|
protected java.lang.String |
displayText
|
protected long |
dispossessionTime
|
protected EnvStats |
envStats
|
protected java.lang.String |
imageName
|
protected int |
material
|
protected java.lang.String |
miscText
|
protected Item |
myContainer
|
protected int |
myUses
|
protected long |
myWornCode
|
protected java.lang.String |
name
|
protected Environmental |
owner
|
protected long |
properWornBitmap
|
protected Rideable |
riding
|
protected java.util.Vector |
scripts
|
protected java.lang.String |
secretIdentity
|
protected long |
tickStatus
|
protected boolean |
wornLogicalAnd
|
protected java.lang.String[] |
xtraValues
|
| 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 | |
|---|---|
StdItem()
|
|
| Method Summary | |
|---|---|
protected boolean |
abilityImbuesMagic()
|
void |
addBehavior(Behavior to)
Manipulation of Behavior objects, which includes movement, speech, spellcasting, etc, etc. |
void |
addEffect(Ability to)
Add a new effect to this object, whether permanent or temporary. |
void |
addNonUninvokableEffect(Ability to)
Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked. |
void |
addScript(ScriptingEngine S)
Manipulation of the scripts list |
void |
affectCharState(MOB affectedMob,
CharState affectableMaxState)
This method is called by the recoverCharState() method on other MOB objects. |
void |
affectCharStats(MOB affectedMob,
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 boolean |
alreadyWornMsg(MOB mob,
Item thisItem)
|
boolean |
amDestroyed()
Whether the destroy() method has been previousy called on this object. |
boolean |
amWearingAt(long wornCode)
Can test where, if anywhere, an item is being worn. |
EnvStats |
baseEnvStats()
Object containing a set of base, unmodified, mostly numeric fields. |
int |
baseGoldValue()
The user/builder-entered value of the item, represented in base CoffeeMud currency. |
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. |
protected boolean |
canWearComplete(MOB mob)
|
protected java.util.Vector |
cloneEffects()
|
protected void |
cloneFix(Item E)
|
boolean |
compareProperLocations(Item toThis)
compares whether this item is allowed to be worn on the same locations as the given item. |
int |
compareTo(CMObject o)
|
Item |
container()
Where the item is located. |
CMObject |
copyOf()
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed. |
java.lang.String |
databaseID()
Gets the internal database id for mapping back to tables. |
void |
delBehavior(Behavior to)
Delete a behavior from this object. |
void |
delEffect(Ability to)
Delete an effect from this object, whether permanent or temporary. |
void |
delScript(ScriptingEngine S)
Remove a running script from this object. |
java.lang.String |
description()
The basic description of this object, as shown when the item is directly LOOKed at. |
void |
destroy()
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. |
java.lang.String |
displayText()
Gets the raw string used to show what this object looks like in the room. |
EnvStats |
envStats()
Object containing a set of current, modified, usable, mostly numeric fields. |
void |
executeMsg(Environmental myHost,
CMMsg msg)
The general message event handler for the object. |
long |
expirationDate()
If this object expires, it should have a timestamp saying when it expires, in real time. |
Behavior |
fetchBehavior(int index)
Returns a behavior object on this object. |
Behavior |
fetchBehavior(java.lang.String ID)
Returns a behavior object listed on this object. |
Ability |
fetchEffect(int index)
Returns an ability object listed as an effect on this object. |
Ability |
fetchEffect(java.lang.String ID)
Returns an ability object listed as an effect on this object. |
ScriptingEngine |
fetchScript(int x)
Retreive one of the enumerated scripts running on this object |
protected void |
finalize()
|
boolean |
fitsOn(long wornCode)
Whether this item is designated as being wearable on the given worn codes defined in the Item interface. |
protected int |
getCodeNum(java.lang.String code)
|
int |
getSaveStatIndex()
Returns the index into the stat codes array where extra savable fields begins. |
java.lang.String |
getStat(java.lang.String code)
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. |
java.lang.String[] |
getStatCodes()
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders. |
long |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
java.lang.String |
image()
Returns the fully qualified and determined name of the image file displayed for this object when MXP is used. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
boolean |
isGeneric()
Whether the fields of this item are set in code, or set by builders. |
boolean |
isStat(java.lang.String code)
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. |
int |
material()
The resource code representing the material out of which this item is principally made. |
int |
maxRange()
the maximum range of this object, if applicable. |
int |
minRange()
the minimum range of this object, if applicable. |
java.lang.String |
miscTextFormat()
Unimplemented as of yet, but will hold a string telling the system what the proper format of any miscText data. |
java.lang.String |
name()
The displayable name of this object. |
java.lang.String |
Name()
The raw unmodified name of this object as stored in the database. |
CMObject |
newInstance()
Returns a new instance of this class. |
int |
numBehaviors()
The number of behaviors this object has. |
int |
numberOfItems()
How many items this Item object represents. |
int |
numEffects()
Returns the number of ability objects listed as effects on this object. |
int |
numScripts()
Return the number of scripts running on this object |
boolean |
okMessage(Environmental myHost,
CMMsg msg)
The general message event previewer for the object. |
Environmental |
owner()
The Room or MOB representing where this item is located. |
java.lang.String |
rawImage()
Returns the raw name of the image file to display for this object when MXP is used. |
boolean |
rawLogicalAnd()
Flag which determines whether the rawProperLocationBitmap represents the fact that it is worn on ALL locations (value of true) or worn on any of the locations. |
long |
rawProperLocationBitmap()
Returns the builder-defined bitmap made from a logical combination of the worn location constants from the Item interface. |
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. |
long |
rawWornCode()
Returns the bitmap representing where this item is presently being worn by the mob or player who has the item in his or inventory. |
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. |
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. |
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(). |
Rideable |
riding()
Returns the Rideable upon which this Rider is Riding. |
boolean |
sameAs(Environmental E)
Whether this object instance is functionally identical to the object passed in. |
boolean |
savable()
Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container. |
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 |
setBaseEnvStats(EnvStats newBaseEnvStats)
Re-sets the object containing a set of base, unmodified, mostly numeric fields. |
void |
setBaseValue(int newValue)
Changes the base value of the item, represented in base CoffeeMud currency. |
void |
setContainer(Item newContainer)
Change the container where the item is located. |
void |
setDatabaseID(java.lang.String id)
Sets the internal database id for mapping back to tables. |
void |
setDescription(java.lang.String newDescription)
Sets the basic description of this object, as shown when the item is directly LOOKed at. |
void |
setDisplayText(java.lang.String newDisplayText)
Sets the raw string used to show what this object looks like in the room. |
void |
setExpirationDate(long time)
If this object expires, it should have a timestamp saying when it expires, in real time. |
void |
setImage(java.lang.String newImage)
Sets the raw name of the image file to display for this object when MXP is used. |
void |
setMaterial(int newValue)
Sets the resource code representing the material out of which this item is principally made. |
void |
setMiscText(java.lang.String newText)
For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object. |
void |
setName(java.lang.String newName)
Sets the raw unmodified name of this object as stored in the database. |
void |
setOwner(Environmental E)
Sets the Room or MOB representing where this item is located. |
void |
setRawLogicalAnd(boolean newAnd)
Sets flag which determines whether the rawProperLocationBitmap represents the fact that it is worn on ALL locations (value of true) or worn on any of the locations. |
void |
setRawProperLocationBitmap(long newValue)
Sets the builder-defined bitmap made from a logical combination of the worn location constants from the Item interface. |
void |
setRawWornCode(long newValue)
Sets the bitmap representing where this item is presently being worn by the mob or player who has the item in his or inventory. |
void |
setReadableText(java.lang.String text)
Changes the text that is written on the item. |
void |
setRiding(Rideable ride)
Sets the Rideable upon which this Rider is Riding. |
void |
setSecretIdentity(java.lang.String newIdentity)
This method is used to change the string returned by rawSecretIdentity. |
void |
setStat(java.lang.String code,
java.lang.String val)
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. |
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. |
protected java.lang.String |
tackOns()
|
java.lang.String |
text()
For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
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. |
void |
unWear()
Removes this item from a state of being worn, and puts it back into the mob or player inventory. |
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. |
void |
wearAt(long wornCode)
This method is similar to the wearEvenIfImpossible method method above, except that it does not inspect this item for allowed wearable locations, but always puts the item on the wear location represented by the given wornCode bitmap. |
void |
wearEvenIfImpossible(MOB mob)
Puts this item into a state of being worn regardless of whether it is practical for the given mob to wear it -- for instance, even if an item is already being worn where this item wants to be worn, or if the player has no such limbs to wear this item. |
void |
wearIfPossible(MOB mob)
Using the canWear method, this method will put the item into a state of being worn only if it is practical for the given mob or player to wear this Item. |
long |
whereCantWear(MOB mob)
Returns a bitmap of all the locations where the given mob is practically unable to wear an item. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.lang.String displayText
protected byte[] description
protected Item myContainer
protected int myUses
protected long myWornCode
protected java.lang.String miscText
protected java.lang.String imageName
protected java.lang.String secretIdentity
protected boolean wornLogicalAnd
protected long properWornBitmap
protected int baseGoldValue
protected int material
protected Environmental owner
protected java.lang.String[] xtraValues
protected long dispossessionTime
protected long tickStatus
protected java.lang.String databaseID
protected java.util.Vector affects
protected java.util.Vector behaviors
protected java.util.Vector scripts
protected EnvStats envStats
protected EnvStats baseEnvStats
protected boolean destroyed
protected Rideable riding
protected static java.lang.String[] CODES
| Constructor Detail |
|---|
public StdItem()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectprotected boolean abilityImbuesMagic()
protected void finalize()
finalize in class java.lang.Objectpublic void initializeClass()
CMObject
initializeClass in interface CMObjectpublic boolean isGeneric()
Environmental
isGeneric in interface EnvironmentalEnvironmental.text()public java.lang.String Name()
Environmental
Name in interface EnvironmentalEnvironmental.name()public void setName(java.lang.String newName)
Environmental
setName in interface EnvironmentalnewName - the raw base name of this object on the map.Environmental.Name()public java.lang.String name()
Environmental
name in interface Environmentalname in interface TickableEnvironmental.Name()public java.lang.String image()
Environmental
image in interface Environmentalpublic java.lang.String rawImage()
Environmental
rawImage in interface Environmentalpublic void setImage(java.lang.String newImage)
Environmental
setImage in interface EnvironmentalnewImage - the raw name of the mxp image filepublic EnvStats envStats()
Environmental
envStats in interface EnvironmentalEnvironmental.baseEnvStats(),
Environmental.recoverEnvStats(),
EnvStatspublic EnvStats baseEnvStats()
Environmental
baseEnvStats in interface EnvironmentalEnvironmental.envStats(),
Environmental.recoverEnvStats(),
EnvStatspublic void recoverEnvStats()
Environmental
recoverEnvStats in interface EnvironmentalEnvironmental.baseEnvStats(),
Environmental.envStats(),
Environmental.addEffect(Ability),
Behavable.addBehavior(Behavior),
EnvStatspublic void setBaseEnvStats(EnvStats newBaseEnvStats)
Environmental
setBaseEnvStats in interface EnvironmentalnewBaseEnvStats - a set of state fieldsEnvironmental.envStats(),
Environmental.recoverEnvStats(),
EnvStatspublic CMObject newInstance()
CMObject
newInstance in interface CMObjectpublic boolean subjectToWearAndTear()
Item
subjectToWearAndTear in interface Itemprotected void cloneFix(Item E)
public CMObject copyOf()
CMObject
copyOf in interface CMObjectpublic Rideable riding()
Rider
riding in interface RiderRideablepublic void setRiding(Rideable ride)
Rider
setRiding in interface Riderride - the Rideable to ride uponRideablepublic Environmental owner()
Item
owner in interface ItemMOB,
Itempublic void setOwner(Environmental E)
Item
setOwner in interface ItemE - the mob or room where the item is locatedMOB.addInventory(Item),
Room.addItem(Item)public long expirationDate()
Environmental
expirationDate in interface EnvironmentalEnvironmental.setExpirationDate(long)public void setDatabaseID(java.lang.String id)
Item
setDatabaseID in interface Itemid - the database idMOB.databaseID()public java.lang.String databaseID()
Item
databaseID in interface ItemMOB.setDatabaseID(String)public void setExpirationDate(long time)
Environmental
setExpirationDate in interface Environmentaltime - the time stamp when this thing expiresEnvironmental.expirationDate()public boolean amDestroyed()
Environmental
amDestroyed in interface Environmentalpublic boolean amWearingAt(long wornCode)
Item
amWearingAt in interface ItemwornCode - either 0, or one or more worn codes
Itempublic boolean fitsOn(long wornCode)
Item
fitsOn in interface ItemwornCode - the worn code to check, as defined in the Item interface
Itempublic void wearEvenIfImpossible(MOB mob)
Item
wearEvenIfImpossible in interface Itemmob - the player or mobpublic void wearIfPossible(MOB mob)
Item
wearIfPossible in interface Itemmob - the player or mob to put this item on.public void wearAt(long wornCode)
Item
wearAt in interface ItemwornCode - the bitmap from Item interface constants usedItem,
Item.wearEvenIfImpossible(MOB)public long rawProperLocationBitmap()
Item
rawProperLocationBitmap in interface ItemItempublic boolean r