com.planet_ink.coffee_mud.MOBS.interfaces
Interface MOB

All Superinterfaces:
AbilityContainer, Affectable, Behavable, java.lang.Cloneable, CMObject, Combatant, java.lang.Comparable<CMObject>, Contingent, DBIdentifiable, Environmental, FactionMember, Followable<MOB>, ItemCollection, ItemPossessor, Modifiable, MsgListener, MUDCmdProcessor, Physical, PhysicalAgent, Rider, StatsAffecting, Tattooable, Tickable
All Known Subinterfaces:
Deity
All Known Implementing Classes:
Alligator, AngryCitizen, Ape, Assassin, Beaver, Bee, BlackBear, BlackDragon, BlueDragon, BrassDragon, BronzeDragon, BrownBear, BrownSnake, Buck, Buffalo, Bugbear, Bull, Cat, Centaur, Centipede, Cheetah, Chicken, Chimp, Citizen, Cobra, CommonBat, CopperDragon, Cougar, Cow, Coyote, Crocodile, Deer, DireWolf, Doe, Dog, Dolphin, Doppleganger, Dragon, DrowElf, DrowPriestess, DrowWarrior, DrowWizard, Duck, Elephant, Falcon, FireGiant, FlyingInsect, Fox, Frog, FrostGiant, GardenSnake, GenAuctioneer, GenBanker, GenCow, GenDeity, GenHorse, GenLibrarian, GenMob, GenPostman, GenRideable, GenShopkeeper, GenUndead, GiantBat, GiantScorpion, Gnoll, Goat, GoatDoe, Goblin, GoldDragon, Gorilla, GreenDragon, Hawk, HeavenlyServent, HillGiant, Hornet, Horse, InvisibleStalker, Jaguar, Kitten, LargeBat, Lion, Lizard, LizardMan, LizardManShaman, Minotaur, Monkey, MountainLion, Mouse, Naga, Ogre, Orc, Owl, Panther, Parakeet, Pegasus, PegasusGreater, Penguin, Pig, Puppy, Python, Rabbit, Rat, Rattlesnake, Raven, RedDragon, Scorpion, Seal, Shark, Sheep, SilverDragon, Skeleton, Snake, Spider, Squirrel, StdAuctioneer, StdBanker, StdDeity, StdFactoryMOB, StdLibrarian, StdMOB, StdPostman, StdRideable, StdShopKeeper, StoneGiant, StoneGolem, Swordfish, Teacher, Tiger, Toad, Troll, Turtle, UmberHulk, Undead, Vulture, Walrus, Whale, WhiteBear, WhiteDragon, WildEagle, Wolf, Wolverine, Worm, Wyvern, Zombie

public interface MOB
extends Rider, DBIdentifiable, PhysicalAgent, ItemPossessor, AbilityContainer, Tattooable, FactionMember, MUDCmdProcessor, Followable<MOB>, Combatant

A MOB is a creature in the system, from a user down to a goblin.


Nested Class Summary
static class MOB.Attrib
          Enum for the MOB Attributes, which will also return whether the attribute is intuitively reversed (so Setting turns it off instead of on) and a longer description string.
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
 
Field Summary
static long AGE_MILLIS_THRESHOLD
           
static long END_SHEATH_TIME
          The number of ticks out of combat this mob will try to sheath their weapon, assuming the appropriate attribute is set.
static long START_SHEATH_TIME
          The number of ticks out of combat this mob should be before trying to sheath their weapon, assuming the appropriate attribute is set.
 
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
 
