com.planet_ink.coffee_mud.Items.Basic
Class StdPortal

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.Basic.StdPortal
All Implemented Interfaces:
Behavable, CMModifiable, CMObject, Environmental, MsgListener, Rideable, Rider, StatsAffecting, Tickable, Exit, Container, Item, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenPortal, GenSSPortal

public class StdPortal
extends StdContainer
implements Rideable, Exit


Field Summary
protected  java.lang.String closedText
           
protected  java.lang.String doorName
           
 
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.core.interfaces.Rideable
RIDEABLE_AIR, RIDEABLE_DESCS, RIDEABLE_ENTERIN, RIDEABLE_LADDER, RIDEABLE_LAND, RIDEABLE_SIT, RIDEABLE_SLEEP, RIDEABLE_TABLE, RIDEABLE_WAGON, RIDEABLE_WATER
 
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
 
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
 
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
StdPortal()
           
 
Method Summary
 void addRider(Rider mob)
          Adds a new Rider to this Rideable.
 boolean amRiding(Rider mob)
          Returns whether Rider is currently mounted on this Rideable
 java.lang.String closedText()
          Returns a text description of what this exit looks like when closed.
 java.lang.String closeWord()
          Returns the verb used for describing closing this exit, e.g.
 boolean defaultsClosed()
          For exits with a door, this returns whether the door defaults in a closed state.
 boolean defaultsLocked()
          For exits with a door and lock, this returns whether the door defaults in a closed and locked state.
 void delRider(Rider mob)
          Removes a Rider from this Rideable.
 java.lang.String dismountString(Rider R)
          Returns a string grammatically correct for the given rider when they are dismounting this Rideable
 java.lang.String displayText()
          Gets the raw string used to show what this object looks like in the room.
 java.lang.String doorName()
          Returns the short name of this door, e.g.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 short exitUsage(short change)
          Both reads and optionally modifies an internal reference counter for this exit.
 Rider fetchRider(int which)
          Returns a particular Rider mounted on this Rideable.
protected  Room getDestinationRoom()
           
 java.util.HashSet getRideBuddies(java.util.HashSet list)
          Adds all of the MOB Riders on this Rideable to the given HashSet and returns it
 boolean hasADoor()
          Returns whether this exit has a door, and must be opened before being used.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isMobileRideBasis()
          Whether the type of rideable is mobile.
 boolean isReadable()
          Returns whether this exit is readable when the player uses the READ command and targets it.
 boolean mobileRideBasis()
          Whether this Rideable moves when the Rider wants to move it.
 java.lang.String mountString(int commandType, Rider R)
          Returns a string grammatically correct for the given rider when they are mounting this Rideable
 int numRiders()
          Returns the number of riders currently mounted on this Rideable
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 int openDelayTicks()
          Returns the number of ticks that this exit remains open when a mob or player changes it from a closed to an open state, and the door defaults in a closed state.
 java.lang.String openWord()
          Returns the verb used for describing opening this exit, e.g.
 java.lang.String putString(Rider R)
          Returns a string grammatically correct for the given rider when they are putting something on this Rideable
 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 rideBasis()
          The type of rideable object this is.
 int riderCapacity()
          The number of Riders which may ride upon this Rideable
 void setDoorsNLocks(boolean hasADoor, boolean isOpen, boolean defaultsClosed, boolean hasALock, boolean isLocked, boolean defaultsLocked)
          Modifies the various door/lock settings for this exit.
 void setExitParams(java.lang.String newDoorName, java.lang.String newCloseWord, java.lang.String newOpenWord, java.lang.String newClosedText)
          Sets various word descriptions used when doing some dynamic manipulations of this exit.
 void setOpenDelayTicks(int numTicks)
          Sets the number of ticks that this exit will remain open when a mob or player changes it from a closed to an open state, and the door defaults in a closed state.
 void setReadable(boolean isTrue)
          Returns whether this exit is readable when the player uses the READ command and targets it.
 void setRideBasis(int basis)
          Sets type of rideable object this is.
 void setRiderCapacity(int newCapacity)
          Sets the number of Riders which may ride upon this Rideable
 void setTemporaryDoorLink(java.lang.String link)
          If this exit represents a route to a room not yet created, but whose room id is already known, this will set that designated room id.
 java.lang.String stateString(Rider R)
          Returns a string grammatically correct for the given rider when they are mounted on this Rideable
 java.lang.String stateStringSubject(Rider R)
          Returns a string grammatically correct for this Rideable when Riders are mounted
 java.lang.String temporaryDoorLink()
          If this exit represents a route to a room not yet created, but whose room id is already known, this will return that designated room id.
 java.lang.StringBuffer viewableText(MOB mob, Room myRoom)
          Returns the modified and qualified player-viewed description of this exit.
 
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, affectCharStats, affectEnvStats, alreadyWornMsg, amDestroyed, amWearingAt, baseEnvStats, baseGoldValue, canWear, canWearComplete, cloneEffects, cloneFix, compareProperLocations, compareTo, container, copyOf, databaseID, delBehavior, delEffect, delScript, description, destroy, 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, secretIdentity, setBaseEnvStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadableText, setRiding, setSecretIdentity, setStat, setUsesRemaining, stopTicking, subjectToWearAndTear, tackOns, text, ultimateContainer, unWear, usesRemaining, value, 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.core.interfaces.Environmental
addEffect, addNonUninvokableEffect, amDestroyed, baseEnvStats, delEffect, description, destroy, envStats, expirationDate, fetchEffect, fetchEffect, image, isGeneric, maxRange, minRange, miscTextFormat, name, Name, numEffects, rawImage, sameAs, savable, setBaseEnvStats, 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.StatsAffecting
affectCharState, affectCharStats, affectEnvStats
 
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
 
Methods inherited from interface com.planet_ink.coffee_mud.Exits.interfaces.Exit
hasALock, isLocked, isOpen, keyName, readableText, setKeyName, setReadableText
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
addEffect, addNonUninvokableEffect, amDestroyed, baseEnvStats, delEffect, description, destroy, envStats, expirationDate, fetchEffect, fetchEffect, image, isGeneric, maxRange, minRange, miscTextFormat, name, Name, numEffects, rawImage, sameAs, savable, setBaseEnvStats, 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.StatsAffecting
affectCharState, affectCharStats, affectEnvStats
 
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
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
amWearingAt, baseGoldValue, canWear, compareProperLocations, container, databaseID, fitsOn, material, numberOfItems, owner, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recursiveWeight, removeFromOwnerContainer, secretIdentity, setBaseValue, setContainer, setDatabaseID, setMaterial, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadableText, setSecretIdentity, setUsesRemaining, stopTicking, subjectToWearAndTear, ultimateContainer, unWear, usesRemaining, value, wearAt, wearEvenIfImpossible, wearIfPossible, whereCantWear
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 

Field Detail

doorName

protected java.lang.String doorName

closedText

protected java.lang.String closedText
Constructor Detail

StdPortal

public StdPortal()
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

isMobileRideBasis

public boolean isMobileRideBasis()
Description copied from interface: Rideable
Whether the type of rideable is mobile.

Specified by:
isMobileRideBasis in interface Rideable
Returns:
Whether this type of rideable is mobile
See Also:
Rideable

rideBasis

public int rideBasis()
Description copied from interface: Rideable
The type of rideable object this is.

Specified by:
rideBasis in interface Rideable
Returns:
the RIDEABLE_* constant describing how this is ridden
See Also:
Rideable

setRideBasis

public void setRideBasis(int basis)
Description copied from interface: Rideable
Sets type of rideable object this is.

Specified by:
setRideBasis in interface Rideable
Parameters:
basis - the RIDEABLE_* constant describing how this is ridden
See Also:
Rideable

riderCapacity

public int riderCapacity()
Description copied from interface: Rideable
The number of Riders which may ride upon this Rideable

Specified by:
riderCapacity in interface Rideable
Returns:
the maximum riders
See Also:
Rider

setRiderCapacity

public void setRiderCapacity(int newCapacity)
Description copied from interface: Rideable
Sets the number of Riders which may ride upon this Rideable

