Tramway SDK
quest.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_EXTENSIONS_KITCHENSINK_QUEST_H
5#define TRAM_SDK_EXTENSIONS_KITCHENSINK_QUEST_H
6
7#include <framework/value.h>
8
9#include <vector>
10
11namespace tram::Ext::Kitchensink {
12
13enum quest_t : int {
27
28
32};
33
37
39
42
43 int state;
44
47
48 void SetValue(Value);
55 void SetNot(name_t, name_t);
58 void SetScript(name_t);
59
60 void SetObjective(name_t, name_t, int);
61
63};
64
68
69 name_t condition; // condition, if any, for firing
70
71 name_t variable; // name for variable which will be set
72 Value value; // variable name for which will be set
73
75 void SetObjective(name_t name, int state);
76};
77
78struct Quest {
80
81 std::vector<QuestVariable> variables;
82 std::vector<QuestTrigger> triggers;
83
84 // TODO: add trigger script
85 // if can't find in trigger list, then call script
86
89
90 void FireTrigger(name_t);
91
92 static void Init();
93
94 static Quest* Find(name_t quest);
95};
96
97}
98
99#endif // TRAM_SDK_EXTENSIONS_KITCHENSINK_QUEST_H
Generic, type-safe union.
Definition: value.h:18
Definition: ai.cpp:16
quest_t
Definition: quest.h:13
@ QUEST_VAR_CONDITION_OR
Definition: quest.h:23
@ QUEST_VAR_VALUE_GREATER_OR_EQUAL
Definition: quest.h:18
@ QUEST_VAR_CONDITION_AND
Definition: quest.h:22
@ QUEST_VAR_CONDITION_NOT
Definition: quest.h:21
@ QUEST_TGR_SET_OBJECTIVE
Definition: quest.h:30
@ QUEST_VAR_CONDITION_SCRIPT
Definition: quest.h:24
@ QUEST_VAR_VALUE_IS
Definition: quest.h:15
@ QUEST_VAR_VALUE
Definition: quest.h:14
@ QUEST_VAR_OBJECTIVE
Definition: quest.h:25
@ QUEST_TGR_SET_VARIABLE
Definition: quest.h:29
@ QUEST_VAR_VALUE_LESS_OR_EQUAL
Definition: quest.h:20
@ QUEST_VAR_VALUE_GREATER
Definition: quest.h:17
@ QUEST_VAR_VALUE_IS_NOT
Definition: quest.h:16
@ QUEST_VAR_HAS_ITEM
Definition: quest.h:26
@ QUEST_VAR_VALUE_LESS
Definition: quest.h:19
@ QUEST_TGR_SHOW_MESSAGE
Definition: quest.h:31
Definition: quest.h:78
Value GetVariable(name_t)
Definition: quest.cpp:140
static void Init()
Definition: quest.cpp:214
name_t name
Definition: quest.h:79
static Quest * Find(name_t quest)
Definition: quest.cpp:189
void SetVariable(name_t, Value)
Definition: quest.cpp:151
void FireTrigger(name_t)
Definition: quest.cpp:167
std::vector< QuestVariable > variables
Definition: quest.h:81
std::vector< QuestTrigger > triggers
Definition: quest.h:82
name_t name
Definition: quest.h:66
name_t variable
Definition: quest.h:71
quest_t type
Definition: quest.h:67
name_t condition
Definition: quest.h:69
void SetObjective(name_t name, int state)
Definition: quest.cpp:132
void SetValue(name_t variable, Value)
Definition: quest.cpp:126
Value value
Definition: quest.h:72
void SetGreaterLess(name_t, name_t, name_t, name_t)
Definition: quest.cpp:44
name_t quest1
Definition: quest.h:45
Value value2
Definition: quest.h:41
void SetIsNot(name_t, name_t, name_t, name_t)
Definition: quest.cpp:29
Value value1
Definition: quest.h:40
void SetGreater(name_t, name_t, name_t, name_t)
Definition: quest.cpp:34
void SetScript(name_t)
Definition: quest.cpp:70
void SetAnd(name_t, name_t, name_t, name_t)
Definition: quest.cpp:60
quest_t type
Definition: quest.h:36
void SetGreaterLessOrEqual(name_t, name_t, name_t, name_t)
Definition: quest.cpp:49
void SetIs(name_t, name_t, name_t, name_t)
Definition: quest.cpp:21
int state
Definition: quest.h:43
Value Evaluate()
Definition: quest.cpp:84
name_t target
Definition: quest.h:38
name_t name
Definition: quest.h:35
void SetNot(name_t, name_t)
Definition: quest.cpp:54
void SetGreaterOrEqual(name_t, name_t, name_t, name_t)
Definition: quest.cpp:39
void SetOr(name_t, name_t, name_t, name_t)
Definition: quest.cpp:65
void SetObjective(name_t, name_t, int)
Definition: quest.cpp:76
name_t quest2
Definition: quest.h:46
void SetValue(Value)
Definition: quest.cpp:16
Definition: uid.h:11