Method Summary
 void addExpertise(java.lang.String code)
          Adds a new expertise, or updates an existing one.
 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.
 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.
 CharStats baseCharStats()
          Gets the Base CharStats object for this mob, which are the stats like saves and strength.
 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.
 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.
 CharStats charStats()
          Gets the Current CharStats object for this mob, which are the stats like saves and strength.
 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.
 CharState curState()
          Gets the Current CharState object for this mob, which are the temp stats like health and mana.
 void delAllExpertises()
          Deletes all expertises from the collection
 void delExpertise(java.lang.String baseCode)
          Deletes an expertise.
 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.
 java.util.Enumeration<java.lang.String> expertises()
          Returns an enumerator of all the expertise names with their numbers if any .
 Pair<java.lang.String,java.lang.Integer> fetchExpertise(java.lang.String code)
          Returns the expertise and number for the given code.
 Item fetchFirstWornItem(long wornCode)
          Returns the first item encountered on this player/mob at the given worn code, or null if nothing found.
 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.
 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 name)
          Returns the best match ability/skill/spell of this mob to the given search name string.
 void flagVariableEq()
          Flags this mob as having their base inventory / shop inventory reconstructed from the database.
 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.
 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 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.
 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.
 Room getStartRoom()
          Gets the stored Start Room for this mob.
 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 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.
 boolean isAttributeSet(MOB.Attrib attrib)
          Returns whether the given attribute is set.
 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.
 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.
 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.
 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.
 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.
 CharState maxState()
          Gets the Max CharState object for this mob, which are the stats like health and mana.
 int numAllEffects()
          Returns the total number of effects this mob/player is under, including Racial and Clan effects.
 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.
 PlayerStats playerStats()
          Returns the PlayerStats object for this mob.
 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 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.
 Session session()
          Returns any Telnet Session object attached to this mob.
 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 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 setExperience(int newVal)
          Sets the total number of experience points earned by this mob.
 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 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 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 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 newRoom)
          Sets the stored Start Room for this mob.
 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.
 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 titledName()
          If this player is using a title, this method returns the players Name() with the title.
 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 interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.DBIdentifiable
canSaveDatabaseID, databaseID, setDatabaseID
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
addItem, moveItemTo, moveItemTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemCollection
addItem, delAllItems, delItem, eachItem, findItem, findItem, findItems, findItems, getItem, getRandomItem, isContent, items, numItems
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.AbilityContainer
abilities, addAbility, allAbilities, delAbility, delAllAbilities, fetchAbility, fetchAbility, fetchRandomAbility, numAbilities, numAllAbilities
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tattooable
addTattoo, addTattoo, addTattoo, delTattoo, delTattoo, findTattoo, findTattooStartsWith, tattoos
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.FactionMember
addFaction, adjustFaction, copyFactions, factions, fetchFaction, fetchFactionData, fetchFactionRanges, getFactionListing, hasFaction, removeFaction
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MUDCmdProcessor
actions, clearCommandQueue, commandQueSize, dequeCommand, doCommand, enqueCommand, enqueCommands, prequeCommand, prequeCommands, setActions
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Followable
addFollower, amFollowing, amUltimatelyFollowing, delFollower, fetchFollower, fetchFollower, fetchFollowerOrder, followers, getGroupMembers, getGroupMembersAndRideables, isFollowedBy, numFollowers, setFollowing, totalFollowers
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Combatant
getCombatant, getDirectionToTarget, isInCombat, makePeace, mayIFight, mayPhysicallyAttack, rangeToTarget, setCombatant, setRangeToTarget
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 

Field Detail

AGE_MILLIS_THRESHOLD

static final long AGE_MILLIS_THRESHOLD
See Also:
Constant Field Values

START_SHEATH_TIME

static final long START_SHEATH_TIME
The number of ticks out of combat this mob should be before trying to sheath their weapon, assuming the appropriate attribute is set.


END_SHEATH_TIME

static final long END_SHEATH_TIME
The number of ticks out of combat this mob will try to sheath their weapon, assuming the appropriate attribute is set.

Method Detail

getAttributesBitmap

int getAttributesBitmap()
Returns the raw numeric attributes bitmap

Returns:
the raw numeric attributes bitmap
See Also:
MOB.Attrib, setAttributesBitmap(int)

setAttributesBitmap

void setAttributesBitmap(int bitmap)
Sets the raw numeric attributes bitmap

Parameters:
bitmap - the raw numeric attributes bitmap
See Also:
MOB.Attrib, getAttributesBitmap()

setAttribute

void setAttribute(MOB.Attrib attrib,
                  boolean set)
Changes the value of a specific attribute

Parameters:
attrib - the attribute to set or clear
set - true to set it, false to clear it
See Also:
isAttributeSet(Attrib)

isAttributeSet

boolean isAttributeSet(MOB.Attrib attrib)
Returns whether the given attribute is set.

Parameters:
attrib - the attribute to check
Returns:
true if it is set, false otherwise
See Also:
setAttribute(Attrib, boolean)

titledName

java.lang.String titledName()
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().

Returns:
the name with a title, or not
See Also:
Environmental.Name(), Tickable.name()

genericName

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.

Returns:
the age-range and race of this mob

isPlayer

boolean isPlayer()
Returns whether this mob represents a player. It basically checks for a PlayerStats object.

Returns:
whether this mob represents a player
See Also:
isMonster(), playerStats()

playerStats

PlayerStats playerStats()
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.

Returns:
the PlayerStats object or NULL for an NPC
See Also:
setPlayerStats(PlayerStats), PlayerStats

setPlayerStats

void setPlayerStats(PlayerStats newStats)
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.

Parameters:
newStats - the PlayerStats object or null for an NPC
See Also:
playerStats(), PlayerStats

baseCharStats

CharStats baseCharStats()
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.

Returns:
the CharStats object for this mob
See Also:
charStats(), recoverCharStats(), setBaseCharStats(CharStats)

charStats

CharStats charStats()
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.

Returns:
the CharStats object for this mob
See Also:
baseCharStats(), recoverCharStats(), setBaseCharStats(CharStats)

recoverCharStats

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.

See Also:
baseCharStats(), charStats(), setBaseCharStats(CharStats)

setBaseCharStats

void setBaseCharStats(CharStats newBaseCharStats)
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.

Parameters:
newBaseCharStats - the CharStats object for this mob
See Also:
charStats(), baseCharStats(), setBaseCharStats(CharStats)

maxCarry

int maxCarry()
Returns the maximum total weight in pounds that this mob can carry.

Returns:
the maximum total weight in pounds that this mob can carry.
See Also:
maxItems()

maxItems

int maxItems()
Returns the maximum total number of items that this mob can carry.

Returns:
the maximum total number of items that this mob can carry.
See Also:
maxCarry()

baseWeight

int baseWeight()
Returns the base weight of this mob, which includes any char stat adjustments, and adjustments from race.

Returns:
the base weight of this mob

healthText

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

Parameters:
viewer - the mob viewing this mob
Returns:
the friendly viewable health status string

amDead

boolean amDead()
Returns whether this mob is dead and presumably waiting for rejuv.

Returns:
true if this mob is dead, false otherwise
See Also:
killMeDead(boolean), bringToLife(Room, boolean), removeFromGame(boolean, boolean)

killMeDead

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.

Parameters:
createBody - true to create a corpse, false otherwise
Returns:
the corpse, if one was created
See Also:
amDead(), bringToLife(Room, boolean), removeFromGame(boolean, boolean)

bringToLife

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. This also calls bringToLife to start ticking.

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

bringToLife

void bringToLife()
Flags this mob as being alive, and restarts the mob tick.

See Also:
bringToLife(Room, boolean), killMeDead(boolean), removeFromGame(boolean, boolean)

removeFromGame

void removeFromGame(boolean preserveFollowers,
                    boolean killSession)
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.

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

amActive

boolean amActive()
Returns whether this mob has been removed from the game. It only checks the flag set by removeFromGame.

Returns:
true if the removeFromGame flag is set, false otherwise
See Also:
bringToLife(Room, boolean), killMeDead(boolean), removeFromGame(boolean, boolean)

getVictim

MOB getVictim()
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.

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

setVictim

void setVictim(MOB other)
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.

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

tell

void tell(MOB source,
          Environmental target,
          Environmental tool,
          java.lang.String msg)
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.

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:
tell(String)

tell

void tell(java.lang.String msg)
Basic communication to a session attached to this mob, if any.

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

session

