|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.planet_ink.coffee_mud.Common.DefaultScriptingEngine
public class DefaultScriptingEngine
Nested Class Summary | |
---|---|
protected static class |
DefaultScriptingEngine.JScriptEvent
|
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.ScriptingEngine |
---|
ScriptingEngine.ScriptableResponse |
Field Summary | |
---|---|
protected Tickable |
altStatusTickable
|
protected boolean |
alwaysTriggers
|
protected MOB |
backupMOB
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
connH
|
protected boolean |
debugBadScripts
|
protected java.lang.String |
defaultQuestName
|
protected java.util.Map<java.lang.Integer,int[]> |
delayProgCounters
|
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
delayTargetTimes
|
protected static java.util.Vector<DVector> |
empty
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
funcH
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
gstatH
|
protected boolean |
isSavable
|
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
lastDayProgsDone
|
protected Room |
lastKnownLocation
|
protected Environmental |
lastLoaded
|
protected CMMsg |
lastMsg
|
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
lastTimeProgsDone
|
protected MOB |
lastToHurtMe
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
methH
|
protected java.lang.String |
myScript
|
protected boolean |
noDelay
|
protected java.util.Map<java.lang.Integer,java.lang.Long> |
noTrigger
|
protected java.util.List<DVector> |
oncesDone
|
protected static java.util.Map<java.lang.String,java.util.regex.Pattern> |
patterns
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
progH
|
protected java.util.List<ScriptingEngine.ScriptableResponse> |
que
|
protected java.util.concurrent.atomic.AtomicInteger |
recurseCounter
|
protected java.util.Set<java.lang.Integer> |
registeredEvents
|
protected Resources |
resources
|
protected boolean |
runInPassiveAreas
|
protected java.lang.String |
scope
|
protected java.lang.String |
scriptKey
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
signH
|
protected int |
tickStatus
|
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.ScriptingEngine |
---|
CONNECTOR_AND, CONNECTOR_ANDNOT, CONNECTOR_MAP, CONNECTOR_NOT, CONNECTOR_OR, CONNECTOR_ORNOT, CONNECTORS, DATETIME_ARGS, funcs, GSTATADD_CLAN, GSTATADD_CLANROLE, GSTATADD_DEITY, GSTATADD_STINK, GSTATCODES_ADDITIONAL, methods, progs, SIGN_EQGT, SIGN_EQLT, SIGN_EQUL, SIGN_GRAT, SIGN_GTEQ, SIGN_LEST, SIGN_LTEQ, SIGN_NTEQ, SIGNS, SPECIAL_9SHOPHASPRICE, SPECIAL_NUM_OBJECTS, SPECIAL_RANDANYONE, SPECIAL_RANDPC |
Constructor Summary | |
---|---|
DefaultScriptingEngine()
|
Method Summary | |
---|---|
protected void |
buildHashes()
|
protected boolean |
canTrigger(int triggerCode)
|
int |
compareTo(CMObject o)
|
CMObject |
copyOf()
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed. |
protected Quest |
defaultQuest()
|
java.lang.String |
defaultQuestName()
If this script is associated with a particular quest, this method is called to return that quest name. |
void |
dequeResponses()
Forces any queued event responses to be immediately executed. |
boolean |
endQuest(PhysicalAgent hostObj,
MOB mob,
java.lang.String quest)
Calling this method forces this script to look for a trigger dealing with the end of a quest (QUEST_TIME_PROG -1). |
void |
enqueResponse(PhysicalAgent host,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
DVector script,
int ticks,
java.lang.String msg,
java.lang.String[] triggerStr)
|
boolean |
eval(PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp,
java.lang.String[][] eval,
int startEval)
Evaluates a scripting function. |
java.lang.String |
execute(PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
DVector script,
java.lang.String msg,
java.lang.Object[] tmp)
Executes a script in response to an event The scripts are formatted as a 2 dimensional DVector with the first row being the trigger information. |
java.lang.String |
execute(PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
DVector script,
java.lang.String msg,
java.lang.Object[] tmp,
int startLine)
|
void |
executeMsg(Environmental host,
CMMsg msg)
The general message event handler for the object. |
java.util.List<java.lang.String> |
externalFiles()
If the script is a load command, this will return the list of loaded script files referenced by the load command |
protected Environmental |
findSomethingCalledThis(java.lang.String thisName,
MOB meMOB,
Room imHere,
java.util.List<Environmental> OBJS,
boolean mob)
|
java.lang.String |
functify(PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp,
java.lang.String evaluable)
Evaluates one of the boolean functions as a string variable expression, which gives different and informative results. |
protected java.util.List<PhysicalAgent> |
generateItemsFromFile(Environmental scripted,
java.lang.String filename,
java.lang.String tagName,
java.lang.String rest)
|
protected java.util.List<PhysicalAgent> |
generateMobsFromFile(Environmental scripted,
java.lang.String filename,
java.lang.String tagName,
java.lang.String rest)
|
protected PhysicalAgent |
getArgumentItem(java.lang.String str,
MOB source,
MOB monster,
PhysicalAgent scripted,
Environmental target,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp)
|
protected PhysicalAgent |
getArgumentMOB(java.lang.String str,
MOB source,
MOB monster,
Environmental target,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp)
|
protected java.lang.String |
getGStatValue(Environmental E,
java.lang.String arg2)
|
java.lang.String |
getLocalVarXML()
If the variable scope of this script is local, this will return all the variables and values defined as an xml document for easy storage. |
MOB |
getMakeMOB(Tickable ticking)
Creates a mob from the Tickable object sent, possibly saving it locally to this object for use later. |
protected MOB |
getRandAnyone(MOB monster,
java.lang.Object[] tmp,
Room room)
|
protected MOB |
getRandPC(MOB monster,
java.lang.Object[] tmp,
Room room)
|
protected Room |
getRoom(java.lang.String thisName,
Room imHere)
|
java.lang.String |
getScript()
Returns the script or load command(s). |
java.lang.String |
getScriptResourceKey()
Returns the hey used to cache the script or load commands in here. |
protected java.util.List<DVector> |
getScripts()
|
protected DVector |
getScriptVarSet(java.lang.String mobname,
java.lang.String varname)
|
protected java.lang.String |
getStatValue(Environmental E,
java.lang.String arg2)
|
int |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
protected int |
getTriggerCode(java.lang.String trigger,
java.lang.String[] ttrigger)
|
java.lang.String |
getVar(Environmental E,
java.lang.String rawHost,
java.lang.String var,
MOB source,
Environmental target,
PhysicalAgent scripted,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp)
|
java.lang.String |
getVar(Resources resources,
java.lang.String host,
java.lang.String var,
java.lang.String defaultVal)
|
java.lang.String |
getVar(java.lang.String host,
java.lang.String var)
Returns the value of one of the internal variables, determined by the scope of the script, the context of the variable, and the name of the variable. |
protected java.lang.String |
getVarHost(Environmental E,
java.lang.String rawHost,
MOB source,
Environmental target,
PhysicalAgent scripted,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp)
|
java.lang.String |
getVarScope()
Returns the scope of any variables defined within the script. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
protected java.lang.String[] |
insertStringArray(java.lang.String[] oldS,
java.lang.String[] inS,
int where)
|
boolean |
isFreeToBeTriggered(Tickable affecting)
|
boolean |
isSavable()
Returns whether this script is a temporary attributed of the scripted object, or a permanent on that should be saved with the object. |
boolean |
isVar(java.lang.String host,
java.lang.String var)
Returns whether an internal variables, determined by the scope of the script, the context of the variable, and the name of the variable, is defined. |
java.lang.String |
L(java.lang.String str,
java.lang.String... xs)
|
protected java.util.List<PhysicalAgent> |
loadItemsFromFile(Environmental scripted,
java.lang.String filename)
|
protected java.util.List<PhysicalAgent> |
loadMobsFromFile(Environmental scripted,
java.lang.String filename)
|
protected void |
logError(Environmental scripted,
java.lang.String cmdName,
java.lang.String errType,
java.lang.String errMsg)
|
protected boolean |
match(java.lang.String str,
java.lang.String patt)
|
java.lang.String |
name()
The displayable name of this object. |
CMObject |
newInstance()
Returns a new instance of this class. |
protected java.lang.Object[] |
newObjs()
|
boolean |
okMessage(Environmental host,
CMMsg msg)
The general message event previewer for the object. |
protected java.lang.String[] |
parseBits(DVector script,
int row,
java.lang.String instructions)
|
protected java.lang.String[] |
parseBits(java.lang.String[][] oldBits,
int start,
java.lang.String instructions)
|
protected java.lang.String[] |
parseBits(java.lang.String line,
java.lang.String instructions)
|
java.lang.String[] |
parseEval(java.lang.String evaluable)
Receives a string for evaluation by the eval function, and stores it as the first element in the given 2 dimensional string array. |
protected java.lang.String |
parseLoads(java.lang.String text,
int depth,
java.util.Vector<java.lang.String> filenames,
java.lang.StringBuffer nonFilenameScript)
|
protected java.util.Vector<DVector> |
parseScripts(java.lang.String text)
|
protected java.lang.String[] |
parseSpecial3PartEval(java.lang.String[][] eval,
int t)
|
void |
prequeResponse(PhysicalAgent host,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
DVector script,
int ticks,
java.lang.String msg)
|
void |
pushEvalBoolean(java.util.Vector<java.lang.Object> stack,
boolean trueFalse)
|
void |
registerDefaultQuest(java.lang.String qName)
If this script is associated with a particular quest, this method is called to register that quest name. |
void |
reset()
|
void |
setLocalVarXML(java.lang.String xml)
If the variable scope of this script is local, this will set all the variables and values defined from a passed in xml document. |
void |
setSavable(boolean truefalse)
Sets whether this script is a temporary attributed of the scripted object, or a permanent on that should be saved with the object. |
void |
setScript(java.lang.String newParms)
Sets the script or load command(s). |
protected void |
setShopPrice(ShopKeeper shopHere,
Environmental E,
java.lang.Object[] tmp)
|
void |
setVar(java.lang.String baseName,
java.lang.String key,
java.lang.String val)
Sets the value of one of the internal variables, determined by the scope of the script, the context of the variable, and the name of the variable. |
void |
setVarScope(java.lang.String newScope)
Sets the scope of any variables defined within the script. |
protected boolean |
simpleEval(Environmental scripted,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String cmp,
java.lang.String cmdName)
|
protected boolean |
simpleEvalStr(Environmental scripted,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String cmp,
java.lang.String cmdName)
|
protected boolean |
simpleExpressionEval(Environmental scripted,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String cmp,
java.lang.String cmdName)
|
protected java.lang.String |
standardTriggerCheck(DVector script,
java.lang.String[] t,
Environmental E)
|
protected static int |
stringContainsFunctionImpl(java.lang.String str1,
java.lang.String str2)
As the name implies, this is the implementation of the stringcontains mobprog function |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
java.lang.String |
varify(MOB source,
Environmental target,
PhysicalAgent scripted,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp,
java.lang.String varifyable)
Uses this scripting engines variable parsing system to replace any script variables $XXXX with their script determined values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.Map<java.lang.String,java.lang.Integer> funcH
protected static final java.util.Map<java.lang.String,java.lang.Integer> methH
protected static final java.util.Map<java.lang.String,java.lang.Integer> progH
protected static final java.util.Map<java.lang.String,java.lang.Integer> connH
protected static final java.util.Map<java.lang.String,java.lang.Integer> gstatH
protected static final java.util.Map<java.lang.String,java.lang.Integer> signH
protected static final java.util.Map<java.lang.String,java.util.regex.Pattern> patterns
protected boolean noDelay
protected java.lang.String scope
protected int tickStatus
protected boolean isSavable
protected boolean alwaysTriggers
protected MOB lastToHurtMe
protected Room lastKnownLocation
protected Tickable altStatusTickable
protected java.util.List<DVector> oncesDone
protected java.util.Map<java.lang.Integer,java.lang.Integer> delayTargetTimes
protected java.util.Map<java.lang.Integer,int[]> delayProgCounters
protected java.util.Map<java.lang.Integer,java.lang.Integer> lastTimeProgsDone
protected java.util.Map<java.lang.Integer,java.lang.Integer> lastDayProgsDone
protected java.util.Set<java.lang.Integer> registeredEvents
protected java.util.Map<java.lang.Integer,java.lang.Long> noTrigger
protected MOB backupMOB
protected CMMsg lastMsg
protected Resources resources
protected Environmental lastLoaded
protected java.lang.String myScript
protected java.lang.String defaultQuestName
protected java.lang.String scriptKey
protected boolean runInPassiveAreas
protected boolean debugBadScripts
protected java.util.List<ScriptingEngine.ScriptableResponse> que
protected final java.util.concurrent.atomic.AtomicInteger recurseCounter
protected static final java.util.Vector<DVector> empty
Constructor Detail |
---|
public DefaultScriptingEngine()
Method Detail |
---|
public java.lang.String ID()
CMObject
ID
in interface CMObject
public java.lang.String name()
CMObject
name
in interface CMObject
name
in interface Tickable
Environmental.Name()
public boolean isSavable()
ScriptingEngine
isSavable
in interface ScriptingEngine
ScriptingEngine.setSavable(boolean)
public void setSavable(boolean truefalse)
ScriptingEngine
setSavable
in interface ScriptingEngine
truefalse
- true if this script is a saveable attribute of the scripted objectScriptingEngine.isSavable()
public java.lang.String defaultQuestName()
ScriptingEngine
defaultQuestName
in interface ScriptingEngine
ScriptingEngine.registerDefaultQuest(String)
protected Quest defaultQuest()
public void setVarScope(java.lang.String newScope)
ScriptingEngine
setVarScope
in interface ScriptingEngine
newScope
- the scope of variablesScriptingEngine.getVarScope()
,
ScriptingEngine.getVar(String, String)
,
ScriptingEngine.getLocalVarXML()
public java.lang.String getVarScope()
ScriptingEngine
getVarScope
in interface ScriptingEngine
ScriptingEngine.setVarScope(String)
,
ScriptingEngine.setVar(String, String, String)
,
ScriptingEngine.setLocalVarXML(String)
protected java.lang.Object[] newObjs()
public java.lang.String getLocalVarXML()
ScriptingEngine
getLocalVarXML
in interface ScriptingEngine
ScriptingEngine.setVarScope(String)
,
ScriptingEngine.setVar(String, String, String)
,
ScriptingEngine.setLocalVarXML(String)
public void setLocalVarXML(java.lang.String xml)
ScriptingEngine
setLocalVarXML
in interface ScriptingEngine
xml
- the local variable values as xmlScriptingEngine.getVarScope()
,
ScriptingEngine.getVar(String, String)
,
ScriptingEngine.getLocalVarXML()
public int getTickStatus()
Tickable
getTickStatus
in interface Tickable
Tickable.tick(Tickable, int)
public void registerDefaultQuest(java.lang.String qName)
ScriptingEngine
registerDefaultQuest
in interface ScriptingEngine
qName
- the quest associated with this scriptScriptingEngine.defaultQuestName()
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public CMObject copyOf()
CMObject
copyOf
in interface CMObject
protected java.lang.String[] parseBits(DVector script, int row, java.lang.String instructions)
protected java.lang.String[] parseSpecial3PartEval(java.lang.String[][] eval, int t)
protected java.lang.String[] parseBits(java.lang.String line, java.lang.String instructions)
protected java.lang.String[] insertStringArray(java.lang.String[] oldS, java.lang.String[] inS, int where)
protected java.lang.String[] parseBits(java.lang.String[][] oldBits, int start, java.lang.String instructions)
public boolean endQuest(PhysicalAgent hostObj, MOB mob, java.lang.String quest)
ScriptingEngine
endQuest
in interface ScriptingEngine
hostObj
- the scripted objectmob
- a mob representation of the host objectquest
- the name of the quest being ended
public java.util.List<java.lang.String> externalFiles()
ScriptingEngine
externalFiles
in interface ScriptingEngine
ScriptingEngine.getScript()
,
ScriptingEngine.setScript(String)
protected java.lang.String getVarHost(Environmental E, java.lang.String rawHost, MOB source, Environmental target, PhysicalAgent scripted, MOB monster, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp)
public boolean isVar(java.lang.String host, java.lang.String var)
ScriptingEngine
isVar
in interface ScriptingEngine
host
- the context of the variable, usually a mob or object namevar
- the name of the variable
ScriptingEngine.setVarScope(String)
,
ScriptingEngine.getVarScope()
,
ScriptingEngine.getVar(String, String)
,
ScriptingEngine.setVar(String, String, String)
,
ScriptingEngine.getLocalVarXML()
,
ScriptingEngine.setLocalVarXML(String)
public java.lang.String getVar(Environmental E, java.lang.String rawHost, java.lang.String var, MOB source, Environmental target, PhysicalAgent scripted, MOB monster, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp)
public java.lang.String getVar(java.lang.String host, java.lang.String var)
ScriptingEngine
getVar
in interface ScriptingEngine
host
- the context of the variable, usually a mob or object namevar
- the name of the variable
ScriptingEngine.setVarScope(String)
,
ScriptingEngine.getVarScope()
,
ScriptingEngine.setVar(String, String, String)
,
ScriptingEngine.isVar(String, String)
,
ScriptingEngine.getLocalVarXML()
,
ScriptingEngine.setLocalVarXML(String)
public java.lang.String getVar(Resources resources, java.lang.String host, java.lang.String var, java.lang.String defaultVal)
public java.lang.String getScript()
ScriptingEngine
getScript
in interface ScriptingEngine
ScriptingEngine.setScript(String)
,
ScriptingEngine.externalFiles()
public void reset()
public void setScript(java.lang.String newParms)
ScriptingEngine
setScript
in interface ScriptingEngine
newParms
- the script or load command(s)ScriptingEngine.getScript()
,
ScriptingEngine.externalFiles()
public boolean isFreeToBeTriggered(Tickable affecting)
protected java.lang.String parseLoads(java.lang.String text, int depth, java.util.Vector<java.lang.String> filenames, java.lang.StringBuffer nonFilenameScript)
protected void buildHashes()
protected java.util.Vector<DVector> parseScripts(java.lang.String text)
protected Room getRoom(java.lang.String thisName, Room imHere)
protected void logError(Environmental scripted, java.lang.String cmdName, java.lang.String errType, java.lang.String errMsg)
protected boolean simpleEvalStr(Environmental scripted, java.lang.String arg1, java.lang.String arg2, java.lang.String cmp, java.lang.String cmdName)
protected boolean simpleEval(Environmental scripted, java.lang.String arg1, java.lang.String arg2, java.lang.String cmp, java.lang.String cmdName)
protected boolean simpleExpressionEval(Environmental scripted, java.lang.String arg1, java.lang.String arg2, java.lang.String cmp, java.lang.String cmdName)
protected java.util.List<PhysicalAgent> loadMobsFromFile(Environmental scripted, java.lang.String filename)
protected java.util.List<PhysicalAgent> generateMobsFromFile(Environmental scripted, java.lang.String filename, java.lang.String tagName, java.lang.String rest)
protected java.util.List<PhysicalAgent> loadItemsFromFile(Environmental scripted, java.lang.String filename)
protected java.util.List<PhysicalAgent> generateItemsFromFile(Environmental scripted, java.lang.String filename, java.lang.String tagName, java.lang.String rest)
protected Environmental findSomethingCalledThis(java.lang.String thisName, MOB meMOB, Room imHere, java.util.List<Environmental> OBJS, boolean mob)
protected PhysicalAgent getArgumentMOB(java.lang.String str, MOB source, MOB monster, Environmental target, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp)
protected PhysicalAgent getArgumentItem(java.lang.String str, MOB source, MOB monster, PhysicalAgent scripted, Environmental target, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp)
public java.lang.String varify(MOB source, Environmental target, PhysicalAgent scripted, MOB monster, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp, java.lang.String varifyable)
ScriptingEngine
varify
in interface ScriptingEngine
source
- the source of the eventtarget
- the target of the eventscripted
- the object that is scriptedmonster
- a mob representation of the scripted objectprimaryItem
- an item involved in the eventsecondaryItem
- a second item involved in the eventmsg
- a string message associated with the eventtmp
- miscellaneous local variablesvarifyable
- the string to parse
protected DVector getScriptVarSet(java.lang.String mobname, java.lang.String varname)
protected java.lang.String getStatValue(Environmental E, java.lang.String arg2)
protected java.lang.String getGStatValue(Environmental E, java.lang.String arg2)
public void setVar(java.lang.String baseName, java.lang.String key, java.lang.String val)
ScriptingEngine
setVar
in interface ScriptingEngine
baseName
- the context of the variable, usually a mob or object namekey
- the name of the variableval
- the value of the variableScriptingEngine.setVarScope(String)
,
ScriptingEngine.getVarScope()
,
ScriptingEngine.getVar(String, String)
,
ScriptingEngine.isVar(String, String)
,
ScriptingEngine.getLocalVarXML()
,
ScriptingEngine.setLocalVarXML(String)
public java.lang.String[] parseEval(java.lang.String evaluable) throws ScriptParseException
ScriptingEngine
parseEval
in interface ScriptingEngine
evaluable
- the eval expression
ScriptParseException
- a parse errorpublic void pushEvalBoolean(java.util.Vector<java.lang.Object> stack, boolean trueFalse)
protected static final int stringContainsFunctionImpl(java.lang.String str1, java.lang.String str2)
str1
- the string to search instr2
- the coded search expression
public boolean eval(PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp, java.lang.String[][] eval, int startEval)
ScriptingEngine
eval
in interface ScriptingEngine
scripted
- the object that is scriptedsource
- the source of the eventtarget
- the target of the eventmonster
- a mob representation of the scripted objectprimaryItem
- an item involved in the eventsecondaryItem
- a second item involved in the eventmsg
- a string message associated with the eventtmp
- miscellaneous local variableseval
- the pre-parsed expressionstartEval
- while line to start evaluating on.
protected void setShopPrice(ShopKeeper shopHere, Environmental E, java.lang.Object[] tmp)
public java.lang.String functify(PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp, java.lang.String evaluable)
ScriptingEngine
functify
in interface ScriptingEngine
scripted
- the object that is scriptedsource
- the source of the eventtarget
- the target of the eventmonster
- a mob representation of the scripted objectprimaryItem
- an item involved in the eventsecondaryItem
- a second item involved in the eventmsg
- a string message associated with the eventtmp
- miscellaneous local variablesevaluable
- the function expression
protected MOB getRandPC(MOB monster, java.lang.Object[] tmp, Room room)
protected MOB getRandAnyone(MOB monster, java.lang.Object[] tmp, Room room)
public java.lang.String execute(PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, DVector script, java.lang.String msg, java.lang.Object[] tmp)
ScriptingEngine
execute
in interface ScriptingEngine
scripted
- the object that is scriptedsource
- the source of the eventtarget
- the target of the eventmonster
- a mob representation of the scripted objectprimaryItem
- an item involved in the eventsecondaryItem
- a second item involved in the eventscript
- 2 dimensional DVector, the script to executemsg
- a string message associated with the eventtmp
- miscellaneous local variables
ScriptingEngine.ScriptableResponse
public java.lang.String execute(PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, DVector script, java.lang.String msg, java.lang.Object[] tmp, int startLine)
public java.lang.String getScriptResourceKey()
ScriptingEngine
getScriptResourceKey
in interface ScriptingEngine
ScriptingEngine.getScript()
protected java.util.List<DVector> getScripts()
protected boolean match(java.lang.String str, java.lang.String patt)
public boolean okMessage(Environmental host, CMMsg msg)
MsgListener
okMessage
in interface MsgListener
host
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that wants to be executed
CMMsg
,
CMMsg.source()
protected java.lang.String standardTriggerCheck(DVector script, java.lang.String[] t, Environmental E)
public void executeMsg(Environmental host, CMMsg msg)
MsgListener
executeMsg
in interface MsgListener
host
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that needs to be executedCMMsg
protected int getTriggerCode(java.lang.String trigger, java.lang.String[] ttrigger)
public MOB getMakeMOB(Tickable ticking)
ScriptingEngine
getMakeMOB
in interface ScriptingEngine
ticking
- the scripted object to make a fake mob out of
protected boolean canTrigger(int triggerCode)
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in Tickable
Tickable
,
ServiceEngine
,
TickableGroup
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
public void enqueResponse(PhysicalAgent host, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, DVector script, int ticks, java.lang.String msg, java.lang.String[] triggerStr)
public void prequeResponse(PhysicalAgent host, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, DVector script, int ticks, java.lang.String msg)
public void dequeResponses()
ScriptingEngine
dequeResponses
in interface ScriptingEngine
public java.lang.String L(java.lang.String str, java.lang.String... xs)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |