1 /**
2  * @file monstdat.h
3  *
4  * Interface of all monster data.
5  */
6 #ifndef __MONSTDAT_H__
7 #define __MONSTDAT_H__
8 
9 DEVILUTION_BEGIN_NAMESPACE
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 typedef enum _mai_id {
16 	AI_ZOMBIE,
17 	AI_FAT,
18 	AI_SKELSD,
19 	AI_SKELBOW,
20 	AI_SCAV,
21 	AI_RHINO,
22 	AI_GOATMC,
23 	AI_GOATBOW,
24 	AI_FALLEN,
25 	AI_MAGMA,
26 	AI_SKELKING,
27 	AI_BAT,
28 	AI_GARG,
29 	AI_CLEAVER,
30 	AI_SUCC,
31 	AI_SNEAK,
32 	AI_STORM,
33 	AI_FIREMAN,
34 	AI_GARBUD,
35 	AI_ACID,
36 	AI_ACIDUNIQ,
37 	AI_GOLUM,
38 	AI_ZHAR,
39 	AI_SNOTSPIL,
40 	AI_SNAKE,
41 	AI_COUNSLR,
42 	AI_MEGA,
43 	AI_DIABLO,
44 	AI_LAZURUS,
45 	AI_LAZHELP,
46 	AI_LACHDAN,
47 	AI_WARLORD,
48 	AI_FIREBAT,
49 	AI_TORCHANT,
50 	AI_HORKDMN,
51 	AI_LICH,
52 	AI_ARCHLICH,
53 	AI_PSYCHORB,
54 	AI_NECROMORB,
55 	AI_BONEDEMON,
56 	AI_INVALID = -1,
57 } _mai_id;
58 
59 typedef enum _mc_id {
60 	MC_UNDEAD,
61 	MC_DEMON,
62 	MC_ANIMAL,
63 } _mc_id;
64 
65 typedef enum monster_resistance {
66 	// clang-format off
67 	RESIST_MAGIC     = 0x01,
68 	RESIST_FIRE      = 0x02,
69 	RESIST_LIGHTNING = 0x04,
70 	IMMUNE_MAGIC     = 0x08,
71 	IMMUNE_FIRE      = 0x10,
72 	IMMUNE_LIGHTNING = 0x20,
73 	IMMUNE_NULL_40   = 0x40,
74 	IMMUNE_ACID      = 0x80,
75 	// clang-format on
76 } monster_resistance;
77 
78 typedef struct MonsterData {
79 	Sint32 width;
80 	Sint32 mImage;
81 	const char *GraphicType;
82 	bool has_special;
83 	const char *sndfile;
84 	bool snd_special;
85 	bool has_trans;
86 	const char *TransFile;
87 	Sint32 Frames[6];
88 	Sint32 Rate[6];
89 	const char *mName;
90 	Sint8 mMinDLvl;
91 	Sint8 mMaxDLvl;
92 	Sint8 mLevel;
93 	Sint32 mMinHP;
94 	Sint32 mMaxHP;
95 	_mai_id mAi;
96 	/** Usign monster_flag as bitflags */
97 	Sint32 mFlags;
98 	Uint8 mInt;
99 	Uint16 mHit;
100 	Uint8 mAFNum;
101 	Uint8 mMinDamage;
102 	Uint8 mMaxDamage;
103 	Uint16 mHit2;
104 	Uint8 mAFNum2;
105 	Uint8 mMinDamage2;
106 	Uint8 mMaxDamage2;
107 	Uint8 mArmorClass;
108 	_mc_id mMonstClass;
109 	/** Using monster_resistance as bitflags */
110 	Uint16 mMagicRes;
111 	/** Using monster_resistance as bitflags */
112 	Uint16 mMagicRes2;
113 	Uint16 mTreasure; // TODO Create enum
114 	Sint8 mSelFlag;   // TODO Create enum
115 	Uint16 mExp;
116 } MonsterData;
117 
118 typedef enum _monster_id {
119 	MT_NZOMBIE,
120 	MT_BZOMBIE,
121 	MT_GZOMBIE,
122 	MT_YZOMBIE,
123 	MT_RFALLSP,
124 	MT_DFALLSP,
125 	MT_YFALLSP,
126 	MT_BFALLSP,
127 	MT_WSKELAX,
128 	MT_TSKELAX,
129 	MT_RSKELAX,
130 	MT_XSKELAX,
131 	MT_RFALLSD,
132 	MT_DFALLSD,
133 	MT_YFALLSD,
134 	MT_BFALLSD,
135 	MT_NSCAV,
136 	MT_BSCAV,
137 	MT_WSCAV,
138 	MT_YSCAV,
139 	MT_WSKELBW,
140 	MT_TSKELBW,
141 	MT_RSKELBW,
142 	MT_XSKELBW,
143 	MT_WSKELSD,
144 	MT_TSKELSD,
145 	MT_RSKELSD,
146 	MT_XSKELSD,
147 	MT_INVILORD,
148 	MT_SNEAK,
149 	MT_STALKER,
150 	MT_UNSEEN,
151 	MT_ILLWEAV,
152 	MT_LRDSAYTR,
153 	MT_NGOATMC,
154 	MT_BGOATMC,
155 	MT_RGOATMC,
156 	MT_GGOATMC,
157 	MT_FIEND,
158 	MT_BLINK,
159 	MT_GLOOM,
160 	MT_FAMILIAR,
161 	MT_NGOATBW,
162 	MT_BGOATBW,
163 	MT_RGOATBW,
164 	MT_GGOATBW,
165 	MT_NACID,
166 	MT_RACID,
167 	MT_BACID,
168 	MT_XACID,
169 	MT_SKING,
170 	MT_CLEAVER,
171 	MT_FAT,
172 	MT_MUDMAN,
173 	MT_TOAD,
174 	MT_FLAYED,
175 	MT_WYRM,
176 	MT_CAVSLUG,
177 	MT_DVLWYRM,
178 	MT_DEVOUR,
179 	MT_NMAGMA,
180 	MT_YMAGMA,
181 	MT_BMAGMA,
182 	MT_WMAGMA,
183 	MT_HORNED,
184 	MT_MUDRUN,
185 	MT_FROSTC,
186 	MT_OBLORD,
187 	MT_BONEDMN,
188 	MT_REDDTH,
189 	MT_LTCHDMN,
190 	MT_UDEDBLRG,
191 	MT_INCIN,
192 	MT_FLAMLRD,
193 	MT_DOOMFIRE,
194 	MT_HELLBURN,
195 	MT_STORM,
196 	MT_RSTORM,
197 	MT_STORML,
198 	MT_MAEL,
199 	MT_BIGFALL,
200 	MT_WINGED,
201 	MT_GARGOYLE,
202 	MT_BLOODCLW,
203 	MT_DEATHW,
204 	MT_MEGA,
205 	MT_GUARD,
206 	MT_VTEXLRD,
207 	MT_BALROG,
208 	MT_NSNAKE,
209 	MT_RSNAKE,
210 	MT_BSNAKE,
211 	MT_GSNAKE,
212 	MT_NBLACK,
213 	MT_RTBLACK,
214 	MT_BTBLACK,
215 	MT_RBLACK,
216 	MT_UNRAV,
217 	MT_HOLOWONE,
218 	MT_PAINMSTR,
219 	MT_REALWEAV,
220 	MT_SUCCUBUS,
221 	MT_SNOWWICH,
222 	MT_HLSPWN,
223 	MT_SOLBRNR,
224 	MT_COUNSLR,
225 	MT_MAGISTR,
226 	MT_CABALIST,
227 	MT_ADVOCATE,
228 	MT_GOLEM,
229 	MT_DIABLO,
230 	MT_DARKMAGE,
231 	MT_HELLBOAR,
232 	MT_STINGER,
233 	MT_PSYCHORB,
234 	MT_ARACHNON,
235 	MT_FELLTWIN,
236 	MT_HORKSPWN,
237 	MT_VENMTAIL,
238 	MT_NECRMORB,
239 	MT_SPIDLORD,
240 	MT_LASHWORM,
241 	MT_TORCHANT,
242 	MT_HORKDMN,
243 	MT_DEFILER,
244 	MT_GRAVEDIG,
245 	MT_TOMBRAT,
246 	MT_FIREBAT,
247 	MT_SKLWING,
248 	MT_LICH,
249 	MT_CRYPTDMN,
250 	MT_HELLBAT,
251 	MT_BONEDEMN,
252 	MT_ARCHLICH,
253 	MT_BICLOPS,
254 	MT_FLESTHNG,
255 	MT_REAPER,
256 	MT_NAKRUL,
257 	NUM_MTYPES,
258 	MT_INVALID = -1,
259 } _monster_id;
260 
261 typedef enum _monster_availability {
262 	MAT_NEVER,
263 	MAT_ALWAYS,
264 	MAT_RETAIL,
265 } _monster_availability;
266 
267 typedef struct UniqMonstStruct {
268 	_monster_id mtype;
269 	const char *mName;
270 	const char *mTrnName;
271 	Uint8 mlevel;
272 	Uint16 mmaxhp;
273 	_mai_id mAi;
274 	Uint8 mint;
275 	Uint8 mMinDamage;
276 	Uint8 mMaxDamage;
277 	/** Using monster_resistance as bitflags */
278 	Uint16 mMagicRes;
279 	Uint16 mUnqAttr; // TODO create enum
280 	Uint8 mUnqVar1;
281 	Uint8 mUnqVar2;
282 	Sint32 mtalkmsg;
283 } UniqMonstStruct;
284 
285 extern const MonsterData monsterdata[];
286 extern const _monster_id MonstConvTbl[];
287 extern const char MonstAvailTbl[];
288 extern const UniqMonstStruct UniqMonst[];
289 
290 #ifdef __cplusplus
291 }
292 #endif
293 
294 DEVILUTION_END_NAMESPACE
295 
296 #endif /* __MONSTDAT_H__ */
297