Session session()
Returns any Telnet Session object attached to this mob. Without one, this mob has nowhere to send messages, or receive input from a keyboard

Returns:
the Telnet Session attached to this mob
See Also:
setSession(Session), isMonster(), isPossessing(), soulMate()

setSession

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

Parameters:
newSession - the Telnet Session attached to this mob
See Also:
session(), isMonster(), isPossessing(), soulMate()

isMonster

boolean isMonster()
Returns whether this mob has a real telnet session attached to it.

Returns:
true if there is a session attached, false otherwise
See Also:
session(), setSession(Session), isPossessing(), soulMate()

isPossessing

boolean isPossessing()
Returns whether this mob base session is possessing some other mob. It says more about the session than the mob.

Returns:
true if this mobs session is possessing another mob
See Also:
session(), setSession(Session), soulMate(), dispossess(boolean)

soulMate

MOB soulMate()
Returns the player mob that is possessing this mob by loaning it its session.

Returns:
the mob that is possessing this mob
See Also:
session(), isPossessing(), setSoulMate(MOB), dispossess(boolean)

setSoulMate

void setSoulMate(MOB mob)
Sets the player mob that is possessing this mob by loaning it its session.

Parameters:
mob - the mob that is possessing this mob
See Also:
session(), isPossessing(), soulMate(), dispossess(boolean)

dispossess

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.

Parameters:
forceLook - true to force the player to Look afterwards
See Also:
session(), isPossessing(), soulMate(), setSoulMate(MOB)

getExperience

int getExperience()
Returns the total number of experience points earned by this mob.

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

setExperience

void setExperience(int newVal)
Sets the total number of experience points earned by this mob.

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

getPeaceTime

long getPeaceTime()
Returns the number of ms (in tick increments) that this mob has NOT been in combat.

Returns:
the ms of peace enjoyed by this mob.

getExpNextLevel

int getExpNextLevel()
Gets the total number of experience points this mob needs to earn their next level.

Returns:
total xp to next level
See Also:
getExperience(), setExperience(int), getExpNeededDelevel(), getExpNeededLevel(), getExpPrevLevel()

getExpNeededLevel

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

Returns:
how much more xp needed
See Also:
getExperience(), getExpNextLevel(), getExpNeededDelevel(), setExperience(int), getExpPrevLevel()

getExpNeededDelevel

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. It returns 0 at first level, since a first level character cannot de-level.

Returns:
how much more xp gained
See Also:
getExperience(), getExpNextLevel(), setExperience(int), getExpNeededLevel(), getExpPrevLevel()

getExpPrevLevel

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.

Returns:
the experience point level baseline

getAgeMinutes

long getAgeMinutes()
Returns the total number of rl minutes this player has ever played.

Returns:
the total number of rl minutes this player has ever played.
See Also:
setAgeMinutes(long)

setAgeMinutes

void setAgeMinutes(long newVal)
Returns the total number of rl minutes this player has ever played.

Parameters:
newVal - the total number of rl minutes this player has ever played.
See Also:
getAgeMinutes()

getPractices

int getPractices()
Returns the number of practice points this mob has

Returns:
the number of practice points this mob has
See Also:
setPractices(int)

setPractices

void setPractices(int newVal)
Sets the number of practice points this mob has

Parameters:
newVal - the number of practice points this mob has
See Also:
getPractices()

getTrains

int getTrains()
Returns the number of training points this mob has

Returns:
the number of training points this mob has
See Also:
setTrains(int)

setTrains

void setTrains(int newVal)
Sets the number of training points this mob has

Parameters:
newVal - the number of training points this mob has
See Also:
getTrains()

getMoney

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

Returns:
the mob npc money
See Also:
setMoney(int), getMoneyVariation(), setMoneyVariation(double)

setMoney

void setMoney(int newVal)
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.

Parameters:
newVal - the mob npc money
See Also:
getMoney(), getMoneyVariation(), setMoneyVariation(double)

getMoneyVariation

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.

Returns:
the amount of money to vary for looting money
See Also:
getMoney(), setMoney(int), setMoneyVariation(double)

