com.planet_ink.coffee_mud.MOBS
Class StdMOB

java.lang.Object
  extended by com.planet_ink.coffee_mud.MOBS.StdMOB
All Implemented Interfaces:
AbilityContainer, Affectable, Behavable, CMObject, Combatant, Contingent, DBIdentifiable, Environmental, FactionMember, Followable<MOB>, ItemCollection, ItemPossessor, Modifiable, MsgListener, MUDCmdProcessor, Physical, PhysicalAgent, Rider, StatsAffecting, Tattooable, Tickable, MOB, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
Alligator, AngryCitizen, Ape, Beaver, Bee, BlackBear, BrownBear, BrownSnake, Buffalo, Bugbear, Bull, Cat, Centaur, Centipede, Cheetah, Chicken, Chimp, Citizen, Cobra, CommonBat, Cougar, Cow, Coyote, Crocodile, Deer, DireWolf, Dog, Dolphin, Doppleganger, Dragon, DrowElf, Duck, Elephant, Falcon, FireGiant, FlyingInsect, Fox, Frog, FrostGiant, GardenSnake, GenMob, GiantBat, GiantScorpion, Gnoll, Goat, Goblin, Gorilla, Hawk, HeavenlyServent, HillGiant, Hornet, InvisibleStalker, Jaguar, Kitten, LargeBat, Lion, Lizard, LizardMan, Minotaur, Monkey, MountainLion, Mouse, Naga, Ogre, Orc, Owl, Panther, Parakeet, Penguin, Pig, Puppy, Python, Rabbit, Rat, Rattlesnake, Raven, Scorpion, Seal, Shark, Sheep, Snake, Spider, Squirrel, StdAuctioneer, StdDeity, StdFactoryMOB, StdRideable, StdShopKeeper, StoneGiant, StoneGolem, Swordfish, Teacher, Tiger, Toad, Troll, Turtle, UmberHulk, Undead, Vulture, Walrus, Whale, WildEagle, Wolf, Wolverine, Worm, Wyvern

public class StdMOB
extends java.lang.Object
implements MOB


Nested Class Summary
static class StdMOB.ApplyAffectCharState<T extends StatsAffecting>
          EachApplicable class that affect charState
static class StdMOB.ApplyAffectCharStats<T extends StatsAffecting>
          EachApplicable class that affect charStats
static class StdMOB.ApplyRecAffectPhyStats<T extends StatsAffecting>
          EachApplicable class that recovers item and affect phyStats
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
MOB.Attrib
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
 
Field Summary
protected  CMUniqSortSVec<Ability> abilitys
           
protected  STreeMap<java.lang.String,int[][]> abilityUseCache
           
protected  int[] abilityUseTrig
           
protected  StdMOB.ApplyAffectCharState affectCharState
           
protected  StdMOB.ApplyAffectCharStats affectCharStats
           
protected  EachApplicable.ApplyAffectPhyStats<Ability> affectPhyStats
           
protected  SVector<Ability> affects
           
protected  long ageMinutes
           
protected  boolean amDead
           
protected  boolean amDestroyed
           
protected  Followable<MOB> amFollowing
           
protected  int atRange
           
protected  int attributesBitmap
           
protected  CharStats baseCharStats
           
protected  PhyStats basePhyStats
           
 CharState baseState
           
protected  CMUniqSortSVec<Behavior> behaviors
           
protected  java.lang.String cachedImageName
           
protected  CharStats charStats
           
protected  java.util.List<Ability> clanAffects
           
protected  OrderedMap<java.lang.String,Pair<Clan,java.lang.Integer>> clans
           
protected static java.lang.String[] CODES
           
protected  java.util.LinkedList<com.planet_ink.coffee_mud.MOBS.StdMOB.QMCommand> commandQue
           
 CharState curState
           
protected  java.lang.String databaseID
           
protected  java.lang.Object description
           
protected  java.lang.String displayText
           
protected  int experience
           
protected  STreeMap<java.lang.String,java.lang.Integer> expertises
           
protected  SHashtable<java.lang.String,Faction.FData> factions
           
protected  PairList<MOB,java.lang.Short> followers
           
protected  SVector<Item> inventory
           
protected  boolean kickFlag
           
protected  Room lastLocation
           
protected  java.lang.String liegeID
           
protected  Room location
           
 CharState maxState
           
protected  MOB me
           
protected  java.lang.Object miscText
           
protected  int money
           
protected  double moneyVariation
           
protected  Session mySession
           
protected  long peaceTime
           
protected  PhyStats phyStats
           
protected  PlayerStats playerStats
           
protected  java.lang.ref.WeakReference<Item> possHeldItem
           
protected  Room possStartRoom
           
protected  java.lang.ref.WeakReference<Item> possWieldedItem
           
protected  int practices
           
protected  int questPoint
           
protected  java.util.List<Ability> racialAffects
           
protected  java.lang.String rawImageName
           
protected  StdMOB.ApplyRecAffectPhyStats<Item> recoverAffectP
           
protected  int recoverTickCter
           
protected  boolean removeFromGame
           
protected  Rideable riding
           
protected  SVector<ScriptingEngine> scripts
           
protected  MOB soulMate
           
protected  CMUniqNameSortSVec<Tattoo> tattoos
           
protected  int tickAgeCounter
           
protected  int tickStatus
           
protected  int trains
           
 java.lang.String username
           
protected  MOB victim
           
protected  int wimpHitPoint
           
protected  java.lang.String worshipCharID
           
protected  java.lang.String[] xtraValues
           
 
Fields inherited from interface com.planet_ink.coffee_mud.MOBS.interfaces.MOB
AGE_MILLIS_THRESHOLD, END_SHEATH_TIME, START_SHEATH_TIME
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.MUDCmdProcessor
METAFLAG_AS, METAFLAG_ASMESSAGE, METAFLAG_FORCED, METAFLAG_INORDER, METAFLAG_MPFORCED, METAFLAG_ORDER, METAFLAG_POSSESSED, METAFLAG_SNOOPED
 
Constructor Summary
StdMOB()
           
 
Method Summary
 java.util.Enumeration<Ability> abilities()
          Returns an enumerator of the Ability objects in this container.
 double actions()
          Returns the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them.
 void addAbility(Ability to)
          Adds a new ability to this for use.
 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 addExpertise(java.lang.String code)
          Adds a new expertise, or updates an existing one.
 void addFaction(java.lang.String which, int start)
          Manipulation of the factions list
 void addFollower(MOB follower, int order)
          Adds/Alters a follower to this Followable, of the appropriate type, while also setting the order/rank they hold in the line.
 void addItem(Item item)
          Adds a new item to its possessor.
 void addItem(Item item, ItemPossessor.Expire expire)
          Adds a new item to its possessor, with an expiration code.
 void addNonUninvokableEffect(Ability to)
          Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked.
 void addPriorityEffect(Ability to)
          Adds the given Ability as a new effect, also putting it on the top of the list to ensure that it is processed first for messaging and stat effect purposes.
 void addScript(ScriptingEngine S)
          Manipulation of the scripts list
 void addTattoo(java.lang.String of)
          Manipulation of the tatoo list
 void addTattoo(java.lang.String of, int tickDown)
          Add a new tattoo to this object
 void addTattoo(Tattoo of)
          Add a new tattoo to this object
 void adjustFaction(java.lang.String which, int amount)
          If this is already a member of the given faction, then the value or rank in that faction will be adjusted by the given amount.
 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 affectPhyStats(Physical affected, PhyStats affectableStats)
          This method is called by the recoverPhyStats() method on other Environmental objects.
 java.util.Enumeration<Ability> allAbilities()
          Returns an enumerator of the Ability objects in this container.
 boolean amActive()
          Returns whether this mob has been removed from the game.
 boolean amDead()
          Returns whether this mob is dead and presumably waiting for rejuv.
 boolean amDestroyed()
          Whether the destroy() method has been previousy called on this object.
 MOB amFollowing()
          Returns the followable that this followable follower is following, or null.
 MOB amUltimatelyFollowing()
          If this followable follower is following a followable that is also following a followable, then this will recursively determine the First followable and return it.
 CharStats baseCharStats()
          Gets the Base CharStats object for this mob, which are the stats like saves and strength.
 PhyStats basePhyStats()
          Object containing a set of base, unmodified, mostly numeric fields.
 CharState baseState()
          Gets the Base CharState object for this mob, which are the stats like health and mana.
 int baseWeight()
          Returns the base weight of this mob, which includes any char stat adjustments, and adjustments from race.
 java.util.Enumeration<Behavior> behaviors()
          Returns an enumerator of all the behaviors on this object.
 void bringToLife()
          Flags this mob as being alive, and restarts the mob tick.
 void bringToLife(Room newLocation, boolean resetStats)
          Brings this mob to life, or back to life, and puts the mob into the given room, or their start room if none given.
protected  double calculateActionCost(java.lang.Object command, java.util.List<java.lang.String> commands, double overrideActionCost)
           
 boolean canSaveDatabaseID()
          Returns true if this object can safely store and retrieve a database ID, and false if the TYPE of object can, but this particular instance can not.
 CharStats charStats()
          Gets the Current CharStats object for this mob, which are the stats like saves and strength.
protected  java.util.List<Ability> clanEffects()
           
 java.lang.Iterable<Pair<Clan,java.lang.Integer>> clans()
          Returns an iterable set of the Clans that this mob/player belongs to, along with the Rank code in that clan that this mob has in it.
 void clearCommandQueue()
          Cancels and empties the command que of this processor.
protected  void cloneFix(MOB M)
           
 int commandQueSize()
          Returns the number of commands on this processors que
 int compareTo(CMObject o)
           
protected  boolean confirmLocation(Room whereHeShouldBeR)
           
 void copyFactions(FactionMember source)
          Copies the factions that the given member belongs to into this.
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 CharState curState()
          Gets the Current CharState object for this mob, which are the temp stats like health and mana.
 java.lang.String databaseID()
          Retrieve the unique contextual database ID for this object.
 void delAbility(Ability to)
          Removes the exact given ability object from here.
 void delAllAbilities()
          Removes all owned abilities from this container.
 void delAllBehaviors()
          Removes all behaviors from this object.
 void delAllEffects(boolean unInvoke)
          Optionally uninvokes and then certainly removes all effects from this object.
 void delAllExpertises()
          Deletes all expertises from the collection
 void delAllItems(boolean destroy)
          Removes all items from this collection
 void delAllScripts()
          Removes all executing scripts from this object.
 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 delExpertise(java.lang.String baseCode)
          Deletes an expertise.
 void delFollower(MOB follower)
          Removes the given follower from this followable.
 void delItem(Item item)
          Removes the item from this possessor.
 void delScript(ScriptingEngine S)
          Remove a running script from this object.
 void delTattoo(java.lang.String of)
          Remove a specific tattoo from this object
 void delTattoo(Tattoo of)
          Remove a specific tattoo from this object
 boolean dequeCommand()
          If this processor has enough action points to perform the top command on the que, then this method will execute that action.
 java.lang.String description()
          The basic description of this object, as shown when the item is directly LOOKed at.
 java.lang.String description(MOB viewerMob)
          Returns the description, but as seen by the given viewer.
 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.
 java.lang.String displayText(MOB viewerMob)
          Returns the displayText, but as seen by the given viewer.
 void dispossess(boolean forceLook)
          If this mob is being possessed by a player, this method can be called to return this mobs borrowed session to the player, thus ending the possession.
 void doCommand(java.util.List<java.lang.String> commands, int metaFlags)
          Forces this processor to parse the given command string tokens, determine a command to execute, and then execute it, regardless of whether there are any action points remaining.
protected  void doCommand(java.lang.Object O, java.util.List<java.lang.String> commands, int metaFlags)
           
 void eachBehavior(EachApplicable<Behavior> applier)
          Applies the given code to each behavior on this object
 void eachEffect(EachApplicable<Ability> applier)
          Applies the given code to each effect on this object
 void eachItem(EachApplicable<Item> applier)
          Applies the given code to each item in this collection
 void eachScript(EachApplicable<ScriptingEngine> applier)
          Applies the given code to each scripting engine on this object
 java.util.Enumeration<Ability> effects()
          Returns an enumerator of abilities listed as effects on this object.
 void enqueCommand(java.util.List<java.lang.String> commands, int metaFlags, double actionCost)
          Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.
 void enqueCommands(java.util.List<java.util.List<java.lang.String>> commands, int metaFlags)
          Parses the given commands string tokens to determine what kind of commands are to be executed, and depending on how many actions the player has remaining this tick, either executes the commands or puts them on the que for automatic execution once sufficient actions are available.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 java.util.Enumeration<java.lang.String> expertises()
          Returns an enumerator of all the expertise names with their numbers if any .
 long expirationDate()
          If this object expires, it should have a timestamp saying when it expires, in real time.
 java.util.Enumeration<java.lang.String> factions()
          Returns an enumeration of all the faction id this is a member of.
 Ability fetchAbility(int index)
          Returns the Ability object at that index in this container.
 Ability fetchAbility(java.lang.String ID)
          If contained herein, this will return the ability from this container of the given ID.
 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.
 Pair<java.lang.String,java.lang.Integer> fetchExpertise(java.lang.String baseCode)
          Returns the expertise and number for the given code.
 int fetchFaction(java.lang.String which)
          Returns the faction rank/value that this member has in the given faction id.
 Faction.FData fetchFactionData(java.lang.String which)
          Returns the complete contextual faction data for this member.
 java.util.List<java.lang.String> fetchFactionRanges()
          Returns an enumeration of the faction range ids that represent the rank that this member has in each of their factions.
 Item fetchFirstWornItem(long wornCode)
          Returns the first item encountered on this player/mob at the given worn code, or null if nothing found.
 MOB fetchFollower(int index)
          Returns the followable follower at the give index in this collection
 MOB fetchFollower(java.lang.String named)
          Returns the followable follower that best matches the given search string name.
 int fetchFollowerOrder(MOB thisOne)
          Returns the relative order/rank of the specific follower in the formation.
 Item fetchFromInventory(Item goodLocation, java.lang.String itemName, Filterer<Environmental> filter, boolean respectLocationAndWornCode)
           
 Item fetchHeldItem()
          Returns the item being wielded in the HELD position by this player/mob.
 Item fetchItem(Item goodLocation, Filterer<Environmental> filter, java.lang.String itemName)
          Returns a best match for the given itemName in this mob/players base inventory.
 Ability fetchRandomAbility()
          Returns a random ability from this container.
 ScriptingEngine fetchScript(int x)
          Retrieve one of the enumerated scripts running on this object
 Item fetchWieldedItem()
          Returns the item being wielded in the WIELD position by this player/mob.
 java.util.List<Item> fetchWornItems(long wornCode, short aboveOrAroundLayer, short layerAttributes)
          Returns the collection of items worn by this mob/player at the given specific worn code, at or above the given Layer code, and having the given layerAttributes.
 Ability findAbility(java.lang.String ID)
          Returns the best match ability/skill/spell of this mob to the given search name string.
 Item findItem(Item goodLocation, java.lang.String itemName)
          Returns the item in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found).
 Item findItem(java.lang.String itemName)
          Returns the item in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found).
 java.util.List<Item> findItems(Item goodLocation, java.lang.String itemName)
          Returns all items in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).
 java.util.List<Item> findItems(java.lang.String itemName)
          Returns all items in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).
 Tattoo findTattoo(java.lang.String of)
          Returns the tattoo of the given marker name
 Tattoo findTattooStartsWith(java.lang.String of)
          Returns the tattoo that starts with the given marker name
