|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Quest
A quest object manages the details and text for a single descriptive script that is scheduled and, when directed, spawns, creates, watches, shuts down, and cleans up the various objects, subsidiary quests, and existing objects modifications related to this Quest. To the user, a quest is a task the user must complete for reward. To the Archon, a quest is something that adds content to an area at particular times, or under particular circumstances.
QuestManager
Nested Class Summary | |
---|---|
static class |
Quest.QuestScript
A Quest script contains strings, and options, which are mini-quest scripts of strings. |
Field Summary | |
---|---|
static int |
FLAG_SUSPENDED
A quest flag @see getFlags() |
static java.lang.String[] |
MYSTERY_QCODES
The list of basic mystery quest objects defined in an iterative fashion during quest script execution |
static java.lang.String[] |
QCODES
The list of BASIC non-iterative variable codes that pertain to a quest object |
static java.lang.String[] |
QOBJS
The list of basic quest objects defined in an iterative fashion during quest script execution |
static java.lang.String[] |
ROOM_REFERENCE_QCODES
the list of room-related mystery quest objects defined in an iterative fashion during quest script execution |
static int |
SPAWN_ANY
A quest spawn flag denoting that this quest attempts to spawn every step at once |
static java.lang.String[] |
SPAWN_DESCS
Descriptions of the several quest step spawn flags |
static int |
SPAWN_FIRST
A quest spawn flag denoting that this quest spawns only its first step |
static int |
SPAWN_NO
A quest spawn flag denoting that this quest does not spawn its steps |
Method Summary | |
---|---|
java.lang.String |
author()
Returns the author of the quest |
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 |
declareWinner(java.lang.String mobName)
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. |
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. |
long |
getFlags()
Returns flag bitmap |
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 |
java.lang.StringBuffer |
getResourceFileData(java.lang.String named,
boolean showErrors)
Quest scripts can have files of various sorts embedded in them. |
int |
getSpawn()
Returns the flag denoting whether this quest spawns new ones from its several steps and if so, by what method. |
java.util.Map<java.lang.String,java.lang.Long> |
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 |
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. |
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 |
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 minusEllapsed)
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(PhysicalAgent 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(PhysicalAgent 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(PhysicalAgent P)
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. |
java.lang.String |
script()
Returns the unparsed quest script as a single happy string. |
void |
setAuthor(java.lang.String newName)
Sets the author of the quest |
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 |
setFlags(long flags)
Sets the flag bitmap |
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. |
boolean |
setScript(java.lang.String parm,
boolean showErrors)
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 newName)
Sets the real-life start date of this quest. |
void |
setStartMudDate(java.lang.String newName)
Sets the in-game mud start date of this quest. |
void |
setSuspended(boolean truefalse)
Sets whether this quest object is suspended. |
void |
setVars(java.util.List<?> 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 |
java.lang.String |
startDate()
Returns the unique start date of the quest. |
boolean |
startQuest()
This will execute the quest script. |
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. |
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 |
java.lang.Long |
whenLastWon(java.lang.String name)
Returns when a player of the given name last won this quest or null |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable |
---|
getTickStatus, tick |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable |
---|
getSaveStatIndex, getStat, getStatCodes, isStat, setStat |
Field Detail |
---|
static final int SPAWN_NO
static final int SPAWN_FIRST
static final int SPAWN_ANY
static final java.lang.String[] SPAWN_DESCS
static final int FLAG_SUSPENDED
getFlags()
static final java.lang.String[] QCODES
static final java.lang.String[] QOBJS
static final java.lang.String[] MYSTERY_QCODES
static final java.lang.String[] ROOM_REFERENCE_QCODES
Method Detail |
---|
java.lang.String name()
name
in interface CMObject
name
in interface Tickable
setName(String)
void setName(java.lang.String newName)
newName
- the unique name of the questname()
java.lang.String author()
setAuthor(String)
void setAuthor(java.lang.String newName)
newName
- the author of the questauthor()
java.lang.String displayName()
setDisplayName(String)
void setDisplayName(java.lang.String newName)
newName
- the friendly display name of the questdisplayName()
java.lang.String startDate()
setStartDate(String)
,
setStartMudDate(String)
void setStartDate(java.lang.String newName)
newName
- the real-life start date of this queststartDate()
,
setStartMudDate(String)
void setStartMudDate(java.lang.String newName)
newName
- the in-game mud start date of this queststartDate()
,
setStartDate(String)
int duration()
setDuration(int)
void setDuration(int newTicks)
newTicks
- the duration, in ticks, of this questduration()
boolean suspended()
setSuspended(boolean)
void setSuspended(boolean truefalse)
truefalse
- true if this quest object is suspendedsuspended()
boolean setScript(java.lang.String parm, boolean showErrors)
parm
- the actual quest scriptshowErrors
- true to report file errors, false otherwise
script()
void setVars(java.util.List<?> script, int startAtLine)
script
- the parsed quest scriptstartAtLine
- which line of the script to start atQuest
java.lang.String script()
setScript(String, boolean)
boolean startQuest()
resetQuest(int)
,
stepQuest()
,
stopQuest()
void stopQuest()
startQuest()
,
stepQuest()
,
resetQuest(int)
void resetQuest(int firstPauseTicks)
firstPauseTicks
- ticks to remain in stopped state before restartingstartQuest()
,
stepQuest()
,
stopQuest()
void internalQuestDelete()
boolean stepQuest()
startQuest()
,
stopQuest()
boolean enterDormantState()
void setCopy(boolean truefalse)
truefalse
- true if this quest object is a spawned copyisCopy()
boolean isCopy()
setCopy(boolean)
void setSpawn(int spawnFlag)
spawnFlag
- the quest spawn flag infoSPAWN_ANY
,
SPAWN_FIRST
,
SPAWN_NO
,
SPAWN_DESCS
,
getSpawn()
int getSpawn()
SPAWN_ANY
,
SPAWN_FIRST
,
SPAWN_NO
,
SPAWN_DESCS
,
setSpawn(int)
java.lang.StringBuffer getResourceFileData(java.lang.String named, boolean showErrors)
named
- the name of the resource path file to returnshowErrors
- true to report file errors, false otherwise
Quest
int getObjectInUseIndex(java.lang.String name)
name
- the given name
isObjectInUse(Environmental)
boolean isObjectInUse(Environmental E)
E
- the object to check
getObjectInUseIndex(String)
java.lang.Object getDesignatedObject(java.lang.String named)
named
- the code to return a string, object, or vector for
QOBJS
int getQuestMobIndex(java.lang.String name)
name
- the given name
getQuestMobName(int)
,
getQuestMob(int)
MOB getQuestMob(int i)
i
- the index
getQuestMobName(int)
,
getQuestMobIndex(String)
java.lang.String getQuestMobName(int i)
i
- the index
getQuestMob(int)
,
getQuestMobIndex(String)
int getQuestItemIndex(java.lang.String name)
name
- the given name
getQuestItem(int)
,
getQuestItemName(int)
Item getQuestItem(int i)
i
- the index
getQuestItemIndex(String)
,
getQuestItemName(int)
java.lang.String getQuestItemName(int i)
i
- the index
getQuestItem(int)
,
getQuestItemIndex(String)
int getQuestRoomIndex(java.lang.String roomID)
roomID
- the given room id
getQuestRoom(int)
,
getQuestRoomID(int)
Room getQuestRoom(int i)
i
- the index
getQuestRoomIndex(String)
,
getQuestRoomID(int)
java.lang.String getQuestRoomID(int i)
i
- the index
getQuestRoom(int)
,
getQuestRoomIndex(String)
void runtimeRegisterAbility(MOB mob, java.lang.String abilityID, java.lang.String parms, boolean give)
mob
- the mob receiving the abilityabilityID
- the id of the abilityparms
- any ability parametersgive
- false to remove this ability, true to replace an existing oneruntimeRegisterBehavior(PhysicalAgent, String, String, boolean)
,
runtimeRegisterEffect(PhysicalAgent, String, String, boolean)
,
runtimeRegisterObject(PhysicalAgent)
void runtimeRegisterObject(PhysicalAgent P)
P
- the object added to the mapruntimeRegisterAbility(MOB, String, String, boolean)
,
runtimeRegisterBehavior(PhysicalAgent, String, String, boolean)
,
runtimeRegisterEffect(PhysicalAgent, String, String, boolean)
,
Quest
void runtimeRegisterEffect(PhysicalAgent affected, java.lang.String abilityID, java.lang.String parms, boolean give)
affected
- the object receiving the effectabilityID
- the id of the effectparms
- any effect parametersgive
- false to remove this effect, true to replace an existing oneruntimeRegisterAbility(MOB, String, String, boolean)
,
runtimeRegisterBehavior(PhysicalAgent, String, String, boolean)
,
runtimeRegisterObject(PhysicalAgent)
void runtimeRegisterBehavior(PhysicalAgent behaving, java.lang.String behaviorID, java.lang.String parms, boolean give)
behaving
- the object receiving the behaviorbehaviorID
- the id of the behaviorparms
- any behavior parametersgive
- false to remove this behavior, true to replace an existing oneruntimeRegisterAbility(MOB, String, String, boolean)
,
runtimeRegisterEffect(PhysicalAgent, String, String, boolean)
,
runtimeRegisterObject(PhysicalAgent)
void declareWinner(java.lang.String mobName)
mobName
- the player namegetWinners()
,
getWinnerStr()
,
wasWinner(String)
,
setWinners(String)
,
whenLastWon(String)
java.util.Map<java.lang.String,java.lang.Long> getWinners()
declareWinner(String)
,
getWinnerStr()
,
wasWinner(String)
,
setWinners(String)
,
whenLastWon(String)
java.lang.String getWinnerStr()
declareWinner(String)
,
getWinners()
,
wasWinner(String)
,
setWinners(String)
,
whenLastWon(String)
boolean wasWinner(java.lang.String name)
name
- the player name
declareWinner(String)
,
getWinners()
,
getWinnerStr()
,
setWinners(String)
,
whenLastWon(String)
java.lang.Long whenLastWon(java.lang.String name)
name
- the player name
declareWinner(String)
,
getWinners()
,
getWinnerStr()
,
setWinners(String)
,
wasWinner(String)
void setWinners(java.lang.String list)
list
- a semicolon delimtied list of player namesdeclareWinner(String)
,
getWinners()
,
getWinnerStr()
,
wasWinner(String)
int minPlayers()
setMinPlayers(int)
,
playerMask()
,
setPlayerMask(String)
void setMinPlayers(int players)
players
- minimum number of players matching player criteria requiredminPlayers()
,
playerMask()
,
setPlayerMask(String)
int runLevel()
setRunLevel(int)
void setRunLevel(int level)
level
- the run level. -1 means runs alwaysrunLevel()
java.lang.String playerMask()
MaskingLibrary
,
setMinPlayers(int)
,
minPlayers()
,
setPlayerMask(String)
void setPlayerMask(java.lang.String mask)
mask
- the zappermask that determines who counts as a playerMaskingLibrary
,
setMinPlayers(int)
,
minPlayers()
,
playerMask()
int minWait()
setMinWait(int)
,
waitInterval()
,
setWaitInterval(int)
void setMinWait(int wait)
wait
- the minimum number of ticks between attempts to run this quest.minWait()
,
waitInterval()
,
setWaitInterval(int)
int waitInterval()
setMinWait(int)
,
minWait()
,
setWaitInterval(int)
void setWaitInterval(int wait)
wait
- the maximum ticks, above the minimum wait, that must go bysetMinWait(int)
,
minWait()
,
waitInterval()
void autostartup()
boolean running()
suspended()
,
waiting()
,
startQuest()
boolean stopping()
suspended()
,
waiting()
,
running()
,
stopQuest()
boolean waiting()
suspended()
,
waiting()
,
running()
,
stopQuest()
int ticksRemaining()
minsRemaining()
,
startQuest()
int minsRemaining()
ticksRemaining()
,
startQuest()
int waitRemaining()
resetWaitRemaining(long)
boolean resetWaitRemaining(long minusEllapsed)
minusEllapsed
- the number of miliseconds already ellapsed before wait began
waitRemaining()
long getFlags()
FLAG_SUSPENDED
void setFlags(long flags)
flags
- the flag bitmapFLAG_SUSPENDED
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |