com.planet_ink.coffee_mud.Libraries
Class CommonMsgs

java.lang.Object
  extended by com.planet_ink.coffee_mud.Libraries.StdLibrary
      extended by com.planet_ink.coffee_mud.Libraries.CommonMsgs
All Implemented Interfaces:
CMObject, Tickable, CMLibrary, CommonCommands, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class CommonMsgs
extends StdLibrary
implements CommonCommands


Field Summary
protected  Ability awarenessA
           
protected  java.util.List<java.lang.ref.WeakReference<MsgMonitor>> globalMonitors
           
protected static int LOOK_BRIEFOK
           
protected static int LOOK_LONG
           
protected static int LOOK_NORMAL
           
 MOB nonClanTalker
           
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
CommonMsgs()
           
 
Method Summary
 void addGlobalMonitor(MsgMonitor M)
           
 void delGlobalMonitor(MsgMonitor M)
           
protected  java.lang.String dispossessionTimeLeftString(Item item)
           
 java.lang.Object forceInternalCommand(MOB mob, java.lang.String command, java.lang.Object... parms)
           
 boolean forceStandardCommand(MOB mob, java.lang.String command, java.util.List<java.lang.String> parms)
           
 java.lang.StringBuilder getEquipment(MOB viewer, MOB mob)
           
 java.lang.String getExamineItemString(MOB mob, Item item)
           
 java.lang.StringBuilder getInventory(MOB viewer, MOB mob)
           
 java.lang.StringBuilder getScore(MOB mob)
           
protected  void gmcpSaySend(java.lang.String sayName, MOB mob, MOB target, CMMsg msg)
           
 void handleBeingDropped(CMMsg msg)
           
protected  void handleBeingExitLookedAt(CMMsg msg)
           
 void handleBeingGetted(CMMsg msg)
           
 void handleBeingGivenTo(CMMsg msg)
           
 void handleBeingHeld(CMMsg msg)
           
protected  void handleBeingItemLookedAt(CMMsg msg)
           
protected  void handleBeingItemSniffed(CMMsg msg)
           
 void handleBeingLookedAt(CMMsg msg)
           
protected  void handleBeingMobLookedAt(CMMsg msg)
           
 void handleBeingMobSniffed(CMMsg msg)
           
 void handleBeingRead(CMMsg msg)
           
 void handleBeingRemoved(CMMsg msg)
           
protected  void handleBeingRoomLookedAt(CMMsg msg)
           
protected  void handleBeingRoomSniffed(CMMsg msg)
           
 void handleBeingSniffed(CMMsg msg)
           
 void handleBeingSpokenTo(MOB speaker, MOB me, java.lang.String msg)
           
 void handleBeingWielded(CMMsg msg)
           
 void handleBeingWorn(CMMsg msg)
           
 void handleComeToLife(MOB mob, CMMsg msg)
           
 boolean handleCommandFail(MOB mob, Environmental target, Environmental tools, java.util.List<java.lang.String> command, java.lang.String msgStr)
           
 boolean handleCommandFail(MOB mob, java.util.List<java.lang.String> commands, java.lang.String msgStr)
           
 void handleHygienicMessage(CMMsg msg, int minHygiene, long adjHygiene)
           
 void handleIntroductions(MOB speaker, MOB me, java.lang.String msg)
           
 void handleObserveComesToLife(MOB observer, MOB lifer, CMMsg msg)
           
 void handleRecall(CMMsg msg)
           
 void handleSit(CMMsg msg)
           
 void handleSleep(CMMsg msg)
           
 void handleStand(CMMsg msg)
           
 boolean handleUnknownCommand(MOB mob, java.util.List<java.lang.String> command)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isHygienicMessage(CMMsg msg, int minHygiene, long adjHygiene)
           
 void lookAtExits(Room room, MOB mob)
           
 void lookAtExitsShort(Room room, MOB mob)
           
 java.lang.String makeContainerTypes(Container E)
           
 void monitorGlobalMessage(Room room, CMMsg msg)
           
 void postChannel(MOB mob, java.lang.String channelName, java.lang.String message, boolean systemMsg)
           
 void postChannel(java.lang.String channelName, java.lang.Iterable<Pair<Clan,java.lang.Integer>> clanList, java.lang.String message, boolean systemMsg)
           
 boolean postCommandFail(MOB mob, Environmental target, Environmental tools, java.util.List<java.lang.String> command, java.lang.String msgStr)
           
 boolean postCommandFail(MOB mob, java.util.List<java.lang.String> commands, java.lang.String msgStr)
           
 boolean postCommandRejection(MOB mob, Environmental target, Environmental tools, java.util.List<java.lang.String> command)
           
 boolean postCommandRejection(MOB mob, java.util.List<java.lang.String> commands)
           
 void postDraw(MOB mob, boolean doHold, boolean ifNecessary)
           
 boolean postDrop(MOB mob, Environmental dropThis, boolean quiet, boolean optimized, boolean intermediate)
           
 void postFlee(MOB mob, java.lang.String whereTo)
           
 void postFollow(MOB follower, MOB leader, boolean quiet)
           
 boolean postGet(MOB mob, Item container, Item getThis, boolean quiet)
           
 boolean postGive(MOB mob, MOB targetM, Item giveThis, boolean quiet)
           
 void postLook(MOB mob, boolean quiet)
           
 boolean postOpen(MOB mob, Environmental openThis, boolean quiet)
           
 boolean postPut(MOB mob, Item container, Item getThis, boolean quiet)
           
 void postRead(MOB mob, Physical target, java.lang.String readOff, boolean quiet)
           
 boolean postRemove(MOB mob, Item item, boolean quiet)
           
 void postSay(MOB mob, MOB target, java.lang.String text)
           
 void postSay(MOB mob, MOB target, java.lang.String text, boolean isPrivate, boolean tellFlag)
           
 void postSay(MOB mob, java.lang.String text)
           
 void postSheath(MOB mob, boolean ifPossible)
           
 void postSleep(MOB mob)
           
 void postStand(MOB mob, boolean ifNecessary, boolean quietly)
           
 boolean postWear(MOB mob, Item item, boolean quiet)
           