protected  java.lang.String fixChannelColors(int channelCode, java.lang.String message)
           
 void flagVariableEq()
          Flags this mob as having their base inventory / shop inventory reconstructed from the database.
 java.util.Enumeration<Pair<MOB,java.lang.Short>> followers()
          Returns an enumeration of the followers of this Followable, along with their relative rank/position in the formation.
 int freeWearPositions(long wornCode, short belowLayer, short layerAttributes)
          Returns the number of free spaces the player/mob has at the given worn location, below the given layer, without the given attributes.
 java.lang.String genericName()
          Returns the age-range and race of this mob, as if it were someone spotted on the street that you didn't know.
 int[][] getAbilityUsageCache(java.lang.String abilityID)
          Because of certain variables, mobs are required to cache the calculation of the costs of using their Abilities.
 long getAgeMinutes()
          Returns the total number of rl minutes this player has ever played.
 int getAttributesBitmap()
          Returns the raw numeric attributes bitmap
 Pair<Clan,java.lang.Integer> getClanRole(java.lang.String clanID)
          Given a precise clanID (name), this method returns the Clan object and this players rank in the clan, if they belong.
protected  int getCodeNum(java.lang.String code)
           
 PhysicalAgent getCombatant()
          If this mob is in combat, this returns the mob that this mob is targeting.
 int getDirectionToTarget()
          Gets the compass direction between this combatant and the current combat victim.
 int getExperience()
          Returns the total number of experience points earned by this mob.
 int getExpNeededDelevel()
          Returns the number of experience points gained since the player got their current level, thus also telling you how much xp can be lost before de-leveling.
 int getExpNeededLevel()
          Returns the number of additional experience points needed for this mob to gain their next level.
 int getExpNextLevel()
          Gets the total number of experience points this mob needs to earn their next level.
 int getExpPrevLevel()
          Gets the total number of experience points the mob acquired to reach their current level, making it the baseline for this levels experience.
 java.lang.String getFactionListing()
          Returns a friendly viewable list of all the factions that this is a member of, along with the rank/value this member has in that faction.
 java.util.Set<MOB> getGroupMembers(java.util.Set<MOB> list)
          Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers.
 java.util.Set<? extends Rider> getGroupMembersAndRideables(java.util.Set<? extends Rider> list)
          Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers.
 Item getItem(int index)
          Returns the item at the given index, regardless of container status, visibility, or other modifiers.
 java.lang.String getLiegeID()
          Returns the liege to which this mob owes loyalty.
 int getMoney()
          Only somewhat deprecated, this method returns the internal money counter.
 double getMoneyVariation()
          Returns a positive or negative range from 0->this number that represents the amount of money added or removed from this mob when the mob-as-NPC does and is ready to be looted.
 Deity getMyDeity()
          Returns the Deity object of the mob that this player/mob worships.
 Weapon getNaturalWeapon()
          Returns the Weapon object that this mob attacks with when attacking otherwise unarmed.
 long getPeaceTime()
          Returns the number of ms (in tick increments) that this mob has NOT been in combat.
 int getPractices()
          Returns the number of practice points this mob has
 int getQuestPoint()
          Returns the number of quest points that this mob has earned.
 Item getRandomItem()
          Returns a random item in this collection, or null
 java.util.Set<MOB> getRideBuddies(java.util.Set<MOB> list)
          This method recursively returns whoever this mob is riding, and if they are a rideable, who all is riding with him.
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 Room getStartRoom()
          Gets the stored Start Room for this mob.
 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.
 int getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 int getTrains()
          Returns the number of training points this mob has
 MOB getVictim()
          If this mob is in combat, this returns the mob that this mob is targeting.
 int getWearPositions(long wornCode)
          Returns the total number of worn locations this mob/player has at the given worn code location.
 int getWimpHitPoint()
          Returns the number of hit points below which this mob will automatically flee combat.
 java.lang.String getWorshipCharID()
          Returns the name of the Deity mob that this player/mob worships.
 boolean hasFaction(java.lang.String which)
          Returns whether this is a member of the given faction and has some rank.
 boolean hasOnlyGoldInInventory()
          Returns whether this mob is only carrying money, meaning their main inventory is essentially empty.
 java.lang.String healthText(MOB viewer)
          Returns the friendly viewable description of this mobs health status, from the given viewer mobs point of view.
 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 isAttributeSet(MOB.Attrib attrib)
          Returns whether the given attribute is set.
 boolean isContent(Item I)
          Returns whether the given item is in this possessors list.
protected  boolean isEitherOfUsDead(MOB mob)
           
 boolean isFollowedBy(MOB thisOne)
          Returns whether the given followable is following this followable.
 boolean isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 boolean isInCombat()
          Returns whether this combatant is in an active combat state
 boolean isMarriedToLiege()
          Returns whether this mob/player is married to their liege, or whether they are a simple liege.
 boolean isMine(Environmental env)
          Returns whether the given environmental is possessed by this mob.
 boolean isMonster()
          Returns whether this mob has a real telnet session attached to it.
protected  boolean isPermissableToFight(MOB mob)
           
 boolean isPlayer()
          Returns whether this mob represents a player.
 boolean isPossessing()
          Returns whether this mob base session is possessing some other mob.
 boolean isRacialAbility(java.lang.String abilityID)
          Returns whether the given ability is actually a racial ability instead of a learned, clan, or some other kind of ability.
 boolean isSavable()
          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.
 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.
 java.util.Enumeration<Item> items()
          An enumeration of all the items at this possessor.
 DeadBody killMeDead(boolean createBody)
          Puts this mob in a dead state, removes all temporary effects, creates a corpse, ends combat, and sends players to their graveyard.
 java.lang.String L(java.lang.String str, java.lang.String... xs)
          Localize an internal string -- shortcut.
 long lastTickedDateTime()
          Returns the precise time, in milliseconds, that this mob last "Ticked".
 Room location()
          Returns the room in which this mob/player is currently standing.
 void makePeace(boolean includePlayerFollowers)
          Clears the combat state between this combatant and their target, clears the targets combat state, as well as that of any followers of this combatant.
 int maxCarry()
          Returns the maximum total weight in pounds that this mob can carry.
 int maxFollowers()
          Returns the maximum number of followers that this Followable can have.
 int maxItems()
          Returns the maximum total number of items that this mob can carry.
 int maxRange()
          the maximum range of this object, if applicable.
 CharState maxState()
          Gets the Max CharState object for this mob, which are the stats like health and mana.
 boolean mayIFight(PhysicalAgent victim)
          Returns whether this combatant is both permitted to attack the given combatant, and that both this combatant and the potential target are alive.
 boolean mayPhysicallyAttack(PhysicalAgent victim)
          Returns whether this combatant is permitted to attack the given combatant, both this combatant and the potential target are alive, both the combatant and the target are confirmed to be the same place.
 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.
 void moveItemTo(Item container)
          Intelligently removes an item from its current location and moves it to this possessor, managing any container contents.
 void moveItemTo(Item container, ItemPossessor.Expire expire, ItemPossessor.Move... moveFlags)
          Intelligently removes an item from its current location and moves it to this possessor, managing any container contents, and possibly followers/riders if the item is a cart.
 java.lang.String name()
          The nice displayable name of this instance of this object
 java.lang.String Name()
          The raw unmodified name of this object as stored in the database.
 java.lang.String name(MOB viewer)
          Returns the name, but as seen by the given viewer.
 CMObject newInstance()
          Returns a new instance of this class.
 int numAbilities()
          Returns the number of abilities contained herein this object.
 int numAllAbilities()
          Returns the number of all abilities in this container.
 int numAllEffects()
          Returns the total number of effects this mob/player is under, including Racial and Clan effects.
 int numBehaviors()
          The number of behaviors this object has.
 int numEffects()
          Returns the number of ability objects listed as effects on this object.
 int numFollowers()
          Returns the total number of Direct followers
 int numItems()
          Returns the total number of items at this possessor, regardless of container status.
 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.
 java.util.Enumeration<Ability> personalEffects()
          Returns an enumeration only of the effects that are personally owned by this mob, which means it will skip any Clan or Racial effects.
 PhyStats phyStats()
          Object containing a set of current, modified, usable, mostly numeric fields.
 PlayerStats playerStats()
          Returns the PlayerStats object for this mob.
 void prequeCommand(java.util.List<java.lang.String> commands, int metaFlags, double actionCost)
          Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.
 void prequeCommands(java.util.List<java.util.List<java.lang.String>> commands, int metaFlags)
          Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.
protected  java.util.List<Ability> racialEffects()
           
 int rangeToTarget()
          Gets the distance between this combatant and the current combat victim.
 java.lang.String rawImage()
          Returns the raw name of the image file to display for this object when MXP is used.
 void recoverCharStats()
          Causes this mob to recalculate its current char stats by copying the base stats over and then calling all equipment and spell effects to modify them.
 void recoverMaxState()
          Causes this mob to recalculate its max char state by copying the base state over and then calling all equipment and spell effects to modify them.
 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.
 void removeFaction(java.lang.String which)
          Removes this as a member of the given faction, losing all rank.
 void removeFromGame(boolean preserveFollowers, boolean killSession)
          Removes this mob from the game.
 void resetToMaxState()
          Causes this mob to copy the max state object to the current state object, effectively healing and rejuvinating the mob.
 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.
 java.util.Enumeration<ScriptingEngine> scripts()
          Returns an enumerator of all the scripts on this object.
 Session session()
          Returns any Telnet Session object attached to this mob.
 void setActions(double remain)
          Sets the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them.
 void setAgeMinutes(long newVal)
          Returns the total number of rl minutes this player has ever played.
 void setAttribute(MOB.Attrib attrib, boolean set)
          Changes the value of a specific attribute
 void setAttributesBitmap(int bitmap)
          Sets the raw numeric attributes bitmap
 void setBaseCharStats(CharStats newBaseCharStats)
          Sets the Base CharStats object for this mob, which are the stats like saves and strength.
 void setBasePhyStats(PhyStats newStats)
          Re-sets the object containing a set of base, unmodified, mostly numeric fields.
 void setBaseState(CharState newState)
          Sets the Base CharState object for this mob, which are the stats like health and mana.
 void setClan(java.lang.String clanID, int role)
          Adds or alters the rank of this player/mob in the given clan.
 void setCombatant(PhysicalAgent other)
          Sets the mob that this mob is targeting for combat, which either puts them into, or clears their combat state.
 void setDatabaseID(java.lang.String id)
          Set the unique contextual database ID for this object.
 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 setExperience(int newVal)
          Sets the total number of experience points earned by this mob.
 void setExpirationDate(long time)
          If this object expires, it should have a timestamp saying when it expires, in real time.
 void setFollowing(MOB mob)
          Alters who this followable follower is following.
 void setImage(java.lang.String newImage)
          Sets the raw name of the image file to display for this object when MXP is used.
 void setLiegeID(java.lang.String newVal)
          Sets the liege to which this mob owes loyalty.
 void setLocation(Room newRoom)
          Sets the room in which this mob/player is currently standing.
 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 setMoney(int newVal)
          Only somewhat deprecated, this method sets the internal money counter.
 void setMoneyVariation(double newVal)
          Sets a positive or negative range from 0->this number that represents the amount of money added or removed from this mob when the mob-as-NPC does and is ready to be looted.
 void setName(java.lang.String newName)
          Sets the raw unmodified name of this object as stored in the database.
 void setPlayerStats(PlayerStats newStats)
          Sets the PlayerStats object for this mob.
 void setPractices(int newVal)
          Sets the number of practice points this mob has
 void setQuestPoint(int newVal)
          Sets the number of quest points that this mob has earned.
 void setRangeToTarget(int newRange)
          Sets the distance between this combatant and the current combat victim.
 void setRiding(Rideable ride)
          Sets the Rideable upon which this Rider is Riding.
 void setSavable(boolean truefalse)
          Sets whether this object can be saved as a permanent aspect of its host.
 void setSession(Session newSession)
          Sets any Telnet Session object attached to this mob.
 void setSoulMate(MOB mob)
          Sets the player mob that is possessing this mob by loaning it its session.
 void setStartRoom(Room room)
          Sets the stored Start Room for this mob.
 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 setTrains(int newVal)
          Sets the number of training points this mob has
 void setVictim(MOB other)
          Sets the mob that this mob is targeting for combat, which either puts them into, or clears their combat state.
 void setWimpHitPoint(int newVal)
          Sets the number of hit points below which this mob will automatically flee combat.
 void setWorshipCharID(java.lang.String newVal)
          Sets the name of the Deity mob that this player/mob worships.
 MOB soulMate()
          Returns the player mob that is possessing this mob by loaning it its session.
 java.util.Enumeration<Tattoo> tattoos()
          Returns an enumeration of all the tattoos on this object.
 void tell(MOB source, Environmental target, Environmental tool, java.lang.String msg)
          Basic communication to a session attached to this mob, if any.
 void tell(java.lang.String msg)
          Basic communication to a session attached to this mob, if any.
 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.
 java.lang.String titledName()
          If this player is using a title, this method returns the players Name() with the title.
 int totalFollowers()
          Returns the total number of followable followers following this followable by counting not only the followable followers of this followable, but also the followable followers of the followable followers of this followable, recursively.
 boolean willFollowOrdersOf(MOB mob)
          Returns whether the given mob has the authority to give Orders to this mob, whether from security status, or clan rank.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

username

public java.lang.String username

baseCharStats

protected CharStats baseCharStats

charStats

protected CharStats charStats

phyStats

protected PhyStats phyStats

basePhyStats

protected PhyStats basePhyStats

playerStats

protected PlayerStats playerStats

amDestroyed

protected boolean amDestroyed

removeFromGame

protected boolean removeFromGame

amDead

protected volatile boolean amDead

location

protected volatile Room location

lastLocation

protected volatile Room lastLocation

riding

protected Rideable riding

mySession

protected volatile Session mySession

description

protected java.lang.Object description

displayText

protected java.lang.String displayText

rawImageName

protected java.lang.String rawImageName

cachedImageName

protected java.lang.String cachedImageName

miscText

protected java.lang.Object miscText

xtraValues

protected java.lang.String[] xtraValues

experience

protected int experience

practices

protected int practices

trains

protected int trains

ageMinutes

protected long ageMinutes

money

protected int money

moneyVariation

protected double moneyVariation

attributesBitmap

protected int attributesBitmap

databaseID

protected java.lang.String databaseID

tickAgeCounter

protected int tickAgeCounter

recoverTickCter

protected int recoverTickCter

curState

public CharState curState

maxState

public CharState maxState

baseState

public CharState baseState

possStartRoom

protected Room possStartRoom

worshipCharID

protected java.lang.String worshipCharID

liegeID

protected java.lang.String liegeID

wimpHitPoint

protected int wimpHitPoint

questPoint

protected int questPoint

victim

protected MOB victim

amFollowing

protected Followable<MOB> amFollowing

soulMate

protected MOB soulMate

atRange

protected int atRange

peaceTime

protected long peaceTime

kickFlag

protected boolean kickFlag

me

protected MOB me

tickStatus

protected int tickStatus

inventory

protected SVector<Item> inventory

abilitys

protected CMUniqSortSVec<Ability> abilitys

abilityUseTrig

protected int[] abilityUseTrig

abilityUseCache

protected STreeMap<java.lang.String,int[][]> abilityUseCache

expertises

protected STreeMap<java.lang.String,java.lang.Integer> expertises

affects

protected SVector<Ability> affects

behaviors

protected CMUniqSortSVec<Behavior> behaviors

tattoos

protected CMUniqNameSortSVec<Tattoo> tattoos

followers

protected volatile PairList<MOB,java.lang.Short> followers

commandQue

protected java.util.LinkedList<com.planet_ink.coffee_mud.MOBS.StdMOB.QMCommand> commandQue

scripts

protected SVector<ScriptingEngine> scripts

racialAffects

protected volatile java.util.List<Ability> racialAffects

clanAffects

protected volatile java.util.List<Ability> clanAffects

factions

protected SHashtable<java.lang.String,Faction.FData> factions

possWieldedItem

protected volatile java.lang.ref.WeakReference<Item> possWieldedItem

possHeldItem

protected volatile java.lang.ref.WeakReference<Item> possHeldItem

affectPhyStats

protected EachApplicable.ApplyAffectPhyStats<Ability> affectPhyStats

recoverAffectP

protected StdMOB.ApplyRecAffectPhyStats<Item> recoverAffectP

affectCharStats

protected StdMOB.ApplyAffectCharStats affectCharStats

affectCharState

protected StdMOB.ApplyAffectCharState affectCharState

clans

protected OrderedMap<java.lang.String,Pair<Clan,java.lang.Integer>> clans

CODES

protected static java.lang.String[] CODES
Constructor Detail

StdMOB

public StdMOB()
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, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

lastTickedDateTime

public long lastTickedDateTime()
Description copied from interface: MOB
Returns the precise time, in milliseconds, that this mob last "Ticked".

Specified by:
lastTickedDateTime in interface MOB
Returns:
the precise time, in milliseconds

flagVariableEq

public void flagVariableEq()
Description copied from interface: MOB
Flags this mob as having their base inventory / shop inventory reconstructed from the database. This allows the mob to eventually handle any variable or optional equipment changes, or for shopkeepers to fill out tech/electronics variables.

Specified by:
flagVariableEq in interface MOB

getAgeMinutes

public long getAgeMinutes()
Description copied from interface: MOB
Returns the total number of rl minutes this player has ever played.

Specified by:
getAgeMinutes in interface MOB
Returns:
the total number of rl minutes this player has ever played.
See Also:
MOB.setAgeMinutes(long)

getPractices

public int getPractices()
Description copied from interface: MOB
Returns the number of practice points this mob has

Specified by:
getPractices in interface MOB
Returns:
the number of practice points this mob has
See Also:
MOB.setPractices(int)

getExperience

public int getExperience()
Description copied from interface: MOB
Returns the total number of experience points earned by this mob.

Specified by:
getExperience in interface MOB
Returns:
the total number of experience points earned by this mob.
See Also:
MOB.setExperience(int), MOB.getExpNextLevel(), MOB.getExpNeededDelevel(), MOB.getExpNeededLevel(), MOB.getExpPrevLevel()

getExpNextLevel

public int getExpNextLevel()
Description copied from interface: MOB
Gets the total number of experience points this mob needs to earn their next level.

Specified by:
getExpNextLevel in interface MOB
Returns:
total xp to next level
See Also:
MOB.getExperience(), MOB.setExperience(int), MOB.getExpNeededDelevel(), MOB.getExpNeededLevel(), MOB.getExpPrevLevel()

getExpPrevLevel

public int getExpPrevLevel()
Description copied from interface: MOB
Gets the total number of experience points the mob acquired to reach their current level, making it the baseline for this levels experience.

Specified by:
getExpPrevLevel in interface MOB
Returns:
the experience point level baseline

getExpNeededDelevel

public int getExpNeededDelevel()
Description copied from interface: MOB
Returns the number of experience points gained since the player got their current level, thus also telling you how much xp can be lost before de-leveling. It returns 0 at first level, since a first level character cannot de-level.

Specified by:
getExpNeededDelevel in interface MOB
Returns:
how much more xp gained
See Also:
MOB.getExperience(), MOB.getExpNextLevel(), MOB.setExperience(int), MOB.getExpNeededLevel(), MOB.getExpPrevLevel()

getExpNeededLevel

public int getExpNeededLevel()
Description copied from interface: MOB
Returns the number of additional experience points needed for this mob to gain their next level. It returns Integer.MAX_VALUE if this does not apply.

Specified by:
getExpNeededLevel in interface MOB
Returns:
how much more xp needed
See Also:
MOB.getExperience(), MOB.getExpNextLevel(), MOB.getExpNeededDelevel(), MOB.setExperience(int), MOB.getExpPrevLevel()

getTrains

public int getTrains()
Description copied from interface: MOB
Returns the number of training points this mob has

Specified by:
getTrains in interface MOB
Returns:
the number of training points this mob has
See Also:
MOB.setTrains(int)

getMoney

public int getMoney()
Description copied from interface: MOB
Only somewhat deprecated, this method returns the internal money counter. Technically money is supposed to be stored as Coin items, but these methods are still used as shortcuts to give NPCs their initial money. This number is also a baseline value that can be modified with the money variation methods.

Specified by:
getMoney in interface MOB
Returns:
the mob npc money
See Also:
MOB.setMoney(int), MOB.getMoneyVariation(), MOB.setMoneyVariation(double)

getMoneyVariation

public double getMoneyVariation()
Description copied from interface: MOB
Returns a positive or negative range from 0->this number that represents the amount of money added or removed from this mob when the mob-as-NPC does and is ready to be looted.

Specified by:
getMoneyVariation in interface MOB
Returns:
the amount of money to vary for looting money
See Also:
MOB.getMoney(), MOB.setMoney(int), MOB.setMoneyVariation(double)

getAttributesBitmap

public int getAttributesBitmap()
Description copied from interface: MOB
Returns the raw numeric attributes bitmap

Specified by:
getAttributesBitmap in interface MOB
Returns:
the raw numeric attributes bitmap
See Also:
MOB.Attrib, MOB.setAttributesBitmap(int)

setAgeMinutes

public void setAgeMinutes(long newVal)
Description copied from interface: MOB
Returns the total number of rl minutes this player has ever played.

Specified by:
setAgeMinutes in interface MOB
Parameters:
newVal - the total number of rl minutes this player has ever played.
See Also:
MOB.getAgeMinutes()

setExperience

public void setExperience(int newVal)
Description copied from interface: MOB
Sets the total number of experience points earned by this mob.

Specified by:
setExperience in interface MOB
Parameters:
newVal - the total number of experience points earned by this mob.
See Also:
MOB.getExperience(), MOB.getExpNextLevel(), MOB.getExpNeededDelevel(), MOB.getExpNeededLevel(), MOB.getExpPrevLevel()

setPractices

public void setPractices(int newVal)
Description copied from interface: MOB
Sets the number of practice points this mob has

Specified by:
setPractices in interface MOB
Parameters:
newVal - the number of practice points this mob has
See Also:
MOB.getPractices()

setTrains

public void setTrains(int newVal)
Description copied from interface: MOB
Sets the number of training points this mob has

Specified by:
setTrains in interface MOB
Parameters:
newVal - the number of training points this mob has
See Also:
MOB.getTrains()

setMoney

public void setMoney(int newVal)
Description copied from interface: MOB
Only somewhat deprecated, this method sets the internal money counter. Technically money is supposed to be stored as Coin items, but these methods are still used as shortcuts to give NPCs their initial money. This number is also a baseline value that can be modified with the money variation methods.

Specified by:
setMoney in interface MOB
Parameters:
newVal - the mob npc money
See Also:
MOB.getMoney(), MOB.getMoneyVariation(), MOB.setMoneyVariation(double)

setMoneyVariation

public void setMoneyVariation(double newVal)
Description copied from interface: MOB
Sets a positive or negative range from 0->this number that represents the amount of money added or removed from this mob when the mob-as-NPC does and is ready to be looted.

Specified by:
setMoneyVariation in interface MOB
Parameters:
newVal - the amount of money to vary for looting money
See Also:
MOB.getMoney(), MOB.getMoneyVariation(), MOB.setMoneyVariation(double)

setAttributesBitmap

public void setAttributesBitmap(int bitmap)
Description copied from interface: MOB
Sets the raw numeric attributes bitmap

Specified by:
setAttributesBitmap in interface MOB
Parameters:
bitmap - the raw numeric attributes bitmap
See Also:
MOB.Attrib, MOB.getAttributesBitmap()

setAttribute

public void setAttribute(MOB.Attrib attrib,
                         boolean set)
Description copied from interface: MOB
Changes the value of a specific attribute

Specified by:
setAttribute in interface MOB
Parameters:
attrib - the attribute to set or clear
set - true to set it, false to clear it
See Also:
MOB.isAttributeSet(Attrib)

isAttributeSet

public boolean isAttributeSet(MOB.Attrib attrib)
Description copied from interface: MOB
Returns whether the given attribute is set.

Specified by:
isAttributeSet in interface MOB
Parameters:
attrib - the attribute to check
Returns:
true if it is set, false otherwise
See Also:
MOB.setAttribute(Attrib, boolean)

getFactionListing

public java.lang.String getFactionListing()
Description copied from interface: FactionMember
Returns a friendly viewable list of all the factions that this is a member of, along with the rank/value this member has in that faction. The list is semicolon-delimited.

Specified by:
getFactionListing in interface FactionMember
Returns:
friendly viewable list of all the factions
See Also:
FactionMember

getLiegeID

public java.lang.String getLiegeID()
Description copied from interface: MOB
Returns the liege to which this mob owes loyalty. Because this field doubles for spouse, a player can have a liege or a spouse, but not both. Empty string means no liege or spouse.

Specified by:
getLiegeID in interface MOB
Returns:
the name of the player to which this mob owes loyalty
See Also:
MOB.setLiegeID(String), MOB.isMarriedToLiege()

getWorshipCharID

public java.lang.String getWorshipCharID()
Description copied from interface: MOB
Returns the name of the Deity mob that this player/mob worships. Empty string means they are an atheist. :) The name here should always be the same as a Deity type mob in the game in order for the religion system to work correctly. For Clerics, this field has particular importance.

Specified by:
getWorshipCharID in interface MOB
Returns:
the name of the Deity mob that this player/mob worships.
See Also:
MOB.setWorshipCharID(String), MOB.getMyDeity()

getWimpHitPoint

public int getWimpHitPoint()
Description copied from interface: MOB
Returns the number of hit points below which this mob will automatically flee combat.

Specified by:
getWimpHitPoint in interface MOB
Returns:
the wimpy hit point number
See Also:
MOB.setWimpHitPoint(int)

getQuestPoint

public int getQuestPoint()
Description copied from interface: MOB
Returns the number of quest points that this mob has earned.

Specified by:
getQuestPoint in interface MOB
Returns:
the number of quest points that this mob has earned.
See Also:
MOB.setQuestPoint(int)

setLiegeID

public void setLiegeID(java.lang.String newVal)
Description copied from interface: MOB
Sets the liege to which this mob owes loyalty. Because this field doubles for spouse, a player can have a liege or a spouse, but not both. Empty string means no liege or spouse.

Specified by:
setLiegeID in interface MOB
Parameters:
newVal - the name of the player to which this mob owes loyalty
See Also:
MOB.getLiegeID(), MOB.isMarriedToLiege()

setWorshipCharID

public void setWorshipCharID(java.lang.String newVal)
Description copied from interface: MOB
Sets the name of the Deity mob that this player/mob worships. Empty string means they are an atheist. :) The name here should always be the same as a Deity type mob in the game in order for the religion system to work correctly. For Clerics, this field has particular importance.

Specified by:
setWorshipCharID in interface MOB
Parameters:
newVal - the name of the Deity mob that this player/mob worships.
See Also:
MOB.setWorshipCharID(String), MOB.getMyDeity()

setWimpHitPoint

public void setWimpHitPoint(int newVal)
Description copied from interface: MOB
Sets the number of hit points below which this mob will automatically flee combat.

Specified by:
setWimpHitPoint in interface MOB
Parameters:
newVal - the wimpy hit point number
See Also:
MOB.getWimpHitPoint()

setQuestPoint

public void setQuestPoint(int newVal)
Description copied from interface: MOB
Sets the number of quest points that this mob has earned.

Specified by:
setQuestPoint in interface MOB
Parameters:
newVal - the number of quest points that this mob has earned.
See Also:
MOB.getQuestPoint()

getMyDeity

public Deity getMyDeity()
Description copied from interface: MOB
Returns the Deity object of the mob that this player/mob worships. A null return means they are an atheist. Very important for Clerics.

Specified by:
getMyDeity in interface MOB
Returns:
the Deity object of the mob that this player/mob worships
See Also:
MOB.getWorshipCharID(), MOB.setWorshipCharID(String)

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

getStartRoom

public Room getStartRoom()
Description copied from interface: MOB
Gets the stored Start Room for this mob. This is where the mob/player goes when they recall. Can also return null, of course, which for a mob typically means they are temporary.

Specified by:
getStartRoom in interface MOB
Returns:
the stored Start Room for this mob
See Also:
MOB.setStartRoom(Room)

setStartRoom

public void setStartRoom(Room room)
Description copied from interface: MOB
Sets the stored Start Room for this mob. This is where the mob/player goes when they recall. Can also set to null, of course, which for a mob typically means they are temporary.

Specified by:
setStartRoom in interface MOB
Parameters:
room - the stored Start Room for this mob
See Also:
MOB.getStartRoom()

setDatabaseID

public void setDatabaseID(java.lang.String id)
Description copied from interface: DBIdentifiable
Set the unique contextual database ID for this object.

Specified by:
setDatabaseID in interface DBIdentifiable
Parameters:
id - the unique contextual database ID for this object.
See Also:
DBIdentifiable.canSaveDatabaseID(), DBIdentifiable.databaseID()

canSaveDatabaseID

public boolean canSaveDatabaseID()
Description copied from interface: DBIdentifiable
Returns true if this object can safely store and retrieve a database ID, and false if the TYPE of object can, but this particular instance can not.

Specified by:
canSaveDatabaseID in interface DBIdentifiable
Returns:
true if setDatabaseID can be called, false otherwise
See Also:
DBIdentifiable.databaseID(), DBIdentifiable.setDatabaseID(String)

databaseID

public java.lang.String databaseID()
Description copied from interface: DBIdentifiable
Retrieve the unique contextual database ID for this object.

Specified by:
databaseID in interface DBIdentifiable
Returns:
the unique contextual database ID for this object.
See Also:
DBIdentifiable.canSaveDatabaseID(), DBIdentifiable.setDatabaseID(String)

Name

public java.lang.String Name()
Description copied from interface: Environmental
The raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
Name in interface Environmental
Returns:
the raw base name of this object on the map.
See Also:
Tickable.name()

setName

public void setName(java.lang.String newName)
Description copied from interface: Environmental
Sets the raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
setName in interface Environmental
Parameters:
newName - the raw base name of this object on the map.
See Also:
Environmental.Name()

name

public java.lang.String name()
Description copied from interface: Tickable
The nice displayable name of this instance of this object

Specified by:
name in interface CMObject
Specified by:
name in interface Tickable
Returns:
the displayable name of this object instance
See Also:
Environmental.Name()

titledName

public java.lang.String titledName()
Description copied from interface: MOB
If this player is using a title, this method returns the players Name() with the title. If not using a title, this method returns name().

Specified by:
titledName in interface MOB
Returns:
the name with a title, or not
See Also:
Environmental.Name(), Tickable.name()

genericName

public java.lang.String genericName()
Description copied from interface: MOB
Returns the age-range and race of this mob, as if it were someone spotted on the street that you didn't know.

Specified by:
genericName in interface MOB
Returns:
the age-range and race of this mob

image

public java.lang.String image()
Description copied from interface: Environmental
Returns the fully qualified and determined name of the image file displayed for this object when MXP is used. If rawImage() is non-empty, it will return rawImage, and otherwise use the mxp default data file.

Specified by:
image in interface Environmental
Returns:
the name of the mxp image to display for this object.

rawImage

public java.lang.String rawImage()
Description copied from interface: Environmental
Returns the raw name of the image file to display for this object when MXP is used. This is the value set by the builder, and may be returned by image() if it is non-empty.

Specified by:
rawImage in interface Environmental
Returns:
the raw name of the mxp image file

setImage

public void setImage(java.lang.String newImage)
Description copied from interface: Environmental
Sets the raw name of the image file to display for this object when MXP is used. This is the value set by the builder, and may be returned by image() if it is non-empty.

Specified by:
setImage in interface Environmental
Parameters:
newImage - the raw name of the mxp image file

expirationDate

public long expirationDate()
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
expirationDate in interface Environmental
Returns:
the time stamp when this thing expires
See Also:
Environmental.setExpirationDate(long)

setExpirationDate

public void setExpirationDate(long time)
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
setExpirationDate in interface Environmental
Parameters:
time - the time stamp when this thing expires
See Also:
Environmental.expirationDate()

amDestroyed

public final boolean amDestroyed()
Description copied from interface: Contingent
Whether the destroy() method has been previousy called on this object.

Specified by:
amDestroyed in interface Contingent
Returns:
whether the object is destroy()ed.

cloneFix

protected void cloneFix(MOB M)

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

isGeneric

public boolean isGeneric()
Description copied from interface: Environmental
Whether the fields of this item are set in code, or set by builders. Generic means that they are set by builders, in which case XML is returned by the text() method containing all of the values for all the fields.

Specified by:
isGeneric in interface Environmental
Returns:
whether this item is modifiable by builders
See Also:
Environmental.text()

phyStats

public PhyStats phyStats()
Description copied from interface: Affectable
Object containing a set of current, modified, usable, mostly numeric fields. This object is based on the object from basePhyStats() and then updated and modified by the recoverPhyStats() method. See the PhyStats interface for information on the fields herein.

Specified by:
phyStats in interface Affectable
Returns:
the current set of state fields
See Also:
Affectable.basePhyStats(), Affectable.recoverPhyStats(), PhyStats

basePhyStats

public PhyStats basePhyStats()
Description copied from interface: Affectable
Object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverPhyStats() method. See the PhyStats interface for information on the fields herein.

Specified by:
basePhyStats in interface Affectable
Returns:
a set of state fields
See Also:
Affectable.phyStats(), Affectable.recoverPhyStats(), PhyStats

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
See Also:
Affectable.basePhyStats(), Affectable.phyStats(), Affectable.addEffect(Ability), Behavable.addBehavior(Behavior), PhyStats

setBasePhyStats

public void setBasePhyStats(PhyStats newStats)
Description copied from interface: Affectable
Re-sets the object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverPhyStats() method. See the PhyStats interface for information on the fields herein. This method is rarely called -- the fields therein are usually set using setter methods from the PhyStats interface on the object itself.

Specified by:
setBasePhyStats in interface Affectable
Parameters:
newStats - a set of state fields
See Also:
Affectable.phyStats(), Affectable.recoverPhyStats(), PhyStats

baseWeight

public int baseWeight()
Description copied from interface: MOB
Returns the base weight of this mob, which includes any char stat adjustments, and adjustments from race.

Specified by:
baseWeight in interface MOB
Returns:
the base weight of this mob

maxCarry

public int maxCarry()
Description copied from interface: MOB
Returns the maximum total weight in pounds that this mob can carry.

Specified by:
maxCarry in interface MOB
Returns:
the maximum total weight in pounds that this mob can carry.
See Also:
MOB.maxItems()

maxItems

public int maxItems()
Description copied from interface: MOB
Returns the maximum total number of items that this mob can carry.

Specified by:
maxItems in interface MOB
Returns:
the maximum total number of items that this mob can carry.
See Also:
MOB.maxCarry()

maxFollowers

public int maxFollowers()
Description copied from interface: MOB
Returns the maximum number of followers that this Followable can have.

Specified by:
maxFollowers in interface MOB
Returns:
the maximum number of followers
See Also:
Followable

totalFollowers

public int totalFollowers()
Description copied from interface: Followable
Returns the total number of followable followers following this followable by counting not only the followable followers of this followable, but also the followable followers of the followable followers of this followable, recursively.

Specified by:
totalFollowers in interface Followable<MOB>
Returns:
the total number of followers
See Also:
Followable.numFollowers()

baseCharStats

public CharStats baseCharStats()
Description copied from interface: MOB
Gets the Base CharStats object for this mob, which are the stats like saves and strength. The Base CharStats are those stats before modification by equipment or spell effects.

Specified by:
baseCharStats in interface MOB
Returns:
the CharStats object for this mob
See Also:
MOB.charStats(), MOB.recoverCharStats(), MOB.setBaseCharStats(CharStats)

charStats

public CharStats charStats()
Description copied from interface: MOB
Gets the Current CharStats object for this mob, which are the stats like saves and strength. The Current CharStats are the Base stats after modification by equipment or spell effects.

Specified by:
charStats in interface MOB
Returns:
the CharStats object for this mob
See Also:
MOB.baseCharStats(), MOB.recoverCharStats(), MOB.setBaseCharStats(CharStats)

recoverCharStats

public void recoverCharStats()
Description copied from interface: MOB
Causes this mob to recalculate its current char stats by copying the base stats over and then calling all equipment and spell effects to modify them.

Specified by:
recoverCharStats in interface MOB
See Also:
MOB.baseCharStats(), MOB.charStats(), MOB.setBaseCharStats(CharStats)

setBaseCharStats

public void setBaseCharStats(CharStats newBaseCharStats)
Description copied from interface: MOB
Sets the Base CharStats object for this mob, which are the stats like saves and strength. The Base CharStats are those stats before modification by equipment or spell effects.

Specified by:
setBaseCharStats in interface MOB
Parameters:
newBaseCharStats - the CharStats object for this mob
See Also:
MOB.charStats(), MOB.baseCharStats(), MOB.setBaseCharStats(CharStats)

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
Parameters:
affected - the host of the PhyStats object being affected
affectableStats - the particular PhyStats object being affected
See Also:
PhyStats, Environmental, Affectable.basePhyStats(), Affectable.phyStats(), Affectable.recoverPhyStats()

affectCharState

public void affectCharState(MOB affectedMob,
                            CharState affectableMaxState)
Description copied from interface: StatsAffecting
This method is called by the recoverCharState() method on other MOB objects. It is used to transform the MOB baseCharState() object into a finished charState() object, both of which are objects implementing the CharState interface. See those methods for more information.

Specified by:
affectCharState in interface StatsAffecting
Parameters:
affectedMob - the host of the CharState object being affected
affectableMaxState - the particular CharState object being affected
See Also:
CharState, MOB, MOB.baseState(), MOB.curState(), MOB.recoverMaxState()

isMarriedToLiege

public boolean isMarriedToLiege()
Description copied from interface: MOB
Returns whether this mob/player is married to their liege, or whether they are a simple liege.

Specified by:
isMarriedToLiege in interface MOB
Returns:
true if they are married to liege, false if just a leige
See Also:
MOB.getLiegeID(), MOB.setLiegeID(String)

curState

public CharState curState()
Description copied from interface: MOB
Gets the Current CharState object for this mob, which are the temp stats like health and mana. The Current CharState are the max state after modification by casting, damage, and running around.

Specified by:
curState in interface MOB
Returns:
the Current charState object for this mob
See Also:
CharState, MOB.setBaseState(CharState), MOB.baseState(), MOB.maxState(), MOB.recoverMaxState(), MOB.resetToMaxState()

maxState

public CharState maxState()
Description copied from interface: MOB
Gets the Max CharState object for this mob, which are the stats like health and mana. The Max CharState are those stats after modification by equipment or spell effects, but before taking damage or using by resources with movement and casting

Specified by:
maxState in interface MOB
Returns:
the base CharState object for this mob
See Also:
CharState, MOB.setBaseState(CharState), MOB.curState(), MOB.baseState(), MOB.recoverMaxState(), MOB.resetToMaxState()

baseState

public CharState baseState()
Description copied from interface: MOB
Gets the Base CharState object for this mob, which are the stats like health and mana. The Base CharState are those stats before modification by equipment or spell effects.

Specified by:
baseState in interface MOB
Returns:
the base CharState object for this mob
See Also:
CharState, MOB.setBaseState(CharState), MOB.curState(), MOB.maxState(), MOB.recoverMaxState(), MOB.resetToMaxState()

playerStats

public PlayerStats playerStats()
Description copied from interface: MOB
Returns the PlayerStats object for this mob. A null response indicated definitively that this is a Player and not an NPC, even if there is no session attached.

Specified by:
playerStats in interface MOB
Returns:
the PlayerStats object or NULL for an NPC
See Also:
MOB.setPlayerStats(PlayerStats), PlayerStats

setPlayerStats

public void setPlayerStats(PlayerStats newStats)
Description copied from interface: MOB
Sets the PlayerStats object for this mob. A null value indicated definitively that this is a Player and not an NPC, even if there is no session attached.

Specified by:
setPlayerStats in interface MOB
Parameters:
newStats - the PlayerStats object or null for an NPC
See Also:
MOB.playerStats(), PlayerStats

setBaseState

public void setBaseState(CharState newState)
Description copied from interface: MOB
Sets the Base CharState object for this mob, which are the stats like health and mana. The Base CharState are those stats before modification by equipment or spell effects.

Specified by:
setBaseState in interface MOB
Parameters:
newState - the base CharState object for this mob
See Also:
CharState, MOB.baseState(), MOB.curState(), MOB.maxState(), MOB.recoverMaxState(), MOB.resetToMaxState()

resetToMaxState

public void resetToMaxState()
Description copied from interface: MOB
Causes this mob to copy the max state object to the current state object, effectively healing and rejuvinating the mob.

Specified by:
resetToMaxState in interface MOB
See Also:
MOB.setBaseState(CharState), MOB.curState(), MOB.baseState(), MOB.maxState(), MOB.recoverMaxState()

recoverMaxState

public void recoverMaxState()
Description copied from interface: MOB
Causes this mob to recalculate its max char state by copying the base state over and then calling all equipment and spell effects to modify them.

Specified by:
recoverMaxState in interface MOB
See Also:
MOB.setBaseState(CharState), MOB.curState(), MOB.baseState(), MOB.maxState(), MOB.resetToMaxState()

amDead

public boolean amDead()
Description copied from interface: MOB
Returns whether this mob is dead and presumably waiting for rejuv.

Specified by:
amDead in interface MOB
Returns:
true if this mob is dead, false otherwise
See Also:
MOB.killMeDead(boolean), MOB.bringToLife(Room, boolean), MOB.removeFromGame(boolean, boolean)

amActive

public boolean amActive()
Description copied from interface: MOB
Returns whether this mob has been removed from the game. It only checks the flag set by removeFromGame.

Specified by:
amActive in interface MOB
Returns:
true if the removeFromGame flag is set, false otherwise
See Also:
MOB.bringToLife(Room, boolean), MOB.killMeDead(boolean), MOB.removeFromGame(boolean, boolean)

dispossess

