forked from Whales/Cataclysm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterrain.h
66 lines (54 loc) · 1.46 KB
/
terrain.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
#ifndef _TERRAIN_H_
#define _TERRAIN_H_
#include "glyph.h"
#include "enum.h"
//#include "tool.h"
#include "dice.h"
#include <vector>
#include <map>
Terrain_flag lookup_terrain_flag(std::string name);
std::string terrain_flag_name(Terrain_flag flag);
struct Terrain;
struct Terrain_smash
{
Terrain_smash();
~Terrain_smash(){}
std::string failure_sound;
std::string success_sound;
Dice armor[DAMAGE_MAX];
int ignore_chance;
bool load_data(std::istream &data, std::string name = "unknown");
};
struct Terrain
{
int uid;
std::string name;
std::string display_name;
glyph sym;
unsigned int movecost;
/* Height ranged from 0-100 and reflects how much vertical space is blocked (for
* line of sight calculations). It defaults to 100.
*/
unsigned int height;
unsigned int hp; // Defaults to 0. 0 HP means it's indestructible.
Terrain_smash smash;
bool smashable;
std::string open_result;
std::string close_result;
std::string destroy_result;
// A map of what happens when a tool' terrain_action is applied
std::map<std::string,std::string> tool_result;
bool can_smash() { return smashable; }
bool can_open() { return !open_result.empty(); }
bool can_close() { return !close_result.empty(); }
Terrain();
~Terrain(){}
std::string get_data_name();
std::string get_name();
void assign_uid(int id) { uid = id; }
bool load_data(std::istream &data);
bool has_flag(Terrain_flag flag);
private:
std::vector<bool> flags;
};
#endif