annotate Monsters.cpp @ 2045:696545f20be7

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