public void dispossess(boolean forceLook)
Description copied from interface: MOB
If this mob is being possessed by a player, this method can be called to return this mobs borrowed session to the player, thus ending the possession.

Specified by:
dispossess in interface MOB
Parameters:
forceLook - true to force the player to Look afterwards
See Also:
MOB.session(), MOB.isPossessing(), MOB.soulMate(), MOB.setSoulMate(MOB)

destroy

public void destroy()
Description copied from interface: Contingent
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have their destroy() method called will also call the destroy() methods on all items and other objects listed as content, recursively.

Specified by:
destroy in interface Contingent

removeFromGame

public void removeFromGame(boolean preserveFollowers,
                           boolean killSession)
Description copied from interface: MOB
Removes this mob from the game. Principally used for player mobs, this method optionally copies the follower mobs, stops the session if any, and removes the mob from the room they are in.

Specified by:
removeFromGame in interface MOB
Parameters:
preserveFollowers - true to copy the followers over
killSession - true to end the session connected to this mob, if any
See Also:
MOB.bringToLife(Room, boolean), MOB.killMeDead(boolean), MOB.amActive()

bringToLife

public void bringToLife()
Description copied from interface: MOB
Flags this mob as being alive, and restarts the mob tick.

Specified by:
bringToLife in interface MOB
See Also:
MOB.bringToLife(Room, boolean), MOB.killMeDead(boolean), MOB.removeFromGame(boolean, boolean)

confirmLocation

protected final boolean confirmLocation(Room whereHeShouldBeR)

bringToLife

public void bringToLife(Room newLocation,
                        boolean resetStats)
Description copied from interface: MOB
Brings this mob to life, or back to life, and puts the mob into the given room, or their start room if none given. This also calls bringToLife to start ticking.

Specified by:
bringToLife in interface MOB
Parameters:
newLocation - the room to bring the mob to life in
resetStats - true to bring all char state stats to max
See Also:
MOB.bringToLife(), MOB.killMeDead(boolean), MOB.removeFromGame(boolean, boolean)

isInCombat

public boolean isInCombat()
Description copied from interface: Combatant
Returns whether this combatant is in an active combat state

Specified by:
isInCombat in interface Combatant
Returns:
true if this combatant is in combat, false otherwise
See Also:
MOB.getVictim(), MOB.setVictim(MOB), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.makePeace(boolean), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

isEitherOfUsDead

protected boolean isEitherOfUsDead(MOB mob)

isPermissableToFight

protected boolean isPermissableToFight(MOB mob)

mayIFight

public boolean mayIFight(PhysicalAgent victim)
Description copied from interface: Combatant
Returns whether this combatant is both permitted to attack the given combatant, and that both this combatant and the potential target are alive. Being in the same place is not necessary.

Specified by:
mayIFight in interface Combatant
Parameters:
victim - the potential combat target
Returns:
true if this combatant can fight the given combatant, false otherwise
See Also:
MOB.getVictim(), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.setRangeToTarget(int), Combatant.mayPhysicallyAttack(PhysicalAgent)

mayPhysicallyAttack

public boolean mayPhysicallyAttack(PhysicalAgent victim)
Description copied from interface: Combatant
Returns whether this combatant is permitted to attack the given combatant, both this combatant and the potential target are alive, both the combatant and the target are confirmed to be the same place.

Specified by:
mayPhysicallyAttack in interface Combatant
Parameters:
victim - the potential combat target
Returns:
true if this combatant can attack the given combatant, false otherwise
See Also:
MOB.getVictim(), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.setRangeToTarget(int), Combatant.mayPhysicallyAttack(PhysicalAgent)

getPeaceTime

public long getPeaceTime()
Description copied from interface: MOB
Returns the number of ms (in tick increments) that this mob has NOT been in combat.

Specified by:
getPeaceTime in interface MOB
Returns:
the ms of peace enjoyed by this mob.

setRangeToTarget

public void setRangeToTarget(int newRange)
Description copied from interface: Combatant
Sets the distance between this combatant and the current combat victim. This method only matters if the combatant is in combat and getCombatant() returns a non-null value. This method does not reciprocate by setting the range to target of the combat target.

Specified by:
setRangeToTarget in interface Combatant
Parameters:
newRange - the range from this combatant to their target
See Also:
MOB.getVictim(), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.rangeToTarget(), Combatant.mayIFight(PhysicalAgent)

rangeToTarget

public int rangeToTarget()
Description copied from interface: Combatant
Gets the distance between this combatant and the current combat victim. This method only matters if the combatant is in combat and getCombatant() returns a non-null value.

Specified by:
rangeToTarget in interface Combatant
Returns:
newRange the range from this combatant to their target
See Also:
MOB.getVictim(), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

getDirectionToTarget

public int getDirectionToTarget()
Description copied from interface: Combatant
Gets the compass direction between this combatant and the current combat victim. This method only matters if the combatant is in combat and getCombatant() returns a non-null value.

Specified by:
getDirectionToTarget in interface Combatant
Returns:
cardinal direction from this combatant to their target
See Also:
MOB.getVictim(), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

maxRange

public int maxRange()
Description copied from interface: Environmental
the maximum range of this object, if applicable. Can refer to the size of a room, the range of a weapon, or the calculated range of a mob in combat.

Specified by:
maxRange in interface Environmental
Returns:
the maximum range

minRange

public int minRange()
Description copied from interface: Environmental
the minimum range of this object, if applicable. Can refer to the size of a room, the range of a weapon, or the calculated range of a mob in combat. Usually 0.

Specified by:
minRange in interface Environmental
Returns:
the minimum range

makePeace

public void makePeace(boolean includePlayerFollowers)
Description copied from interface: Combatant
Clears the combat state between this combatant and their target, clears the targets combat state, as well as that of any followers of this combatant. It is at best an approximation of a universal combat ender.

Specified by:
makePeace in interface Combatant
Parameters:
includePlayerFollowers - false to apply only to npc followers, true for npc and player
See Also:
Combatant.isInCombat(), MOB.getVictim(), MOB.setVictim(MOB), Combatant.setCombatant(PhysicalAgent), Combatant.getCombatant(), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

getVictim

public MOB getVictim()
Description copied from interface: MOB
If this mob is in combat, this returns the mob that this mob is targeting. If this method returns null, the mob is not in combat.

Specified by:
getVictim in interface MOB
Returns:
the combat target, or null for a peace state
See Also:
Combatant.isInCombat(), MOB.setVictim(MOB), Combatant.makePeace(boolean), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

getCombatant

public PhysicalAgent getCombatant()
Description copied from interface: Combatant
If this mob is in combat, this returns the mob that this mob is targeting. If this method returns null, the mob is not in combat.

Specified by:
getCombatant in interface Combatant
Returns:
the combat target, or null for a peace state
See Also:
Combatant.isInCombat(), Combatant.setCombatant(PhysicalAgent), Combatant.makePeace(boolean), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

setCombatant

public void setCombatant(PhysicalAgent other)
Description copied from interface: Combatant
Sets the mob that this mob is targeting for combat, which either puts them into, or clears their combat state. If a null value, the mob is no longer fighting.

Specified by:
setCombatant in interface Combatant
Parameters:
other - the combat target, or null for a peace state
See Also:
Combatant.isInCombat(), Combatant.getCombatant(), Combatant.makePeace(boolean), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

setVictim

public void setVictim(MOB other)
Description copied from interface: MOB
Sets the mob that this mob is targeting for combat, which either puts them into, or clears their combat state. If a null value, the mob is no longer fighting.

Specified by:
setVictim in interface MOB
Parameters:
other - the combat target, or null for a peace state
See Also:
Combatant.isInCombat(), MOB.getVictim(), Combatant.makePeace(boolean), Combatant.setRangeToTarget(int), Combatant.mayIFight(PhysicalAgent)

killMeDead

public DeadBody killMeDead(boolean createBody)
Description copied from interface: MOB
Puts this mob in a dead state, removes all temporary effects, creates a corpse, ends combat, and sends players to their graveyard.

Specified by:
killMeDead in interface MOB
Parameters:
createBody - true to create a corpse, false otherwise
Returns:
the corpse, if one was created
See Also:
MOB.amDead(), MOB.bringToLife(Room, boolean), MOB.removeFromGame(boolean, boolean)

location

public Room location()
Description copied from interface: MOB
Returns the room in which this mob/player is currently standing. It can also refer to the room in which this mob/player WOULD be standing if they were still in the game.

Specified by:
location in interface MOB
Returns:
the room in which this mob/player is currently standing
See Also:
MOB.setLocation(Room), Room.isInhabitant(MOB)

setLocation

public void setLocation(Room newRoom)
Description copied from interface: MOB
Sets the room in which this mob/player is currently standing. It can also refer to the room in which this mob/player WOULD be standing if they were still in the game.

Specified by:
setLocation in interface MOB
Parameters:
newRoom - the room in which this mob/player is currently standing
See Also:
MOB.location(), Room.isInhabitant(MOB)

riding

public Rideable riding()
Description copied from interface: Rider
Returns the Rideable upon which this Rider is Riding.

Specified by:
riding in interface Rider
Returns:
the Rideable upon which this Rider is Riding.
See Also:
Rideable

setRiding

public void setRiding(Rideable ride)
Description copied from interface: Rider
Sets the Rideable upon which this Rider is Riding.

Specified by:
setRiding in interface Rider
Parameters:
ride - the Rideable to ride upon
See Also:
Rideable

session

public final Session session()
Description copied from interface: MOB
Returns any Telnet Session object attached to this mob. Without one, this mob has nowhere to send messages, or receive input from a keyboard

Specified by:
session in interface MOB
Returns:
the Telnet Session attached to this mob
See Also:
MOB.setSession(Session), MOB.isMonster(), MOB.isPossessing(), MOB.soulMate()

setSession

public void setSession(Session newSession)
Description copied from interface: MOB
Sets any Telnet Session object attached to this mob. Without one, this mob has nowhere to send messages, or receive input from a keyboard

Specified by:
setSession in interface MOB
Parameters:
newSession - the Telnet Session attached to this mob
See Also:
MOB.session(), MOB.isMonster(), MOB.isPossessing(), MOB.soulMate()

getNaturalWeapon

public Weapon getNaturalWeapon()
Description copied from interface: MOB
Returns the Weapon object that this mob attacks with when attacking otherwise unarmed. This is like claws and teeth for animals and so forth. It is typically determined by the mobs race.

Specified by:
getNaturalWeapon in interface MOB
Returns:
the unarmed weapon

name

public java.lang.String name(MOB viewer)
Description copied from interface: Physical
Returns the name, but as seen by the given viewer. Can differ from name() without being saved to the DB.

Specified by:
name in interface Physical
Parameters:
viewer - the mob viewing the physical thing
Returns:
the name as seen by the viewer
See Also:
Tickable.name()

displayText

public java.lang.String displayText(MOB viewerMob)
Description copied from interface: Physical
Returns the displayText, but as seen by the given viewer. Can differ from displayText() without being saved to the DB. Display Texts are normally the way something appears in a room, or is the roomTitle of rooms.

Specified by:
displayText in interface Physical
Parameters:
viewerMob - the mob viewing the physical thing
Returns:
the displayText as seen by the viewer
See Also:
Environmental.displayText()

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
Returns:
the string describing how this object looks in the room

setDisplayText

public void setDisplayText(java.lang.String newDisplayText)
Description copied from interface: Environmental
Sets 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:
setDisplayText in interface Environmental
Parameters:
newDisplayText - the string describing how this object looks in the room

description

public java.lang.String description()
Description copied from interface: Environmental
The basic description of this object, as shown when the item is directly LOOKed at.

Specified by:
description in interface Environmental
Returns:
the basic detail description of this object

description

public java.lang.String description(MOB viewerMob)
Description copied from interface: Physical
Returns the description, but as seen by the given viewer. Can differ from description() without being saved to the DB. Descriptions are normally the way something appears when looked at, or is the long description of rooms.

Specified by:
description in interface Physical
Parameters:
viewerMob - the mob viewing the physical thing
Returns:
the description as seen by the viewer
See Also:
Environmental.description()

setDescription

public void setDescription(java.lang.String newDescription)
Description copied from interface: Environmental
Sets the basic description of this object, as shown when the item is directly LOOKed at.

Specified by:
setDescription in interface Environmental
Parameters:
newDescription - the basic detail description of this object

setMiscText

public void setMiscText(java.lang.String newText)
Description copied from interface: Environmental
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. For objects which have true for their isGeneric method, this is used to set and parse the XML which will be used to fill out the fields in this object. Since Ability objects are never Generic, this will always be where parameters are read from an Ability instance.

Specified by:
setMiscText in interface Environmental
Parameters:
newText - either an open internal text string, or XML

text

public java.lang.String text()
Description copied from interface: Environmental
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. For objects which have true for their isGeneric method, this is used to set and parse the XML which will be used to fill out the fields in this object. Since Ability objects are never Generic, this will always be where parameters are read from an Ability instance.

Specified by:
text in interface Environmental
Returns:
either an open internal text string, or XML

miscTextFormat

public java.lang.String miscTextFormat()
Description copied from interface: Environmental
Unimplemented as of yet, but will hold a string telling the system what the proper format of any miscText data. Will use the CMParms.MTFORMAT_* constants for definition.

Specified by:
miscTextFormat in interface Environmental
Returns:
the format expected for the miscText field
See Also:
CMParms, Environmental.text(), Environmental.setMiscText(String)

healthText

public java.lang.String healthText(MOB viewer)
Description copied from interface: MOB
Returns the friendly viewable description of this mobs health status, from the given viewer mobs point of view.

Specified by:
healthText in interface MOB
Parameters:
viewer - the mob viewing this mob
Returns:
the friendly viewable health status string

actions

public double actions()
Description copied from interface: MUDCmdProcessor
Returns the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them. They are usually replenished once per tick.

Specified by:
actions in interface MUDCmdProcessor
Returns:
the number of action points
See Also:
MUDCmdProcessor.enqueCommand(List, int, double), MUDCmdProcessor.setActions(double)

setActions

public void setActions(double remain)
Description copied from interface: MUDCmdProcessor
Sets the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them. They are usually replenished once per tick.

Specified by:
setActions in interface MUDCmdProcessor
Parameters:
remain - the number of action points
See Also:
MUDCmdProcessor.enqueCommand(List, int, double), MUDCmdProcessor.actions()

commandQueSize

public int commandQueSize()
Description copied from interface: MUDCmdProcessor
Returns the number of commands on this processors que