Specified by:
setRiderCapacity in interface Rideable
Parameters:
newCapacity - the maximum riders
See Also:
Rider

numRiders

public int numRiders()
Description copied from interface: Rideable
Returns the number of riders currently mounted on this Rideable

Specified by:
numRiders in interface Rideable
Returns:
the number of current Riders
See Also:
Rider

fetchRider

public Rider fetchRider(int which)
Description copied from interface: Rideable
Returns a particular Rider mounted on this Rideable. May return null in the case of a race condition

Specified by:
fetchRider in interface Rideable
Parameters:
which - which rider to detch
Returns:
the rider riding
See Also:
Rider, Rideable, Rideable.numRiders()

addRider

public void addRider(Rider mob)
Description copied from interface: Rideable
Adds a new Rider to this Rideable. Is called by Rider.setRiding(Rideable) Should also call Rider.setRiding(Rideable) without recursion

Specified by:
addRider in interface Rideable
Parameters:
mob - Rider object, either an item or a mob
See Also:
Rider, Rideable

delRider

public void delRider(Rider mob)
Description copied from interface: Rideable
Removes a Rider from this Rideable. Is called by Rider.setRiding(null) Should also call Rider.setRiding(null) without recursion

Specified by:
delRider in interface Rideable
Parameters:
mob - Rider object, either an item or a mob
See Also:
Rider, Rideable

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

getRideBuddies

public java.util.HashSet getRideBuddies(java.util.HashSet list)
Description copied from interface: Rideable
Adds all of the MOB Riders on this Rideable to the given HashSet and returns it

Specified by:
getRideBuddies in interface Rideable
Parameters:
list - the hashset into which to add all the mob riders
Returns:
the same list passed in, filled

mobileRideBasis

public boolean mobileRideBasis()
Description copied from interface: Rideable
Whether this Rideable moves when the Rider wants to move it. Largely derived from rideBasis().

Specified by:
mobileRideBasis in interface Rideable
Returns:
whether this item moves with the rider
See Also:
Rideable.rideBasis()

stateString

public java.lang.String stateString(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are mounted on this Rideable

Specified by:
stateString in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of riding this Rideable
See Also:
Rider, Rideable

putString

public java.lang.String putString(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are putting something on this Rideable

Specified by:
putString in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of putting something on this Rideable
See Also:
Rider, Rideable

mountString

public java.lang.String mountString(int commandType,
                                    Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are mounting this Rideable

Specified by:
mountString in interface Rideable
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of mounting this Rideable
See Also:
Rider, Rideable

dismountString

public java.lang.String dismountString(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for the given rider when they are dismounting this Rideable

Specified by:
dismountString in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the riders state of dismounting this Rideable
See Also:
Rider, Rideable

stateStringSubject

public java.lang.String stateStringSubject(Rider R)
Description copied from interface: Rideable
Returns a string grammatically correct for this Rideable when Riders are mounted

Specified by:
stateStringSubject in interface Rideable
Parameters:
R - The rider object to make grammatically correct.
Returns:
a string describing the Riderable state of being ridden
See Also:
Rider, Rideable

exitUsage

public short exitUsage(short change)
Description copied from interface: Exit
Both reads and optionally modifies an internal reference counter for this exit. Not currently functional.

Specified by:
exitUsage in interface Exit
Parameters:
change - 0 to make no change, or a positive or negative number
Returns:
the value of the usage counter after the change is applied

displayText

public java.lang.String displayText()
Description copied from interface: Environmental
Gets the raw string used to show what this object looks like in the room. May be used as a basis for other methods, such as the title of rooms, and what an exit looks like when open. The value for Items may be null if the item is not displayed when the room is seen.

Specified by:
displayText in interface Environmental
Overrides:
displayText in class StdItem
Returns:
the string describing how this object looks in the room

amRiding

public boolean amRiding(Rider mob)
Description copied from interface: Rideable
Returns whether Rider is currently mounted on this Rideable

Specified by:
amRiding in interface Rideable
Parameters:
mob - the Rider to check this Rideable for
Returns:
true if the Rider is mounted on this Rideable
See Also:
Rider, Rideable

okMessage

public boolean okMessage(Environmental myHost,