protected  java.lang.String relativeCharStatTest(CharStats C, MOB mob, java.lang.String weakword, java.lang.String strongword, int stat)
           
 void tickAging(MOB mob, long millisSinceLast)
          Adjusts the mobs age based on ellapsed time, and checks for age related diseases and wish someone a happy birthday.
 int tickManaConsumption(MOB mob, int manaConsumeCounter)
          An optional system that consumes mana based on effects cast by the player.
 java.lang.Object unforcedInternalCommand(MOB mob, java.lang.String command, java.lang.Object... parms)
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getServiceClient, L, propertiesLoaded, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

LOOK_LONG

protected static final int LOOK_LONG
See Also:
Constant Field Values

LOOK_NORMAL

protected static final int LOOK_NORMAL
See Also:
Constant Field Values

LOOK_BRIEFOK

protected static final int LOOK_BRIEFOK
See Also:
Constant Field Values

globalMonitors

protected final java.util.List<java.lang.ref.WeakReference<MsgMonitor>> globalMonitors

awarenessA

protected Ability awarenessA

nonClanTalker

public MOB nonClanTalker
Constructor Detail

CommonMsgs

public CommonMsgs()
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
Overrides:
ID in class StdLibrary
Returns:
the name of this class

handleUnknownCommand

public boolean handleUnknownCommand(MOB mob,
                                    java.util.List<java.lang.String> command)
Specified by:
handleUnknownCommand in interface CommonCommands

handleCommandFail

public boolean handleCommandFail(MOB mob,
                                 java.util.List<java.lang.String> commands,
                                 java.lang.String msgStr)

handleCommandFail

public boolean handleCommandFail(MOB mob,
                                 Environmental target,
                                 Environmental tools,
                                 java.util.List<java.lang.String> command,
                                 java.lang.String msgStr)

postCommandFail

public boolean postCommandFail(MOB mob,
                               java.util.List<java.lang.String> commands,
                               java.lang.String msgStr)
Specified by:
postCommandFail in interface CommonCommands

postCommandFail

public boolean postCommandFail(MOB mob,
                               Environmental target,
                               Environmental tools,
                               java.util.List<java.lang.String> command,
                               java.lang.String msgStr)
Specified by:
postCommandFail in interface CommonCommands

postCommandRejection

public boolean postCommandRejection(MOB mob,
                                    java.util.List<java.lang.String> commands)
Specified by:
postCommandRejection in interface CommonCommands

postCommandRejection

public boolean postCommandRejection(MOB mob,
                                    Environmental target,
                                    Environmental tools,
                                    java.util.List<java.lang.String> command)
Specified by:
postCommandRejection in interface CommonCommands

unforcedInternalCommand

public java.lang.Object unforcedInternalCommand(MOB mob,
                                                java.lang.String command,
                                                java.lang.Object... parms)
Specified by:
unforcedInternalCommand in interface CommonCommands

forceInternalCommand

public java.lang.Object forceInternalCommand(MOB mob,
                                             java.lang.String command,
                                             java.lang.Object... parms)
Specified by:
forceInternalCommand in interface CommonCommands

forceStandardCommand

public boolean forceStandardCommand(MOB mob,
                                    java.lang.String command,
                                    java.util.List<java.lang.String> parms)
Specified by:
forceStandardCommand in interface CommonCommands

monitorGlobalMessage

public void monitorGlobalMessage(Room room,
                                 CMMsg msg)
Specified by:
monitorGlobalMessage in interface CommonCommands

addGlobalMonitor

public void addGlobalMonitor(MsgMonitor M)
Specified by:
addGlobalMonitor in interface CommonCommands

delGlobalMonitor

public void delGlobalMonitor(MsgMonitor M)
Specified by:
delGlobalMonitor in interface CommonCommands

getScore

public java.lang.StringBuilder getScore(MOB mob)
Specified by:
getScore in interface CommonCommands

getEquipment

public java.lang.StringBuilder getEquipment(MOB viewer,
                                            MOB mob)
Specified by:
getEquipment in interface CommonCommands

getInventory

public java.lang.StringBuilder getInventory(MOB viewer,
                                            MOB mob)
Specified by:
getInventory in interface CommonCommands

postChannel

public void postChannel(MOB mob,
                        java.lang.String channelName,
                        java.lang.String message,
                        boolean systemMsg)
Specified by:
postChannel in interface CommonCommands

postChannel

public void postChannel(java.lang.String channelName,
                        java.lang.Iterable<Pair<Clan,java.lang.Integer>> clanList,
                        java.lang.String message,
                        boolean systemMsg)
Specified by:
postChannel in interface CommonCommands

postDrop

public boolean postDrop(MOB mob,
                        Environmental dropThis,
                        boolean quiet,
                        boolean optimized,
                        boolean intermediate)
Specified by:
postDrop in interface CommonCommands

postGive

public boolean postGive(MOB mob,
                        MOB targetM,
                        Item giveThis,
                        boolean quiet)
Specified by:
postGive in interface CommonCommands

postOpen

public boolean postOpen(MOB mob,
                        Environmental openThis,
                        boolean quiet)
Specified by:
postOpen in interface CommonCommands

postGet

public boolean postGet(MOB mob,
                       Item container,
                       Item getThis,
                       boolean quiet)
Specified by:
postGet in interface CommonCommands

postPut

public boolean postPut(MOB mob,
                       Item container,
                       Item getThis,
                       boolean quiet)
Specified by:
postPut in interface CommonCommands

postRemove

public boolean postRemove(MOB mob,
                          Item item,
                          boolean quiet)
Specified by:
postRemove in interface CommonCommands

postWear

public boolean postWear(MOB mob,
                        Item item,
                        boolean quiet)
Specified by:
postWear in interface CommonCommands

postLook

public void postLook(MOB mob,
                     boolean quiet)
Specified by:
postLook in interface CommonCommands

postRead

public void postRead(MOB mob,
                     Physical target,
                     java.lang.String readOff,
                     boolean quiet)
Specified by:
postRead in interface CommonCommands

postFlee

public void postFlee(MOB mob,
                     java.lang.String whereTo)
Specified by:
postFlee in interface CommonCommands

postSheath

public void postSheath(MOB mob,
                       boolean ifPossible)
Specified by:
postSheath in interface CommonCommands

postDraw

public void postDraw(MOB mob,
                     boolean doHold,
                     boolean ifNecessary)
Specified by:
postDraw in interface CommonCommands

postStand

public void postStand(MOB mob,
                      boolean ifNecessary,
                      boolean quietly)
Specified by:
postStand in interface CommonCommands

postSleep

public void postSleep(MOB mob)
Specified by:
postSleep in interface CommonCommands

postFollow

public void postFollow(MOB follower,
                       MOB leader,
                       boolean quiet)
Specified by:
postFollow in interface CommonCommands

postSay

public void postSay(MOB mob,
                    MOB target,
                    java.lang.String text)
Specified by:
postSay in interface CommonCommands

postSay

public void postSay(MOB mob,
                    java.lang.String text)
Specified by:
postSay in interface CommonCommands

postSay

public void postSay(MOB mob,
                    MOB target,
                    java.lang.String text,
                    boolean isPrivate,
                    boolean tellFlag)
Specified by:
postSay in interface CommonCommands

gmcpSaySend

protected void gmcpSaySend(java.lang.String sayName,
                           MOB mob,
                           MOB target,
                           CMMsg msg)

handleBeingSniffed

public void handleBeingSniffed(CMMsg msg)
Specified by:
handleBeingSniffed in interface CommonCommands

handleBeingMobSniffed

public void handleBeingMobSniffed(CMMsg msg)

handleObserveComesToLife

public void handleObserveComesToLife(MOB observer,
                                     MOB lifer,
                                     CMMsg msg)
Specified by:
handleObserveComesToLife in interface CommonCommands

handleComeToLife