Specified by:
commandQueSize in interface MUDCmdProcessor
Returns:
the number of commands on this processors que
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.doCommand(List, int), MUDCmdProcessor.enqueCommand(List, int, double), MUDCmdProcessor.actions()

clearCommandQueue

public void clearCommandQueue()
Description copied from interface: MUDCmdProcessor
Cancels and empties the command que of this processor.

Specified by:
clearCommandQueue in interface MUDCmdProcessor
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.enqueCommand(List, int, double), MUDCmdProcessor.doCommand(List, int), MUDCmdProcessor.commandQueSize(), MUDCmdProcessor.actions()

dequeCommand

public boolean dequeCommand()
Description copied from interface: MUDCmdProcessor
If this processor has enough action points to perform the top command on the que, then this method will execute that action. It returns whether there are still more actions on the que.

Specified by:
dequeCommand in interface MUDCmdProcessor
Returns:
true if there are more actions on the que, false otherwise
See Also:
MUDCmdProcessor.enqueCommand(List, int, double), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.doCommand(List, int), MUDCmdProcessor.commandQueSize(), MUDCmdProcessor.actions()

doCommand

public void doCommand(java.util.List<java.lang.String> commands,
                      int metaFlags)
Description copied from interface: MUDCmdProcessor
Forces this processor to parse the given command string tokens, determine a command to execute, and then execute it, regardless of whether there are any action points remaining.

Specified by:
doCommand in interface MUDCmdProcessor
Parameters:
commands - the command string tokens
metaFlags - any meta-command flags
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.commandQueSize(), MUDCmdProcessor.enqueCommand(List, int, double), MUDCmdProcessor.actions()

doCommand

protected void doCommand(java.lang.Object O,
                         java.util.List<java.lang.String> commands,
                         int metaFlags)

calculateActionCost

protected double calculateActionCost(java.lang.Object command,
                                     java.util.List<java.lang.String> commands,
                                     double overrideActionCost)

prequeCommand

public void prequeCommand(java.util.List<java.lang.String> commands,
                          int metaFlags,
                          double actionCost)
Description copied from interface: MUDCmdProcessor
Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.

Specified by:
prequeCommand in interface MUDCmdProcessor
Parameters:
commands - the parsed command string tokens
metaFlags - meta-command flags to send to the command, if any
actionCost - either 0 to let the action object decide, or an override cost
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.doCommand(List, int), MUDCmdProcessor.actions()

prequeCommands

public void prequeCommands(java.util.List<java.util.List<java.lang.String>> commands,
                           int metaFlags)
Description copied from interface: MUDCmdProcessor
Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.

Specified by:
prequeCommands in interface MUDCmdProcessor
Parameters:
commands - the parsed command string tokens
metaFlags - meta-command flags to send to the command, if any
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.doCommand(List, int)

enqueCommand

public void enqueCommand(java.util.List<java.lang.String> commands,
                         int metaFlags,
                         double actionCost)
Description copied from interface: MUDCmdProcessor
Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.

Specified by:
enqueCommand in interface MUDCmdProcessor
Parameters:
commands - the parsed command string tokens
metaFlags - meta-command flags to send to the command, if any
actionCost - either 0 to let the action object decide, or an override cost
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.doCommand(List, int), MUDCmdProcessor.actions()

enqueCommands

public void enqueCommands(java.util.List<java.util.List<java.lang.String>> commands,
                          int metaFlags)
Description copied from interface: MUDCmdProcessor
Parses the given commands string tokens to determine what kind of commands are to be executed, and depending on how many actions the player has remaining this tick, either executes the commands or puts them on the que for automatic execution once sufficient actions are available.

Specified by:
enqueCommands in interface MUDCmdProcessor
Parameters:
commands - the parsed commands string tokens
metaFlags - meta-command flags to send to the command, if any
See Also:
MUDCmdProcessor.dequeCommand(), MUDCmdProcessor.clearCommandQueue(), MUDCmdProcessor.doCommand(List, int), MUDCmdProcessor.actions()

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
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

tell

public void tell(MOB source,
                 Environmental target,
                 Environmental tool,
                 java.lang.String msg)
Description copied from interface: MOB
Basic communication to a session attached to this mob, if any. This version allows the basic naming tags to be used by providing the objects to supply the names.

Specified by:
tell in interface MOB
Parameters:
source - the <S-NAME> source/agent of the message or null
target - the <T-NAME> target of the message or null
tool - the <O-NAME> tool of the message or null
msg - the string message with naming tags
See Also:
MOB.tell(String)

tell

public void tell(java.lang.String msg)
Description copied from interface: MOB
Basic communication to a session attached to this mob, if any.

Specified by:
tell in interface MOB
Parameters:
msg - the string message to send to the session.
See Also:
MOB.tell(MOB, Environmental, Environmental, String)

fixChannelColors

protected java.lang.String fixChannelColors(int channelCode,
                                            java.lang.String message)

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
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

affectCharStats

public void affectCharStats(MOB affectedMob,
                            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
Parameters:
affectedMob - the host of the CharStats object being affected
affectableStats - the particular CharStats object being affected
See Also:
CharStats, MOB, MOB.baseCharStats(), MOB.charStats(), MOB.recoverCharStats()

getTickStatus

public int getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

isPlayer

public boolean isPlayer()
Description copied from interface: MOB
Returns whether this mob represents a player. It basically checks for a PlayerStats object.

Specified by:
isPlayer in interface MOB
Returns:
whether this mob represents a player
See Also:
MOB.isMonster(), MOB.playerStats()

isMonster

public boolean isMonster()
Description copied from interface: MOB
Returns whether this mob has a real telnet session attached to it.

Specified by:
isMonster in interface MOB
Returns:
true if there is a session attached, false otherwise
See Also:
MOB.session(), MOB.setSession(Session), MOB.isPossessing(), MOB.soulMate()

isPossessing

public boolean isPossessing()
Description copied from interface: MOB
Returns whether this mob base session is possessing some other mob. It says more about the session than the mob.

Specified by:
isPossessing in interface MOB
Returns:
true if this mobs session is possessing another mob
See Also:
MOB.session(), MOB.setSession(Session), MOB.soulMate(), MOB.dispossess(boolean)

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

addItem

public void addItem(Item item)
Description copied from interface: ItemCollection
Adds a new item to its possessor. By default, the item is added in a default resting state -- no containers, timeouts, or other modifiers are set. Duplicates will not be permitted.

Specified by:
addItem in interface ItemCollection
Parameters:
item - the item to add
See Also:
ItemCollection.delItem(Item)

addItem

public void addItem(Item item,
                    ItemPossessor.Expire expire)
Description copied from interface: ItemPossessor
Adds a new item to its possessor, with an expiration code. Duplicates will not be permitted.

Specified by:
addItem in interface ItemPossessor
Parameters:
item - the item to add
expire - the expiration argument to decide when it will get cleaned up
See Also:
ItemPossessor.Expire

delItem

public void delItem(Item item)
Description copied from interface: ItemCollection
Removes the item from this possessor.

Specified by:
delItem in interface ItemCollection
Parameters:
item - the item to remove

delAllItems

public void delAllItems(boolean destroy)
Description copied from interface: ItemCollection
Removes all items from this collection

Specified by:
delAllItems in interface ItemCollection
Parameters:
destroy - true to also destroy the items

numItems

public int numItems()
Description copied from interface: ItemCollection
Returns the total number of items at this possessor, regardless of container status.

Specified by:
numItems in interface ItemCollection
Returns:
the total number of items

items

public java.util.Enumeration<Item> items()
Description copied from interface: ItemCollection
An enumeration of all the items at this possessor.

Specified by:
items in interface ItemCollection
Returns:
enumeration of all the items at this possessor.

isContent

public boolean isContent(Item I)
Description copied from interface: ItemCollection
Returns whether the given item is in this possessors list.

Specified by:
isContent in interface ItemCollection
Parameters:
I - the item to check
Returns:
true if the item was found, and false otherwise

findItems

public java.util.List<Item> findItems(Item goodLocation,
                                      java.lang.String itemName)
Description copied from interface: ItemCollection
Returns all items in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).

Specified by:
findItems in interface ItemCollection
Parameters:
goodLocation - the container to look in, or null for none
itemName - the name or partial name of the item to fetch
Returns:
the item found, or null

getItem

public Item getItem(int index)
Description copied from interface: ItemCollection
Returns the item at the given index, regardless of container status, visibility, or other modifiers.

Specified by:
getItem in interface ItemCollection
Parameters:
index - the index of the item
Returns:
the item at that index, or null if its not found

eachItem

public void eachItem(EachApplicable<Item> applier)
Description copied from interface: ItemCollection
Applies the given code to each item in this collection

Specified by:
eachItem in interface ItemCollection
Parameters:
applier - code to execute against each object

getRandomItem

public Item getRandomItem()
Description copied from interface: ItemCollection
Returns a random item in this collection, or null

Specified by:
getRandomItem in interface ItemCollection
Returns:
a random item in this collection, or null

fetchFromInventory

public Item fetchFromInventory(Item goodLocation,
                               java.lang.String itemName,
                               Filterer<Environmental> filter,
                               boolean respectLocationAndWornCode)

findItem

public Item findItem(java.lang.String itemName)
Description copied from interface: ItemCollection
Returns the item in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found). Handles indexing for duplicate-named items.

Specified by:
findItem in interface ItemCollection
Parameters:
itemName - the name or partial name of the item to fetch
Returns:
the item found, or null

findItem

public Item findItem(Item goodLocation,
                     java.lang.String itemName)
Description copied from interface: ItemCollection
Returns the item in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found). Handles indexing for duplicate-named items.

Specified by:
findItem in interface ItemCollection
Parameters:
goodLocation - the container to look in, or null for none
itemName - the name or partial name of the item to fetch
Returns:
the item found, or null

fetchItem

public Item fetchItem(Item goodLocation,
                      Filterer<Environmental> filter,
                      java.lang.String itemName)
Description copied from interface: MOB
Returns a best match for the given itemName in this mob/players base inventory. The filter must be non-null, but can be Wearable.FILTER_ANY or one of the other Wearable filters. Also allows specific container checks. This method also respects context numbers, such as .1, .2 for grabbing a specific duplicate item.

Specified by:
fetchItem in interface MOB
Parameters:
goodLocation - the container to look in, or null for uncontained
filter - the wearable filter to use
itemName - the name, id, or display text, or keyboard for the item to find.
Returns:
a best match for the given itemName
See Also:
Wearable.FILTER_WORNONLY, MOB.fetchWornItems(long, short, short), MOB.fetchWieldedItem()

findItems

public java.util.List<Item> findItems(java.lang.String itemName)
Description copied from interface: ItemCollection
Returns all items in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).

Specified by:
findItems in interface ItemCollection
Parameters:
itemName - the name or partial name of the item to fetch
Returns:
the item found, or null

addFollower

public void addFollower(MOB follower,
                        int order)
Description copied from interface: Followable
Adds/Alters a follower to this Followable, of the appropriate type, while also setting the order/rank they hold in the line. Orders don't have to be unique. This does NOT call setFollowing on the follower, so that would also need to be done, and, in fact, can be done instead if you like.

Specified by:
addFollower in interface Followable<MOB>
Parameters:
follower - the new follower to follow
order - the relative position of the new follower in the formation
See Also:
Followable.setFollowing(Followable)

delFollower

public void delFollower(MOB follower)
Description copied from interface: Followable
Removes the given follower from this followable.

Specified by:
delFollower in interface Followable<MOB>
Parameters:
follower - the follower to remove

numFollowers

public int numFollowers()
Description copied from interface: Followable
Returns the total number of Direct followers

Specified by:
numFollowers in interface Followable<MOB>
Returns:
the total number of Direct followers
See Also:
Followable.totalFollowers()

followers

public java.util.Enumeration<Pair<MOB,java.lang.Short>> followers()
Description copied from interface: Followable
Returns an enumeration of the followers of this Followable, along with their relative rank/position in the formation.

Specified by:
followers in interface Followable<MOB>
Returns:
an enumeration of the followers of this Followable

fetchFollowerOrder

public int fetchFollowerOrder(MOB thisOne)
Description copied from interface: Followable
Returns the relative order/rank of the specific follower in the formation.

Specified by:
fetchFollowerOrder in interface Followable<MOB>
Parameters:
thisOne - the specific followable
Returns:
the relative order/rank of the specific follower

fetchFollower

public MOB fetchFollower(java.lang.String named)
Description copied from interface: Followable
Returns the followable follower that best matches the given search string name.

Specified by:
fetchFollower in interface Followable<MOB>
Parameters:
named - the search string name
Returns:
the followable follower that best matches

fetchFollower

public MOB fetchFollower(int index)
Description copied from interface: Followable
Returns the followable follower at the give index in this collection

Specified by:
fetchFollower in interface Followable<MOB>
Parameters:
index - the index (0-based) of the followable follower
Returns:
the followable follower at the give index in this collection

isFollowedBy

public boolean isFollowedBy(MOB thisOne)
Description copied from interface: Followable
Returns whether the given followable is following this followable.

Specified by:
isFollowedBy in interface Followable<MOB>
Parameters:
thisOne - the followable follower to look for.
Returns:
true if thisOne is following, false otherwise

willFollowOrdersOf

public boolean willFollowOrdersOf(MOB mob)
Description copied from interface: MOB
Returns whether the given mob has the authority to give Orders to this mob, whether from security status, or clan rank.

Specified by:
willFollowOrdersOf in interface MOB
Parameters:
mob - the mob to check to see if he's the leader
Returns:
true if you'll follow the mobs orders, false otherwise

amUltimatelyFollowing

public MOB amUltimatelyFollowing()
Description copied from interface: Followable
If this followable follower is following a followable that is also following a followable, then this will recursively determine the First followable and return it.

Specified by:
amUltimatelyFollowing in interface Followable<MOB>
Returns:
the first followable

amFollowing

public MOB amFollowing()
Description copied from interface: Followable
Returns the followable that this followable follower is following, or null.

Specified by:
amFollowing in interface Followable<MOB>
Returns:
the followable that this followable follower is following, or null.

setFollowing

public void setFollowing(MOB mob)
Description copied from interface: Followable
Alters who this followable follower is following. This also calls addFollower above.

Specified by:
setFollowing in interface Followable<MOB>
Parameters:
mob - the follower following
See Also:
Followable.addFollower(Followable, int)

getRideBuddies

public java.util.Set<MOB> getRideBuddies(java.util.Set<MOB> list)
Description copied from interface: MOB
This method recursively returns whoever this mob is riding, and if they are a rideable, who all is riding with him.

