Go to the documentation of this file.
25 #define QUESTFILE_NEXTQUEST 0
26 #define QUESTFILE_QUEST 1
27 #define QUESTFILE_QUESTDESC 2
28 #define QUESTFILE_STEP 3
29 #define QUESTFILE_STEPDESC 4
30 #define QUESTFILE_STEPCOND 5
31 #define QUESTFILE_COMMENT 6
47 if (strcmp(read,
"end_setwhen") == 0) {
58 LOG(
llevError,
"Invalid line '%s' in setwhen block for quest %s=n", read,
quest->quest_code);
72 LOG(
llevDebug,
"condition added for step %d of quest %s, looking for quest %s between steps %d and %d\n",
77 if (strcmp(read,
"end_description") == 0) {
97 if (strcmp(read,
"end_step") == 0) {
102 if (strcmp(read,
"finishes_quest") == 0) {
106 if (strcmp(read,
"description") == 0) {
111 if (strcmp(read,
"setwhen") == 0) {
115 LOG(
llevError,
"quests: invalid line %s in definition of quest %s in %s:%d!\n",
121 if (strcmp(read,
"end_description") == 0) {
139 if (strcmp(read,
"end_comment") == 0) {
143 quest->quest_comment = (*comment !=
'\0') ?
add_string(comment + 1) : NULL;
153 if (strcmp(read,
"end_quest") == 0) {
163 if (strcmp(read,
"description") == 0) {
169 if (strncmp(read,
"title ", 6) == 0) {
174 if (sscanf(read,
"step %d", &i)) {
190 if (sscanf(read,
"restart %d", &i)) {
191 quest->quest_restart = i;
194 if (strncmp(read,
"parent ", 7) == 0) {
199 if (strncmp(read,
"face ", 5) == 0) {
204 if (strncmp(read,
"comment", 7) == 0) {
210 if (sscanf(read,
"is_system %d", &i)) {
211 quest->quest_is_system = (i ? true :
false);
219 if (strncmp(read,
"quest ", 6) == 0) {
230 if (strcmp(read,
"") == 0)
233 LOG(
llevError,
"quest: invalid file format for %s, I don't know what to do with the line %s\n",
filename.c_str(), read);
237 LOG(
llevError,
"quest: quest definition file %s read in, ends with state %d\n",
filename.c_str(), in);
sstring add_string(const char *str)
StringBuffer * stringbuffer_new(void)
quest_step_definition * quest_create_step(void)
#define QUESTFILE_STEPDESC
#define QUESTFILE_QUESTDESC
static event_registration c
char * bufferreader_next_line(BufferReader *br)
size_t bufferreader_current_line(BufferReader *br)
QuestLoader(Quests *quests, Faces *faces, AssetsTracker *tracker)
#define QUESTFILE_STEPCOND
T * define(const Key &name, T *asset)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
virtual void assetDefined(const archetype *asset, const std::string &filename)
char * stringbuffer_finish(StringBuffer *sb)
#define QUESTFILE_NEXTQUEST
quest_condition * conditions
void LOG(LogLevel logLevel, const char *format,...)
virtual void load(BufferReader *reader, const std::string &filename) override
#define QUESTFILE_COMMENT
static struct_quest ** quests
quest_definition * quest_create(const char *name)
int quest_condition_from_string(quest_condition *condition, const char *buffer)
quest_condition * quest_create_condition(void)