World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Monsters.cpp
См. документацию.
2 
3 #include "Engine/Engine.h"
4 
5 #include "../LOD.h"
6 #include "../Tables/FrameTableInc.h"
7 
10 
11 unsigned int ParseSpellType(struct FrameTableTxtLine *tbl, int *next_token);
12 
13 int ParseAttackType(const char *damage_type_str);
14 void ParseDamage(char *damage_str, unsigned __int8 *dice_rolls,
15  unsigned __int8 *dice_sides, unsigned __int8 *dmg_bonus);
16 int ParseMissleAttackType(const char *missle_attack_str);
17 int ParseSpecialAttack(const char *spec_att_str);
18 
19 //----- (004548E2) --------------------------------------------------------
20 unsigned int ParseSpellType(struct FrameTableTxtLine *tbl, int *next_token) {
21  if (!tbl->pProperties[0]) {
22  ++*next_token;
23  return 0;
24  }
25  if (!_stricmp(tbl->pProperties[0], "Dispel")) { // dispel magic
26  ++*next_token;
27  return 80;
28  } else if (!_stricmp(tbl->pProperties[0], "Day")) { // day of protection
29  *next_token += 2;
30  return 85;
31  } else if (!_stricmp(tbl->pProperties[0], "Hour")) { // hour of power
32  *next_token += 2;
33  return 86;
34  } else if (!_stricmp(tbl->pProperties[0], "Shield")) {
35  return 17;
36  } else if (!_stricmp(tbl->pProperties[0], "Spirit")) {
37  ++*next_token;
38  return 52;
39  } else if (!_stricmp(tbl->pProperties[0], "Power")) { // power cure
40  ++*next_token;
41  return 77;
42  } else if (!_stricmp(tbl->pProperties[0], "Meteor")) { // meteot shower
43  ++*next_token;
44  return 9;
45  } else if (!_stricmp(tbl->pProperties[0], "Lightning")) { // Lightning bolt
46  ++*next_token;
47  return 18;
48  } else if (!_stricmp(tbl->pProperties[0], "Implosion")) {
49  return 20;
50  } else if (!_stricmp(tbl->pProperties[0], "Stone")) {
51  ++*next_token;
52  return 38;
53  } else if (!_stricmp(tbl->pProperties[0], "Haste")) {
54  return 5;
55  } else if (!_stricmp(tbl->pProperties[0], "Heroism")) {
56  return 51;
57  } else if (!_stricmp(tbl->pProperties[0], "Pain")) { // pain reflection
58  ++*next_token;
59  return 95;
60  } else if (!_stricmp(tbl->pProperties[0], "Sparks")) {
61  return 15;
62  } else if (!_stricmp(tbl->pProperties[0], "Light")) {
63  ++*next_token;
64  return 78;
65  } else if (!_stricmp(tbl->pProperties[0], "Toxic")) { // toxic cloud
66  ++*next_token;
67  return 90;
68  } else if (!_stricmp(tbl->pProperties[0], "ShrapMetal")) {
69  return 93;
70  } else if (!_stricmp(tbl->pProperties[0], "Paralyze")) {
71  return 81;
72  } else if (!_stricmp(tbl->pProperties[0], "Fireball")) {
73  return 6;
74  } else if (!_stricmp(tbl->pProperties[0], "Incinerate")) {
75  return 11;
76  } else if (!_stricmp(tbl->pProperties[0], "Fire")) {
77  ++*next_token;
78  return 2;
79  } else if (!_stricmp(tbl->pProperties[0], "Rock")) {
80  ++*next_token;
81  return 41;
82  } else if (!_stricmp(tbl->pProperties[0], "Mass")) {
83  ++*next_token;
84  return 44;
85  } else if (!_stricmp(tbl->pProperties[0], "Ice")) {
86  ++*next_token;
87  return 26;
88  } else if (!_stricmp(tbl->pProperties[0], "Acid")) {
89  ++*next_token;
90  return 29;
91  } else if (!_stricmp(tbl->pProperties[0], "Bless")) {
92  return 46;
93  } else if (!_stricmp(tbl->pProperties[0], "Dragon")) {
94  ++*next_token;
95  return 97;
96  } else if (!_stricmp(tbl->pProperties[0], "Reanimate")) {
97  return 89;
98  } else if (!_stricmp(tbl->pProperties[0], "Summon")) {
99  ++*next_token;
100  return 82;
101  } else if (!_stricmp(tbl->pProperties[0], "Fate")) {
102  return 47;
103  } else if (!_stricmp(tbl->pProperties[0], "Harm")) {
104  return 70;
105  } else if (!_stricmp(tbl->pProperties[0], "Mind")) {
106  ++*next_token;
107  return 57;
108  } else if (!_stricmp(tbl->pProperties[0], "Blades")) {
109  return 39;
110  } else if (!_stricmp(tbl->pProperties[0], "Psychic")) {
111  ++*next_token;
112  return 65;
113  } else if (!_stricmp(tbl->pProperties[0], "Hammerhands")) {
114  return 73;
115  } else {
116  logger->Warning(
117  L"%S", StringPrintf("Unknown monster spell %s", tbl->pProperties[0])
118  .c_str());
119  ++*next_token;
120  return 0;
121  }
122 }
123 
124 //----- (00454CB4) --------------------------------------------------------
125 int ParseAttackType(const char *damage_type_str) {
126  switch (tolower(*damage_type_str)) {
127  case 'f':
128  return 0; // fire
129  case 'a':
130  return 1; // air
131  case 'w':
132  return 2; // water
133  case 'e':
134  return 3; // earth
135 
136  case 's':
137  return 6; // spirit
138  case 'm':
139  return 7; // mind
140  // m ?? 8
141  case 'l':
142  return 9; // light
143  case 'd':
144  return 10; // dark
145  // d?? 11
146  }
147  return 4; // phis
148 }
149 
150 //----- (00454D7D) --------------------------------------------------------
151 void ParseDamage(char *damage_str, unsigned __int8 *dice_rolls,
152  unsigned __int8 *dice_sides, unsigned __int8 *dmg_bonus) {
153  int str_len = 0;
154  int str_pos = 0;
155  bool dice_flag = false;
156 
157  *dice_rolls = 0;
158  *dice_sides = 1;
159  *dmg_bonus = 0;
160 
161  str_len = strlen(damage_str);
162  if (str_len <= 0) return;
163  for (str_pos = 0; str_pos < str_len; ++str_pos) {
164  if (tolower(damage_str[str_pos]) == 'd') {
165  damage_str[str_pos] = '\0';
166  *dice_rolls = atoi(damage_str);
167  *dice_sides = atoi(&damage_str[str_pos + 1]);
168  dice_flag = true;
169  damage_str[str_pos] = 'd';
170  } else if (tolower(damage_str[str_pos]) == '+') {
171  *dmg_bonus = atoi(&damage_str[str_pos + 1]);
172  }
173  }
174  if (!dice_flag) {
175  if ((*damage_str >= '0') && (*damage_str <= '9')) {
176  *dice_rolls = atoi(damage_str);
177  *dice_sides = 1;
178  }
179  }
180 }
181 
182 //----- (00454E3A) --------------------------------------------------------
183 int ParseMissleAttackType(const char *missle_attack_str) {
184  if (!_stricmp(missle_attack_str, "ARROW"))
185  return 1;
186  else if (!_stricmp(missle_attack_str, "ARROWF"))
187  return 2;
188  else if (!_stricmp(missle_attack_str, "FIRE"))
189  return 3;
190  else if (!_stricmp(missle_attack_str, "AIR"))
191  return 4;
192  else if (!_stricmp(missle_attack_str, "WATER"))
193  return 5;
194  else if (!_stricmp(missle_attack_str, "EARTH"))
195  return 6;
196  else if (!_stricmp(missle_attack_str, "SPIRIT"))
197  return 7;
198  else if (!_stricmp(missle_attack_str, "MIND"))
199  return 8;
200  else if (!_stricmp(missle_attack_str, "BODY"))
201  return 9;
202  else if (!_stricmp(missle_attack_str, "LIGHT"))
203  return 10;
204  else if (!_stricmp(missle_attack_str, "DARK"))
205  return 11;
206  else if (!_stricmp(missle_attack_str, "ENER"))
207  return 13;
208  else
209  return 0;
210 }
211 
212 int ParseSpecialAttack(char *spec_att_str) {
213  _strlwr(spec_att_str);
214  if (strstr(spec_att_str, "curse"))
215  return 1;
216  else if (strstr(spec_att_str, "weak"))
217  return 2;
218  else if (strstr(spec_att_str, "asleep"))
219  return 3;
220  else if (strstr(spec_att_str, "afraid"))
221  return 23;
222  else if (strstr(spec_att_str, "drunk"))
223  return 4;
224  else if (strstr(spec_att_str, "insane"))
225  return 5;
226  else if (strstr(spec_att_str, "poison weak"))
227  return 6;
228  else if (strstr(spec_att_str, "poison medium"))
229  return 7;
230  else if (strstr(spec_att_str, "poison severe"))
231  return 8;
232  else if (strstr(spec_att_str, "disease weak"))
233  return 9;
234  else if (strstr(spec_att_str, "disease medium"))
235  return 10;
236  else if (strstr(spec_att_str, "disease severe"))
237  return 11;
238  else if (strstr(spec_att_str, "paralyze"))
239  return 12;
240  else if (strstr(spec_att_str, "uncon"))
241  return 13;
242  else if (strstr(spec_att_str, "dead"))
243  return 14;
244  else if (strstr(spec_att_str, "stone"))
245  return 15;
246  else if (strstr(spec_att_str, "errad"))
247  return 16;
248  else if (strstr(spec_att_str, "brkitem"))
249  return 17;
250  else if (strstr(spec_att_str, "brkarmor"))
251  return 18;
252  else if (strstr(spec_att_str, "brkweapon"))
253  return 19;
254  else if (strstr(spec_att_str, "steal"))
255  return 20;
256  else if (strstr(spec_att_str, "age"))
257  return 21;
258  else if (strstr(spec_att_str, "drainsp"))
259  return 22;
260  else
261  return 0;
262 }
263 
264 //----- (004598FC) --------------------------------------------------------
265 bool MonsterList::FromFileTxt(const char *Args) {
266  MonsterList *v2; // ebx@1
267  FILE *v3; // eax@1
268  unsigned int v4; // esi@3
269  void *v5; // eax@9
270  FILE *v6; // ST14_4@11
271  char *i; // eax@11
272  signed int v8; // esi@12
273  unsigned __int16 v9; // ax@16
274  const char *v10; // ST18_4@16
275  unsigned __int16 v11; // ax@16
276  const char *v12; // ST14_4@16
277  unsigned __int16 v13; // ax@16
278  const char *v14; // ST10_4@16
279  __int16 v15; // ax@16
280  const char *v16; // ST0C_4@16
281  int v17; // esi@16
282  unsigned __int8 v18; // al@16
283  signed int v19; // esi@16
284  unsigned __int16 v20; // ax@17
285  int v21; // ecx@17
286  char Buf; // [sp+4h] [bp-304h]@3
287  FrameTableTxtLine v24; // [sp+1F8h] [bp-110h]@4
288  FrameTableTxtLine v25; // [sp+274h] [bp-94h]@4
289  int v26; // [sp+2F0h] [bp-18h]@16
290  char v27; // [sp+2F4h] [bp-14h]@14
291  char v28; // [sp+2F5h] [bp-13h]@14
292  char v29; // [sp+2F6h] [bp-12h]@14
293  char v30; // [sp+2F7h] [bp-11h]@14
294  char v31; // [sp+2F8h] [bp-10h]@14
295  char v32; // [sp+2F9h] [bp-Fh]@14
296  char v33; // [sp+2FAh] [bp-Eh]@14
297  char v34; // [sp+2FBh] [bp-Dh]@14
298  char v35; // [sp+2FCh] [bp-Ch]@14
299  char v36; // [sp+2FDh] [bp-Bh]@14
300  char v37; // [sp+2FEh] [bp-Ah]@14
301  char v38; // [sp+2FFh] [bp-9h]@14
302  char v39; // [sp+300h] [bp-8h]@14
303  char v40; // [sp+301h] [bp-7h]@14
304  char v41; // [sp+302h] [bp-6h]@14
305  char v42; // [sp+303h] [bp-5h]@14
306  FILE *File; // [sp+304h] [bp-4h]@1
307  unsigned int Argsa; // [sp+310h] [bp+8h]@3
308  int Argsb; // [sp+310h] [bp+8h]@16
309 
310  v2 = this;
311  v3 = fopen(Args, "r");
312  File = v3;
313  if (!v3) Error("MonsterRaceListStruct::load - Unable to open file: %s.");
314 
315  v4 = 0;
316  Argsa = 0;
317  if (fgets(&Buf, 490, v3)) {
318  do {
319  *strchr(&Buf, 10) = 0;
320  memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
321  if (v25.uPropCount && *v25.pProperties[0] != 47) ++Argsa;
322  } while (fgets(&Buf, 490, File));
323  v4 = Argsa;
324  }
325  v2->uNumMonsters = v4;
326  v5 = malloc(sizeof(MonsterDesc) * v4);
327  v2->pMonsters = (MonsterDesc *)v5;
328  if (!v5) Error("MonsterRaceListStruct::load - Out of Memory!");
329 
330  v6 = File;
331  v2->uNumMonsters = 0;
332  fseek(v6, 0, 0);
333  for (i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File)) {
334  *strchr(&Buf, 10) = 0;
335  memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
336  v8 = 0;
337  if (v25.uPropCount && *v25.pProperties[0] != 47) {
338  strcpy(v2->pMonsters[v2->uNumMonsters].pMonsterName,
339  v25.pProperties[0]);
340  v35 = 0;
341  v36 = 1;
342  v37 = 7;
343  v38 = 2;
344  v39 = 3;
345  v40 = 4;
346  v41 = 5;
347  v42 = 6;
348  v27 = 1;
349  v28 = 2;
350  v29 = 3;
351  v30 = 4;
352  v31 = 4;
353  v32 = 5;
354  v33 = 6;
355  v34 = 7;
356  do {
357  strcpy(v2->pMonsters[v2->uNumMonsters]
358  .pSpriteNames[(unsigned __int8)*(&v35 + v8)],
359  v25.pProperties[(unsigned __int8)*(&v27 + v8)]);
360  ++v8;
361  } while (v8 < 8);
362  v9 = atoi(v25.pProperties[8]);
363  v10 = v25.pProperties[9];
364  v2->pMonsters[v2->uNumMonsters].uMonsterHeight = v9;
365  v11 = atoi(v10);
366  v12 = v25.pProperties[10];
367  v2->pMonsters[v2->uNumMonsters].uMovementSpeed = v11;
368  v13 = atoi(v12);
369  v14 = v25.pProperties[11];
370  v2->pMonsters[v2->uNumMonsters].uMonsterRadius = v13;
371  v15 = atoi(v14);
372  v16 = v25.pProperties[12];
373  v2->pMonsters[v2->uNumMonsters].uToHitRadius = v15;
374  v17 = (unsigned __int8)atoi(v16);
375  Argsb = atoi(v25.pProperties[13]) & 0xFF;
376  v26 = atoi(v25.pProperties[14]) & 0xFF;
377  v18 = atoi(v25.pProperties[15]);
378  v2->pMonsters[v2->uNumMonsters].sTintColor =
379  v18 | ((v26 | ((Argsb | (v17 << 8)) << 8)) << 8);
380  v19 = 0;
381  do {
382  v20 = atoi(v25.pProperties[v19 + 16]);
383  v21 = v19++;
384  v2->pMonsters[v2->uNumMonsters].pSoundSampleIDs[v21] = v20;
385  } while (v19 < 4);
386  ++v2->uNumMonsters;
387  }
388  }
389  fclose(File);
390  return 1;
391 }
392 
393 //----- (004598AF) --------------------------------------------------------
394 void MonsterList::FromFile(void *data_mm6, void *data_mm7, void *data_mm8) {
395  uint num_mm6_monsters = data_mm6 ? *(int *)data_mm6 : 0,
396  num_mm7_monsters = data_mm7 ? *(int *)data_mm7 : 0,
397  num_mm8_monsters = data_mm8 ? *(int *)data_mm8 : 0;
398 
399  uNumMonsters = num_mm6_monsters + num_mm7_monsters + num_mm8_monsters;
400  Assert(uNumMonsters);
401  Assert(!num_mm8_monsters);
402 
403  pMonsters = (MonsterDesc *)malloc(sizeof(MonsterDesc) * uNumMonsters);
404  memcpy(pMonsters, (char *)data_mm7 + 4,
405  num_mm7_monsters * sizeof(MonsterDesc));
406  for (uint i = 0; i < num_mm6_monsters; ++i) {
407  auto src = (MonsterDesc_mm6 *)((char *)data_mm6 + 4) + i;
408  MonsterDesc *dst = &pMonsters[num_mm7_monsters + i];
409 
410  dst->uMonsterHeight = src->uMonsterHeight;
411  dst->uMonsterRadius = src->uMonsterRadius;
412  dst->uMovementSpeed = src->uMovementSpeed;
413  dst->uToHitRadius = src->uToHitRadius;
414  dst->sTintColor = -1;
415  memcpy(dst->pSoundSampleIDs, src->pSoundSampleIDs,
416  sizeof(src->pSoundSampleIDs));
417  memcpy(dst->pMonsterName, src->pMonsterName, sizeof(src->pMonsterName));
418  memcpy(dst->pSpriteNames, src->pSpriteNames, sizeof(src->pSpriteNames));
419  }
420  memcpy(pMonsters + num_mm6_monsters + num_mm7_monsters,
421  (char *)data_mm8 + 4, num_mm8_monsters * sizeof(MonsterDesc));
422 }
423 
424 //----- (00459860) --------------------------------------------------------
426  MonsterList *v1; // esi@1
427  FILE *v2; // eax@1
428  FILE *v3; // edi@1
429 
430  v1 = this;
431  v2 = fopen("data\\dmonlist.bin", "wb");
432  v3 = v2;
433  if (!v2) Error("Unable to save dmonlist.bin!");
434  fwrite(v1, 4u, 1u, v2);
435  fwrite(v1->pMonsters, 0x98u, v1->uNumMonsters, v3);
436  fclose(v3);
437 }
438 
439 //----- (004563FF) --------------------------------------------------------
441  const char *monster_textr_name) {
442  for (int i = 1; i < uNumMonsters; ++i) {
443  if ((pInfos[i].pName) &&
444  (!_stricmp(pInfos[i].pPictureName, monster_textr_name)))
445  return i;
446  }
447  return -1;
448 }
449 
450 //----- (00454F4E) --------------------------------------------------------
452  int i;
453  char *test_string;
454  unsigned char c;
455  bool break_loop;
456  unsigned int temp_str_len;
457  char *tmp_pos;
458  int decode_step;
459  // int item_counter;
460 
462  strtok(pMonsterPlacementTXT_Raw, "\r");
463  for (i = 1; i < 31; ++i) {
464  test_string = strtok(NULL, "\r") + 1;
465  break_loop = false;
466  decode_step = 0;
467  do {
468  c = *(unsigned char *)test_string;
469  temp_str_len = 0;
470  while ((c != '\t') && (c > 0)) {
471  ++temp_str_len;
472  c = test_string[temp_str_len];
473  }
474  tmp_pos = test_string + temp_str_len;
475  if (*tmp_pos == 0) break_loop = true;
476  *tmp_pos = 0;
477  if (temp_str_len) {
478  if (decode_step == 1)
479  pPlaceStrings[i] = RemoveQuotes(test_string);
480  } else {
481  break_loop = true;
482  }
483  ++decode_step;
484  test_string = tmp_pos + 1;
485  } while ((decode_step < 3) && !break_loop);
486  }
487  uNumPlacements = 31;
488 }
489 
490 //----- (0045501E) --------------------------------------------------------
492  int i; // ,j;
493  char *test_string;
494  unsigned char c;
495  bool break_loop;
496  unsigned int temp_str_len;
497  char *tmp_pos;
498  int decode_step;
499  // int item_counter;
500  int curr_rec_num;
501  char parse_str[64];
502  // char Src[120];
503  FrameTableTxtLine parsed_field;
504  String str;
505 
506  free(pMonstersTXT_Raw);
507  pMonstersTXT_Raw = (char *)pEvents_LOD->LoadCompressedTexture("monsters.txt");
508  strtok(pMonstersTXT_Raw, "\r");
509  strtok(NULL, "\r");
510  strtok(NULL, "\r");
511  strtok(NULL, "\r");
512  uNumMonsters = 265;
513  curr_rec_num = 0;
514  for (i = 0; i < uNumMonsters - 1; ++i) {
515  test_string = strtok(NULL, "\r") + 1;
516  break_loop = false;
517  decode_step = 0;
518  do {
519  c = *(unsigned char *)test_string;
520  temp_str_len = 0;
521  while ((c != '\t') && (c > 0)) {
522  ++temp_str_len;
523  c = test_string[temp_str_len];
524  }
525  tmp_pos = test_string + temp_str_len;
526  if (*tmp_pos == 0) break_loop = true;
527  *tmp_pos = 0;
528  if (temp_str_len) {
529  switch (decode_step) {
530  case 0:
531  curr_rec_num = atoi(test_string);
532  pInfos[curr_rec_num].uID = curr_rec_num;
533  break;
534  case 1:
535  pInfos[curr_rec_num].pName = RemoveQuotes(test_string);
536  break;
537  case 2:
538  pInfos[curr_rec_num].pPictureName =
539  RemoveQuotes(test_string);
540  break;
541  case 3:
542  pInfos[curr_rec_num].uLevel = atoi(test_string);
543  break;
544  case 4: {
545  int str_len = 0;
546  int str_pos = 0;
547  pInfos[curr_rec_num].uHP = 0;
548  if (test_string[0] == '"') test_string[0] = ' ';
549  str_len = strlen(test_string);
550  if (str_len == 0) break;
551  while ((test_string[str_pos] != ',') &&
552  (str_pos < str_len))
553  ++str_pos;
554  if (str_len == str_pos) {
555  pInfos[curr_rec_num].uHP = atoi(test_string);
556  } else {
557  test_string[str_pos] = '\0';
558  pInfos[curr_rec_num].uHP = 1000 * atoi(test_string);
559  pInfos[curr_rec_num].uHP +=
560  atoi(&test_string[str_pos + 1]);
561  test_string[str_pos] = ',';
562  }
563  } break;
564  case 5:
565  pInfos[curr_rec_num].uAC = atoi(test_string);
566  break;
567  case 6: {
568  int str_len = 0;
569  int str_pos = 0;
570  pInfos[curr_rec_num].uExp = 0;
571  if (test_string[0] == '"') test_string[0] = ' ';
572  str_len = strlen(test_string);
573  if (str_len == 0) break;
574  while ((test_string[str_pos] != ',') &&
575  (str_pos < str_len))
576  ++str_pos;
577  if (str_len == str_pos) {
578  pInfos[curr_rec_num].uExp = atoi(test_string);
579  } else {
580  test_string[str_pos] = '\0';
581  pInfos[curr_rec_num].uExp =
582  1000 * atoi(test_string);
583  pInfos[curr_rec_num].uExp +=
584  atoi(&test_string[str_pos + 1]);
585  test_string[str_pos] = ',';
586  }
587  } break;
588  case 7: {
589  int str_len = 0;
590  int str_pos = 0;
591  bool chance_flag = false;
592  bool dice_flag = false;
593  bool item_type_flag = false;
594  char *item_name;
595  pInfos[curr_rec_num].uTreasureDropChance = 0;
596  pInfos[curr_rec_num].uTreasureDiceRolls = 0;
597  pInfos[curr_rec_num].uTreasureDiceSides = 0;
598  pInfos[curr_rec_num].uTreasureType = 0;
599  pInfos[curr_rec_num].uTreasureLevel = 0;
600  if (test_string[0] == '"') test_string[0] = ' ';
601  str_len = strlen(test_string);
602  do {
603  switch (tolower(test_string[str_pos])) {
604  case '%':
605  chance_flag = true;
606  break;
607  case 'd':
608  dice_flag = true;
609  break;
610  case 'l':
611  item_type_flag = true;
612  break;
613  }
614  ++str_pos;
615  } while (str_pos < str_len);
616  if (chance_flag) {
617  pInfos[curr_rec_num].uTreasureDropChance =
618  atoi(test_string);
619  } else {
620  if ((!dice_flag) && (!item_type_flag)) break;
621  pInfos[curr_rec_num].uTreasureDropChance = 100;
622  }
623  if (dice_flag) {
624  str_pos = 0;
625  dice_flag = false;
626  do {
627  switch (tolower(test_string[str_pos])) {
628  case '%':
629  pInfos[curr_rec_num]
631  atoi(&test_string[str_pos + 1]);
632  dice_flag = true;
633  break;
634  case 'd':
635  if (!dice_flag)
636  pInfos[curr_rec_num]
638  atoi(test_string);
639  pInfos[curr_rec_num]
641  atoi(&test_string[str_pos + 1]);
642  str_pos = str_len;
643  break;
644  }
645  ++str_pos;
646  } while (str_pos < str_len);
647  }
648  if (item_type_flag) {
649  str_pos = 0;
650  do {
651  if (tolower(test_string[str_pos]) == 'l') break;
652  ++str_pos;
653  } while (str_pos < str_len);
654 
655  pInfos[curr_rec_num].uTreasureLevel =
656  test_string[str_pos + 1] - '0';
657  item_name = &test_string[str_pos + 2];
658  if (*item_name) {
659  if (!_stricmp(item_name, "WEAPON"))
660  pInfos[curr_rec_num].uTreasureType = 20;
661  else if (!_stricmp(item_name, "ARMOR"))
662  pInfos[curr_rec_num].uTreasureType = 21;
663  else if (!_stricmp(item_name, "MISC"))
664  pInfos[curr_rec_num].uTreasureType = 22;
665  else if (!_stricmp(item_name, "SWORD"))
666  pInfos[curr_rec_num].uTreasureType = 23;
667  else if (!_stricmp(item_name, "DAGGER"))
668  pInfos[curr_rec_num].uTreasureType = 24;
669  else if (!_stricmp(item_name, "AXE"))
670  pInfos[curr_rec_num].uTreasureType = 25;
671  else if (!_stricmp(item_name, "SPEAR"))
672  pInfos[curr_rec_num].uTreasureType = 26;
673  else if (!_stricmp(item_name, "BOW"))
674  pInfos[curr_rec_num].uTreasureType = 27;
675  else if (!_stricmp(item_name, "MACE"))
676  pInfos[curr_rec_num].uTreasureType = 28;
677  else if (!_stricmp(item_name, "CLUB"))
678  pInfos[curr_rec_num].uTreasureType = 29;
679  else if (!_stricmp(item_name, "STAFF"))
680  pInfos[curr_rec_num].uTreasureType = 30;
681  else if (!_stricmp(item_name, "LEATHER"))
682  pInfos[curr_rec_num].uTreasureType = 31;
683  else if (!_stricmp(item_name, "CHAIN"))
684  pInfos[curr_rec_num].uTreasureType = 32;
685  else if (!_stricmp(item_name, "PLATE"))
686  pInfos[curr_rec_num].uTreasureType = 33;
687  else if (!_stricmp(item_name, "SHIELD"))
688  pInfos[curr_rec_num].uTreasureType = 34;
689  else if (!_stricmp(item_name, "HELM"))
690  pInfos[curr_rec_num].uTreasureType = 35;
691  else if (!_stricmp(item_name, "BELT"))
692  pInfos[curr_rec_num].uTreasureType = 36;
693  else if (!_stricmp(item_name, "CAPE"))
694  pInfos[curr_rec_num].uTreasureType = 37;
695  else if (!_stricmp(item_name, "GAUNTLETS"))
696  pInfos[curr_rec_num].uTreasureType = 38;
697  else if (!_stricmp(item_name, "BOOTS"))
698  pInfos[curr_rec_num].uTreasureType = 39;
699  else if (!_stricmp(item_name, "RING"))
700  pInfos[curr_rec_num].uTreasureType = 40;
701  else if (!_stricmp(item_name, "AMULET"))
702  pInfos[curr_rec_num].uTreasureType = 41;
703  else if (!_stricmp(item_name, "WAND"))
704  pInfos[curr_rec_num].uTreasureType = 42;
705  else if (!_stricmp(item_name, "SCROLL"))
706  pInfos[curr_rec_num].uTreasureType = 43;
707  else if (!_stricmp(item_name, "GEM"))
708  pInfos[curr_rec_num].uTreasureType = 46;
709  }
710  }
711  } break;
712  case 8: {
713  pInfos[curr_rec_num].bQuestMonster = 0;
714  if (atoi(test_string))
715  pInfos[curr_rec_num].bQuestMonster = 1;
716  } break;
717  case 9: {
718  pInfos[curr_rec_num].uFlying = false;
719  if (_strnicmp(test_string, "n", 1))
720  pInfos[curr_rec_num].uFlying = true;
721  } break;
722  case 10: {
723  switch (tolower(test_string[0])) {
724  case 's':
725  pInfos[curr_rec_num].uMovementType =
727  if (tolower(test_string[1]) != 'h')
728  pInfos[curr_rec_num].uMovementType =
729  MONSTER_MOVEMENT_TYPE_STAIONARY; // stationary
730  break; // short
731  case 'l':
732  pInfos[curr_rec_num].uMovementType =
734  break; // long
735  case 'm':
736  pInfos[curr_rec_num].uMovementType =
738  break; // med
739  case 'g':
740  pInfos[curr_rec_num].uMovementType =
742  break; // global?
743  default:
744  pInfos[curr_rec_num].uMovementType =
746  }
747  } break;
748  case 11: {
749  switch (tolower(test_string[0])) {
750  case 's':
751  pInfos[curr_rec_num].uAIType = 0;
752  break; // suicide
753  case 'w':
754  pInfos[curr_rec_num].uAIType = 1;
755  break; // wimp
756  case 'n':
757  pInfos[curr_rec_num].uAIType = 2;
758  break; // normal
759  default:
760  pInfos[curr_rec_num].uAIType = 3; // Agress
761  }
762  } break;
763  case 12:
764  pInfos[curr_rec_num].uHostilityType =
765  (MonsterInfo::HostilityRadius)atoi(test_string);
766  break;
767  case 13:
768  pInfos[curr_rec_num].uBaseSpeed = atoi(test_string);
769  break;
770  case 14:
771  pInfos[curr_rec_num].uRecoveryTime = atoi(test_string);
772  break;
773  case 15: {
774  int str_len = 0;
775  int str_pos = 0;
776  pInfos[curr_rec_num].uAttackPreference = 0;
777  pInfos[curr_rec_num]
779  str_len = strlen(test_string);
780  for (str_pos = 0; str_pos < str_len; ++str_pos) {
781  switch (tolower(test_string[str_pos])) {
782  case '0':
783  pInfos[curr_rec_num].uAttackPreference |=
784  0x0004;
785  break;
786  case '2':
787  pInfos[curr_rec_num]
789  2;
790  break;
791  case '3':
792  pInfos[curr_rec_num]
794  3;
795  break;
796  case '4':
797  pInfos[curr_rec_num]
799  4;
800  break;
801  case 'c':
802  pInfos[curr_rec_num].uAttackPreference |=
803  0x0010;
804  break;
805  case 'd':
806  pInfos[curr_rec_num].uAttackPreference |=
807  0x0008;
808  break;
809  case 'e':
810  pInfos[curr_rec_num].uAttackPreference |=
811  0x1000;
812  break;
813  case 'f':
814  pInfos[curr_rec_num].uAttackPreference |=
815  0x0400;
816  break;
817  case 'h':
818  pInfos[curr_rec_num].uAttackPreference |=
819  0x0800;
820  break;
821  case 'k':
822  pInfos[curr_rec_num].uAttackPreference |=
823  0x0001;
824  break;
825  case 'm':
826  pInfos[curr_rec_num].uAttackPreference |=
827  0x0100;
828  break;
829  case 'o':
830  pInfos[curr_rec_num].uAttackPreference |=
831  0x0400;
832  break;
833  case 'p':
834  pInfos[curr_rec_num].uAttackPreference |=
835  0x0002;
836  break;
837  case 'r':
838  pInfos[curr_rec_num].uAttackPreference |=
839  0x0040;
840  break;
841  case 's':
842  pInfos[curr_rec_num].uAttackPreference |=
843  0x0020;
844  break;
845  case 't':
846  pInfos[curr_rec_num].uAttackPreference |=
847  0x0080;
848  break;
849  case 'w':
850  pInfos[curr_rec_num].uAttackPreference |=
851  0x2000;
852  break;
853  case 'x':
854  pInfos[curr_rec_num].uAttackPreference |=
855  0x0200;
856  break;
857  }
858  }
859  } break;
860  case 16: {
861  int str_len = 0;
862  int str_pos = 0;
863  pInfos[curr_rec_num].uSpecialAttackLevel = 1;
864  pInfos[curr_rec_num].uSpecialAttackType =
866  str_len = strlen(test_string);
867  if (str_len > 1) {
868  for (str_pos = 0; str_pos < str_len; ++str_pos) {
869  if (tolower(test_string[str_pos]) == 'x') {
870  test_string[str_pos] = '\0';
871  pInfos[curr_rec_num].uSpecialAttackLevel =
872  atoi(&test_string[str_pos + 1]);
873  test_string[str_pos] = 'x';
874  break;
875  }
876  }
877  pInfos[curr_rec_num].uSpecialAttackType =
879  test_string);
880  }
881  } break;
882  case 17:
883  pInfos[curr_rec_num].uAttack1Type =
884  ParseAttackType(test_string);
885  break;
886  case 18: {
887  ParseDamage(
888  test_string,
889  &pInfos[curr_rec_num].uAttack1DamageDiceRolls,
890  &pInfos[curr_rec_num].uAttack1DamageDiceSides,
891  &pInfos[curr_rec_num].uAttack1DamageBonus);
892  } break;
893  case 19:
894  pInfos[curr_rec_num].uMissleAttack1Type =
895  ParseMissleAttackType(test_string);
896  break;
897  case 20:
898  pInfos[curr_rec_num].uAttack2Chance = atoi(test_string);
899  break;
900  case 21:
901  pInfos[curr_rec_num].uAttack2Type =
902  ParseAttackType(test_string);
903  break;
904  case 22: {
905  ParseDamage(
906  test_string,
907  &pInfos[curr_rec_num].uAttack2DamageDiceRolls,
908  &pInfos[curr_rec_num].uAttack2DamageDiceSides,
909  &pInfos[curr_rec_num].uAttack2DamageBonus);
910  } break;
911  case 23:
912  pInfos[curr_rec_num].uMissleAttack2Type =
913  ParseMissleAttackType(test_string);
914  break;
915  case 24:
916  pInfos[curr_rec_num].uSpell1UseChance =
917  atoi(test_string);
918  break;
919  case 25: {
920  int param_num;
921  char type_flag;
922  strcpy(parse_str, test_string);
923  parse_str[0] = ' ';
924  parse_str[strlen(parse_str) - 1] = ' ';
925  frame_table_txt_parser(parse_str, &parsed_field);
926  if (parsed_field.uPropCount > 2) {
927  param_num = 1;
928  pInfos[curr_rec_num].uSpell1ID =
929  ParseSpellType(&parsed_field, &param_num);
930  type_flag = *parsed_field.pProperties[param_num];
931  pInfos[curr_rec_num].uSpellSkillAndMastery1 =
932  atoi(parsed_field.pProperties[param_num + 1]) &
933  0x003F;
934  switch (type_flag) {
935  case 'E':
936  pInfos[curr_rec_num]
937  .uSpellSkillAndMastery1 |= 0x0040;
938  break;
939  case 'M':
940  pInfos[curr_rec_num]
941  .uSpellSkillAndMastery1 |= 0x0080;
942  break;
943  case 'G':
944  pInfos[curr_rec_num]
945  .uSpellSkillAndMastery1 |= 0x0100;
946  break;
947  }
948  } else {
949  pInfos[curr_rec_num].uSpell1ID = 0;
950  pInfos[curr_rec_num].uSpellSkillAndMastery1 = 0;
951  }
952  } break;
953  case 26:
954  pInfos[curr_rec_num].uSpell2UseChance =
955  atoi(test_string);
956  break;
957  case 27: {
958  int param_num;
959  char type_flag;
960  strcpy(parse_str, test_string);
961  parse_str[0] = ' ';
962  parse_str[strlen(parse_str) - 1] = ' ';
963  frame_table_txt_parser(parse_str, &parsed_field);
964  if (parsed_field.uPropCount > 2) {
965  param_num = 1;
966  pInfos[curr_rec_num].uSpell2ID =
967  ParseSpellType(&parsed_field, &param_num);
968  type_flag = *parsed_field.pProperties[param_num];
969  pInfos[curr_rec_num].uSpellSkillAndMastery2 =
970  atoi(parsed_field.pProperties[param_num + 1]) &
971  0x003F;
972  switch (type_flag) {
973  case 'E':
974  pInfos[curr_rec_num]
975  .uSpellSkillAndMastery2 |= 0x0040;
976  break;
977  case 'M':
978  pInfos[curr_rec_num]
979  .uSpellSkillAndMastery2 |= 0x0080;
980  break;
981  case 'G':
982  pInfos[curr_rec_num]
983  .uSpellSkillAndMastery2 |= 0x0100;
984  break;
985  }
986  } else {
987  pInfos[curr_rec_num].uSpell2ID = 0;
988  pInfos[curr_rec_num].uSpellSkillAndMastery2 = 0;
989  }
990  } break;
991  case 28: {
992  if (tolower(test_string[0]) == 'i')
993  pInfos[curr_rec_num].uResFire = 200;
994  else
995  pInfos[curr_rec_num].uResFire = atoi(test_string);
996  } break;
997  case 29: {
998  if (tolower(test_string[0]) == 'i')
999  pInfos[curr_rec_num].uResAir = 200;
1000  else
1001  pInfos[curr_rec_num].uResAir = atoi(test_string);
1002  } break;
1003  case 30: {
1004  if (tolower(test_string[0]) == 'i')
1005  pInfos[curr_rec_num].uResWater = 200;
1006  else
1007  pInfos[curr_rec_num].uResWater = atoi(test_string);
1008  } break;
1009  case 31: {
1010  if (tolower(test_string[0]) == 'i')
1011  pInfos[curr_rec_num].uResEarth = 200;
1012  else
1013  pInfos[curr_rec_num].uResEarth = atoi(test_string);
1014  } break;
1015  case 32: {
1016  if (tolower(test_string[0]) == 'i')
1017  pInfos[curr_rec_num].uResMind = 200;
1018  else
1019  pInfos[curr_rec_num].uResMind = atoi(test_string);
1020  } break;
1021  case 33: {
1022  if (tolower(test_string[0]) == 'i')
1023  pInfos[curr_rec_num].uResSpirit = 200;
1024  else
1025  pInfos[curr_rec_num].uResSpirit = atoi(test_string);
1026  } break;
1027  case 34: {
1028  if (tolower(test_string[0]) == 'i')
1029  pInfos[curr_rec_num].uResBody = 200;
1030  else
1031  pInfos[curr_rec_num].uResBody = atoi(test_string);
1032  } break;
1033  case 35: {
1034  if (tolower(test_string[0]) == 'i')
1035  pInfos[curr_rec_num].uResLight = 200;
1036  else
1037  pInfos[curr_rec_num].uResLight = atoi(test_string);
1038  } break;
1039  case 36: {
1040  if (tolower(test_string[0]) == 'i')
1041  pInfos[curr_rec_num].uResDark = 200;
1042  else
1043  pInfos[curr_rec_num].uResDark = atoi(test_string);
1044  } break;
1045  case 37: {
1046  if (tolower(test_string[0]) == 'i')
1047  pInfos[curr_rec_num].uResPhysical = 200;
1048  else
1049  pInfos[curr_rec_num].uResPhysical =
1050  atoi(test_string);
1051  } break;
1052  case 38: {
1053  // int param_num;
1054  // char type_flag;
1055  pInfos[curr_rec_num].uSpecialAbilityType = 0;
1056  pInfos[curr_rec_num].uSpecialAbilityDamageDiceBonus = 0;
1057  strcpy(parse_str, test_string);
1058  parse_str[0] = ' ';
1059  parse_str[strlen(parse_str) - 1] = ' ';
1060  frame_table_txt_parser(parse_str, &parsed_field);
1061  if (parsed_field.uPropCount) {
1062  // v74 = v94.field_0;
1063  if (parsed_field.uPropCount < 10) {
1064  if (!_stricmp(parsed_field.pProperties[0],
1065  "shot")) {
1066  pInfos[curr_rec_num].uSpecialAbilityType =
1067  1;
1068  pInfos[curr_rec_num]
1070  (char *)(parsed_field.pProperties[1] +
1071  1));
1072  } else if (!_stricmp(
1073  parsed_field.pProperties[0],
1074  "summon")) {
1075  pInfos[curr_rec_num].uSpecialAbilityType =
1076  2;
1077  if (parsed_field.uPropCount > 1) {
1078  str = parsed_field.pProperties[2];
1079  if (parsed_field.uPropCount > 2) {
1080  int prop_cnt = 3;
1081  if (parsed_field.uPropCount > 3) {
1082  do {
1083  str += " ";
1084  char test_char =
1085  parsed_field.pProperties
1086  [prop_cnt][0];
1087  str +=
1088  parsed_field.pProperties
1089  [prop_cnt];
1090  if (prop_cnt ==
1091  (parsed_field
1092  .uPropCount -
1093  1)) {
1094  switch (tolower(
1095  test_char)) {
1096  case 'a':
1097  pInfos[curr_rec_num]
1099  1;
1100  break;
1101  case 'b':
1102  pInfos[curr_rec_num]
1104  2;
1105  break;
1106  case 'c':
1107  pInfos[curr_rec_num]
1109  3;
1110  break;
1111  default:
1112  pInfos[curr_rec_num]
1114  0;
1115  }
1116  }
1117  ++prop_cnt;
1118  } while (
1119  prop_cnt <
1120  parsed_field.uPropCount);
1121  }
1122  } else {
1123  pInfos[curr_rec_num]
1125  0;
1126  }
1127  if (pMonsterList->uNumMonsters) {
1128  pInfos[curr_rec_num]
1130  pMonsterList
1132  str.c_str()) +
1133  1;
1134  if (pInfos[curr_rec_num]
1135  .field_3C_some_special_attack ==
1136  -1) {
1137  logger->Warning(
1138  L"%S",
1139  StringPrintf(
1140  "Can't create random "
1141  "monster: '%s' See "
1142  "MapStats!",
1143  str.c_str()));
1144  }
1145  }
1146  pInfos[curr_rec_num]
1148  if (!_stricmp(
1149  parsed_field.pProperties[1],
1150  "ground"))
1151  pInfos[curr_rec_num]
1153  1;
1154  if (pInfos[curr_rec_num]
1155  .field_3C_some_special_attack ==
1156  -1)
1157  pInfos[curr_rec_num]
1158  .uSpecialAbilityType = 0;
1159  }
1160  } else if (!_stricmp(
1161  parsed_field.pProperties[0],
1162  "explode")) {
1163  pInfos[curr_rec_num].uSpecialAbilityType =
1164  3;
1165  ParseDamage(
1166  (char *)parsed_field.pProperties[1],
1167  &pInfos[curr_rec_num]
1169  &pInfos[curr_rec_num]
1171  &pInfos[curr_rec_num]
1173  pInfos[curr_rec_num]
1175  ParseAttackType(test_string);
1176  }
1177  }
1178  }
1179  } break;
1180  }
1181  } else {
1182  break_loop = true;
1183  }
1184  ++decode_step;
1185  test_string = tmp_pos + 1;
1186  } while ((decode_step < 39) && !break_loop);
1187  }
1188  uNumMonsters = i;
1189 }
1190 
1191 //----- (0044FA08) --------------------------------------------------------
1192 signed __int16 MonsterList::GetMonsterIDByName(const char *pMonsterName) {
1193  if (!pMonsterName) return -1;
1194  for (signed __int16 i = 0; i <= uNumMonsters; ++i) {
1195  if ((!_stricmp(pMonsters[i].pMonsterName, pMonsterName))) return i;
1196  }
1197  Error("Monster not found: %s", pMonsterName);
1198 }
1199 //----- (00438BDF) --------------------------------------------------------
1200 bool MonsterStats::BelongsToSupertype(unsigned int uMonsterInfoID,
1201  enum MONSTER_SUPERTYPE eSupertype) {
1202  switch (eSupertype) {
1204  if ((signed int)uMonsterInfoID >= MONSTER_GHOST_1 &&
1205  (signed int)uMonsterInfoID <= MONSTER_GHOST_3 // 70<=id<=72
1206  || (signed int)uMonsterInfoID >= MONSTER_LICH_1 &&
1207  (signed int)uMonsterInfoID <= MONSTER_LICH_3 // 91-93
1208  ||
1209  (signed int)uMonsterInfoID >= MONSTER_SKELETON_1 &&
1210  (signed int)uMonsterInfoID <= MONSTER_SKELETON_3 // 199-201
1211  ||
1212  (signed int)uMonsterInfoID >= MONSTER_VAMPIRE_1 &&
1213  (signed int)uMonsterInfoID <= MONSTER_VAMPIRE_3 // 217-219
1214  || (signed int)uMonsterInfoID >= MONSTER_WIGHT_1 &&
1215  (signed int)uMonsterInfoID <= MONSTER_WIGHT_3 // 223-225
1216  ||
1217  (signed int)uMonsterInfoID >= MONSTER_ZOMBIE_1 &&
1218  (signed int)uMonsterInfoID <= MONSTER_ZOMBIE_3 // 229-231
1219  ||
1220  (signed int)uMonsterInfoID >= MONSTER_GHOUL_1 &&
1221  (signed int)uMonsterInfoID <= MONSTER_GHOUL_3) // 256-258
1222  return true;
1223  return false;
1225  if ((signed int)uMonsterInfoID >= MONSTER_DEVIL_1 &&
1226  (signed int)uMonsterInfoID <= MONSTER_DEVIL_3) // 22-24
1227  return true;
1228  return false;
1229  case MONSTER_SUPERTYPE_ELF:
1230  if ((signed int)uMonsterInfoID >= MONSTER_PEASANT_ELF_FEMALE_1_1 &&
1231  (signed int)uMonsterInfoID <=
1232  MONSTER_PEASANT_ELF_MALE_3_3 // 133 - 150
1233  ||
1234  (signed int)uMonsterInfoID >= MONSTER_ELF_ARCHER_1 &&
1235  (signed int)uMonsterInfoID <= MONSTER_ELF_ARCHER_3 // 49-51
1236  || (signed int)uMonsterInfoID >= MONSTER_ELF_SPEARMAN_1 &&
1237  (signed int)uMonsterInfoID <=
1238  MONSTER_ELF_SPEARMAN_3) // 52-54
1239  return true;
1240  return false;
1242  if ((signed int)uMonsterInfoID >= MONSTER_DRAGON_1 &&
1243  (signed int)uMonsterInfoID <= MONSTER_DRAGON_3) // 25-27
1244  return true;
1245  return false;
1247  if ((signed int)uMonsterInfoID >= MONSTER_ELEMENTAL_WATER_1 &&
1248  (signed int)uMonsterInfoID <=
1249  MONSTER_ELEMENTAL_WATER_3) // 46-48
1250  return true;
1251  return false;
1253  if ((signed int)uMonsterInfoID >= MONSTER_TREANT_1 &&
1254  (signed int)uMonsterInfoID <= MONSTER_TREANT_3) // 253-255
1255  return true;
1256  return false;
1258  if ((signed int)uMonsterInfoID >= MONSTER_TITAN_1 &&
1259  (signed int)uMonsterInfoID <= MONSTER_TITAN_3) // 211-213
1260  return true;
1261  return false;
1262  default:
1263  return false;
1264  }
1265  return false;
1266 }
MonsterInfo::uMissleAttack1Type
uint8_t uMissleAttack1Type
Definition: Monsters.h:139
MONSTER_SUPERTYPE_UNDEAD
@ MONSTER_SUPERTYPE_UNDEAD
Definition: Monsters.h:70
FrameTableTxtLine::uPropCount
int uPropCount
Definition: FrameTableInc.h:12
MONSTER_DEVIL_3
@ MONSTER_DEVIL_3
Definition: Monsters.h:9
FrameTableTxtLine::pProperties
const char * pProperties[30]
Definition: FrameTableInc.h:13
MONSTER_PEASANT_ELF_MALE_3_3
@ MONSTER_PEASANT_ELF_MALE_3_3
Definition: Monsters.h:30
MONSTER_VAMPIRE_3
@ MONSTER_VAMPIRE_3
Definition: Monsters.h:36
MONSTER_GHOST_3
@ MONSTER_GHOST_3
Definition: Monsters.h:20
MONSTER_DEVIL_1
@ MONSTER_DEVIL_1
Definition: Monsters.h:7
MonsterInfo::uSpell2UseChance
uint8_t uSpell2UseChance
Definition: Monsters.h:148
MonsterInfo::uResBody
uint8_t uResBody
Definition: Monsters.h:156
MonsterInfo::uAttackPreference
unsigned int uAttackPreference
Definition: Monsters.h:180
RemoveQuotes
char * RemoveQuotes(char *str)
Definition: Strings.h:17
MONSTER_ELF_SPEARMAN_3
@ MONSTER_ELF_SPEARMAN_3
Definition: Monsters.h:18
MonsterInfo::uBaseSpeed
unsigned int uBaseSpeed
Definition: Monsters.h:178
MONSTER_VAMPIRE_1
@ MONSTER_VAMPIRE_1
Definition: Monsters.h:35
pMonsterPlacementTXT_Raw
char * pMonsterPlacementTXT_Raw
Definition: mm7_data.cpp:678
MONSTER_LICH_1
@ MONSTER_LICH_1
Definition: Monsters.h:24
MonsterInfo::uHostilityType
HostilityRadius uHostilityType
Definition: Monsters.h:131
Monsters.h
pMonsterStats
struct MonsterStats * pMonsterStats
Definition: Monsters.cpp:8
LOD::File::LoadCompressedTexture
void * LoadCompressedTexture(const String &pContainer, size_t *data_size=nullptr)
Definition: LOD.cpp:921
MonsterInfo::uSpell1ID
uint8_t uSpell1ID
Definition: Monsters.h:147
MONSTER_WIGHT_3
@ MONSTER_WIGHT_3
Definition: Monsters.h:38
MONSTER_SUPERTYPE_KREEGAN
@ MONSTER_SUPERTYPE_KREEGAN
Definition: Monsters.h:71
MonsterInfo::uResDark
uint8_t uResDark
Definition: Monsters.h:158
MonsterInfo::uAC
unsigned int uAC
Definition: Monsters.h:176
MonsterInfo::uResLight
uint8_t uResLight
Definition: Monsters.h:157
MonsterInfo::field_3C_some_special_attack
int16_t field_3C_some_special_attack
Definition: Monsters.h:173
MonsterInfo::uResFire
uint8_t uResFire
Definition: Monsters.h:150
ParseMissleAttackType
int ParseMissleAttackType(const char *missle_attack_str)
Definition: Monsters.cpp:183
MonsterInfo::uAttack2Chance
uint8_t uAttack2Chance
Definition: Monsters.h:140
ParseSpellType
unsigned int ParseSpellType(struct FrameTableTxtLine *tbl, int *next_token)
Definition: Monsters.cpp:20
MonsterInfo::uTreasureType
uint8_t uTreasureType
Definition: Monsters.h:127
MONSTER_MOVEMENT_TYPE_FREE
@ MONSTER_MOVEMENT_TYPE_FREE
Definition: Monsters.h:64
MonsterStats::uNumPlacements
unsigned int uNumPlacements
Definition: Monsters.h:197
MonsterInfo::uSpecialAbilityDamageDiceBonus
uint8_t uSpecialAbilityDamageDiceBonus
Definition: Monsters.h:166
MONSTER_ELF_SPEARMAN_1
@ MONSTER_ELF_SPEARMAN_1
Definition: Monsters.h:17
MonsterDesc_mm6
Definition: Monsters.h:203
MonsterInfo::uTreasureDropChance
uint8_t uTreasureDropChance
Definition: Monsters.h:123
MonsterList::ToFile
void ToFile()
Definition: Monsters.cpp:425
MonsterInfo::uSpecialAbilityDamageDiceSides
uint8_t uSpecialAbilityDamageDiceSides
Definition: Monsters.h:165
MONSTER_SUPERTYPE_ELF
@ MONSTER_SUPERTYPE_ELF
Definition: Monsters.h:73
Engine.h
MonsterInfo::uSpecialAbilityDamageDiceRolls
uint8_t uSpecialAbilityDamageDiceRolls
Definition: Monsters.h:164
MonsterInfo::pPictureName
char * pPictureName
Definition: Monsters.h:121
MONSTER_MOVEMENT_TYPE_GLOBAL
@ MONSTER_MOVEMENT_TYPE_GLOBAL
Definition: Monsters.h:63
MonsterStats::uNumMonsters
unsigned int uNumMonsters
Definition: Monsters.h:196
MonsterInfo::uTreasureDiceRolls
uint8_t uTreasureDiceRolls
Definition: Monsters.h:124
MONSTER_GHOUL_3
@ MONSTER_GHOUL_3
Definition: Monsters.h:48
MonsterInfo::HostilityRadius
HostilityRadius
Definition: Monsters.h:110
MONSTER_MOVEMENT_TYPE_MEDIUM
@ MONSTER_MOVEMENT_TYPE_MEDIUM
Definition: Monsters.h:61
MONSTER_SUPERTYPE_TITAN
@ MONSTER_SUPERTYPE_TITAN
Definition: Monsters.h:76
MONSTER_SUPERTYPE
MONSTER_SUPERTYPE
Definition: Monsters.h:69
MonsterStats::InitializePlacements
void InitializePlacements()
Definition: Monsters.cpp:451
MONSTER_TREANT_1
@ MONSTER_TREANT_1
Definition: Monsters.h:45
MonsterInfo::uSpecialAbilityType
uint8_t uSpecialAbilityType
Definition: Monsters.h:160
frame_table_txt_parser
FrameTableTxtLine * frame_table_txt_parser(const char *str_to_parse, FrameTableTxtLine *tokens_table)
Definition: FrameTableInc.cpp:69
MonsterInfo::uAIType
uint8_t uAIType
Definition: Monsters.h:130
MonsterInfo::uResEarth
uint8_t uResEarth
Definition: Monsters.h:153
MonsterInfo::uMissleAttack2Type
uint8_t uMissleAttack2Type
Definition: Monsters.h:145
MONSTER_MOVEMENT_TYPE_LONG
@ MONSTER_MOVEMENT_TYPE_LONG
Definition: Monsters.h:62
MONSTER_TITAN_3
@ MONSTER_TITAN_3
Definition: Monsters.h:34
MonsterInfo::uResSpirit
uint8_t uResSpirit
Definition: Monsters.h:155
MonsterInfo::uSpell1UseChance
uint8_t uSpell1UseChance
Definition: Monsters.h:146
MONSTER_ELF_ARCHER_3
@ MONSTER_ELF_ARCHER_3
Definition: Monsters.h:16
MONSTER_ZOMBIE_3
@ MONSTER_ZOMBIE_3
Definition: Monsters.h:40
SPECIAL_ATTACK_TYPE
SPECIAL_ATTACK_TYPE
Definition: Monsters.h:80
MonsterInfo::uResPhysical
uint8_t uResPhysical
Definition: Monsters.h:159
MonsterInfo::uSpellSkillAndMastery1
uint16_t uSpellSkillAndMastery1
Definition: Monsters.h:171
src
GLenum src
Definition: SDL_opengl_glext.h:1740
MONSTER_MOVEMENT_TYPE_SHORT
@ MONSTER_MOVEMENT_TYPE_SHORT
Definition: Monsters.h:60
ParseSpecialAttack
int ParseSpecialAttack(const char *spec_att_str)
MonsterInfo::uID
uint16_t uID
Definition: Monsters.h:169
MonsterStats
Definition: Monsters.h:186
MonsterStats::pPlaceStrings
char * pPlaceStrings[31]
Definition: Monsters.h:195
MonsterInfo::uExp
unsigned int uExp
Definition: Monsters.h:177
MonsterList::GetMonsterIDByName
int16_t GetMonsterIDByName(const char *pMonsterName)
Definition: Monsters.cpp:1192
_strlwr
void _strlwr(char *src)
Definition: PlatformLinux.h:8
v1
GLfloat GLfloat v1
Definition: SDL_opengl_glext.h:694
MonsterList
Definition: Monsters.h:226
Log::Warning
void Warning(const wchar_t *pFormat,...)
Definition: Log.cpp:28
MonsterInfo::bQuestMonster
uint16_t bQuestMonster
Definition: Monsters.h:170
MONSTER_ELF_ARCHER_1
@ MONSTER_ELF_ARCHER_1
Definition: Monsters.h:15
MONSTER_SUPERTYPE_DRAGON
@ MONSTER_SUPERTYPE_DRAGON
Definition: Monsters.h:72
MONSTER_ZOMBIE_1
@ MONSTER_ZOMBIE_1
Definition: Monsters.h:39
MonsterStats::pInfos
MonsterInfo pInfos[265]
Definition: Monsters.h:194
MonsterInfo::uSpecialAttackType
SPECIAL_ATTACK_TYPE uSpecialAttackType
Definition: Monsters.h:133
MonsterInfo::uSpecialAttackLevel
uint8_t uSpecialAttackLevel
Definition: Monsters.h:134
ParseAttackType
int ParseAttackType(const char *damage_type_str)
Definition: Monsters.cpp:125
MonsterInfo::uMovementType
uint8_t uMovementType
Definition: Monsters.h:129
MonsterInfo::uNumCharactersAttackedPerSpecialAbility
uint8_t uNumCharactersAttackedPerSpecialAbility
Definition: Monsters.h:167
ParseDamage
void ParseDamage(char *damage_str, unsigned __int8 *dice_rolls, unsigned __int8 *dice_sides, unsigned __int8 *dmg_bonus)
Definition: Monsters.cpp:151
MONSTER_TREANT_3
@ MONSTER_TREANT_3
Definition: Monsters.h:46
MONSTER_ELEMENTAL_WATER_3
@ MONSTER_ELEMENTAL_WATER_3
Definition: Monsters.h:14
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1740
pEvents_LOD
LODFile_IconsBitmaps * pEvents_LOD
Definition: LOD.cpp:10
MonsterDesc
Definition: Monsters.h:213
MonsterInfo::uResMind
uint8_t uResMind
Definition: Monsters.h:154
MonsterStats::BelongsToSupertype
static bool BelongsToSupertype(unsigned int uMonsterInfoID, enum MONSTER_SUPERTYPE eSupertype)
Definition: Monsters.cpp:1200
MONSTER_SKELETON_1
@ MONSTER_SKELETON_1
Definition: Monsters.h:31
MonsterList::pMonsters
struct MonsterDesc * pMonsters
Definition: Monsters.h:237
MonsterStats::FindMonsterByTextureName
signed int FindMonsterByTextureName(const char *Str2)
Definition: Monsters.cpp:440
MONSTER_SUPERTYPE_TREANT
@ MONSTER_SUPERTYPE_TREANT
Definition: Monsters.h:75
MonsterInfo::uResAir
uint8_t uResAir
Definition: Monsters.h:151
MONSTER_SKELETON_3
@ MONSTER_SKELETON_3
Definition: Monsters.h:32
MonsterInfo::uHP
unsigned int uHP
Definition: Monsters.h:175
pMonsterList
struct MonsterList * pMonsterList
Definition: Monsters.cpp:9
MonsterList::FromFileTxt
bool FromFileTxt(const char *Args)
Definition: Monsters.cpp:265
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11096
MONSTER_MOVEMENT_TYPE_STAIONARY
@ MONSTER_MOVEMENT_TYPE_STAIONARY
Definition: Monsters.h:65
v2
GLfloat GLfloat GLfloat v2
Definition: SDL_opengl_glext.h:695
uint
unsigned int uint
Definition: MM7.h:4
MonsterInfo::uSpell2ID
uint8_t uSpell2ID
Definition: Monsters.h:149
v3
GLfloat GLfloat GLfloat GLfloat v3
Definition: SDL_opengl_glext.h:696
MonsterStats::Initialize
void Initialize()
Definition: Monsters.cpp:491
MONSTER_GHOST_1
@ MONSTER_GHOST_1
Definition: Monsters.h:19
MonsterInfo::uTreasureDiceSides
uint8_t uTreasureDiceSides
Definition: Monsters.h:125
pMonstersTXT_Raw
char * pMonstersTXT_Raw
Definition: mm7_data.cpp:677
MonsterList::FromFile
void FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
Definition: Monsters.cpp:394
MonsterInfo::pName
char * pName
Definition: Monsters.h:120
MonsterInfo::uSpellSkillAndMastery2
uint16_t uSpellSkillAndMastery2
Definition: Monsters.h:172
MONSTER_DRAGON_1
@ MONSTER_DRAGON_1
Definition: Monsters.h:10
MonsterInfo::uAttack1Type
uint8_t uAttack1Type
Definition: Monsters.h:135
MONSTER_SUPERTYPE_WATER_ELEMENTAL
@ MONSTER_SUPERTYPE_WATER_ELEMENTAL
Definition: Monsters.h:74
logger
Log * logger
Definition: IocContainer.cpp:47
MonsterList::uNumMonsters
signed int uNumMonsters
Definition: Monsters.h:236
MonsterInfo::uResWater
uint8_t uResWater
Definition: Monsters.h:152
MONSTER_TITAN_1
@ MONSTER_TITAN_1
Definition: Monsters.h:33
MONSTER_WIGHT_1
@ MONSTER_WIGHT_1
Definition: Monsters.h:37
MonsterInfo::uTreasureLevel
uint8_t uTreasureLevel
Definition: Monsters.h:126
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
MonsterInfo::uAttack2Type
uint8_t uAttack2Type
Definition: Monsters.h:141
MONSTER_GHOUL_1
@ MONSTER_GHOUL_1
Definition: Monsters.h:47
MONSTER_DRAGON_3
@ MONSTER_DRAGON_3
Definition: Monsters.h:12
MONSTER_ELEMENTAL_WATER_1
@ MONSTER_ELEMENTAL_WATER_1
Definition: Monsters.h:13
MonsterInfo::uFlying
uint8_t uFlying
Definition: Monsters.h:128
String
std::string String
Definition: Strings.h:10
MonsterInfo::uRecoveryTime
signed int uRecoveryTime
Definition: Monsters.h:179
MonsterInfo::uLevel
uint8_t uLevel
Definition: Monsters.h:122
FrameTableTxtLine
Definition: FrameTableInc.h:11
MonsterDesc::uMonsterHeight
uint16_t uMonsterHeight
Definition: Monsters.h:214
MONSTER_PEASANT_ELF_FEMALE_1_1
@ MONSTER_PEASANT_ELF_FEMALE_1_1
Definition: Monsters.h:29
MONSTER_LICH_3
@ MONSTER_LICH_3
Definition: Monsters.h:25