|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Common.DefaultQuest
public class DefaultQuest
| Nested Class Summary | |
|---|---|
protected static class |
DefaultQuest.JScriptQuest
|
static class |
DefaultQuest.MysteryData
|
static class |
DefaultQuest.QuestState
|
| Field Summary | |
|---|---|
protected java.lang.String |
displayName
|
protected boolean |
durable
|
protected int |
duration
|
DVector |
internalFiles
|
protected long |
lastStartDateTime
|
protected int |
maxWait
|
protected int |
minPlayers
|
protected int |
minWait
|
protected java.lang.String |
name
|
protected java.lang.String |
playerMask
|
protected java.lang.String |
rawScriptParameter
|
protected int |
runLevel
|
protected int |
spawn
|
protected java.lang.String |
startDate
|
protected int |
ticksRemaining
|
protected int |
waitRemaining
|
protected java.util.Vector |
winners
|
| Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Quest |
|---|
MYSTERY_QCODES, QCODES, QOBJS, ROOM_REFERENCE_QCODES, SPAWN_ANY, SPAWN_DESCS, SPAWN_FIRST, SPAWN_NO |
| Constructor Summary | |
|---|---|
DefaultQuest()
|
|
| Method Summary | |
|---|---|
void |
autostartup()
After a quest is added to the list of quests, this method is called to put the quest into its initial wait state, and get it thread time. |
void |
cleanQuestStep()
|
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. |
void |
declareWinner(java.lang.String name)
Registers the given player name as having won this quest. |
java.lang.String |
displayName()
Returns the friendly display name of the quest |
int |
duration()
Returns the duration, in ticks of this quest. |
boolean |
enterDormantState()
A dormant state is the state where a quest is no longer running, but is not, or has not yet, been scheduled to wait for another run time. |
void |
enterRunningState()
|
protected void |
errorOccurred(DefaultQuest.QuestState q,
boolean quietFlag,
java.lang.String msg)
|
protected int |
getCodeNum(java.lang.String code)
|
java.lang.Object |
getDesignatedObject(java.lang.String named)
From the given official quest variable name, it derives either an object or a vector of objects that reflect it. |
Quest |
getMainQuestObject()
|
int |
getObjectInUseIndex(java.lang.String name)
Returns the index of a room, mob, or item of the given name in use by this quest. |
Item |
getQuestItem(int i)
Returns the item in use by this quest at the given index |
int |
getQuestItemIndex(java.lang.String name)
Returns the index of a item of the given name in use by this quest |
java.lang.String |
getQuestItemName(int i)
Returns the name of the item in use by this quest at the given index |
MOB |
getQuestMob(int i)
Returns the mob in use by this quest at the given index |
int |
getQuestMobIndex(java.lang.String name)
Returns the index of a mob of the given name in use by this quest |
java.lang.String |
getQuestMobName(int i)
Returns the name of the mob in use by this quest at the given index |
Room |
getQuestRoom(int i)
Returns the room in use by this quest at the given index |
java.lang.String |
getQuestRoomID(int i)
Returns the id of the room in use by this quest at the given index |
int |
getQuestRoomIndex(java.lang.String roomID)
Returns the index of a room of the given id in use by this quest |
Environmental |
getQuestThing(java.util.Vector V,
int dex,
int type,
int[] num)
|
int |
getQuestThingIndex(java.util.Vector V,
java.lang.String name,
int type,
int[] num)
|
java.lang.StringBuffer |
getResourceFileData(java.lang.String named)
Quest scripts can have files of various sorts embedded in them. |
int |
getSaveStatIndex()
Returns the index into the stat codes array where extra savable fields begins. |
int |
getSpawn()
Returns the flag denoting whether this quest spawns new ones from its several steps and if so, by what method. |
java.lang.String |
getStat(java.lang.String code)
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. |
java.lang.String[] |
getStatCodes()
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders. |
long |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
java.util.Vector |
getWinners()
Returns the names of all the winners of this quest |
java.lang.String |
getWinnerStr()
Returns a semicolon delimited string of all the winners of this quest |
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. |
void |
internalQuestDelete()
If any files are embedded and cached inside this quest script, this method will clear them from resources and memory. |
boolean |
isCopy()
Returns whether this quest object is a spawned copy |
boolean |
isObjectInUse(Environmental E)
Returns whether the exact given object is in use by this quest. |
boolean |
isStat(java.lang.String code)
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. |
int |
minPlayers()
The minimum number of players matching player criteria required before this quest will start |
int |
minsRemaining()
Returns the number of minutes before this quest will go from a running state to a stopped state. |
int |
minWait()
Returns the minimum number of ticks between attempts to run this quest. |
java.lang.String |
name()
Returns the unique name of the quest |
CMObject |
newInstance()
Returns a new instance of this class. |
java.util.Vector |
parseLoadScripts(java.lang.String text,
java.util.Vector oldArgs,
java.util.Vector args)
|
void |
parseQuestScript(java.util.Vector script,
java.util.Vector args,
int startLine)
|
void |
parseQuestScriptWArgs(java.util.Vector script,
java.util.Vector args)
|
java.lang.String |
playerMask()
Returns the zappermask that determines who counts as an elligible player for the purposes of the minPlayer setting. |
void |
resetQuest(int firstPauseTicks)
this will stop executing of the quest script. |
boolean |
resetWaitRemaining(long ellapsedTime)
Sets the number of ticks before this quest will attempt to start. |
int |
runLevel()
Returns the run level. |
boolean |
running()
Returns whether this quest is in a running state |
void |
runtimeRegisterAbility(MOB mob,
java.lang.String abilityID,
java.lang.String parms,
boolean give)
they are called when you want the quest engine to be aware of a a quest-specific object thats being added to the map, so that it can be cleaned up later. |
void |
runtimeRegisterBehavior(Environmental behaving,
java.lang.String behaviorID,
java.lang.String parms,
boolean give)
Called when you want the quest engine to be aware of a quest specific object that is being added to the map, so that it can be cleaned up later. |
void |
runtimeRegisterEffect(Environmental affected,
java.lang.String abilityID,
java.lang.String parms,
boolean give)
Called when you want the quest engine to be aware of a quest specific object that is being added to the map, so that it can be cleaned up later. |
void |
runtimeRegisterObject(Environmental object)
Called when you want the quest engine to be aware of a quest specific object that is being added to the map, so that it can be cleaned up later. |
void |
runtimeRegisterStat(Environmental E,
java.lang.String stat,
java.lang.String parms,
boolean give)
|
boolean |
sameAs(DefaultQuest E)
|
java.lang.String |
script()
Returns the unparsed quest script as a single happy string. |
void |
setCopy(boolean truefalse)
Sets whether this quest object is a spawned copy |
void |
setDisplayName(java.lang.String newName)
Sets the friendly display name of the quest |
void |
setDuration(int newTicks)
Sets the duration, in ticks of this quest. |
void |
setMinPlayers(int players)
Sets minimum number of players matching player criteria required before this quest will start |
void |
setMinWait(int wait)
Sets the minimum number of ticks between attempts to run this quest. |
void |
setName(java.lang.String newName)
Sets the unique name of the quest |
void |
setPlayerMask(java.lang.String mask)
Sets the zappermask that determines who counts as an elligible player for the purposes of the minPlayer setting. |
void |
setRunLevel(int level)
Sets the run level. |
void |
setScript(java.lang.String parm)
Sets the quest script. |
void |
setSpawn(int spawnFlag)
Sets the flag denoting whether this quest spawns new ones from its several steps and if so, by what method. |
void |
setStartDate(java.lang.String newDate)
Sets the real-life start date of this quest. |
void |
setStartMudDate(java.lang.String newDate)
Sets the in-game mud start date of this quest. |
void |
setStat(java.lang.String code,
java.lang.String val)
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. |
void |
setSuspended(boolean truefalse)
Sets whether this quest object is suspended. |
void |
setVars(java.util.Vector script,
int startAtLine)
Accepts a pre-parsed quest script and extracts certain non-iterative variables, such as the quest name and similar variables. |
void |
setWaitInterval(int wait)
Sets the maximum ticks, above the minimum wait, that must go by before an attempt to run a quest. |
void |
setWinners(java.lang.String list)
Sets the list of player names that have won this quest |
boolean |
spawnQuest(java.lang.String script,
java.util.Vector baseVars,
boolean reTime)
|
java.lang.String |
startDate()
Returns the unique start date of the quest. |
boolean |
startQuest()
This will execute the quest script. |
boolean |
startQuestOnTime()
This method is called every tick to check and see if the wait is completed and its time to actually start the quest. |
boolean |
stepQuest()
This method is called when a quest is done with a particular step in a multi-step quest. |
boolean |
stopping()
Returns whether this quest is in a midway stopping state |
void |
stopQuest()
this will stop executing of the quest script. |
boolean |
suspended()
Returns whether this quest object is suspended. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
int |
ticksRemaining()
Returns the number of ticks before this quest will go from a running state to a stopped state. |
boolean |
waiting()
Returns whether this quest is in a wait state between runs |
int |
waitInterval()
Returns the maximum ticks, above the minimum wait, that must go by before an attempt to run a quest. |
int |
waitRemaining()
Returns the number of ticks before this quest will attempt to start. |
boolean |
wasWinner(java.lang.String name)
Returns whether a player of the given name has won this quest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.lang.String displayName
protected java.lang.String startDate
protected int duration
protected java.lang.String rawScriptParameter
protected java.util.Vector winners
protected boolean durable
protected int minWait
protected int minPlayers
protected java.lang.String playerMask
protected int runLevel
protected int maxWait
protected int waitRemaining
protected int ticksRemaining
protected long lastStartDateTime
protected int spawn
public DVector internalFiles
| Constructor Detail |
|---|
public DefaultQuest()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectpublic java.lang.String name()
Quest
name in interface Questname in interface TickableQuest.setName(String)public void setName(java.lang.String newName)
Quest
setName in interface QuestnewName - the unique name of the questQuest.name()public java.lang.String displayName()
Quest
displayName in interface QuestQuest.setDisplayName(String)public void setDisplayName(java.lang.String newName)
Quest
setDisplayName in interface QuestnewName - the friendly display name of the questQuest.displayName()public CMObject copyOf()
CMObject
copyOf in interface CMObjectpublic boolean suspended()
Quest
suspended in interface QuestQuest.setSuspended(boolean)public void setSuspended(boolean truefalse)
Quest
setSuspended in interface Questtruefalse - true if this quest object is suspendedQuest.suspended()public CMObject newInstance()
CMObject
newInstance in interface CMObjectpublic void initializeClass()
CMObject
initializeClass in interface CMObjectpublic java.lang.Object getDesignatedObject(java.lang.String named)
Quest
getDesignatedObject in interface Questnamed - the code to return a string, object, or vector for
Quest.QOBJSpublic void internalQuestDelete()
Quest
internalQuestDelete in interface Questpublic java.lang.String startDate()
Quest
startDate in interface QuestQuest.setStartDate(String),
Quest.setStartMudDate(String)public void setStartDate(java.lang.String newDate)
Quest
setStartDate in interface QuestnewDate - the real-life start date of this questQuest.startDate(),
Quest.setStartMudDate(String)public void setStartMudDate(java.lang.String newDate)
Quest
setStartMudDate in interface QuestnewDate - the in-game mud start date of this questQuest.startDate(),
Quest.setStartDate(String)public int duration()
Quest
duration in interface QuestQuest.setDuration(int)public void setDuration(int newTicks)
Quest
setDuration in interface QuestnewTicks - the duration, in ticks, of this questQuest.duration()public void setCopy(boolean truefalse)
Quest
setCopy in interface Questtruefalse - true if this quest object is a spawned copyQuest.isCopy()public boolean isCopy()
Quest
isCopy in interface QuestQuest.setCopy(boolean)public void setSpawn(int spawnFlag)
Quest
setSpawn in interface QuestspawnFlag - the quest spawn flag infoQuest.SPAWN_ANY,
Quest.SPAWN_FIRST,
Quest.SPAWN_NO,
Quest.SPAWN_DESCS,
Quest.getSpawn()public int getSpawn()
Quest
getSpawn in interface QuestQuest.SPAWN_ANY,
Quest.SPAWN_FIRST,
Quest.SPAWN_NO,
Quest.SPAWN_DESCS,
Quest.setSpawn(int)public int minPlayers()
Quest
minPlayers in interface QuestQuest.setMinPlayers(int),
Quest.playerMask(),
Quest.setPlayerMask(String)public void setMinPlayers(int players)
Quest
setMinPlayers in interface Questplayers - minimum number of players matching player criteria requiredQuest.minPlayers(),
Quest.playerMask(),
Quest.setPlayerMask(String)public int runLevel()
Quest
runLevel in interface QuestQuest.setRunLevel(int)public void setRunLevel(int level)
Quest
setRunLevel in interface Questlevel - the run level. -1 means runs alwaysQuest.runLevel()public java.lang.String playerMask()
Quest
playerMask in interface QuestMaskingLibrary,
Quest.setMinPlayers(int),
Quest.minPlayers(),
Quest.setPlayerMask(String)public void setPlayerMask(java.lang.String mask)
Quest
setPlayerMask in interface Questmask - the zappermask that determines who counts as a playerMaskingLibrary,
Quest.setMinPlayers(int),
Quest.minPlayers(),
Quest.playerMask()public void setScript(java.lang.String parm)
Quest
setScript in interface Questparm - the actual quest scriptQuest.script()public java.lang.String script()
Quest
script in interface QuestQuest.setScript(String)public void autostartup()
Quest
autostartup in interface Quest
public void setVars(java.util.Vector script,
int startAtLine)
Quest
setVars in interface Questscript - the parsed quest scriptstartAtLine - which line of the script to start atQuestpublic java.lang.StringBuffer getResourceFileData(java.lang.String named)
Quest
getResourceFileData in interface Questnamed - the name of the resource path file to return
Quest
public void parseQuestScriptWArgs(java.util.Vector script,
java.util.Vector args)
protected void errorOccurred(DefaultQuest.QuestState q,
boolean quietFlag,
java.lang.String msg)
public void parseQuestScript(java.util.Vector script,
java.util.Vector args,
int startLine)
public boolean spawnQuest(java.lang.String script,
java.util.Vector baseVars,
boolean reTime)
public boolean startQuest()
Quest
startQuest in interface QuestQuest.startQuestOnTime(),
Quest.resetQuest(int),
Quest.stepQuest(),
Quest.stopQuest()public void enterRunningState()
public void cleanQuestStep()
public boolean stepQuest()
Quest
stepQuest in interface QuestQuest.startQuest(),
Quest.stopQuest(),
Quest.startQuestOnTime()public void resetQuest(int firstPauseTicks)
Quest
resetQuest in interface QuestfirstPauseTicks - ticks to remain in stopped state before restartingQuest.startQuest(),
Quest.stepQuest(),
Quest.stopQuest(),
Quest.startQuestOnTime()public void stopQuest()
Quest
stopQuest in interface QuestQuest.startQuest(),
Quest.stepQuest(),
Quest.resetQuest(int),
Quest.startQuestOnTime()public boolean enterDormantState()
Quest
enterDormantState in interface Questpublic boolean resetWaitRemaining(long ellapsedTime)
Quest
resetWaitRemaining in interface QuestellapsedTime - the number of miliseconds already ellapsed before wait began
Quest.waitRemaining()public int minWait()
Quest
minWait in interface QuestQuest.setMinWait(int),
Quest.waitInterval(),
Quest.setWaitInterval(int)public void setMinWait(int wait)
Quest
setMinWait in interface Questwait - the minimum number of ticks between attempts to run this quest.Quest.minWait(),
Quest.waitInterval(),
Quest.setWaitInterval(int)public int waitInterval()
Quest
waitInterval in interface QuestQuest.setMinWait(int),
Quest.minWait(),
Quest.setWaitInterval(int)public void setWaitInterval(int wait)
Quest
setWaitInterval in interface Questwait - the maximum ticks, above the minimum wait, that must go byQuest.setMinWait(int),
Quest.minWait(),
Quest.waitInterval()public int waitRemaining()
Quest
waitRemaining in interface QuestQuest.resetWaitRemaining(long)public Quest getMainQuestObject()
public void declareWinner(java.lang.String name)
Quest
declareWinner in interface Questname - the player nameQuest.getWinners(),
Quest.getWinnerStr(),
Quest.wasWinner(String),
Quest.setWinners(String)public java.lang.String getWinnerStr()
Quest
getWinnerStr in interface QuestQuest.declareWinner(String),
Quest.getWinners(),
Quest.wasWinner(String),
Quest.setWinners(String)public void setWinners(java.lang.String list)
Quest
setWinners in interface Questlist - a semicolon delimtied list of player namesQuest.declareWinner(String),
Quest.getWinners(),
Quest.getWinnerStr(),
Quest.wasWinner(String)public java.util.Vector getWinners()
Quest
getWinners in interface QuestQuest.declareWinner(String),
Quest.getWinnerStr(),
Quest.wasWinner(String),
Quest.setWinners(String)public boolean wasWinner(java.lang.String name)
Quest
wasWinner in interface Questname - the player name
Quest.declar