Mercurial > mm7
annotate mm7_4.cpp @ 1418:483b1b453986
more label cleaning
author | zipi |
---|---|
date | Sun, 28 Jul 2013 17:45:21 +0100 |
parents | 3881d2f94eb1 |
children | 9a1adf08f4ed |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1110
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1110
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1110
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1110
diff
changeset
|
4 |
198 | 5 #include <assert.h> |
0 | 6 |
1262 | 7 #include "Texture.h" |
8 #include "mm7_data.h" | |
1016 | 9 #include "VideoPlayer.h" |
10 #include "Sprites.h" | |
11 #include "BSPModel.h" | |
12 #include "OutdoorCamera.h" | |
13 #include "Mouse.h" | |
14 #include "stru6.h" | |
15 | |
16 #include "LightmapBuilder.h" | |
341 | 17 #include "MM7.h" |
0 | 18 #include "MapInfo.h" |
19 #include "Game.h" | |
20 #include "GUIWindow.h" | |
21 #include "GUIFont.h" | |
22 #include "Party.h" | |
23 #include "AudioPlayer.h" | |
24 #include "Outdoor.h" | |
1277 | 25 #include "Outdoor_stuff.h" |
0 | 26 #include "IndoorCamera.h" |
27 #include "LOD.h" | |
28 #include "Actor.h" | |
29 #include "Allocator.h" | |
30 #include "Events.h" | |
31 #include "Viewport.h" | |
32 #include "FrameTableInc.h" | |
33 #include "Math.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
34 #include "SpriteObject.h" |
0 | 35 #include "ObjectList.h" |
36 #include "DecorationList.h" | |
37 #include "Time.h" | |
38 #include "IconFrameTable.h" | |
39 #include "PlayerFrameTable.h" | |
40 #include "Awards.h" | |
41 #include "TurnEngine.h" | |
42 #include "Events2D.h" | |
43 #include "stru159.h" | |
189 | 44 #include "texts.h" |
0 | 45 #include "Log.h" |
1299 | 46 #include "UI\UIHouses.h" |
1262 | 47 #include "Lights.h" |
0 | 48 |
49 //----- (0046CC4B) -------------------------------------------------------- | |
783 | 50 void __cdecl check_event_triggers() |
0 | 51 { |
52 int v0; // eax@1 | |
53 LevelDecoration *v1; // esi@2 | |
54 signed int v2; // edi@2 | |
55 int v3; // ebx@2 | |
56 int v4; // eax@3 | |
57 int v5; // ebx@3 | |
58 unsigned int v6; // ecx@3 | |
59 unsigned int v7; // edx@6 | |
60 unsigned int v8; // edx@8 | |
112 | 61 Actor *v9; // edi@13 |
0 | 62 int v10; // ebx@14 |
63 int v11; // eax@14 | |
64 int v12; // ebx@14 | |
65 unsigned int v13; // ecx@14 | |
66 int v14; // edx@15 | |
67 unsigned int v15; // edx@17 | |
68 unsigned int v16; // edx@19 | |
69 char *v17; // edi@25 | |
70 int v18; // ebx@26 | |
71 int v19; // eax@26 | |
72 int v20; // ebx@26 | |
73 unsigned int v21; // ecx@26 | |
74 int v22; // edx@27 | |
75 unsigned int v23; // edx@29 | |
76 unsigned int v24; // edx@31 | |
77 int v25; // [sp+0h] [bp-24h]@3 | |
78 int v26; // [sp+0h] [bp-24h]@14 | |
79 int v27; // [sp+0h] [bp-24h]@26 | |
80 int v28; // [sp+4h] [bp-20h]@3 | |
81 int v29; // [sp+4h] [bp-20h]@14 | |
82 int v30; // [sp+4h] [bp-20h]@26 | |
83 signed int v31; // [sp+8h] [bp-1Ch]@2 | |
84 int v32; // [sp+Ch] [bp-18h]@2 | |
85 int v33; // [sp+10h] [bp-14h]@2 | |
86 int i; // [sp+14h] [bp-10h]@1 | |
87 int v35; // [sp+18h] [bp-Ch]@2 | |
88 int v36; // [sp+1Ch] [bp-8h]@3 | |
89 signed int v37; // [sp+1Ch] [bp-8h]@12 | |
90 signed int v38; // [sp+20h] [bp-4h]@24 | |
91 | |
92 v0 = 0; | |
93 for ( i = 0; i < _6836C8_num_decorations_6807E8; ++i ) | |
94 { | |
95 v1 = &pLevelDecorations[_6807E8_level_decorations_ids[v0]]; | |
96 v2 = v1->field_18; | |
97 v3 = v1->vPosition.y; | |
98 v33 = v1->vPosition.x; | |
99 v32 = v1->vPosition.y; | |
100 v35 = v1->vPosition.z; | |
101 v31 = v1->field_18; | |
102 if ( v1->field_2 & 1 ) | |
103 { | |
104 v36 = abs(v1->vPosition.x - pParty->vPosition.x); | |
105 v25 = abs(v3 - pParty->vPosition.y); | |
106 v28 = abs(v35 - pParty->vPosition.z); | |
107 v4 = v36; | |
108 v5 = v25; | |
109 v6 = v28; | |
110 if ( v36 < v25 ) | |
111 { | |
112 v4 = v25; | |
113 v5 = v36; | |
114 } | |
115 if ( v4 < v28 ) | |
116 { | |
117 v7 = v4; | |
118 v4 = v28; | |
119 v6 = v7; | |
120 } | |
121 if ( v5 < (signed int)v6 ) | |
122 { | |
123 v8 = v6; | |
124 v6 = v5; | |
125 v5 = v8; | |
126 } | |
127 if ( (signed int)(((unsigned int)(11 * v5) >> 5) + (v6 >> 2) + v4) < v2 ) | |
862 | 128 EventProcessor(v1->field_16_event_id, PID(OBJECT_Decoration,i), 1); |
0 | 129 } |
130 if ( v1->field_2 & 2 ) | |
131 { | |
132 v37 = 0; | |
133 if ( (signed int)uNumActors > 0 ) | |
134 { | |
1202 | 135 v9 = pActors.data();//[0].vPosition.y; |
0 | 136 do |
137 { | |
112 | 138 v10 = abs(v33 - v9->vPosition.x); |
139 v29 = abs(v32 - v9->vPosition.y); | |
140 v26 = abs(v35 - v9->vPosition.z); | |
0 | 141 v11 = v10; |
142 v12 = v29; | |
143 v13 = v26; | |
144 if ( v11 < v29 ) | |
145 { | |
146 v14 = v11; | |
147 v11 = v29; | |
148 v12 = v14; | |
149 } | |
150 if ( v11 < v26 ) | |
151 { | |
152 v15 = v11; | |
153 v11 = v26; | |
154 v13 = v15; | |
155 } | |
156 if ( v12 < (signed int)v13 ) | |
157 { | |
158 v16 = v13; | |
159 v13 = v12; | |
160 v12 = v16; | |
161 } | |
162 if ( (signed int)(((unsigned int)(11 * v12) >> 5) + (v13 >> 2) + v11) < v31 ) | |
163 EventProcessor(v1->field_16_event_id, 0, 1); | |
164 ++v37; | |
112 | 165 ++v9; |
0 | 166 } |
167 while ( v37 < (signed int)uNumActors ); | |
168 } | |
169 } | |
170 if ( v1->field_2 & 4 ) | |
171 { | |
172 v38 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
173 if ( (signed int)uNumSpriteObjects > 0 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
174 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
175 v17 = (char *)&pSpriteObjects[0].vPosition.y; |
0 | 176 do |
177 { | |
178 v18 = abs(v33 - *((int *)v17 - 1)); | |
179 v30 = abs(v32 - *(int *)v17); | |
180 v27 = abs(v35 - *((int *)v17 + 1)); | |
181 v19 = v18; | |
182 v20 = v30; | |
183 v21 = v27; | |
184 if ( v19 < v30 ) | |
185 { | |
186 v22 = v19; | |
187 v19 = v30; | |
188 v20 = v22; | |
189 } | |
190 if ( v19 < v27 ) | |
191 { | |
192 v23 = v19; | |
193 v19 = v27; | |
194 v21 = v23; | |
195 } | |
196 if ( v20 < (signed int)v21 ) | |
197 { | |
198 v24 = v21; | |
199 v21 = v20; | |
200 v20 = v24; | |
201 } | |
202 if ( (signed int)(((unsigned int)(11 * v20) >> 5) + (v21 >> 2) + v19) < v31 ) | |
203 EventProcessor(v1->field_16_event_id, 0, 1); | |
204 ++v38; | |
205 v17 += 112; | |
206 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
207 while ( v38 < (signed int)uNumSpriteObjects ); |
0 | 208 } |
209 } | |
210 v0 = i + 1; | |
211 } | |
212 } | |
213 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8; | |
214 | |
215 //----- (0046D8E3) -------------------------------------------------------- | |
216 int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4) | |
217 { | |
218 int v4; // ebx@1 | |
219 unsigned int v5; // ecx@1 | |
220 BSPModel *v6; // edi@3 | |
221 ODMFace *v7; // esi@10 | |
222 unsigned __int8 v8; // al@10 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
659
diff
changeset
|
223 signed __int16 *v9; // eax@18 |
0 | 224 int v10; // edx@19 |
225 int v11; // ecx@21 | |
226 int v12; // ecx@23 | |
227 signed int v13; // eax@25 | |
228 int v14; // edx@27 | |
229 int v15; // edx@29 | |
230 int v16; // ST18_4@29 | |
231 signed int v17; // edx@29 | |
232 signed __int64 v18; // qtt@29 | |
233 int v19; // eax@35 | |
234 signed int v20; // ecx@37 | |
235 signed int v22; // ebx@42 | |
236 unsigned int v23; // esi@43 | |
237 int v24; // edx@44 | |
238 int v25; // eax@44 | |
239 int v26; // [sp+Ch] [bp-38h]@7 | |
240 int v27; // [sp+10h] [bp-34h]@21 | |
241 int v28; // [sp+18h] [bp-2Ch]@21 | |
242 int v29; // [sp+1Ch] [bp-28h]@2 | |
243 unsigned int v30; // [sp+20h] [bp-24h]@8 | |
244 signed int v31; // [sp+24h] [bp-20h]@1 | |
245 signed int v32; // [sp+28h] [bp-1Ch]@1 | |
246 int v33; // [sp+2Ch] [bp-18h]@7 | |
247 bool v34; // [sp+30h] [bp-14h]@21 | |
248 bool v35; // [sp+34h] [bp-10h]@23 | |
249 signed int v36; // [sp+38h] [bp-Ch]@17 | |
250 signed int v37; // [sp+38h] [bp-Ch]@21 | |
251 signed int v38; // [sp+38h] [bp-Ch]@42 | |
252 signed int v39; // [sp+3Ch] [bp-8h]@1 | |
253 signed int v40; // [sp+40h] [bp-4h]@1 | |
254 | |
255 dword_720ED0[0] = -1; | |
256 dword_720E80[0] = -1; | |
257 v4 = a1; | |
258 v5 = 0; | |
259 v40 = a2; | |
260 v31 = v4; | |
261 v39 = 1; | |
262 dword_720F20[0] = 10000; | |
263 v32 = 0; | |
264 if ( (signed int)pOutdoor->uNumBModels > 0 ) | |
265 { | |
266 v29 = 0; | |
267 do | |
268 { | |
269 v6 = &pOutdoor->pBModels[v29]; | |
270 if ( v4 <= pOutdoor->pBModels[v29].sMaxX ) | |
271 { | |
272 if ( v4 >= v6->sMinX ) | |
273 { | |
274 if ( v40 <= v6->sMaxY ) | |
275 { | |
276 if ( v40 >= v6->sMinY ) | |
277 { | |
278 v33 = v5; | |
279 v26 = v6->uNumFaces; | |
280 if ( (signed int)v6->uNumFaces > (signed int)v5 ) | |
281 { | |
282 v30 = v5; | |
283 while ( 1 ) | |
284 { | |
285 v7 = (ODMFace *)((char *)v6->pFaces + v30); | |
286 v8 = v7->uPolygonType; | |
287 if ( (v8 == 5 || v8 == 6) | |
288 && !(BYTE3(v7->uAttributes) & 0x20) | |
289 && v4 <= v7->pBoundingBox.x2 | |
290 && v4 >= v7->pBoundingBox.x1 | |
291 && v40 <= v7->pBoundingBox.y2 | |
292 && v40 >= v7->pBoundingBox.y1 ) | |
293 { | |
294 v36 = v5; | |
295 if ( v7->uNumVertices ) | |
296 { | |
297 v9 = v7->pXInterceptDisplacements; | |
298 do | |
299 { | |
300 v10 = 2 * v36; | |
301 word_720DB0_xs[2 * v36] = *v9 + LOWORD(v6->pVertices.pVertices[*(v9 - 60)].x); | |
302 word_720CE0_ys[2 * v36] = v9[20] + LOWORD(v6->pVertices.pVertices[*(v9 - 60)].y); | |
303 word_720DB0_xs[2 * v36++ + 1] = *v9 + LOWORD(v6->pVertices.pVertices[*(v9 - 59)].x); | |
304 word_720CE0_ys[v10 + 1] = v9[20] + LOWORD(v6->pVertices.pVertices[*(v9 - 59)].y); | |
305 ++v9; | |
306 } | |
307 while ( v36 < v7->uNumVertices ); | |
308 v4 = v31; | |
309 } | |
310 v27 = 2 * v7->uNumVertices; | |
311 word_720DB0_xs[2 * v7->uNumVertices] = word_720DB0_xs[0]; | |
312 word_720CE0_ys[v27] = word_720CE0_ys[0]; | |
313 v11 = 0; | |
314 v34 = word_720CE0_ys[0] >= v40; | |
315 v37 = 0; | |
316 v28 = 0; | |
317 if ( v27 > 0 ) | |
318 { | |
319 do | |
320 { | |
321 if ( v37 >= 2 ) | |
322 break; | |
323 v12 = v11; | |
324 v4 = v31; | |
325 v35 = word_720CE0_ys[v12 + 1] >= v40; | |
326 if ( v34 != v35 ) | |
327 { | |
328 v13 = word_720DB0_xs[v12 + 1] >= v31 ? 0 : 2; | |
1110 | 329 v14 = v13 | (word_720DB0_xs[v12] < v31); |
0 | 330 if ( v14 != 3 ) |
331 { | |
332 if ( !v14 | |
333 || (v15 = word_720CE0_ys[v12], | |
334 v16 = word_720CE0_ys[v12 + 1] - v15, | |
335 v17 = v40 - v15, | |
336 LODWORD(v18) = v17 << 16, | |
337 HIDWORD(v18) = v17 >> 16, | |
338 (signed int)(((unsigned __int64)(((signed int)word_720DB0_xs[v12 + 1] | |
339 - (signed int)word_720DB0_xs[v12]) | |
340 * v18 | |
341 / v16) >> 16) | |
342 + word_720DB0_xs[v12]) >= v31) ) | |
343 ++v37; | |
344 } | |
345 } | |
346 v11 = v28 + 1; | |
347 v34 = v35; | |
348 ++v28; | |
349 } | |
350 while ( v28 < v27 ); | |
351 if ( v37 == 1 ) | |
352 { | |
353 if ( v39 >= 20 ) | |
354 break; | |
355 if ( v7->uPolygonType == 5 ) | |
356 v19 = v6->pVertices.pVertices[v7->pVertexIDs[0]].z; | |
357 else | |
358 v19 = ((unsigned __int64)(v7->zCalc1 * (signed __int64)v4) >> 16) | |
359 + ((unsigned __int64)(v7->zCalc2 * (signed __int64)v40) >> 16) | |
360 + HIWORD(v7->zCalc3); | |
361 v20 = v39++; | |
362 dword_720F20[v20] = v19; | |
363 dword_720ED0[v20] = v32; | |
364 dword_720E80[v20] = v33; | |
365 } | |
366 } | |
367 } | |
368 ++v33; | |
369 v30 += 308; | |
370 if ( v33 >= v26 ) | |
371 break; | |
372 v5 = 0; | |
373 } | |
374 } | |
375 } | |
376 } | |
377 } | |
378 } | |
379 ++v32; | |
380 ++v29; | |
381 v5 = 0; | |
382 } | |
383 while ( v32 < (signed int)pOutdoor->uNumBModels ); | |
384 if ( !v39 ) | |
385 { | |
386 *(int *)a4 = 0; | |
387 return dword_720F20[0]; | |
388 } | |
389 } | |
390 v22 = 0; | |
391 v38 = v5; | |
392 if ( v39 <= (signed int)v5 ) | |
393 goto LABEL_54; | |
394 v23 = 0; | |
395 do | |
396 { | |
397 v24 = dword_720F20[v5 / 4]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
398 v25 = *(int *)((char *)dword_720F20.data() + v23); |
0 | 399 if ( v24 == v25 ) |
400 goto LABEL_50; | |
401 if ( v25 > a3 + 15 ) | |
402 { | |
403 if ( v24 >= v25 ) | |
404 goto LABEL_51; | |
405 LABEL_50: | |
406 v22 = v38; | |
407 v23 = v5; | |
408 goto LABEL_51; | |
409 } | |
410 if ( v24 > v25 && v24 <= a3 + 15 ) | |
411 goto LABEL_50; | |
412 LABEL_51: | |
413 ++v38; | |
414 v5 += 4; | |
415 } | |
416 while ( v38 < v39 ); | |
417 if ( v22 ) | |
418 { | |
419 *(int *)a4 = dword_720E80[v22] | (dword_720ED0[v22] << 6); | |
420 return dword_720F20[v22]; | |
421 } | |
422 LABEL_54: | |
423 *(int *)a4 = 0; | |
424 return dword_720F20[v22]; | |
425 } | |
426 | |
427 //----- (0046DEF2) -------------------------------------------------------- | |
428 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID) | |
429 { | |
430 unsigned int result; // eax@1 | |
431 | |
432 result = uLayingItemID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
433 if ( pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID].uFlags & 0x10 ) |
0 | 434 result = _46BFFA_check_object_intercept(uLayingItemID, a2); |
435 return result; | |
436 } | |
437 | |
438 //----- (0046E0B2) -------------------------------------------------------- | |
439 void __cdecl _46E0B2_collide_against_decorations() | |
440 { | |
441 BLVSector *v0; // ebp@1 | |
442 LevelDecoration *v1; // edi@2 | |
443 DecorationDesc *v2; // esi@3 | |
444 int v3; // edx@4 | |
445 int v4; // eax@4 | |
446 int v5; // ecx@6 | |
447 int v6; // ebx@8 | |
448 int v7; // esi@8 | |
449 int v8; // ebx@10 | |
450 int v9; // esi@11 | |
451 int v10; // edi@12 | |
452 int v11; // eax@12 | |
453 int v12; // esi@14 | |
454 unsigned int v13; // eax@17 | |
455 signed int i; // [sp+4h] [bp-14h]@1 | |
456 int v15; // [sp+8h] [bp-10h]@10 | |
457 int v16; // [sp+Ch] [bp-Ch]@10 | |
458 int v17; // [sp+10h] [bp-8h]@10 | |
459 int v18; // [sp+14h] [bp-4h]@8 | |
460 | |
461 v0 = &pIndoor->pSectors[stru_721530.uSectorID]; | |
462 for ( i = 0; i < v0->uNumDecorations; ++i ) | |
463 { | |
464 v1 = &pLevelDecorations[v0->pDecorationIDs[i]]; | |
465 if ( !(v1->field_2 & 0x20) ) | |
466 { | |
467 v2 = &pDecorationList->pDecorations[v1->uDecorationDescID]; | |
380 | 468 if (!v2->CanMoveThrough()) |
0 | 469 { |
470 v3 = v2->uRadius; | |
471 v4 = v1->vPosition.x; | |
472 if ( stru_721530.sMaxX <= v4 + v3 ) | |
473 { | |
474 if ( stru_721530.sMinX >= v4 - v3 ) | |
475 { | |
476 v5 = v1->vPosition.y; | |
477 if ( stru_721530.sMaxY <= v5 + v3 ) | |
478 { | |
479 if ( stru_721530.sMinY >= v5 - v3 ) | |
480 { | |
481 v6 = v2->uDecorationHeight; | |
482 v7 = v1->vPosition.z; | |
483 v18 = v6; | |
484 if ( stru_721530.sMaxZ <= v7 + v6 ) | |
485 { | |
486 if ( stru_721530.sMinZ >= v7 ) | |
487 { | |
488 v16 = v4 - stru_721530.normal.x; | |
489 v15 = v5 - stru_721530.normal.y; | |
490 v8 = stru_721530.prolly_normal_d + v3; | |
491 v17 = ((v4 - stru_721530.normal.x) * stru_721530.field_58.y | |
492 - (v5 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16; | |
493 if ( abs(v17) <= stru_721530.prolly_normal_d + v3 ) | |
494 { | |
495 v9 = (v16 * stru_721530.field_58.x + v15 * stru_721530.field_58.y) >> 16; | |
496 if ( v9 > 0 ) | |
497 { | |
498 v10 = v1->vPosition.z; | |
499 v11 = stru_721530.normal.z | |
500 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v9) >> 16); | |
501 if ( v11 >= v10 ) | |
502 { | |
503 if ( v11 <= v18 + v10 ) | |
504 { | |
295 | 505 v12 = v9 - integer_sqrt(v8 * v8 - v17 * v17); |
0 | 506 if ( v12 < 0 ) |
507 v12 = 0; | |
508 if ( v12 < stru_721530.field_7C ) | |
509 { | |
510 stru_721530.field_7C = v12; | |
511 v13 = 8 * v0->pDecorationIDs[i]; | |
512 LOBYTE(v13) = v13 | 5; | |
513 stru_721530.uFaceID = v13; | |
514 } | |
515 } | |
516 } | |
517 } | |
518 } | |
519 } | |
520 } | |
521 } | |
522 } | |
523 } | |
524 } | |
525 } | |
526 } | |
527 } | |
528 } | |
529 | |
530 //----- (00487DA9) -------------------------------------------------------- | |
531 void __cdecl sub_487DA9() | |
532 { | |
1413 | 533 for (int i = 0; i < 20000; ++i) |
534 array_77EC08[i].field_108 = 0; | |
0 | 535 } |
536 | |
537 //----- (00487DBE) -------------------------------------------------------- | |
538 void Software_ResetNewEdges() | |
539 { | |
540 int v0; // ecx@1 | |
541 Edge **v1; // eax@1 | |
542 signed int v2; // eax@3 | |
543 | |
544 v0 = 0; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
545 v1 = ptr_80CA10.data(); |
0 | 546 do |
547 { | |
548 ++v0; | |
549 *((int *)&pNewEdges[v0] - 9) = (int)&defaultEdge; | |
550 *v1 = 0; | |
551 ++v1; | |
552 } | |
553 while ( (signed int)v1 < (signed int)&unk_80D190 ); | |
554 v2 = 2000; | |
555 do | |
556 { | |
557 pSurfs->field_22 = 0; | |
558 --v2; | |
559 } | |
560 while ( v2 ); | |
561 } | |
562 | |
563 //----- (0048A959) -------------------------------------------------------- | |
564 unsigned int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace) | |
565 { | |
566 float r = ((uColor & 0x00FF0000) >> 16) / 255.0f, | |
567 g = ((uColor & 0x0000FF00) >> 8) / 255.0f, | |
568 b = (uColor & 0x000000FF) / 255.0f; | |
569 | |
570 float h, s, v; | |
571 RGB2HSV(&h, &s, r, g, b, &v); | |
572 | |
573 if ( h_replace != -1.0 ) | |
574 h = h_replace; | |
575 if ( s_replace != -1.0 ) | |
576 s = s_replace; | |
577 if ( v_replace != -1.0 ) | |
578 v = v_replace; | |
579 HSV2RGB(&r, &g, &b, h, s, v); | |
580 | |
1413 | 581 return (((uint)round(r * 255.0f) & 0xFF) << 16) | |
582 (((uint)round(g * 255.0f) & 0xFF) << 8) | | |
583 (((uint)round(b * 255.0f) & 0xFF)); | |
0 | 584 } |
585 | |
586 //----- (0048B561) -------------------------------------------------------- | |
1029 | 587 int fixpoint_from_float(float val) |
0 | 588 { |
1029 | 589 // float X.Yf -> int XXXX YYYY |
590 int left = floorf((val - 0.5f) + 0.5f); | |
591 int right = floorf((val - left) * 65536.0f); | |
592 return (left << 16) | right; | |
0 | 593 } |
594 | |
595 //----- (00491E3A) -------------------------------------------------------- | |
596 void __cdecl sub_491E3A() | |
597 { | |
598 Player *v0; // ebx@1 | |
599 signed int v1; // esi@3 | |
600 char *v2; // eax@4 | |
601 unsigned int v3; // eax@7 | |
602 unsigned int v4; // edx@8 | |
603 char *v5; // ecx@9 | |
604 int v6; // edi@17 | |
605 Texture *v7; // ebx@18 | |
606 struct IDirect3DTexture2 **v8; // eax@19 | |
607 struct IDirect3DTexture2 *v9; // eax@20 | |
608 struct IDirectDrawSurface **v10; // eax@22 | |
609 struct IDirectDrawSurface *v11; // eax@23 | |
610 int v12; // eax@26 | |
611 | |
612 v0 = pParty->pPlayers; | |
613 do | |
614 { | |
203 | 615 if (SoundSetAction[24][0]) |
0 | 616 { |
617 v1 = 0; | |
764 | 618 if ( (signed int)pSoundList->sNumSounds <= 0 ) |
0 | 619 { |
620 LABEL_7: | |
621 v3 = 0; | |
622 } | |
623 else | |
624 { | |
625 v2 = (char *)&pSoundList->pSounds->uSoundID; | |
203 | 626 while ( *(int *)v2 != 2 * (SoundSetAction[24][0] + 50 * v0->uVoiceID) + 4998 ) |
0 | 627 { |
628 ++v1; | |
629 v2 += 120; | |
764 | 630 if ( v1 >= (signed int)pSoundList->sNumSounds ) |
0 | 631 goto LABEL_7; |
632 } | |
633 v3 = v1; | |
634 } | |
764 | 635 pSoundList->UnloadSound(v3, 1); |
0 | 636 v4 = 0; |
764 | 637 if ( (signed int)pSoundList->sNumSounds <= 0 ) |
0 | 638 { |
639 LABEL_12: | |
640 v4 = 0; | |
641 } | |
642 else | |
643 { | |
644 v5 = (char *)&pSoundList->pSounds->uSoundID; | |
203 | 645 while ( *(int *)v5 != 2 * (SoundSetAction[24][0] + 50 * v0->uVoiceID) + 4999 ) |
0 | 646 { |
647 ++v4; | |
648 v5 += 120; | |
764 | 649 if ( (signed int)v4 >= (signed int)pSoundList->sNumSounds ) |
0 | 650 goto LABEL_12; |
651 } | |
652 } | |
764 | 653 pSoundList->UnloadSound(v4, 1); |
0 | 654 } |
655 ++v0; | |
656 } | |
657 while ( (signed int)v0 < (signed int)pParty->pHirelings ); | |
658 v6 = pIcons_LOD->uNumLoadedFiles - 1; | |
33 | 659 if ( v6 >= pIcons_LOD->pFacesLock ) |
0 | 660 { |
661 v7 = &pIcons_LOD->pTextures[v6]; | |
662 do | |
663 { | |
664 v7->Release(); | |
665 v8 = pIcons_LOD->pHardwareTextures; | |
666 if ( v8 ) | |
667 { | |
668 v9 = v8[v6]; | |
669 if ( v9 ) | |
670 { | |
671 v9->Release(); | |
672 pIcons_LOD->pHardwareTextures[v6] = 0; | |
673 } | |
674 } | |
675 v10 = pIcons_LOD->pHardwareSurfaces; | |
676 if ( v10 ) | |
677 { | |
678 v11 = v10[v6]; | |
679 if ( v11 ) | |
680 { | |
681 v11->Release(); | |
682 pIcons_LOD->pHardwareSurfaces[v6] = 0; | |
683 } | |
684 } | |
685 --v6; | |
686 --v7; | |
687 } | |
33 | 688 while ( v6 >= pIcons_LOD->pFacesLock ); |
689 } | |
690 v12 = pIcons_LOD->pFacesLock; | |
691 pIcons_LOD->pFacesLock = 0; | |
0 | 692 pIcons_LOD->uNumLoadedFiles = v12; |
693 } | |
694 // 4ED498: using guessed type char byte_4ED498; | |
695 | |
696 //----- (00493938) -------------------------------------------------------- | |
697 int __cdecl _493938_regenerate() | |
698 { | |
699 int v0; // edi@1 | |
700 signed __int64 v1; // qax@1 | |
701 int v2; // ecx@1 | |
702 int result; // eax@1 | |
703 int v4; // eax@2 | |
704 int v5; // edi@5 | |
112 | 705 int *v6; // ecx@5 |
0 | 706 char v7; // sf@5 |
112 | 707 int *v8; // ecx@10 |
0 | 708 int v9; // edi@15 |
709 signed int v10; // eax@15 | |
710 __int16 *v11; // edx@16 | |
711 int v12; // eax@20 | |
712 int v13; // ebx@20 | |
713 unsigned int *v14; // esi@21 | |
714 unsigned int v15; // ecx@21 | |
715 unsigned int v16; // eax@21 | |
716 int v17; // edx@21 | |
717 int v18; // eax@21 | |
718 signed int v19; // eax@21 | |
719 signed int v20; // ebx@25 | |
720 Player *v21; // esi@25 | |
721 ITEM_EQUIP_TYPE v22; // edi@30 | |
722 //int v23; // edx@31 | |
723 signed int v24; // ecx@32 | |
724 signed int v25; // eax@33 | |
725 int v26; // eax@35 | |
726 int v27; // eax@36 | |
727 int v28; // eax@37 | |
728 int v29; // eax@40 | |
729 int v30; // eax@41 | |
730 signed int v31; // ecx@53 | |
731 char *v32; // eax@53 | |
732 char *v33; // edi@82 | |
733 int v34; // ecx@88 | |
734 int v35; // eax@88 | |
735 char *v36; // edi@99 | |
736 int v37; // edi@104 | |
737 int v38; // edi@106 | |
738 int v39; // edi@111 | |
739 int v40; // ecx@113 | |
740 char v41[400]; // [sp+4h] [bp-22Ch]@20 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
741 SpriteObject a1; // [sp+194h] [bp-9Ch]@15 |
0 | 742 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15 |
743 int v44; // [sp+210h] [bp-20h]@22 | |
744 int v45; // [sp+214h] [bp-1Ch]@25 | |
745 int v46; // [sp+218h] [bp-18h]@25 | |
746 int v47; // [sp+21Ch] [bp-14h]@25 | |
747 int v48; // [sp+220h] [bp-10h]@25 | |
748 int v49; // [sp+224h] [bp-Ch]@24 | |
749 int v50; // [sp+228h] [bp-8h]@25 | |
750 int v51; // [sp+22Ch] [bp-4h]@2 | |
751 | |
752 v0 = (signed int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60; | |
753 v1 = (signed __int64)((double)pParty->uLastRegenerationTime * 0.234375); | |
754 v2 = (signed int)v1 / 60; | |
755 result = (signed int)v1 / 60 + 5; | |
756 if ( v0 >= result ) | |
757 { | |
758 v51 = 0; | |
759 v4 = (v0 - v2) / 5; | |
760 if (pParty->FlyActive()) | |
761 { | |
762 if ( pParty->bFlying ) | |
763 { | |
569 | 764 if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) ) |
765 { // colliding with something in the air - fall down | |
766 v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower; | |
767 //__debugbreak(); | |
1167 | 768 v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster + 2000]; |
112 | 769 v7 = *v6 < v5; |
770 *v6 -= v5; | |
0 | 771 if ( v7 ) |
772 { | |
112 | 773 *v6 = 0; |
0 | 774 pParty->uFlags &= 0xFFFFFFBFu; |
775 pParty->bFlying = 0; | |
776 v51 = 1; | |
777 } | |
778 } | |
779 } | |
780 } | |
569 | 781 |
0 | 782 if (pParty->WaterWalkActive()) |
783 { | |
569 | 784 if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) |
785 { | |
786 if ( !(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) ) | |
787 { // taking on water | |
788 //__debugbreak(); | |
1167 | 789 v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 2000]; |
112 | 790 v7 = *v8 < v4; |
791 *v8 -= v4; | |
0 | 792 if ( v7 ) |
793 { | |
112 | 794 *v8 = 0; |
569 | 795 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; |
0 | 796 v51 = 1; |
797 } | |
798 } | |
799 } | |
800 } | |
569 | 801 |
0 | 802 if (pParty->ImmolationActive()) |
803 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
804 //SpriteObject::SpriteObject(&a1); |
0 | 805 v9 = 0; |
806 a3.z = 0; | |
807 a3.y = 0; | |
808 a3.x = 0; | |
809 a1.stru_24.Reset(); | |
822 | 810 a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower; |
811 a1.spell_skill = pParty->ImmolationSkillLevel(); | |
0 | 812 v10 = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
813 a1.uType = 1070; |
822 | 814 a1.spell_id = SPELL_FIRE_IMMOLATION; |
0 | 815 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
816 { | |
817 LABEL_19: | |
818 LOWORD(v10) = 0; | |
819 } | |
820 else | |
821 { | |
822 v11 = &pObjectList->pObjects->uObjectID; | |
924 | 823 while ( stru_4E3ACC[8].uType != *v11 ) |
0 | 824 { |
825 ++v10; | |
826 v11 += 28; | |
827 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
828 goto LABEL_19; | |
829 } | |
830 } | |
831 a1.uObjectDescID = v10; | |
832 a1.field_60_distance_related_prolly_lod = 0; | |
1167 | 833 v12 = 8 * pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster; |
303 | 834 LOBYTE(v12) = v12 | OBJECT_Player; |
0 | 835 a1.uAttributes = 0; |
836 a1.uSectorID = 0; | |
837 a1.uSpriteFrameID = 0; | |
822 | 838 a1.spell_caster_pid = v12; |
0 | 839 a1.uFacing = 0; |
840 a1.uSoundID = 0; | |
841 v13 = sub_46A89E((int)v41, 100, 307); | |
842 if ( v13 > 0 ) | |
843 { | |
844 do | |
845 { | |
846 v14 = (unsigned int *)&v41[4 * v9]; | |
847 v15 = *v14; | |
848 v16 = *v14; | |
849 a1.vPosition.x = pActors[v16].vPosition.x; | |
850 v17 = pActors[v16].vPosition.y; | |
851 a1.vPosition.z = pActors[v16].vPosition.z; | |
852 v18 = 8 * v15; | |
862 | 853 LOBYTE(v18) = PID(OBJECT_Actor,v15); |
0 | 854 a1.vPosition.y = v17; |
823 | 855 a1.spell_target_pid = v18; |
0 | 856 v19 = a1.Create(0, 0, 0, 0); |
862 | 857 DamageMonsterFromParty(PID(OBJECT_Item,v19), *v14, &a3); |
0 | 858 ++v9; |
859 } | |
860 while ( v9 < v13 ); | |
861 } | |
862 } | |
863 v44 = 0; | |
248 | 864 if (PartyHasDragon()) |
0 | 865 v44 = 1; |
866 v49 = 0; | |
867 LABEL_25: | |
868 v20 = 0; | |
869 v21 = &pParty->pPlayers[v49]; | |
870 v50 = 0; | |
871 v47 = 0; | |
872 v45 = 0; | |
873 v48 = 0; | |
874 v46 = 0; | |
255 | 875 if ( v44 && v21->classType == PLAYER_CLASS_WARLOCK ) |
0 | 876 v50 = 1; |
135 | 877 if ( v21->classType == PLAYER_CLASS_LICH ) |
0 | 878 v48 = 1; |
879 v22 = (ITEM_EQUIP_TYPE)0; | |
880 while ( 1 ) | |
881 { | |
882 if ( v21->HasItemEquipped(v22) ) | |
883 { | |
884 //v23 = v21->pEquipment.pIndices; | |
885 auto _idx = v21->pEquipment.pIndices[v22]; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1372
diff
changeset
|
886 v24 = v21->pInventoryItemList[_idx].uItemID; |
0 | 887 if ( v24 > 134 ) |
888 { | |
889 if ( v24 == 529 ) | |
890 goto LABEL_43; | |
891 if ( v24 == 535 ) | |
892 goto LABEL_44; | |
893 if ( v24 == 515 ) | |
894 { | |
895 v47 = 1; | |
896 } | |
897 else | |
898 { | |
899 if ( v24 == 532 ) | |
900 goto LABEL_50; | |
901 } | |
902 } | |
903 else | |
904 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1372
diff
changeset
|
905 v25 = v21->pInventoryItemList[_idx].uSpecEnchantmentType; |
0 | 906 if ( v25 <= 50 ) |
907 { | |
908 if ( v25 != 50 ) | |
909 { | |
910 v26 = v25 - 37; | |
911 if ( v26 ) | |
912 { | |
913 v27 = v26 - 1; | |
914 if ( !v27 ) | |
915 goto LABEL_50; | |
916 v28 = v27 - 6; | |
917 if ( v28 ) | |
918 { | |
919 if ( v28 != 3 ) | |
920 goto LABEL_51; | |
921 LABEL_50: | |
922 v50 = 1; | |
923 goto LABEL_51; | |
924 } | |
925 } | |
926 } | |
927 LABEL_44: | |
928 v20 = 1; | |
929 goto LABEL_51; | |
930 } | |
931 v29 = v25 - 54; | |
932 if ( !v29 ) | |
933 goto LABEL_44; | |
934 v30 = v29 - 1; | |
935 if ( !v30 ) | |
936 goto LABEL_50; | |
937 if ( v30 == 11 ) | |
938 { | |
939 LABEL_43: | |
940 v20 = 1; | |
941 v50 = 1; | |
942 goto LABEL_51; | |
943 } | |
944 } | |
945 } | |
946 LABEL_51: | |
947 v22 = (ITEM_EQUIP_TYPE)((int)v22 + 1); | |
948 if ( (signed int)v22 >= 16 ) | |
949 { | |
950 if ( v48 ) | |
951 { | |
952 v31 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1372
diff
changeset
|
953 v32 = (char *)v21->pInventoryItemList; |
0 | 954 while ( *(int *)v32 != 601 || (unsigned __int8)v32[26] != v49 + 1 ) |
955 { | |
956 ++v31; | |
957 v32 += 36; | |
958 if ( v31 >= 138 ) | |
959 goto LABEL_59; | |
960 } | |
961 v48 = 0; | |
962 v45 = 1; | |
963 } | |
964 LABEL_59: | |
965 if ( v21->pConditions[17] ) | |
966 v46 = 1; | |
967 if ( v20 && !v21->pConditions[14] && !v21->pConditions[16] ) | |
968 { | |
969 ++v21->sHealth; | |
970 if ( v21->sHealth > v21->GetMaxHealth() ) | |
971 v21->sHealth = v21->GetMaxHealth(); | |
972 if ( v21->pConditions[13] && v21->sHealth > 0 ) | |
973 { | |
974 LODWORD(v21->pConditions[13]) = 0; | |
975 HIDWORD(v21->pConditions[13]) = 0; | |
976 } | |
977 v51 = 1; | |
978 } | |
979 if ( SHIDWORD(v21->pPlayerBuffs[12].uExpireTime) >= 0 | |
980 && (SHIDWORD(v21->pPlayerBuffs[12].uExpireTime) > 0 || LODWORD(v21->pPlayerBuffs[12].uExpireTime)) | |
981 && !v21->pConditions[14] | |
982 && !v21->pConditions[16] ) | |
983 { | |
984 v21->sHealth += 5 * v21->pPlayerBuffs[12].uPower; | |
985 if ( v21->sHealth > v21->GetMaxHealth() ) | |
986 v21->sHealth = v21->GetMaxHealth(); | |
987 if ( v21->pConditions[13] && v21->sHealth > 0 ) | |
988 { | |
989 LODWORD(v21->pConditions[13]) = 0; | |
990 HIDWORD(v21->pConditions[13]) = 0; | |
991 } | |
992 v51 = 1; | |
993 } | |
994 if ( v50 ) | |
995 { | |
996 v33 = (char *)&v21->sMana; | |
997 ++*(int *)v33; | |
998 if ( v21->sMana > v21->GetMaxMana() ) | |
999 *(int *)v33 = v21->GetMaxMana(); | |
1000 v51 = 1; | |
1001 } | |
1002 if ( v47 && !v21->pConditions[14] && !v21->pConditions[16] ) | |
1003 { | |
1004 v34 = LODWORD(v21->pConditions[13]); | |
1005 --v21->sHealth; | |
1006 v35 = v21->sHealth; | |
1007 if ( !(HIDWORD(v21->pConditions[13]) | v34) && v35 < 0 ) | |
1008 v21->pConditions[13] = pParty->uTimePlayed; | |
1009 if ( v35 < 1 ) | |
1010 { | |
1011 if ( v21->sHealth + v21->uEndurance + v21->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1 | |
1012 || (signed __int64)v21->pPlayerBuffs[11].uExpireTime > 0 ) | |
1013 { | |
1014 v21->pConditions[13] = pParty->uTimePlayed; | |
1015 } | |
1016 else | |
1017 { | |
1018 if ( !v21->pConditions[14] ) | |
1019 v21->pConditions[14] = pParty->uTimePlayed; | |
1020 } | |
1021 } | |
1022 v51 = 1; | |
1023 } | |
1024 if ( v45 ) | |
1025 { | |
1026 v36 = (char *)&v21->sMana; | |
1027 ++*(int *)v36; | |
1028 if ( v21->sMana > v21->GetMaxMana() ) | |
1029 *(int *)v36 = v21->GetMaxMana(); | |
1030 } | |
1031 if ( v48 && !v21->pConditions[14] && !v21->pConditions[16] ) | |
1032 { | |
1033 v37 = v21->sHealth; | |
1034 if ( v37 > v21->GetMaxHealth() / 2 ) | |
1035 v21->sHealth = v37 - 2; | |
1036 v38 = v21->sMana; | |
1037 if ( v38 > v21->GetMaxMana() / 2 ) | |
1038 v21->sMana = v38 - 2; | |
1039 } | |
1040 if ( v46 && !v21->pConditions[14] && !v21->pConditions[16] ) | |
1041 { | |
1042 v39 = v21->sHealth; | |
1043 if ( v39 > v21->GetMaxHealth() / 2 ) | |
1044 v21->sHealth = v39 - 1; | |
1045 v40 = v21->sMana; | |
1046 if ( v40 > 0 ) | |
1047 v21->sMana = v40 - 1; | |
1048 } | |
1049 ++v49; | |
1050 if ( v49 >= 4 ) | |
1051 { | |
1052 result = HIDWORD(pParty->uTimePlayed); | |
1053 pParty->uLastRegenerationTime = pParty->uTimePlayed; | |
1054 if ( !viewparams->bRedrawGameUI ) | |
1055 { | |
1056 result = v51; | |
1057 viewparams->bRedrawGameUI = v51; | |
1058 } | |
1059 return result; | |
1060 } | |
1061 goto LABEL_25; | |
1062 } | |
1063 } | |
1064 } | |
1065 return result; | |
1066 } | |
1067 | |
1068 //----- (00493F79) -------------------------------------------------------- | |
351 | 1069 void sub_493F79(stru351_summoned_item *_this, __int64 a2) |
0 | 1070 { |
1071 signed __int64 v2; // ST2C_8@1 | |
1072 signed __int64 v3; // qax@1 | |
351 | 1073 //signed __int64 v4; // ST1C_8@1 |
0 | 1074 unsigned __int64 v5; // qax@1 |
1075 unsigned int v6; // ebx@1 | |
1076 | |
1077 v2 = (signed __int64)((double)a2 * 0.234375); | |
1078 v3 = v2 / 60 / 60; | |
351 | 1079 //v4 = v3; |
0 | 1080 v5 = (unsigned int)v3 / 0x18; |
1081 v6 = (unsigned int)(v5 / 7) >> 2; | |
351 | 1082 _this->field_0_expire_second = v2 % 60; |
1083 _this->field_4_expire_minute = v2 / 60 % 60; | |
1084 _this->field_8_expire_hour = v3 % 24; | |
1085 _this->field_10_expire_week = v5 / 7 & 3; | |
1086 _this->field_C_expire_day = (unsigned int)v5 % 0x1C; | |
1087 _this->field_14_exprie_month = v6 % 0xC; | |
352 | 1088 _this->field_18_expire_year = v6 / 0xC + game_starting_year; |
0 | 1089 } |
1090 | |
1091 //----- (00494035) -------------------------------------------------------- | |
1031 | 1092 void _494035_timed_effects__water_walking_damage__etc() |
0 | 1093 { |
1094 signed __int64 v0; // qax@1 | |
1095 signed __int64 v1; // ST30_8@1 | |
1096 signed __int64 v2; // ST38_8@1 | |
1097 unsigned __int64 v3; // qax@1 | |
1098 unsigned int v4; // edi@1 | |
1099 //signed int v5; // eax@4 | |
1100 //char *v6; // ecx@5 | |
1101 //Player *v7; // esi@8 | |
1102 //char *v8; // ecx@12 | |
766 | 1103 //Player *pPlayer; // esi@15 |
0 | 1104 //void *v10; // esi@25 |
1105 unsigned int v11; // ecx@27 | |
1106 signed int v12; // edi@29 | |
1107 Player *v13; // ecx@30 | |
1108 Player *v14; // esi@35 | |
1109 double v15; // st7@35 | |
1110 Player **v16; // esi@43 | |
1111 Player *v17; // edi@44 | |
1112 double v18; // st7@44 | |
816 | 1113 //float v19; // ST28_4@48 |
1114 //double v20; // ST38_8@48 | |
0 | 1115 Player *v21; // esi@51 |
1116 signed int v22; // edi@53 | |
1117 int v23; // eax@59 | |
1118 int v24; // ecx@60 | |
1119 int v25; // eax@63 | |
1120 int v26; // ecx@64 | |
1121 int v27; // eax@67 | |
1122 int v28; // ecx@68 | |
1123 int v29; // eax@71 | |
1124 int v30; // ecx@72 | |
1125 int v31; // eax@75 | |
1126 int v32; // ecx@76 | |
1127 int v33; // eax@79 | |
1128 int v34; // ecx@80 | |
1129 int v35; // eax@83 | |
1130 int v36; // ecx@84 | |
1131 int v37; // eax@87 | |
1132 int v38; // ecx@88 | |
1133 int v39; // eax@91 | |
1134 int v40; // ecx@92 | |
1135 int v41; // eax@95 | |
1136 int v42; // ecx@96 | |
1137 bool v43; // ebx@102 | |
1138 //SpellBuff *v44; // edi@104 | |
1139 //signed int v45; // ebp@104 | |
1140 bool v46; // edi@111 | |
1141 //SpellBuff *v47; // esi@113 | |
1142 //Player **v48; // esi@119 | |
1143 //signed int v49; // edi@121 | |
1144 //char *v50; // esi@122 | |
1145 signed int v51; // edx@128 | |
1146 signed int v52; // ecx@130 | |
1147 int v53; // eax@131 | |
1148 Player *v54; // eax@141 | |
766 | 1149 //unsigned int v55; // [sp-8h] [bp-38h]@18 |
0 | 1150 unsigned int v56; // [sp-8h] [bp-38h]@55 |
766 | 1151 //int v57; // [sp-4h] [bp-34h]@18 |
0 | 1152 int v58; // [sp-4h] [bp-34h]@33 |
1153 int v59; // [sp-4h] [bp-34h]@55 | |
816 | 1154 //unsigned int v60; // [sp+10h] [bp-20h]@1 |
0 | 1155 unsigned int v61; // [sp+14h] [bp-1Ch]@1 |
1156 Player **v62; // [sp+14h] [bp-1Ch]@50 | |
766 | 1157 //unsigned int a2; // [sp+18h] [bp-18h]@1 |
0 | 1158 signed int a2a; // [sp+18h] [bp-18h]@47 |
1159 signed int v65; // [sp+1Ch] [bp-14h]@47 | |
1160 | |
766 | 1161 //a2 = pParty->uCurrentHour; |
0 | 1162 v61 = pParty->uDaysPlayed; |
816 | 1163 //auto prev_time = pEventTimer->uTimeElapsed; |
766 | 1164 pParty->uTimePlayed += pEventTimer->uTimeElapsed; |
1165 v0 = (signed __int64)(pParty->uTimePlayed * 0.234375) / 60; | |
0 | 1166 v1 = v0; |
1167 v0 /= 60i64; | |
1168 v2 = v0; | |
1169 v3 = (unsigned int)v0 / 24; | |
1170 v4 = (unsigned int)(v3 / 7) >> 2; | |
1171 pParty->uCurrentTimeSecond = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) % 60; | |
1172 pParty->uCurrentMinute = v1 % 60; | |
1173 pParty->uCurrentMonthWeek = v3 / 7 & 3; | |
1174 pParty->uCurrentHour = v2 % 24; | |
1175 pParty->uDaysPlayed = (unsigned int)v3 % 28; | |
1176 pParty->uCurrentMonth = v4 % 12; | |
352 | 1177 pParty->uCurrentYear = v4 / 0xC + game_starting_year; |
766 | 1178 if ( pParty->uCurrentHour >= 3 && (pParty->uCurrentHour < 3 || pParty->uDaysPlayed > v61) ) // new day dawns |
0 | 1179 { |
1180 pParty->pHirelings[0].bHasUsedTheAbility = false; | |
1181 pParty->pHirelings[1].bHasUsedTheAbility = false; | |
1182 | |
1183 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
1184 pNPCStats->pNewNPCData[i].bHasUsedTheAbility = false; | |
1185 | |
766 | 1186 ++pParty->days_played_without_rest; |
1187 if (pParty->days_played_without_rest > 1) | |
0 | 1188 { |
1189 for (uint i = 0; i < 4; ++i) | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
1190 pParty->pPlayers[i].SetCondWeakWithBlockCheck(0); |
766 | 1191 |
1192 if (pParty->uNumFoodRations) | |
1193 Party::TakeFood(1); | |
0 | 1194 else |
1195 for (uint i = 0; i < 4; ++i) | |
766 | 1196 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].sHealth / (pParty->days_played_without_rest + 1) + 1; |
1197 | |
1198 if (pParty->days_played_without_rest > 3) | |
1199 for (uint i = 0; i < 4; ++i) | |
0 | 1200 { |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
1201 Player* player = pParty->pPlayers + i; |
766 | 1202 |
1203 player->Zero(); | |
1204 | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
1205 if (!player->IsPertified() && !player->IsEradicated() && !player->IsDead()) |
0 | 1206 { |
767 | 1207 if (rand() % 100 < 5 * pParty->days_played_without_rest) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
1208 player->SetCondDeadWithBlockCheck(0); |
767 | 1209 if (rand() % 100 < 10 * pParty->days_played_without_rest) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
1210 player->SetCondInsaneWithBlockCheck(0); |
0 | 1211 } |
1212 } | |
766 | 1213 } |
1214 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
0 | 1215 pOutdoor->SetFog(); |
1216 | |
1217 for (uint i = 0; i < 4; ++i) | |
1218 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0; | |
1219 } | |
766 | 1220 |
0 | 1221 v11 = LODWORD(pParty->uTimePlayed); |
1222 if ( pParty->uFlags & 4 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed ) | |
1223 { | |
1224 v12 = 1; | |
1225 pParty->field_6FC = LODWORD(pParty->uTimePlayed) + 128; | |
1226 viewparams->bRedrawGameUI = 1; | |
1227 while ( 1 ) | |
1228 { | |
1080 | 1229 if ( pPlayers[v12]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR) |
99 | 1230 || pPlayers[v12]->HasEnchantedItemEquipped(71) |
1231 || pPlayers[v12]->pPlayerBuffs[23].uExpireTime > 0 ) | |
0 | 1232 { |
1233 v58 = 0; | |
1234 } | |
1235 else | |
1236 { | |
1237 v58 = 0; | |
1238 if ( !sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v12) ) | |
1239 { | |
1240 v14 = pPlayers[v12]; | |
1241 v15 = (double)pPlayers[v12]->GetMaxHealth() * 0.1; | |
1036 | 1242 v14->ReceiveDamage((signed __int64)v15, DMGT_FIRE); |
0 | 1243 if ( pParty->uFlags & 4 ) |
1244 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1245 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]); |
783 | 1246 GameUI_Footer_TimeLeft = 128; |
0 | 1247 } |
1248 goto LABEL_39; | |
1249 } | |
1250 v13 = pPlayers[v12]; | |
1251 } | |
130 | 1252 v13->PlayEmotion(CHARACTER_EXPRESSION_37, v58); |
0 | 1253 LABEL_39: |
1254 ++v12; | |
1255 if ( v12 > 4 ) | |
1256 { | |
1257 v11 = LODWORD(pParty->uTimePlayed); | |
1258 break; | |
1259 } | |
1260 } | |
1261 } | |
1262 if ( pParty->uFlags & 0x200 && pParty->field_6FC < (signed __int64)__PAIR__(HIDWORD(pParty->uTimePlayed), v11) ) | |
1263 { | |
1264 viewparams->bRedrawGameUI = 1; | |
1265 pParty->field_6FC = v11 + 128; | |
1266 v16 = &pPlayers[1]; | |
1267 do | |
1268 { | |
1269 v17 = *v16; | |
1270 v18 = (double)(*v16)->GetMaxHealth() * 0.1; | |
1036 | 1271 v17->ReceiveDamage((signed __int64)v18, DMGT_FIRE); |
0 | 1272 if ( pParty->uFlags & 0x200 ) |
1273 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1274 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]); |
783 | 1275 GameUI_Footer_TimeLeft = 128; |
0 | 1276 } |
1277 ++v16; | |
1278 } | |
1279 while ( (signed int)v16 <= (signed int)&pPlayers[4] ); | |
1280 } | |
1281 _493938_regenerate(); | |
1282 v65 = 4; | |
816 | 1283 a2a = pEventTimer->uTimeElapsed; |
1284 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING ) | |
1285 { | |
1286 //v19 = (double)(signed int)prev_time * 0.5; | |
1287 //v20 = v19 + 6.7553994e15; | |
1288 a2a *= 0.5f; | |
1289 if (a2a < 1) | |
0 | 1290 a2a = 1; |
1291 } | |
1292 v62 = &pPlayers[1]; | |
1293 do | |
1294 { | |
1295 v21 = *v62; | |
1296 if ( (*v62)->uTimeToRecovery ) | |
1297 v21->Recover(a2a); | |
1298 v22 = v21->sHealth; | |
1299 if ( v21->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) + v22 + v21->uEndurance >= 1 | |
1300 || (signed __int64)v21->pPlayerBuffs[11].uExpireTime > 0 ) | |
1301 { | |
1302 if ( v22 >= 1 ) | |
1303 goto LABEL_59; | |
1304 v59 = 0; | |
1305 v56 = 13; | |
1306 } | |
1307 else | |
1308 { | |
1309 v59 = 0; | |
1310 v56 = 14; | |
1311 } | |
1312 v21->SetCondition(v56, v59); | |
1313 LABEL_59: | |
1314 v23 = (int)&v21->field_E0; | |
1315 if ( v21->field_E0 ) | |
1316 { | |
816 | 1317 v24 = *(int *)v23 - pEventTimer->uTimeElapsed; |
0 | 1318 if ( v24 > 0 ) |
1319 { | |
1320 *(int *)v23 = v24; | |
1321 } | |
1322 else | |
1323 { | |
1324 *(int *)v23 = 0; | |
1325 viewparams->bRedrawGameUI = 1; | |
1326 } | |
1327 } | |
1328 v25 = (int)&v21->field_E4; | |
1329 if ( v21->field_E4 ) | |
1330 { | |
816 | 1331 v26 = *(int *)v25 - pEventTimer->uTimeElapsed; |
0 | 1332 if ( v26 > 0 ) |
1333 { | |
1334 *(int *)v25 = v26; | |
1335 } | |
1336 else | |
1337 { | |
1338 *(int *)v25 = 0; | |
1339 viewparams->bRedrawGameUI = 1; | |
1340 } | |
1341 } | |
1342 v27 = (int)&v21->field_E8; | |
1343 if ( v21->field_E8 ) | |
1344 { | |
816 | 1345 v28 = *(int *)v27 - pEventTimer->uTimeElapsed; |
0 | 1346 if ( v28 > 0 ) |
1347 { | |
1348 *(int *)v27 = v28; | |
1349 } | |
1350 else | |
1351 { | |
1352 *(int *)v27 = 0; | |
1353 viewparams->bRedrawGameUI = 1; | |
1354 } | |
1355 } | |
1356 v29 = (int)&v21->field_EC; | |
1357 if ( v21->field_EC ) | |
1358 { | |
816 | 1359 v30 = *(int *)v29 - pEventTimer->uTimeElapsed; |
0 | 1360 if ( v30 > 0 ) |
1361 { | |
1362 *(int *)v29 = v30; | |
1363 } | |
1364 else | |
1365 { | |
1366 *(int *)v29 = 0; | |
1367 viewparams->bRedrawGameUI = 1; | |
1368 } | |
1369 } | |
1370 v31 = (int)&v21->field_F0; | |
1371 if ( v21->field_F0 ) | |
1372 { | |
816 | 1373 v32 = *(int *)v31 - pEventTimer->uTimeElapsed; |
0 | 1374 if ( v32 > 0 ) |
1375 { | |
1376 *(int *)v31 = v32; | |
1377 } | |
1378 else | |
1379 { | |
1380 *(int *)v31 = 0; | |
1381 viewparams->bRedrawGameUI = 1; | |
1382 } | |
1383 } | |
1384 v33 = (int)&v21->field_F4; | |
1385 if ( v21->field_F4 ) | |
1386 { | |
816 | 1387 v34 = *(int *)v33 - pEventTimer->uTimeElapsed; |
0 | 1388 if ( v34 > 0 ) |
1389 { | |
1390 *(int *)v33 = v34; | |
1391 } | |
1392 else | |
1393 { | |
1394 *(int *)v33 = 0; | |
1395 viewparams->bRedrawGameUI = 1; | |
1396 } | |
1397 } | |
1398 v35 = (int)&v21->field_F8; | |
1399 if ( v21->field_F8 ) | |
1400 { | |
816 | 1401 v36 = *(int *)v35 - pEventTimer->uTimeElapsed; |
0 | 1402 if ( v36 > 0 ) |
1403 { | |
1404 *(int *)v35 = v36; | |
1405 } | |
1406 else | |
1407 { | |
1408 *(int *)v35 = 0; | |
1409 viewparams->bRedrawGameUI = 1; | |
1410 } | |
1411 } | |
1412 v37 = (int)&v21->field_FC; | |
1413 if ( v21->field_FC ) | |
1414 { | |
816 | 1415 v38 = *(int *)v37 - pEventTimer->uTimeElapsed; |
0 | 1416 if ( v38 > 0 ) |
1417 { | |
1418 *(int *)v37 = v38; | |
1419 } | |
1420 else | |
1421 { | |
1422 *(int *)v37 = 0; | |
1423 viewparams->bRedrawGameUI = 1; | |
1424 } | |
1425 } | |
1426 v39 = (int)&v21->field_100; | |
1427 if ( v21->field_100 ) | |
1428 { | |
816 | 1429 v40 = *(int *)v39 - pEventTimer->uTimeElapsed; |
0 | 1430 if ( v40 > 0 ) |
1431 { | |
1432 *(int *)v39 = v40; | |
1433 } | |
1434 else | |
1435 { | |
1436 *(int *)v39 = 0; | |
1437 viewparams->bRedrawGameUI = 1; | |
1438 } | |
1439 } | |
1440 v41 = (int)&v21->field_104; | |
1441 if ( v21->field_104 ) | |
1442 { | |
816 | 1443 v42 = *(int *)v41 - pEventTimer->uTimeElapsed; |
0 | 1444 if ( v42 > 0 ) |
1445 { | |
1446 *(int *)v41 = v42; | |
1447 } | |
1448 else | |
1449 { | |
1450 *(int *)v41 = 0; | |
1451 viewparams->bRedrawGameUI = 1; | |
1452 } | |
1453 } | |
1454 if ( v21->pConditions[2] | v21->pConditions[12] | v21->pConditions[13] | v21->pConditions[14] | v21->pConditions[15] | v21->pConditions[16] ) | |
1455 --v65; | |
1456 v43 = (signed __int64)v21->pPlayerBuffs[7].uExpireTime > 0; | |
1457 | |
1458 for (uint k = 0; k < 24; ++k) | |
1340 | 1459 v21->pPlayerBuffs[k].IsBuffExpiredToTime(pParty->uTimePlayed); |
0 | 1460 |
1461 if ( v43 && (signed __int64)v21->pPlayerBuffs[7].uExpireTime <= 0 ) | |
1462 v21->SetCondition(1u, 0); | |
1463 ++v62; | |
1464 } | |
1465 while ( (signed int)v62 <= (signed int)&pPlayers[4] ); | |
1167 | 1466 v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0; |
0 | 1467 |
1468 for (uint i = 0; i < 20; ++i) | |
1469 { | |
1340 | 1470 if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed) == 1) |
0 | 1471 viewparams->bRedrawGameUI = 1; |
1472 } | |
1473 | |
1167 | 1474 if ( v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0 ) |
0 | 1475 { |
1476 for (uint i = 0; i < 4; ++i) | |
1477 pParty->pPlayers[i].SetCondition(1, 0); | |
1478 } | |
1479 | |
1480 for (uint i = 0; i < 2; ++i) | |
1481 { | |
1482 auto pBuf = &pParty->pPartyBuffs[dword_4EE07C[i]]; | |
1483 if (pBuf->uExpireTime == 0) | |
1484 continue; | |
1485 | |
1486 if ( !(pBuf->uFlags & 1) ) | |
1487 { | |
1488 if (!pPlayers[pBuf->uCaster]->CanAct()) | |
1489 { | |
1490 pBuf->Reset(); | |
1491 if (dword_4EE07C[i] == 7 ) | |
1492 pParty->bFlying = false; | |
1493 } | |
1494 } | |
1495 } | |
1496 | |
1497 v51 = v65; | |
1498 if ( v65 ) | |
1499 goto LABEL_135; | |
151 | 1500 if ( pCurrentScreen != SCREEN_REST ) |
0 | 1501 { |
1502 v52 = (signed int)&pPlayers[1]; | |
1503 while ( 1 ) | |
1504 { | |
1505 v53 = *(int *)v52; | |
1506 if ( *(_QWORD *)(*(int *)v52 + 16) ) | |
1507 break; | |
1508 v52 += 4; | |
1509 if ( v52 > (signed int)&pPlayers[4] ) | |
1510 goto LABEL_135; | |
1511 } | |
1512 *(int *)(v53 + 16) = 0; | |
1513 *(int *)(v53 + 20) = 0; | |
1514 v51 = 1; | |
1515 LABEL_135: | |
151 | 1516 if ( pCurrentScreen != SCREEN_REST |
0 | 1517 && (!v51 || dword_5C35C0) ) |
981 | 1518 uGameState = GAME_STATE_PARTY_DIED; |
0 | 1519 } |
1520 if ( uActiveCharacter ) | |
1521 { | |
151 | 1522 if ( pCurrentScreen != SCREEN_REST ) |
0 | 1523 { |
1524 v54 = pPlayers[uActiveCharacter]; | |
1525 if ( v54->pConditions[2] | |
1526 || v54->pConditions[12] | |
1527 || v54->pConditions[13] | |
1528 || v54->pConditions[14] | |
1529 || v54->pConditions[15] | |
1530 || v54->pConditions[16] ) | |
1531 { | |
1532 viewparams->bRedrawGameUI = 1; | |
1533 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1534 } | |
1535 } | |
1536 } | |
1537 } | |
1538 | |
1539 //----- (00494820) -------------------------------------------------------- | |
758 | 1540 unsigned int __fastcall _494820_training_time(unsigned int a1) |
0 | 1541 { |
1542 signed int v1; // eax@1 | |
1543 | |
1544 v1 = 5; | |
758 | 1545 if ( a1 % 24 >= 5 ) |
0 | 1546 v1 = 29; |
758 | 1547 return v1 - a1 % 24; |
0 | 1548 } |
1549 | |
1550 //----- (00494836) -------------------------------------------------------- | |
1551 int stru339_spell_sound::_494836(int uSoundID, int a6) | |
1552 { | |
1553 int v3; // esi@1 | |
1554 int result; // eax@1 | |
1555 stru339_spell_sound *v5; // ebx@1 | |
1556 int *v6; // edi@2 | |
1557 unsigned int v7; // eax@3 | |
1558 int v8; // [sp+Ch] [bp-8h]@3 | |
1559 int v9; // [sp+10h] [bp-4h]@2 | |
1560 int a2a; // [sp+1Ch] [bp+8h]@1 | |
1561 | |
1562 v3 = 0; | |
1563 result = word_4EE088_sound_ids[uSoundID]; | |
1564 v5 = this; | |
1565 a2a = word_4EE088_sound_ids[uSoundID]; | |
1566 if ( result ) | |
1567 { | |
1568 v9 = 0; | |
1569 v6 = this->pSoundsOffsets; | |
1570 do | |
1571 { | |
1572 v7 = a2a++; | |
1573 result = pSoundList->LoadSound(v7, (char *)v5 + v3, 44744 - v3, &v8, a6); | |
1574 if ( !result ) | |
1575 break; | |
1576 a6 += 4; | |
1577 result = v8 + 256; | |
1578 *v6 = v3; | |
1579 v3 += result; | |
1580 ++v9; | |
1581 *(v6 - 2) = result; | |
1582 ++v6; | |
1583 } | |
1584 while ( v9 < 2 ); | |
1585 } | |
1586 return result; | |
1587 } | |
1588 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[]; | |
1589 | |
1590 //----- (00494AED) -------------------------------------------------------- | |
130 | 1591 unsigned int PlayerFrameTable::GetFrameIdByExpression(CHARACTER_EXPRESSION_ID expression) |
0 | 1592 { |
1593 unsigned int _uNumFrames; // edx@1 | |
1594 unsigned int result; // eax@1 | |
1595 PlayerFrame *v4; // ecx@2 | |
1596 | |
1597 _uNumFrames = this->uNumFrames; | |
1598 result = 0; | |
1599 if ( (signed int)this->uNumFrames <= 0 ) | |
1600 { | |
1601 LABEL_5: | |
1602 result = 0; | |
1603 } | |
1604 else | |
1605 { | |
1606 v4 = this->pFrames; | |
130 | 1607 while ( v4->expression != expression ) |
0 | 1608 { |
1609 ++result; | |
1610 ++v4; | |
1611 if ( (signed int)result >= (signed int)_uNumFrames ) | |
1612 goto LABEL_5; | |
1613 } | |
1614 } | |
1615 return result; | |
1616 } | |
1617 | |
1618 //----- (00494B10) -------------------------------------------------------- | |
1619 PlayerFrame *PlayerFrameTable::GetFrameBy_x(unsigned int uFramesetID, unsigned int uFrameID) | |
1620 { | |
1621 unsigned int v3; // esi@1 | |
1622 PlayerFrame *v4; // edi@1 | |
1623 PlayerFrame *v5; // ecx@1 | |
1624 __int16 v6; // dx@2 | |
1625 int v7; // edx@3 | |
1626 char *i; // eax@3 | |
1627 int v9; // ecx@5 | |
1628 PlayerFrame *result; // eax@6 | |
1629 | |
1630 v3 = uFramesetID; | |
1631 v4 = this->pFrames; | |
1632 v5 = &v4[uFramesetID]; | |
1633 if ( v5->uFlags & 1 && (v6 = v5->uAnimLength) != 0 ) | |
1634 { | |
1635 v7 = ((signed int)uFrameID >> 3) % (unsigned __int16)v6; | |
1636 for ( i = (char *)&v5->uAnimTime; ; i += 10 ) | |
1637 { | |
1638 v9 = *(short *)i; | |
1639 if ( v7 <= v9 ) | |
1640 break; | |
1641 v7 -= v9; | |
1642 ++v3; | |
1643 } | |
1644 result = &v4[v3]; | |
1645 } | |
1646 else | |
1647 { | |
1648 result = &v4[uFramesetID]; | |
1649 } | |
1650 return result; | |
1651 } | |
1652 | |
1653 //----- (00494B5E) -------------------------------------------------------- | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1654 PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *pFramesetID, int *pAnimTime, int a4) |
0 | 1655 { |
1656 PlayerFrameTable *v4; // edi@1 | |
1657 int v5; // esi@1 | |
1658 int v6; // eax@2 | |
1659 | |
1660 v4 = this; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1661 v5 = a4 + *pAnimTime; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1662 if ( v5 < 8 * this->pFrames[*pFramesetID].uAnimTime ) |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1663 { |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1664 *pAnimTime = v5; |
0 | 1665 } |
1666 else | |
1667 { | |
1668 v6 = rand() % 4 + 21; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1669 *pFramesetID = v6; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1670 *pAnimTime = 8 * v5 % v4->pFrames[v6].uAnimTime; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1671 } |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1672 return &v4->pFrames[*pFramesetID]; |
0 | 1673 } |
1674 | |
1675 //----- (00494BC3) -------------------------------------------------------- | |
1676 void PlayerFrameTable::ToFile() | |
1677 { | |
1678 PlayerFrameTable *v1; // esi@1 | |
1679 FILE *v2; // eax@1 | |
1680 FILE *v3; // edi@1 | |
1681 | |
1682 auto Str = this; | |
1683 | |
1684 v1 = Str; | |
1685 v2 = fopen("data\\dpft.bin", "wb"); | |
1686 v3 = v2; | |
1687 if ( !v2 ) | |
1688 Abortf("Unable to save dpft.bin!"); | |
1689 fwrite(v1, 4u, 1u, v2); | |
1690 fwrite(v1->pFrames, 0xAu, v1->uNumFrames, v3); | |
1691 fclose(v3); | |
1692 } | |
1693 | |
1694 //----- (00494C0F) -------------------------------------------------------- | |
1695 void PlayerFrameTable::FromFile(void *pSerialized) | |
1696 { | |
1697 uNumFrames = *(int *)pSerialized; | |
1698 pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, 10 * uNumFrames, "P Frames"); | |
1699 memcpy(pFrames, (char *)pSerialized + 4, 10 * uNumFrames); | |
1700 } | |
1701 | |
1702 //----- (00494C5A) -------------------------------------------------------- | |
1703 int PlayerFrameTable::FromFileTxt(const char *Args) | |
1704 { | |
1705 PlayerFrameTable *v2; // ebx@1 | |
1706 FILE *v3; // eax@1 | |
1707 int v4; // esi@3 | |
1708 void *v5; // eax@10 | |
1709 FILE *v6; // ST0C_4@12 | |
1710 char *i; // eax@12 | |
1711 __int16 v8; // ax@15 | |
1712 const char *v9; // ST10_4@15 | |
1713 unsigned __int16 v10; // ax@15 | |
1714 const char *v11; // ST0C_4@15 | |
1715 int j; // esi@15 | |
1716 int v13; // eax@17 | |
1717 int v14; // edx@22 | |
1718 int v15; // ecx@23 | |
1719 int v16; // eax@24 | |
1720 signed int k; // eax@27 | |
1721 PlayerFrame *v18; // edx@28 | |
1722 int v19; // esi@28 | |
1723 int l; // ecx@29 | |
1724 char Buf; // [sp+Ch] [bp-2F8h]@3 | |
1725 FrameTableTxtLine v23; // [sp+200h] [bp-104h]@4 | |
1726 FrameTableTxtLine v24; // [sp+27Ch] [bp-88h]@4 | |
1727 int v25; // [sp+2F8h] [bp-Ch]@3 | |
1728 int v26; // [sp+2FCh] [bp-8h]@3 | |
1729 FILE *File; // [sp+300h] [bp-4h]@1 | |
1730 int Argsa; // [sp+30Ch] [bp+8h]@28 | |
1731 | |
1732 v2 = this; | |
1733 //TileTable::dtor((TileTable *)this); | |
1734 v3 = fopen(Args, "r"); | |
1735 File = v3; | |
1736 if ( !v3 ) | |
1737 Abortf("PlayerFrameTable::load - Unable to open file: %s.", Args); | |
1738 v4 = 0; | |
1739 v25 = 0; | |
1740 v26 = 1; | |
1741 if ( fgets(&Buf, 490, v3) ) | |
1742 { | |
1743 do | |
1744 { | |
1745 *strchr(&Buf, 10) = 0; | |
703 | 1746 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24)); |
701 | 1747 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) |
1748 { | |
1749 if ( v24.uPropCount < 3 ) | |
0 | 1750 Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26); |
1751 ++v25; | |
1752 } | |
1753 ++v26; | |
1754 } | |
1755 while ( fgets(&Buf, 490, File) ); | |
1756 v4 = v25; | |
1757 } | |
1758 v2->uNumFrames = v4; | |
1759 v5 = pAllocator->AllocNamedChunk(v2->pFrames, 10 * v4, "P Frames"); | |
1760 v2->pFrames = (PlayerFrame *)v5; | |
1761 if ( !v5 ) | |
1762 Abortf("PlayerFrameTable::load - Out of Memory!"); | |
1763 v6 = File; | |
1764 v2->uNumFrames = 0; | |
1765 fseek(v6, 0, 0); | |
1766 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) | |
1767 { | |
1768 *strchr(&Buf, 10) = 0; | |
703 | 1769 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24)); |
701 | 1770 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) |
0 | 1771 { |
1772 v8 = atoi(v24.pProperties[0]); | |
1773 v9 = v24.pProperties[1]; | |
130 | 1774 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8; |
0 | 1775 v10 = atoi(v9); |
1776 v11 = v24.pProperties[2]; | |
1777 v2->pFrames[v2->uNumFrames].uTextureID = v10; | |
1778 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11); | |
1779 v2->pFrames[v2->uNumFrames].uAnimLength = 0; | |
1780 v2->pFrames[v2->uNumFrames].uFlags = 0; | |
701 | 1781 for ( j = 3; j < v24.uPropCount; ++j ) |
0 | 1782 { |
1104 | 1783 if ( !_stricmp(v24.pProperties[j], "New") ) |
0 | 1784 { |
1785 v13 = (int)&v2->pFrames[v2->uNumFrames].uFlags; | |
1786 *(char *)v13 |= 4u; | |
1787 } | |
1788 } | |
1789 ++v2->uNumFrames; | |
1790 } | |
1791 } | |
1792 fclose(File); | |
1793 v14 = 0; | |
1794 if ( (signed int)(v2->uNumFrames - 1) > 0 ) | |
1795 { | |
1796 v15 = 0; | |
1797 do | |
1798 { | |
1799 v16 = (int)&v2->pFrames[v15]; | |
1800 if ( !(*(char *)(v16 + 18) & 4) ) | |
1801 *(char *)(v16 + 8) |= 1u; | |
1802 ++v14; | |
1803 ++v15; | |
1804 } | |
1805 while ( v14 < (signed int)(v2->uNumFrames - 1) ); | |
1806 } | |
1807 for ( k = 0; k < (signed int)v2->uNumFrames; *(short *)(Argsa + 6) = v19 ) | |
1808 { | |
1809 v18 = v2->pFrames; | |
1810 Argsa = (int)&v18[k]; | |
1811 v19 = *(short *)(Argsa + 4); | |
1812 if ( *(char *)(Argsa + 8) & 1 ) | |
1813 { | |
1814 ++k; | |
1815 for ( l = (int)&v18[k]; *(char *)(l + 8) & 1; l += 10 ) | |
1816 { | |
1817 v19 += *(short *)(l + 4); | |
1818 ++k; | |
1819 } | |
1820 LOWORD(v19) = v18[k].uAnimTime + v19; | |
1821 } | |
1822 ++k; | |
1823 } | |
1824 return 1; | |
1825 } | |
1826 | |
1827 //----- (00495366) -------------------------------------------------------- | |
1828 char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2) | |
1829 { | |
1830 int v2; // edi@1 | |
1831 int v3; // edx@2 | |
1832 int v4; // esi@3 | |
1833 int v5; // ebx@5 | |
1834 signed int v7; // [sp+Ch] [bp-14h]@1 | |
1835 signed int v8; // [sp+10h] [bp-10h]@1 | |
1836 int **v9; // [sp+14h] [bp-Ch]@4 | |
1837 signed int v10; // [sp+18h] [bp-8h]@3 | |
1838 unsigned __int8 v11; // [sp+1Ch] [bp-4h]@1 | |
1839 | |
1840 v2 = a1; | |
1841 v11 = a2; | |
1842 v8 = 0; | |
1843 v7 = 0; | |
1844 if ( dword_AE336C == a1 ) | |
1845 { | |
1846 v3 = dword_AE3370; | |
1847 } | |
1848 else | |
1849 { | |
1850 v4 = a2; | |
1851 dword_AE336C = a1; | |
1852 v10 = 0; | |
1853 if ( (signed int)pNPCStats->uNumNPCNames[v4] <= 0 ) | |
1854 goto LABEL_17; | |
1855 v9 = (int **)((char *)pNPCStats->pNPCNames + v4 * 4); | |
1856 do | |
1857 { | |
1858 v5 = tolower(*(char *)*v9); | |
1859 if ( v5 == tolower(v2) ) | |
1860 { | |
1861 if ( v8 ) | |
1862 v7 = v10; | |
1863 else | |
1864 v8 = v10; | |
1865 } | |
1866 ++v10; | |
1867 v9 += 2; | |
1868 } | |
1869 while ( v10 < (signed int)pNPCStats->uNumNPCNames[v4] ); | |
1870 if ( v8 && v8 != v7 ) | |
1871 v3 = v8 + rand() % (v7 - v8); | |
1872 else | |
1873 LABEL_17: | |
1874 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4]; | |
1875 } | |
1876 dword_AE3370 = v3; | |
1877 return pNPCStats->pNPCNames[0][v11 + 2 * v3]; | |
1878 } | |
1879 // AE336C: using guessed type int dword_AE336C; | |
1880 // AE3370: using guessed type int dword_AE3370; | |
1881 | |
1882 //----- (00495430) -------------------------------------------------------- | |
607 | 1883 char * GetReputationString( signed int a1 ) |
1884 { | |
566 | 1885 if (a1 >= 25) |
1886 return pGlobalTXT_LocalizationStrings[379]; // Hated | |
1887 else if (a1 >= 6) | |
1888 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly | |
1889 else if (a1 >= -5) | |
1890 return pGlobalTXT_LocalizationStrings[399]; // Neutral; | |
1891 else if (a1 >= -24) | |
1892 return pGlobalTXT_LocalizationStrings[402]; // Friendly | |
0 | 1893 else |
566 | 1894 return pGlobalTXT_LocalizationStrings[434]; // Respected; |
0 | 1895 } |
1896 | |
1897 //----- (00495461) -------------------------------------------------------- | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1409
diff
changeset
|
1898 char *BuildDialogueString(char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6) |
0 | 1899 { |
1900 unsigned __int8 v6; // bl@1 | |
1901 Player *pPlayer; // ebx@3 | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1902 //NPCData *v9; // eax@4 |
250 | 1903 //size_t v10; // eax@6 |
0 | 1904 char *v11; // esi@7 |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1905 //int v12; // edx@7 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1906 //ItemGen *v13; // edi@7 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1907 //char v14; // cl@8 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1908 //char *v15; // ecx@10 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1909 //int v16; // edx@10 |
0 | 1910 int v17; // eax@10 |
1911 signed __int64 v18; // qax@18 | |
1912 unsigned int v19; // edi@32 | |
1913 unsigned __int8 *v20; // ebx@32 | |
1914 int v21; // ecx@34 | |
1915 __int16 v22; // ax@34 | |
1916 int v23; // edx@39 | |
1917 int v24; // eax@39 | |
1918 int v25; // eax@45 | |
1919 float *v26; // esi@68 | |
1920 float v27; // ST18_4@68 | |
1921 signed int v28; // eax@68 | |
1922 int v29; // eax@68 | |
1923 float v30; // ST18_4@72 | |
1924 signed int v31; // eax@72 | |
1925 float v32; // ST18_4@74 | |
1926 signed int v33; // eax@74 | |
1927 double v34; // st7@75 | |
1928 float v35; // ST18_4@76 | |
1929 signed int v36; // eax@76 | |
1930 float *v37; // esi@78 | |
1931 float v38; // ST18_4@78 | |
1932 int v39; // eax@78 | |
1933 float v40; // ST18_4@82 | |
1934 int v41; // eax@82 | |
1935 float v42; // ST18_4@83 | |
1936 int v43; // eax@83 | |
1937 float v44; // ST18_4@85 | |
1938 int v45; // eax@85 | |
1939 const char *v46; // eax@86 | |
1940 unsigned int v47; // eax@87 | |
1941 float v48; // ST18_4@97 | |
1942 __int64 v49; // ST14_8@107 | |
1943 int v50; // eax@107 | |
1944 int v51; // eax@108 | |
1945 Player *v52; // eax@109 | |
1946 int v53; // [sp-4h] [bp-13Ch]@107 | |
1947 int v54; // [sp+0h] [bp-138h]@107 | |
1948 __int16 v55[56]; // [sp+10h] [bp-128h]@34 | |
351 | 1949 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107 |
1950 stru351_summoned_item v57; // [sp+9Ch] [bp-9Ch]@115 | |
0 | 1951 char a1[100]; // [sp+B8h] [bp-80h]@3 |
1952 unsigned int v59; // [sp+11Ch] [bp-1Ch]@3 | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1953 //size_t v60; // [sp+120h] [bp-18h]@3 |
249 | 1954 //Player *v61; // [sp+124h] [bp-14h]@3 |
1955 //char *Str; // [sp+128h] [bp-10h]@1 | |
0 | 1956 int v63; // [sp+12Ch] [bp-Ch]@32 |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1957 //int v64; // [sp+130h] [bp-8h]@6 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1958 //NPCData *v65; // [sp+134h] [bp-4h]@6 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1959 //int packed; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1960 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1961 |
0 | 1962 |
1963 v6 = uPlayerID; | |
249 | 1964 //Str = lpsz; |
0 | 1965 if ( IsBadStringPtrA(lpsz, 1u) ) |
1966 return "Invalid String Passed"; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1967 |
0 | 1968 a1[0] = 0; |
1969 pPlayer = &pParty->pPlayers[v6]; | |
949 | 1970 v59 = TargetColor(255, 255, 155); |
249 | 1971 //v61 = pPlayer; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1972 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2)); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1973 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1974 NPCData *npc = nullptr; |
0 | 1975 if ( dword_5C35D4 ) |
248 | 1976 { |
463 | 1977 //__debugbreak(); // fix |
1211 | 1978 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1 |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1979 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1980 else |
602 | 1981 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1982 //v65 = v9; |
250 | 1983 //v10 = 0; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1984 //v64 = 0; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1985 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1986 //int i = 0; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1987 //if ( (signed int)v60 > 0 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1988 v11 = a4; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1989 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1990 auto len = strlen(lpsz); |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1991 for (int i = 0, dst = 0; i < len; ++i) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1992 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1993 //v12 = v64; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1994 //v13 = a3; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1995 //while ( 1 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1996 //{ |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1997 char c = lpsz[i]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1998 if (c != '%') |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1999 pTmpBuf2[dst++] = c; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2000 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2001 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2002 //v15 = &lpsz[v12 + 1]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2003 //v16 = (unsigned __int8)lpsz[v12 + 2]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2004 //packed = 10 * (int)lpsz[v12 + 1] + lpsz[v12 + 2]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2005 //v17 = packed - 528;// 10 * '0' + '0' |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2006 v17 = 10 * (int)(lpsz[i + 1] - '0') + lpsz[i + 2] - '0'; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2007 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2008 switch ( v17 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2009 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2010 case 1: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2011 v11 = npc->pName; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2012 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2013 case 2: |
0 | 2014 v11 = pPlayer->pName; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2015 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2016 case 3: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2017 case 4: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2018 v11 = a1; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2019 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2020 case 5: |
0 | 2021 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24; |
2022 v11 = pGlobalTXT_LocalizationStrings[397];// "evening" | |
2023 if ( SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0 ) | |
2024 { | |
2025 if ( SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 0xB ) | |
2026 { | |
2027 if ( v18 < 20 ) | |
2028 v11 = pGlobalTXT_LocalizationStrings[396];// "day" | |
2029 } | |
2030 else | |
2031 { | |
2032 v11 = pGlobalTXT_LocalizationStrings[395];// "morning" | |
2033 } | |
2034 } | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2035 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2036 case 6: |
0 | 2037 if ( pPlayer->uSex ) |
2038 v11 = pGlobalTXT_LocalizationStrings[387];// "lady" | |
2039 else | |
2040 v11 = pGlobalTXT_LocalizationStrings[385];// "sir" | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2041 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2042 case 7: |
0 | 2043 if ( pPlayer->uSex ) |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2044 v11 = pGlobalTXT_LocalizationStrings[389];// "Lady" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2045 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2046 v11 = pGlobalTXT_LocalizationStrings[386];// "Sir" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2047 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2048 case 8: |
0 | 2049 v19 = 0; |
2050 v63 = 0; | |
484 | 2051 v20 = (unsigned __int8 *)pPlayer->_guilds_member_bits; |
0 | 2052 do |
2053 { | |
2054 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[v19]) ) | |
2055 { | |
2056 v21 = v63; | |
2057 v22 = word_4EE150[v19]; | |
2058 ++v63; | |
2059 v55[v21] = v22; | |
2060 } | |
2061 ++v19; | |
2062 } | |
2063 while ( v19 < 28 ); | |
2064 if ( v63 ) | |
2065 { | |
2066 v23 = rand() % v63; | |
2067 v24 = dword_A74CDC; | |
2068 if ( dword_A74CDC == -1 ) | |
2069 { | |
2070 v24 = v23; | |
2071 dword_A74CDC = v23; | |
2072 } | |
492 | 2073 v11 = (char *)pAwards[v55[v24]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; |
0 | 2074 } |
2075 else | |
2076 { | |
2077 v11 = (char *)pNPCTopics[55].pText; | |
2078 } | |
249 | 2079 //pPlayer = v61; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2080 //v13 = a3; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2081 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2082 case 9: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2083 if ( npc->uSex ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2084 v11 = pGlobalTXT_LocalizationStrings[384];// "her" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2085 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2086 v11 = pGlobalTXT_LocalizationStrings[383];// "his" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2087 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2088 case 10: |
0 | 2089 if ( pPlayer->uSex ) |
2090 v11 = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
2091 else | |
2092 v11 = pGlobalTXT_LocalizationStrings[388];// "Lord" | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2093 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2094 case 11: |
0 | 2095 v25 = GetPartyReputation(); |
2096 goto LABEL_46; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2097 case 12: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2098 v25 = npc->rep; |
0 | 2099 LABEL_46: |
2100 if ( v25 >= 25 ) | |
2101 { | |
2102 v11 = pGlobalTXT_LocalizationStrings[379]; | |
2103 } | |
2104 else | |
2105 { | |
2106 if ( v25 < 6 ) | |
2107 { | |
2108 if ( v25 >= -5 ) | |
2109 { | |
2110 v11 = pGlobalTXT_LocalizationStrings[399]; | |
2111 } | |
2112 else | |
2113 { | |
2114 if ( v25 < -24 ) | |
2115 v11 = pGlobalTXT_LocalizationStrings[434]; | |
2116 else | |
2117 v11 = pGlobalTXT_LocalizationStrings[402]; | |
2118 } | |
2119 } | |
2120 else | |
2121 { | |
2122 v11 = pGlobalTXT_LocalizationStrings[392]; | |
2123 } | |
2124 } | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2125 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2126 case 13: |
0 | 2127 v11 = sub_495366(pPlayer->pName[0], pPlayer->uSex); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2128 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2129 case 14: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2130 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2131 if ( npc->uSex ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2132 v11 = pGlobalTXT_LocalizationStrings[391];// "sister" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2133 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2134 v11 = pGlobalTXT_LocalizationStrings[390];// "brother" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2135 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2136 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2137 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2138 case 15: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2139 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2140 v11 = pGlobalTXT_LocalizationStrings[393];// "daughter" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2141 _continue_strcat: |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2142 strcat(pTmpBuf2.data(), v11); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2143 dst = strlen(pTmpBuf2.data()); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2144 //v64 += 2; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2145 i += 2; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2146 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2147 break; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2148 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2149 case 16: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2150 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2151 if ( npc->uSex ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2152 v11 = pGlobalTXT_LocalizationStrings[391];// "sister" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2153 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2154 v11 = pGlobalTXT_LocalizationStrings[390];// "brother" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2155 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2156 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2157 case 17: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2158 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2159 auto pay_percentage = pNPCStats->pProfessions[npc->uProfession - 1].uHirePrice / 100; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2160 if (!pay_percentage) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2161 pay_percentage = 1; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2162 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2163 sprintf(a1, "%lu", pay_percentage); |
250 | 2164 v11 = a1; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2165 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2166 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2167 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2168 case 18: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2169 case 19: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2170 case 20: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2171 case 21: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2172 case 22: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2173 case 26: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2174 _continue_strncpy: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2175 strncpy(a1, lpsz + i + 1, 2); |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2176 v51 = atoi(a1); |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2177 sprintf(a1, "%lu", v51); |
0 | 2178 v11 = a1; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2179 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2180 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2181 case 23: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2182 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2183 v47 = pMapStats->GetMapInfo(pCurrentMapName.data()); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2184 if ( v47 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2185 v11 = pMapStats->pInfos[v47].pName; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2186 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2187 v11 = pGlobalTXT_LocalizationStrings[394];// "Unknown" |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2188 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2189 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2190 case 24: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2191 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2192 v46 = a3->GetDisplayName(); |
1393 | 2193 sprintfex(a1, format_4E2D80, v59, v46); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2194 v11 = a1; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2195 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2196 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2197 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2198 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2199 case 25: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2200 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2201 v37 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2202 v38 = *v37; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2203 v39 = a3->GetValue(); |
1275 | 2204 v29 = pPlayer->GetBaseBuyingPrice(v39, v38); |
0 | 2205 switch ( a5 ) |
2206 { | |
2207 case 3: | |
2208 v44 = *v37; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2209 v45 = a3->GetValue(); |
1275 | 2210 v29 = pPlayer->GetBaseSellingPrice(v45, v44); |
0 | 2211 break; |
2212 case 4: | |
1275 | 2213 v29 = pPlayer->GetBaseIdentifyPrice(*v37); |
0 | 2214 break; |
2215 case 5: | |
2216 v42 = *v37; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2217 v43 = a3->GetValue(); |
1275 | 2218 v29 = pPlayer->GetBaseRepairPrice(v43, v42); |
0 | 2219 break; |
2220 case 6: | |
2221 v40 = *v37; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2222 v41 = a3->GetValue(); |
1275 | 2223 v29 = pPlayer->GetBaseSellingPrice(v41, v40) / 2; |
0 | 2224 break; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2225 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2226 goto _continue_sprintf; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2227 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2228 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2229 case 27: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2230 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2231 v26 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier; |
0 | 2232 v27 = *v26; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2233 v28 = a3->GetValue(); |
749 | 2234 v29 = pPlayer->GetBuyingPrice(v28, v27); |
0 | 2235 if ( a5 == 3 ) |
2236 { | |
2237 v35 = *v26; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2238 v36 = a3->GetValue(); |
917 | 2239 v29 = pPlayer->GetPriceSell(v36, v35); |
315 | 2240 if (a3->Broken()) |
0 | 2241 v29 = 1; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2242 goto _continue_sprintf; |
0 | 2243 } |
2244 if ( a5 != 4 ) | |
2245 { | |
2246 if ( a5 == 5 ) | |
2247 { | |
2248 v32 = *v26; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2249 v33 = a3->GetValue(); |
916 | 2250 v29 = pPlayer->GetPriceRepair(v33, v32); |
0 | 2251 } |
2252 else | |
2253 { | |
2254 if ( a5 == 6 ) | |
2255 { | |
2256 v30 = *v26; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2257 v31 = a3->GetValue(); |
917 | 2258 v29 = pPlayer->GetPriceSell(v31, v30) / 2; |
315 | 2259 if (a3->Broken()) |
0 | 2260 v29 = 1; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2261 if (!v29) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2262 v29 = 1; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2263 goto _continue_sprintf; |
0 | 2264 } |
2265 } | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2266 _continue_sprintf: |
1393 | 2267 sprintfex(a1, "%lu", v29); |
250 | 2268 v11 = a1; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2269 goto _continue_strcat; |
0 | 2270 } |
2271 v34 = *v26; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2272 |
0 | 2273 v48 = v34; |
916 | 2274 v29 = pPlayer->GetPriceIdentification(v48); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2275 goto _continue_sprintf; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2276 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2277 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2278 case 28: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2279 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2280 //v11 = (char *)p2DEvents_minus1__10[13 * (signed int)a4]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2281 v11 = (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2282 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2283 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2284 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2285 case 29: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2286 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2287 //v34 = p2DEvents_minus1__20[13 * (signed int)a4]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2288 v34 = p2DEvents[(signed int)a4 - 1].fPriceMultiplier; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2289 v48 = v34; |
916 | 2290 v29 = pPlayer->GetPriceIdentification(v48); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2291 goto _continue_sprintf; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2292 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2293 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2294 case 30: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2295 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2296 if ( !a6 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2297 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2298 sub_493F79(&v57, *a6); |
351 | 2299 v54 = v57.field_18_expire_year; |
2300 v53 = v57.field_C_expire_day + 1; | |
2301 v50 = v57.field_14_exprie_month; | |
1393 | 2302 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2303 v11 = a1; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2304 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2305 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2306 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2307 case 31: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2308 case 32: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2309 case 33: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2310 case 34: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2311 v52 = &pParty->pPlayers[v17 - 31]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2312 v11 = v52->pName; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2313 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2314 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2315 default: |
0 | 2316 if ( v17 <= 50 || v17 > 70 ) |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2317 goto _continue_strncpy; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2318 if ( v17 - 51 >= 20 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2319 goto _continue_strcat; |
484 | 2320 v49 = pParty->field_3C._s_times[v17-51]; |
2321 | |
0 | 2322 sub_493F79(&v56, v49); |
351 | 2323 v54 = v56.field_18_expire_year; |
2324 v53 = v56.field_C_expire_day + 1; | |
2325 v50 = v56.field_14_exprie_month; | |
1393 | 2326 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54); |
250 | 2327 v11 = a1; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2328 goto _continue_strcat; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2329 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
2330 } |
0 | 2331 } |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2332 return pTmpBuf2.data(); |
0 | 2333 } |
2334 | |
2335 //----- (0049B04D) -------------------------------------------------------- | |
734 | 2336 void stru154::GetFacePlaneAndClassify(ODMFace *a2, BSPVertexBuffer *a3) |
0 | 2337 { |
734 | 2338 //stru154 *v3; // edi@1 |
2339 //signed int v4; // eax@1 | |
2340 //signed int result; // eax@9 | |
2341 //signed int v6; // [sp-8h] [bp-18h]@8 | |
0 | 2342 Vec3_float_ v; // [sp+4h] [bp-Ch]@1 |
734 | 2343 float v7; |
0 | 2344 |
2345 v.x = 0.0; | |
2346 v.y = 0.0; | |
2347 v.z = 0.0; | |
734 | 2348 GetFacePlane(a2, a3, &v, &v7); |
2349 | |
2350 if (fabsf(a2->pFacePlane.vNormal.z) < 1e-6f) | |
2351 polygonType = POLYGON_VerticalWall; | |
2352 else if (fabsf(a2->pFacePlane.vNormal.x) < 1e-6f && | |
2353 fabsf(a2->pFacePlane.vNormal.y) < 1e-6f) | |
2354 polygonType = POLYGON_Floor; | |
0 | 2355 else |
734 | 2356 polygonType = POLYGON_InBetweenFloorAndWall; |
2357 | |
2358 face_plane.vNormal.x = v.x; | |
2359 face_plane.vNormal.y = v.y; | |
2360 face_plane.vNormal.z = v.z; | |
2361 face_plane.dist = v7; | |
0 | 2362 } |
2363 | |
2364 //----- (0049B0C9) -------------------------------------------------------- | |
734 | 2365 void stru154::ClassifyPolygon(Vec3_float_ *pNormal, float dist) |
0 | 2366 { |
734 | 2367 if (fabsf(pNormal->z) < 1e-6f) |
2368 polygonType = POLYGON_VerticalWall; | |
2369 else if (fabsf(pNormal->x) < 1e-6f && | |
2370 fabsf(pNormal->y) < 1e-6f) | |
2371 polygonType = POLYGON_Floor; | |
0 | 2372 else |
734 | 2373 polygonType = POLYGON_InBetweenFloorAndWall; |
2374 | |
2375 face_plane.vNormal.x = pNormal->x; | |
2376 face_plane.dist = dist; | |
2377 face_plane.vNormal.y = pNormal->y; | |
2378 face_plane.vNormal.z = pNormal->z; | |
0 | 2379 } |
2380 | |
2381 //----- (0049B13D) -------------------------------------------------------- | |
734 | 2382 void stru154::GetFacePlane(ODMFace *pFace, BSPVertexBuffer *pVertices, Vec3_float_ *pOutNormal, float *pOutDist) |
0 | 2383 { |
2384 ODMFace *v5; // ebx@1 | |
734 | 2385 //int v6; // eax@1 |
2386 //unsigned __int16 *v7; // ebx@2 | |
2387 //Vec3_int_ *v8; // eax@3 | |
0 | 2388 Vec3_int_ *v9; // ecx@3 |
734 | 2389 //double v10; // st7@3 |
2390 //int v11; // ecx@3 | |
0 | 2391 Vec3_int_ *v12; // ecx@3 |
734 | 2392 //double v13; // st7@3 |
2393 //double v14; // st6@3 | |
2394 //double v15; // st5@3 | |
2395 //int v16; // ecx@3 | |
0 | 2396 Vec3_int_ *v17; // eax@3 |
734 | 2397 //double v18; // st5@3 |
0 | 2398 Vec3_float_ *v19; // eax@3 |
734 | 2399 //int result; // eax@8 |
2400 //float v21; // ecx@10 | |
2401 //double v22; // st7@10 | |
2402 //double v23; // st6@10 | |
0 | 2403 Vec3_float_ v2; // [sp+4h] [bp-64h]@3 |
734 | 2404 //float v25; // [sp+18h] [bp-50h]@3 |
0 | 2405 float v26; // [sp+1Ch] [bp-4Ch]@3 |
2406 float v27; // [sp+20h] [bp-48h]@3 | |
2407 float v28; // [sp+24h] [bp-44h]@3 | |
734 | 2408 //float v29; // [sp+2Ch] [bp-3Ch]@3 |
2409 //float v30; // [sp+30h] [bp-38h]@3 | |
2410 //float v31; // [sp+34h] [bp-34h]@3 | |
2411 //float v32; // [sp+38h] [bp-30h]@3 | |
2412 //float v33; // [sp+3Ch] [bp-2Ch]@3 | |
0 | 2413 Vec3_float_ v1; // [sp+40h] [bp-28h]@1 |
734 | 2414 //float v35; // [sp+4Ch] [bp-1Ch]@3 |
2415 //float v36; // [sp+50h] [bp-18h]@3 | |
2416 //float v37; // [sp+54h] [bp-14h]@3 | |
0 | 2417 Vec3_float_ v38; // [sp+58h] [bp-10h]@3 |
734 | 2418 //int v39; // [sp+64h] [bp-4h]@1 |
2419 | |
2420 //v39 = 0; | |
0 | 2421 v1.x = 0.0; |
2422 v5 = pFace; | |
734 | 2423 //v6 = pFace->uNumVertices; |
0 | 2424 v1.y = 0.0; |
2425 v1.z = 0.0; | |
734 | 2426 |
2427 if (pFace->uNumVertices >= 2) | |
2428 { | |
2429 int i = 0; | |
2430 while ( i < pFace->uNumVertices - 2 ) | |
2431 { | |
2432 v9 = &pVertices->pVertices[pFace->pVertexIDs[i]]; | |
2433 v12 = &pVertices->pVertices[pFace->pVertexIDs[i + 1]]; | |
2434 v17 = &pVertices->pVertices[pFace->pVertexIDs[i + 2]]; | |
1093 | 2435 i++; |
734 | 2436 v1.x = v12->x - v9->x; |
2437 v26 = v17->x - v12->x; | |
2438 v1.y = v12->y - v9->y; | |
2439 v27 = v17->y - v12->y; | |
2440 v1.z = v12->z - v9->z; | |
2441 v28 = v17->z - v12->z; | |
0 | 2442 v19 = Vec3_float_::Cross(&v1, &v2, v26, v27, v28); |
2443 v38.x = v19->x; | |
2444 v38.y = v19->y; | |
2445 v38.z = v19->z; | |
734 | 2446 if ( v38.x != 0.0 || v38.y != 0.0 || v38.z != 0.0) |
2447 { | |
2448 v38.Normalize(); | |
2449 | |
2450 pOutNormal->x = v38.x; | |
2451 pOutNormal->y = v38.y; | |
2452 pOutNormal->z = v38.z; | |
2453 | |
2454 *pOutDist = -(v9->x * v38.x + v9->y * v38.y + v9->z * v38.z); | |
2455 return; | |
2456 } | |
2457 } | |
2458 } | |
2459 | |
2460 pOutNormal->x = (double)(v5->pFacePlane.vNormal.x & 0xFFFF) / 65535.0f + (double)(v5->pFacePlane.vNormal.x >> 16); | |
2461 pOutNormal->y = (double)(v5->pFacePlane.vNormal.y & 0xFFFF) / 65535.0f + (double)(v5->pFacePlane.vNormal.y >> 16); | |
2462 pOutNormal->z = (double)(v5->pFacePlane.vNormal.z & 0xFFFF) / 65535.0f + (double)(v5->pFacePlane.vNormal.z >> 16); | |
2463 *pOutDist = (double)(v5->pFacePlane.dist & 0xFFFF) / 65535.0f + (double)(v5->pFacePlane.dist >> 16); | |
0 | 2464 } |
2465 | |
2466 //----- (0049D700) -------------------------------------------------------- | |
2467 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim) | |
2468 { | |
2469 unsigned int v1; // eax@1 | |
2470 int v2; // ecx@1 | |
2471 unsigned int v3; // eax@1 | |
2472 | |
2473 v1 = uDim; | |
2474 v2 = 0; | |
2475 v3 = v1 - 1; | |
2476 while ( v3 & 1 ) | |
2477 { | |
2478 v3 >>= 1; | |
2479 ++v2; | |
2480 } | |
2481 return v3 == 0 ? v2 : 0; | |
2482 } | |
2483 | |
2484 //----- (004A19D8) -------------------------------------------------------- | |
737 | 2485 unsigned int BlendColors(unsigned int a1, unsigned int a2) |
0 | 2486 { |
737 | 2487 /*signed __int64 v2; // ST10_8@1 |
0 | 2488 double v3; // st7@1 |
2489 float v4; // ST24_4@1 | |
2490 double v5; // ST10_8@1 | |
2491 int v6; // ST1C_4@1 | |
2492 float v7; // ST24_4@1 | |
2493 double v8; // ST10_8@1 | |
2494 unsigned __int8 v9; // ST20_1@1 | |
2495 float v10; // ST24_4@1 | |
2496 double v11; // ST10_8@1 | |
2497 float v12; // ST24_4@1 | |
737 | 2498 double v13; // ST08_8@1*/ |
2499 | |
2500 uint alpha = (uint)floorf(0.5f + (a1 >> 24) / 255.0f * | |
2501 (a2 >> 24) / 255.0f * 255.0f), | |
2502 red = (uint)floorf(0.5f + ((a1 >> 16) & 0xFF) / 255.0f * | |
2503 ((a2 >> 16) & 0xFF) / 255.0f * 255.0f), | |
2504 green = (uint)floorf(0.5f + ((a1 >> 8) & 0xFF) / 255.0f * | |
2505 ((a2 >> 8) & 0xFF) / 255.0f * 255.0f), | |
2506 blue = (uint)floorf(0.5f + ((a1 >> 0) & 0xFF) / 255.0f * | |
2507 ((a2 >> 0) & 0xFF) / 255.0f * 255.0f); | |
2508 return (alpha << 24) | (red << 16) | (green << 8) | blue; | |
2509 /*v2 = a1 >> 24; | |
2510 v3 = (double)v2 / 255.0f; | |
2511 HIDWORD(v2) = 0; | |
0 | 2512 LODWORD(v2) = a2 >> 24; |
737 | 2513 v4 = v3 * (double)v2 / 255.0f * 255.0; |
0 | 2514 v5 = v4 + 6.7553994e15; |
2515 v6 = LODWORD(v5); | |
737 | 2516 v7 = (double)((a1 >> 16) & 0xFFi64) / 255.0f * (double)((a2 >> 16) & 0xFF) * 0.0039215689 * 255.0; |
0 | 2517 v8 = v7 + 6.7553994e15; |
2518 v9 = LOBYTE(v8); | |
737 | 2519 v10 = (double)((unsigned __int16)a1 >> 8) / 255.0f * (double)((unsigned __int16)a2 >> 8) / 255.0f * 255.0; |
0 | 2520 v11 = v10 + 6.7553994e15; |
737 | 2521 v12 = (double)(a1 & 0xFFi64) / 255.0f * (double)(unsigned __int8)a2 / 255.0f * 255.0; |
0 | 2522 v13 = v12 + 6.7553994e15; |
737 | 2523 return LOBYTE(v13) | ((LOBYTE(v11) | (((v6 << 8) | v9) << 8)) << 8);*/ |
0 | 2524 } |
2525 | |
2526 //----- (004A46E6) -------------------------------------------------------- | |
2527 int __fastcall sr_4A46E6_draw_particle_segment(unsigned int x, signed int y, signed int _z, int a4, unsigned int lightColor) | |
2528 { | |
2529 int v5; // eax@1 | |
2530 int z; // eax@1 | |
2531 unsigned int v7; // eax@9 | |
2532 unsigned int v8; // ecx@9 | |
2533 int v9; // eax@9 | |
2534 unsigned int v10; // eax@10 | |
2535 int *v11; // esi@10 | |
2536 int *v12; // edi@10 | |
2537 int v13; // ecx@10 | |
2538 int v14; // edx@10 | |
2539 unsigned int v15; // eax@22 | |
2540 int *v16; // esi@22 | |
2541 int *v17; // edi@22 | |
2542 int v18; // ecx@22 | |
2543 int v19; // edx@22 | |
2544 unsigned __int16 *pTarget; // [sp+Ch] [bp-8h]@9 | |
2545 int *pTargetZ; // [sp+10h] [bp-4h]@9 | |
2546 unsigned int v22; // [sp+1Ch] [bp+8h]@9 | |
2547 signed int v23; // [sp+20h] [bp+Ch]@1 | |
2548 | |
2549 v5 = a4; | |
2550 v23 = _z >> 16; | |
2551 z = x + v5; | |
693 | 2552 if ( z >= (signed int)pViewport->uViewportTL_X |
2553 && (signed int)x <= (signed int)pViewport->uViewportBR_X | |
2554 && y >= (signed int)pViewport->uViewportTL_Y | |
2555 && y <= (signed int)pViewport->uViewportBR_Y ) | |
2556 { | |
2557 if ( (signed int)x < (signed int)pViewport->uViewportTL_X ) | |
2558 x = pViewport->uViewportTL_X; | |
2559 if ( z > (signed int)pViewport->uViewportBR_X ) | |
2560 z = pViewport->uViewportBR_X; | |
0 | 2561 pTarget = &pRenderer->pTargetSurface[x + y * pRenderer->uTargetSurfacePitch]; |
2562 v22 = z - x; | |
2563 pTargetZ = &pRenderer->pActiveZBuffer[x + 640 * y]; | |
2564 v7 = lightColor >> 3; | |
2565 v8 = lightColor & 0xF0; | |
2566 v9 = v7 & 0x1E0000; | |
2567 if ( pRenderer->uTargetGBits == 5 ) | |
2568 { | |
2569 v10 = (v8 | (((unsigned __int16)(lightColor & 0xF000) | (unsigned int)v9) >> 3)) >> 4; | |
2570 v11 = (int *)pTarget; | |
2571 v12 = pTargetZ; | |
2572 v13 = v22; | |
2573 v14 = (v10 << 16) | v10; | |
2574 z = (unsigned __int8)pTarget & 2; | |
2575 if ( (unsigned __int8)pTarget & 2 ) | |
2576 { | |
2577 z = (unsigned int)*pTargetZ >> 16; | |
2578 if ( z > v23 ) | |
2579 { | |
2580 z = v14 + ((*pTarget & 0x7BDEu) >> 1); | |
2581 *pTarget = z; | |
2582 } | |
2583 v13 = v22 - 1; | |
2584 v11 = (int *)(pTarget + 1); | |
2585 v12 = pTargetZ + 1; | |
2586 } | |
2587 while ( v13 != 1 ) | |
2588 { | |
2589 if ( v13 < 1 ) | |
2590 return z; | |
2591 z = (unsigned int)*v12 >> 16; | |
2592 if ( z <= v23 ) | |
2593 { | |
2594 v13 -= 2; | |
2595 ++v11; | |
2596 v12 += 2; | |
2597 } | |
2598 else | |
2599 { | |
2600 v12 += 2; | |
2601 z = v14 + ((*v11 & 0x7BDE7BDEu) >> 1); | |
2602 v13 -= 2; | |
2603 *v11 = z; | |
2604 ++v11; | |
2605 } | |
2606 } | |
2607 z = (unsigned int)*v12 >> 16; | |
2608 if ( z > v23 ) | |
2609 { | |
2610 z = v14 + ((*(short *)v11 & 0x7BDEu) >> 1); | |
2611 *(short *)v11 = z; | |
2612 } | |
2613 } | |
2614 else | |
2615 { | |
2616 v15 = (v8 | (((unsigned __int16)(lightColor & 0xF800) | (unsigned int)v9) >> 2)) >> 4; | |
2617 v16 = (int *)pTarget; | |
2618 v17 = pTargetZ; | |
2619 v18 = v22; | |
2620 v19 = (v15 << 16) | v15; | |
2621 z = (unsigned __int8)pTarget & 2; | |
2622 if ( (unsigned __int8)pTarget & 2 ) | |
2623 { | |
2624 z = (unsigned int)*pTargetZ >> 16; | |
2625 if ( z > v23 ) | |
2626 { | |
2627 z = v19 + ((*pTarget & 0xF7DEu) >> 1); | |
2628 *pTarget = z; | |
2629 } | |
2630 v18 = v22 - 1; | |
2631 v16 = (int *)(pTarget + 1); | |
2632 v17 = pTargetZ + 1; | |
2633 } | |
2634 while ( v18 != 1 ) | |
2635 { | |
2636 if ( v18 < 1 ) | |
2637 return z; | |
2638 z = (unsigned int)*v17 >> 16; | |
2639 if ( z <= v23 ) | |
2640 { | |
2641 v18 -= 2; | |
2642 ++v16; | |
2643 v17 += 2; | |
2644 } | |
2645 else | |
2646 { | |
2647 v17 += 2; | |
2648 z = v19 + ((*v16 & 0xF7DEF7DEu) >> 1); | |
2649 v18 -= 2; | |
2650 *v16 = z; | |
2651 ++v16; | |
2652 } | |
2653 } | |
2654 z = (unsigned int)*v17 >> 16; | |
2655 if ( z > v23 ) | |
2656 { | |
2657 z = v19 + ((*(short *)v16 & 0xF7DEu) >> 1); | |
2658 *(short *)v16 = z; | |
2659 } | |
2660 } | |
2661 } | |
2662 return z; | |
2663 } | |
2664 | |
2665 //----- (004A57E9) -------------------------------------------------------- | |
2666 void __cdecl Present_ColorKey() | |
2667 { | |
2668 HRESULT v0; // eax@3 | |
2669 HRESULT v1; // eax@3 | |
2670 HRESULT v2; // eax@3 | |
2671 HRESULT v3; // eax@3 | |
2672 HRESULT v4; // eax@3 | |
2673 RECT a2; // [sp+4h] [bp-14h]@3 | |
2674 //CheckHRESULT_stru0 this; // [sp+14h] [bp-4h]@3 | |
2675 | |
2676 if ( !pRenderer->uNumSceneBegins ) | |
2677 { | |
2678 if ( pRenderer->field_40110 ) | |
2679 { | |
693 | 2680 a2.bottom = pViewport->uViewportTL_Y; |
0 | 2681 a2.left = 0; |
2682 a2.top = 0; | |
2683 a2.right = 640; | |
2684 ErrD3D(pRenderer->pBackBuffer4->BltFast(0, 0, pRenderer->pColorKeySurface4, &a2, 16u)); | |
2685 a2.right = 640; | |
2686 a2.left = 0; | |
693 | 2687 a2.top = pViewport->uViewportBR_Y + 1; |
0 | 2688 a2.bottom = 480; |
2689 ErrD3D(pRenderer->pBackBuffer4->BltFast( | |
2690 0, | |
693 | 2691 pViewport->uViewportBR_Y + 1, |
0 | 2692 pRenderer->pColorKeySurface4, |
2693 &a2, | |
2694 16u)); | |
693 | 2695 a2.right = pViewport->uViewportTL_X; |
2696 a2.bottom = pViewport->uViewportBR_Y + 1; | |
0 | 2697 a2.left = 0; |
693 | 2698 a2.top = pViewport->uViewportTL_Y; |
0 | 2699 ErrD3D(pRenderer->pBackBuffer4->BltFast( |
2700 0, | |
693 | 2701 pViewport->uViewportTL_Y, |
0 | 2702 pRenderer->pColorKeySurface4, |
2703 &a2, | |
2704 16u)); | |
693 | 2705 a2.left = pViewport->uViewportBR_X; |
2706 a2.top = pViewport->uViewportTL_Y; | |
0 | 2707 a2.right = 640; |
693 | 2708 a2.bottom = pViewport->uViewportBR_Y + 1; |
0 | 2709 ErrD3D(pRenderer->pBackBuffer4->BltFast( |
693 | 2710 pViewport->uViewportBR_X, |
2711 pViewport->uViewportTL_Y, | |
0 | 2712 pRenderer->pColorKeySurface4, |
2713 &a2, | |
2714 16u)); | |
693 | 2715 a2.right = pViewport->uViewportBR_X; |
2716 a2.bottom = pViewport->uViewportBR_Y + 1; | |
2717 a2.left = pViewport->uViewportTL_X; | |
2718 a2.top = pViewport->uViewportTL_Y; | |
0 | 2719 ErrD3D(pRenderer->pBackBuffer4->BltFast( |
693 | 2720 pViewport->uViewportTL_X, |
2721 pViewport->uViewportTL_Y, | |
0 | 2722 pRenderer->pColorKeySurface4, |
2723 &a2, | |
2724 17u)); | |
2725 } | |
2726 } | |
2727 } | |
2728 | |
2729 //----- (004A597D) -------------------------------------------------------- | |
2730 void Present_NoColorKey() | |
2731 { | |
2732 //unsigned __int16 *v0; // eax@4 | |
2733 unsigned __int16 *v1; // esi@4 | |
2734 void *v2; // edi@4 | |
2735 //signed int v4; // ebx@4 | |
2736 //signed int v5; // ebx@6 | |
2737 //void *v6; // edi@7 | |
2738 //const void *v7; // esi@7 | |
2739 signed int v8; // ebx@8 | |
2740 int v9; // eax@10 | |
2741 unsigned int v10; // esi@10 | |
2742 unsigned __int32 v11; // edi@10 | |
2743 //int v12; // ecx@10 | |
2744 unsigned int v13; // ebx@10 | |
2745 int v14; // eax@11 | |
2746 int v15; // eax@13 | |
2747 int v16; // eax@14 | |
2748 int v17; // eax@16 | |
2749 HRESULT v18; // eax@22 | |
2750 DDSURFACEDESC2 Dst; // [sp+Ch] [bp-98h]@3 | |
2751 int v20; // [sp+88h] [bp-1Ch]@10 | |
2752 int v21; // [sp+8Ch] [bp-18h]@10 | |
2753 __int32 v22; // [sp+90h] [bp-14h]@10 | |
2754 //unsigned __int32 v23; // [sp+94h] [bp-10h]@10 | |
2755 unsigned int v24; // [sp+98h] [bp-Ch]@4 | |
2756 //unsigned int _this; // [sp+9Ch] [bp-8h]@10 | |
2757 //LPVOID v26; // [sp+A0h] [bp-4h]@4 | |
2758 | |
2759 if ( !pRenderer->uNumSceneBegins ) | |
2760 { | |
2761 if ( pRenderer->field_40110 ) | |
2762 { | |
2763 memset(&Dst, 0, 0x7Cu); | |
2764 Dst.dwSize = 124; | |
168 | 2765 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) ) |
0 | 2766 { |
2767 //v26 = Dst.lpSurface; | |
2768 pRenderer->pCurrentlyLockedSurfaceDataPtr = (unsigned __int16 *)Dst.lpSurface; | |
2769 v24 = pRenderer->uTargetGMask | pRenderer->uTargetBMask | | |
2770 ((pRenderer->uTargetGMask | pRenderer->uTargetBMask) << 16); | |
2771 pRenderer->pCurrentlyLockedSoftSurface = pRenderer->pTargetSurface; | |
2772 pRenderer->uCurrentlyLockedSurfacePitch = Dst.lPitch; | |
2773 v1 = pRenderer->pTargetSurface; | |
2774 v2 = Dst.lpSurface; | |
2775 | |
2776 | |
2777 /*for (uint y = 0; y < 480; ++y) | |
2778 { | |
2779 auto pDst = (unsigned short *)((char *)Dst.lpSurface + y * Dst.lPitch); | |
2780 for (uint x = 0; x < 640; ++x) | |
2781 pDst[x] = pRenderer->uTargetRMask | pRenderer->uTargetBMask; | |
2782 }*/ | |
2783 | |
2784 auto pSrc = pRenderer->pTargetSurface; | |
2785 auto pDst = (__int16 *)Dst.lpSurface; | |
2786 | |
2787 for (uint y = 0; y < 8; ++y) | |
2788 memcpy(pDst + y * Dst.lPitch / 2, | |
2789 | |
2790 pSrc + y * 640, 640 * sizeof(__int16)); | |
2791 | |
2792 for (uint y = 8; y < 352; ++y) | |
2793 { | |
2794 memcpy(pDst + y * Dst.lPitch / 2, | |
2795 pSrc + y * 640, 8 * sizeof(__int16)); | |
819 | 2796 memcpy(pDst + 8 + game_viewport_width/*462*/ + y * Dst.lPitch / 2, |
2797 pSrc + 8 + game_viewport_width/*462*/ + y * 640, 174/*172*/ * sizeof(__int16)); | |
0 | 2798 } |
2799 | |
121 | 2800 for (uint y = 352; y < 480; ++y) |
0 | 2801 memcpy(pDst + y * Dst.lPitch / 2, |
2802 pSrc + y * 640, 640 * sizeof(__int16)); | |
2803 | |
2804 | |
693 | 2805 auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportTL_Y + pViewport->uViewportTL_X; |
0 | 2806 //_this = (unsigned int)&pSrc[2 * (((signed int)pViewport->uViewportX >> 1) + 320 * pViewport->uViewportY)]; |
693 | 2807 auto pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportTL_Y + pViewport->uViewportTL_X; |
0 | 2808 //v23 = (unsigned __int32)((char *)v26 + 4 * (((signed int)pViewport->uViewportX >> 1) + (Dst.lPitch >> 2) * pViewport->uViewportY)); |
693 | 2809 v9 = ((signed int)pViewport->uViewportTL_X >> 1) - ((signed int)pViewport->uViewportBR_X >> 1); |
0 | 2810 //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1); |
2811 v22 = 4 * ((Dst.lPitch / 4) + v9); | |
2812 v21 = 4 * v9 + 1280; | |
2813 | |
121 | 2814 //auto uNumLines = pViewport->uViewportW - pViewport->uViewportY + 1; |
0 | 2815 //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1); |
2816 v10 = (int)pSrc_x1y1; | |
2817 v11 = (int)pDst_x1y1; | |
693 | 2818 auto uHalfWidth = v20 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2; |
0 | 2819 v13 = v24; |
2820 | |
693 | 2821 for (uint y = pViewport->uViewportTL_Y; y < pViewport->uViewportBR_Y + 1; ++y) |
0 | 2822 { |
2823 //memcpy(pDst + pViewport->uViewportX + y * Dst.lPitch / 2, | |
2824 // pSrc + pViewport->uViewportX + y * 640, (pViewport->uViewportZ - pViewport->uViewportX) * sizeof(__int16)); | |
693 | 2825 for (uint x = pViewport->uViewportTL_X; x < pViewport->uViewportBR_X; ++x) |
0 | 2826 { |
2827 if (pSrc[y * 640 + x] != (pRenderer->uTargetGMask | pRenderer->uTargetBMask)) | |
2828 pDst[y * Dst.lPitch / 2 + x] = pSrc[y * 640 + x]; | |
2829 } | |
2830 } | |
2831 | |
2832 ErrD3D(pRenderer->pBackBuffer4->Unlock(0)); | |
2833 | |
2834 /* while ( 1 ) | |
2835 { | |
2836 while ( 1 ) | |
2837 { | |
2838 v14 = *(int *)v10; | |
2839 v10 += 4; | |
2840 if ( v14 == v13 ) | |
2841 break; | |
2842 if ( (short)v14 == (short)v13 ) | |
2843 { | |
2844 *(int *)v11 = *(int *)v11 & 0xFFFF | v14 & 0xFFFF0000; | |
2845 v11 += 4; | |
2846 --uHalfWidth; | |
2847 if ( !uHalfWidth ) | |
2848 goto LABEL_21; | |
2849 } | |
2850 else | |
2851 { | |
2852 v15 = __ROL__(v14, 16); | |
2853 if ( (short)v15 == (short)v13 ) | |
2854 { | |
2855 v17 = __ROR__(v15, 16); | |
2856 *(int *)v11 = *(int *)v11 & 0xFFFF0000 | (unsigned __int16)v17; | |
2857 v11 += 4; | |
2858 --uHalfWidth; | |
2859 if ( !uHalfWidth ) | |
2860 goto LABEL_21; | |
2861 } | |
2862 else | |
2863 { | |
2864 v16 = __ROR__(v15, 16); | |
2865 *(int *)v11 = v16; | |
2866 v11 += 4; | |
2867 --uHalfWidth; | |
2868 if ( !uHalfWidth ) | |
2869 goto LABEL_21; | |
2870 } | |
2871 } | |
2872 } | |
2873 v11 += 4; | |
2874 --uHalfWidth; | |
2875 if ( !uHalfWidth ) | |
2876 { | |
2877 LABEL_21: | |
2878 v10 += v21; | |
2879 v11 += v22; | |
2880 uHalfWidth = v20; | |
2881 if ( !--uNumLines ) | |
2882 { | |
2883 ErrD3D(pRenderer->pBackBuffer4->Unlock(0)); | |
2884 return; | |
2885 } | |
2886 } | |
2887 }*/ | |
2888 } | |
2889 } | |
2890 } | |
2891 } | |
2892 | |
2893 //----- (004A7063) -------------------------------------------------------- | |
1390 | 2894 unsigned int ModulateColor(unsigned int diffuse, float multiplier) |
0 | 2895 { |
1390 | 2896 float alpha = multiplier * ((diffuse >> 24) & 0xFF); |
2897 int a = (int)floorf(alpha + 0.5f); | |
2898 a = max(0, min(255, a)); | |
2899 | |
2900 float red = multiplier * ((diffuse >> 16) & 0xFF); | |
2901 int r = (int)floorf(red + 0.5f); | |
2902 r = max(0, min(255, r)); | |
2903 | |
2904 float green = multiplier * ((diffuse >> 8) & 0xFF); | |
2905 int g = (int)floorf(green + 0.5f); | |
2906 g = max(0, min(255, g)); | |
2907 | |
2908 float blue = multiplier * ((diffuse >> 0) & 0xFF); | |
2909 int b = (int)floorf(blue + 0.5f); | |
2910 b = max(0, min(255, b)); | |
2911 | |
2912 return (a << 24) | (r << 16) | (g << 8) | b; | |
0 | 2913 } |
2914 | |
2915 | |
2916 | |
2917 //----- (004B1447) -------------------------------------------------------- | |
2918 Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3) | |
2919 { | |
2920 signed int v3; // esi@1 | |
2921 char v4; // sf@8 | |
2922 int v5; // eax@8 | |
2923 unsigned __int64 v6; // qax@12 | |
2924 DDM_DLV_Header *v7; // eax@14 | |
2925 Player **v8; // edi@18 | |
2926 Player *result; // eax@19 | |
735 | 2927 //char *v10; // esi@20 |
0 | 2928 |
2929 v3 = 0; | |
2930 if ( a2 ) | |
2931 { | |
2932 if ( a2 != 1 ) | |
2933 { | |
2934 if ( a2 == 2 ) | |
2935 v3 = 2; | |
2936 goto LABEL_13; | |
2937 } | |
2938 v3 = 2; | |
2939 } | |
2940 else | |
2941 { | |
2942 v3 = 1; | |
2943 } | |
2944 if ( pParty->uFine < 4000000 ) | |
2945 { | |
2946 v4 = a3 + pParty->uFine < 0; | |
2947 v5 = a3 + pParty->uFine; | |
2948 pParty->uFine += a3; | |
2949 if ( v4 ) | |
2950 { | |
2951 v5 = 0; | |
2952 pParty->uFine = 0; | |
2953 } | |
2954 if ( v5 > 4000000 ) | |
2955 pParty->uFine = 4000000; | |
2956 } | |
487 | 2957 |
2958 pParty->field_3C._shop_ban_times[a1] = pParty->uTimePlayed + 368640; | |
2959 | |
0 | 2960 LABEL_13: |
463 | 2961 pParty->InTheShopFlags[a1] = 1; |
0 | 2962 if ( v3 ) |
2963 { | |
2964 v7 = &pOutdoor->ddm; | |
2965 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
2966 v7 = &pIndoor->dlv; | |
2967 v7->uReputation += v3; | |
2968 if ( v7->uReputation > 10000 ) | |
2969 v7->uReputation = 10000; | |
2970 } | |
2971 v8 = &pPlayers[1]; | |
2972 do | |
2973 { | |
2974 result = *v8; | |
2975 if ( pParty->uFine ) | |
2976 { | |
735 | 2977 //v10 = result->_guilds_member_bits; |
484 | 2978 result = (Player *)_449B57_test_bit((unsigned __int8 *)result->_guilds_member_bits, 1); |
0 | 2979 if ( !(short)result ) |
735 | 2980 __debugbreak(); |
501 | 2981 //result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u); |
0 | 2982 } |
2983 ++v8; | |
2984 } | |
2985 while ( (signed int)v8 <= (signed int)&pPlayers[4] ); | |
2986 return result; | |
2987 } | |
2988 | |
2989 //----- (004B1523) -------------------------------------------------------- | |
762 | 2990 void __thiscall sub_4B1523(int *_this) |
0 | 2991 { |
2992 int v1; // esi@1 | |
2993 int v2; // edx@1 | |
2994 unsigned int v3; // eax@2 | |
2995 int v4; // eax@4 | |
2996 LONG v5; // ecx@4 | |
2997 int v6; // eax@10 | |
2998 char *v7; // ST44_4@12 | |
2999 unsigned __int16 v8; // ax@12 | |
3000 GUIWindow a1; // [sp+Ch] [bp-68h]@4 | |
3001 unsigned int v11; // [sp+60h] [bp-14h]@1 | |
3002 POINT a2; // [sp+64h] [bp-10h]@1 | |
3003 int v13; // [sp+6Ch] [bp-8h]@4 | |
3004 int v14; // [sp+70h] [bp-4h]@4 | |
3005 | |
3006 v1 = *_this - 399; | |
3007 v2 = (*_this - 400) % 11 + 1; | |
3008 v11 = 4 * (*_this - 400) / 11; | |
1312 | 3009 // sprintf(pTmpBuf.data(), "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2); not used |
0 | 3010 if ( pMouse->GetCursorPos(&a2)->y <= 320 ) |
3011 v3 = pMouse->GetCursorPos(&a2)->y + 30; | |
3012 else | |
3013 v3 = 30; | |
3014 a1.Hint = 0; | |
3015 a1.uFrameY = v3; | |
3016 a1.uFrameWidth = 328; | |
3017 a1.uFrameHeight = 68; | |
3018 a1.uFrameX = 90; | |
3019 a1.uFrameZ = 417; | |
3020 a1.uFrameW = v3 + 67; | |
3021 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]); | |
3022 v14 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]); | |
3023 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]); | |
3024 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]); | |
3025 v5 = a2.y; | |
3026 if ( v14 > a2.y ) | |
3027 v5 = v14; | |
3028 if ( v13 > v5 ) | |
3029 v5 = v13; | |
3030 if ( v4 > v5 ) | |
3031 v5 = v4; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3032 sprintf(pTmpBuf2.data(), "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", |
262 | 3033 pSpellStats->pInfos[v1].pDescription, pGlobalTXT_LocalizationStrings[431], // "Normal" |
3034 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pBasicSkillDesc, pGlobalTXT_LocalizationStrings[433], // "Expert" | |
3035 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pExpertSkillDesc, pGlobalTXT_LocalizationStrings[432], // "Master" | |
3036 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pMasterSkillDesc, pGlobalTXT_LocalizationStrings[96], // "Grand" | |
3037 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pGrandmasterSkillDesc); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3038 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0); |
0 | 3039 a1.uFrameHeight += v6; |
3040 if ( (signed int)a1.uFrameHeight < 150 ) | |
3041 a1.uFrameHeight = 150; | |
819 | 3042 a1.uFrameWidth = game_viewport_width; |
0 | 3043 a1.DrawMessageBox(0); |
3044 a1.uFrameWidth -= 12; | |
3045 a1.uFrameHeight -= 12; | |
3046 v7 = pSpellStats->pInfos[v1].pName; | |
3047 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; | |
3048 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
949 | 3049 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
0 | 3050 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3051 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0); |
0 | 3052 a1.uFrameZ = a1.uFrameX + 107; |
3053 a1.uFrameWidth = 108; | |
3054 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u); | |
1393 | 3055 sprintfex(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1)); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3056 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3); |
0 | 3057 } |
3058 | |
3059 //----- (004B1ECE) -------------------------------------------------------- | |
3060 void __cdecl sub_4B1ECE() | |
3061 { | |
3062 __int16 *v0; // edi@1 | |
3063 int v1; // ebx@3 | |
3064 Player *v2; // esi@3 | |
3065 int v3; // eax@4 | |
3066 signed int v4; // eax@9 | |
3067 int v5; // ebx@11 | |
89 | 3068 Player *v6; // esi@13 |
3069 ItemGen *v7; // eax@14 | |
0 | 3070 signed int v8; // edi@14 |
89 | 3071 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 |
0 | 3072 signed int v10; // [sp+10h] [bp-8h]@13 |
3073 int v11; // [sp+14h] [bp-4h]@1 | |
89 | 3074 Player *v12; // [sp+14h] [bp-4h]@11 |
0 | 3075 |
484 | 3076 contract_approved = 0; |
0 | 3077 v11 = 0; |
3078 uDialogueType = 84; | |
827 | 3079 current_npc_text = (char *)pNPCTopics[667].pText; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3080 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data(); |
0 | 3081 while ( 1 ) |
3082 { | |
484 | 3083 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) ) |
0 | 3084 { |
3085 v1 = 0; | |
3086 v2 = pParty->pPlayers; | |
3087 do | |
3088 { | |
89 | 3089 LOBYTE(v3) = v2->CompareVariable(VAR_PlayerItemInHands, *(v0+1)); |
0 | 3090 if ( v3 ) |
3091 break; | |
3092 ++v2; | |
3093 ++v1; | |
3094 } | |
3095 while ( (signed int)v2 < (signed int)pParty->pHirelings ); | |
3096 if ( v1 == 4 ) | |
3097 break; | |
3098 } | |
3099 ++v11; | |
3100 v0 += 2; | |
89 | 3101 if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) |
3102 break; | |
3103 } | |
3104 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
3105 { | |
827 | 3106 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful |
89 | 3107 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
484 | 3108 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
89 | 3109 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); |
3110 } | |
484 | 3111 if ( contract_approved == 601 ) |
0 | 3112 { |
3113 v5 = 0; | |
89 | 3114 v12 = pParty->pPlayers;//[0].uClass; |
0 | 3115 v9 = 0; |
3116 while ( 1 ) | |
3117 { | |
135 | 3118 if ( v12->classType == PLAYER_CLASS_LICH ) |
0 | 3119 { |
3120 v10 = 0; | |
89 | 3121 v6 = pParty->pPlayers;//[0].pInventoryItems[0].field_1A; |
0 | 3122 do |
3123 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1372
diff
changeset
|
3124 v7 = v6->pInventoryItemList; |
0 | 3125 v8 = 138; |
3126 do | |
3127 { | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1355
diff
changeset
|
3128 if ( v7->uItemID == ITEM_LICH_JAR_FULL ) |
0 | 3129 { |
377 | 3130 if ( !v7->uHolderPlayer ) |
89 | 3131 v9 = v7; |
377 | 3132 if ( v7->uHolderPlayer == v5 ) |
0 | 3133 v10 = 1; |
3134 } | |
89 | 3135 ++v7; |
0 | 3136 --v8; |
3137 } | |
3138 while ( v8 ); | |
89 | 3139 ++v6; |
3140 } | |
3141 while ( v6 <= &pParty->pPlayers[3] ); | |
0 | 3142 if ( !v10 ) |
3143 break; | |
3144 } | |
89 | 3145 ++v12; |
0 | 3146 ++v5; |
89 | 3147 if ( v12 > &pParty->pPlayers[3] ) |
0 | 3148 return; |
3149 } | |
3150 if ( v9 ) | |
377 | 3151 v9->uHolderPlayer = v5; |
0 | 3152 } |
3153 } | |
3154 // 4F08EC: using guessed type int dword_4F08EC[]; | |
3155 // 722B3C: using guessed type int dword_722B3C; | |
3156 // 722B44: using guessed type int dword_722B44; | |
3157 // F8B1A8: using guessed type int dword_F8B1A8; | |
3158 | |
3159 //----- (004B254D) -------------------------------------------------------- | |
3160 char *__thiscall _4B254D_SkillMasteryTeacher(int _this) | |
3161 { | |
955 | 3162 //Player *v1; // esi@1 |
0 | 3163 int v2; // edx@1 |
3164 int v3; // ecx@1 | |
3165 int v4; // edi@1 | |
955 | 3166 int pClassType; // eax@7 |
0 | 3167 int v6; // eax@7 |
3168 int v7; // ebx@7 | |
955 | 3169 //int v8; // ebx@8 |
0 | 3170 signed int v9; // esi@8 |
3171 int v10; // eax@8 | |
3172 char *v11; // ecx@8 | |
3173 int v12; // edi@9 | |
3174 char *v13; // edx@9 | |
3175 signed int v14; // edi@10 | |
3176 unsigned int v16; // eax@29 | |
955 | 3177 //int v17; // eax@36 |
0 | 3178 char v18; // cl@46 |
3179 __int16 v19; // dx@56 | |
3180 int v20; // eax@60 | |
955 | 3181 //char *v21; // [sp-Ch] [bp-38h]@82 |
3182 //const char *v22; // [sp-8h] [bp-34h]@21 | |
3183 //unsigned int v23; // [sp-8h] [bp-34h]@38 | |
3184 //char *v24; // [sp-8h] [bp-34h]@82 | |
0 | 3185 char *v25; // [sp-4h] [bp-30h]@14 |
955 | 3186 //int v26; // [sp-4h] [bp-30h]@38 |
3187 //int v27; // [sp-4h] [bp-30h]@82 | |
0 | 3188 char v28[4]; // [sp+Ch] [bp-20h]@9 |
3189 int v29; // [sp+10h] [bp-1Ch]@13 | |
3190 int v30; // [sp+14h] [bp-18h]@15 | |
3191 int v31; // [sp+18h] [bp-14h]@16 | |
3192 unsigned __int16 a1[2]; // [sp+1Ch] [bp-10h]@7 | |
955 | 3193 //int v33; // [sp+20h] [bp-Ch]@7 |
0 | 3194 int v34; // [sp+24h] [bp-8h]@7 |
3195 char *v35; // [sp+28h] [bp-4h]@1 | |
3196 | |
484 | 3197 contract_approved = 0; |
0 | 3198 v2 = (_this - 200) % 3; |
3199 v3 = (_this - 200) / 3; | |
3200 v4 = v2; | |
3201 v35 = (char *)pNPCTopics[127].pText; | |
492 | 3202 dword_F8B1AC_award_bit_number = v3; |
0 | 3203 if ( v2 ) |
3204 { | |
3205 if ( v2 == 1 ) | |
3206 { | |
267 | 3207 gold_transaction_amount = 5000; |
0 | 3208 dword_F8B1B0 = 3; |
3209 } | |
3210 else | |
3211 { | |
3212 if ( v2 == 2 ) | |
3213 { | |
267 | 3214 gold_transaction_amount = 8000; |
0 | 3215 dword_F8B1B0 = 4; |
3216 } | |
3217 } | |
3218 } | |
3219 else | |
3220 { | |
267 | 3221 gold_transaction_amount = 2000; |
0 | 3222 dword_F8B1B0 = 2; |
3223 } | |
955 | 3224 pClassType = pPlayers[uActiveCharacter]->classType; |
3225 //v33 = pClassType; | |
3226 v6 = byte_4ED970_skill_learn_ability_by_class_table[pClassType][v3]; | |
3227 *(int *)a1 = pPlayers[uActiveCharacter]->pActiveSkills[v3]; | |
0 | 3228 v7 = a1[0] & 0x3F; |
3229 v34 = v2 + 2; | |
3230 if ( v6 < v2 + 2 ) | |
3231 { | |
955 | 3232 //v8 = v33; |
0 | 3233 v9 = 0; |
955 | 3234 v10 = pClassType - pClassType % 4; |
3235 v11 = &byte_4ED970_skill_learn_ability_by_class_table[pClassType - pClassType % 4][v3]; | |
0 | 3236 do |
3237 { | |
3238 v12 = (unsigned __int8)*v11; | |
3239 v13 = &v28[4 * v9]; | |
3240 *(int *)v13 = 0; | |
3241 if ( v12 < v34 ) | |
3242 { | |
3243 v14 = 1; | |
3244 } | |
3245 else | |
3246 { | |
3247 v14 = 1; | |
3248 *(int *)v13 = 1; | |
3249 } | |
3250 ++v9; | |
3251 v11 += 37; | |
3252 } | |
3253 while ( v9 < 4 ); | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1393
diff
changeset
|
3254 __debugbreak(); // warning C4700: uninitialized local variable 'v29' used |
0 | 3255 if ( v29 == v14 ) |
3256 { | |
3257 v25 = pClassNames[v10 + 1]; | |
3258 } | |
3259 else | |
3260 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1393
diff
changeset
|
3261 __debugbreak(); // warning C4700: uninitialized local variable 'v30' used |
955 | 3262 if ( v30 == v14 )//crash |
0 | 3263 { |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1393
diff
changeset
|
3264 __debugbreak(); // warning C4700: uninitialized local variable 'v31' used |
0 | 3265 if ( v31 == v14 ) |
3266 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3267 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s èëè %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3268 return pTmpBuf.data(); |
0 | 3269 } |
3270 v25 = pClassNames[v10 + 2]; | |
3271 } | |
3272 else | |
3273 { | |
3274 if ( v31 != v14 ) | |
3275 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3276 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Ýòîò óðîâåíü íàâûêà íå ìîæåò áûòü ïîñòèãíóò êëàññîì %s. |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3277 return pTmpBuf.data(); |
0 | 3278 } |
3279 v25 = pClassNames[v10 + 3]; | |
3280 } | |
3281 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3282 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], v25);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3283 return pTmpBuf.data(); |
0 | 3284 } |
955 | 3285 if ( !pPlayers[uActiveCharacter]->CanAct() ) |
0 | 3286 return (char *)pNPCTopics[122].pText; |
3287 if ( !v7 ) | |
3288 return (char *)pNPCTopics[131].pText; | |
3289 v16 = SkillToMastery(a1[0]); | |
3290 if ( (signed int)v16 > v4 + 1 ) | |
3291 return (char *)pNPCTopics[v4 + 128].pText; | |
3292 if ( v34 != 2 ) | |
3293 { | |
3294 if ( v34 == 3 ) | |
3295 { | |
3296 if ( (signed int)v16 >= 2 && v7 >= 7 ) | |
3297 { | |
492 | 3298 switch ( dword_F8B1AC_award_bit_number ) |
0 | 3299 { |
3300 case 12: | |
3301 case 13: | |
3302 case 14: | |
3303 case 15: | |
3304 case 16: | |
3305 case 17: | |
3306 case 18: | |
267 | 3307 gold_transaction_amount = 4000; |
0 | 3308 goto LABEL_42; |
3309 case 19: | |
3310 v19 = 114; | |
955 | 3311 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) ) |
3312 return v35; | |
3313 if ( !gold_transaction_amount ) | |
3314 goto LABEL_79; | |
3315 goto LABEL_42; | |
0 | 3316 case 20: |
3317 v19 = 110; | |
484 | 3318 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) ) |
0 | 3319 return v35; |
955 | 3320 if ( !gold_transaction_amount ) |
3321 goto LABEL_79; | |
3322 goto LABEL_42; | |
0 | 3323 case 22: |
955 | 3324 v20 = pPlayers[uActiveCharacter]->GetBaseWillpower(); |
3325 if ( v20 < 50 ) | |
3326 return v35; | |
3327 if ( !gold_transaction_amount ) | |
3328 goto LABEL_79; | |
3329 goto LABEL_42; | |
0 | 3330 case 24: |
267 | 3331 gold_transaction_amount = 2500; |
955 | 3332 v20 = pPlayers[uActiveCharacter]->GetBaseEndurance(); |
0 | 3333 if ( v20 < 50 ) |
3334 return v35; | |
955 | 3335 if ( !gold_transaction_amount ) |
3336 goto LABEL_79; | |
3337 goto LABEL_42; | |
3338 case 36: | |
3339 v20 = pPlayers[uActiveCharacter]->GetBaseIntelligence(); | |
3340 if ( v20 < 50 ) | |
3341 return v35; | |
3342 if ( !gold_transaction_amount ) | |
3343 goto LABEL_79; | |
3344 goto LABEL_42; | |
0 | 3345 case 21: |
3346 case 23: | |
3347 case 25: | |
3348 case 26: | |
3349 case 29: | |
3350 case 32: | |
3351 case 34: | |
3352 case 35: | |
267 | 3353 gold_transaction_amount = 2500; |
0 | 3354 goto LABEL_42; |
3355 case 8: | |
3356 case 9: | |
3357 case 10: | |
3358 case 11: | |
267 | 3359 gold_transaction_amount = 3000; |
0 | 3360 goto LABEL_42; |
3361 case 7: | |
955 | 3362 gold_transaction_amount = 0; |
3363 if ( !gold_transaction_amount ) | |
3364 goto LABEL_79; | |
3365 goto LABEL_42; | |
3366 default: | |
3367 if ( !gold_transaction_amount ) | |
3368 goto LABEL_79; | |
3369 goto LABEL_42; | |
0 | 3370 } |
955 | 3371 gold_transaction_amount = 0; |
3372 if ( !gold_transaction_amount ) | |
3373 goto LABEL_79; | |
3374 goto LABEL_42; | |
0 | 3375 } |
3376 } | |
3377 else | |
3378 { | |
3379 if ( v34 != 4 ) | |
3380 { | |
955 | 3381 if ( !gold_transaction_amount ) |
3382 goto LABEL_79; | |
3383 goto LABEL_42; | |
0 | 3384 } |
3385 if ( (signed int)v16 >= 3 && v7 >= 10 ) | |
3386 { | |
492 | 3387 switch ( dword_F8B1AC_award_bit_number ) |
0 | 3388 { |
3389 case 19: | |
1355 | 3390 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x22u, 1) == 1 ) |
955 | 3391 { |
3392 if ( !gold_transaction_amount ) | |
3393 goto LABEL_79; | |
3394 goto LABEL_42; | |
3395 } | |
1355 | 3396 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Au, 1) == 1 ) |
955 | 3397 { |
3398 if ( !gold_transaction_amount ) | |
3399 goto LABEL_79; | |
3400 goto LABEL_42; | |
3401 } | |
3402 return v35; | |
0 | 3403 case 20: |
1355 | 3404 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x23u, 1) == 1 ) |
955 | 3405 { |
3406 if ( !gold_transaction_amount ) | |
3407 goto LABEL_79; | |
3408 goto LABEL_42; | |
3409 } | |
1355 | 3410 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Bu, 1) == 1 ) |
955 | 3411 { |
3412 if ( !gold_transaction_amount ) | |
3413 goto LABEL_79; | |
3414 goto LABEL_42; | |
3415 } | |
0 | 3416 return v35; |
3417 case 30: | |
955 | 3418 v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[31]); |
0 | 3419 if ( (v18 & 0x3Fu) < 0xA ) |
3420 return v35; | |
955 | 3421 if ( !gold_transaction_amount ) |
3422 goto LABEL_79; | |
3423 goto LABEL_42; | |
3424 case 31: | |
3425 v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[30]); | |
3426 if ( (v18 & 0x3Fu) < 0xA ) | |
3427 return v35; | |
3428 if ( !gold_transaction_amount ) | |
3429 goto LABEL_79; | |
3430 goto LABEL_42; | |
0 | 3431 case 21: |
3432 case 23: | |
3433 case 24: | |
3434 case 25: | |
3435 case 26: | |
3436 case 29: | |
3437 case 32: | |
3438 case 34: | |
3439 case 35: | |
267 | 3440 gold_transaction_amount = 6000; |
0 | 3441 goto LABEL_42; |
3442 case 8: | |
3443 case 9: | |
3444 case 10: | |
3445 case 11: | |
267 | 3446 gold_transaction_amount = 7000; |
0 | 3447 goto LABEL_42; |
3448 case 7: | |
3449 break; | |
955 | 3450 default: |
3451 if ( !gold_transaction_amount ) | |
3452 goto LABEL_79; | |
3453 goto LABEL_42; | |
0 | 3454 } |
267 | 3455 gold_transaction_amount = 0; |
955 | 3456 if ( !gold_transaction_amount ) |
3457 goto LABEL_79; | |
3458 goto LABEL_42; | |
0 | 3459 } |
3460 } | |
3461 return v35; | |
3462 } | |
3463 if ( v7 < 4 ) | |
3464 return v35; | |
492 | 3465 if ( dword_F8B1AC_award_bit_number > 27 ) |
3466 { | |
3467 if ( dword_F8B1AC_award_bit_number != 29 | |
3468 && dword_F8B1AC_award_bit_number != 32 | |
3469 && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) ) | |
0 | 3470 { |
267 | 3471 if ( !gold_transaction_amount ) |
0 | 3472 goto LABEL_79; |
3473 goto LABEL_42; | |
3474 } | |
267 | 3475 gold_transaction_amount = 500; |
955 | 3476 if ( !gold_transaction_amount ) |
3477 goto LABEL_79; | |
3478 goto LABEL_42; | |
0 | 3479 } |
492 | 3480 if ( dword_F8B1AC_award_bit_number >= 23 ) |
955 | 3481 { |
3482 gold_transaction_amount = 500; | |
3483 if ( !gold_transaction_amount ) | |
3484 goto LABEL_79; | |
3485 goto LABEL_42; | |
3486 } | |
492 | 3487 if ( dword_F8B1AC_award_bit_number == 7 ) |
0 | 3488 { |
267 | 3489 gold_transaction_amount = 0; |
0 | 3490 goto LABEL_79; |
3491 } | |
492 | 3492 if ( dword_F8B1AC_award_bit_number <= 7 ) |
955 | 3493 { |
3494 if ( !gold_transaction_amount ) | |
3495 goto LABEL_79; | |
3496 goto LABEL_42; | |
3497 } | |
492 | 3498 if ( dword_F8B1AC_award_bit_number > 18 ) |
3499 { | |
3500 if ( dword_F8B1AC_award_bit_number != 21 ) | |
955 | 3501 { |
3502 if ( !gold_transaction_amount ) | |
3503 goto LABEL_79; | |
3504 goto LABEL_42; | |
3505 } | |
3506 gold_transaction_amount = 500; | |
3507 if ( !gold_transaction_amount ) | |
3508 goto LABEL_79; | |
3509 goto LABEL_42; | |
0 | 3510 } |
267 | 3511 gold_transaction_amount = 1000; |
0 | 3512 LABEL_42: |
267 | 3513 if ( gold_transaction_amount > pParty->uNumGold ) |
0 | 3514 return (char *)pNPCTopics[124].pText; |
3515 LABEL_79: | |
484 | 3516 contract_approved = 1; |
0 | 3517 if ( v34 == 2 ) |
3518 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3519 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Ïîëó÷èòü ñòåïåíü ^Pr[%s] â íàâûêå ^Pr[%s] çà ^I[%lu] çîëîò^L[îé;ûõ;ûõ] |
955 | 3520 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ýêñïåðò |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3521 return pTmpBuf2.data(); |
0 | 3522 } |
3523 if ( v34 == 3 ) | |
3524 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3525 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
955 | 3526 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ìàñòåð |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3527 return pTmpBuf2.data(); |
0 | 3528 } |
3529 if ( v34 == 4 ) | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3530 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
955 | 3531 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Âåëèêèé Ìàãèñòð |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3532 return pTmpBuf2.data(); |
0 | 3533 } |
3534 | |
3535 //----- (004B3E1E) -------------------------------------------------------- | |
3536 void __cdecl sub_4B3E1E() | |
3537 { | |
3538 NPCData *v0; // ST40_4@1 | |
3539 signed int v1; // edi@1 | |
165 | 3540 //GUIWindow *v2; // ecx@1 |
0 | 3541 |
167 | 3542 __debugbreak(); |
602 | 3543 v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
0 | 3544 v1 = 0; |
3545 pDialogueWindow->eWindowType = WINDOW_MainMenu; | |
3546 pDialogueWindow->Release(); | |
165 | 3547 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 1, 0); |
291 | 3548 if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) |
0 | 3549 { |
832 | 3550 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); |
0 | 3551 v1 = 1; |
3552 } | |
832 | 3553 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Íàíÿòü |
972 | 3554 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); |
0 | 3555 } |
3556 | |
3557 // F8B19C: using guessed type int dword_F8B19C; | |
3558 | |
3559 //----- (004B3FE5) -------------------------------------------------------- | |
3560 void __fastcall sub_4B3FE5(int a4) | |
3561 { | |
3562 int v1; // edi@1 | |
3563 char *v2; // edi@1 | |
1411 | 3564 |
3565 __debugbreak(); | |
0 | 3566 v1 = a4; |
3567 uDialogueType = 78; | |
827 | 3568 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; |
0 | 3569 _4B254D_SkillMasteryTeacher(a4); |
3570 pDialogueWindow->Release(); | |
3571 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); | |
3572 v2 = ""; | |
832 | 3573 pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, |
948 | 3574 pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
832 | 3575 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); |
484 | 3576 if ( contract_approved ) |
0 | 3577 v2 = pGlobalTXT_LocalizationStrings[535]; |
832 | 3578 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0); |
972 | 3579 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
747 | 3580 dialog_menu_id = HOUSE_DIALOGUE_OTHER; |
0 | 3581 } |
3582 // F8B19C: using guessed type int dword_F8B19C; | |
3583 // F8B1A8: using guessed type int dword_F8B1A8; | |
3584 | |
3585 //----- (004B46A5) -------------------------------------------------------- | |
1006 | 3586 void __fastcall DrawTextAtStatusBar( const char *Str, int a5 ) |
1411 | 3587 { |
0 | 3588 int v4; // eax@1 |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
470
diff
changeset
|
3589 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
1006 | 3590 v4 = pFontLucida->AlignText_Center(450, Str); |
3591 pPrimaryWindow->DrawText(pFontLucida, v4 + 11, 357, a5, Str, 0, 0, 0); | |
0 | 3592 } |
3593 | |
3594 //----- (004B46F8) -------------------------------------------------------- | |
3595 int __fastcall sub_4B46F8(int a1) | |
3596 { | |
3597 int v1; // eax@1 | |
3598 int i; // edx@1 | |
3599 | |
3600 v1 = 0; | |
3601 for ( i = 0; i < a1; ++i ) | |
3602 v1 += i + 1; | |
3603 return 1000 * v1; | |
3604 } | |
3605 | |
3606 //----- (004BC49B) -------------------------------------------------------- | |
651 | 3607 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType) |
652 | 3608 { |
656 | 3609 //unsigned int v1; // esi@1 |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3610 NPCData *speakingNPC; // ebp@1 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3611 //unsigned int v3; // eax@1 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3612 int npc_event_id; // ecx@10 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3613 signed int v5; // edi@14 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3614 char *v6; // esi@15 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3615 const char *v7; // ecx@22 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3616 signed int v8; // edi@37 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3617 //unsigned int v9; // eax@56 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3618 unsigned int v10; // ecx@57 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3619 void *v11; // [sp-Ch] [bp-1Ch]@46 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3620 int v12; // [sp-8h] [bp-18h]@46 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3621 char *v13; // [sp-8h] [bp-18h]@60 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3622 size_t v14; // [sp-4h] [bp-14h]@46 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3623 const char *v15; // [sp-4h] [bp-14h]@60 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3624 |
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3625 //v1 = _this; |
656 | 3626 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
3627 //v3 = v1; |
656 | 3628 uDialogueType = newDialogueType; |
3629 if (!speakingNPC->uFlags) | |
3630 { | |
3631 speakingNPC->uFlags = 1; | |
3632 //v3 = uDialogueType; | |
3633 } | |
3634 | |
3635 if(newDialogueType == DIALOGUE_PROFESSION_DETAILS) | |
3636 { | |
3637 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
3638 } | |
3639 else if(newDialogueType == DIALOGUE_76) | |
3640 { | |
3641 if (speakingNPC->Hired()) | |
3642 { | |
3643 v8 = 0; | |
3644 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
3645 { | |
3646 v6 = (char *)pNPCStats->pNewNPCData; | |
3647 while ( !(v6[8] & 0x80) || strcmp(speakingNPC->pName, *(const char **)v6) ) | |
3648 { | |
3649 ++v8; | |
3650 v6 += 76; | |
3651 if ( v8 >= (signed int)pNPCStats->uNumNewNPCs ) | |
3652 break; | |
3653 } | |
3654 if( v8 < (signed int)pNPCStats->uNumNewNPCs ) | |
3655 v6[8] &= 0x7Fu; | |
3656 } | |
1104 | 3657 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) |
656 | 3658 { |
3659 v11 = pParty->pHirelings; | |
3660 memset(v11, 0, sizeof(NPCData)); | |
3661 } | |
1104 | 3662 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) |
656 | 3663 { |
3664 v11 = &pParty->pHirelings[1]; | |
3665 memset(v11, 0, sizeof(NPCData)); | |
3666 } | |
3667 pParty->field_709 = 0; | |
1035 | 3668 pParty->CountHirelings(); |
656 | 3669 dword_591084 = 0; |
3670 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3671 dword_7241C8 = 0; | |
3672 return; | |
3673 } | |
3674 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName ) | |
3675 { | |
3676 v7 = pGlobalTXT_LocalizationStrings[533]; // ""I cannot join you, you're party is full"" | |
3677 ShowStatusBarString(v7, 2u); | |
3678 } | |
3679 else | |
3680 { | |
3681 //v9 = v2->uProfession; | |
3682 if ( speakingNPC->uProfession != 51 ) | |
3683 { | |
3684 v10 = pNPCStats->pProfessions[speakingNPC->uProfession - 1].uHirePrice; | |
3685 if ( pParty->uNumGold < v10 ) | |
3686 { | |
3687 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" | |
3688 dialogue_show_profession_details = false; | |
3689 uDialogueType = 13; | |
3690 if ( uActiveCharacter ) | |
3691 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
3692 v7 = pGlobalTXT_LocalizationStrings[155]; | |
3693 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | |
3694 if ( !dword_7241C8 ) | |
3695 pGame->Draw(); | |
3696 dword_7241C8 = 0; | |
3697 return; | |
3698 } | |
3699 Party::TakeGold(v10); | |
3700 } | |
3701 LOBYTE(speakingNPC->uFlags) |= 0x80u; | |
3702 if ( pParty->pHirelings[0].pName ) | |
3703 { | |
3704 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1])); | |
3705 v15 = speakingNPC->pName; | |
3706 v13 = pParty->pHireling2Name; | |
3707 } | |
3708 else | |
3709 { | |
3710 memcpy(pParty->pHirelings, speakingNPC, 0x4Cu); | |
3711 v15 = speakingNPC->pName; | |
3712 v13 = pParty->pHireling1Name; | |
3713 } | |
3714 strcpy(v13, v15); | |
3715 pParty->field_709 = 0; | |
1035 | 3716 pParty->CountHirelings(); |
656 | 3717 |
3718 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3719 | |
711 | 3720 if ( sDialogue_SpeakingActorNPC_ID >= 0 ) |
656 | 3721 pDialogue_SpeakingActor->uAIState = Removed; |
3722 if ( uActiveCharacter ) | |
3723 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); | |
3724 } | |
3725 } | |
3726 else if ( (signed int)newDialogueType > 84 && (signed int)newDialogueType <= 88 ) | |
3727 { | |
3728 ArenaFight(); | |
3729 return; | |
3730 } | |
1413 | 3731 else if(newDialogueType == DIALOGUE_USE_NPC_ABILITY) |
656 | 3732 { |
1413 | 3733 if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0) |
656 | 3734 { |
1413 | 3735 if ( speakingNPC->uProfession != GateMaster ) |
656 | 3736 speakingNPC->bHasUsedTheAbility = 1; |
3737 | |
3738 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3739 } | |
3740 else | |
1413 | 3741 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!" |
656 | 3742 } |
3743 else if(newDialogueType == DIALOGUE_13) | |
3744 { | |
3745 if (!speakingNPC->Hired()) | |
3746 { | |
3747 sub_4B3E1E(); | |
3748 dialogue_show_profession_details = false; | |
3749 } | |
3750 else | |
3751 { | |
3752 v5 = 0; | |
3753 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
3754 { | |
3755 v6 = (char *)pNPCStats->pNewNPCData; | |
3756 while ( !(v6[8] & 0x80) || strcmp(speakingNPC->pName, *(const char **)v6) ) | |
3757 { | |
3758 ++v5; | |
3759 v6 += 76; | |
3760 if ( v5 >= (signed int)pNPCStats->uNumNewNPCs ) | |
3761 break; | |
3762 } | |
3763 if ( v5 < (signed int)pNPCStats->uNumNewNPCs ) | |
3764 v6[8] &= 0x7Fu; | |
3765 } | |
1104 | 3766 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) |
656 | 3767 { |
3768 v11 = pParty->pHirelings; | |
3769 memset(v11, 0, sizeof(NPCData)); | |
3770 } | |
1104 | 3771 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) |
656 | 3772 { |
3773 v11 = &pParty->pHirelings[1]; | |
3774 memset(v11, 0, sizeof(NPCData)); | |
3775 } | |
3776 pParty->field_709 = 0; | |
1035 | 3777 pParty->CountHirelings(); |
656 | 3778 dword_591084 = 0; |
3779 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3780 dword_7241C8 = 0; | |
3781 return; | |
3782 } | |
3783 } | |
3784 else if(newDialogueType >= 19 && newDialogueType <= 24) | |
3785 { | |
3786 switch(newDialogueType) | |
3787 { | |
3788 case DIALOGUE_19: npc_event_id = speakingNPC->evt_A; break; | |
3789 case DIALOGUE_20: npc_event_id = speakingNPC->evt_B; break; | |
3790 case DIALOGUE_21: npc_event_id = speakingNPC->evt_C; break; | |
3791 case DIALOGUE_22: npc_event_id = speakingNPC->evt_D; break; | |
3792 case DIALOGUE_23: npc_event_id = speakingNPC->evt_E; break; | |
3793 case DIALOGUE_24: npc_event_id = speakingNPC->evt_F; break; | |
3794 } | |
3795 if ( (npc_event_id >= 200) && (npc_event_id <= 310) ) | |
3796 sub_4B3FE5(npc_event_id); //200-310 | |
3797 else if (( npc_event_id >= 400) && (npc_event_id <= 410) ) | |
3798 { //400-410 | |
3799 dword_F8B1D8 = newDialogueType; | |
3800 DrawJoinGuildWindow(npc_event_id - 400); | |
3801 } | |
3802 else | |
3803 { | |
3804 switch ( npc_event_id ) | |
3805 { | |
3806 case 139: | |
3807 sub_4B1ECE(); | |
3808 break; | |
3809 case 311: | |
3810 sub_4BBA85_bounties(); | |
3811 break; | |
3812 case 399: | |
3813 sub_4BBCDD(); | |
3814 break; | |
3815 default: | |
3816 activeLevelDecoration = (LevelDecoration*)1; | |
827 | 3817 current_npc_text = 0; |
656 | 3818 EventProcessor(npc_event_id, 0, 1); |
3819 activeLevelDecoration = NULL; | |
3820 break; | |
3821 } | |
3822 } | |
3823 } | |
3824 if ( !dword_7241C8 ) | |
3825 pGame->Draw(); | |
3826 dword_7241C8 = 0; | |
3827 } | |
0 | 3828 |
3829 //----- (004BDAAF) -------------------------------------------------------- | |
907 | 3830 bool __fastcall MerchandiseTest(ItemGen *item, int _2da_idx) |
0 | 3831 { |
3832 int v6; // edx@8 | |
3833 int v7; // edx@9 | |
3834 int v8; // edx@10 | |
3835 unsigned __int8 v9; // zf@16 | |
3836 char v10; // sf@16 | |
3837 unsigned __int8 v11; // of@16 | |
702 | 3838 bool test; |
0 | 3839 |
907 | 3840 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771) |
3841 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->Stolen()) | |
0 | 3842 return 0; |
907 | 3843 switch( p2DEvents[_2da_idx - 1].uType ) |
3844 { | |
1411 | 3845 case BuildingType_WeaponShop: |
907 | 3846 { |
3847 test = pItemsTable->pItems[item->uItemID].uEquipType <= 2; | |
3848 break; | |
3849 } | |
1411 | 3850 case BuildingType_ArmorShop: |
907 | 3851 { |
3852 test = pItemsTable->pItems[item->uItemID].uEquipType >= 3; | |
3853 break; | |
3854 } | |
1411 | 3855 case BuildingType_MagicShop: |
907 | 3856 { |
3857 test = pItemsTable->pItems[item->uItemID].uSkillType == 38 || pItemsTable->pItems[item->uItemID].uEquipType == 16; | |
3858 break; | |
3859 } | |
1411 | 3860 case BuildingType_AlchemistShop: |
907 | 3861 { |
3862 test = pItemsTable->pItems[item->uItemID].uEquipType == 13 || pItemsTable->pItems[item->uItemID].uEquipType == 14 | |
3863 || (pItemsTable->pItems[item->uItemID].uEquipType > 14 && !(pItemsTable->pItems[item->uItemID].uEquipType != 17 | |
3864 || (signed int)item->uItemID < 740) && item->uItemID != 771); | |
3865 break; | |
3866 } | |
3867 default: | |
3868 { | |
3869 test = false; | |
3870 break; | |
3871 } | |
3872 } | |
702 | 3873 return test; |
3874 /* | |
3875 if ( p2DEvents[a2 - 1].uType == 1 ) | |
0 | 3876 { |
3877 v11 = __OFSUB__(v5, 2); | |
3878 v9 = v5 == 2; | |
3879 v10 = v5 - 2 < 0; | |
3880 goto LABEL_23; | |
3881 } | |
702 | 3882 if ( p2DEvents[a2 - 1].uType > 2 ) |
3883 { | |
3884 if ( p2DEvents[a2 - 1].uType == 3 ) | |
0 | 3885 { |
3886 if ( pItemsTable->pItems[v4].uSkillType != 38 ) | |
3887 return v5 == 16; | |
3888 return 1; | |
3889 } | |
702 | 3890 if ( p2DEvents[a2 - 1].uType != 4 || v5 < 13 ) |
0 | 3891 return 0; |
702 | 3892 if ( p2DEvents[a2 - 1].uType == 4) |
3893 { | |
3894 if ( v5 < 13 ) | |
3895 return 0; | |
3896 if ( v5 <= 14 ) | |
3897 return 1; | |
3898 if ( v5 != 17 || (signed int)v3 < 740 ) | |
3899 return 0; | |
3900 v11 = __OFSUB__(v3, 771); | |
3901 v9 = v3 == 771; | |
3902 v10 = ((v3 - 771) & 0x80000000u) != 0; | |
0 | 3903 LABEL_23: |
702 | 3904 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) |
3905 return 0; | |
3906 return 1; | |
3907 } | |
3908 } | |
3909 if ( p2DEvents[a2 - 1].uType == 2 ) | |
3910 { | |
3911 if ( v5 >= 3 ) | |
3912 { | |
3913 v11 = __OFSUB__(v5, 9); | |
3914 v9 = v5 == 9; | |
3915 v10 = v5 - 9 < 0; | |
3916 goto LABEL_23; | |
3917 } | |
0 | 3918 } |
3919 return 0; | |
702 | 3920 */ |
0 | 3921 } |
3922 | |
1209 | 3923 |
0 | 3924 |