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);
64 LOG(
llevDebug,
"condition added for step %d of quest %s, looking for quest %s between steps %d and %d\n",
69 if (strcmp(read,
"end_description") == 0) {
89 if (strcmp(read,
"end_step") == 0) {
94 if (strcmp(read,
"finishes_quest") == 0) {
98 if (strcmp(read,
"description") == 0) {
103 if (strcmp(read,
"setwhen") == 0) {
107 LOG(
llevError,
"quests: invalid line %s in definition of quest %s in %s:%zu!\n",
113 if (strcmp(read,
"end_description") == 0) {
131 if (strcmp(read,
"end_comment") == 0) {
135 quest->quest_comment = (*comment !=
'\0') ?
add_string(comment + 1) : NULL;
145 if (strcmp(read,
"end_quest") == 0) {
155 if (strcmp(read,
"description") == 0) {
161 if (strncmp(read,
"title ", 6) == 0) {
166 if (sscanf(read,
"step %d", &i)) {
169 quest->steps.push_back(step);
174 if (sscanf(read,
"restart %d", &i)) {
175 quest->quest_restart = i;
178 if (strncmp(read,
"parent ", 7) == 0) {
183 if (strncmp(read,
"face ", 5) == 0) {
188 if (strncmp(read,
"comment", 7) == 0) {
194 if (sscanf(read,
"is_system %d", &i)) {
195 quest->quest_is_system = (i ? true :
false);
203 if (strncmp(read,
"quest ", 6) == 0) {
214 if (strcmp(read,
"") == 0)
217 LOG(
llevError,
"quest: invalid file format for %s, I don't know what to do with the line %s\n",
filename.c_str(), read);
221 LOG(
llevError,
"quest: quest definition file %s read in, ends with state %d\n",
filename.c_str(), in);
size_t bufferreader_current_line(BufferReader *br)
quest_step_definition * quest_create_step(void)
void LOG(LogLevel logLevel, const char *format,...)
#define QUESTFILE_STEPDESC
#define QUESTFILE_QUESTDESC
StringBuffer * stringbuffer_new(void)
char * stringbuffer_finish(StringBuffer *sb)
QuestLoader(Quests *quests, Faces *faces, AssetsTracker *tracker)
#define QUESTFILE_STEPCOND
T * define(const Key &name, T *asset)
sstring add_string(const char *str)
virtual void assetDefined(const archetype *asset, const std::string &filename)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
#define QUESTFILE_NEXTQUEST
std::vector< quest_condition * > conditions
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)
char * bufferreader_next_line(BufferReader *br)