forked from Whales/Cataclysm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonster_type.h
78 lines (62 loc) · 1.46 KB
/
monster_type.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
#ifndef _MONSTER_TYPE_H_
#define _MONSTER_TYPE_H_
#include "glyph.h"
#include "enum.h"
#include "attack.h"
#include "entity_ai.h"
#include "dice.h"
#include <string>
#include <istream>
#include <vector>
struct Monster_genus;
struct Monster_type
{
Monster_type();
~Monster_type();
Monster_genus *genus;
std::string name;
std::string display_name;
std::string display_name_plural;
int uid;
glyph sym;
Dice hp_dice;
bool hp_set;
int speed;
int chance;
std::vector<Attack> attacks;
std::vector<Ranged_attack> ranged_attacks;
int total_attack_weight;
int total_ranged_attack_weight;
Entity_AI AI;
void set_genus(Monster_genus *mg);
void assign_uid(int id);
std::string get_data_name();
std::string get_name();
std::string get_name_plural();
bool load_data(std::istream &data);
bool has_sense(Sense_type type);
private:
bool attacks_copied_from_genus;
bool ranged_attacks_copied_from_genus;
bool senses_copied_from_genus;
std::vector<bool> senses;
};
struct Monster_genus
{
Monster_genus();
~Monster_genus();
std::string name;
std::string display_name;
int uid;
Monster_type default_values; // Default values for monsters in this genus
// Spawning stuff
std::vector<Monster_type*> members;
int total_chance;
void add_member(Monster_type* member);
Monster_type* random_member();
void assign_uid(int id);
std::string get_data_name();
std::string get_name();
bool load_data(std::istream &data);
};
#endif