Crossfire Server, Trunk
quest.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2021 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef QUEST_H
14 #define QUEST_H
15 
16 #include "global.h"
17 
19 typedef struct quest_condition {
21  int minstep;
23  int maxstep;
27 
29 typedef struct quest_step_definition {
30  int step;
36 
38 typedef struct quest_definition {
44  const Face *face;
45  uint32_t client_code;
50 
51 typedef void(*quest_op)(const quest_definition *, void *);
52 
53 void quest_for_each(quest_op op, void *user);
54 
60 
66 
67 quest_definition *quest_create(const char *name);
73 
86 int quest_condition_from_string(quest_condition *condition, const char *buffer);
87 
94 void quest_write_condition(char *buf, size_t len, const quest_condition *condition);
95 
96 #endif /* QUEST_H */
Face
Definition: face.h:14
quest_definition::steps
quest_step_definition * steps
Definition: quest.h:47
quest_destroy_condition
void quest_destroy_condition(quest_condition *condition)
Definition: Quests.cpp:69
global.h
quest_for_each
void quest_for_each(quest_op op, void *user)
Definition: assets.cpp:546
quest_condition::quest_code
sstring quest_code
Definition: quest.h:20
quest_condition::maxstep
int maxstep
Definition: quest.h:23
quest_op
void(* quest_op)(const quest_definition *, void *)
Definition: quest.h:51
quest_definition
struct quest_definition quest_definition
quest_create_condition
quest_condition * quest_create_condition(void)
Definition: Quests.cpp:56
quest_definition::quest_description
sstring quest_description
Definition: quest.h:41
quest_destroy
void quest_destroy(quest_definition *quest)
Definition: Quests.cpp:101
quest_step_definition::step
int step
Definition: quest.h:30
quest_step_definition
struct quest_step_definition quest_step_definition
quest_condition_from_string
int quest_condition_from_string(quest_condition *condition, const char *buffer)
Definition: Quests.cpp:106
quest_definition::quest_is_system
bool quest_is_system
Definition: quest.h:46
buf
StringBuffer * buf
Definition: readable.cpp:1611
quest_step_definition
Definition: quest.h:29
quest_definition::quest_title
sstring quest_title
Definition: quest.h:40
quest_definition::quest_comment
sstring quest_comment
Definition: quest.h:42
quest
Definition: quest.py:1
quest_step_definition::next
struct quest_step_definition * next
Definition: quest.h:33
quest_step_definition::is_completion_step
int is_completion_step
Definition: quest.h:32
quest_clear
void quest_clear(quest_definition *quest)
Definition: Quests.cpp:93
quest_definition::face
const Face * face
Definition: quest.h:44
quest_definition::quest_code
sstring quest_code
Definition: quest.h:39
quest_definition::parent
struct quest_definition * parent
Definition: quest.h:48
sstring
const typedef char * sstring
Definition: global.h:43
nlohmann::detail::void
j template void())
Definition: json.hpp:4099
quest_condition
struct quest_condition quest_condition
quest_destroy_steps
void quest_destroy_steps(quest_step_definition *step)
Definition: Quests.cpp:85
quest_definition::client_code
uint32_t client_code
Definition: quest.h:45
quest_condition::minstep
int minstep
Definition: quest.h:21
quest_step_definition::conditions
quest_condition * conditions
Definition: quest.h:34
quest_condition
Definition: quest.h:19
quest_create_step
quest_step_definition * quest_create_step(void)
Definition: Quests.cpp:49
give.op
op
Definition: give.py:33
quest_definition
Definition: quest.h:38
quest_destroy_step
void quest_destroy_step(quest_step_definition *step)
Definition: Quests.cpp:74
quest_write_condition
void quest_write_condition(char *buf, size_t len, const quest_condition *condition)
Definition: Quests.cpp:136
quest_create
quest_definition * quest_create(const char *name)
Definition: Quests.cpp:63
quest_step_definition::step_description
sstring step_description
Definition: quest.h:31
quest_condition::next
struct quest_condition * next
Definition: quest.h:25
quest_definition::quest_restart
int quest_restart
Definition: quest.h:43
give.name
name
Definition: give.py:27