-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstate.h
215 lines (188 loc) · 3.14 KB
/
state.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#pragma once
#include "camera.h"
#include "objects.h"
#include <ncurses.h>
#define MAX_CHESTS 100
#define MAX_CHESTS_PER_ROOM 2
/// Define o número máximo de itens que um jogador pode carregar
#define MAX_INVENTORY_SIZE 10
// Define o tipo de item
typedef enum
{
Item_ManaPotion,
Item_HealthPotion,
Item__Size,
Item_Key,
Item_Sword,
Item_BlastGun,
} Item;
typedef enum
{
ItemType_Disposable,
ItemType_Weapon
} ItemType;
typedef struct
{
ItemType type;
int count;
Item name;
float cooldown;
} ItemSlot;
typedef struct
{
ItemSlot items[MAX_INVENTORY_SIZE];
int size;
int selected_item;
} Inventory;
typedef struct
{
Inventory inventory;
Rect rect;
int is_open;
} Chest;
typedef enum
{
State_Game,
State_Menu,
State_Controlos,
State_Niveis,
State_Info,
State_Pause,
State_New_Game,
State_Over
} State;
typedef struct
{
int type;
int count;
} HotbarItem;
#define HOTBAR_SIZE 9
typedef struct
{
HotbarItem items[HOTBAR_SIZE];
int selected; // O item selecionado atualmente
} Hotbar;
typedef struct
{
RectFloat rect;
Vec2f velocity;
Vec2f direction;
int hp;
int maxHP;
int dmg;
int weight;
int kills;
int dmg_cooldown;
int attacking;
Hotbar hotbar;
} Warrior;
#define MAX_MOBS 20
typedef enum
{
MobType_Stupid,
MobType_Coward,
MobType_Intelligent,
MobType_Archer,
MobType__Size
} MobType;
typedef struct
{
float speed;
MobType type;
Warrior warrior;
int called;
Vec2i wander_to;
} Mob;
typedef struct
{
int hp;
int mana;
int maxMana;
int level;
int defense;
int rbp;
} Player_Stats;
typedef enum
{
LightType_Vision,
LightType_Torch
} LightType;
typedef struct
{
Rect position;
int radius;
} Torch;
typedef struct
{
Rect rect;
int radius;
Vec2f velocity;
} Star;
typedef struct
{
Camera camera;
CameraMode cam_mode;
Warrior player;
Player_Stats player_stats;
WINDOW *win_inventory;
WINDOW *win_game;
WINDOW *win_log;
WINDOW *win_minimap;
WINDOW *win_stats;
Bitmap collision;
Bitmap distance;
Bitmap light;
Torch *torches;
Chest *chests;
Rect portal;
int chests_count;
Mob *mobs;
Bitmap illuminated;
Inventory inventory;
int minimap_maximized;
int player_spike_damage_cooldown;
int chestCount;
Arrow *arrows;
int arrow_count;
int minimap_height;
int sidebar_width;
int player_stats_height;
int inventory_height;
} GameState;
typedef struct
{
WINDOW *win;
int highlight;
Star *stars;
int num_stars;
Bitmap star_map;
} StartMenuState;
typedef struct
{
WINDOW *win;
int highlight;
} StartNiveisState;
typedef struct
{
WINDOW *win;
int highlight;
} StartPauseState;
typedef struct
{
WINDOW *win;
int highlight;
} StartOverState;
typedef enum
{
BUFF_INCREASE_MOBS_HEALTH,
BUFF_INCREASE_MOBS_DAMAGE,
BUFF_INCREASE_MAX_MOBS,
BUFF_INCREASE_MOBS_SPEED,
BUFF_INCREASE_ROOMS
} BuffType;
typedef struct
{
RectFloat rect;
Vec2f direction;
int active;
} Blast;