public void handleComeToLife(MOB mob,
                             CMMsg msg)
Specified by:
handleComeToLife in interface CommonCommands

handleSit

public void handleSit(CMMsg msg)
Specified by:
handleSit in interface CommonCommands

handleSleep

public void handleSleep(CMMsg msg)
Specified by:
handleSleep in interface CommonCommands

handleStand

public void handleStand(CMMsg msg)
Specified by:
handleStand in interface CommonCommands

handleRecall

public void handleRecall(CMMsg msg)
Specified by:
handleRecall in interface CommonCommands

tickManaConsumption

public int tickManaConsumption(MOB mob,
                               int manaConsumeCounter)
Description copied from interface: CommonCommands
An optional system that consumes mana based on effects cast by the player.

Specified by:
tickManaConsumption in interface CommonCommands
Parameters:
mob - the mob to consume mana of.
manaConsumeCounter - internally manipulated counter
Returns:
remaining manaConsumeCounter

tickAging

public void tickAging(MOB mob,
                      long millisSinceLast)
Description copied from interface: CommonCommands
Adjusts the mobs age based on ellapsed time, and checks for age related diseases and wish someone a happy birthday.

Specified by:
tickAging in interface CommonCommands
Parameters:
mob - the mob to tick
millisSinceLast - the ellapsed time

relativeCharStatTest

protected java.lang.String relativeCharStatTest(CharStats C,
                                                MOB mob,
                                                java.lang.String weakword,
                                                java.lang.String strongword,
                                                int stat)

handleBeingLookedAt

public void handleBeingLookedAt(CMMsg msg)
Specified by:
handleBeingLookedAt in interface CommonCommands

makeContainerTypes

public java.lang.String makeContainerTypes(Container E)

getExamineItemString

public java.lang.String getExamineItemString(MOB mob,
                                             Item item)
Specified by:
getExamineItemString in interface CommonCommands

dispossessionTimeLeftString

protected java.lang.String dispossessionTimeLeftString(Item item)

handleBeingItemLookedAt

protected void handleBeingItemLookedAt(CMMsg msg)

handleBeingItemSniffed

protected void handleBeingItemSniffed(CMMsg msg)

handleIntroductions

public void handleIntroductions(MOB speaker,
                                MOB me,
                                java.lang.String msg)
Specified by:
handleIntroductions in interface CommonCommands

handleBeingSpokenTo

public void handleBeingSpokenTo(MOB speaker,
                                MOB me,
                                java.lang.String msg)
Specified by:
handleBeingSpokenTo in interface CommonCommands

handleBeingRoomSniffed

protected void handleBeingRoomSniffed(CMMsg msg)

handleBeingRoomLookedAt

protected void handleBeingRoomLookedAt(CMMsg msg)

isHygienicMessage

public boolean isHygienicMessage(CMMsg msg,
                                 int minHygiene,
                                 long adjHygiene)
Specified by:
isHygienicMessage in interface CommonCommands

handleHygienicMessage

public void handleHygienicMessage(CMMsg msg,
                                  int minHygiene,
                                  long adjHygiene)
Specified by:
handleHygienicMessage in interface CommonCommands

handleBeingExitLookedAt

protected void handleBeingExitLookedAt(CMMsg msg)

handleBeingMobLookedAt

protected void handleBeingMobLookedAt(CMMsg msg)

handleBeingGivenTo

public void handleBeingGivenTo(CMMsg msg)
Specified by:
handleBeingGivenTo in interface CommonCommands

handleBeingRead

public void handleBeingRead(CMMsg msg)
Specified by:
handleBeingRead in interface CommonCommands

handleBeingGetted

public void handleBeingGetted(CMMsg msg)
Specified by:
handleBeingGetted in interface CommonCommands

handleBeingDropped

public void handleBeingDropped(CMMsg msg)
Specified by:
handleBeingDropped in interface CommonCommands

handleBeingRemoved

public void handleBeingRemoved(CMMsg msg)
Specified by:
handleBeingRemoved in interface CommonCommands

handleBeingWorn

public void handleBeingWorn(CMMsg msg)
Specified by:
handleBeingWorn in interface CommonCommands

handleBeingWielded

public void handleBeingWielded(CMMsg msg)
Specified by:
handleBeingWielded in interface CommonCommands

handleBeingHeld

public void handleBeingHeld(CMMsg msg)
Specified by:
handleBeingHeld in interface CommonCommands

lookAtExits

public void lookAtExits(Room room,
                        MOB mob)
Specified by:
lookAtExits in interface CommonCommands

lookAtExitsShort

public void lookAtExitsShort(Room room,
                             MOB mob)
Specified by:
lookAtExitsShort in interface CommonCommands