Specified by:
getRideBuddies in interface MOB
Parameters:
list - the required list to populate with riders and rideable
Returns:
the same list sent in
See Also:
Rider, Rideable

getGroupMembers

public java.util.Set<MOB> getGroupMembers(java.util.Set<MOB> list)
Description copied from interface: Followable
Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers.

Specified by:
getGroupMembers in interface Followable<MOB>
Parameters:
list - requires list to populate with followables
Returns:
the same list, filled

getGroupMembersAndRideables

public java.util.Set<? extends Rider> getGroupMembersAndRideables(java.util.Set<? extends Rider> list)
Description copied from interface: Followable
Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers. It also includes all their rideables, and their rideables riders, and those riders rideables.

Specified by:
getGroupMembersAndRideables in interface Followable<MOB>
Parameters:
list - requires list to populate with followables and rideables
Returns:
the same list, filled

isSavable

public boolean isSavable()
Description copied from interface: Contingent
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. It always returns true except under unique circumstances.

Specified by:
isSavable in interface Contingent
Returns:
true, usually.

setSavable

public void setSavable(boolean truefalse)
Description copied from interface: Contingent
Sets whether this object can be saved as a permanent aspect of its host.

Specified by:
setSavable in interface Contingent
Parameters:
truefalse - whether this behavior can be saved as part of its host.
See Also:
Contingent.isSavable()

soulMate

public MOB soulMate()
Description copied from interface: MOB
Returns the player mob that is possessing this mob by loaning it its session.

Specified by:
soulMate in interface MOB
Returns:
the mob that is possessing this mob
See Also:
MOB.session(), MOB.isPossessing(), MOB.setSoulMate(MOB), MOB.dispossess(boolean)

setSoulMate

public void setSoulMate(MOB mob)
Description copied from interface: MOB
Sets the player mob that is possessing this mob by loaning it its session.

Specified by:
setSoulMate in interface MOB
Parameters:
mob - the mob that is possessing this mob
See Also:
MOB.session(), MOB.isPossessing(), MOB.soulMate(), MOB.dispossess(boolean)

addAbility

public void addAbility(Ability to)
Description copied from interface: AbilityContainer
Adds a new ability to this for use. No ability with the same ID can be contained twice.

Specified by:
addAbility in interface AbilityContainer
Parameters:
to - the Ability to add.
See Also:
Ability

delAbility

public void delAbility(Ability to)
Description copied from interface: AbilityContainer
Removes the exact given ability object from here.

Specified by:
delAbility in interface AbilityContainer
Parameters:
to - the exact Ability to remove
See Also:
Ability

delAllAbilities

public void delAllAbilities()
Description copied from interface: AbilityContainer
Removes all owned abilities from this container. Any extraneous abilities bestowed from other sources will NOT be removed.

Specified by:
delAllAbilities in interface AbilityContainer

numAbilities

public int numAbilities()
Description copied from interface: AbilityContainer
Returns the number of abilities contained herein this object. Any extraneous abilities bestowed from other sources will NOT be returned -- only the exact abilities owned herein.

Specified by:
numAbilities in interface AbilityContainer
Returns:
the number of owned abilities
See Also:
Ability

abilities

public java.util.Enumeration<Ability> abilities()
Description copied from interface: AbilityContainer
Returns an enumerator of the Ability objects in this container. Any extraneous abilities bestowed from other sources will NOT be returned -- only the exact abilities owned herein.

Specified by:
abilities in interface AbilityContainer
Returns:
An enumerator for abilities

allAbilities

public java.util.Enumeration<Ability> allAbilities()
Description copied from interface: AbilityContainer
Returns an enumerator of the Ability objects in this container. Any extraneous abilities bestowed from other sources WILL ALSO be returned.

Specified by:
allAbilities in interface AbilityContainer
Returns:
An enumerator for all abilities, both in the container and not

numAllAbilities

public int numAllAbilities()
Description copied from interface: AbilityContainer
Returns the number of all abilities in this container. Any extraneous abilities bestowed from other sources WILL be counted by this.

Specified by:
numAllAbilities in interface AbilityContainer
Returns:
the number of all abilities in this container

fetchRandomAbility

public Ability fetchRandomAbility()
Description copied from interface: AbilityContainer
Returns a random ability from this container. Any extraneous abilities bestowed from other sources MAY be returned by this method.

Specified by:
fetchRandomAbility in interface AbilityContainer
Returns:
a random Ability
See Also:
Ability

isRacialAbility

public boolean isRacialAbility(java.lang.String abilityID)
Description copied from interface: MOB
Returns whether the given ability is actually a racial ability instead of a learned, clan, or some other kind of ability.

Specified by:
isRacialAbility in interface MOB
Parameters:
abilityID - the ability object to check for
Returns:
true if that object is racial, false otherwise

fetchAbility

public Ability fetchAbility(int index)
Description copied from interface: AbilityContainer
Returns the Ability object at that index in this container. Any extraneous abilities bestowed from other sources MAY be returned, so long as index > numAbilities.

Specified by:
fetchAbility in interface AbilityContainer
Parameters:
index - the index of the Ability object to return
Returns:
the Ability object
See Also:
Ability

fetchAbility

public Ability fetchAbility(java.lang.String ID)
Description copied from interface: AbilityContainer
If contained herein, this will return the ability from this container of the given ID. Any extraneous abilities bestowed from other sources MAY be returned by this method.

Specified by:
fetchAbility in interface AbilityContainer
Parameters:
ID - the ID of the ability to return.
Returns:
the Ability object
See Also:
Ability

findAbility

public Ability findAbility(java.lang.String ID)
Description copied from interface: MOB
Returns the best match ability/skill/spell of this mob to the given search name string. This also searches racial and clan abilities.

Specified by:
findAbility in interface MOB
Parameters:
ID - the search string for the ability id, name, or whatever
Returns:
the best match ability/skill to the search string

racialEffects

protected final java.util.List<Ability> racialEffects()

clanEffects

protected final java.util.List<Ability> clanEffects()

clans

public java.lang.Iterable<Pair<Clan,java.lang.Integer>> clans()
Description copied from interface: MOB
Returns an iterable set of the Clans that this mob/player belongs to, along with the Rank code in that clan that this mob has in it.

Specified by:
clans in interface MOB
Returns:
an iterable set of the Clans that this mob/player belongs
See Also:
MOB.setClan(String, int), MOB.getClanRole(String)

getClanRole

public Pair<Clan,java.lang.Integer> getClanRole(java.lang.String clanID)
Description copied from interface: MOB
Given a precise clanID (name), this method returns the Clan object and this players rank in the clan, if they belong. Otherwise it returns null

Specified by:
getClanRole in interface MOB
Parameters:
clanID - the clan name/id
Returns:
the Clan object + Rank, or null
See Also:
MOB.clans(), MOB.setClan(String, int)

setClan

public void setClan(java.lang.String clanID,
                    int role)
Description copied from interface: MOB
Adds or alters the rank of this player/mob in the given clan.

Specified by:
setClan in interface MOB
Parameters:
clanID - the clanID/name
role - the rank/role of this player in the clan
See Also:
MOB.clans(), MOB.getClanRole(String)

addNonUninvokableEffect

public void addNonUninvokableEffect(Ability to)
Description copied from interface: Affectable
Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked. recoverPhyStats() method should be called next. An Ability with a given ID() can only be added once per object.

Specified by:
addNonUninvokableEffect in interface Affectable
Parameters:
to - The ability object to add as an effect.
See Also:
Ability, Affectable.recoverPhyStats()

addPriorityEffect

public void addPriorityEffect(Ability to)
Description copied from interface: MOB
Adds the given Ability as a new effect, also putting it on the top of the list to ensure that it is processed first for messaging and stat effect purposes.

Specified by:
addPriorityEffect in interface MOB
Parameters:
to - the Ability to add as an effect
See Also:
MOB.numAllEffects(), MOB.personalEffects(), Ability, Affectable.addEffect(Ability)

addEffect

public void addEffect(Ability to)
Description copied from interface: Affectable
Add a new effect to this object, whether permanent or temporary. After calling this method, recoverPhyStats() should be called next in case this ability object modifies the stats. An Ability with a given ID() can only be added once per object.

Specified by:
addEffect in interface Affectable
Parameters:
to - The ability object to add as an effect.
See Also:
Ability, Affectable.recoverPhyStats()

delEffect

public void delEffect(Ability to)
Description copied from interface: Affectable
Delete an effect from this object, whether permanent or temporary. After calling this method, recoverPhyStats() should be called next in case this ability object modified the stats.

Specified by:
delEffect in interface Affectable
Parameters:
to - The ability object to remove as an effect on this object
See Also:
Ability, Affectable.recoverPhyStats()

eachEffect

public void eachEffect(EachApplicable<Ability> applier)
Description copied from interface: Affectable
Applies the given code to each effect on this object

Specified by:
eachEffect in interface Affectable
Parameters:
applier - code to execute against each object

delAllEffects

public void delAllEffects(boolean unInvoke)
Description copied from interface: Affectable
Optionally uninvokes and then certainly removes all effects from this object.

Specified by:
delAllEffects in interface Affectable
Parameters:
unInvoke - send true to uninvoke before deleting

numAllEffects

public int numAllEffects()
Description copied from interface: MOB
Returns the total number of effects this mob/player is under, including Racial and Clan effects. This is as opposed to the normal numEffects, which only returns the effects properly owned by this mob.

Specified by:
numAllEffects in interface MOB
Returns:
the total number of effects this mob/player is under
See Also:
MOB.addPriorityEffect(Ability), MOB.personalEffects(), Affectable.numEffects()

numEffects

public int numEffects()
Description copied from interface: Affectable
Returns the number of ability objects listed as effects on this object.

Specified by:
numEffects in interface Affectable
Returns:
the number of effects this object has
See Also:
Ability

fetchEffect

public Ability fetchEffect(int index)
Description copied from interface: Affectable
Returns an ability object listed as an effect on this object. May return null even if the index is correct to mark a race condition.

Specified by:
fetchEffect in interface Affectable
Parameters:
index - which object to return
Returns:
the ability object effecting this object
See Also:
Ability, Affectable.numEffects()

fetchEffect

public Ability fetchEffect(java.lang.String ID)
Description copied from interface: Affectable
Returns an ability object listed as an effect on this object. The object will be the one with the same ID() string as passed in.

Specified by:
fetchEffect in interface Affectable
Parameters:
ID - the Ability ID to look for in effects
Returns:
the ability object effecting this object
See Also:
Ability, CMObject.ID()

personalEffects

public java.util.Enumeration<Ability> personalEffects()
Description copied from interface: MOB
Returns an enumeration only of the effects that are personally owned by this mob, which means it will skip any Clan or Racial effects.

Specified by:
personalEffects in interface MOB
Returns:
the enumeration of personal effect objects
See Also:
MOB.numAllEffects(), MOB.addPriorityEffect(Ability), Ability, Affectable.effects()

effects

public java.util.Enumeration<Ability> effects()
Description copied from interface: Affectable
Returns an enumerator of abilities listed as effects on this object.

Specified by:
effects in interface Affectable
Returns:
the enumerator of ability objects effecting this object
See Also:
Ability

addBehavior

public void addBehavior(Behavior to)
Manipulation of Behavior objects, which includes movement, speech, spellcasting, etc, etc.

Specified by:
addBehavior in interface Behavable
Parameters:
to - The behavior object to add.
See Also:
Behavior, Affectable.recoverPhyStats()

delBehavior

public void delBehavior(Behavior to)
Description copied from interface: Behavable
Delete a behavior from this object. After calling this method, recoverPhyStats() should be called next in case this behavior object modified the stats.

Specified by:
delBehavior in interface Behavable
Parameters:
to - The behavior object to remove.
See Also:
Behavior, Affectable.recoverPhyStats()

delAllBehaviors

public void delAllBehaviors()
Description copied from interface: Behavable
Removes all behaviors from this object.

Specified by:
delAllBehaviors in interface Behavable

numBehaviors

public int numBehaviors()
Description copied from interface: Behavable
The number of behaviors this object has.

Specified by:
numBehaviors in interface Behavable
Returns:
the number of behaviors
See Also:
Behavior

behaviors

public java.util.Enumeration<Behavior> behaviors()
Description copied from interface: Behavable
Returns an enumerator of all the behaviors on this object.

Specified by:
behaviors in interface Behavable
Returns:
an enumerator of all the behaviors on this object.
See Also:
Behavior

fetchBehavior

public Behavior fetchBehavior(int index)
Description copied from interface: Behavable
Returns a behavior object on this object. May return null even if the index is correct to mark a race condition.

Specified by:
fetchBehavior in interface Behavable
Parameters:
index - which object to return
Returns:
the behavior object
See Also:
Behavior, Behavable.numBehaviors()

fetchBehavior

public Behavior fetchBehavior(java.lang.String ID)
Description copied from interface: Behavable
Returns a behavior object listed on this object. The object will be the one with the same ID() string as passed in.

Specified by:
fetchBehavior in interface Behavable
Parameters:
ID - the Behavior ID to look for
Returns:
the behavior object
See Also:
Behavior, CMObject.ID()

eachBehavior

public void eachBehavior(EachApplicable<Behavior> applier)
Description copied from interface: Behavable
Applies the given code to each behavior on this object

Specified by:
eachBehavior in interface Behavable
Parameters:
applier - code to execute against each object

getAbilityUsageCache

public int[][] getAbilityUsageCache(java.lang.String abilityID)
Description copied from interface: MOB
Because of certain variables, mobs are required to cache the calculation of the costs of using their Abilities. The array's first dimension is the type of cost, indexed by the CACHEINDEX constants. The second dimension is the resource type, which is indexed by the USAGEINDEX constants. Therefore by default, the array is CACHEINDEX_TOTAL x 3.

Specified by:
getAbilityUsageCache in interface MOB
Parameters:
abilityID - the specific Ability ID() to get the cache for
Returns:
the ability usage cache array
See Also:
Ability.CACHEINDEX_TOTAL

addExpertise

public void addExpertise(java.lang.String code)
Description copied from interface: MOB
Adds a new expertise, or updates an existing one. Requires a coded expertise name (string followed by roman or decimal number)

Specified by:
addExpertise in interface MOB
Parameters:
code - the expertise to add or update
See Also:
MOB.fetchExpertise(String), MOB.expertises(), MOB.delAllExpertises(), MOB.delExpertise(String)

delExpertise

public void delExpertise(java.lang.String baseCode)
Description copied from interface: MOB
Deletes an expertise.

