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 #include <vector>
18 
21  sstring quest_code = nullptr;
22  int minstep = 0;
24  int maxstep = 0;
26 };
27 
30  int step = 0;
33  std::vector<quest_condition *> conditions;
34 };
35 
38  sstring quest_code = nullptr;
39  sstring quest_title = nullptr;
41  sstring quest_comment = nullptr;
42  int quest_restart = 0;
43  const Face *face = nullptr;
44  uint32_t client_code = 0;
45  bool quest_is_system = false;
46  std::vector<quest_step_definition *> steps;
47  struct quest_definition *parent = nullptr;
48 };
49 
50 typedef void(*quest_op)(const quest_definition *, void *);
51 
52 void quest_for_each(quest_op op, void *user);
53 
59 
65 
66 quest_definition *quest_create(const char *name);
71 
84 int quest_condition_from_string(quest_condition *condition, const char *buffer);
85 
92 void quest_write_condition(char *buf, size_t len, const quest_condition *condition);
93 
94 #endif /* QUEST_H */
Face
Definition: face.h:14
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:539
quest_condition::quest_code
sstring quest_code
Definition: quest.h:21
quest_condition::maxstep
int maxstep
Definition: quest.h:24
quest_op
void(* quest_op)(const quest_definition *, void *)
Definition: quest.h:50
quest_create_condition
quest_condition * quest_create_condition(void)
Definition: Quests.cpp:56
quest_definition::quest_description
sstring quest_description
Definition: quest.h:40
quest_destroy
void quest_destroy(quest_definition *quest)
Definition: Quests.cpp:95
quest_step_definition::step
int step
Definition: quest.h:30
quest_condition_from_string
int quest_condition_from_string(quest_condition *condition, const char *buffer)
Definition: Quests.cpp:100
quest_definition::quest_is_system
bool quest_is_system
Definition: quest.h:45
buf
StringBuffer * buf
Definition: readable.cpp:1565
quest_step_definition
Definition: quest.h:29
quest_definition::quest_title
sstring quest_title
Definition: quest.h:39
quest_definition::quest_comment
sstring quest_comment
Definition: quest.h:41
quest
Definition: quest.py:1
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:83
quest_definition::face
const Face * face
Definition: quest.h:43
quest_definition::quest_code
sstring quest_code
Definition: quest.h:38
quest_definition::parent
struct quest_definition * parent
Definition: quest.h:47
nlohmann::detail::void
j template void())
Definition: json.hpp:4099
quest_definition::client_code
uint32_t client_code
Definition: quest.h:44
quest_condition::minstep
int minstep
Definition: quest.h:22
quest_condition
Definition: quest.h:20
sstring
const typedef char * sstring
Definition: sstring.h:2
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:37
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:130
quest_create
quest_definition * quest_create(const char *name)
Definition: Quests.cpp:63
quest_step_definition::conditions
std::vector< quest_condition * > conditions
Definition: quest.h:33
quest_step_definition::step_description
sstring step_description
Definition: quest.h:31
quest_definition::quest_restart
int quest_restart
Definition: quest.h:42
give.name
name
Definition: give.py:27
quest_definition::steps
std::vector< quest_step_definition * > steps
Definition: quest.h:46