Behavior
, ChattyBehavior
, CMObject
, Contingent
, Modifiable
, MsgListener
, Tickable
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
QuestChat
public class MudChat extends StdBehavior implements ChattyBehavior
Modifier and Type | Class | Description |
---|---|---|
protected static class |
MudChat.ChatExpConn |
Enum for connectors between matches/expressions
|
protected static class |
MudChat.ChatExpression |
A match expression, composed of one or more matches and expressions
|
protected static class |
MudChat.ChatMatch |
A specific string match, with modifiers
|
protected static class |
MudChat.ChatMatchFlag |
Flag for how to compare a match string with the user string
|
protected static class |
MudChat.ChatMatchType |
Enum for different match types
|
protected static class |
MudChat.ChattyEntry |
A chatty entry embodies a test for a particular environmental event, such as
someone speaking or acting, and all possible responses to that event.
|
protected static class |
MudChat.ChattyGroup |
A chatty group is a collection of particular environmental event tests, and
their possible responses.
|
protected static class |
MudChat.ChattyResponse |
A response object representing something the chatty-one will
definitely be saying soon.
|
protected static class |
MudChat.ChattyTestResponse |
A test response is a possible response to an environmental event, such as
someone speaking or acting.
|
Modifier and Type | Field | Description |
---|---|---|
protected MudChat.ChattyEntry[] |
addedChatEntries |
|
protected MOB |
lastReactedTo |
|
protected MOB |
lastRespondedTo |
|
protected java.lang.String |
lastThingSaid |
|
protected MudChat.ChattyGroup |
myChatGroup |
|
protected java.lang.String |
myOldName |
|
protected static int |
RESPONSE_DELAY |
|
protected SLinkedList<MudChat.ChattyResponse> |
responseQue |
|
protected ScriptingEngine |
scriptEngine |
|
protected static int |
TALK_WAIT_DELAY |
|
protected int |
talkDown |
|
protected int |
tickDown |
CAN_AREAS, CAN_EXITS, CAN_ITEMS, CAN_MOBS, CAN_ROOMS, FLAG_LEGALBEHAVIOR, FLAG_MOBILITY, FLAG_POTENTIALLYAGGRESSIVE, FLAG_POTENTIALLYAUTODEATHING, FLAG_TROUBLEMAKING
idConverter
CODES, isSavableBehavior, parms
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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, 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_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
MudChat() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
accountForYourself() |
Returns a string describing what this behavior does.
|
protected void |
addChatEntries(java.lang.String addParms) |
|
void |
executeMsg(Environmental affecting,
CMMsg msg) |
The general message event handler for the object.
|
java.util.List<java.lang.String> |
externalFiles() |
Returns a string list of any external files which
may be required to make this ability work.
|
protected static MudChat.ChattyGroup[] |
getChatGroups(java.lang.String parms) |
|
MOB |
getLastRespondedTo() |
Returns the last MOB object spoken to.
|
java.lang.String |
getLastThingSaid() |
Returns the last thing actually spoken by the wielder of this
behavior, or null if nothing has been said yet.
|
protected MudChat.ChattyGroup |
getMyBaseChatGroup(MOB forMe,
MudChat.ChattyGroup[] chatGroups) |
|
protected MudChat.ChattyGroup |
getMyChatGroup(MOB forMe,
MudChat.ChattyGroup[] chatGroups) |
|
protected static Pair<MudChat.ChatMatchType,java.lang.Character> |
getTypeAndCloser(char openChar) |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
protected boolean |
isExpressionStart(java.lang.String possExpression) |
|
protected static MudChat.ChattyGroup[] |
loadChatData(java.lang.String resourceName) |
|
protected boolean |
match(MOB speaker,
MudChat.ChatExpression expression,
int val) |
|
protected boolean |
match(MOB speaker,
MudChat.ChatExpression expression,
java.lang.String lowerStrNoPunc,
java.lang.String[] rest) |
|
protected boolean |
match(MOB speaker,
MudChat.ChatMatch match,
java.lang.String message,
java.lang.String[] rest) |
|
protected static MudChat.ChattyGroup |
matchChatGroup(MOB meM,
java.lang.String myName,
MudChat.ChattyGroup[] chatGroups) |
|
protected static MudChat.ChattyGroup |
newChattyGroup(java.lang.String name) |
|
static java.lang.String |
nextLine(java.lang.StringBuffer tsc) |
|
protected static MudChat.ChattyGroup[] |
parseChatData(java.lang.StringBuffer rsc) |
|
protected static MudChat.ChatExpression |
parseExpression(java.lang.String expression) |
|
protected void |
queResponse(java.util.List<Pair<MudChat.ChattyTestResponse,java.lang.String>> responses,
MOB source,
MOB target) |
|
void |
setParms(java.lang.String newParms) |
Sets the raw parameter string for this behavior.
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
protected static MudChat.ChattyGroup[] |
unprotectedChatGroupLoad(java.lang.String parms) |
canImprove, canImprove, endBehavior, flags, getParms, grantsAggressivenessTo, parmsFormat, registerDefaultQuest, setSavable, startBehavior
copyOf, initializeClass, newInstance
amDestroyed, destroy, isSavable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
okMessage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
amDestroyed, canActAtAll, canFreelyBehaveNormal, canImprove, canImprove, canImproveCode, compareTo, copyOf, destroy, endBehavior, flags, getBehaversMOB, getBehaversRoom, getCodeNum, getInternalCodeNum, getParms, getSaveStatIndex, getStat, getStatCodes, getTickStatus, grantsAggressivenessTo, I, initializeClass, isSavable, isStat, L, name, newInstance, okMessage, parmsFormat, registerDefaultQuest, sameAs, setSavable, setStat, startBehavior
getTickStatus, name
protected MudChat.ChattyGroup myChatGroup
protected java.lang.String myOldName
protected MudChat.ChattyEntry[] addedChatEntries
protected MOB lastReactedTo
protected MOB lastRespondedTo
protected java.lang.String lastThingSaid
protected int tickDown
protected int talkDown
protected SLinkedList<MudChat.ChattyResponse> responseQue
protected ScriptingEngine scriptEngine
protected static final int RESPONSE_DELAY
protected static final int TALK_WAIT_DELAY
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdBehavior
public java.lang.String accountForYourself()
Behavior
accountForYourself
in interface Behavior
accountForYourself
in class StdBehavior
protected void addChatEntries(java.lang.String addParms)
public void setParms(java.lang.String newParms)
Behavior
setParms
in interface Behavior
setParms
in class StdBehavior
newParms
- the parameter string for this behaviorBehavior.getParms()
public java.lang.String getLastThingSaid()
ChattyBehavior
getLastThingSaid
in interface ChattyBehavior
public MOB getLastRespondedTo()
ChattyBehavior
getLastRespondedTo
in interface ChattyBehavior
protected static MudChat.ChattyGroup newChattyGroup(java.lang.String name)
protected static MudChat.ChattyGroup[] getChatGroups(java.lang.String parms)
protected static MudChat.ChattyGroup[] unprotectedChatGroupLoad(java.lang.String parms)
public java.util.List<java.lang.String> externalFiles()
Behavior
externalFiles
in interface Behavior
externalFiles
in class StdBehavior
Behavior.setParms(String)
protected static MudChat.ChattyGroup[] parseChatData(java.lang.StringBuffer rsc)
protected static MudChat.ChattyGroup[] loadChatData(java.lang.String resourceName)
public static java.lang.String nextLine(java.lang.StringBuffer tsc)
protected static MudChat.ChattyGroup matchChatGroup(MOB meM, java.lang.String myName, MudChat.ChattyGroup[] chatGroups)
protected MudChat.ChattyGroup getMyBaseChatGroup(MOB forMe, MudChat.ChattyGroup[] chatGroups)
protected MudChat.ChattyGroup getMyChatGroup(MOB forMe, MudChat.ChattyGroup[] chatGroups)
protected void queResponse(java.util.List<Pair<MudChat.ChattyTestResponse,java.lang.String>> responses, MOB source, MOB target)
protected boolean isExpressionStart(java.lang.String possExpression)
protected static Pair<MudChat.ChatMatchType,java.lang.Character> getTypeAndCloser(char openChar)
protected static MudChat.ChatExpression parseExpression(java.lang.String expression) throws CMException
CMException
protected boolean match(MOB speaker, MudChat.ChatMatch match, java.lang.String message, java.lang.String[] rest)
protected boolean match(MOB speaker, MudChat.ChatExpression expression, int val)
protected boolean match(MOB speaker, MudChat.ChatExpression expression, java.lang.String lowerStrNoPunc, java.lang.String[] rest)
public void executeMsg(Environmental affecting, CMMsg msg)
MsgListener
executeMsg
in interface MsgListener
executeMsg
in class StdBehavior
affecting
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that needs to be executedCMMsg
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdBehavior
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup