forked from arcadia-xenos/progress-quest
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathc_world.h
127 lines (103 loc) · 2.4 KB
/
c_world.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#ifndef C_WORLD_H
#define C_WORLD_H
#include "entity.h"
#include "c_spell.h"
#include "c_item.h"
#include "c_monster.h"
#include "pq7_config.h"
#include <iostream>
#include <fstream>
#include <QObject>
#include <QList>
#include <QMessageBox>
#include <QJsonObject>
typedef enum {
pq_debug_none = 0,
pq_debug_zero_action_timer = 1 << 0,
pq_debug_always_trigger_action = 1 << 1,
pq_debug_action_triggers_save = 1 << 2,
pq_debug_reserved_1 = 1 << 3,
pq_debug_active = 1 << 15
} t_pq_debug;
enum class State {
Reserved1,
HeadingToKillingFields,
Fighting,
HeadingToTown,
SellingOff,
BuyingNewEquipment,
InterplotCinematic
};
class c_World : public QObject
{
Q_OBJECT
public:
explicit c_World(QObject *parent = nullptr);
/*
* Player instance - gamewide
*/
Entity *Player = nullptr;
/*
* Monster instance - gamewide
*/
c_Monster *Monster = nullptr;
c_Monster *Nemesis = nullptr;
/*
* State values
*/
int Act = 0;
QString Action;
State currentState = State::Reserved1;
/*
* Progress Bar values
*/
int pb_action = 0;
int pb_experience = 0;
int pb_encumbrance = 0;
int pb_plot = 0;
int pb_quest = 0;
/*
* Quest history
*/
QStringList quests;
/*
* Timer Interval
*/
int actionTime = 0;
/*
* Flag for Post Load UI Processing
*/
bool isLoaded = false;
QStringList interplotCinematic;
/*
* Public Methods
*/
c_Item *makeEqByGrade(Equipment eqtype, int grade);
void initPlayer();
bool isDebugFlagSet(t_pq_debug flag);
bool isDebugFlagReset(t_pq_debug flag);
void setDebugFlag(t_pq_debug flag);
void resetDebugFlag(t_pq_debug flag);
void toggleDebugFlag(t_pq_debug flag);
void debugClear();
void debugActive();
private:
// save / load helpers
QStringList arrayToList(QJsonArray array);
/*
* Debug flags
*/
quint32 debug = pq_debug_none;
signals:
//void debugChanged(quint32 dbgValue);
//void gameSaved();
//void gameLoaded();
public slots:
void save();
void save(QString filename);
void load();
void load(QString filename);
void load(QJsonObject root);
};
#endif // C_WORLD_H
extern c_World *game;