forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mtype.h
209 lines (196 loc) · 6.42 KB
/
mtype.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
#ifndef _MTYPE_H_
#define _MTYPE_H_
// SEE ALSO: monitemsdef.cpp, which defines data on which items any given
// monster may carry.
#include <string>
#include <math.h>
#include "mondeath.h"
#include "monattack.h"
#include "enums.h"
#include "color.h"
class mdeath;
enum mon_id {
mon_null = 0,
// Wildlife
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear,
// Friendly animals
mon_dog,
// Ants
mon_ant_larva, mon_ant, mon_ant_soldier, mon_ant_queen, mon_ant_fungus,
// Bees
mon_bee, mon_wasp,
// Worms
mon_graboid, mon_worm, mon_halfworm,
// Zombies
mon_zombie, mon_zombie_shrieker, mon_zombie_spitter, mon_zombie_electric,
mon_zombie_fast, mon_zombie_brute, mon_zombie_hulk, mon_zombie_fungus,
mon_boomer, mon_boomer_fungus, mon_skeleton, mon_zombie_necro,
mon_zombie_scientist,
// Triffids
mon_triffid, mon_triffid_young, mon_triffid_queen,
// Fungaloids
mon_fungaloid, mon_fungaloid_dormant, mon_fungaloid_young, mon_spore,
mon_fungaloid_queen, mon_fungal_wall,
// Blobs
mon_blob, mon_blob_small,
// Sewer mutants
mon_chud, mon_one_eye, mon_crawler,
// Sewer animals
mon_sewer_fish, mon_sewer_snake, mon_sewer_rat,
// Swamp monsters
mon_mosquito, mon_dragonfly, mon_centipede, mon_frog, mon_slug,
mon_dermatik_larva, mon_dermatik,
// SPIDERS
mon_spider_wolf, mon_spider_web, mon_spider_jumping, mon_spider_trapdoor,
mon_spider_widow,
// Unearthed Horrors
mon_dark_wyrm, mon_amigara_horror, mon_dog_thing, mon_headless_dog_thing,
mon_thing,
// Spiral monsters
mon_human_snail, mon_twisted_body, mon_vortex,
// Subspace monsters
mon_flying_polyp, mon_hunting_horror, mon_mi_go, mon_yugg, mon_gelatin,
mon_flaming_eye, mon_kreck, mon_blank, mon_gozu,
// Robots
mon_eyebot, mon_manhack, mon_skitterbot, mon_secubot, mon_copbot, mon_molebot,
mon_tripod, mon_chickenbot, mon_tankbot, mon_turret,
// Hallucinations
mon_hallu_zom, mon_hallu_bee, mon_hallu_ant, mon_hallu_mom,
num_monsters
};
enum m_size {
MS_TINY = 0, // Rodent
MS_SMALL, // Half human
MS_MEDIUM, // Human
MS_LARGE, // Cow
MS_HUGE // TAAAANK
};
// Feel free to add to m_flags. Order shouldn't matter, just keep it tidy!
// There is a maximum number of 32 flags, including MF_MAX, so...
// And comment them well. ;)
// mfb(n) converts a flag to its appropriate position in mtype's bitfield
#ifndef mfb
#define mfb(n) long(pow(2,(long)n))
#endif
enum m_flags {
MF_SEES, // It can see you (and will run/follow)
MF_HEARS, // It can hear you
MF_GOODHEARING, // Pursues sounds more than most monsters
MF_SMELLS, // It can smell you
MF_STUMBLES, // Stumbles in its movement
MF_WARM, // Warm blooded
MF_NOHEAD, // Headshots not allowed!
MF_HARDTOSHOOT, // Some shots are actually misses
MF_BASHES, // Bashes down doors
MF_DESTROYS, // Bashes down walls and more
MF_POISON, // Poisonous to eat
MF_VENOM, // Attack may poison the player
MF_BADVENOM, // Attack may SEVERELY poison the player
MF_WEBWALK, // Doesn't destroy webs
MF_DIGS, // Digs through the ground
MF_FLIES, // Can fly (over water, etc)
MF_AQUATIC, // Confined to water
MF_SWIMS, // Treats water as 50 movement point terrain
MF_ATTACKMON, // Attacks other monsters
MF_ANIMAL, // Is an "animal" for purposes of the Animal Empath trait
MF_PLASTIC, // Absorbs physical damage to a great degree
MF_SUNDEATH, // Dies in full sunlight
MF_ACIDPROOF, // Immune to acid
MF_ACIDTRAIL, // Leaves a trail of acid
MF_FIREY, // Burns stuff and is immune to fire
MF_SHOCK, // Shocks the player if they attack w/out gloves
MF_ELECTRONIC, // e.g. a robot; affected by emp blasts, and other stuff
MF_FUR, // May produce fur when butchered.
MF_LEATHER, // May produce leather when butchered
MF_IMMOBILE, // Doesn't move (e.g. turrets)
MF_FRIENDLY_SPECIAL, // Use our special attack, even if friendly
MF_QUEEN, // When it dies, local populations start to die off too
MF_MAX // Sets the length of the flags - obviously MUST be last
};
struct mtype {
int id;
std::string name;
std::string description;
char sym; // Symbol on the map
nc_color color;// Color of symbol (see color.h)
m_size size;
material mat; // See enums.h for material list. Generally, flesh; veggy?
unsigned long flags : MF_MAX; // Bitfield of m_flags
unsigned char frequency; // How often do these show up? 0 (never) to ??
int difficulty;// Used all over; 30 min + (diff-3)*30 min = earlist appearance
signed char agro; // How likely to attack; -5 to 5
unsigned int speed; // Speed; human = 100
unsigned char melee_skill; // Melee skill; should be 0 to 5
unsigned char melee_dice; // Number of dice on melee hit
unsigned char melee_sides; // Number of sides those dice have
unsigned char melee_cut; // Bonus cutting damage
unsigned char sk_dodge; // Dodge skill; should be 0 to 5
unsigned char armor; // Natural armor
signed char item_chance; // Higher # means higher chance of loot
// Negative # means one item gen'd, tops
int hp;
unsigned char sp_freq; // How long sp_attack takes to charge
void (mdeath::*dies)(game *, monster *); // What happens when this monster dies
void (mattack::*sp_attack)(game *, monster *); // This monster's special attack
// Default constructor
mtype () {
id = 0;
name = "human";
description = "";
sym = ' ';
color = c_white;
size = MS_MEDIUM;
mat = FLESH;
flags = 0;
difficulty = 0;
frequency = 0;
agro = 0;
speed = 0;
melee_skill = 0;
melee_dice = 0;
melee_sides = 0;
melee_cut = 0;
sk_dodge = 0;
armor = 0;
hp = 0;
sp_freq = 0;
item_chance = 0;
dies = NULL;
sp_attack = NULL;
}
// Non-default (messy)
mtype (int pid, std::string pname, char psym, nc_color pcolor, m_size psize,
material pmat, unsigned pflags, unsigned char pfreq, unsigned int pdiff,
signed char pagro, unsigned int pspeed, unsigned char pml_skill,
unsigned char pml_dice, unsigned char pml_sides, unsigned char pml_cut,
unsigned char pdodge, unsigned char parmor, signed char pitem_chance,
int php, unsigned char psp_freq,
void (mdeath::*pdies) (game *, monster *),
void (mattack::*psp_attack)(game *, monster *),
std::string pdescription ) {
id = pid;
name = pname;
sym = psym;
color = pcolor;
size = psize;
mat = pmat;
flags = pflags;
frequency = pfreq;
difficulty = pdiff;
agro = pagro;
speed = pspeed;
melee_skill = pml_skill;
melee_dice = pml_dice;
melee_sides = pml_sides;
melee_cut = pml_cut;
sk_dodge = pdodge;
armor = parmor;
item_chance = pitem_chance;
hp = php;
sp_freq = psp_freq;
dies = pdies;
sp_attack = psp_attack;
description = pdescription;
}
};
#endif