-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdungeon.h
112 lines (91 loc) · 4.87 KB
/
dungeon.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
#ifndef DUNGEON_H
#define DUNGEON_H
#include "Character.h" /*TODO remove?*/
#include "Monster.h"
#include "Item.h"
#include <stdint.h>
#include "Cell_Pair.h"
#include <queue>
#define nRows 105
#define nCols 160
typedef struct Room{
int x;
int y;
uint8_t width;
uint8_t height;
}Room;
typedef struct Dungeon{
Room* rooms;
int num_rooms;
}Dungeon;
enum chances {
ITEM_SPAWN,
ITEM_REVALUE,
PC_RAD,
SHOP_MAX,
PESOS_DROP,
NOTHING
};
# ifdef __cplusplus
template <class T> void printmon(T* object);//TODO: remove C Linkage so this function can join the rest of them
void render_partial(Cell map[][nCols], int chars[][nCols], Character* monsts[], Pair start, Pair* newPos);
/*new stuff*/
void remove_items(std::vector<Item*>& items);
void addItems(Dungeon* dungeon, std::vector<Item*>& items, int item_map[][nCols], int& num_items);
void render(int chars[][nCols], Character* monsts[], int item_map[][nCols], std::vector<Item*>& items, Pair start, Pair* newPos);
void generic_render(Cell map[][nCols], int chars[][nCols], Character* monsts[], int item_map[][nCols], std::vector<Item*>& items, Pair start, Pair* newPos, bool complete);
void render_partial(Cell map[][nCols], int chars[][nCols], Character* monsts[], int item_map[][nCols], std::vector<Item*>& items, Pair start, Pair* newPos);
extern "C" {
# endif
int create_room(Cell map[][nCols], int x, int y, uint8_t* width, uint8_t* height);
int rand_gen(int min, int max);
int connect_rooms(Cell map[][nCols], Cell p, Cell q);
int update_cell(Cell* p, char value, unsigned char hardness);
int write_room(Cell map[][nCols], Room room);
int add_room(Dungeon* rlg, Room room);
void render_dungeon(Cell map[][nCols], int chars[][nCols], Character* monsts[]);
int getRoom(Dungeon d, int x, int y);
Pair determine_position(Room room);
bool in_room(const Room& room, const Pair& position);
void create_dungeon(Dungeon* dungeon, Cell map[][nCols], Cell room_cells[]);
void load_dungeon(FILE* dungeon_file, Dungeon* dungeon, Cell map[][nCols], char* dungeon_title, uint32_t* version, uint32_t* size_dungeon_file);
int cell_equals(void* c1, void* c2);
void BFS_impl(int dist[][nCols], Cell map[][nCols], Queue* q, Cell pc);
void Djikstra_impl(int t_dist[][nCols], Cell map[][nCols], Queue* q, Cell pc);
void print_Character(void* Character);
int char_equals(void* c1, void* c2);
Character* pc_init(Character* pc, Room room);
Pair* getInputC(Pair* target);
Pair* look_mode(Pair *target, int* control_mode);
// void addCharcters(Dungeon* dungeon, std::priority_queue<Character, std::vector<Character> >* evt, int nummon, Character* characters[], int chars[][nCols], unsigned int pace[]);
// void delete_dungeon(Dungeon* dungeon, std::priority_queue<Character, std::vector<Character> >* evt, Cell map[][nCols]);
void add_stairs(Dungeon* dungeon, Cell map[][nCols]);
void delete_Characters(Character* characters[], int num_characters);
void updateSight(Character* pc, Cell map[][nCols], int items[][nCols]);
Item** addItems(Dungeon* dungeon, Item** items, int item_map[][nCols], int* num_items);
void addCharcters(Dungeon* dungeon, Queue* evt, int nummon, Character* characters[], int chars[][nCols], unsigned int pace[]);
void* delete_items(Item** items, int& num_items);
void delete_dungeon(Dungeon* dungeon, Queue* evt, Cell map[][nCols]);
void add_shops(Dungeon* dungeon, Cell map[][nCols]);
void clearShop(std::vector<Item*>& wShop);
/*ncurses*/
void ncurses_init();
// void printmon(Character* Character);
void log_message(const char* message);
void nrender_dungeon(Cell map[][nCols], int chars[][nCols], Character* monsts[]);
void pc_render_partial(Cell map[][nCols], int chars[][nCols], Character* monsts[], Pair start, Pair* newPos);
// void render(int chars[][nCols], Character* monsts[], Pair start, Pair* newPos);
void render(int chars[][nCols], Character* monsts[], int item_map[][nCols], Item** items, Pair start, Pair* newPos);
void render_partial(Cell map[][nCols], int chars[][nCols], Character* monsts[], int item_map[][nCols], Item** items, Pair start, Pair* newPos);
void generic_render(Cell map[][nCols], int chars[][nCols], Character* monsts[], int item_map[][nCols], Item** items, Pair start, Pair* newPos, bool complete);
void custom_render(int chars[][nCols], Character* monsts[], int item_map[][nCols], std::vector<Item*>& items, Pair start, Pair* newPos, char value, const Pair& curr);
Pair select_position(Pair curr_pos, const Room& boundary, int chars[][nCols], Character* characters[], int item_map[][nCols], std::vector<Item*>& items, Pair start, char value);
// void endgame(Dungeon* dungeon, Queue* game_queue, const char* endmessage);
unsigned int addItem(int id, std::vector<Item*>& items);
bool isRanged(Item* item);
void item_drop(std::vector<Item*>& items, int chance, int item_map[][nCols], const Pair& target);
// void clear_queue(std::priority_queue<Character*, std::vector<Character*>, CharacterComparator>* q); //TODO remove
# ifdef __cplusplus
}
# endif
#endif