CMCommon
, ScriptingEngine
, CMObject
, MsgListener
, Tickable
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class DefaultScriptingEngine extends java.lang.Object implements ScriptingEngine
Modifier and Type | Class | Description |
---|---|---|
protected static class |
DefaultScriptingEngine.JScriptEvent |
ScriptingEngine.ScriptLn, ScriptingEngine.SubScript
Modifier and Type | Field | Description |
---|---|---|
protected Tickable |
altStatusTickable |
|
protected boolean |
alwaysTriggers |
|
protected MOB |
backupMOB |
|
protected java.lang.Object |
cachedRef |
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
connH |
|
protected static java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicInteger> |
counterCache |
|
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.List<ScriptingEngine.SubScript> |
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 Room |
homeKnownLocation |
|
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<java.lang.Integer> |
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<com.planet_ink.coffee_mud.Common.DefaultScriptingEngine.ScriptableResponse> |
que |
|
protected Quest |
questCacheObj |
|
protected java.util.concurrent.atomic.AtomicInteger |
recurseCounter |
|
protected java.util.Set<java.lang.Integer> |
registeredEvents |
|
protected Resources |
resources |
|
protected PrioritizingLimitedMap<java.lang.String,Room> |
roomFinder |
|
protected boolean |
runInPassiveAreas |
|
protected boolean |
runWithoutPCs |
|
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 |
idConverter
CONNECTOR_AND, CONNECTOR_ANDNOT, CONNECTOR_MAP, CONNECTOR_NOT, CONNECTOR_OR, CONNECTOR_ORNOT, CONNECTORS, DATETIME_ARGS, funcs, 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
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 |
---|---|
DefaultScriptingEngine() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
buildHashes() |
|
protected void |
bumpDownCache() |
|
boolean |
bumpDownCache(java.lang.String key) |
|
void |
bumpUpCache() |
|
void |
bumpUpCache(java.lang.String key) |
|
java.lang.String |
callFunc(java.lang.String named,
java.lang.String parms,
PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.String msg,
java.lang.Object[] tmp) |
Called a func with the given name, sending the given parms, and returning its
return value, if any, or null.
|
protected boolean |
canTrigger(int triggerCode) |
|
int |
compareTo(CMObject o) |
|
protected void |
confirmLastKnownLocation(MOB monster,
MOB source) |
|
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.
|
protected void |
dupCheckClear(com.planet_ink.coffee_mud.Common.DefaultScriptingEngine.ScriptableResponse resp,
java.lang.String[] triggerStr) |
|
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 * -2).
|
void |
enqueResponse(int triggerCode,
PhysicalAgent host,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
ScriptingEngine.SubScript 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,
ScriptingEngine.SubScript script,
java.lang.String msg,
java.lang.Object[] tmp) |
Executes a script in response to an event
The scripts are formatted as a SubScript class.
|
java.lang.String |
execute(PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
ScriptingEngine.SubScript 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 void |
finalize() |
|
protected Ability |
findAbility(java.lang.String arg) |
|
protected ScriptingEngine.SubScript |
findFunc(Environmental scripted,
java.lang.String named) |
|
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<Item> |
generateItemsFromFile(Environmental scripted,
java.lang.String filename,
java.lang.String tagName,
java.lang.String rest) |
|
protected java.util.List<MOB> |
generateMobsFromFile(Environmental scripted,
java.lang.String filename,
java.lang.String tagName,
java.lang.String rest) |
|
protected Ability |
getAbility(java.lang.String arg) |
|
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 java.util.List<Ability> |
getQuestAbilities() |
|
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<ScriptingEngine.SubScript> |
getScripts(Environmental scriptedE) |
|
protected PairList<java.lang.String,java.lang.String> |
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 |
getTriggerPercent(java.lang.String t1,
Physical P) |
|
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.
|
protected Resources |
globalResources() |
|
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 |
isFunc(java.lang.String named) |
Returns whether the script has a function with the given name.
|
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<Item> |
loadItemsFromFile(Environmental scripted,
java.lang.String filename) |
|
protected java.util.List<MOB> |
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(ScriptingEngine.SubScript 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(Environmental E,
java.lang.String text,
int depth,
java.util.List<java.lang.String> filenames,
java.lang.StringBuffer nonFilenameScript) |
|
protected java.util.List<ScriptingEngine.SubScript> |
parseScripts(Environmental E,
java.lang.String text) |
|
protected java.lang.String[] |
parseSpecial3PartEval(java.lang.String[][] eval,
int t) |
|
void |
prequeResponse(int triggerCode,
PhysicalAgent host,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
ScriptingEngine.SubScript script,
int ticks,
java.lang.String msg) |
|
void |
pushEvalBoolean(java.util.List<java.lang.Object> stack,
boolean trueFalse) |
|
void |
registerDefaultQuest(java.lang.Object quest) |
If this script is associated with a particular quest, this
method is called to register that quest name or object.
|
void |
reset() |
|
protected static void |
safeResetArea(Area area) |
|
protected static boolean |
safeResetCheck() |
|
protected static void |
safeResetRoom(Room room) |
|
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(ScriptingEngine.SubScript script,
java.lang.String[] t,
Environmental E,
PhysicalAgent scripted,
MOB source,
Environmental target,
MOB monster,
Item primaryItem,
Item secondaryItem,
java.lang.Object[] tmp) |
|
protected boolean |
stepEndQuest(PhysicalAgent hostObj,
MOB mob,
java.lang.String quest,
int reqCode) |
|
boolean |
stepQuest(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 step (QUEST_TIME_PROG * -1).
|
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 varifyableStr) |
Uses this scripting engines variable parsing system to replace
any script variables $XXXX with their script determined values.
|
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.concurrent.atomic.AtomicInteger> counterCache
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 volatile Room lastKnownLocation
protected Room homeKnownLocation
protected Tickable altStatusTickable
protected java.util.List<java.lang.Integer> 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 Quest questCacheObj
protected java.lang.String scriptKey
protected boolean runInPassiveAreas
protected boolean debugBadScripts
protected java.util.List<com.planet_ink.coffee_mud.Common.DefaultScriptingEngine.ScriptableResponse> que
protected final java.util.concurrent.atomic.AtomicInteger recurseCounter
protected volatile java.lang.Object cachedRef
protected boolean runWithoutPCs
protected final PrioritizingLimitedMap<java.lang.String,Room> roomFinder
protected static final java.util.List<ScriptingEngine.SubScript> empty
public java.lang.String ID()
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(Object)
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.Object quest)
ScriptingEngine
registerDefaultQuest
in interface ScriptingEngine
quest
- the quest associated with this scriptScriptingEngine.defaultQuestName()
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public CMObject copyOf()
CMObject
protected java.lang.String[] parseBits(ScriptingEngine.SubScript 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)
protected boolean stepEndQuest(PhysicalAgent hostObj, MOB mob, java.lang.String quest, int reqCode)
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 endedpublic boolean stepQuest(PhysicalAgent hostObj, MOB mob, java.lang.String quest)
ScriptingEngine
stepQuest
in interface ScriptingEngine
hostObj
- the scripted objectmob
- a mob representation of the host objectquest
- the name of the quest being endedpublic 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 variableScriptingEngine.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)
protected Resources globalResources()
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 variableScriptingEngine.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(Environmental E, java.lang.String text, int depth, java.util.List<java.lang.String> filenames, java.lang.StringBuffer nonFilenameScript)
protected void buildHashes()
protected java.util.List<ScriptingEngine.SubScript> parseScripts(Environmental E, java.lang.String text)
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<MOB> loadMobsFromFile(Environmental scripted, java.lang.String filename)
protected java.util.List<MOB> generateMobsFromFile(Environmental scripted, java.lang.String filename, java.lang.String tagName, java.lang.String rest)
protected java.util.List<Item> loadItemsFromFile(Environmental scripted, java.lang.String filename)
protected java.util.List<Item> 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 varifyableStr)
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 variablesvarifyableStr
- the string to parseprotected PairList<java.lang.String,java.lang.String> 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)
protected java.util.List<Ability> getQuestAbilities()
protected Ability getAbility(java.lang.String arg)
protected Ability findAbility(java.lang.String arg)
protected static final boolean safeResetCheck()
protected static final void safeResetRoom(Room room)
protected static final void safeResetArea(Area area)
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 expressionScriptParseException
- a parse errorpublic void pushEvalBoolean(java.util.List<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 expressionpublic 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 expressionprotected ScriptingEngine.SubScript findFunc(Environmental scripted, java.lang.String named)
public boolean isFunc(java.lang.String named)
ScriptingEngine
isFunc
in interface ScriptingEngine
named
- the FUNCTION_PROG to look forpublic java.lang.String callFunc(java.lang.String named, java.lang.String parms, PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, java.lang.String msg, java.lang.Object[] tmp)
ScriptingEngine
callFunc
in interface ScriptingEngine
named
- the name of the FUNCTION_PROG to callparms
- parameters to send as $gscripted
- 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 variablespublic java.lang.String execute(PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, ScriptingEngine.SubScript 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
- the script to executemsg
- a string message associated with the eventtmp
- miscellaneous local variablespublic java.lang.String execute(PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, ScriptingEngine.SubScript script, java.lang.String msg, java.lang.Object[] tmp, int startLine)
public java.lang.String getScriptResourceKey()
ScriptingEngine
getScriptResourceKey
in interface ScriptingEngine
ScriptingEngine.getScript()
public void bumpUpCache(java.lang.String key)
public void bumpUpCache()
public boolean bumpDownCache(java.lang.String key)
protected void bumpDownCache()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected java.util.List<ScriptingEngine.SubScript> getScripts(Environmental scriptedE)
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 executedCMMsg
,
CMMsg.source()
protected java.lang.String standardTriggerCheck(ScriptingEngine.SubScript script, java.lang.String[] t, Environmental E, PhysicalAgent scripted, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, java.lang.Object[] tmp)
protected int getTriggerPercent(java.lang.String t1, Physical P)
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
public MOB getMakeMOB(Tickable ticking)
ScriptingEngine
getMakeMOB
in interface ScriptingEngine
ticking
- the scripted object to make a fake mob out ofprotected 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 TickableTickable
,
ServiceEngine
,
TickableGroup
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
protected void dupCheckClear(com.planet_ink.coffee_mud.Common.DefaultScriptingEngine.ScriptableResponse resp, java.lang.String[] triggerStr)
public void enqueResponse(int triggerCode, PhysicalAgent host, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, ScriptingEngine.SubScript script, int ticks, java.lang.String msg, java.lang.String[] triggerStr)
public void prequeResponse(int triggerCode, PhysicalAgent host, MOB source, Environmental target, MOB monster, Item primaryItem, Item secondaryItem, ScriptingEngine.SubScript 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)