setMoneyVariation

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.

Parameters:
newVal - the amount of money to vary for looting money
See Also:
getMoney(), getMoneyVariation(), setMoneyVariation(double)

baseState

CharState baseState()
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.

Returns:
the base CharState object for this mob
See Also:
CharState, setBaseState(CharState), curState(), maxState(), recoverMaxState(), resetToMaxState()

setBaseState

void setBaseState(CharState newState)
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.

Parameters:
newState - the base CharState object for this mob
See Also:
CharState, baseState(), curState(), maxState(), recoverMaxState(), resetToMaxState()

curState

CharState curState()
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.

Returns:
the Current charState object for this mob
See Also:
CharState, setBaseState(CharState), baseState(), maxState(), recoverMaxState(), resetToMaxState()

maxState

CharState maxState()
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

Returns:
the base CharState object for this mob
See Also:
CharState, setBaseState(CharState), curState(), baseState(), recoverMaxState(), resetToMaxState()

recoverMaxState

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.

See Also:
setBaseState(CharState), curState(), baseState(), maxState(), resetToMaxState()

resetToMaxState

void resetToMaxState()
Causes this mob to copy the max state object to the current state object, effectively healing and rejuvinating the mob.

See Also:
setBaseState(CharState), curState(), baseState(), maxState(), recoverMaxState()

getNaturalWeapon

Weapon getNaturalWeapon()
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.

Returns:
the unarmed weapon

getLiegeID

java.lang.String getLiegeID()
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.

Returns:
the name of the player to which this mob owes loyalty
See Also:
setLiegeID(String), isMarriedToLiege()

setLiegeID

void setLiegeID(java.lang.String newVal)
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.

Parameters:
newVal - the name of the player to which this mob owes loyalty
See Also:
getLiegeID(), isMarriedToLiege()

isMarriedToLiege

boolean isMarriedToLiege()
Returns whether this mob/player is married to their liege, or whether they are a simple liege.

Returns:
true if they are married to liege, false if just a leige
See Also:
getLiegeID(), setLiegeID(String)

getWorshipCharID

java.lang.String getWorshipCharID()
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.

Returns:
the name of the Deity mob that this player/mob worships.
See Also:
setWorshipCharID(String), getMyDeity()

setWorshipCharID

void setWorshipCharID(java.lang.String newVal)
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.

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

getMyDeity

Deity getMyDeity()
Returns the Deity object of the mob that this player/mob worships. A null return means they are an atheist. Very important for Clerics.

Returns:
the Deity object of the mob that this player/mob worships
See Also:
getWorshipCharID(), setWorshipCharID(String)

getWimpHitPoint

int getWimpHitPoint()
Returns the number of hit points below which this mob will automatically flee combat.

Returns:
the wimpy hit point number
See Also:
setWimpHitPoint(int)

setWimpHitPoint

void setWimpHitPoint(int newVal)
Sets the number of hit points below which this mob will automatically flee combat.

Parameters:
newVal - the wimpy hit point number
See Also:
getWimpHitPoint()

getQuestPoint

int getQuestPoint()
Returns the number of quest points that this mob has earned.

Returns:
the number of quest points that this mob has earned.
See Also:
setQuestPoint(int)

setQuestPoint

void setQuestPoint(int newVal)
Sets the number of quest points that this mob has earned.

Parameters:
newVal - the number of quest points that this mob has earned.
See Also:
getQuestPoint()

lastTickedDateTime

long lastTickedDateTime()
Returns the precise time, in milliseconds, that this mob last "Ticked".

Returns:
the precise time, in milliseconds

clans

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.

Returns:
an iterable set of the Clans that this mob/player belongs
See Also:
setClan(String, int), getClanRole(String)

getClanRole

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. Otherwise it returns null

Parameters:
clanID - the clan name/id
Returns:
the Clan object + Rank, or null
See Also:
clans(), setClan(String, int)

setClan

void setClan(java.lang.String clanID,
             int role)
Adds or alters the rank of this player/mob in the given clan.

Parameters:
clanID - the clanID/name
role - the rank/role of this player in the clan
See Also:
clans(), getClanRole(String)

getStartRoom

Room getStartRoom()
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.

Returns:
the stored Start Room for this mob
See Also:
setStartRoom(Room)

setStartRoom

void setStartRoom(Room newRoom)
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.

Parameters:
newRoom - the stored Start Room for this mob
See Also:
getStartRoom()

location

Room location()
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.

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

setLocation

void setLocation(Room newRoom)
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.

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

flagVariableEq

void flagVariableEq()
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.


fetchItem

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

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, fetchWornItems(long, short, short), fetchWieldedItem()

fetchWornItems

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.

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, fetchItem(Item, Filterer, String), fetchWieldedItem(), fetchFirstWornItem(long)

fetchFirstWornItem

Item fetchFirstWornItem(long wornCode)
Returns the first item encountered on this player/mob at the given worn code, or null if nothing found.

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

fetchWieldedItem

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

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

fetchHeldItem

Item fetchHeldItem()
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.

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

hasOnlyGoldInInventory

boolean hasOnlyGoldInInventory()
Returns whether this mob is only carrying money, meaning their main inventory is essentially empty. Also returns true if they are broke.

Returns:
true if only money is being carried, or nothing.

freeWearPositions

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.

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, getWearPositions(long)

getWearPositions

int getWearPositions(long wornCode)
Returns the total number of worn locations this mob/player has at the given worn code location.

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

isMine

boolean isMine(Environmental env)
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.

Parameters:
env - the mob, item, or Ability to look for
Returns:
true if this is presently mine

numAllEffects

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

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

addPriorityEffect

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.

Parameters:
to - the Ability to add as an effect
See Also:
numAllEffects(), personalEffects(), Ability, Affectable.addEffect(Ability)

personalEffects

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.

Returns:
the enumeration of personal effect objects
See Also:
numAllEffects(), addPriorityEffect(Ability), Ability, Affectable.effects()

getRideBuddies

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.

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

willFollowOrdersOf

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.

Parameters:
mob - the mob to check to see if he's the leader
Returns:
true if you'll follow the mobs orders, false otherwise

maxFollowers

int maxFollowers()
Returns the maximum number of followers that this Followable can have.

Returns:
the maximum number of followers
See Also:
Followable

findAbility

Ability findAbility(java.lang.String name)
Returns the best match ability/skill/spell of this mob to the given search name string. This also searches racial and clan abilities.

Parameters:
name - the search string for the ability id, name, or whatever
Returns:
the best match ability/skill to the search string

getAbilityUsageCache

int[][] getAbilityUsageCache(java.lang.String abilityID)
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.

Parameters:
abilityID - the specific Ability ID() to get the cache for
Returns:
the ability usage cache array
See Also:
Ability.CACHEINDEX_TOTAL

isRacialAbility

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.

Parameters:
abilityID - the ability object to check for
Returns:
true if that object is racial, false otherwise

addExpertise

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

Parameters:
code - the expertise to add or update
See Also:
fetchExpertise(String), expertises(), delAllExpertises(), delExpertise(String)

delExpertise

void delExpertise(java.lang.String baseCode)
Deletes an expertise.

Parameters:
baseCode - the expertise code
See Also:
fetchExpertise(String), expertises(), delAllExpertises(), addExpertise(String)

fetchExpertise

Pair<java.lang.String,java.lang.Integer> fetchExpertise(java.lang.String code)
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.

Parameters:
code - the expertise code
Returns:
the entry with the string and number
See Also:
delAllExpertises(), expertises(), delExpertise(String), addExpertise(String)

delAllExpertises

void delAllExpertises()
Deletes all expertises from the collection

See Also:
fetchExpertise(String), expertises(), delExpertise(String), addExpertise(String)

expertises

java.util.Enumeration<java.lang.String> expertises()
Returns an enumerator of all the expertise names with their numbers if any .

Returns:
an enumerator
See Also:
delAllExpertises(), fetchExpertise(String), delExpertise(String), addExpertise(String)