CommonMsgs
public interface CommonCommands extends CMLibrary
Modifier and Type | Interface | Description |
---|---|---|
static class |
CommonCommands.LookView |
Enum for special mob room view settings, decoded from
player mob attributes.
|
idConverter
Modifier and Type | Method | Description |
---|---|---|
void |
addGlobalMonitor(MsgMonitor M) |
Adds a new listener to global messages.
|
void |
delGlobalMonitor(MsgMonitor M) |
Removes a listener to global messages.
|
java.lang.Object |
forceInternalCommand(MOB mob,
java.lang.String command,
java.lang.Object... parms) |
This method does a forced internal execute of a specific command with the
given parameters.
|
boolean |
forceStandardCommand(MOB mob,
java.lang.String command,
java.util.List<java.lang.String> parms) |
This method does a forced execution of a normal command using the
normal channels used by players.
|
java.lang.StringBuilder |
getEquipment(MOB viewer,
MOB mob) |
Builds a string list of the things the given mob is
wearing.
|
java.lang.StringBuilder |
getEquipmentLong(MOB viewer,
MOB mob) |
Builds a string list of the things the given mob is
wearing, in long view, which includes wear slots.
|
java.lang.String |
getExamineItemString(MOB mob,
Item item) |
This method builds a string of the things a mob knows about
an item from taking a good hard longlook at it.
|
java.lang.String |
getFullRoomView(MOB mob,
Room room,
CommonCommands.LookView lookCode,
boolean doMXP) |
Builds the complete room view for the given mob.
|
java.lang.StringBuilder |
getInventory(MOB viewer,
MOB mob) |
Builds a string list of the things the given viewer can
see in the given mobs inventory.
|
java.lang.StringBuilder |
getScore(MOB mob) |
Builds the standard SCORE command response.
|
void |
handleBeingDropped(CMMsg msg) |
Handler function for when a mob drops an item
|
void |
handleBeingGetted(CMMsg msg) |
Handler function for when a mob gets an item
|
void |
handleBeingGivenTo(CMMsg msg) |
Handler function for when a mob is given an item
by another mob.
|
void |
handleBeingHeld(CMMsg msg) |
Handler function for when a mob holds an item.
|
void |
handleBeingLookedAt(CMMsg msg) |
Handler function for when a mob looks at something, or
examines it closely.
|
void |
handleBeingRead(CMMsg msg) |
Handler function for when a mob reads something
|
void |
handleBeingRemoved(CMMsg msg) |
Handler function for when a mob removes an item
|
void |
handleBeingSniffed(CMMsg msg) |
Handler function for when a mob sniffs an item or
mob or room or something.
|
void |
handleBeingSpokenTo(MOB speaker,
MOB me,
java.lang.String msg) |
Handler function called when a mob is spoken to by another mob
with targeted speech.
|
void |
handleBeingWielded(CMMsg msg) |
Handler function for when a mob wields a weapon.
|
void |
handleBeingWorn(CMMsg msg) |
Handler function for when a mob wears an item
|
void |
handleComeToLife(MOB mob,
CMMsg msg) |
Handler function that is called when a mob enters the
game, either by logging in, or respawning, or remorting.
|
void |
handleHygienicMessage(CMMsg msg,
int minHygiene,
long adjHygiene) |
Handler function called when a mob does something that might affect their
hygiene, typically in a cleanly way.
|
void |
handleIntroductions(MOB speaker,
MOB me,
java.lang.String said) |
Handler function called when a mob is spoken to by another mob in
the same room, and the introduction system is enabled.
|
void |
handleObserveComesToLife(MOB observer,
MOB lifer,
CMMsg msg) |
Handler function that is called when a mob observes another mob enter the
game, either by logging in, or respawning, or remorting.
|
void |
handleRecall(CMMsg msg) |
Handler function for when a mob recalls back to their beacon room
|
void |
handleSit(CMMsg msg) |
Handler function for when a mob sits down
|
void |
handleSleep(CMMsg msg) |
Handler function for when a mob goes to sleep
|
void |
handleStand(CMMsg msg) |
Handler function for when a mob stands up
|
boolean |
handleUnknownCommand(MOB mob,
java.util.List<java.lang.String> command) |
Handler-like function that is called whenever the given mob
enters a command that cannot be resolved to an actual mud
command, social, or skill.
|
boolean |
isHygienicMessage(CMMsg msg) |
Returns true if the given message reflects something that would improve
someone's hygiene, such as washing.
|
void |
lookAtExits(Room room,
MOB mob) |
Constructs a full table of the exits for the given room
and sends them as a tell message to the given mob.
|
void |
lookAtExitsShort(Room room,
MOB mob) |
Constructs an abbreviated list of the exits for the given room
and sends them as a tell message to the given mob.
|
java.lang.String |
makeContainerTypes(Container E) |
This method builds a string of the things a container
can contain..
|
void |
monitorGlobalMessage(Room room,
CMMsg msg) |
When a message is generated and sent anywhere in the mud, this
method is called to allow any global followers to inspect the
message and possibly react.
|
java.lang.String |
parseVaries(MOB mob,
Area area,
Room room,
java.lang.String text) |
Parse variable display and description texts to generate
the dynamic text seen in some rooms.
|
void |
postChannel(MOB mob,
java.lang.String channelName,
java.lang.String message,
boolean systemMsg) |
Method to post a chat message onto a channel from a specific mob.
|
void |
postChannel(java.lang.String channelName,
java.lang.Iterable<Pair<Clan,java.lang.Integer>> clanList,
java.lang.String message,
boolean systemMsg) |
Method to post an informational, system-generated message to a channel.
|
boolean |
postCommandFail(MOB mob,
Environmental target,
Environmental tools,
java.util.List<java.lang.String> command,
java.lang.String msgStr) |
Method called by the system when certain (but not all -- maybe someday) commands
fail because of syntax or bad arguments.
|
boolean |
postCommandFail(MOB mob,
java.util.List<java.lang.String> commands,
java.lang.String msgStr) |
Method called by the system when certain (but not all -- maybe someday) commands
fail because of syntax or bad arguments.
|
boolean |
postCommandRejection(MOB mob,
Environmental target,
Environmental tools,
java.util.List<java.lang.String> command) |
Method called when certain (but not all -- maybe someday) commands fail because of
a message rejection specifically.
|
boolean |
postCommandRejection(MOB mob,
java.util.List<java.lang.String> commands) |
Method called by the system when certain (but not all -- maybe someday) commands
fail because of a message rejection specifically.
|
void |
postDraw(MOB mob,
boolean doHold,
boolean ifNecessary) |
Shortcut method for making a mob draw their first available weapon
from a sheath.
|
boolean |
postDrop(MOB mob,
Environmental dropThis,
boolean quiet,
boolean optimized,
boolean intermediate) |
Shortcut method to make a mob drop an item onto the room.
|
void |
postFlee(MOB mob,
java.lang.String whereTo) |
Shortcut method for making a mob panic and flee the room.
|
void |
postFollow(MOB follower,
MOB leader,
boolean quiet) |
Shortcut method for making one mob attempt to follow another.
|
boolean |
postGet(MOB mob,
Item container,
Item getThis,
boolean quiet) |
Shortcut method for making a mob get something from the room, or
from a container.
|
boolean |
postGive(MOB mob,
MOB targetM,
Item giveThis,
boolean quiet) |
Shortcut method to make one mob given an item to another
|
void |
postLook(MOB mob,
boolean quiet) |
Shortcut method for making a mob look around the room
|
boolean |
postOpen(MOB mob,
Environmental openThis,
boolean quiet) |
Shortcut method to make a mob try to open something
|
boolean |
postPut(MOB mob,
Item container,
Item getThis,
boolean quiet) |
Shortcut method for making a mob put an item into a container.
|
void |
postRead(MOB mob,
Physical target,
java.lang.String readOff,
boolean quiet) |
Shortcut method for making a mob read something.
|
boolean |
postRemove(MOB mob,
Item item,
boolean quiet) |
Shortcut method to make a mob remove an item and put it
into their inventory.
|
void |
postSay(MOB mob,
MOB target,
java.lang.String text) |
Shortcut method for forcing the given mob to do the command:
sayto [target] [text]
|
void |
postSay(MOB mob,
MOB target,
java.lang.String text,
boolean isPrivate,
boolean tellFlag) |
Shortcut method for forcing the given mob to do the command:
tell [target] [text] ...
|
void |
postSay(MOB mob,
java.lang.String text) |
Shortcut method for forcing the given mob to do the command:
say [text]
|
void |
postSheath(MOB mob,
boolean ifPossible) |
Shortcut method for making a mob sheath a weapon into
an available sheath.
|
void |
postSleep(MOB mob) |
Shortcut method for making a mob lay down and go to sleep
|
void |
postStand(MOB mob,
boolean ifNecessary,
boolean quietly) |
Shortcut method for making a mob stand up.
|
boolean |
postWear(MOB mob,
Item item,
boolean quiet) |
Shortcut method to make a mob attempt to wear an item.
|
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) |
This method does a normal internal execute of a specific command with the
given parameters.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
void addGlobalMonitor(MsgMonitor M)
M
- the monitor object to call backMsgMonitor
,
monitorGlobalMessage(Room, CMMsg)
,
delGlobalMonitor(MsgMonitor)
void delGlobalMonitor(MsgMonitor M)
M
- the monitor object to call backMsgMonitor
,
monitorGlobalMessage(Room, CMMsg)
,
addGlobalMonitor(MsgMonitor)
void monitorGlobalMessage(Room room, CMMsg msg)
room
- the room in which the event occurredmsg
- the message sent to that room.addGlobalMonitor(MsgMonitor)
,
delGlobalMonitor(MsgMonitor)
boolean forceStandardCommand(MOB mob, java.lang.String command, java.util.List<java.lang.String> parms)
mob
- the mob to execute the commandcommand
- the command ID() to executeparms
- the arguments to the command, including the command wordjava.lang.Object forceInternalCommand(MOB mob, java.lang.String command, java.lang.Object... parms)
mob
- the mob to execute the commandcommand
- the command class ID() to executeparms
- the parameters required by the commands internal execute methodunforcedInternalCommand(MOB, String, Object...)
,
forceStandardCommand(MOB, String, List)
java.lang.Object unforcedInternalCommand(MOB mob, java.lang.String command, java.lang.Object... parms)
mob
- the mob to execute the commandcommand
- the command class ID() to executeparms
- the parameters required by the commands internal execute methodforceInternalCommand(MOB, String, Object...)
,
forceStandardCommand(MOB, String, List)
boolean handleUnknownCommand(MOB mob, java.util.List<java.lang.String> command)
mob
- the player who entered the bad commandcommand
- the parsed command as entered.boolean postCommandFail(MOB mob, java.util.List<java.lang.String> commands, java.lang.String msgStr)
mob
- the mob who tried the commandcommands
- the command that was typed inmsgStr
- the message explaining the failure, using <S-NAME>, <T-NAME>, etc..boolean postCommandFail(MOB mob, Environmental target, Environmental tools, java.util.List<java.lang.String> command, java.lang.String msgStr)
mob
- the mob who tried the commandtarget
- the target of the command, if applicable and identifiedtools
- the tool used by the command, if applicable and identifiedcommand
- the command that was typed inmsgStr
- the message explaining the failure, using <S-NAME>, <T-NAME>, etc..boolean postCommandRejection(MOB mob, java.util.List<java.lang.String> commands)
mob
- the mob who did the commandcommands
- the command string enteredboolean postCommandRejection(MOB mob, Environmental target, Environmental tools, java.util.List<java.lang.String> command)
mob
- the mob who did the commandtarget
- the target of the command, if applicabletools
- a tool used by the command, if applicablecommand
- the command string enteredvoid postChannel(MOB mob, java.lang.String channelName, java.lang.String message, boolean systemMsg)
mob
- the mob to do the chattingchannelName
- the channel to chat onmessage
- the message to send to the channelsystemMsg
- true to format as a system message, false for a normal chat messagevoid postChannel(java.lang.String channelName, java.lang.Iterable<Pair<Clan,java.lang.Integer>> clanList, java.lang.String message, boolean systemMsg)
channelName
- the name of the channel to post the message toclanList
- null normally, or a list of clans for possible focusmessage
- the message to send to the channelsystemMsg
- true to format as a system message, false for a normal chat messageboolean postDrop(MOB mob, Environmental dropThis, boolean quiet, boolean optimized, boolean intermediate)
mob
- the mob to do the droppingdropThis
- the item to dropquiet
- true to do so without a visible room messageoptimized
- true if this is part of a mass-drop (no stat recalc)intermediate
- true if this is only the first part of a GIVEboolean postGive(MOB mob, MOB targetM, Item giveThis, boolean quiet)
mob
- the mob to do the givingtargetM
- the mob to do the receiving of the givinggiveThis
- the item to givequiet
- true to do so without a visible room messageboolean postOpen(MOB mob, Environmental openThis, boolean quiet)
mob
- the mob to do the openingopenThis
- the item or exit to openquiet
- true to do so without a visible room messageboolean postGet(MOB mob, Item container, Item getThis, boolean quiet)
mob
- the mob to do the gettingcontainer
- the items current container, or nullgetThis
- the item to getquiet
- true to do so without a visible messageboolean postPut(MOB mob, Item container, Item getThis, boolean quiet)
mob
- the mob to do the puttingcontainer
- the target container to put something intogetThis
- the item to put into the containerquiet
- true to do so without a visible room messageboolean postRemove(MOB mob, Item item, boolean quiet)
mob
- the mob to do the removingitem
- the item to be removedquiet
- true to do so without a visible messageboolean postWear(MOB mob, Item item, boolean quiet)
mob
- the mob to do the wearingitem
- the item to be wornquiet
- true to attempt without a visible messagevoid postLook(MOB mob, boolean quiet)
mob
- the mob to do the lookingquiet
- true to do so without a visible messagevoid postRead(MOB mob, Physical target, java.lang.String readOff, boolean quiet)
mob
- the mob to do the readingtarget
- the item to readreadOff
- read arguments, such as page or chapter number, or ""quiet
- true to do so without a room-visible messagevoid postFlee(MOB mob, java.lang.String whereTo)
mob
- the mob to fleewhereTo
- NOWHERE or a direction in which to flee, or "" to random choosevoid postSheath(MOB mob, boolean ifPossible)
mob
- the mob to sheath a weaponifPossible
- true to suppress errors or lack of weapon/sheathvoid postDraw(MOB mob, boolean doHold, boolean ifNecessary)
mob
- the mob to draw the weapondoHold
- true to off-hand the weapon, false for main-handifNecessary
- if true, only do so if not currently wieldingvoid postStand(MOB mob, boolean ifNecessary, boolean quietly)
mob
- the mob to standifNecessary
- true if they should attempt only if not standingquietly
- true to do so without a visible messagevoid postSleep(MOB mob)
mob
- the mob to sleepvoid postFollow(MOB follower, MOB leader, boolean quiet)
follower
- the mob to do the followingleader
- the mob to be followedquiet
- true to do so without a visible messagevoid postSay(MOB mob, MOB target, java.lang.String text, boolean isPrivate, boolean tellFlag)
mob
- the speakertarget
- the target of the telltext
- the message to sayisPrivate
- true to TELL or private SAYTO, false to public SAYTOtellFlag
- true to TELL, false to private SAYTOvoid postSay(MOB mob, MOB target, java.lang.String text)
mob
- the mob to do the commandtarget
- the target being spoken totext
- the text to sayvoid postSay(MOB mob, java.lang.String text)
mob
- the mob to do the commandtext
- the text to sayvoid lookAtExits(Room room, MOB mob)
room
- the room to find exits inmob
- the mob to tell about those exitslookAtExitsShort(Room, MOB)
void lookAtExitsShort(Room room, MOB mob)
room
- the room to find exits inmob
- the mob to tell about those exitslookAtExits(Room, MOB)
java.lang.String parseVaries(MOB mob, Area area, Room room, java.lang.String text)
mob
- the mob who is lookingarea
- the area containing the mobroom
- the room containing the mobtext
- the raw variable textvoid handleBeingLookedAt(CMMsg msg)
msg
- the looking or examining messagevoid handleBeingRead(CMMsg msg)
msg
- the reading messagevoid handleRecall(CMMsg msg)
msg
- the recall messagevoid handleSit(CMMsg msg)
msg
- the sitting messagevoid handleStand(CMMsg msg)
msg
- the standing messagevoid handleSleep(CMMsg msg)
msg
- the sleeping messagevoid handleBeingSniffed(CMMsg msg)
msg
- the item sniffing messagevoid handleBeingGivenTo(CMMsg msg)
msg
- the item giving messagevoid handleBeingGetted(CMMsg msg)
msg
- the item getting messagevoid handleBeingDropped(CMMsg msg)
msg
- the item removing messagevoid handleBeingRemoved(CMMsg msg)
msg
- the item removing messagevoid handleBeingWorn(CMMsg msg)
msg
- the item wearing messagevoid handleBeingWielded(CMMsg msg)
msg
- the item wielding messagevoid handleBeingHeld(CMMsg msg)
msg
- the item holding messagevoid handleHygienicMessage(CMMsg msg, int minHygiene, long adjHygiene)
msg
- the message that triggered the hygiene efectminHygiene
- the smallest hygiene amount to consider the mob cleanadjHygiene
- the amount by which to adjust hygiene, usually +void handleIntroductions(MOB speaker, MOB me, java.lang.String said)
speaker
- the mob speakingme
- the mob being spoken tosaid
- what the speaker saidvoid handleBeingSpokenTo(MOB speaker, MOB me, java.lang.String msg)
speaker
- the speaker mobme
- the mob being spoken tomsg
- the messagevoid handleComeToLife(MOB mob, CMMsg msg)
mob
- the player or npc coming to lifemsg
- the "come to life" messagevoid handleObserveComesToLife(MOB observer, MOB lifer, CMMsg msg)
observer
- the player or npc observing the life happeninglifer
- the player or npc coming to lifemsg
- the "come to life" messagejava.lang.StringBuilder getScore(MOB mob)
mob
- the mob whose score to getjava.lang.String getFullRoomView(MOB mob, Room room, CommonCommands.LookView lookCode, boolean doMXP)
mob
- the player to view the roomroom
- the room to be viewedlookCode
- the look view code for viewing optionsdoMXP
- true to add MXP where neededjava.lang.StringBuilder getEquipment(MOB viewer, MOB mob)
viewer
- the viewer of the worn stuffmob
- the mob wearing the stuffjava.lang.StringBuilder getEquipmentLong(MOB viewer, MOB mob)
viewer
- the viewer of the worn stuffmob
- the mob wearing the stuffjava.lang.StringBuilder getInventory(MOB viewer, MOB mob)
viewer
- the viewer of the inventorymob
- the mob whose inventory needs viewingjava.lang.String getExamineItemString(MOB mob, Item item)
mob
- the mob doing the lookingitem
- the item being looked atjava.lang.String makeContainerTypes(Container E)
E
- the container containing thingsboolean isHygienicMessage(CMMsg msg)
msg
- the message to examinevoid tickAging(MOB mob, long millisSinceLast)
mob
- the mob to tickmillisSinceLast
- the ellapsed timeint tickManaConsumption(MOB mob, int manaConsumeCounter)
mob
- the mob to consume mana of.manaConsumeCounter
- internally manipulated counter