Specified by:
delExpertise in interface MOB
Parameters:
baseCode - the expertise code
See Also:
MOB.fetchExpertise(String), MOB.expertises(), MOB.delAllExpertises(), MOB.addExpertise(String)

fetchExpertise

public Pair<java.lang.String,java.lang.Integer> fetchExpertise(java.lang.String baseCode)
Description copied from interface: MOB
Returns the expertise and number for the given code. The code is a full expertise code, including number. This will only return a value if the mob has one at or below the given level, returning null if the mob does not have a sufficient expertise as the one given.

Specified by:
fetchExpertise in interface MOB
Parameters:
baseCode - the expertise code
Returns:
the entry with the string and number
See Also:
MOB.delAllExpertises(), MOB.expertises(), MOB.delExpertise(String), MOB.addExpertise(String)

delAllExpertises

public void delAllExpertises()
Description copied from interface: MOB
Deletes all expertises from the collection

Specified by:
delAllExpertises in interface MOB
See Also:
MOB.fetchExpertise(String), MOB.expertises(), MOB.delExpertise(String), MOB.addExpertise(String)

expertises

public java.util.Enumeration<java.lang.String> expertises()
Description copied from interface: MOB
Returns an enumerator of all the expertise names with their numbers if any .

Specified by:
expertises in interface MOB
Returns:
an enumerator
See Also:
MOB.delAllExpertises(), MOB.fetchExpertise(String), MOB.delExpertise(String), MOB.addExpertise(String)

addScript

public void addScript(ScriptingEngine S)
Manipulation of the scripts list

Specified by:
addScript in interface Behavable
Parameters:
S - the scripting engine, fully populated, to add
See Also:
ScriptingEngine

delScript

public void delScript(ScriptingEngine S)
Description copied from interface: Behavable
Remove a running script from this object.

Specified by:
delScript in interface Behavable
Parameters:
S - the specific scripting engine to remove
See Also:
ScriptingEngine

delAllScripts

public void delAllScripts()
Description copied from interface: Behavable
Removes all executing scripts from this object.

Specified by:
delAllScripts in interface Behavable

numScripts

public int numScripts()
Description copied from interface: Behavable
Return the number of scripts running on this object

Specified by:
numScripts in interface Behavable
Returns:
number of scripts

scripts

public java.util.Enumeration<ScriptingEngine> scripts()
Description copied from interface: Behavable
Returns an enumerator of all the scripts on this object.

Specified by:
scripts in interface Behavable
Returns:
an enumerator of all the scripts on this object.
See Also:
ScriptingEngine

fetchScript

public ScriptingEngine fetchScript(int x)
Description copied from interface: Behavable
Retrieve one of the enumerated scripts running on this object

Specified by:
fetchScript in interface Behavable
Parameters:
x - which script to return
Returns:
the scripting engine
See Also:
ScriptingEngine

eachScript

public void eachScript(EachApplicable<ScriptingEngine> applier)
Description copied from interface: Behavable
Applies the given code to each scripting engine on this object

Specified by:
eachScript in interface Behavable
Parameters:
applier - code to execute against each object

addTattoo

public void addTattoo(java.lang.String of)
Manipulation of the tatoo list

Specified by:
addTattoo in interface Tattooable
Parameters:
of - the permanent tattoo name to add
See Also:
Tattooable, Tattooable.addTattoo(String, int), Tattooable.addTattoo(Tattoo)

addTattoo

public void addTattoo(java.lang.String of,
                      int tickDown)
Description copied from interface: Tattooable
Add a new tattoo to this object

Specified by:
addTattoo in interface Tattooable
Parameters:
of - the permanent tattoo name to add
tickDown - the ticks of life for this tattoo
See Also:
Tattooable, Tattooable.addTattoo(String), Tattooable.addTattoo(Tattoo)

delTattoo

public void delTattoo(java.lang.String of)
Description copied from interface: Tattooable
Remove a specific tattoo from this object

Specified by:
delTattoo in interface Tattooable
Parameters:
of - the tattoo name of the tattoo to remove
See Also:
Tattooable, Tattooable.delTattoo(Tattoo)

addTattoo

public void addTattoo(Tattoo of)
Description copied from interface: Tattooable
Add a new tattoo to this object

Specified by:
addTattoo in interface Tattooable
Parameters:
of - the tattoo object to add
See Also:
Tattooable, Tattooable.addTattoo(String, int), Tattooable.addTattoo(String)

delTattoo

public void delTattoo(Tattoo of)
Description copied from interface: Tattooable
Remove a specific tattoo from this object

Specified by:
delTattoo in interface Tattooable
Parameters:
of - the tattoo object to remove
See Also:
Tattooable, Tattooable.delTattoo(String)

tattoos

public java.util.Enumeration<Tattoo> tattoos()
Description copied from interface: Tattooable
Returns an enumeration of all the tattoos on this object.

Specified by:
tattoos in interface Tattooable
Returns:
an enumeration of all the tattoos on this object.
See Also:
Tattooable

findTattoo

public Tattoo findTattoo(java.lang.String of)
Description copied from interface: Tattooable
Returns the tattoo of the given marker name

Specified by:
findTattoo in interface Tattooable
Parameters:
of - the marker name to return a tattoo for
Returns:
the tattoo of the given marker name
See Also:
Tattooable, Tattooable.findTattooStartsWith(String)

findTattooStartsWith

public Tattoo findTattooStartsWith(java.lang.String of)
Description copied from interface: Tattooable
Returns the tattoo that starts with the given marker name

Specified by:
findTattooStartsWith in interface Tattooable
Parameters:
of - the marker name to return a tattoo starter for
Returns:
the tattoo that starts with the given marker name
See Also:
Tattooable, Tattooable.findTattoo(String)

addFaction

public void addFaction(java.lang.String which,
                       int start)
Manipulation of the factions list

Specified by:
addFaction in interface FactionMember
Parameters:
which - the facton ID to add to this
start - the initial rank/value in the new faction
See Also:
FactionMember

adjustFaction

public void adjustFaction(java.lang.String which,
                          int amount)
Description copied from interface: FactionMember
If this is already a member of the given faction, then the value or rank in that faction will be adjusted by the given amount. If this is NOT yet a member of the given faction, then the faction is added with the amount as an initial value.

Specified by:
adjustFaction in interface FactionMember
Parameters:
which - the facton ID to add or alter
amount - the amount to alter the faction by, or initial value
See Also:
FactionMember

factions

public java.util.Enumeration<java.lang.String> factions()
Description copied from interface: FactionMember
Returns an enumeration of all the faction id this is a member of.

Specified by:
factions in interface FactionMember
Returns:
an enumeration of all the faction id this is a member of.
See Also:
FactionMember

fetchFaction

public int fetchFaction(java.lang.String which)
Description copied from interface: FactionMember
Returns the faction rank/value that this member has in the given faction id.

Specified by:
fetchFaction in interface FactionMember
Parameters:
which - the faction id to return rank/value in
Returns:
the rank value, or Integer.MAX_VALUE if no value found
See Also:
FactionMember

fetchFactionData

public Faction.FData fetchFactionData(java.lang.String which)
Description copied from interface: FactionMember
Returns the complete contextual faction data for this member.

Specified by:
fetchFactionData in interface FactionMember
Parameters:
which - the faction id to return rank/value in
Returns:
the faction data
See Also:
Faction.FData

removeFaction

public void removeFaction(java.lang.String which)
Description copied from interface: FactionMember
Removes this as a member of the given faction, losing all rank.

Specified by:
removeFaction in interface FactionMember
Parameters:
which - the faction id to remove
See Also:
FactionMember

copyFactions

public void copyFactions(FactionMember source)
Description copied from interface: FactionMember
Copies the factions that the given member belongs to into this.

Specified by:
copyFactions in interface FactionMember
Parameters:
source - the source of the factions to copy
See Also:
FactionMember

hasFaction

public boolean hasFaction(java.lang.String which)
Description copied from interface: FactionMember
Returns whether this is a member of the given faction and has some rank.

Specified by:
hasFaction in interface FactionMember
Parameters:
which - the faction id to search for
Returns:
true if this is a member of the given faction, false otherwise
See Also:
FactionMember

fetchFactionRanges

public java.util.List<java.lang.String> fetchFactionRanges()
Description copied from interface: FactionMember
Returns an enumeration of the faction range ids that represent the rank that this member has in each of their factions. So there is one range returned per faction.

Specified by:
fetchFactionRanges in interface FactionMember
Returns:
an enumeration of the faction ranges
See Also:
FactionMember

freeWearPositions

public int freeWearPositions(long wornCode,
                             short belowLayer,
                             short layerAttributes)
Description copied from interface: MOB
Returns the number of free spaces the player/mob has at the given worn location, below the given layer, without the given attributes.

Specified by:
freeWearPositions in interface MOB
Parameters:
wornCode - the worn location to look for a free spot in
belowLayer - the layer at or below which you need a spot -- 0 works
layerAttributes - the layer attributes to check, again, 0 works
Returns:
the number of free spaces the player/mob has at the given worn location
See Also:
Wearable.WORN_HEAD, Armor.LAYERMASK_MULTIWEAR, MOB.getWearPositions(long)

getWearPositions

public int getWearPositions(long wornCode)
Description copied from interface: MOB
Returns the total number of worn locations this mob/player has at the given worn code location.

Specified by:
getWearPositions in interface MOB
Parameters:
wornCode - the worn location to look in
Returns:
the total number of worn locations this mob/player has
See Also:
Wearable.WORN_HEAD, MOB.freeWearPositions(long, short, short)

fetchWornItems

public java.util.List<Item> fetchWornItems(long wornCode,
                                           short aboveOrAroundLayer,
                                           short layerAttributes)
Description copied from interface: MOB
Returns the collection of items worn by this mob/player at the given specific worn code, at or above the given Layer code, and having the given layerAttributes.

Specified by:
fetchWornItems in interface MOB
Parameters:
wornCode - the specific worn code to loook for worn items
aboveOrAroundLayer - -2048 will grab everything, and > 0 are higher layers
layerAttributes - 0 will grab everything, or one of the layer attributes
Returns:
the list of items worn at the given worn code
See Also:
Wearable.WORN_HEAD, Armor.LAYERMASK_MULTIWEAR, MOB.fetchItem(Item, Filterer, String), MOB.fetchWieldedItem(), MOB.fetchFirstWornItem(long)

hasOnlyGoldInInventory

public boolean hasOnlyGoldInInventory()
Description copied from interface: MOB
Returns whether this mob is only carrying money, meaning their main inventory is essentially empty. Also returns true if they are broke.

Specified by:
hasOnlyGoldInInventory in interface MOB
Returns:
true if only money is being carried, or nothing.

fetchFirstWornItem

public Item fetchFirstWornItem(long wornCode)
Description copied from interface: MOB
Returns the first item encountered on this player/mob at the given worn code, or null if nothing found.

Specified by:
fetchFirstWornItem in interface MOB
Parameters:
wornCode - the worn_ code
Returns:
the first item encountered at that worn code.
See Also:
Wearable.WORN_HEAD, MOB.fetchItem(Item, Filterer, String), MOB.fetchFirstWornItem(long), MOB.fetchWieldedItem()

fetchWieldedItem

public Item fetchWieldedItem()
Description copied from interface: MOB
Returns the item being wielded in the WIELD position by this player/mob. Its a really quick way to get the mobs main weapon.

Specified by:
fetchWieldedItem in interface MOB
Returns:
the item being wielded in the WIELD position by this player/mob
See Also:
MOB.fetchFirstWornItem(long), MOB.fetchWornItems(long, short, short), MOB.fetchHeldItem()

fetchHeldItem

public Item fetchHeldItem()
Description copied from interface: MOB
Returns the item being wielded in the HELD position by this player/mob. Its a really quick way to get the mobs secondary weapon or shield.

Specified by:
fetchHeldItem in interface MOB
Returns:
the item being wielded in the HELD position by this player/mob
See Also:
MOB.fetchFirstWornItem(long), MOB.fetchWornItems(long, short, short), MOB.fetchWieldedItem()

isMine

public boolean isMine(Environmental env)
Description copied from interface: MOB
Returns whether the given environmental is possessed by this mob. Whether the object is an exact Ability or effect Ability, a Follower MOB, or an inventory Item.

Specified by:
isMine in interface MOB
Parameters:
env - the mob, item, or Ability to look for
Returns:
true if this is presently mine

moveItemTo

public void moveItemTo(Item container,
                       ItemPossessor.Expire expire,
                       ItemPossessor.Move... moveFlags)
Description copied from interface: ItemPossessor
Intelligently removes an item from its current location and moves it to this possessor, managing any container contents, and possibly followers/riders if the item is a cart. An expiration can be set on the move to have the items expire. Duplicates will not be permitted.

Specified by:
moveItemTo in interface ItemPossessor
Parameters:
container - the item to add
expire - the expiration code
moveFlags - any flags related to the move
See Also:
ItemPossessor.Expire

moveItemTo

public void moveItemTo(Item container)
Description copied from interface: ItemPossessor
Intelligently removes an item from its current location and moves it to this possessor, managing any container contents. Is the same as calling the longer moveItemTo with a Never expiration, and NO movement flags. Duplicates will not be permitted.

Specified by:
moveItemTo in interface ItemPossessor
Parameters:
container - the item to add
See Also:
ItemPossessor.Expire

L

public java.lang.String L(java.lang.String str,
                          java.lang.String... xs)
Description copied from interface: Environmental
Localize an internal string -- shortcut. Same as calling:

Specified by:
L in interface Environmental
Parameters:
str - the string to translate
xs - the array of variables to replace
Returns:
the translated string, with all variables in place
See Also:
Call with the string to translate, which may contain variables of the form @x1, @x2, etc. The array in xs is then used to replace the variables AFTER the string is translated.

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

getSaveStatIndex

public int getSaveStatIndex()
Description copied from interface: Modifiable
Returns the index into the stat codes array where extra savable fields begins. This number is always the same as getStatCodes().length unless there are extra fields which need to be saved in xml for generic objects. This method is used by editors for post-build user-defined fields.

Specified by:
getSaveStatIndex in interface Modifiable
Returns:
the index into getStatCodes()
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String), Modifiable.setStat(String, String)

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

isStat

public boolean isStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
isStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
true if the code is a real value, false otherwise
See Also:
Modifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)

sameAs

public boolean sameAs(Environmental E)
Description copied from interface: Environmental
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Specified by:
sameAs in interface Environmental
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String)