Mercurial > mm7
annotate Arcomage.cpp @ 1197:2b950844f2d6
mostly arcomage structs renaming.
author | Gloval |
---|---|
date | Sat, 08 Jun 2013 22:41:45 +0400 |
parents | 9baf16113199 |
children | 98a70229c271 |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
4 |
0 | 5 #include <string> |
1033 | 6 #include <assert.h> |
0 | 7 |
1016 | 8 #include "LightmapBuilder.h" |
0 | 9 #include "Arcomage.h" |
10 #include "VideoPlayer.h" | |
11 #include "AudioPlayer.h" | |
12 #include "Mouse.h" | |
13 #include "Game.h" | |
14 #include "Viewport.h" | |
15 #include "Time.h" | |
16 #include "GUIFont.h" | |
17 #include "Party.h" | |
18 #include "GUIWindow.h" | |
19 #include "Events2D.h" | |
20 #include "VectorTypes.h" | |
189 | 21 #include "texts.h" |
1183 | 22 #include <windef.h> |
0 | 23 |
24 | |
25 | |
1197 | 26 void SetStartConditions(); |
27 | |
28 | |
29 void SetStartGameData(); | |
30 void FillPlayerDeck(); | |
1183 | 31 void am_40A255(); |
32 void am_40A283(int a1); | |
1185 | 33 int GetEmptyCardSlotIndex(int player_num); |
1197 | 34 void IncreaseResourcesInTurn(int player_num); |
1183 | 35 void __cdecl am_40A383(); |
1197 | 36 bool IsGameOver(); |
1183 | 37 char __thiscall am_40A560(unsigned int _this); |
1197 | 38 void DrawGameUI(int a1); // idb |
1185 | 39 void am_40AA4E(); |
1197 | 40 void DrawRectanglesForText(); |
41 void DrawPlayersText(); | |
42 void DrawPlayerLevels(int a1, char *text, POINT *pXY); // idb | |
43 void DrawBricksCount(int a1, char* text, POINT *pXY); // idb | |
44 void DrawGemsCount(int a1, char* text, POINT* pXY); | |
45 void DrawBeastsCount(int a1, char *text, POINT *pXY); // idb | |
46 void DrawPlayersTowers(); | |
47 void DrawPlayersWall(); | |
1183 | 48 void __cdecl am_40B4B9(); |
49 void __fastcall am_40B76F(int a1); | |
1185 | 50 int GetPlayerHandCardCount(int player_num); |
1183 | 51 signed int __fastcall am_40BB67(int a1); |
52 char __fastcall am_40BCFB(int a1, signed int a2); | |
1197 | 53 bool PlayCard(int player_num, signed int card_slot_num); |
54 bool CanCardBePlayed(int player_num, int hand_card_indx); | |
1183 | 55 void __fastcall am_40BF77(int a1, unsigned int uCardID); // idb |
1185 | 56 int am_40D2B4(POINT* a1, int a2); // weak |
1183 | 57 int __fastcall am_40D402(int, int); // weak |
1197 | 58 int __cdecl GameResultsApply(); |
1183 | 59 |
60 void pPrimaryWindow_draws_text(int a1, const char *pText, POINT *pXY); | |
61 void __thiscall am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb | |
62 void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4); | |
63 void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3); | |
64 void __cdecl am_EndScene(); | |
65 void __fastcall DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill); // idb | |
1185 | 66 void SetPixel(POINT *pTargetXY, unsigned __int16 uColor); |
1183 | 67 int __fastcall rand_interval(int a, int b); // idb |
68 char *__fastcall inv_strcat(const char *Source, char *Dest); | |
69 char *__fastcall inv_strcpy(const char *Source, char *Dest); | |
70 void __fastcall intToString(int val, char *pOut); | |
938 | 71 |
72 /* 388 */ | |
73 #pragma pack(push, 1) | |
1197 | 74 struct ArcomageStartConditions |
938 | 75 { |
1197 | 76 __int16 max_tower; |
77 __int16 max_resources; | |
78 __int16 tower_height; | |
79 __int16 wall_height; | |
80 __int16 quarry_level; | |
81 __int16 magic_level; | |
82 __int16 might_level; | |
83 __int16 bricks_amount; | |
84 __int16 gems_amount; | |
85 __int16 beasts_amount; | |
938 | 86 int field_14; |
87 }; | |
88 #pragma pack(pop) | |
1197 | 89 ArcomageStartConditions start_conditions[13] = |
938 | 90 { |
91 { 30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0}, | |
92 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1}, | |
93 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 2}, | |
94 { 75, 200, 25, 10, 3, 3, 3, 5, 5, 5, 2}, | |
95 { 75, 200, 20, 10, 3, 3, 3, 5, 5, 5, 1}, | |
96 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 1}, | |
97 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 2}, | |
98 {150, 400, 20, 10, 5, 5, 5, 25, 25, 25, 0}, | |
99 {200, 500, 20, 10, 1, 1, 1, 15, 15, 15, 2}, | |
100 {100, 300, 20, 50, 1, 1, 5, 5, 5, 25, 0}, | |
101 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 2}, | |
102 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 1}, | |
103 {100, 300, 50, 50, 5, 3, 5, 20, 10, 20, 0} | |
104 }; | |
105 | |
1184 | 106 #define SIG_trpg 0x67707274 |
107 #define SIG_xxxx 0x78787878 | |
0 | 108 |
109 ArcomageGame *pArcomageGame = new ArcomageGame; | |
1194 | 110 |
1183 | 111 ArcomagePlayer am_Players[2]; |
112 | |
113 Acromage_st1 struct_st1[10]; | |
0 | 114 |
1184 | 115 stru272 array_4FABD0[10]; |
935 | 116 |
1194 | 117 ArcomageDeck playDeck; |
118 | |
119 //char byte_5052A8[108]; | |
120 //int dword_505314[108]; // weak | |
121 | |
122 ArcomageDeck deckMaster; | |
123 //char byte_5054C8[32]; // idb | |
124 //char byte_5054E8[108]; | |
125 //int dword_505554[108]; | |
126 | |
127 char pArcomagePlayer2Name[]="Enemy"; | |
128 char pArcomagePlayer1Name[]="Player"; | |
129 char pDeckMaster[]="Master Deck"; | |
1186 | 130 |
0 | 131 |
132 /* 267 */ | |
133 #pragma pack(push, 1) | |
134 struct stru273 | |
135 { | |
136 bool _40DD2F(); | |
1185 | 137 bool Inside(RECT*pXYZW); |
0 | 138 |
139 int x; | |
140 int y; | |
141 char field_8; | |
142 char field_9; | |
143 char field_A; | |
144 char field_B; | |
145 }; | |
146 #pragma pack(pop) | |
147 | |
1186 | 148 |
149 | |
1185 | 150 char am_byte_4E185D; // weak |
151 | |
1197 | 152 int start_tower_height; // weak |
153 int start_wall_height; // weak | |
154 int start_quarry_level; // weak | |
155 int start_magic_level; // weak | |
156 int start_might_level; // weak | |
1185 | 157 |
1183 | 158 |
159 int dword_4E1874 = 5; // weak | |
1197 | 160 int quarry_bonus = 1; // weak |
161 int magic_bonus = 1; // weak | |
162 int might_bonus = 1; // weak | |
163 | |
164 int max_tower_height = 50; // weak | |
165 int max_resources_amount = 100 ; // weak | |
1185 | 166 |
167 int dword_4DF3A4; // weak | |
168 | |
169 char byte_4FAA2C; // weak | |
1186 | 170 char byte_4FAA2D; // weak |
171 | |
1197 | 172 int current_player_num; // idb |
1185 | 173 char am_byte_4FAA77; // weak |
174 | |
1186 | 175 signed int dword_4FABBC; // idb |
1185 | 176 unsigned int amuint_4FABC0; // idb |
0 | 177 |
1186 | 178 int dword_4FABC8; // weak |
0 | 179 |
1197 | 180 int start_bricks_amount; // weak |
181 int start_gems_amount; // weak | |
182 int start_beasts_amount; // weak | |
183 | |
0 | 184 |
185 //----- (0040DD2F) -------------------------------------------------------- | |
186 bool stru273::_40DD2F() | |
187 { | |
188 | |
189 this->x = pArcomageGame->mouse_x; | |
190 this->y = pArcomageGame->mouse_y; | |
191 this->field_8 = pArcomageGame->mouse_left; | |
192 this->field_9 = pArcomageGame->mouse_left == pArcomageGame->field_F7; | |
1185 | 193 this->field_A = pArcomageGame->mouse_right; |
0 | 194 this->field_B = pArcomageGame->mouse_right == pArcomageGame->field_F8; |
195 pArcomageGame->field_F7 = pArcomageGame->mouse_left; | |
196 pArcomageGame->field_F8 = pArcomageGame->mouse_right; | |
1183 | 197 return true; |
0 | 198 } |
199 | |
200 //----- (0040DD93) -------------------------------------------------------- | |
1185 | 201 bool stru273::Inside(RECT*pXYZW ) |
202 { | |
203 | |
204 return (x >= pXYZW->left) && (x <= pXYZW->right) && | |
205 (y>= pXYZW->top) && (y <= pXYZW->bottom); | |
0 | 206 } |
207 | |
1184 | 208 //----- (0040DFD1) -------------------------------------------------------- |
209 void stru272_stru0::_40DFD1(stru272_stru0 *a1) | |
210 { | |
211 stru272_stru0 *v2; // eax@1 | |
212 v2 = (stru272_stru0 *)malloc(0x5Cu); | |
213 a1 = v2; | |
214 v2->signature = SIG_trpg; | |
215 v2->field_8 = 0; | |
216 v2->field_30 = 0.0; | |
217 v2->field_58 = 0; | |
218 v2->field_59 = 0; | |
219 } | |
220 | |
221 //----- (0040DFFE) -------------------------------------------------------- | |
222 int stru272_stru0::_40DFFE() | |
223 { | |
224 | |
225 if ( this->signature == SIG_trpg ) | |
226 { | |
227 this->signature = SIG_xxxx; | |
228 free(this); | |
229 return 0; | |
230 } | |
231 else | |
232 return 2; | |
233 | |
234 } | |
235 | |
236 //----- (0040E01A) -------------------------------------------------------- | |
1186 | 237 int stru272_stru0::_40E01A( stru272_stru2* a2 ) |
1184 | 238 { |
239 auto a1 = this; | |
240 if ( a1->signature == SIG_trpg ) | |
241 { | |
1186 | 242 a1->field_4 = a2->field_20; |
243 a1->field_C = a2->field_0 << 16; | |
244 a1->field_10 = a2->field_4 << 16; | |
245 a1->field_14 = a2->field_8 << 16; | |
246 a1->field_18 = a2->field_C << 16; | |
247 a1->field_1C = a2->field_10; | |
248 a1->field_20 = a2->field_14; | |
249 a1->field_24 = a2->field_18; | |
250 a1->field_28 = (float)(a2->field_1Cf * 65536.0); | |
251 a1->field_2C = a2->field_24f; | |
252 a1->field_34 = (int)(a2->field_28f * 65536.0); | |
253 a1->field_38 = (int)(a2->field_2Cf * 65536.0); | |
254 a1->field_3C = a2->field_30; | |
255 a1->field_40 = a2->field_34; | |
256 a1->field_54 = a2->field_38; | |
1184 | 257 a1->field_59 = 1; |
1186 | 258 |
1185 | 259 return 0; |
1184 | 260 } |
261 else | |
1185 | 262 return 2; |
1184 | 263 } |
264 | |
265 //----- (0040E0F5) -------------------------------------------------------- | |
266 int stru272_stru0::_40E0F5(char a2, char a3) | |
267 { | |
1185 | 268 if ( signature == SIG_trpg) |
1184 | 269 { |
270 if ( a2 ) | |
271 { | |
1185 | 272 field_8 = 0; |
273 field_30 = 0.0; | |
1184 | 274 } |
1185 | 275 if ( field_59 && a3 ) |
1184 | 276 { |
1185 | 277 |
278 for (int i=0; i<field_4; ++i) | |
279 field_54[i].field_0 = 0; | |
280 field_58 = 0; | |
1184 | 281 } |
1185 | 282 return 0; |
1184 | 283 } |
284 else | |
1185 | 285 return 2; |
1184 | 286 } |
287 | |
288 //----- (0040E133) -------------------------------------------------------- | |
289 int stru272_stru0::_40E133() | |
290 { | |
1186 | 291 |
1184 | 292 stru272_stru0 *v1; // edi@1 |
293 int v3; // ST18_4@3 | |
294 double v4; // st7@3 | |
295 double v5; // st6@4 | |
296 char v6; // bl@8 | |
1186 | 297 stru272_stru1 *v7; // esi@8 |
1184 | 298 int v8; // ecx@10 |
299 signed int v9; // eax@10 | |
300 int v10; // ecx@10 | |
301 signed int v11; // eax@10 | |
1186 | 302 int v12; // ebx@12 |
303 int v13; // ST1C_4@12 | |
304 int v14; // ebx@12 | |
305 int v15; // ST1C_4@12 | |
306 signed int v16; // edx@12 | |
307 int v17; // ebx@12 | |
308 int v18; // ST1C_4@12 | |
309 signed int v19; // edx@12 | |
310 int v20; // [sp+8h] [bp-10h]@8 | |
311 int v21; // [sp+Ch] [bp-Ch]@8 | |
312 float v22; // [sp+14h] [bp-4h]@3 | |
1184 | 313 |
314 v1 = this; | |
315 if ( this->signature != SIG_trpg ) | |
316 return 2; | |
317 v3 = this->field_8; | |
1186 | 318 v22 = this->field_30; |
319 v4 = v3; | |
1184 | 320 if ( v3 > 0 ) |
321 { | |
1186 | 322 v5 = v22 + this->field_2C; |
323 v22 = v5; | |
1184 | 324 if ( v5 > v4 ) |
1186 | 325 v22 = v4; |
1184 | 326 } |
1186 | 327 if ( v22 >= 1.0 || this->field_58 ) |
1184 | 328 { |
329 v6 = 0; | |
1186 | 330 v7 = this->field_54; |
331 v20 = this->field_28; | |
332 v21 = this->field_4; | |
333 while ( v7->field_0 <= 0 ) | |
1184 | 334 { |
1186 | 335 if ( v22 >= 1.0 ) |
1184 | 336 { |
1186 | 337 v12 = v1->field_40; |
338 v13 = v1->field_3C; | |
339 v7->field_0 = v13 + rand() % (v12 - v13 + 1); | |
340 v7->field_14 = (rand() % 17 - 8) << 16; | |
341 v7->field_18 = (rand() % 17 - 8) << 16; | |
342 v14 = v1->field_14 - 1; | |
343 v15 = v1->field_C; | |
344 v16 = v15 + rand() % (v14 - v15 + 1); | |
345 v7->field_C = v16; | |
346 v7->field_4.x = v16 >> 16; | |
347 | |
348 v17 = v1->field_18 - 1; | |
349 v18 = v1->field_10; | |
350 v22 = v22 - 1.0; | |
351 v19 = v18 + rand() % (v17 - v18 + 1); | |
352 v7->field_10 = v19; | |
353 v7->field_4.y = v19 >> 16; | |
1184 | 354 --v1->field_8; |
355 goto LABEL_13; | |
356 } | |
357 LABEL_14: | |
1186 | 358 ++v7; |
359 --v21; | |
360 if ( !v21 ) | |
1184 | 361 { |
362 v1->field_58 = v6; | |
1186 | 363 v1->field_30 = v22; |
1184 | 364 return 0; |
365 } | |
366 } | |
1186 | 367 v8 = v7->field_14; |
368 --v7->field_0; | |
369 v9 = v8 + v7->field_C; | |
370 | |
371 v10 = v20 + v7->field_18; | |
372 v7->field_C = v9; | |
373 v7->field_4.x = v9 >> 16; | |
374 | |
375 v11 = v10 + v7->field_10; | |
376 v7->field_18 = v10; | |
377 v7->field_10 = v11; | |
378 v7->field_4.y = v11 >> 16; | |
1184 | 379 LABEL_13: |
380 v6 = 1; | |
381 goto LABEL_14; | |
382 } | |
383 return 0; | |
384 } | |
385 | |
386 //----- (0040E2A7) -------------------------------------------------------- | |
387 int stru272_stru0::_40E2A7() | |
388 { | |
1185 | 389 |
390 if (signature == SIG_trpg ) | |
1184 | 391 { |
1185 | 392 if ( field_8 <= 0 ) |
393 return field_58 != 0 ? 2 : 0; | |
1184 | 394 else |
1185 | 395 return 1; |
1184 | 396 } |
397 else | |
1185 | 398 return 3; |
1184 | 399 } |
0 | 400 |
401 | |
402 //----- (0040DFAF) -------------------------------------------------------- | |
403 void ArcomageGame::OnMouseClick(char right_left, bool bDown) | |
404 { | |
405 if ( right_left ) | |
406 pArcomageGame->mouse_right = bDown; | |
407 else | |
408 pArcomageGame->mouse_left = bDown; | |
409 } | |
410 | |
411 //----- (0040DFC1) -------------------------------------------------------- | |
412 void ArcomageGame::OnMouseMove(POINT *pXY) | |
413 { | |
414 pArcomageGame->mouse_x = pXY->x; | |
415 pArcomageGame->mouse_y = pXY->y; | |
416 } | |
417 | |
418 | |
419 //----- (0040DF47) -------------------------------------------------------- | |
420 void DoBlt_Copy(unsigned __int16 *pPixels) | |
421 { | |
1183 | 422 RECT pSrcRect; |
423 POINT pTargetPoint; // [sp+1Ch] [bp-8h]@1 | |
424 | |
0 | 425 pRenderer->Present(); |
1183 | 426 |
427 pTargetPoint.x = 0; | |
428 pTargetPoint.y = 0; | |
429 | |
430 pSrcRect.left = 0; | |
431 pSrcRect.right = 640; | |
432 pSrcRect.top = 0; | |
433 pSrcRect.bottom = 480; | |
434 | |
0 | 435 pRenderer->BeginScene(); |
1183 | 436 pArcomageGame->pBlit_Copy_pixels = pPixels; |
437 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
0 | 438 pRenderer->EndScene(); |
439 pArcomageGame->pBlit_Copy_pixels = 0; | |
440 } | |
441 | |
442 //----- (0040DDC9) -------------------------------------------------------- | |
1183 | 443 void ArcomageGame::PlaySound( unsigned int event_id ) |
444 { | |
445 SoundID play_sound_id; // eax@10 | |
446 | |
447 switch ( event_id ) | |
448 { | |
449 case 40: | |
450 case 43: | |
451 case 46: | |
452 play_sound_id = SOUND_Arcomage_LoseResources; | |
453 break; | |
454 case 39: | |
455 case 41: | |
456 case 42: | |
457 case 44: | |
458 case 45: | |
459 case 47: | |
460 play_sound_id = SOUND_Arcomage_AddResources; | |
461 break; | |
462 case 0: | |
463 case 12: | |
464 case 14: | |
465 case 15: | |
466 case 16: | |
467 case 48: | |
468 case 50: | |
469 case 53: | |
470 play_sound_id = SOUND_Arcomage_TowerWallDamage; | |
471 break; | |
472 case 21: | |
473 case 22: | |
474 case 23: | |
475 play_sound_id = SOUND_Arcomage_DrawCard; | |
476 break; | |
477 case 56: | |
478 play_sound_id = SOUND_Arcomage_124; | |
0 | 479 break; |
1183 | 480 case 31: |
481 case 34: | |
482 case 37: | |
483 play_sound_id = SOUND_Arcomage_ProductionDamage; | |
484 break; | |
485 case 1: | |
486 case 30: | |
487 case 32: | |
488 case 33: | |
489 case 35: | |
490 case 36: | |
491 case 38: | |
492 play_sound_id = SOUND_Arcomage_ProductionUpgrade; | |
493 break; | |
494 case 20: | |
495 play_sound_id = SOUND_Arcomage_127; | |
496 break; | |
497 case 3: | |
498 play_sound_id = SOUND_Arcomage_128; | |
499 break; | |
500 case 52: | |
501 case 54: | |
502 play_sound_id = SOUND_Arcomage_TowerUpgrade; | |
503 break; | |
504 case 10: | |
505 case 11: | |
506 case 13: | |
507 play_sound_id = SOUND_Arcomage_130; | |
508 break; | |
509 case 55u: | |
510 play_sound_id = SOUND_Arcomage_131; | |
511 break; | |
512 case 49: | |
513 case 51: | |
514 play_sound_id = SOUND_Arcomage_WallUpgrade; | |
515 break; | |
516 default: | |
0 | 517 return; |
1183 | 518 } |
519 pAudioPlayer->PlaySound(play_sound_id, 0, 0, -1, 0, 0, 0, 0); | |
0 | 520 } |
521 | |
522 //----- (0040DC2D) -------------------------------------------------------- | |
523 bool ArcomageGame::MsgLoop(int a1, ArcomageGame_stru1 *a2) | |
524 { | |
525 void *v2; // ebp@1 | |
526 BOOL v3; // eax@1 | |
1183 | 527 //int v4; // edx@6 |
528 //int v5; // edx@6 | |
529 //int v6; // eax@6 | |
530 //int v7; // edx@7 | |
0 | 531 |
532 v2 = a2; | |
533 pArcomageGame->field_0 = 0; | |
534 pArcomageGame->stru1.field_0 = 0; | |
535 v3 = PeekMessageA(&pArcomageGame->msg, 0, 0, 0, PM_REMOVE); | |
536 if ( pArcomageGame->msg.message == WM_QUIT ) | |
537 Game_DeinitializeAndTerminate(0); | |
538 if ( v3 > 0 ) | |
539 { | |
540 TranslateMessage(&pArcomageGame->msg); | |
541 DispatchMessageA(&pArcomageGame->msg); | |
542 } | |
1038 | 543 /*if (pAsyncMouse) |
0 | 544 { |
545 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse); | |
546 v4 = *((unsigned int *)pAsyncMouse + 7); | |
547 pArcomageGame->mouse_x = *((unsigned int *)pAsyncMouse + 6); | |
548 pArcomageGame->mouse_y = v4; | |
549 v5 = *((unsigned int *)pAsyncMouse + 27); | |
550 v6 = *(unsigned int *)v5; | |
551 if ( *(unsigned int *)v5 != v5 ) | |
552 { | |
553 do | |
554 { | |
555 v7 = *(unsigned int *)(v6 + 20); | |
556 if ( v7 & 1 ) | |
557 { | |
558 pArcomageGame->stru1.field_0 = 7; | |
559 } | |
560 else | |
561 { | |
562 if ( v7 & 2 ) | |
563 pArcomageGame->stru1.field_0 = 8; | |
564 } | |
565 v6 = *(unsigned int *)v6; | |
566 } | |
567 while ( v6 != *((unsigned int *)pAsyncMouse + 27) ); | |
568 } | |
569 pAsyncMouse->_46B944(); | |
570 if ( !*((unsigned char *)pAsyncMouse + 90) ) | |
571 pArcomageGame->field_F6 = 1; | |
572 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse); | |
1038 | 573 }*/ |
0 | 574 memcpy(v2, &pArcomageGame->stru1, 0xCu); |
575 return pArcomageGame->stru1.field_0 != 0; | |
576 } | |
577 | |
578 | |
579 //----- (0040D7D5) -------------------------------------------------------- | |
580 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3) | |
581 { | |
582 pRenderer->BeginScene(); | |
1183 | 583 pArcomageGame->pBlit_Copy_pixels = pPcxPixels; |
0 | 584 } |
585 | |
586 //----- (0040D7EC) -------------------------------------------------------- | |
1183 | 587 void __fastcall Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode) |
0 | 588 { |
1183 | 589 |
590 unsigned __int16 *pSrc; // eax@2 | |
591 unsigned __int16 *dest_surf_pos; // edi@3 | |
592 int uSrcTotalWidth; // ecx@4 | |
593 unsigned int v10; // esi@9 | |
594 int v21; // [sp+Ch] [bp-18h]@8 | |
595 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9 | |
596 __int32 src_width; // [sp+14h] [bp-10h]@3 | |
597 __int32 src_height; // [sp+18h] [bp-Ch]@3 | |
598 int uSrcPitch; // [sp+1Ch] [bp-8h]@5 | |
599 | |
600 | |
601 if ( !pRenderer->uNumSceneBegins ) | |
602 return; | |
603 if ( !pArcomageGame->pBlit_Copy_pixels ) | |
0 | 604 return; |
1183 | 605 |
606 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch]; | |
607 src_width = pSrcRect->right - pSrcRect->left; | |
608 src_height = pSrcRect->bottom - pSrcRect->top; | |
609 | |
610 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels ) | |
611 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth; | |
612 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels ) | |
613 uSrcTotalWidth = pArcomageGame->pSprites.uWidth; | |
614 | |
615 //v20 = 157; | |
616 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp"; | |
617 //v21 = &v18; | |
618 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a); | |
619 //466D09_xcpt_string(&v21, v18, v19, v20); | |
620 //pSrc = pArcomageGame.pBlit_Copy_pixels; | |
621 //LABEL_9: | |
622 pSrc = pArcomageGame->pBlit_Copy_pixels; | |
623 uSrcPitch = uSrcTotalWidth; | |
624 | |
625 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top]; | |
626 v10 = 0xFFu >> (8 - (unsigned __int8)pRenderer->uTargetBBits); | |
627 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF); | |
628 | |
629 | |
630 if ( blend_mode == 2 ) | |
0 | 631 { |
1194 | 632 uSrcPitch = (uSrcPitch - src_width); |
1183 | 633 for (int i=0; i< src_height; ++i) |
634 { | |
635 for (int j=0; j< src_width; ++j) | |
636 { | |
637 if ( *src_surf_pos != v10 ) | |
638 *dest_surf_pos = *src_surf_pos; | |
639 ++dest_surf_pos; | |
640 ++src_surf_pos; | |
641 } | |
642 src_surf_pos+=uSrcPitch; | |
643 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
644 } | |
0 | 645 } |
1183 | 646 else |
0 | 647 { |
1194 | 648 uSrcPitch = (uSrcPitch - src_width); |
1183 | 649 for (int i=0; i< src_height; ++i) |
0 | 650 { |
1183 | 651 for (int j=0; j< src_width; ++j) |
0 | 652 { |
1183 | 653 if ( *src_surf_pos != v10 ) |
654 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1)); | |
655 ++dest_surf_pos; | |
656 ++src_surf_pos; | |
0 | 657 } |
1183 | 658 src_surf_pos+=uSrcPitch; |
659 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
0 | 660 } |
661 } | |
1183 | 662 |
0 | 663 } |
664 | |
665 //----- (0040D9B1) -------------------------------------------------------- | |
1183 | 666 void Blt_Copy( RECT *pSrcRect, POINT *pTargetPoint, int blend_mode ) |
0 | 667 { |
1183 | 668 |
669 unsigned __int16 *pSrc; // eax@2 | |
670 unsigned __int16 *dest_surf_pos; // edi@3 | |
671 int uSrcTotalWidth; // ecx@4 | |
672 int v21; // [sp+Ch] [bp-18h]@8 | |
673 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9 | |
674 __int32 src_width; // [sp+14h] [bp-10h]@3 | |
675 __int32 src_height; // [sp+18h] [bp-Ch]@3 | |
676 int uSrcPitch; // [sp+1Ch] [bp-8h]@5 | |
677 | |
678 if ( !pRenderer->uNumSceneBegins ) | |
679 return; | |
680 if ( !pArcomageGame->pBlit_Copy_pixels ) | |
681 return; | |
682 | |
683 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch]; | |
684 src_width = pSrcRect->right - pSrcRect->left; | |
685 src_height = pSrcRect->bottom - pSrcRect->top; | |
686 | |
687 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels ) | |
688 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth; | |
689 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels ) | |
690 uSrcTotalWidth = pArcomageGame->pSprites.uWidth; | |
691 | |
692 //v20 = 157; | |
693 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp"; | |
694 //v21 = &v18; | |
695 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a); | |
696 //466D09_xcpt_string(&v21, v18, v19, v20); | |
697 //pSrc = pArcomageGame.pBlit_Copy_pixels; | |
698 //LABEL_9: | |
699 pSrc = pArcomageGame->pBlit_Copy_pixels; | |
700 uSrcPitch = uSrcTotalWidth; | |
701 | |
702 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top]; | |
703 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF); | |
704 | |
705 if ( blend_mode == 2 ) | |
0 | 706 { |
1194 | 707 uSrcPitch = (uSrcPitch - src_width); |
1183 | 708 for (int i=0; i< src_height; ++i) |
709 { | |
710 for (int j=0; j< src_width; ++j) | |
711 { | |
712 *dest_surf_pos = *src_surf_pos; | |
713 ++dest_surf_pos; | |
714 ++src_surf_pos; | |
715 } | |
716 src_surf_pos+=uSrcPitch; | |
717 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
718 } | |
0 | 719 } |
1183 | 720 else |
0 | 721 { |
1194 | 722 uSrcPitch = (uSrcPitch - src_width); |
1183 | 723 for (int i=0; i< src_height; ++i) |
0 | 724 { |
1183 | 725 for (int j=0; j< src_width; ++j) |
726 { | |
727 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1)); | |
728 ++dest_surf_pos; | |
729 ++src_surf_pos; | |
730 } | |
731 src_surf_pos+=uSrcPitch; | |
732 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
0 | 733 } |
734 } | |
735 } | |
736 | |
737 //----- (0040DB10) -------------------------------------------------------- | |
1183 | 738 void am_EndScene() |
0 | 739 { |
740 pRenderer->EndScene(); | |
1183 | 741 pArcomageGame->pBlit_Copy_pixels = NULL; |
0 | 742 } |
743 | |
744 //----- (0040D7B7) -------------------------------------------------------- | |
745 bool ArcomageGame::LoadSprites() | |
746 { | |
747 pArcomageGame->pSprites.Load("sprites.pcx", 2); | |
748 pArcomageGame->pSpritesPixels = pArcomageGame->pSprites.pPixels; | |
1183 | 749 return true; |
0 | 750 } |
751 | |
752 //----- (0040D799) -------------------------------------------------------- | |
753 bool ArcomageGame::LoadBackground() | |
754 { | |
755 pArcomageGame->pGameBackground.Load("layout.pcx", 2); | |
756 pArcomageGame->pBackgroundPixels = pArcomageGame->pGameBackground.pPixels; | |
1183 | 757 return true; |
0 | 758 } |
759 | |
760 //----- (00408BB4) -------------------------------------------------------- | |
761 bool __fastcall am_408BB4(int a1) | |
762 { | |
1183 | 763 // char result; // al@3 |
764 // signed int v3; // ebx@8 | |
765 // int v4; // esi@8 | |
766 // int v5; // eax@9 | |
767 // int v6; // edi@9 | |
768 // int v7; // eax@11 | |
769 // signed int v8; // eax@11 | |
770 // int v9; // ebx@5 | |
771 // int v10; // eax@5 | |
772 // int v11; // ecx@18 | |
773 // char v12; // bl@20 | |
774 // int v13; // eax@20 | |
775 // ArcomageCard *v14; // ecx@20 | |
776 // char v15; // dl@20 | |
777 // char v16; // dl@24 | |
778 // int v17; // edx@25 | |
779 // int v18; // edx@27 | |
780 // char v19; // dl@31 | |
781 // int v20; // edx@32 | |
782 // char v21; // dl@35 | |
783 // char v22; // dl@39 | |
784 // int v23; // edx@40 | |
785 // char v24; // dl@45 | |
786 // int v25; // edx@46 | |
787 // char v26; // dl@52 | |
788 // int v27; // edx@53 | |
789 // char v28; // dl@58 | |
790 // int v29; // edx@59 | |
791 // char v30; // dl@64 | |
792 // int v31; // edx@65 | |
793 // char v32; // dl@70 | |
794 // int v33; // edx@71 | |
795 // char v34; // dl@76 | |
796 // int v35; // edx@77 | |
797 // char v36; // dl@82 | |
798 // int v37; // edx@83 | |
799 // char v38; // dl@86 | |
800 // char v39; // dl@90 | |
801 // int v40; // edi@93 | |
802 // char v41; // dl@93 | |
803 // int v42; // esi@93 | |
804 // char v43; // bl@94 | |
805 // int v44; // esi@95 | |
806 // char v45; // dl@99 | |
807 // char v46; // dl@103 | |
808 // char v47; // dl@107 | |
809 // char v48; // dl@111 | |
810 // char v49; // dl@115 | |
811 // ArcomagePlayer *v50; // ebx@116 | |
812 // ArcomagePlayer *v51; // edx@116 | |
813 // int v52; // esi@124 | |
814 // int v53; // edx@124 | |
815 // int v54; // edx@127 | |
816 // int v55; // esi@130 | |
817 // int v56; // edi@138 | |
818 // int l; // esi@138 | |
819 // int v58; // eax@140 | |
820 // int v59; // ecx@142 | |
821 // int v60; // edx@142 | |
822 // int v61; // ebx@142 | |
823 // int v62; // eax@145 | |
824 // int v63; // esi@146 | |
825 // int v64; // ebx@4 | |
826 // int v65; // eax@4 | |
827 // int v66; // ecx@168 | |
828 // char v67; // bl@170 | |
829 // int v68; // eax@170 | |
830 // ArcomageCard *v69; // ecx@170 | |
831 // char v70; // dl@170 | |
832 // char v71; // dl@174 | |
833 // int v72; // edx@175 | |
834 // int v73; // edx@177 | |
835 // char v74; // dl@181 | |
836 // char v75; // dl@184 | |
837 // char v76; // dl@188 | |
838 // int v77; // edx@189 | |
839 // char v78; // dl@194 | |
840 // char v79; // dl@200 | |
841 // int v80; // edx@201 | |
842 // char v81; // dl@206 | |
843 // int v82; // edx@207 | |
844 // char v83; // dl@212 | |
845 // int v84; // edx@213 | |
846 // char v85; // dl@218 | |
847 // int v86; // edx@219 | |
848 // char v87; // dl@224 | |
849 // int v88; // edx@225 | |
850 // char v89; // dl@230 | |
851 // int v90; // edx@231 | |
852 // char v91; // dl@234 | |
853 // int v92; // edx@235 | |
854 // char v93; // dl@238 | |
855 // int v94; // edx@239 | |
856 // int v95; // esi@241 | |
857 // char v96; // dl@241 | |
858 // int v97; // esi@241 | |
859 // char v98; // bl@242 | |
860 // int v99; // edi@243 | |
861 // int v100; // edx@245 | |
862 // int v101; // edi@246 | |
863 // char v102; // dl@247 | |
864 // int v103; // edx@248 | |
865 // char v104; // dl@251 | |
866 // int v105; // edx@252 | |
867 // char v106; // dl@255 | |
868 // int v107; // edx@256 | |
869 // char v108; // dl@259 | |
870 // int v109; // edx@260 | |
871 // char v110; // dl@263 | |
872 // ArcomagePlayer *v111; // ebx@264 | |
873 // ArcomagePlayer *v112; // edx@264 | |
874 // int v113; // esi@272 | |
875 // int v114; // edx@272 | |
876 // int v115; // edx@275 | |
877 // int v116; // esi@278 | |
878 // int v117; // edi@286 | |
879 // int j; // esi@286 | |
880 // int v119; // eax@288 | |
881 // int v120; // ecx@290 | |
882 // int v121; // edx@290 | |
883 // int v122; // ebx@290 | |
884 // int v123; // eax@293 | |
885 // int v124; // esi@294 | |
886 // int v125; // [sp-28h] [bp-28h]@130 | |
887 // int v126; // [sp-28h] [bp-28h]@278 | |
888 // int k; // [sp-24h] [bp-24h]@18 | |
889 // int i; // [sp-24h] [bp-24h]@168 | |
890 // int v129; // [sp-20h] [bp-20h]@5 | |
891 // int v130; // [sp-20h] [bp-20h]@4 | |
892 // int v131; // [sp-1Ch] [bp-1Ch]@17 | |
893 // int v132; // [sp-1Ch] [bp-1Ch]@140 | |
894 // int v133; // [sp-1Ch] [bp-1Ch]@167 | |
895 // int v134; // [sp-1Ch] [bp-1Ch]@288 | |
896 // int v135; // [sp-18h] [bp-18h]@5 | |
897 // int v136; // [sp-18h] [bp-18h]@4 | |
898 // signed int v137; // [sp-14h] [bp-14h]@0 | |
899 // int v138; // [sp-14h] [bp-14h]@93 | |
900 // int v139; // [sp-14h] [bp-14h]@130 | |
901 // int v140; // [sp-14h] [bp-14h]@241 | |
902 // int v141; // [sp-14h] [bp-14h]@278 | |
903 // ArcomagePlayer *v142; // [sp-10h] [bp-10h]@5 | |
904 // ArcomagePlayer *v143; // [sp-10h] [bp-10h]@4 | |
905 // ArcomagePlayer *v144; // [sp-Ch] [bp-Ch]@5 | |
906 // ArcomagePlayer *v145; // [sp-Ch] [bp-Ch]@4 | |
907 // char v146; // [sp-8h] [bp-8h]@35 | |
908 // char v147; // [sp-8h] [bp-8h]@184 | |
909 // char v148; // [sp-5h] [bp-5h]@20 | |
910 // char v149; // [sp-5h] [bp-5h]@170 | |
911 // | |
912 // byte_4FAA00 = 1; | |
913 // if ( dword_4DF3A4 ) | |
914 // { | |
915 // if ( dword_4DF3A4 != 1 ) | |
916 // { | |
917 // result = dword_4DF3A4 - 2; | |
918 // if ( dword_4DF3A4 != 2 ) | |
919 // return result != 0; | |
920 // v64 = a1; | |
921 // v145 = &stru_505708[a1]; | |
922 // v130 = a1; | |
923 // v143 = &stru_505708[(a1 + 1) % 2]; | |
1185 | 924 // v136 = GetPlayerHandCardCount(a1); |
1183 | 925 // v65 = 0; |
926 // do | |
927 // { | |
928 // if ( v65 >= v136 ) | |
929 // { | |
930 // dword_4FA9B0[2 * v65] = -1; | |
931 // dword_4FA9B4[2 * v65] = -9999; | |
932 // } | |
933 // else | |
934 // { | |
935 // dword_4FA9B0[2 * v65] = v65; | |
936 // dword_4FA9B4[2 * v65] = 0; | |
937 // } | |
938 // ++v65; | |
939 // } | |
940 // while ( v65 < 10 ); | |
941 // v133 = 0; | |
942 // if ( v136 > 0 ) | |
943 // { | |
944 // v66 = 47 * v64; | |
945 // for ( i = 47 * v64; ; v66 = i ) | |
946 // { | |
947 // v67 = 99; | |
948 // v68 = 2 * v133; | |
949 // v69 = &pCards[stru_505708[0].cards_at_hand[v66 + dword_4FA9B0[2 * v133]]]; | |
950 // v70 = v69->field_38[2]; | |
951 // v149 = v69->field_38[2]; | |
952 // if ( v145->field_24 >= 10 ) | |
953 // { | |
954 // if ( v70 == 99 | |
955 // || v69->field_48[4] == 99 | |
956 // || v69->field_48[15] == 99 | |
957 // || (v74 = BYTE1(v69->field_68), v74 == 99) ) | |
958 // v73 = 5 * (v143->field_24 - v145->field_24); | |
959 // else | |
960 // v73 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v74); | |
961 // } | |
962 // else | |
963 // { | |
964 // if ( v70 == 99 | |
965 // || v69->field_48[4] == 99 | |
966 // || v69->field_48[15] == 99 | |
967 // || (v71 = BYTE1(v69->field_68), v71 == 99) ) | |
968 // v72 = 5 * (v143->field_24 - v145->field_24); | |
969 // else | |
970 // v72 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v71); | |
971 // v73 = 4 * v72; | |
972 // } | |
973 // dword_4FA9B4[v68] += v73; | |
974 // v75 = v69->field_38[1]; | |
975 // v147 = v69->field_38[1]; | |
976 // if ( v145->field_28 >= 10 ) | |
977 // { | |
978 // if ( v75 == 99 | |
979 // || v69->field_48[3] == 99 | |
980 // || v69->field_48[14] == 99 | |
981 // || (v78 = LOBYTE(v69->field_68), v78 == 99) ) | |
982 // v77 = v143->field_28 - v145->field_28; | |
983 // else | |
984 // v77 = v147 + v69->field_48[3] + v69->field_48[14] + v78; | |
985 // } | |
986 // else | |
987 // { | |
988 // if ( v75 == 99 | |
989 // || v69->field_48[3] == 99 | |
990 // || v69->field_48[14] == 99 | |
991 // || (v76 = LOBYTE(v69->field_68), v76 == 99) ) | |
992 // v77 = 5 * (v143->field_28 - v145->field_28); | |
993 // else | |
994 // v77 = 5 * (v147 + v69->field_48[3] + v69->field_48[14] + v76); | |
995 // } | |
996 // dword_4FA9B4[v68] += v77; | |
997 // dword_4FA9B4[v68] += 7 * (v69->field_38[0] + v69->field_48[2] + v69->field_48[13] + v69->field_58[15]); | |
998 // if ( BYTE2(v69->field_30) == 99 | |
999 // || v69->field_38[12] == 99 | |
1000 // || v69->field_48[7] == 99 | |
1001 // || (v79 = v69->field_58[9], v79 == 99) ) | |
1002 // v80 = 5 * (v143->field_2C - v145->field_2C); | |
1003 // else | |
1004 // v80 = 5 * (BYTE2(v69->field_30) + v69->field_38[12] + v69->field_48[7] + v79); | |
1005 // dword_4FA9B4[v68] += 8 * v80; | |
1006 // if ( BYTE3(v69->field_30) == 99 | |
1007 // || v69->field_38[13] == 99 | |
1008 // || v69->field_48[8] == 99 | |
1009 // || (v81 = v69->field_58[10], v81 == 99) ) | |
1010 // v82 = 5 * (v143->field_30 - v145->field_30); | |
1011 // else | |
1012 // v82 = 5 * (BYTE3(v69->field_30) + v69->field_38[13] + v69->field_48[8] + v81); | |
1013 // dword_4FA9B4[v68] += 8 * v82; | |
1014 // if ( LOBYTE(v69->field_34) == 99 | |
1015 // || v69->field_38[14] == 99 | |
1016 // || v69->field_48[9] == 99 | |
1017 // || (v83 = v69->field_58[11], v83 == 99) ) | |
1018 // v84 = 5 * (v143->field_34 - v145->field_34); | |
1019 // else | |
1020 // v84 = 5 * (LOBYTE(v69->field_34) + v69->field_38[14] + v69->field_48[9] + v83); | |
1021 // dword_4FA9B4[v68] += 8 * v84; | |
1022 // if ( BYTE1(v69->field_34) == 99 | |
1023 // || v69->field_38[15] == 99 | |
1024 // || v69->field_48[10] == 99 | |
1025 // || (v85 = v69->field_58[12], v85 == 99) ) | |
1026 // v86 = v143->field_38 - v145->field_38; | |
1027 // else | |
1028 // v86 = BYTE1(v69->field_34) + v69->field_38[15] + v69->field_48[10] + v85; | |
1029 // dword_4FA9B4[v68] += 2 * v86; | |
1030 // if ( BYTE2(v69->field_34) == 99 | |
1031 // || v69->field_48[0] == 99 | |
1032 // || v69->field_48[11] == 99 | |
1033 // || (v87 = v69->field_58[13], v87 == 99) ) | |
1034 // v88 = v143->field_3C - v145->field_3C; | |
1035 // else | |
1036 // v88 = BYTE2(v69->field_34) + v69->field_48[0] + v69->field_48[11] + v87; | |
1037 // dword_4FA9B4[v68] += 2 * v88; | |
1038 // if ( BYTE3(v69->field_34) == 99 | |
1039 // || v69->field_48[1] == 99 | |
1040 // || v69->field_48[12] == 99 | |
1041 // || (v89 = v69->field_58[14], v89 == 99) ) | |
1042 // v90 = v143->field_40 - v145->field_40; | |
1043 // else | |
1044 // v90 = BYTE3(v69->field_34) + v69->field_48[1] + v69->field_48[12] + v89; | |
1045 // dword_4FA9B4[v68] += 2 * v90; | |
1046 // if ( v69->field_38[11] == 99 || (v91 = v69->field_58[8], v91 == 99) ) | |
1047 // v92 = 10 * (v145->field_24 - v143->field_24); | |
1048 // else | |
1049 // v92 = -10 * (v69->field_38[11] + v91); | |
1050 // dword_4FA9B4[v68] += v92; | |
1051 // if ( v69->field_38[10] == 99 || (v93 = v69->field_58[7], v93 == 99) ) | |
1052 // v94 = 3 * (v145->field_28 - v143->field_28); | |
1053 // else | |
1054 // v94 = -3 * (v69->field_38[10] + v93); | |
1055 // dword_4FA9B4[v68] += v94; | |
1056 // v95 = v69->field_38[9]; | |
1057 // v140 = v95; | |
1058 // v96 = v69->field_38[3]; | |
1059 // dword_4FA9B4[v68] += -7 * (v69->field_58[6] + v95); | |
1060 // v97 = dword_4FA9B4[v68]; | |
1061 // if ( v96 == 99 ) | |
1062 // goto LABEL_245; | |
1063 // v98 = v69->field_58[0]; | |
1064 // if ( v98 == 99 ) | |
1065 // break; | |
1066 // v99 = v96 + v98; | |
1067 // v67 = 99; | |
1068 // dword_4FA9B4[v68] = v97 - 5 * v99; | |
1069 //LABEL_246: | |
1070 // v101 = v140; | |
1071 // if ( v69->field_38[4] == v67 || (v102 = v69->field_58[1], v102 == v67) ) | |
1072 // v103 = 5 * (v145->field_30 - v143->field_30); | |
1073 // else | |
1074 // v103 = -5 * (v69->field_38[4] + v102); | |
1075 // dword_4FA9B4[v68] += v103; | |
1076 // if ( v69->field_38[5] == v67 || (v104 = v69->field_58[2], v104 == v67) ) | |
1077 // v105 = 5 * (v145->field_34 - v143->field_34); | |
1078 // else | |
1079 // v105 = -5 * (v69->field_38[5] + v104); | |
1080 // dword_4FA9B4[v68] += v105; | |
1081 // if ( v69->field_38[6] == v67 || (v106 = v69->field_58[3], v106 == v67) ) | |
1082 // v107 = v145->field_38 - v143->field_38; | |
1083 // else | |
1084 // v107 = -(v69->field_38[6] + v106); | |
1085 // dword_4FA9B4[v68] += 2 * v107; | |
1086 // if ( v69->field_38[7] == v67 || (v108 = v69->field_58[4], v108 == v67) ) | |
1087 // v109 = v145->field_3C - v143->field_3C; | |
1088 // else | |
1089 // v109 = -(v69->field_38[7] + v108); | |
1090 // dword_4FA9B4[v68] += 2 * v109; | |
1091 // if ( v69->field_38[8] == v67 || (v110 = v69->field_58[5], v110 == v67) ) | |
1092 // { | |
1093 // v112 = v145; | |
1094 // v111 = v143; | |
1095 // dword_4FA9B4[v68] += 2 * (v145->field_40 - v143->field_40); | |
1096 // } | |
1097 // else | |
1098 // { | |
1099 // v111 = v143; | |
1100 // dword_4FA9B4[v68] += -2 * (v69->field_38[8] + v110); | |
1101 // v112 = v145; | |
1102 // } | |
1103 // if ( LOBYTE(v69->field_30) || v69->field_48[5] ) | |
1104 // dword_4FA9B4[v68] *= 10; | |
1105 // if ( LOBYTE(v69->field_24) == 1 ) | |
1106 // { | |
1107 // v113 = LOBYTE(v69->field_28); | |
1108 // v114 = v112->field_38; | |
1109 // } | |
1110 // else | |
1111 // { | |
1112 // if ( LOBYTE(v69->field_24) == 2 ) | |
1113 // { | |
1114 // v113 = BYTE1(v69->field_28); | |
1115 // v114 = v112->field_3C; | |
1116 // } | |
1117 // else | |
1118 // { | |
1119 // if ( LOBYTE(v69->field_24) != 3 ) | |
1120 // goto LABEL_278; | |
1121 // v113 = BYTE2(v69->field_28); | |
1122 // v114 = v112->field_40; | |
1123 // } | |
1124 // } | |
1125 // v115 = v114 - v113; | |
1126 // if ( v115 > 3 ) | |
1127 // v115 = 3; | |
1128 // dword_4FA9B4[v68] += 5 * v115; | |
1129 //LABEL_278: | |
1130 // v116 = v69->field_58[8]; | |
1131 // v141 = v111->field_24; | |
1132 // v126 = v69->field_38[11]; | |
1133 // if ( v141 <= v116 + v126 ) | |
1134 // dword_4FA9B4[v68] += 9999; | |
1135 // v137 = v111->field_28 + v141; | |
1136 // if ( v137 <= v116 + v126 + v69->field_58[6] + v69->field_58[7] + v101 + v69->field_38[10] ) | |
1137 // dword_4FA9B4[v68] += 9999; | |
1138 // if ( v69->field_48[15] + (signed int)BYTE1(v69->field_68) + v145->field_24 + v69->field_48[4] + v149 >= dword_4E1884 ) | |
1139 // dword_4FA9B4[v68] += 9999; | |
1140 // ++v133; | |
1141 // if ( v133 >= v136 ) | |
1142 // { | |
1143 // v64 = v130; | |
1144 // goto LABEL_286; | |
1145 // } | |
1146 // } | |
1147 // v67 = 99; | |
1148 //LABEL_245: | |
1149 // v100 = v145->field_2C - v143->field_2C; | |
1150 // dword_4FA9B4[v68] = v97 + 4 * v100 + v100; | |
1151 // goto LABEL_246; | |
1152 // } | |
1153 //LABEL_286: | |
1154 // v117 = v136 - 1; | |
1155 // for ( j = v136 - 1; j >= 0; --j ) | |
1156 // { | |
1157 // v137 = 0; | |
1158 // if ( j > 0 ) | |
1159 // { | |
1160 // v119 = (int)dword_4FA9B0; | |
1161 // v134 = j; | |
1162 // v137 = j; | |
1163 // do | |
1164 // { | |
1165 // if ( *(unsigned int *)(v119 + 4) < *(unsigned int *)(v119 + 12) ) | |
1166 // { | |
1167 // v120 = *(unsigned int *)v119; | |
1168 // v121 = *(unsigned int *)(v119 + 4); | |
1169 // *(unsigned int *)v119 = *(unsigned int *)(v119 + 8); | |
1170 // v122 = *(unsigned int *)(v119 + 12); | |
1171 // *(unsigned int *)(v119 + 8) = v120; | |
1172 // *(unsigned int *)(v119 + 4) = v122; | |
1173 // v64 = v130; | |
1174 // *(unsigned int *)(v119 + 12) = v121; | |
1175 // } | |
1176 // v119 += 8; | |
1177 // --v134; | |
1178 // } | |
1179 // while ( v134 ); | |
1180 // } | |
1181 // } | |
1182 // v123 = v136 - 1; | |
1183 // if ( am_byte_4FAA77 ) | |
1184 // { | |
1185 // if ( v117 >= 0 ) | |
1186 // { | |
1187 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) ) | |
1188 // { | |
1189 // --v123; | |
1190 // if ( v123 < 0 ) | |
1191 // return am_40BCFB(v64, v137) != 0; | |
1192 // } | |
1193 // v137 = dword_4FA9B0[2 * v123]; | |
1194 // } | |
1195 // } | |
1196 // else | |
1197 // { | |
1198 // v124 = 0; | |
1199 // if ( v117 >= 0 ) | |
1200 // { | |
1201 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) ) | |
1202 // { | |
1203 // --v123; | |
1204 // if ( v123 < 0 ) | |
1205 // goto LABEL_299; | |
1206 // } | |
1207 // v137 = dword_4FA9B0[2 * v123]; | |
1208 // } | |
1209 //LABEL_299: | |
1210 // if ( v136 > 0 ) | |
1211 // { | |
1212 // while ( !am_40BF15(v64, dword_4FA9B0[2 * v124]) || dword_4FA9B4[2 * v124] < 0 ) | |
1213 // { | |
1214 // ++v124; | |
1215 // if ( v124 >= v136 ) | |
1216 // return am_40BCFB(v64, v137) != 0; | |
1217 // } | |
1218 // return am_40BE0E(v64, dword_4FA9B0[2 * v124]) != 0; | |
1219 // } | |
1220 // } | |
1221 // return am_40BCFB(v64, v137) != 0; | |
1222 // } | |
1223 // v9 = a1; | |
1224 // v144 = &stru_505708[a1]; | |
1225 // v129 = a1; | |
1226 // v142 = &stru_505708[(a1 + 1) % 2]; | |
1185 | 1227 // v135 = GetPlayerHandCardCount(a1); |
1183 | 1228 // v10 = 0; |
1229 // do | |
1230 // { | |
1231 // if ( v10 >= v135 ) | |
1232 // { | |
1233 // dword_4FA9B0[2 * v10] = -1; | |
1234 // dword_4FA9B4[2 * v10] = -9999; | |
1235 // } | |
1236 // else | |
1237 // { | |
1238 // dword_4FA9B0[2 * v10] = v10; | |
1239 // dword_4FA9B4[2 * v10] = 0; | |
1240 // } | |
1241 // ++v10; | |
1242 // } | |
1243 // while ( v10 < 10 ); | |
1244 // v131 = 0; | |
1245 // if ( v135 > 0 ) | |
1246 // { | |
1247 // v11 = 47 * v9; | |
1248 // for ( k = 47 * v9; ; v11 = k ) | |
1249 // { | |
1250 // v12 = 99; | |
1251 // v13 = 2 * v131; | |
1252 // v14 = &pCards[stru_505708[0].cards_at_hand[v11 + dword_4FA9B0[2 * v131]]]; | |
1253 // v15 = v14->field_38[2]; | |
1254 // v148 = v14->field_38[2]; | |
1255 // if ( v144->field_24 >= 10 ) | |
1256 // { | |
1257 // if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v19 = BYTE1(v14->field_68), v19 == 99) ) | |
1258 // v20 = 5 * (v142->field_24 - v144->field_24); | |
1259 // else | |
1260 // v20 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v19); | |
1261 // v18 = 2 * v20; | |
1262 // } | |
1263 // else | |
1264 // { | |
1265 // if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v16 = BYTE1(v14->field_68), v16 == 99) ) | |
1266 // v17 = 5 * (v142->field_24 - v144->field_24); | |
1267 // else | |
1268 // v17 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v16); | |
1269 // v18 = 4 * v17; | |
1270 // } | |
1271 // dword_4FA9B4[v13] += v18; | |
1272 // v21 = v14->field_38[1]; | |
1273 // v146 = v14->field_38[1]; | |
1274 // if ( v144->field_28 >= 10 ) | |
1275 // { | |
1276 // if ( v21 == 99 | |
1277 // || v14->field_48[3] == 99 | |
1278 // || v14->field_48[14] == 99 | |
1279 // || (v24 = LOBYTE(v14->field_68), v24 == 99) ) | |
1280 // v25 = v142->field_28 - v144->field_28; | |
1281 // else | |
1282 // v25 = v146 + v14->field_48[3] + v14->field_48[14] + v24; | |
1283 // v23 = 2 * v25; | |
1284 // } | |
1285 // else | |
1286 // { | |
1287 // if ( v21 == 99 | |
1288 // || v14->field_48[3] == 99 | |
1289 // || v14->field_48[14] == 99 | |
1290 // || (v22 = LOBYTE(v14->field_68), v22 == 99) ) | |
1291 // v23 = 5 * (v142->field_28 - v144->field_28); | |
1292 // else | |
1293 // v23 = 5 * (v146 + v14->field_48[3] + v14->field_48[14] + v22); | |
1294 // } | |
1295 // dword_4FA9B4[v13] += v23; | |
1296 // dword_4FA9B4[v13] += 7 * (v14->field_38[0] + v14->field_48[2] + v14->field_48[13] + v14->field_58[15]); | |
1297 // if ( BYTE2(v14->field_30) == 99 | |
1298 // || v14->field_38[12] == 99 | |
1299 // || v14->field_48[7] == 99 | |
1300 // || (v26 = v14->field_58[9], v26 == 99) ) | |
1301 // v27 = 5 * (v142->field_2C - v144->field_2C); | |
1302 // else | |
1303 // v27 = 5 * (BYTE2(v14->field_30) + v14->field_38[12] + v14->field_48[7] + v26); | |
1304 // dword_4FA9B4[v13] += 8 * v27; | |
1305 // if ( BYTE3(v14->field_30) == 99 | |
1306 // || v14->field_38[13] == 99 | |
1307 // || v14->field_48[8] == 99 | |
1308 // || (v28 = v14->field_58[10], v28 == 99) ) | |
1309 // v29 = 5 * (v142->field_30 - v144->field_30); | |
1310 // else | |
1311 // v29 = 5 * (BYTE3(v14->field_30) + v14->field_38[13] + v14->field_48[8] + v28); | |
1312 // dword_4FA9B4[v13] += 8 * v29; | |
1313 // if ( LOBYTE(v14->field_34) == 99 | |
1314 // || v14->field_38[14] == 99 | |
1315 // || v14->field_48[9] == 99 | |
1316 // || (v30 = v14->field_58[11], v30 == 99) ) | |
1317 // v31 = 5 * (v142->field_34 - v144->field_34); | |
1318 // else | |
1319 // v31 = 5 * (LOBYTE(v14->field_34) + v14->field_38[14] + v14->field_48[9] + v30); | |
1320 // dword_4FA9B4[v13] += 8 * v31; | |
1321 // if ( BYTE1(v14->field_34) == 99 | |
1322 // || v14->field_38[15] == 99 | |
1323 // || v14->field_48[10] == 99 | |
1324 // || (v32 = v14->field_58[12], v32 == 99) ) | |
1325 // v33 = v142->field_38 - v144->field_38; | |
1326 // else | |
1327 // v33 = BYTE1(v14->field_34) + v14->field_38[15] + v14->field_48[10] + v32; | |
1328 // dword_4FA9B4[v13] += 2 * v33; | |
1329 // if ( BYTE2(v14->field_34) == 99 | |
1330 // || v14->field_48[0] == 99 | |
1331 // || v14->field_48[11] == 99 | |
1332 // || (v34 = v14->field_58[13], v34 == 99) ) | |
1333 // v35 = v142->field_3C - v144->field_3C; | |
1334 // else | |
1335 // v35 = BYTE2(v14->field_34) + v14->field_48[0] + v14->field_48[11] + v34; | |
1336 // dword_4FA9B4[v13] += 2 * v35; | |
1337 // if ( BYTE3(v14->field_34) == 99 | |
1338 // || v14->field_48[1] == 99 | |
1339 // || v14->field_48[12] == 99 | |
1340 // || (v36 = v14->field_58[14], v36 == 99) ) | |
1341 // v37 = v142->field_40 - v144->field_40; | |
1342 // else | |
1343 // v37 = BYTE3(v14->field_34) + v14->field_48[1] + v14->field_48[12] + v36; | |
1344 // dword_4FA9B4[v13] += 2 * v37; | |
1345 // if ( v14->field_38[11] == 99 || (v38 = v14->field_58[8], v38 == 99) ) | |
1346 // dword_4FA9B4[v13] += v144->field_24 - v142->field_24; | |
1347 // else | |
1348 // dword_4FA9B4[v13] -= v14->field_38[11] + v38; | |
1349 // if ( v14->field_38[10] == 99 || (v39 = v14->field_58[7], v39 == 99) ) | |
1350 // dword_4FA9B4[v13] += v144->field_28 - v142->field_28; | |
1351 // else | |
1352 // dword_4FA9B4[v13] -= v14->field_38[10] + v39; | |
1353 // v40 = v14->field_38[9]; | |
1354 // v138 = v14->field_38[9]; | |
1355 // dword_4FA9B4[v13] -= v40 + v14->field_58[6]; | |
1356 // v41 = v14->field_38[3]; | |
1357 // v42 = dword_4FA9B4[v13]; | |
1358 // if ( v41 == 99 ) | |
1359 // goto LABEL_97; | |
1360 // v43 = v14->field_58[0]; | |
1361 // if ( v43 == 99 ) | |
1362 // break; | |
1363 // v44 = v42 - v43; | |
1364 // v12 = 99; | |
1365 // dword_4FA9B4[v13] = v44 - v41; | |
1366 //LABEL_98: | |
1367 // if ( v14->field_38[4] == v12 || (v45 = v14->field_58[1], v45 == v12) ) | |
1368 // dword_4FA9B4[v13] += v144->field_30 - v142->field_30; | |
1369 // else | |
1370 // dword_4FA9B4[v13] -= v14->field_38[4] + v45; | |
1371 // if ( v14->field_38[5] == v12 || (v46 = v14->field_58[2], v46 == v12) ) | |
1372 // dword_4FA9B4[v13] += v144->field_34 - v142->field_34; | |
1373 // else | |
1374 // dword_4FA9B4[v13] -= v14->field_38[5] + v46; | |
1375 // if ( v14->field_38[6] == v12 || (v47 = v14->field_58[3], v47 == v12) ) | |
1376 // dword_4FA9B4[v13] += v144->field_38 - v142->field_38; | |
1377 // else | |
1378 // dword_4FA9B4[v13] -= v14->field_38[6] + v47; | |
1379 // if ( v14->field_38[7] == v12 || (v48 = v14->field_58[4], v48 == v12) ) | |
1380 // dword_4FA9B4[v13] += v144->field_3C - v142->field_3C; | |
1381 // else | |
1382 // dword_4FA9B4[v13] -= v14->field_38[7] + v48; | |
1383 // if ( v14->field_38[8] == v12 || (v49 = v14->field_58[5], v49 == v12) ) | |
1384 // { | |
1385 // v51 = v144; | |
1386 // v50 = v142; | |
1387 // dword_4FA9B4[v13] += v144->field_40 - v142->field_40; | |
1388 // } | |
1389 // else | |
1390 // { | |
1391 // v50 = v142; | |
1392 // dword_4FA9B4[v13] -= v14->field_38[8] + v49; | |
1393 // v51 = v144; | |
1394 // } | |
1395 // if ( LOBYTE(v14->field_30) || v14->field_48[5] ) | |
1396 // dword_4FA9B4[v13] *= 10; | |
1397 // if ( LOBYTE(v14->field_24) == 1 ) | |
1398 // { | |
1399 // v52 = LOBYTE(v14->field_28); | |
1400 // v53 = v51->field_38; | |
1401 // } | |
1402 // else | |
1403 // { | |
1404 // if ( LOBYTE(v14->field_24) == 2 ) | |
1405 // { | |
1406 // v52 = BYTE1(v14->field_28); | |
1407 // v53 = v51->field_3C; | |
1408 // } | |
1409 // else | |
1410 // { | |
1411 // if ( LOBYTE(v14->field_24) != 3 ) | |
1412 // goto LABEL_130; | |
1413 // v52 = BYTE2(v14->field_28); | |
1414 // v53 = v51->field_40; | |
1415 // } | |
1416 // } | |
1417 // v54 = v53 - v52; | |
1418 // if ( v54 > 3 ) | |
1419 // v54 = 3; | |
1420 // dword_4FA9B4[v13] += 5 * v54; | |
1421 //LABEL_130: | |
1422 // v55 = v14->field_58[8]; | |
1423 // v139 = v50->field_24; | |
1424 // v125 = v14->field_38[11]; | |
1425 // if ( v139 <= v55 + v125 ) | |
1426 // dword_4FA9B4[v13] += 9999; | |
1427 // v137 = v50->field_28 + v139; | |
1428 // if ( v137 <= v55 + v125 + v14->field_58[6] + v14->field_58[7] + v40 + v14->field_38[10] ) | |
1429 // dword_4FA9B4[v13] += 9999; | |
1430 // if ( v14->field_48[15] + (signed int)BYTE1(v14->field_68) + v144->field_24 + v14->field_48[4] + v148 >= dword_4E1884 ) | |
1431 // dword_4FA9B4[v13] += 9999; | |
1432 // ++v131; | |
1433 // if ( v131 >= v135 ) | |
1434 // { | |
1435 // v9 = v129; | |
1436 // goto LABEL_138; | |
1437 // } | |
1438 // } | |
1439 // v12 = 99; | |
1440 //LABEL_97: | |
1441 // v40 = v138; | |
1442 // dword_4FA9B4[v13] = v42 + v144->field_2C - v142->field_2C; | |
1443 // goto LABEL_98; | |
1444 // } | |
1445 //LABEL_138: | |
1446 // v56 = v135 - 1; | |
1447 // for ( l = v135 - 1; l >= 0; --l ) | |
1448 // { | |
1449 // v137 = 0; | |
1450 // if ( l > 0 ) | |
1451 // { | |
1452 // v58 = (int)dword_4FA9B0; | |
1453 // v132 = l; | |
1454 // v137 = l; | |
1455 // do | |
1456 // { | |
1457 // if ( *(unsigned int *)(v58 + 4) < *(unsigned int *)(v58 + 12) ) | |
1458 // { | |
1459 // v59 = *(unsigned int *)v58; | |
1460 // v60 = *(unsigned int *)(v58 + 4); | |
1461 // *(unsigned int *)v58 = *(unsigned int *)(v58 + 8); | |
1462 // v61 = *(unsigned int *)(v58 + 12); | |
1463 // *(unsigned int *)(v58 + 8) = v59; | |
1464 // *(unsigned int *)(v58 + 4) = v61; | |
1465 // v9 = v129; | |
1466 // *(unsigned int *)(v58 + 12) = v60; | |
1467 // } | |
1468 // v58 += 8; | |
1469 // --v132; | |
1470 // } | |
1471 // while ( v132 ); | |
1472 // } | |
1473 // } | |
1474 // v62 = v135 - 1; | |
1475 // if ( am_byte_4FAA77 ) | |
1476 // { | |
1477 // if ( v56 >= 0 ) | |
1478 // { | |
1479 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) ) | |
1480 // { | |
1481 // --v62; | |
1482 // if ( v62 < 0 ) | |
1483 // return am_40BCFB(v9, v137) != 0; | |
1484 // } | |
1485 // v137 = dword_4FA9B0[2 * v62]; | |
1486 // } | |
1487 // } | |
1488 // else | |
1489 // { | |
1490 // v63 = 0; | |
1491 // if ( v56 >= 0 ) | |
1492 // { | |
1493 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) ) | |
1494 // { | |
1495 // --v62; | |
1496 // if ( v62 < 0 ) | |
1497 // goto LABEL_151; | |
1498 // } | |
1499 // v137 = dword_4FA9B0[2 * v62]; | |
1500 // } | |
1501 //LABEL_151: | |
1502 // if ( v135 > 0 ) | |
1503 // { | |
1504 // while ( !am_40BF15(v9, dword_4FA9B0[2 * v63]) || dword_4FA9B4[2 * v63] < 0 ) | |
1505 // { | |
1506 // ++v63; | |
1507 // if ( v63 >= v135 ) | |
1508 // return am_40BCFB(v9, v137) != 0; | |
1509 // } | |
1510 // return am_40BE0E(v9, dword_4FA9B0[2 * v63]) != 0; | |
1511 // } | |
1512 // } | |
1513 // return am_40BCFB(v9, v137) != 0; | |
1514 // } | |
1515 // v3 = 0; | |
1516 // v4 = a1; | |
1517 // if ( am_byte_4FAA77 ) | |
1518 // { | |
1519 //LABEL_11: | |
1185 | 1520 // v7 = GetPlayerHandCardCount(v4); |
1183 | 1521 // v8 = rand_interval(0, v7 - 1); |
1522 // result = am_40BCFB(v4, v8); | |
1523 // } | |
1524 // else | |
1525 // { | |
1526 // while ( 1 ) | |
1527 // { | |
1185 | 1528 // v5 = GetPlayerHandCardCount(v4); |
1183 | 1529 // v6 = rand_interval(0, v5 - 1); |
1530 // if ( am_40BF15(v4, v6) ) | |
1531 // break; | |
1532 // ++v3; | |
1533 // if ( v3 >= 10 ) | |
1534 // goto LABEL_11; | |
1535 // } | |
1536 // result = am_40BE0E(v4, v6); | |
1537 // } | |
1538 return true;//result != 0; | |
0 | 1539 } |
1540 // 408BB4: could not find valid save-restore pair for ebp | |
1541 // 4DF3A4: using guessed type int dword_4DF3A4; | |
1542 // 4E1884: using guessed type int dword_4E1884; | |
1543 // 4FA9B0: using guessed type int dword_4FA9B0[]; | |
1544 // 4FA9B4: using guessed type int dword_4FA9B4[]; | |
1545 // 4FAA00: using guessed type char byte_4FAA00; | |
1546 // 4FAA77: using guessed type char am_byte_4FAA77; | |
1547 | |
1548 | |
1549 | |
1550 //----- (00409E6A) -------------------------------------------------------- | |
1551 void ArcomageGame::Loop() | |
1552 { | |
1553 int v0; // edx@2 | |
1554 int v1; // ecx@14 | |
1555 signed int v2; // eax@15 | |
1556 stru272 *v3; // esi@17 | |
1557 __int16 *v4; // esi@23 | |
1558 | |
1197 | 1559 while ( !pArcomageGame->GameOver ) |
0 | 1560 { |
1561 pArcomageGame->field_F6 = 1; | |
1562 byte_4FAA24 = 1; | |
1197 | 1563 IncreaseResourcesInTurn(current_player_num); |
0 | 1564 LABEL_8: |
1185 | 1565 while ( byte_4FAA24 ) |
0 | 1566 { |
1567 amuint_4FABC0 = -1; | |
1197 | 1568 am_40A283(current_player_num); |
0 | 1569 while ( 1 ) |
1570 { | |
1197 | 1571 byte_4FAA24 = am_40A560(current_player_num); |
1572 if ( GetPlayerHandCardCount(current_player_num) <= dword_4E1874 ) | |
0 | 1573 break; |
1574 am_byte_4FAA77 = 1; | |
1575 if ( pArcomageGame->field_F4 ) | |
1576 goto LABEL_8; | |
1577 } | |
1578 am_byte_4FAA77 = 0; | |
1185 | 1579 } |
1197 | 1580 pArcomageGame->GameOver = IsGameOver(); |
1581 if ( !pArcomageGame->GameOver ) | |
0 | 1582 am_40A383(); |
1583 if ( pArcomageGame->field_F4 ) | |
1197 | 1584 pArcomageGame->GameOver = 1; |
0 | 1585 } |
1197 | 1586 GameResultsApply(); |
0 | 1587 if ( byte_4FAA2C ) |
1588 { | |
1183 | 1589 // v2 = retzero_sub_40DFA7((int)dword_4FAA28); |
1590 // v1 = 1000; | |
1591 // dword_4FAA70 = v2 / 1000; | |
1592 dword_4FAA70 = 0; | |
0 | 1593 } |
1594 else | |
1595 { | |
1596 dword_4FAA70 = -1; | |
1597 } | |
1598 pVideoPlayer->BinkUpdatePalette(dword_4FAA28); | |
1183 | 1599 |
1184 | 1600 for(int i=0; i<10; ++i) |
1601 { | |
1602 array_4FABD0[i].field_40->_40E0F5(1,1); | |
1603 array_4FABD0[i].field_40->_40DFFE(); | |
1604 } | |
1038 | 1605 |
0 | 1606 pArcomageGame->pGameBackground.Release(); |
1607 pArcomageGame->pSprites.Release(); | |
1608 pArcomageGame->bGameInProgress = 0; | |
1609 viewparams->bRedrawGameUI = 1; | |
1610 if ( pVideoPlayer->AnyMovieLoaded() ) | |
1611 pVideoPlayer->_4BF5B2(); | |
1183 | 1612 for(int i=0; i<12; ++i) |
1613 pSoundList->UnloadSound(am_sounds[i], 1); | |
1614 | |
0 | 1615 } |
938 | 1616 |
1617 | |
1618 | |
0 | 1619 |
1620 //----- (00409FE9) -------------------------------------------------------- | |
1197 | 1621 void SetStartGameData() |
1185 | 1622 { |
1194 | 1623 |
1624 signed int j; // edx@7 | |
1625 int card_id_counter; // edx@13 | |
1626 signed int i; // ecx@13 | |
1627 signed int card_dispenser_counter; // eax@13 | |
0 | 1628 |
1197 | 1629 current_player_num = dword_505890; |
1630 SetStartConditions(); | |
1194 | 1631 for(i=0; i<2; ++i ) |
0 | 1632 { |
1194 | 1633 if ( i ) |
0 | 1634 { |
1194 | 1635 strcpy(am_Players[1].pPlayerName, pArcomageGame->pPlayer2Name); |
0 | 1636 if ( byte_4E185C ) |
1197 | 1637 am_Players[1].IsHisTurn = 0; |
0 | 1638 else |
1197 | 1639 am_Players[1].IsHisTurn = 1; |
0 | 1640 } |
1641 else | |
1642 { | |
1194 | 1643 strcpy(am_Players[0].pPlayerName, pArcomageGame->pPlayer1Name); |
1197 | 1644 am_Players[0].IsHisTurn = 1; |
0 | 1645 } |
1197 | 1646 am_Players[i].tower_height = start_tower_height; |
1647 am_Players[i].wall_height = start_wall_height; | |
1648 am_Players[i].quarry_level = start_quarry_level; | |
1649 am_Players[i].magic_level = start_magic_level; | |
1650 am_Players[i].might_level = start_might_level; | |
1651 am_Players[i].resource_bricks = start_bricks_amount; | |
1652 am_Players[i].resource_gems = start_gems_amount; | |
1653 am_Players[i].resource_beasts = start_beasts_amount; | |
1194 | 1654 |
1655 for (j=0; j<10; ++j ) | |
0 | 1656 { |
1194 | 1657 am_Players[i].cards_at_hand[j] = -1; |
0 | 1658 if ( am_byte_4E185D ) |
1659 { | |
1194 | 1660 am_Players[i].arr_6C[j].field_0 = -1; |
1661 am_Players[i].arr_6C[j].field_4 = -1; | |
0 | 1662 } |
1663 else | |
1664 { | |
1194 | 1665 am_Players[i].arr_6C[j].field_0 = 0; |
1666 am_Players[i].arr_6C[j].field_4 = 0; | |
0 | 1667 } |
1668 } | |
1185 | 1669 |
0 | 1670 } |
1194 | 1671 // inv_strcpy(pDeckMaster, byte_5054C8); |
1672 strcpy(deckMaster.name, pDeckMaster); | |
1673 for (i=0, card_dispenser_counter=-2, card_id_counter=0; i<DECK_SIZE; ++i, ++card_dispenser_counter) | |
1185 | 1674 { |
1194 | 1675 deckMaster.cardsInUse[i] = 0; |
1676 deckMaster.cards_IDs[i] =card_id_counter; | |
1677 switch ( card_dispenser_counter ) | |
1185 | 1678 { |
0 | 1679 case 0: |
1680 case 2: | |
1681 case 6: | |
1682 case 9: | |
1683 case 13: | |
1684 case 18: | |
1685 case 23: | |
1686 case 33: | |
1687 case 36: | |
1688 case 38: | |
1689 case 44: | |
1690 case 46: | |
1691 case 52: | |
1692 case 57: | |
1693 case 69: | |
1694 case 71: | |
1695 case 75: | |
1696 case 79: | |
1697 case 81: | |
1698 case 84: | |
1699 case 89: | |
1185 | 1700 break; |
1701 default: | |
1194 | 1702 ++card_id_counter; |
1185 | 1703 } |
1704 } | |
1705 | |
1197 | 1706 FillPlayerDeck(); |
0 | 1707 } |
1708 | |
1709 //----- (0040A198) -------------------------------------------------------- | |
1197 | 1710 void FillPlayerDeck() |
1194 | 1711 { |
1712 | |
0 | 1713 signed int v3; // eax@4 |
1714 int v6; // edx@13 | |
1194 | 1715 char v7; // eax@13 |
1716 char card_taken_flags[DECK_SIZE]; // [sp+8h] [bp-6Ch]@1 | |
1717 int i,j; | |
0 | 1718 |
1719 ArcomageGame::PlaySound(0x14u); | |
1194 | 1720 memset(deckMaster.cardsInUse, 0,DECK_SIZE ); |
1721 memset(card_taken_flags, 0, DECK_SIZE); | |
1722 | |
1723 for (i=0; i<2; ++i) | |
0 | 1724 { |
1194 | 1725 for (j=0; j<10; ++j) |
0 | 1726 { |
1194 | 1727 if ( am_Players[i].cards_at_hand[j] > -1 ) |
0 | 1728 { |
1194 | 1729 for (v3 = 0; v3<DECK_SIZE; ++v3) |
1730 { | |
1731 if (deckMaster.cards_IDs[v3] == am_Players[i].cards_at_hand[j] && deckMaster.cardsInUse[v3] == 0) | |
1732 { | |
1733 deckMaster.cardsInUse[v3] = 1; | |
1734 break; | |
1735 } | |
1736 } | |
0 | 1737 } |
1738 } | |
1739 } | |
1194 | 1740 |
1741 for (i=0; i<DECK_SIZE; ++i) | |
0 | 1742 { |
1743 do | |
1744 { | |
1194 | 1745 v6 = rand() % DECK_SIZE; |
1746 v7 = card_taken_flags[v6]; | |
0 | 1747 } |
1194 | 1748 while ( v7 == 1 ); |
1749 card_taken_flags[v6]=1; | |
1197 | 1750 playDeck.cards_IDs[i] = deckMaster.cards_IDs[v6]; |
1194 | 1751 playDeck.cardsInUse[i] = deckMaster.cardsInUse[v6]; |
0 | 1752 } |
1194 | 1753 |
0 | 1754 dword_4FABC8 = 0; |
1755 amuint_4FABC4 = -1; | |
1756 pArcomageGame->field_F6 = 1; | |
1194 | 1757 |
0 | 1758 } |
1759 | |
1760 //----- (0040A255) -------------------------------------------------------- | |
1183 | 1761 void am_40A255() |
1762 { | |
1763 for (int i = 0; i < dword_4E1874; ++i ) | |
0 | 1764 { |
1183 | 1765 am_40A283(0); |
1766 am_40A283(1); | |
0 | 1767 } |
1768 pArcomageGame->field_F6 = 1; | |
1183 | 1769 |
0 | 1770 } |
1771 // 4E1874: using guessed type int dword_4E1874; | |
1772 | |
1773 //----- (0040A283) -------------------------------------------------------- | |
1183 | 1774 void am_40A283( int a1 ) |
1775 { | |
0 | 1776 signed int v2; // eax@1 |
1777 int v3; // edi@1 | |
1778 int v4; // esi@1 | |
1194 | 1779 bool v5; // bl@1 |
0 | 1780 signed int result; // eax@7 |
1781 int v7; // esi@8 | |
1782 | |
1783 v2 = dword_4FABC8; | |
1784 v3 = a1; | |
1785 v4 = a1; | |
1194 | 1786 v5 = false; |
0 | 1787 do |
1788 { | |
1194 | 1789 if ( v2 >= DECK_SIZE ) |
0 | 1790 { |
1197 | 1791 FillPlayerDeck(); |
0 | 1792 v2 = dword_4FABC8; |
1793 } | |
1194 | 1794 if ( !playDeck.cardsInUse[v2] ) |
1186 | 1795 { |
1194 | 1796 v3 = playDeck.cards_IDs[v2]; |
1797 v5 = true; | |
1186 | 1798 } |
0 | 1799 ++v2; |
1800 dword_4FABC8 = v2; | |
1801 } | |
1802 while ( !v5 ); | |
1194 | 1803 |
1197 | 1804 ArcomageGame::PlaySound(21); |
1185 | 1805 result = GetEmptyCardSlotIndex(v4); |
0 | 1806 if ( result != -1 ) |
1807 { | |
1808 amuint_4FAA4C = result; | |
1186 | 1809 am_Players[a1].cards_at_hand[result] = v3; |
1810 am_Players[a1].arr_6C[result].field_0 = rand_interval(-4, 4); | |
1811 am_Players[a1].arr_6C[result].field_4 = rand_interval(-4, 4); | |
0 | 1812 pArcomageGame->field_F6 = 1; |
1813 byte_4FAA2D = 1; | |
1814 } | |
1183 | 1815 |
0 | 1816 } |
1186 | 1817 |
0 | 1818 |
1819 //----- (0040A324) -------------------------------------------------------- | |
1185 | 1820 int GetEmptyCardSlotIndex( int player_num ) |
1821 { | |
1822 int i; | |
1823 for (i=0; i<10; ++i ) | |
1824 { | |
1825 if (am_Players[player_num].cards_at_hand[i]==-1) | |
1826 break; | |
1827 } | |
1828 if ( i >= 10 ) | |
1829 return -1; | |
1830 else | |
1831 return i; | |
0 | 1832 } |
1833 | |
1834 //----- (0040A346) -------------------------------------------------------- | |
1197 | 1835 void IncreaseResourcesInTurn( int player_num ) |
1185 | 1836 { |
1197 | 1837 am_Players[player_num].resource_bricks += quarry_bonus + am_Players[player_num].quarry_level; |
1838 am_Players[player_num].resource_gems += magic_bonus + am_Players[player_num].magic_level; | |
1839 am_Players[player_num].resource_beasts += might_bonus + am_Players[player_num].might_level; | |
0 | 1840 } |
1183 | 1841 |
0 | 1842 |
1843 //----- (0040A383) -------------------------------------------------------- | |
1844 void __cdecl am_40A383() | |
1845 { | |
1846 int v0; // eax@4 | |
1847 int v1; // ecx@4 | |
1848 unsigned __int8 v2; // sf@4 | |
1849 unsigned __int8 v3; // of@4 | |
1850 int v4; // eax@6 | |
1851 char Dest[64]; // [sp+4h] [bp-64h]@4 | |
1194 | 1852 RECT v6; // [sp+44h] [bp-24h]@6 |
1853 | |
0 | 1854 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7 |
1194 | 1855 POINT v11; // [sp+60h] [bp-8h]@4 |
0 | 1856 |
1857 if ( !pArcomageGame->field_F4 ) | |
1858 { | |
1197 | 1859 if ( am_Players[0].IsHisTurn != 1 || am_Players[1].IsHisTurn != 1 ) |
0 | 1860 { |
1197 | 1861 ++current_player_num; |
0 | 1862 am_byte_4FAA75 = 1; |
1197 | 1863 if ( current_player_num >= 2 ) |
1864 current_player_num = 0; | |
0 | 1865 } |
1866 else | |
1867 { | |
1868 //nullsub_1(); | |
1194 | 1869 v11.x = 0; |
1870 v11.y = 0; | |
0 | 1871 inv_strcpy("Ñëåä", Dest); |
1872 v0 = 0; | |
1194 | 1873 v11.y = 200; |
1874 v11.x = 320 - 12 * v0 / 2; | |
1875 pPrimaryWindow_draws_text(-1, Dest, &v11); | |
0 | 1876 am_byte_4FAA75 = 1; |
1197 | 1877 v1 = current_player_num + 1; |
1878 v3 = __OFSUB__(current_player_num + 1, 2); | |
1879 v2 = current_player_num++ - 1 < 0; | |
0 | 1880 if ( !(v2 ^ v3) ) |
1881 { | |
1882 v1 = 0; | |
1197 | 1883 current_player_num = 0; |
0 | 1884 } |
1183 | 1885 inv_strcpy(am_Players[v1].pPlayerName, Dest); |
0 | 1886 v4 = 0; |
1194 | 1887 v11.y = 260; |
1888 v11.x = 320 - 12 * v4 / 2; | |
1889 pPrimaryWindow_draws_text(-1, Dest, &v11); | |
1197 | 1890 /* v6.left = 0; |
1194 | 1891 v6.right = 640; |
1892 v6.top = 0; | |
1197 | 1893 v6.bottom = 480;*/ |
0 | 1894 //nullsub_1(); |
1895 CallRenderPresent(); | |
1896 //nullsub_1(); | |
1897 while ( 1 ) | |
1898 { | |
1899 while ( 1 ) | |
1900 { | |
1901 while ( !ArcomageGame::MsgLoop(20, &v10) ) | |
1902 ; | |
1903 if ( v10.field_0 != 1 ) | |
1904 break; | |
1905 if ( v10.field_4 ) | |
1906 goto LABEL_13; | |
1907 //nullsub_1(); | |
1908 } | |
1909 if ( v10.field_0 > 4 ) | |
1910 { | |
1911 if ( v10.field_0 <= 8 ) | |
1912 goto LABEL_13; | |
1913 if ( v10.field_0 == 10 ) | |
1914 break; | |
1915 } | |
1916 } | |
1917 pArcomageGame->field_F4 = 1; | |
1918 byte_4FAA74 = 1; | |
1919 LABEL_13: | |
1197 | 1920 /* v11.x = 0; |
1194 | 1921 v11.y = 0; |
1922 v6.left = 0; | |
1923 v6.right = 640; | |
1924 v6.top = 0; | |
1197 | 1925 v6.bottom = 480;*/ |
0 | 1926 //nullsub_1(); |
1927 CallRenderPresent(); | |
1928 } | |
1929 } | |
1930 } | |
1931 | |
1932 | |
1933 //----- (0040A514) -------------------------------------------------------- | |
1197 | 1934 bool IsGameOver() |
1183 | 1935 { |
0 | 1936 bool result; // eax@1 |
1183 | 1937 |
1938 result = false; | |
1939 for(int i=0; i<2; ++i) | |
0 | 1940 { |
1197 | 1941 if ( am_Players[i].tower_height <= 0 ) |
1942 result = true; | |
1943 if ( am_Players[i].tower_height >= max_tower_height ) | |
1183 | 1944 result = true; |
1197 | 1945 if ( am_Players[i].resource_bricks >= max_resources_amount |
1946 || am_Players[i].resource_gems >= max_resources_amount | |
1947 || am_Players[i].resource_beasts >= max_resources_amount ) | |
1183 | 1948 result = true; |
0 | 1949 } |
1183 | 1950 |
0 | 1951 if ( result ) |
1952 byte_4FAA2C = 1; | |
1953 return result; | |
1954 } | |
1197 | 1955 |
0 | 1956 |
1957 //----- (0040A560) -------------------------------------------------------- | |
1958 char am_40A560(unsigned int _this) | |
1959 { | |
1960 int v1; // ebp@0 | |
1961 unsigned __int64 v2; // qax@3 | |
1962 unsigned __int64 v3; // kr00_8@3 | |
1963 int v4; // ecx@17 | |
1964 int v5; // esi@67 | |
1965 char Dest[100]; // [sp+8h] [bp-A8h]@67 | |
1966 int v8; // [sp+6Ch] [bp-44h]@3 | |
1194 | 1967 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75 |
0 | 1968 int v10[4]; // [sp+80h] [bp-30h]@69 |
1194 | 1969 POINT pTargetXY; // [sp+90h] [bp-20h]@75 |
0 | 1970 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8 |
1971 int v13; // [sp+A4h] [bp-Ch]@1 | |
1972 int a1; // [sp+A8h] [bp-8h]@1 | |
1973 char v15; // [sp+AEh] [bp-2h]@63 | |
1974 char v16; // [sp+AFh] [bp-1h]@1 | |
1975 | |
1976 uCardID = -1; | |
1977 a1 = _this; | |
1978 v16 = 0; | |
1979 v13 = 20; | |
1980 byte_4FAA00 = 0; | |
1981 dword_4FAA68 = 0; | |
1982 amuint_4FAA38 = 10; | |
1983 amuint_4FAA34 = 5; | |
1984 if ( amuint_4FAA4C != -1 ) | |
1985 byte_4FAA2D = 1; | |
1986 do | |
1987 { | |
1194 | 1988 |
0 | 1989 do |
1990 { | |
1194 | 1991 v3 = pEventTimer->Time() - pArcomageGame->event_timer_time; |
0 | 1992 } |
1194 | 1993 while (v3 < 6); |
1994 | |
0 | 1995 pArcomageGame->event_timer_time = pEventTimer->Time(); |
1996 if ( pArcomageGame->field_F4 ) | |
1997 v16 = 1; | |
1998 ArcomageGame::MsgLoop(0, &a2); | |
1999 switch ( a2.field_0 ) | |
2000 { | |
2001 case 2: | |
2002 if ( a2.field_4 == 129 && a2.field_8 == 1 ) | |
2003 { | |
2004 pAudioPlayer->StopChannels(-1, -1); | |
2005 dword_4FAA68 = 0; | |
1185 | 2006 v16 = 1; |
2007 pArcomageGame->field_F4 = 1; | |
0 | 2008 } |
2009 break; | |
2010 case 9: | |
2011 pArcomageGame->field_F6 = 1; | |
2012 break; | |
1194 | 2013 case 10: |
0 | 2014 pAudioPlayer->StopChannels(-1, -1); |
2015 byte_4FAA74 = 1; | |
2016 v16 = 1; | |
2017 pArcomageGame->field_F4 = 1; | |
2018 break; | |
2019 } | |
1197 | 2020 v4 = current_player_num; |
2021 if (am_Players[current_player_num].IsHisTurn != 1 && !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D ) | |
0 | 2022 { |
2023 if ( am_byte_4FAA75 ) | |
2024 am_byte_4FAA76 = 1; | |
1197 | 2025 am_408BB4(current_player_num); |
2026 v4 = current_player_num; | |
0 | 2027 byte_4FAA2E = 1; |
2028 } | |
2029 if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 ) | |
2030 amuint_4FAA38 = 10; | |
1197 | 2031 if ( byte_4FAA2E || byte_4FAA2D ||am_Players[v4].IsHisTurn != 1 ) |
0 | 2032 { |
2033 pArcomageGame->field_F6 = 1; | |
2034 if ( byte_4FAA2D ) | |
2035 { | |
2036 --amuint_4FAA38; | |
2037 if ( amuint_4FAA38 < 0 ) | |
2038 { | |
2039 byte_4FAA2D = 0; | |
2040 amuint_4FAA38 = 10; | |
2041 v16 = 0; | |
2042 } | |
2043 } | |
2044 if ( byte_4FAA2E ) | |
2045 { | |
2046 --v13; | |
2047 if ( v13 < 0 ) | |
2048 { | |
2049 if ( dword_4FAA68 > 1 ) | |
2050 { | |
2051 --dword_4FAA68; | |
2052 byte_4FAA00 = 0; | |
2053 } | |
2054 else | |
2055 { | |
2056 v16 = 1; | |
2057 } | |
2058 byte_4FAA2E = 0; | |
2059 v13 = 20; | |
2060 } | |
2061 } | |
2062 } | |
2063 else | |
2064 { | |
2065 if ( am_byte_4FAA77 ) | |
2066 { | |
2067 if ( a2.field_0 == 7 && am_40BCFB(a1, dword_4FABBC) ) | |
2068 { | |
2069 if ( am_byte_4FAA75 ) | |
2070 am_byte_4FAA76 = 1; | |
2071 if ( dword_4FAA64 > 0 ) | |
2072 { | |
2073 --dword_4FAA64; | |
1185 | 2074 am_byte_4FAA77 = GetPlayerHandCardCount(a1) > dword_4E1874; |
0 | 2075 } |
2076 byte_4FAA2E = 1; | |
2077 } | |
2078 if ( a2.field_0 == 8 && am_40BCFB(a1, dword_4FABBC) ) | |
2079 { | |
2080 if ( am_byte_4FAA75 ) | |
2081 am_byte_4FAA76 = 1; | |
2082 if ( dword_4FAA64 > 0 ) | |
2083 { | |
2084 --dword_4FAA64; | |
1185 | 2085 am_byte_4FAA77 = GetPlayerHandCardCount(a1) > dword_4E1874; |
0 | 2086 } |
2087 byte_4FAA2E = 1; | |
2088 } | |
2089 } | |
2090 else | |
2091 { | |
2092 if ( a2.field_0 == 7 ) | |
2093 { | |
1197 | 2094 if ( PlayCard(a1, dword_4FABBC) ) |
0 | 2095 { |
2096 byte_4FAA2E = 1; | |
2097 if ( am_byte_4FAA75 ) | |
2098 am_byte_4FAA76 = 1; | |
2099 } | |
2100 } | |
2101 if ( a2.field_0 == 8 ) | |
2102 { | |
2103 if ( am_40BCFB(a1, dword_4FABBC) ) | |
2104 { | |
2105 byte_4FAA2E = 1; | |
2106 if ( am_byte_4FAA75 ) | |
2107 am_byte_4FAA76 = 1; | |
2108 } | |
2109 } | |
2110 } | |
2111 } | |
2112 //nullsub_1(); | |
2113 if ( false ) | |
2114 { | |
2115 if ( !v15 ) | |
2116 { | |
2117 //nullsub_1(); | |
2118 v15 = 1; | |
2119 } | |
2120 } | |
2121 else | |
2122 { | |
2123 v15 = 0; | |
2124 } | |
2125 if ( false ) | |
2126 { | |
2127 //nullsub_1(); | |
2128 //nullsub_1(); | |
1033 | 2129 assert(false && "Invalid strcpy params"); |
2130 inv_strcpy(nullptr, Dest); | |
0 | 2131 v5 = 0;//unk::const_0(&unk_4E19FC, 0); |
2132 //nullsub_1(); | |
2133 if ( v5 == 1 ) | |
2134 { | |
2135 pAudioPlayer->StopChannels(-1, -1); | |
2136 v16 = 1; | |
2137 pArcomageGame->field_F4 = 1; | |
2138 dword_4FAA68 = 0; | |
2139 } | |
1194 | 2140 /*v10[0] = 0; |
0 | 2141 v10[2] = 640; |
2142 v10[1] = 0; | |
1194 | 2143 v10[3] = 480;*/ |
0 | 2144 //nullsub_1(); |
2145 } | |
1194 | 2146 /* if ( dword_4FABB8 != am_40BB67(a1) ) |
0 | 2147 { |
1194 | 2148 dword_4FABB8 = am_40BB67(a1); |
2149 pArcomageGame->field_F6 = 1; | |
2150 }*/ | |
0 | 2151 if ( pArcomageGame->field_F6 ) |
2152 { | |
1197 | 2153 DrawGameUI(v13); |
0 | 2154 DoBlt_Copy(pArcomageGame->pBackgroundPixels); |
2155 pArcomageGame->field_F6 = 0; | |
2156 } | |
2157 if ( pArcomageGame->field_F9 ) | |
2158 { | |
1194 | 2159 pTargetXY.x = 0; |
2160 pTargetXY.y = 0; | |
2161 pSrcXYZW.left = 0; | |
2162 pSrcXYZW.right = 640; | |
2163 pSrcXYZW.top = 0; | |
2164 pSrcXYZW.bottom = 480; | |
0 | 2165 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1194 | 2166 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
0 | 2167 am_EndScene(); |
1197 | 2168 DrawGameUI(v13); |
0 | 2169 pRenderer->Present(); |
2170 pArcomageGame->field_F9 = 0; | |
2171 } | |
2172 } | |
2173 while ( !v16 ); | |
2174 return dword_4FAA68 > 0; | |
2175 } | |
1194 | 2176 |
0 | 2177 |
2178 //----- (0040A9AF) -------------------------------------------------------- | |
1197 | 2179 void DrawGameUI( int a1 ) |
1185 | 2180 { |
2181 | |
0 | 2182 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1197 | 2183 DrawRectanglesForText(); |
0 | 2184 am_EndScene(); |
1197 | 2185 |
0 | 2186 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
2187 am_40B4B9(); | |
1197 | 2188 DrawPlayersTowers(); |
2189 DrawPlayersWall(); | |
2190 DrawPlayersText(); | |
0 | 2191 am_EndScene(); |
1197 | 2192 |
0 | 2193 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1185 | 2194 am_40B76F(a1); |
2195 | |
2196 for( int i=0; i<10; ++i) | |
2197 { | |
2198 if (array_4FABD0[i].field_0) | |
2199 array_4FABD0[i].field_40->_40E133(); | |
2200 } | |
1197 | 2201 dword_4FABBC = am_40BB67(current_player_num); |
0 | 2202 am_40AA4E(); |
2203 am_EndScene(); | |
2204 } | |
2205 | |
2206 //----- (0040AA4E) -------------------------------------------------------- | |
1185 | 2207 void am_40AA4E() |
2208 { | |
0 | 2209 int v5; // [sp-4h] [bp-2Ch]@4 |
1185 | 2210 unsigned int v7; |
0 | 2211 int v8; // [sp+14h] [bp-14h]@10 |
2212 int v9; // [sp+18h] [bp-10h]@10 | |
1185 | 2213 RECT pXYZW; |
2214 | |
2215 v9 = 0x0000FF00; | |
2216 v8 = 0x000000FF; | |
2217 | |
2218 for (int i=0; i<10; ++i) | |
0 | 2219 { |
1185 | 2220 if(array_4FABD0[i].field_0 && (array_4FABD0[i].field_40->_40E2A7()==2)) |
2221 { | |
2222 | |
2223 v5 = v9; | |
2224 if ( !array_4FABD0[i].field_1 ) | |
2225 v5 = v8; | |
2226 | |
2227 v7 = R8G8B8_to_TargetFormat(v5); | |
2228 for(int j=0; j<150; ++j ) | |
2229 { | |
2230 if (array_4FABD0[i].field_44[j].field_0 > 0) | |
2231 { | |
2232 if (j%2) | |
2233 SetPixel(&array_4FABD0[i].field_44[j].field_4, v7); | |
2234 else | |
2235 { | |
2236 pXYZW.left = array_4FABD0[i].field_44[j].field_4.x; | |
2237 pXYZW.right = pXYZW.left + 2; | |
2238 pXYZW.top = array_4FABD0[i].field_44[j].field_4.y; | |
2239 pXYZW.bottom = pXYZW.top + 2; | |
2240 DrawRect(&pXYZW, v7, 1); | |
2241 } | |
2242 } | |
2243 } | |
2244 } | |
0 | 2245 } |
1185 | 2246 |
0 | 2247 } |
2248 | |
2249 //----- (0040AB0A) -------------------------------------------------------- | |
1197 | 2250 void DrawRectanglesForText() |
2251 { | |
1183 | 2252 |
2253 RECT pSrcRect; // [sp+Ch] [bp-18h]@1 | |
2254 POINT pTargetXY; // [sp+1Ch] [bp-8h]@1 | |
1197 | 2255 //resources rectangles |
1183 | 2256 pSrcRect.top = 0; |
2257 pSrcRect.left = 765; | |
2258 pSrcRect.right = 843; | |
2259 pSrcRect.bottom = 216; | |
2260 | |
2261 pTargetXY.x = 8; | |
2262 pTargetXY.y = 56; | |
2263 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
2264 | |
2265 pTargetXY.x = 555; | |
2266 pTargetXY.y = 56; | |
2267 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
2268 | |
1197 | 2269 //players name rectangle |
1183 | 2270 pSrcRect.left = 283; |
2271 pSrcRect.right = 361; | |
2272 pSrcRect.top = 166; | |
2273 pSrcRect.bottom = 190; | |
2274 pTargetXY.x = 8; | |
2275 pTargetXY.y = 13; | |
2276 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2277 | |
2278 pTargetXY.x = 555; | |
2279 pTargetXY.y = 13; | |
2280 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2281 | |
1197 | 2282 //tower heigth rectangle |
1183 | 2283 pSrcRect.left = 234; |
2284 pSrcRect.right = 283; | |
2285 pSrcRect.top = 166; | |
2286 pSrcRect.bottom = 190; | |
2287 pTargetXY.x = 100; | |
2288 pTargetXY.y = 296; | |
2289 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2290 | |
2291 pTargetXY.x = 492; | |
2292 pTargetXY.y = 296; | |
2293 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2294 | |
1197 | 2295 //wall heigth rectangle |
1183 | 2296 pSrcRect.left = 192; |
2297 pSrcRect.right = 234; | |
2298 pSrcRect.top = 166; | |
2299 pSrcRect.bottom = 190; | |
2300 pTargetXY.x = 168; | |
2301 pTargetXY.y = 296; | |
2302 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2303 | |
2304 pTargetXY.x = 430; | |
2305 pTargetXY.y = 296; | |
2306 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
0 | 2307 } |
2308 | |
2309 //----- (0040AC5F) -------------------------------------------------------- | |
1197 | 2310 void DrawPlayersText() |
2311 { | |
2312 | |
2313 int res_value; // ecx@18 | |
2314 char text_buff[32]; // [sp+Ch] [bp-28h]@2 | |
2315 POINT text_position; // [sp+2Ch] [bp-8h]@2 | |
0 | 2316 |
2317 if ( am_byte_4FAA77 ) | |
2318 { | |
1197 | 2319 inv_strcpy(pGlobalTXT_LocalizationStrings[266], text_buff);// DISCARD A CARD |
2320 text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2; | |
2321 text_position.y = 306; | |
2322 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
0 | 2323 } |
1197 | 2324 inv_strcpy(am_Players[0].pPlayerName, text_buff); |
2325 if ( !current_player_num ) | |
2326 inv_strcat("***", text_buff); | |
2327 text_position.x = 47 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2328 text_position.y = 21; | |
2329 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2330 | |
2331 inv_strcpy(am_Players[1].pPlayerName, text_buff); | |
2332 if ( current_player_num == 1 ) | |
2333 inv_strcat("***", text_buff); | |
2334 text_position.x = 595 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2335 text_position.y = 21; | |
2336 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2337 | |
2338 intToString(am_Players[0].tower_height, text_buff); | |
2339 text_position.x = 123 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2340 text_position.y = 305; | |
2341 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2342 | |
2343 intToString(am_Players[1].tower_height, text_buff); | |
2344 text_position.x = 515 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2345 text_position.y = 305; | |
2346 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2347 | |
2348 intToString(am_Players[0].wall_height, text_buff); | |
2349 text_position.x = 188 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2350 text_position.y = 305; | |
2351 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2352 | |
2353 intToString(am_Players[1].wall_height, text_buff); | |
2354 text_position.x = 451 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2355 text_position.y = 305; | |
2356 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2357 | |
2358 res_value = am_Players[0].quarry_level; | |
0 | 2359 if ( byte_4E185E ) |
1197 | 2360 res_value =am_Players[0].quarry_level + quarry_bonus; |
2361 intToString(res_value, text_buff); | |
2362 text_position.x = 14;// - 6 * 0 / 2; | |
2363 text_position.y = 92; | |
2364 DrawPlayerLevels(-1, text_buff, &text_position); | |
2365 | |
2366 res_value = am_Players[1].quarry_level; | |
0 | 2367 if ( byte_4E185E ) |
1197 | 2368 res_value = am_Players[1].quarry_level + quarry_bonus; |
2369 intToString(res_value, text_buff); | |
2370 // v2 = 0; | |
2371 text_position.y = 92; | |
2372 text_position.x = 561; //- 6 * v2 / 2; | |
2373 DrawPlayerLevels(-1, text_buff, &text_position); | |
2374 | |
2375 res_value = am_Players[0].magic_level; | |
0 | 2376 if ( byte_4E185E ) |
1197 | 2377 res_value = am_Players[0].magic_level + magic_bonus; |
2378 intToString(res_value, text_buff); | |
2379 // v4 = 0; | |
2380 text_position.y = 164; | |
2381 text_position.x = 14; //- 6 * v4 / 2; | |
2382 DrawPlayerLevels(-1, text_buff, &text_position); | |
2383 | |
2384 res_value = am_Players[1].magic_level; | |
0 | 2385 if ( byte_4E185E ) |
1197 | 2386 res_value = am_Players[1].magic_level+magic_bonus; |
2387 intToString(res_value, text_buff); | |
2388 // v6 = 0; | |
2389 text_position.y = 164; | |
2390 text_position.x = 561; //- 6 * v6 / 2; | |
2391 DrawPlayerLevels(-1, text_buff, &text_position); | |
2392 | |
2393 res_value = am_Players[0].might_level; | |
0 | 2394 if ( byte_4E185E ) |
1197 | 2395 res_value = am_Players[0].might_level + might_bonus; |
2396 intToString(res_value, text_buff); | |
2397 // v8 = 0; | |
2398 text_position.y = 236; | |
2399 text_position.x = 14;// - 6 * v8 / 2; | |
2400 DrawPlayerLevels(-1, text_buff, &text_position); | |
2401 | |
2402 res_value = am_Players[1].might_level; | |
0 | 2403 if ( byte_4E185E ) |
1197 | 2404 res_value = am_Players[1].might_level + might_bonus; |
2405 intToString(res_value, text_buff); | |
2406 // v10 = 0; | |
2407 text_position.y = 236; | |
2408 text_position.x = 561;// - 6 * v10 / 2; | |
2409 DrawPlayerLevels(-1, text_buff, &text_position); | |
2410 | |
2411 intToString(am_Players[0].resource_bricks, text_buff); | |
2412 text_position.y = 114; | |
2413 text_position.x = 10; | |
2414 DrawBricksCount(-1, text_buff, &text_position); | |
2415 | |
2416 intToString(am_Players[1].resource_bricks, text_buff); | |
2417 text_position.x = 557; | |
2418 text_position.y = 114; | |
2419 DrawBricksCount(-1, text_buff, &text_position); | |
2420 | |
2421 intToString(am_Players[0].resource_gems, text_buff); | |
2422 text_position.x = 10; | |
2423 text_position.y = 186; | |
2424 DrawGemsCount(-1, text_buff, &text_position); | |
2425 | |
2426 intToString(am_Players[1].resource_gems, text_buff); | |
2427 text_position.x = 557; | |
2428 text_position.y = 186; | |
2429 DrawGemsCount(-1, text_buff, &text_position); | |
2430 | |
2431 intToString(am_Players[0].resource_beasts, text_buff); | |
2432 text_position.x = 10; | |
2433 text_position.y = 258; | |
2434 DrawBeastsCount(-1, text_buff, &text_position); | |
2435 | |
2436 intToString(am_Players[1].resource_beasts, text_buff); | |
2437 text_position.x = 557; | |
2438 text_position.y = 258; | |
2439 DrawBeastsCount(-1, text_buff, &text_position); | |
0 | 2440 } |
1197 | 2441 |
0 | 2442 |
2443 //----- (0040B102) -------------------------------------------------------- | |
1197 | 2444 void DrawPlayerLevels( int a1, char *text, POINT *pXY ) |
0 | 2445 { |
1194 | 2446 char *v3; // esi@1 |
2447 unsigned char test_char; // bl@2 | |
2448 int v7; // eax@3 | |
2449 RECT pSrcRect; | |
2450 POINT pTargetPoint; | |
2451 | |
2452 v3 = text; | |
2453 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2454 pTargetPoint.x = pXY->x; | |
2455 pTargetPoint.y = pXY->y; | |
2456 do | |
2457 { | |
2458 test_char = *v3; | |
2459 ++v3; | |
2460 if ( test_char ) | |
2461 { | |
2462 v7 = 22 * test_char; | |
2463 pSrcRect.right = v7 - 842; | |
2464 pSrcRect.left = v7 - 864; | |
2465 pSrcRect.top = 190; | |
2466 pSrcRect.bottom = 207; | |
2467 Blt_Chroma(&pSrcRect, &pTargetPoint, pArcomageGame->field_54, 1); | |
2468 pTargetPoint.x += 22; | |
2469 } | |
2470 } | |
2471 while ( test_char!= 0 ); | |
2472 am_EndScene(); | |
0 | 2473 } |
2474 | |
2475 //----- (0040B17E) -------------------------------------------------------- | |
1197 | 2476 void DrawBricksCount( int a1, char* text, POINT *pXY ) |
0 | 2477 { |
1194 | 2478 |
2479 char *v3; // esi@1 | |
2480 unsigned char test_char; // bl@2 | |
2481 int v7; // eax@3 | |
2482 RECT pSrcRect; | |
2483 POINT pTargetPoint; | |
2484 | |
2485 v3 = text; | |
2486 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2487 pTargetPoint.x = pXY->x; | |
2488 pTargetPoint.y = pXY->y; | |
2489 do | |
2490 { | |
2491 test_char = *v3; | |
2492 ++v3; | |
2493 if ( test_char ) | |
2494 { | |
2495 v7 = 13 * test_char; | |
1197 | 2496 pSrcRect.left = v7 - 370; |
2497 pSrcRect.right = v7 - 357; | |
1194 | 2498 pSrcRect.top = 128; |
2499 pSrcRect.bottom = 138; | |
2500 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2501 pTargetPoint.x += 13; | |
2502 } | |
2503 } | |
2504 while ( test_char!= 0 ); | |
2505 am_EndScene(); | |
2506 | |
0 | 2507 } |
2508 | |
2509 //----- (0040B1F3) -------------------------------------------------------- | |
1197 | 2510 void DrawGemsCount( int a1, char* text, POINT* pXY ) |
0 | 2511 { |
1194 | 2512 |
2513 char *v3; // esi@1 | |
2514 unsigned char test_char; // bl@2 | |
2515 int v7; // eax@3 | |
2516 RECT pSrcRect; | |
2517 POINT pTargetPoint; | |
2518 | |
2519 v3 = text; | |
2520 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2521 pTargetPoint.x = pXY->x; | |
2522 pTargetPoint.y = pXY->y; | |
2523 do | |
2524 { | |
2525 test_char = *v3; | |
2526 ++v3; | |
2527 if ( test_char ) | |
2528 { | |
2529 v7 = 13 * test_char; | |
1197 | 2530 pSrcRect.left = v7 - 370; |
2531 pSrcRect.right = v7 - 357; | |
1194 | 2532 pSrcRect.top = 138; |
2533 pSrcRect.bottom = 148; | |
2534 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2535 pTargetPoint.x += 13; | |
2536 } | |
2537 } | |
2538 while ( test_char!= 0 ); | |
2539 am_EndScene(); | |
2540 | |
0 | 2541 } |
2542 | |
2543 //----- (0040B268) -------------------------------------------------------- | |
1197 | 2544 void DrawBeastsCount( int a1, char *text, POINT *pXY ) |
0 | 2545 { |
1194 | 2546 |
2547 char *v3; // esi@1 | |
2548 unsigned char test_char; // bl@2 | |
2549 int v7; // eax@3 | |
2550 RECT pSrcRect; | |
2551 POINT pTargetPoint; | |
2552 | |
2553 v3 = text; | |
2554 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2555 pTargetPoint.x = pXY->x; | |
2556 pTargetPoint.y = pXY->y; | |
2557 do | |
2558 { | |
2559 test_char = *v3; | |
2560 ++v3; | |
2561 if ( test_char ) | |
2562 { | |
2563 v7 = 13 * test_char; | |
1197 | 2564 pSrcRect.left = v7 - 370; |
2565 pSrcRect.right = v7 - 357; | |
1194 | 2566 pSrcRect.top = 148; |
2567 pSrcRect.bottom = 158; | |
2568 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2569 pTargetPoint.x += 13; | |
2570 } | |
2571 } | |
2572 while ( test_char!= 0 ); | |
2573 am_EndScene(); | |
2574 | |
0 | 2575 } |
2576 | |
2577 //----- (0040B2DD) -------------------------------------------------------- | |
1197 | 2578 void DrawPlayersTowers() |
2579 { | |
2580 int tower_height; // eax@1 | |
2581 int tower_top; // esi@3 | |
1194 | 2582 RECT pSrcXYZW; // [sp+0h] [bp-18h]@3 |
2583 POINT pTargetXY; // [sp+10h] [bp-8h]@3 | |
2584 | |
1197 | 2585 tower_height= am_Players[0].tower_height; |
2586 if ( am_Players[0].tower_height > max_tower_height ) | |
2587 tower_height = max_tower_height; | |
1194 | 2588 pSrcXYZW.top = 0; |
2589 pSrcXYZW.left = 892; | |
2590 pSrcXYZW.right = 937; | |
1197 | 2591 tower_top = 200 * tower_height / max_tower_height; |
2592 pSrcXYZW.bottom = tower_top; | |
1194 | 2593 pTargetXY.x = 102; |
1197 | 2594 pTargetXY.y = 297 - tower_top; |
1194 | 2595 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
2596 | |
2597 pSrcXYZW.top = 0; | |
2598 pSrcXYZW.left = 384; | |
2599 pSrcXYZW.right = 452; | |
2600 pSrcXYZW.bottom = 94; | |
1197 | 2601 pTargetXY.y = 203 - tower_top; |
1194 | 2602 pTargetXY.x = 91; |
2603 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2604 | |
1197 | 2605 |
2606 tower_height = am_Players[1].tower_height; | |
2607 if (am_Players[1].tower_height > max_tower_height ) | |
2608 tower_height = max_tower_height; | |
2609 tower_top = 200 * tower_height / max_tower_height; | |
2610 pSrcXYZW.top = 0; | |
2611 pSrcXYZW.left = 892; | |
2612 pSrcXYZW.right = 937; | |
2613 pSrcXYZW.bottom = tower_top; | |
2614 | |
1194 | 2615 pTargetXY.x = 494; |
1197 | 2616 pTargetXY.y = 297 - tower_top; |
1194 | 2617 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
1197 | 2618 //draw tower up cone |
2619 pSrcXYZW.left = 384; | |
2620 pSrcXYZW.right = 452; | |
2621 pSrcXYZW.top = 94; | |
1194 | 2622 pSrcXYZW.bottom = 188; |
1197 | 2623 |
1194 | 2624 pTargetXY.x = 483; |
1197 | 2625 pTargetXY.y = 203 - tower_top; |
1194 | 2626 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); |
2627 | |
0 | 2628 } |
2629 // 4E1884: using guessed type int dword_4E1884; | |
2630 | |
2631 //----- (0040B400) -------------------------------------------------------- | |
1197 | 2632 void DrawPlayersWall() |
2633 { | |
1194 | 2634 int v0; // eax@1 |
2635 int v1; // eax@4 | |
2636 LONG v2; // ecx@4 | |
2637 int v3; // eax@5 | |
2638 int v4; // eax@8 | |
2639 LONG v5; // esi@8 | |
2640 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4 | |
2641 POINT pTargetXY; // [sp+14h] [bp-8h]@4 | |
2642 | |
1197 | 2643 v0 = am_Players[0].wall_height; |
2644 if ( am_Players[0].wall_height <= 100 ) | |
1194 | 2645 { |
1197 | 2646 if ( am_Players[0].wall_height <= 0 ) |
1194 | 2647 goto LABEL_5; |
2648 } | |
2649 else | |
2650 { | |
2651 v0 = 100; | |
2652 } | |
2653 pSrcXYZW.top = 0; | |
2654 pSrcXYZW.left = 843; | |
2655 v1 = 200 * v0 / 100; | |
2656 pSrcXYZW.right = 867; | |
2657 pSrcXYZW.bottom = v1; | |
2658 pTargetXY.x = 177; | |
2659 pTargetXY.y = 297 - v1; | |
2660 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2661 | |
2662 LABEL_5: | |
1197 | 2663 v3 = am_Players[1].wall_height; |
2664 if ( am_Players[1].wall_height <= 100 ) | |
1194 | 2665 { |
1197 | 2666 if ( am_Players[1].wall_height <= 0 ) |
1194 | 2667 return; |
2668 } | |
2669 else | |
2670 { | |
2671 v3 = 100; | |
2672 } | |
2673 pSrcXYZW.top = 0; | |
2674 pSrcXYZW.left = 843; | |
2675 v4 = 200 * v3 / 100; | |
2676 pSrcXYZW.right = 867; | |
2677 pSrcXYZW.bottom = v4; | |
2678 pTargetXY.x = 439; | |
2679 pTargetXY.y = 297 - v4; | |
2680 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2681 | |
0 | 2682 } |
2683 | |
2684 //----- (0040B4B9) -------------------------------------------------------- | |
2685 void __cdecl am_40B4B9() | |
2686 { | |
1183 | 2687 // int v0; // esi@1 |
2688 // int v1; // ebx@1 | |
2689 // int v2; // edi@1 | |
2690 // int v3; // edx@2 | |
2691 // int v4; // eax@3 | |
2692 // int v5; // ecx@3 | |
2693 // int v6; // eax@3 | |
2694 // unsigned int v7; // ecx@4 | |
2695 // int v8; // eax@16 | |
2696 // int v9; // ecx@16 | |
2697 // int v10; // eax@16 | |
2698 // signed int v11; // edi@18 | |
2699 // int v12; // esi@20 | |
2700 // unsigned int v13; // ecx@20 | |
2701 // int v14; // eax@23 | |
2702 // unsigned int v15; // eax@25 | |
2703 // unsigned int v16; // ecx@25 | |
2704 // int *v17; // esi@26 | |
2705 // unsigned int v18; // eax@29 | |
2706 // int *v19; // ecx@29 | |
2707 // int v20; // ecx@31 | |
2708 // int v21; // [sp-4h] [bp-2Ch]@8 | |
2709 // int pSrcXYZW[4]; // [sp+Ch] [bp-1Ch]@8 | |
2710 // int pTargetXY[2]; // [sp+1Ch] [bp-Ch]@1 | |
2711 // int v24; // [sp+24h] [bp-4h]@1 | |
2712 // | |
1185 | 2713 // v0 = GetPlayerHandCardCount(amuint_4FAA6C); |
1183 | 2714 // v1 = 0; |
2715 // v2 = 0; | |
2716 // pTargetXY[1] = 327; | |
2717 // v24 = (640 - 96 * v0) / (v0 + 1); | |
2718 // pTargetXY[0] = (640 - 96 * v0) / (v0 + 1); | |
2719 // while ( v2 < v0 ) | |
2720 // { | |
2721 // v3 = amuint_4FAA6C; | |
2722 // if ( am_byte_4E185D != (_BYTE)v1 ) | |
2723 // { | |
2724 // v4 = 188 * amuint_4FAA6C + 8 * v2; | |
2725 // v5 = *(int *)((char *)stru_505708[0].arr_6C[0] + v4); | |
2726 // v6 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v4); | |
2727 // pTargetXY[0] += v5; | |
2728 // pTargetXY[1] += v6; | |
2729 // } | |
2730 // v7 = stru_505708[0].cards_at_hand[v2 + 47 * amuint_4FAA6C]; | |
2731 // if ( v7 == -1 ) | |
2732 // { | |
2733 // ++v0; | |
2734 // goto LABEL_15; | |
2735 // } | |
2736 // if ( v2 != amuint_4FAA4C ) | |
2737 // { | |
2738 // if ( LOBYTE(stru_505708[amuint_4FAA6C].field_20) == (_BYTE)v1 && byte_505881 == (_BYTE)v1 ) | |
2739 // { | |
2740 // pSrcXYZW[0] = 192; | |
2741 // pSrcXYZW[2] = 288; | |
2742 // pSrcXYZW[1] = v1; | |
2743 // pSrcXYZW[3] = 128; | |
2744 // v21 = 2; | |
2745 //LABEL_12: | |
2746 // Blt_Copy(pSrcXYZW, pTargetXY, v21); | |
2747 // goto LABEL_13; | |
2748 // } | |
2749 // ArcomageGame::GetCardRect(v7, pSrcXYZW); | |
2750 // if ( !am_40BF15(amuint_4FAA6C, v2) ) | |
2751 // { | |
2752 // v1 = 0; | |
2753 // v21 = 0; | |
2754 // goto LABEL_12; | |
2755 // } | |
2756 // Blt_Copy(pSrcXYZW, pTargetXY, 2); | |
2757 // v1 = 0; | |
2758 // } | |
2759 //LABEL_13: | |
2760 // v3 = amuint_4FAA6C; | |
2761 // pTargetXY[0] += v24 + 96; | |
2762 //LABEL_15: | |
2763 // if ( am_byte_4E185D != (_BYTE)v1 ) | |
2764 // { | |
2765 // v8 = 188 * v3 + 8 * v2; | |
2766 // v9 = *(int *)((char *)stru_505708[0].arr_6C[0] + v8); | |
2767 // v10 = *(int *)((char *)&stru_505708[0].arr_6C[0][1] + v8); | |
2768 // pTargetXY[0] -= v9; | |
2769 // pTargetXY[1] -= v10; | |
2770 // } | |
2771 // ++v2; | |
2772 // } | |
2773 // v11 = 0; | |
2774 // do | |
2775 // { | |
2776 // if ( am_byte_4FAA76 == (_BYTE)v1 ) | |
2777 // { | |
2778 // v12 = 4 * v11; | |
2779 // v13 = amuint_4FAA78[8 * v11]; | |
2780 // if ( v13 != -1 ) | |
2781 // { | |
2782 // ArcomageGame::GetCardRect(v13, pSrcXYZW); | |
2783 // Blt_Copy((ArcomageRect *)pSrcXYZW, amuint_4FAA90[v12], v1); | |
2784 // } | |
2785 // if ( am_byte_4FAA7C[v12 * 8] != (_BYTE)v1 ) | |
2786 // { | |
2787 // pTargetXY[0] = amuint_4FAA90[v12][0] + 12; | |
2788 // v14 = amuint_4FAA90[v12][1] + 40; | |
2789 // pTargetXY[1] = amuint_4FAA90[v12][1] + 40; | |
2790 // LOWORD(v14) = pArcomageGame->field_54; | |
2791 // pSrcXYZW[0] = 843; | |
2792 // pSrcXYZW[2] = 916; | |
2793 // pSrcXYZW[1] = 200; | |
2794 // pSrcXYZW[3] = 216; | |
2795 // Blt_Chroma(pSrcXYZW, pTargetXY, v14, 2); | |
2796 // } | |
2797 // } | |
2798 // else | |
2799 // { | |
2800 // if ( amuint_4FAA34 <= v1 ) | |
2801 // { | |
2802 // if ( v11 == 9 ) | |
2803 // { | |
2804 // am_byte_4FAA76 = v1; | |
2805 // am_byte_4FAA75 = v1; | |
2806 // amuint_4FAA34 = 5; | |
2807 // } | |
2808 // v18 = 32 * v11; | |
2809 // v19 = &amuint_4FAA78[8 * v11]; | |
2810 // if ( *v19 != -1 ) | |
2811 // amuint_4FABC4 = *v19; | |
2812 // *v19 = -1; | |
2813 // amuint_4FAA90[v18 / 8][0] = amuint_4FAA80[v18 / 4]; | |
2814 // v20 = amuint_4FAA84[v18 / 4]; | |
2815 // am_byte_4FAA7C[v18] = v1; | |
2816 // amuint_4FAA90[v18 / 8][1] = v20; | |
2817 // } | |
2818 // else | |
2819 // { | |
2820 // v15 = 32 * v11; | |
2821 // v16 = amuint_4FAA78[8 * v11]; | |
2822 // if ( v16 != -1 ) | |
2823 // { | |
2824 // v17 = amuint_4FAA90[v15 / 8]; | |
2825 // *v17 += amuint_4FAA88[v15 / 4]; | |
2826 // amuint_4FAA90[v15 / 8][1] += amuint_4FAA8C[v15 / 4]; | |
2827 // ArcomageGame::GetCardRect(v16, pSrcXYZW); | |
2828 // Blt_Copy(pSrcXYZW, v17, v1); | |
2829 // } | |
2830 // } | |
2831 // } | |
2832 // ++v11; | |
2833 // } | |
2834 // while ( v11 < 10 ); | |
2835 // if ( am_byte_4FAA76 != (_BYTE)v1 ) | |
2836 // --amuint_4FAA34; | |
2837 // pSrcXYZW[0] = 192; | |
2838 // pSrcXYZW[2] = 288; | |
2839 // pSrcXYZW[1] = v1; | |
2840 // pSrcXYZW[3] = 128; | |
2841 // pTargetXY[0] = 120; | |
2842 // pTargetXY[1] = 18; | |
2843 // Blt_Copy(pSrcXYZW, pTargetXY, v1); | |
0 | 2844 } |
2845 // 4E185D: using guessed type char am_byte_4E185D; | |
2846 // 4FAA34: using guessed type int amuint_4FAA34; | |
2847 // 4FAA4C: using guessed type int amuint_4FAA4C; | |
2848 // 4FAA75: using guessed type char am_byte_4FAA75; | |
2849 // 4FAA76: using guessed type char am_byte_4FAA76; | |
2850 // 4FAA78: using guessed type int amuint_4FAA78[]; | |
2851 // 4FAA80: using guessed type int amuint_4FAA80[]; | |
2852 // 4FAA84: using guessed type int amuint_4FAA84[]; | |
2853 // 4FAA88: using guessed type int amuint_4FAA88[]; | |
2854 // 4FAA8C: using guessed type int amuint_4FAA8C[]; | |
2855 // 4FABC4: using guessed type int amuint_4FABC4; | |
2856 // 505881: using guessed type char byte_505881; | |
2857 | |
2858 | |
2859 | |
2860 //----- (0040B76F) -------------------------------------------------------- | |
2861 void __fastcall am_40B76F(int a1) | |
2862 { | |
1183 | 2863 // int v1; // eax@3 |
2864 // int v2; // eax@3 | |
2865 // int v3; // esi@4 | |
2866 // int v4; // eax@4 | |
2867 // int *v5; // edx@6 | |
2868 // int *v6; // ecx@6 | |
2869 // signed int v7; // ebx@11 | |
2870 // int v8; // eax@15 | |
2871 // signed int v9; // ecx@15 | |
2872 // int v10; // eax@20 | |
2873 // int v11; // ecx@20 | |
2874 // int v12; // eax@20 | |
2875 // unsigned int v13; // ecx@21 | |
2876 // double v14; // st7@22 | |
2877 // int *v15; // edx@23 | |
2878 // int v16; // eax@32 | |
2879 // char v17; // zf@37 | |
2880 // int v18; // eax@41 | |
2881 // int v19; // eax@46 | |
2882 // int v20; // ecx@46 | |
2883 // int v21; // eax@46 | |
2884 // int v22; // [sp-4h] [bp-2Ch]@6 | |
2885 // int v23; // [sp-4h] [bp-2Ch]@28 | |
2886 // int pSrcXYZW[4]; // [sp+Ch] [bp-1Ch]@6 | |
2887 // int pTargetXY[2]; // [sp+1Ch] [bp-Ch]@20 | |
2888 // int v26; // [sp+24h] [bp-4h]@1 | |
2889 // | |
2890 // v26 = a1; | |
2891 // if ( amuint_4FAA4C != -1 ) | |
2892 // { | |
2893 // if ( amuint_4FAA38 >= 9 ) | |
2894 // { | |
2895 // am_uint_4FAA44_blt_xy[1] = 18; | |
2896 // am_uint_4FAA44_blt_xy[0] = 120; | |
1185 | 2897 // v1 = GetPlayerHandCardCount(amuint_4FAA6C); |
1183 | 2898 // v2 = (640 - 96 * v1) / v1 + 96; |
2899 // if ( am_byte_4E185D ) | |
2900 // { | |
2901 // v3 = 188 * amuint_4FAA6C + 8 * amuint_4FAA4C; | |
2902 // amuint_4FAA3C_blt_xy[0] = (amuint_4FAA4C * v2 + *(int *)((char *)stru_505708[0].arr_6C[0] + v3) - 120) / 10; | |
2903 // v4 = (*(int *)((char *)&stru_505708[0].arr_6C[0][1] + v3) + 309) / 10; | |
2904 // } | |
2905 // else | |
2906 // { | |
2907 // amuint_4FAA3C_blt_xy[0] = (amuint_4FAA4C * v2 - 120) / 10; | |
2908 // v4 = 30; | |
2909 // } | |
2910 // am_uint_4FAA44_blt_xy[1] += v4; | |
2911 // am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0]; | |
2912 // pSrcXYZW[1] = 0; | |
2913 // amuint_4FAA3C_blt_xy[1] = v4; | |
2914 // pSrcXYZW[0] = 192; | |
2915 // pSrcXYZW[2] = 288; | |
2916 // pSrcXYZW[3] = 128; | |
2917 // v5 = am_uint_4FAA44_blt_xy; | |
2918 // v6 = pSrcXYZW; | |
2919 // goto LABEL_7; | |
2920 // } | |
2921 // pSrcXYZW[1] = 0; | |
2922 // v6 = pSrcXYZW; | |
2923 // v5 = am_uint_4FAA44_blt_xy; | |
2924 // | |
2925 // pSrcXYZW[3] = 128; | |
2926 // pSrcXYZW[2] = 288; | |
2927 // pSrcXYZW[0] = 192; | |
2928 // if ( amuint_4FAA38 ) | |
2929 // { | |
2930 // am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0]; | |
2931 // am_uint_4FAA44_blt_xy[1] += amuint_4FAA3C_blt_xy[1]; | |
2932 //LABEL_7: | |
2933 // Blt_Copy(v6, v5, 2); | |
2934 // goto LABEL_11; | |
2935 // } | |
2936 // am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0]; | |
2937 // am_uint_4FAA44_blt_xy[1] += amuint_4FAA3C_blt_xy[1]; | |
2938 // Blt_Copy(pSrcXYZW, am_uint_4FAA44_blt_xy, 2); | |
2939 // amuint_4FAA4C = -1; | |
2940 // } | |
2941 //LABEL_11: | |
2942 // v7 = (signed int)amuint_4FAA78; | |
2943 // if ( uCardID != -1 ) | |
2944 // { | |
2945 // if ( v26 <= 10 ) | |
2946 // { | |
2947 // if ( v26 == 10 ) | |
2948 // { | |
2949 // ArcomageGame::GetCardRect(uCardID, pSrcXYZW); | |
2950 // v8 = 0; | |
2951 // v9 = (signed int)amuint_4FAA78; | |
2952 // while ( *(unsigned int *)v9 != -1 ) | |
2953 // { | |
2954 // v9 += 32; | |
2955 // ++v8; | |
2956 // if ( v9 >= (signed int)&dword_4FABB8 ) | |
2957 // goto LABEL_20; | |
2958 // } | |
2959 // amuint_4FAA78[8 * v8] = uCardID; | |
2960 // am_byte_4FAA7C[32 * v8] = 1; | |
2961 //LABEL_20: | |
2962 // v10 = 8 * v8; | |
2963 // v11 = amuint_4FAA80[v10]; | |
2964 // v12 = amuint_4FAA84[v10]; | |
2965 // pTargetXY[0] = v11; | |
2966 // pTargetXY[1] = v12; | |
2967 // Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 0); | |
2968 // uCardID = -1; | |
2969 // } | |
2970 // } | |
2971 // else | |
2972 // { | |
2973 // ArcomageGame::GetCardRect(uCardID, pSrcXYZW); | |
2974 // amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0]; | |
2975 // amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1]; | |
2976 // Blt_Copy(pSrcXYZW, amuint_4FAA5C_blt_xy, 0); | |
2977 // } | |
2978 // } | |
2979 // v13 = amuint_4FABC0; | |
2980 // if ( amuint_4FABC0 != -1 ) | |
2981 // { | |
2982 // v14 = (double)v26; | |
2983 // if ( v14 > 15.0 ) | |
2984 // { | |
2985 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
2986 // v15 = amuint_4FAA5C_blt_xy; | |
2987 // amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0]; | |
2988 // amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1]; | |
2989 //LABEL_28: | |
2990 // v23 = 2; | |
2991 //LABEL_29: | |
2992 // Blt_Copy(pSrcXYZW, v15, v23); | |
2993 // return; | |
2994 // } | |
2995 // if ( v14 == 15.0 ) | |
2996 // { | |
2997 // am_40BF77(amuint_4FAA6C, amuint_4FABC0); | |
2998 // v13 = amuint_4FABC0; | |
2999 // goto LABEL_26; | |
3000 // } | |
3001 // if ( v14 == 5.0 ) | |
3002 // { | |
3003 // amuint_4FAA5C_blt_xy[0] = 272; | |
3004 // amuint_4FAA5C_blt_xy[1] = 173; | |
3005 // v16 = 0; | |
3006 // do | |
3007 // { | |
3008 // if ( *(unsigned int *)v7 == -1 ) | |
3009 // break; | |
3010 // v7 += 32; | |
3011 // ++v16; | |
3012 // } | |
3013 // while ( v7 < (signed int)&dword_4FABB8 ); | |
3014 // v26 = 32 * v16; | |
3015 // amuint_4FAA54_blt_xy[0] = (amuint_4FAA80[8 * v16] - 272) / 5; | |
3016 // amuint_4FAA54_blt_xy[1] = (amuint_4FAA84[8 * v16] - 173) / 5; | |
3017 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3018 // pTargetXY[0] = 272; | |
3019 // pTargetXY[1] = 173; | |
3020 // goto LABEL_27; | |
3021 // } | |
3022 // if ( v14 >= 5.0 ) | |
3023 // { | |
3024 // v17 = v26 == 0; | |
3025 // } | |
3026 // else | |
3027 // { | |
3028 // v17 = v26 == 0; | |
3029 // if ( v26 > 0 ) | |
3030 // { | |
3031 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3032 // v15 = amuint_4FAA5C_blt_xy; | |
3033 // amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0]; | |
3034 // amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1]; | |
3035 // v23 = 0; | |
3036 // goto LABEL_29; | |
3037 // } | |
3038 // } | |
3039 // if ( !v17 ) | |
3040 // { | |
3041 //LABEL_26: | |
3042 // ArcomageGame::GetCardRect(v13, pSrcXYZW); | |
3043 // pTargetXY[0] = 272; | |
3044 // pTargetXY[1] = 173; | |
3045 //LABEL_27: | |
3046 // v15 = pTargetXY; | |
3047 // goto LABEL_28; | |
3048 // } | |
3049 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3050 // v18 = 0; | |
3051 // while ( *(unsigned int *)v7 != -1 ) | |
3052 // { | |
3053 // v7 += 32; | |
3054 // ++v18; | |
3055 // if ( v7 >= (signed int)&dword_4FABB8 ) | |
3056 // goto LABEL_46; | |
3057 // } | |
3058 // amuint_4FAA78[8 * v18] = amuint_4FABC0; | |
3059 //LABEL_46: | |
3060 // v19 = 8 * v18; | |
3061 // v20 = amuint_4FAA80[v19]; | |
3062 // v21 = amuint_4FAA84[v19]; | |
3063 // pTargetXY[0] = v20; | |
3064 // pTargetXY[1] = v21; | |
3065 // Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 0); | |
3066 // amuint_4FABC0 = -1; | |
3067 // } | |
0 | 3068 } |
3069 // 4E185D: using guessed type char am_byte_4E185D; | |
3070 // 4FAA38: using guessed type int amuint_4FAA38; | |
3071 // 4FAA4C: using guessed type int amuint_4FAA4C; | |
3072 // 4FAA78: using guessed type int amuint_4FAA78[]; | |
3073 // 4FAA80: using guessed type int amuint_4FAA80[]; | |
3074 // 4FAA84: using guessed type int amuint_4FAA84[]; | |
3075 // 4FABB8: using guessed type int dword_4FABB8; | |
3076 | |
3077 //----- (0040BB12) -------------------------------------------------------- | |
1183 | 3078 void ArcomageGame::GetCardRect(unsigned int uCardID, RECT *pCardRect) |
0 | 3079 { |
3080 int v3; // edx@1 | |
3081 int v4; // ecx@1 | |
3082 | |
3083 v3 = pCards[uCardID].slot % 10; | |
3084 v4 = (pCards[uCardID].slot / 10 << 7) + 220; | |
1183 | 3085 pCardRect->top = v4; |
3086 pCardRect->left = 96 * v3; | |
3087 pCardRect->bottom = v4 + 128; | |
3088 pCardRect->right = 96 * v3 + 96; | |
0 | 3089 } |
3090 | |
3091 //----- (0040BB49) -------------------------------------------------------- | |
1185 | 3092 int GetPlayerHandCardCount( int player_num ) |
3093 { | |
3094 int card_count; // eax@1 | |
3095 | |
3096 card_count = 0; | |
3097 for(int i=0; i<10; ++i) | |
3098 { | |
3099 if (am_Players[player_num].cards_at_hand[i]!=-1) | |
3100 ++card_count; | |
3101 } | |
3102 return card_count; | |
3103 | |
0 | 3104 } |
3105 | |
3106 //----- (0040BB67) -------------------------------------------------------- | |
3107 signed int __fastcall am_40BB67(int a1) | |
3108 { | |
1194 | 3109 |
3110 | |
3111 int v1; // esi@1 | |
3112 signed int result; // eax@1 | |
3113 int v3; // ebx@1 | |
3114 char v4; // zf@1 | |
3115 int v5; // eax@3 | |
3116 int v6; // eax@4 | |
3117 int v7; // ecx@6 | |
3118 char *v8; // eax@6 | |
3119 int v9; // eax@10 | |
3120 int v10; // ecx@10 | |
3121 int v11; // eax@10 | |
3122 char v12; // ch@2@11 | |
3123 int v13; // ST00_4@12 | |
3124 unsigned __int16 v14; // ax@12 | |
3125 int v15; // eax@13 | |
3126 int v16; // ecx@13 | |
3127 int v17; // eax@13 | |
3128 char v18; // al@16 | |
3129 char v19; // ch@2@16 | |
3130 int v20; // ST00_4@19 | |
3131 unsigned __int16 v21; // ax@19 | |
3132 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3 | |
3133 stru273 v26; // [sp+1Ch] [bp-2Ch]@2 | |
3134 int player_num; // [sp+28h] [bp-20h]@1 | |
3135 int v25; // [sp+2Ch] [bp-1Ch]@3 | |
3136 __int32 var18; // [sp+30h] [bp-18h]@3 | |
3137 int i; // [sp+34h] [bp-14h]@4 | |
3138 int v28; // [sp+38h] [bp-10h]@1 | |
3139 int hand_index; // [sp+3Ch] [bp-Ch]@3 | |
3140 int v30; // [sp+40h] [bp-8h]@1 | |
3141 char v31; // [sp+44h] [bp-4h]@12 | |
3142 char v32; // [sp+45h] [bp-3h]@12 | |
3143 char v33; // [sp+46h] [bp-2h]@12 | |
3144 | |
3145 v1 = a1; | |
3146 v30 = 0; | |
3147 result = -1; | |
3148 //v3 = 188 * a1; | |
3149 player_num = a1; | |
3150 //v4 = LOBYTE(am_Players[a1].field_20) == 0; | |
3151 v28 = -1; | |
1197 | 3152 if ( am_Players[a1].IsHisTurn ) |
1194 | 3153 { |
0 | 3154 if ( v26._40DD2F() ) |
3155 { | |
1194 | 3156 v5 = GetPlayerHandCardCount(v1); |
3157 hand_index = 0; | |
3158 v25 = v5; | |
3159 pXYZW.top = 327; | |
3160 pXYZW.bottom = 455; | |
3161 pXYZW.left = (640 - 96 * v5) / (v5 + 1); | |
3162 var18 = pXYZW.left + 96; | |
3163 pXYZW.right = pXYZW.left + 96; | |
3164 if ( v5 > 0 ) | |
0 | 3165 { |
1194 | 3166 // v6 = 47 * v1; |
3167 for ( i = 47 * v1; ; v6 = i ) | |
3168 { | |
3169 v7 = v30; | |
3170 // v8 = &am_Players[0].cards_at_hand[v30 + v6]; | |
3171 | |
3172 for (v7=0; v7<10; ++v7) | |
3173 { | |
3174 if (am_Players[v1].cards_at_hand[v7]!= -1 ) | |
3175 break; | |
3176 } | |
3177 //if ( *v8 ) | |
3178 // { | |
3179 // do | |
3180 // { | |
3181 // //v8 += 4; | |
3182 // ++v7; | |
3183 // } | |
3184 // while ( *v8 == -1 ); | |
3185 v30 = v7; | |
3186 // } | |
3187 if ( am_byte_4E185D ) | |
3188 { | |
3189 // v9 = v3 + 8 * v7; | |
3190 v10 = am_Players[v1].arr_6C[v7].field_0;//*(am_player[0].arr_6C[0] + v9); | |
3191 v11 = am_Players[v1].arr_6C[v7].field_4;//*(&am_player[0].arr_6C[0][1] + v9); | |
3192 pXYZW.left += v10; | |
3193 pXYZW.right += v10; | |
3194 pXYZW.top += v11; | |
3195 pXYZW.bottom += v11; | |
3196 } | |
3197 if (v26.Inside(&pXYZW) ) | |
3198 break; | |
3199 | |
3200 v13=0; | |
3201 v14 = R8G8B8_to_TargetFormat(v13); | |
3202 DrawRect(&pXYZW, v14, 0); | |
3203 pXYZW.left += var18; | |
3204 pXYZW.right += var18; | |
3205 if ( am_byte_4E185D ) | |
3206 { | |
3207 v16 = am_Players[v1].arr_6C[v30].field_0;//*(am_player[0].arr_6C[0] + v15); | |
3208 v17 = am_Players[v1].arr_6C[v30].field_4;//*(&am_player[0].arr_6C[0][1] + v15); | |
3209 pXYZW.left -= v16; | |
3210 pXYZW.right -= v16; | |
3211 pXYZW.top -= v17; | |
3212 pXYZW.bottom -= v17; | |
3213 } | |
3214 ++v30; | |
3215 ++hand_index; | |
3216 if ( hand_index >= v25 ) | |
3217 return v28; | |
3218 } | |
3219 v28 = hand_index; | |
1197 | 3220 v18 = CanCardBePlayed(player_num, hand_index); |
1194 | 3221 if ( v18 ) |
3222 { | |
3223 v20=0x00FFFFFF; | |
3224 } | |
3225 else | |
3226 { | |
3227 v20=0x000000FF; | |
3228 } | |
3229 | |
3230 v21 = R8G8B8_to_TargetFormat(v20); | |
3231 DrawRect(&pXYZW, v21, 0); | |
0 | 3232 } |
3233 } | |
1194 | 3234 result = v28; |
0 | 3235 } |
1194 | 3236 return result; |
3237 | |
3238 | |
3239 | |
3240 // int v1; // esi@1 | |
3241 // signed int result; // eax@1 | |
3242 // int v3; // ebx@1 | |
3243 // char v4; // zf@1 | |
3244 // int v5; // eax@3 | |
3245 // int v6; // eax@4 | |
3246 // int v7; // ecx@6 | |
3247 // char *v8; // eax@6 | |
3248 // int v9; // eax@10 | |
3249 // int v10; // ecx@10 | |
3250 // int v11; // eax@10 | |
3251 // char v12; // ch@2@11 | |
3252 // int v13; // ST00_4@12 | |
3253 // unsigned __int16 v14; // ax@12 | |
3254 // int v15; // eax@13 | |
3255 // int v16; // ecx@13 | |
3256 // int v17; // eax@13 | |
3257 // char v18; // al@16 | |
3258 // char v19; // ch@2@16 | |
3259 // int v20; // ST00_4@19 | |
3260 // unsigned __int16 v21; // ax@19 | |
3261 // int pXYZW[4]; // [sp+Ch] [bp-3Ch]@3 | |
3262 // stru273 v26; // [sp+1Ch] [bp-2Ch]@2 | |
3263 // int a1a; // [sp+28h] [bp-20h]@1 | |
3264 // int v25; // [sp+2Ch] [bp-1Ch]@3 | |
3265 // int var18; // [sp+30h] [bp-18h]@3 | |
3266 // int i; // [sp+34h] [bp-14h]@4 | |
3267 // int v28; // [sp+38h] [bp-10h]@1 | |
3268 // int a2; // [sp+3Ch] [bp-Ch]@3 | |
3269 // int v30; // [sp+40h] [bp-8h]@1 | |
3270 // char v31; // [sp+44h] [bp-4h]@12 | |
3271 // char v32; // [sp+45h] [bp-3h]@12 | |
3272 // char v33; // [sp+46h] [bp-2h]@12 | |
3273 // | |
3274 // v1 = a1; | |
3275 // v30 = 0; | |
3276 // result = -1; | |
3277 // v3 = 188 * a1; | |
3278 // a1a = a1; | |
3279 // v4 = LOBYTE(am_Players[a1].field_20) == 0; | |
3280 // v28 = -1; | |
3281 // if ( !v4 ) | |
3282 // { | |
3283 // if ( v26._40DD2F() ) | |
3284 // { | |
3285 // v5 = GetPlayerHandCardCount(v1); | |
3286 // a2 = 0; | |
3287 // v25 = v5; | |
3288 // pXYZW[1] = 327; | |
3289 // pXYZW[3] = 455; | |
3290 // pXYZW[0] = (640 - 96 * v5) / (v5 + 1); | |
3291 // var18 = pXYZW[0] + 96; | |
3292 // pXYZW[2] = pXYZW[0] + 96; | |
3293 // if ( v5 > 0 ) | |
3294 // { | |
3295 // v6 = 47 * v1; | |
3296 // for ( i = 47 * v1; ; v6 = i ) | |
3297 // { | |
3298 // v7 = v30; | |
3299 // v8 = (char *)&am_Players[0].cards_at_hand[v30 + v6]; | |
3300 // if ( *(unsigned int *)v8 == -1 ) | |
3301 // { | |
3302 // do | |
3303 // { | |
3304 // v8 += 4; | |
3305 // ++v7; | |
3306 // } | |
3307 // while ( *(unsigned int *)v8 == -1 ); | |
3308 // v30 = v7; | |
3309 // } | |
3310 // if ( am_byte_4E185D ) | |
3311 // { | |
3312 // v9 = v3 + 8 * v7; | |
3313 // // v10 = *(int *)((char *)am_Players[0].arr_6C[0] + v9); | |
3314 // // v11 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v9); | |
3315 // pXYZW[0] += v10; | |
3316 // pXYZW[2] += v10; | |
3317 // pXYZW[1] += v11; | |
3318 // pXYZW[3] += v11; | |
3319 // } | |
3320 // if ( true)//v26.Inside(pXYZW) ) | |
3321 // break; | |
3322 // v31 = 0; | |
3323 // v32 = 0; | |
3324 // v33 = 0; | |
3325 // BYTE3(v13) = v12; | |
3326 // LOWORD(v13) = *(_WORD *)&v31; | |
3327 // BYTE2(v13) = 0; | |
3328 // v14 = R8G8B8_to_TargetFormat(v13); | |
3329 // // DrawRect(pXYZW, v14, 0); | |
3330 // pXYZW[0] += var18; | |
3331 // pXYZW[2] += var18; | |
3332 // if ( am_byte_4E185D ) | |
3333 // { | |
3334 // v15 = v3 + 8 * v30; | |
3335 // // v16 = *(int *)((char *)am_Players[0].arr_6C[0] + v15); | |
3336 // // v17 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v15); | |
3337 // pXYZW[0] -= v16; | |
3338 // pXYZW[2] -= v16; | |
3339 // pXYZW[1] -= v17; | |
3340 // pXYZW[3] -= v17; | |
3341 // } | |
3342 // ++v30; | |
3343 // ++a2; | |
3344 // if ( a2 >= v25 ) | |
3345 // goto LABEL_20; | |
3346 // } | |
3347 // v28 = a2; | |
3348 // v18 = am_40BF15(a1a, a2); | |
3349 // v31 = -1; | |
3350 // if ( v18 ) | |
3351 // { | |
3352 // v32 = -1; | |
3353 // v33 = -1; | |
3354 // } | |
3355 // else | |
3356 // { | |
3357 // v32 = 0; | |
3358 // v33 = 0; | |
3359 // } | |
3360 // BYTE3(v20) = v19; | |
3361 // LOWORD(v20) = *(_WORD *)&v31; | |
3362 // BYTE2(v20) = v33; | |
3363 // v21 = R8G8B8_to_TargetFormat(v20); | |
3364 // // DrawRect(pXYZW, v21, 0); | |
3365 // } | |
3366 // } | |
3367 //LABEL_20: | |
3368 // result = v28; | |
3369 // } | |
3370 // return result; | |
0 | 3371 } |
3372 // 4E185D: using guessed type char am_byte_4E185D; | |
3373 | |
3374 //----- (0040BCFB) -------------------------------------------------------- | |
3375 char __fastcall am_40BCFB(int a1, signed int a2) | |
3376 { | |
3377 int v2; // esi@2 | |
3378 signed int v3; // edi@2 | |
3379 char *v4; // eax@2 | |
3380 int v5; // ecx@7 | |
3381 int v6; // ebx@7 | |
3382 int v7; // esi@8 | |
3383 int v8; // eax@8 | |
3384 int v9; // esi@8 | |
3385 int v10; // ecx@8 | |
3386 int v11; // eax@8 | |
3387 int v12; // eax@8 | |
3388 signed int v13; // edx@9 | |
3389 unsigned int v14; // eax@12 | |
3390 char result; // al@12 | |
1194 | 3391 int i; |
0 | 3392 |
3393 if ( a2 <= -1 ) | |
1194 | 3394 return 0; |
0 | 3395 v2 = 0; |
3396 v3 = 0; | |
1194 | 3397 |
3398 for(i=0; i<10; ++i) | |
0 | 3399 { |
1194 | 3400 if ( am_Players[a1].cards_at_hand[i] != -1 ) |
0 | 3401 { |
3402 if ( a2 == v2 ) | |
3403 break; | |
3404 ++v2; | |
3405 } | |
3406 } | |
1194 | 3407 |
3408 if ( pCards[am_Players[a1].cards_at_hand[i]].field_2B) | |
0 | 3409 { |
3410 ArcomageGame::PlaySound(0x16u); | |
1197 | 3411 v7 = current_player_num; |
3412 v8 = GetPlayerHandCardCount(current_player_num); | |
0 | 3413 v9 = 188 * v7 + 8 * v3; |
1185 | 3414 // v10 = 96 * v3 + *(int *)((char *)am_Players[0].arr_6C[0] + v9) + (640 - 96 * v8) / (v8 + 1); |
3415 // v11 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v9) + 327; | |
0 | 3416 amuint_4FAA5C_blt_xy[0] = v10; |
3417 amuint_4FAA5C_blt_xy[1] = v11; | |
3418 v12 = 0; | |
3419 if ( !am_byte_4FAA75 ) | |
3420 { | |
3421 v13 = (signed int)amuint_4FAA78; | |
3422 do | |
3423 { | |
3424 if ( *(unsigned int *)v13 == -1 ) | |
3425 break; | |
3426 v13 += 32; | |
3427 ++v12; | |
3428 } | |
3429 while ( v13 < (signed int)&dword_4FABB8 ); | |
3430 } | |
3431 pArcomageGame->field_F6 = 1; | |
3432 amuint_4FAA54_blt_xy[0] = (amuint_4FAA80[8 * v12] - v10) / 10; | |
3433 amuint_4FAA54_blt_xy[1] = (amuint_4FAA84[8 * v12] - 327) / 10; | |
3434 v14 = *(unsigned int *)v6; | |
3435 *(unsigned int *)v6 = -1; | |
3436 am_byte_4FAA77 = 0; | |
3437 uCardID = v14; | |
3438 result = 1; | |
3439 } | |
3440 else | |
3441 { | |
1194 | 3442 |
0 | 3443 result = 0; |
3444 } | |
3445 return result; | |
3446 } | |
3447 // 4FAA75: using guessed type char am_byte_4FAA75; | |
3448 // 4FAA77: using guessed type char am_byte_4FAA77; | |
3449 // 4FAA78: using guessed type int amuint_4FAA78[]; | |
3450 // 4FAA80: using guessed type int amuint_4FAA80[]; | |
3451 // 4FAA84: using guessed type int amuint_4FAA84[]; | |
3452 // 4FABB8: using guessed type int dword_4FABB8; | |
3453 | |
3454 //----- (0040BE0E) -------------------------------------------------------- | |
1197 | 3455 bool PlayCard( int player_num, signed int card_slot_num ) |
3456 { | |
0 | 3457 bool result; // eax@0 |
3458 int v3; // ebp@1 | |
3459 int v4; // ecx@2 | |
1183 | 3460 ArcomagePlayer *v5; // esi@2 |
0 | 3461 int v6; // edi@2 |
3462 int v7; // eax@2 | |
3463 int v8; // ebx@8 | |
3464 int v9; // eax@8 | |
3465 int v10; // ebx@8 | |
3466 int v11; // ebp@8 | |
3467 int v12; // ecx@8 | |
3468 int v13; // eax@8 | |
3469 ArcomageCard *v14; // eax@8 | |
3470 int v15; // ecx@8 | |
3471 int v16; // ecx@8 | |
3472 | |
1197 | 3473 v3 = player_num; |
3474 if ( card_slot_num <= -1 ) | |
3475 return false; | |
0 | 3476 v4 = 0; |
1183 | 3477 v5 = &am_Players[v3]; |
0 | 3478 v6 = 0; |
1183 | 3479 v7 = (int)v5->cards_at_hand; |
0 | 3480 do |
3481 { | |
3482 if ( *(unsigned int *)v7 != -1 ) | |
3483 { | |
1197 | 3484 if ( card_slot_num == v4 ) |
0 | 3485 break; |
3486 ++v4; | |
3487 } | |
3488 ++v6; | |
3489 v7 += 4; | |
3490 } | |
3491 while ( v6 < 10 ); | |
1197 | 3492 result = CanCardBePlayed(v3, v6); |
0 | 3493 if ( result ) |
3494 { | |
3495 ArcomageGame::PlaySound(0x17u); | |
1197 | 3496 v8 = current_player_num; |
3497 v9 = GetPlayerHandCardCount(current_player_num); | |
0 | 3498 v10 = 188 * v8 + 8 * v6; |
3499 v11 = v6 + 47 * v3; | |
3500 amuint_4FAA54_blt_xy[1] = -30; | |
3501 pArcomageGame->field_F6 = 1; | |
1185 | 3502 //v12 = 96 * v6 + *(int *)((char *)am_Players[0].arr_6C[0] + v10) + (640 - 96 * v9) / (v9 + 1); |
3503 // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327; | |
0 | 3504 amuint_4FAA5C_blt_xy[0] = v12; |
3505 amuint_4FAA5C_blt_xy[1] = v13; | |
3506 amuint_4FAA54_blt_xy[0] = (272 - v12) / 5; | |
1183 | 3507 v14 = &pCards[v5->cards_at_hand[v6]]; |
1197 | 3508 v5->resource_bricks -= v14->needed_bricks; |
3509 v5->resource_beasts -= v14->needed_beasts; | |
3510 v5->resource_gems -= v14->needed_gems; | |
0 | 3511 result = 4 * v11 + 5265228; |
1183 | 3512 v16 = am_Players[0].cards_at_hand[v11]; |
3513 am_Players[0].cards_at_hand[v11] = -1; | |
0 | 3514 amuint_4FABC0 = v16; |
1197 | 3515 return true;; |
0 | 3516 } |
3517 else | |
1197 | 3518 return false; |
3519 | |
0 | 3520 } |
3521 | |
3522 //----- (0040BF15) -------------------------------------------------------- | |
1197 | 3523 bool CanCardBePlayed( int player_num, int hand_card_indx ) |
1185 | 3524 { |
0 | 3525 bool result; // eax@1 |
1197 | 3526 ArcomageCard *test_card; // ecx@1 |
3527 ArcomagePlayer *pPlayer; // esi@1 | |
3528 | |
3529 pPlayer = &am_Players[player_num]; | |
1185 | 3530 result = true; |
1197 | 3531 test_card = &pCards[am_Players[player_num].cards_at_hand[hand_card_indx]]; |
3532 if ( test_card->needed_quarry_level > pPlayer->quarry_level ) | |
1185 | 3533 result = false; |
1197 | 3534 if ( test_card->needed_magic_level > pPlayer->magic_level ) |
1185 | 3535 result = false; |
1197 | 3536 if ( test_card->needed_might_level > pPlayer->might_level ) |
1185 | 3537 result = false; |
1197 | 3538 if ( test_card->needed_bricks > pPlayer->resource_bricks ) |
1185 | 3539 result = false; |
1197 | 3540 if ( test_card->needed_gems > pPlayer->resource_gems ) |
1185 | 3541 result = false; |
1197 | 3542 if ( test_card->needed_beasts > pPlayer->resource_beasts ) |
1185 | 3543 result = false; |
0 | 3544 return result; |
3545 } | |
3546 | |
3547 | |
3548 | |
3549 | |
3550 //----- (0040BF77) -------------------------------------------------------- | |
3551 void __fastcall am_40BF77(int a1, unsigned int uCardID) | |
3552 { | |
1183 | 3553 // ArcomagePlayer *v2; // esi@1 |
3554 // int v3; // eax@1 | |
3555 // ArcomagePlayer *v4; // edi@1 | |
3556 // int v5; // eax@2 | |
3557 // char v6; // sf@2 | |
3558 // unsigned __int8 v7; // of@2 | |
3559 // int v8; // eax@3 | |
3560 // int v9; // eax@4 | |
3561 // char v10; // zf@5 | |
3562 // int v11; // eax@8 | |
3563 // unsigned __int8 v12; // zf@8 | |
3564 // char v13; // sf@8 | |
3565 // unsigned __int8 v14; // of@8 | |
3566 // int v15; // eax@9 | |
3567 // int v16; // eax@10 | |
3568 // char v17; // zf@12 | |
3569 // char v18; // al@15 | |
3570 // int v19; // eax@16 | |
3571 // int v20; // eax@17 | |
3572 // int v21; // eax@22 | |
3573 // int v22; // eax@23 | |
3574 // int v23; // eax@26 | |
3575 // int v24; // edx@26 | |
3576 // signed int v25; // ebx@26 | |
3577 // ArcomageCard *v26; // ebx@28 | |
3578 // int v27; // eax@28 | |
3579 // int v28; // edx@33 | |
3580 // int v29; // eax@33 | |
3581 // int v30; // eax@35 | |
3582 // int v31; // edx@40 | |
3583 // int v32; // eax@40 | |
3584 // int v33; // eax@42 | |
3585 // int v34; // edx@47 | |
3586 // int v35; // eax@47 | |
3587 // int v36; // eax@49 | |
3588 // int v37; // edx@54 | |
3589 // int v38; // eax@54 | |
3590 // bool v39; // eax@56 | |
3591 // int v40; // edx@61 | |
3592 // int v41; // eax@61 | |
3593 // int v42; // eax@63 | |
3594 // int v43; // edx@68 | |
3595 // int v44; // eax@68 | |
3596 // char v45; // al@70 | |
3597 // int v46; // eax@72 | |
3598 // int v47; // edx@77 | |
3599 // int v48; // eax@77 | |
3600 // int v49; // eax@79 | |
3601 // int v50; // edx@84 | |
3602 // int v51; // eax@84 | |
3603 // int v52; // eax@86 | |
3604 // int v53; // eax@91 | |
3605 // int v54; // edx@91 | |
3606 // int v55; // eax@93 | |
3607 // int v56; // eax@98 | |
3608 // int v57; // edx@98 | |
3609 // int v58; // eax@100 | |
3610 // int v59; // eax@105 | |
3611 // int v60; // edx@105 | |
3612 // int v61; // eax@107 | |
3613 // int v62; // eax@112 | |
3614 // int v63; // edx@112 | |
3615 // int v64; // eax@114 | |
3616 // int v65; // eax@119 | |
3617 // int v66; // edx@119 | |
3618 // int v67; // eax@121 | |
3619 // int v68; // eax@126 | |
3620 // int v69; // edx@126 | |
3621 // char v70; // al@128 | |
3622 // int v71; // eax@130 | |
3623 // int v72; // eax@135 | |
3624 // int v73; // edx@135 | |
3625 // int v74; // eax@137 | |
3626 // int v75; // eax@142 | |
3627 // int v76; // edx@142 | |
3628 // int v77; // eax@144 | |
3629 // int v78; // eax@151 | |
3630 // int v79; // ecx@151 | |
3631 // int v80; // eax@155 | |
3632 // int v81; // eax@162 | |
3633 // int v82; // ecx@162 | |
3634 // int v83; // eax@166 | |
3635 // int v84; // eax@173 | |
3636 // int v85; // ecx@173 | |
3637 // int v86; // eax@177 | |
3638 // int v87; // eax@184 | |
3639 // int v88; // ecx@184 | |
3640 // bool v89; // eax@188 | |
3641 // int v90; // eax@195 | |
3642 // int v91; // ecx@195 | |
3643 // int v92; // eax@199 | |
3644 // int v93; // eax@206 | |
3645 // int v94; // ecx@206 | |
3646 // char v95; // al@210 | |
3647 // int v96; // eax@211 | |
3648 // int v97; // edx@211 | |
3649 // int v98; // eax@211 | |
3650 // int v99; // eax@211 | |
3651 // int v100; // eax@212 | |
3652 // int v101; // eax@219 | |
3653 // int v102; // ecx@219 | |
3654 // int v103; // eax@223 | |
3655 // int v104; // eax@231 | |
3656 // int v105; // edx@231 | |
3657 // signed int v106; // ebx@231 | |
3658 // ArcomageCard *v107; // ebx@233 | |
3659 // int v108; // eax@233 | |
3660 // int v109; // edx@238 | |
3661 // int v110; // eax@238 | |
3662 // int v111; // eax@240 | |
3663 // int v112; // edx@245 | |
3664 // int v113; // eax@245 | |
3665 // int v114; // eax@247 | |
3666 // int v115; // edx@252 | |
3667 // int v116; // eax@252 | |
3668 // int v117; // eax@254 | |
3669 // int v118; // edx@259 | |
3670 // int v119; // eax@259 | |
3671 // bool v120; // eax@261 | |
3672 // int v121; // edx@266 | |
3673 // int v122; // eax@266 | |
3674 // int v123; // eax@268 | |
3675 // int v124; // edx@273 | |
3676 // int v125; // eax@273 | |
3677 // char v126; // al@275 | |
3678 // int v127; // eax@277 | |
3679 // int v128; // edx@282 | |
3680 // int v129; // eax@282 | |
3681 // int v130; // eax@284 | |
3682 // int v131; // edx@289 | |
3683 // int v132; // eax@289 | |
3684 // int v133; // eax@291 | |
3685 // int v134; // eax@296 | |
3686 // int v135; // edx@296 | |
3687 // int v136; // eax@298 | |
3688 // int v137; // eax@303 | |
3689 // int v138; // edx@303 | |
3690 // int v139; // eax@305 | |
3691 // int v140; // eax@310 | |
3692 // int v141; // edx@310 | |
3693 // int v142; // eax@312 | |
3694 // int v143; // eax@317 | |
3695 // int v144; // edx@317 | |
3696 // int v145; // eax@319 | |
3697 // int v146; // eax@324 | |
3698 // int v147; // edx@324 | |
3699 // int v148; // eax@326 | |
3700 // int v149; // eax@331 | |
3701 // int v150; // edx@331 | |
3702 // char v151; // al@333 | |
3703 // int v152; // eax@335 | |
3704 // int v153; // eax@340 | |
3705 // int v154; // edx@340 | |
3706 // int v155; // eax@342 | |
3707 // int v156; // eax@347 | |
3708 // int v157; // edx@347 | |
3709 // int v158; // eax@349 | |
3710 // int v159; // eax@356 | |
3711 // int v160; // ecx@356 | |
3712 // int v161; // eax@360 | |
3713 // int v162; // eax@367 | |
3714 // int v163; // ecx@367 | |
3715 // int v164; // eax@371 | |
3716 // int v165; // eax@378 | |
3717 // int v166; // ecx@378 | |
3718 // int v167; // eax@382 | |
3719 // int v168; // eax@389 | |
3720 // int v169; // ecx@389 | |
3721 // bool v170; // eax@393 | |
3722 // int v171; // eax@400 | |
3723 // int v172; // ecx@400 | |
3724 // int v173; // eax@404 | |
3725 // int v174; // eax@411 | |
3726 // int v175; // ecx@411 | |
3727 // char v176; // al@415 | |
3728 // int v177; // eax@416 | |
3729 // int v178; // edx@416 | |
3730 // int v179; // eax@416 | |
3731 // int v180; // eax@416 | |
3732 // int v181; // eax@417 | |
3733 // int v182; // eax@424 | |
3734 // int v183; // ecx@424 | |
3735 // int v184; // eax@429 | |
3736 // int v185; // ecx@429 | |
3737 // signed int v186; // esi@511 | |
3738 // Vec2_int_ v187; // [sp+Ch] [bp-64h]@488 | |
3739 // //int v188; // [sp+10h] [bp-60h]@488 | |
3740 // int v189; // [sp+14h] [bp-5Ch]@1 | |
3741 // ArcomageCard *pCard; // [sp+18h] [bp-58h]@1 | |
3742 // int v191; // [sp+1Ch] [bp-54h]@1 | |
3743 // int v192; // [sp+20h] [bp-50h]@1 | |
3744 // int v193; // [sp+24h] [bp-4Ch]@1 | |
3745 // int v194; // [sp+28h] [bp-48h]@1 | |
3746 // int v195; // [sp+2Ch] [bp-44h]@1 | |
3747 // int v196; // [sp+30h] [bp-40h]@1 | |
3748 // int v197; // [sp+34h] [bp-3Ch]@1 | |
3749 // int v198; // [sp+38h] [bp-38h]@1 | |
3750 // int v199; // [sp+3Ch] [bp-34h]@1 | |
3751 // int v200; // [sp+40h] [bp-30h]@1 | |
3752 // int v201; // [sp+44h] [bp-2Ch]@1 | |
3753 // int v202; // [sp+48h] [bp-28h]@1 | |
3754 // int v203; // [sp+4Ch] [bp-24h]@1 | |
3755 // int v204; // [sp+50h] [bp-20h]@1 | |
3756 // bool v205; // [sp+54h] [bp-1Ch]@1 | |
3757 // int v206; // [sp+58h] [bp-18h]@1 | |
3758 // int v207; // [sp+5Ch] [bp-14h]@1 | |
3759 // int v208; // [sp+60h] [bp-10h]@1 | |
3760 // int v209; // [sp+64h] [bp-Ch]@1 | |
3761 // int v210; // [sp+68h] [bp-8h]@1 | |
3762 // int v211; // [sp+6Ch] [bp-4h]@1 | |
3763 // | |
3764 // v194 = 0; | |
3765 // v210 = 0; | |
3766 // v208 = 0; | |
3767 // v197 = 0; | |
3768 // v205 = 0; | |
3769 // v203 = 0; | |
3770 // v201 = 0; | |
3771 // v199 = 0; | |
3772 // v192 = 0; | |
3773 // v196 = 0; | |
3774 // v211 = 0; | |
3775 // v209 = 0; | |
3776 // v207 = 0; | |
3777 // v206 = 0; | |
3778 // v204 = 0; | |
3779 // v202 = 0; | |
3780 // v200 = 0; | |
3781 // v198 = 0; | |
3782 // v191 = 0; | |
3783 // v195 = 0; | |
3784 // v193 = a1; | |
3785 // v2 = &stru_505708[a1]; | |
3786 // pCard = &pCards[uCardID]; | |
3787 // v3 = pCard->field_2C; | |
3788 // v189 = (a1 + 1) % 2; | |
3789 // v4 = &stru_505708[v189]; | |
3790 // switch ( v3 ) | |
3791 // { | |
3792 // case 2: | |
3793 // v5 = v2->field_2C; | |
3794 // v7 = __OFSUB__(v5, v4->field_2C); | |
3795 // v6 = v5 - v4->field_2C < 0; | |
3796 // goto LABEL_18; | |
3797 // case 3: | |
3798 // v8 = v2->field_30; | |
3799 // v7 = __OFSUB__(v8, v4->field_30); | |
3800 // v6 = v8 - v4->field_30 < 0; | |
3801 // goto LABEL_18; | |
3802 // case 4: | |
3803 // v9 = v2->field_34; | |
3804 // v7 = __OFSUB__(v9, v4->field_34); | |
3805 // v6 = v9 - v4->field_34 < 0; | |
3806 // goto LABEL_18; | |
3807 // case 5: | |
3808 // v10 = v2->field_2C == v4->field_2C; | |
3809 // goto LABEL_21; | |
3810 // case 6: | |
3811 // v10 = v2->field_30 == v4->field_30; | |
3812 // goto LABEL_21; | |
3813 // case 7: | |
3814 // v10 = v2->field_34 == v4->field_34; | |
3815 // goto LABEL_21; | |
3816 // case 8: | |
3817 // v11 = v2->field_2C; | |
3818 // v14 = __OFSUB__(v11, v4->field_2C); | |
3819 // v12 = v11 == v4->field_2C; | |
3820 // v13 = v11 - v4->field_2C < 0; | |
3821 // goto LABEL_24; | |
3822 // case 9: | |
3823 // v15 = v2->field_30; | |
3824 // v14 = __OFSUB__(v15, v4->field_30); | |
3825 // v12 = v15 == v4->field_30; | |
3826 // v13 = v15 - v4->field_30 < 0; | |
3827 // goto LABEL_24; | |
3828 // case 10: | |
3829 // v16 = v2->field_34; | |
3830 // v14 = __OFSUB__(v16, v4->field_34); | |
3831 // v12 = v16 == v4->field_34; | |
3832 // v13 = v16 - v4->field_34 < 0; | |
3833 // goto LABEL_24; | |
3834 // case 11: | |
3835 // v10 = v2->field_28 == 0; | |
3836 // goto LABEL_21; | |
3837 // case 12: | |
3838 // v17 = v2->field_28 == 0; | |
3839 // goto LABEL_15; | |
3840 // case 13: | |
3841 // v10 = v4->field_28 == 0; | |
3842 // goto LABEL_21; | |
3843 // case 14: | |
3844 // v17 = v4->field_28 == 0; | |
3845 //LABEL_15: | |
3846 // v18 = !v17; | |
3847 // goto LABEL_25; | |
3848 // case 15: | |
3849 // v19 = v2->field_28; | |
3850 // v7 = __OFSUB__(v19, v4->field_28); | |
3851 // v6 = v19 - v4->field_28 < 0; | |
3852 // goto LABEL_18; | |
3853 // case 16: | |
3854 // v20 = v2->field_24; | |
3855 // v7 = __OFSUB__(v20, v4->field_24); | |
3856 // v6 = v20 - v4->field_24 < 0; | |
3857 //LABEL_18: | |
3858 // v18 = v6 ^ v7; | |
3859 // goto LABEL_25; | |
3860 // case 17: | |
3861 // v10 = v2->field_28 == v4->field_28; | |
3862 // goto LABEL_21; | |
3863 // case 18: | |
3864 // v10 = v2->field_24 == v4->field_24; | |
3865 //LABEL_21: | |
3866 // v18 = v10; | |
3867 // goto LABEL_25; | |
3868 // case 19: | |
3869 // v21 = v2->field_28; | |
3870 // v14 = __OFSUB__(v21, v4->field_28); | |
3871 // v12 = v21 == v4->field_28; | |
3872 // v13 = v21 - v4->field_28 < 0; | |
3873 // goto LABEL_24; | |
3874 // case 20: | |
3875 // v22 = v2->field_24; | |
3876 // v14 = __OFSUB__(v22, v4->field_24); | |
3877 // v12 = v22 == v4->field_24; | |
3878 // v13 = v22 - v4->field_24 < 0; | |
3879 //LABEL_24: | |
3880 // v18 = !((unsigned __int8)(v13 ^ v14) | v12); | |
3881 //LABEL_25: | |
3882 // if ( v18 ) | |
3883 // goto LABEL_26; | |
3884 // goto LABEL_231; | |
3885 // default: | |
3886 //LABEL_26: | |
3887 // v23 = BYTE1(pCard->field_30); | |
3888 // v24 = v23 + (LOBYTE(pCard->field_30) == 1); | |
3889 // v25 = 0; | |
3890 // dword_4FAA68 = v23 + (LOBYTE(pCard->field_30) == 1); | |
3891 // dword_4FAA64 = v23; | |
3892 // if ( v23 > 0 ) | |
3893 // { | |
3894 // do | |
3895 // { | |
3896 // am_40A283(v193, v24); | |
3897 // ++v25; | |
3898 // } | |
3899 // while ( v25 < SBYTE1(pCard->field_30) ); | |
3900 // } | |
3901 // v26 = pCard; | |
1185 | 3902 // am_byte_4FAA77 = GetPlayerHandCardCount(v193) > dword_4E1874; |
1183 | 3903 // LOBYTE(v27) = BYTE2(pCard->field_30); |
3904 // if ( (_BYTE)v27 ) | |
3905 // { | |
3906 // if ( (_BYTE)v27 == 99 ) | |
3907 // { | |
3908 // v28 = v2->field_2C; | |
3909 // v29 = v4->field_2C; | |
3910 // if ( v28 < v29 ) | |
3911 // { | |
3912 // v2->field_2C = v29; | |
3913 // v194 = v29 - v28; | |
3914 // } | |
3915 // } | |
3916 // else | |
3917 // { | |
3918 // v27 = (char)v27; | |
3919 // v6 = (char)v27 + v2->field_2C < 0; | |
3920 // v2->field_2C += (char)v27; | |
3921 // if ( v6 ) | |
3922 // v2->field_2C = 0; | |
3923 // v194 = v27; | |
3924 // } | |
3925 // } | |
3926 // LOBYTE(v30) = BYTE3(v26->field_30); | |
3927 // if ( (_BYTE)v30 ) | |
3928 // { | |
3929 // if ( (_BYTE)v30 == 99 ) | |
3930 // { | |
3931 // v31 = v2->field_30; | |
3932 // v32 = v4->field_30; | |
3933 // if ( v31 < v32 ) | |
3934 // { | |
3935 // v2->field_30 = v32; | |
3936 // v210 = v32 - v31; | |
3937 // } | |
3938 // } | |
3939 // else | |
3940 // { | |
3941 // v30 = (char)v30; | |
3942 // v6 = (char)v30 + v2->field_30 < 0; | |
3943 // v2->field_30 += (char)v30; | |
3944 // if ( v6 ) | |
3945 // v2->field_30 = 0; | |
3946 // v210 = v30; | |
3947 // } | |
3948 // } | |
3949 // LOBYTE(v33) = LOBYTE(v26->field_34); | |
3950 // if ( (_BYTE)v33 ) | |
3951 // { | |
3952 // if ( (_BYTE)v33 == 99 ) | |
3953 // { | |
3954 // v34 = v2->field_34; | |
3955 // v35 = v4->field_34; | |
3956 // if ( v34 < v35 ) | |
3957 // { | |
3958 // v2->field_34 = v35; | |
3959 // v208 = v35 - v34; | |
3960 // } | |
3961 // } | |
3962 // else | |
3963 // { | |
3964 // v33 = (char)v33; | |
3965 // v6 = (char)v33 + v2->field_34 < 0; | |
3966 // v2->field_34 += (char)v33; | |
3967 // if ( v6 ) | |
3968 // v2->field_34 = 0; | |
3969 // v208 = v33; | |
3970 // } | |
3971 // } | |
3972 // LOBYTE(v36) = BYTE1(v26->field_34); | |
3973 // if ( (_BYTE)v36 ) | |
3974 // { | |
3975 // if ( (_BYTE)v36 == 99 ) | |
3976 // { | |
3977 // v37 = v2->field_38; | |
3978 // v38 = v4->field_38; | |
3979 // if ( v37 < v38 ) | |
3980 // { | |
3981 // v2->field_38 = v38; | |
3982 // v197 = v38 - v37; | |
3983 // } | |
3984 // } | |
3985 // else | |
3986 // { | |
3987 // v36 = (char)v36; | |
3988 // v6 = (char)v36 + v2->field_38 < 0; | |
3989 // v2->field_38 += (char)v36; | |
3990 // if ( v6 ) | |
3991 // v2->field_38 = 0; | |
3992 // v197 = v36; | |
3993 // } | |
3994 // } | |
3995 // LOBYTE(v39) = BYTE2(v26->field_34); | |
3996 // if ( v39 ) | |
3997 // { | |
3998 // if ( v39 == 99 ) | |
3999 // { | |
4000 // v40 = v2->field_3C; | |
4001 // v41 = v4->field_3C; | |
4002 // if ( v40 < v41 ) | |
4003 // { | |
4004 // v2->field_3C = v41; | |
4005 // v205 = v41 - v40; | |
4006 // } | |
4007 // } | |
4008 // else | |
4009 // { | |
4010 // v39 = v39; | |
4011 // v6 = v39 + v2->field_3C < 0; | |
4012 // v2->field_3C += v39; | |
4013 // if ( v6 ) | |
4014 // v2->field_3C = 0; | |
4015 // v205 = v39; | |
4016 // } | |
4017 // } | |
4018 // LOBYTE(v42) = BYTE3(v26->field_34); | |
4019 // if ( (_BYTE)v42 ) | |
4020 // { | |
4021 // if ( (_BYTE)v42 == 99 ) | |
4022 // { | |
4023 // v43 = v2->field_40; | |
4024 // v44 = v4->field_40; | |
4025 // if ( v43 < v44 ) | |
4026 // { | |
4027 // v2->field_40 = v44; | |
4028 // v203 = v44 - v43; | |
4029 // } | |
4030 // } | |
4031 // else | |
4032 // { | |
4033 // v42 = (char)v42; | |
4034 // v6 = (char)v42 + v2->field_40 < 0; | |
4035 // v2->field_40 += (char)v42; | |
4036 // if ( v6 ) | |
4037 // v2->field_40 = 0; | |
4038 // v203 = v42; | |
4039 // } | |
4040 // } | |
4041 // v45 = v26->field_38[0]; | |
4042 // if ( v45 ) | |
4043 // { | |
4044 // v196 = am_40D402(v193, v45); | |
4045 // v192 = v26->field_38[0] - v196; | |
4046 // } | |
4047 // LOBYTE(v46) = v26->field_38[1]; | |
4048 // if ( (_BYTE)v46 ) | |
4049 // { | |
4050 // if ( (_BYTE)v46 == 99 ) | |
4051 // { | |
4052 // v47 = v2->field_28; | |
4053 // v48 = v4->field_28; | |
4054 // if ( v47 < v48 ) | |
4055 // { | |
4056 // v2->field_28 = v48; | |
4057 // v201 = v48 - v47; | |
4058 // } | |
4059 // } | |
4060 // else | |
4061 // { | |
4062 // v46 = (char)v46; | |
4063 // v6 = (char)v46 + v2->field_28 < 0; | |
4064 // v2->field_28 += (char)v46; | |
4065 // if ( v6 ) | |
4066 // v2->field_28 = 0; | |
4067 // v201 = v46; | |
4068 // } | |
4069 // } | |
4070 // LOBYTE(v49) = v26->field_38[2]; | |
4071 // if ( (_BYTE)v49 ) | |
4072 // { | |
4073 // if ( (_BYTE)v49 == 99 ) | |
4074 // { | |
4075 // v50 = v2->field_24; | |
4076 // v51 = v4->field_24; | |
4077 // if ( v50 < v51 ) | |
4078 // { | |
4079 // v2->field_24 = v51; | |
4080 // v199 = v51 - v50; | |
4081 // } | |
4082 // } | |
4083 // else | |
4084 // { | |
4085 // v49 = (char)v49; | |
4086 // v6 = (char)v49 + v2->field_24 < 0; | |
4087 // v2->field_24 += (char)v49; | |
4088 // if ( v6 ) | |
4089 // v2->field_24 = 0; | |
4090 // v199 = v49; | |
4091 // } | |
4092 // } | |
4093 // LOBYTE(v52) = v26->field_38[3]; | |
4094 // if ( (_BYTE)v52 ) | |
4095 // { | |
4096 // if ( (_BYTE)v52 == 99 ) | |
4097 // { | |
4098 // v53 = v2->field_2C; | |
4099 // v54 = v4->field_2C; | |
4100 // if ( v53 > v54 ) | |
4101 // { | |
4102 // v4->field_2C = v53; | |
4103 // v211 = v53 - v54; | |
4104 // } | |
4105 // } | |
4106 // else | |
4107 // { | |
4108 // v52 = (char)v52; | |
4109 // v6 = (char)v52 + v4->field_2C < 0; | |
4110 // v4->field_2C += (char)v52; | |
4111 // if ( v6 ) | |
4112 // v4->field_2C = 0; | |
4113 // v211 = v52; | |
4114 // } | |
4115 // } | |
4116 // LOBYTE(v55) = v26->field_38[4]; | |
4117 // if ( (_BYTE)v55 ) | |
4118 // { | |
4119 // if ( (_BYTE)v55 == 99 ) | |
4120 // { | |
4121 // v56 = v2->field_30; | |
4122 // v57 = v4->field_30; | |
4123 // if ( v56 > v57 ) | |
4124 // { | |
4125 // v4->field_30 = v56; | |
4126 // v209 = v56 - v57; | |
4127 // } | |
4128 // } | |
4129 // else | |
4130 // { | |
4131 // v55 = (char)v55; | |
4132 // v6 = (char)v55 + v4->field_30 < 0; | |
4133 // v4->field_30 += (char)v55; | |
4134 // if ( v6 ) | |
4135 // v4->field_30 = 0; | |
4136 // v209 = v55; | |
4137 // } | |
4138 // } | |
4139 // LOBYTE(v58) = v26->field_38[5]; | |
4140 // if ( (_BYTE)v58 ) | |
4141 // { | |
4142 // if ( (_BYTE)v58 == 99 ) | |
4143 // { | |
4144 // v59 = v2->field_34; | |
4145 // v60 = v4->field_34; | |
4146 // if ( v59 > v60 ) | |
4147 // { | |
4148 // v4->field_34 = v59; | |
4149 // v207 = v59 - v60; | |
4150 // } | |
4151 // } | |
4152 // else | |
4153 // { | |
4154 // v58 = (char)v58; | |
4155 // v6 = (char)v58 + v4->field_34 < 0; | |
4156 // v4->field_34 += (char)v58; | |
4157 // if ( v6 ) | |
4158 // v4->field_34 = 0; | |
4159 // v207 = v58; | |
4160 // } | |
4161 // } | |
4162 // LOBYTE(v61) = v26->field_38[6]; | |
4163 // if ( (_BYTE)v61 ) | |
4164 // { | |
4165 // if ( (_BYTE)v61 == 99 ) | |
4166 // { | |
4167 // v62 = v2->field_38; | |
4168 // v63 = v4->field_38; | |
4169 // if ( v62 > v63 ) | |
4170 // { | |
4171 // v4->field_38 = v62; | |
4172 // v206 = v62 - v63; | |
4173 // } | |
4174 // } | |
4175 // else | |
4176 // { | |
4177 // v61 = (char)v61; | |
4178 // v6 = (char)v61 + v4->field_38 < 0; | |
4179 // v4->field_38 += (char)v61; | |
4180 // if ( v6 ) | |
4181 // v4->field_38 = 0; | |
4182 // v206 = v61; | |
4183 // } | |
4184 // } | |
4185 // LOBYTE(v64) = v26->field_38[7]; | |
4186 // if ( (_BYTE)v64 ) | |
4187 // { | |
4188 // if ( (_BYTE)v64 == 99 ) | |
4189 // { | |
4190 // v65 = v2->field_3C; | |
4191 // v66 = v4->field_3C; | |
4192 // if ( v65 > v66 ) | |
4193 // { | |
4194 // v4->field_3C = v65; | |
4195 // v204 = v65 - v66; | |
4196 // } | |
4197 // } | |
4198 // else | |
4199 // { | |
4200 // v64 = (char)v64; | |
4201 // v6 = (char)v64 + v4->field_3C < 0; | |
4202 // v4->field_3C += (char)v64; | |
4203 // if ( v6 ) | |
4204 // v4->field_3C = 0; | |
4205 // v204 = v64; | |
4206 // } | |
4207 // } | |
4208 // LOBYTE(v67) = v26->field_38[8]; | |
4209 // if ( (_BYTE)v67 ) | |
4210 // { | |
4211 // if ( (_BYTE)v67 == 99 ) | |
4212 // { | |
4213 // v68 = v2->field_40; | |
4214 // v69 = v4->field_40; | |
4215 // if ( v68 > v69 ) | |
4216 // { | |
4217 // v4->field_40 = v68; | |
4218 // v202 = v68 - v69; | |
4219 // } | |
4220 // } | |
4221 // else | |
4222 // { | |
4223 // v67 = (char)v67; | |
4224 // v6 = (char)v67 + v4->field_40 < 0; | |
4225 // v4->field_40 += (char)v67; | |
4226 // if ( v6 ) | |
4227 // v4->field_40 = 0; | |
4228 // v202 = v67; | |
4229 // } | |
4230 // } | |
4231 // v70 = v26->field_38[9]; | |
4232 // if ( v70 ) | |
4233 // { | |
4234 // v195 = am_40D402(v189, v70); | |
4235 // v191 = v26->field_38[9] - v195; | |
4236 // } | |
4237 // LOBYTE(v71) = v26->field_38[10]; | |
4238 // if ( (_BYTE)v71 ) | |
4239 // { | |
4240 // if ( (_BYTE)v71 == 99 ) | |
4241 // { | |
4242 // v72 = v2->field_28; | |
4243 // v73 = v4->field_28; | |
4244 // if ( v72 > v73 ) | |
4245 // { | |
4246 // v4->field_28 = v72; | |
4247 // v200 = v72 - v73; | |
4248 // } | |
4249 // } | |
4250 // else | |
4251 // { | |
4252 // v71 = (char)v71; | |
4253 // v6 = (char)v71 + v4->field_28 < 0; | |
4254 // v4->field_28 += (char)v71; | |
4255 // if ( v6 ) | |
4256 // v4->field_28 = 0; | |
4257 // v200 = v71; | |
4258 // } | |
4259 // } | |
4260 // LOBYTE(v74) = v26->field_38[11]; | |
4261 // if ( (_BYTE)v74 ) | |
4262 // { | |
4263 // if ( (_BYTE)v74 == 99 ) | |
4264 // { | |
4265 // v75 = v2->field_24; | |
4266 // v76 = v4->field_24; | |
4267 // if ( v75 > v76 ) | |
4268 // { | |
4269 // v4->field_24 = v75; | |
4270 // v198 = v75 - v76; | |
4271 // } | |
4272 // } | |
4273 // else | |
4274 // { | |
4275 // v74 = (char)v74; | |
4276 // v6 = (char)v74 + v4->field_24 < 0; | |
4277 // v4->field_24 += (char)v74; | |
4278 // if ( v6 ) | |
4279 // v4->field_24 = 0; | |
4280 // v198 = v74; | |
4281 // } | |
4282 // } | |
4283 // LOBYTE(v77) = v26->field_38[12]; | |
4284 // if ( (_BYTE)v77 ) | |
4285 // { | |
4286 // if ( (_BYTE)v77 == 99 ) | |
4287 // { | |
4288 // v78 = v2->field_2C; | |
4289 // v79 = v4->field_2C; | |
4290 // if ( v78 != v79 ) | |
4291 // { | |
4292 // if ( v78 <= v79 ) | |
4293 // { | |
4294 // v2->field_2C = v79; | |
4295 // v194 = v79 - v78; | |
4296 // } | |
4297 // else | |
4298 // { | |
4299 // v4->field_2C = v78; | |
4300 // v211 = v78 - v79; | |
4301 // } | |
4302 // } | |
4303 // } | |
4304 // else | |
4305 // { | |
4306 // v77 = (char)v77; | |
4307 // v2->field_2C += (char)v77; | |
4308 // v4->field_2C += (char)v77; | |
4309 // if ( v2->field_2C < 0 ) | |
4310 // v2->field_2C = 0; | |
4311 // if ( v4->field_2C < 0 ) | |
4312 // v4->field_2C = 0; | |
4313 // v194 = v77; | |
4314 // v211 = v77; | |
4315 // } | |
4316 // } | |
4317 // LOBYTE(v80) = v26->field_38[13]; | |
4318 // if ( (_BYTE)v80 ) | |
4319 // { | |
4320 // if ( (_BYTE)v80 == 99 ) | |
4321 // { | |
4322 // v81 = v2->field_30; | |
4323 // v82 = v4->field_30; | |
4324 // if ( v81 != v82 ) | |
4325 // { | |
4326 // if ( v81 <= v82 ) | |
4327 // { | |
4328 // v2->field_30 = v82; | |
4329 // v210 = v82 - v81; | |
4330 // } | |
4331 // else | |
4332 // { | |
4333 // v4->field_30 = v81; | |
4334 // v209 = v81 - v82; | |
4335 // } | |
4336 // } | |
4337 // } | |
4338 // else | |
4339 // { | |
4340 // v80 = (char)v80; | |
4341 // v2->field_30 += (char)v80; | |
4342 // v4->field_30 += (char)v80; | |
4343 // if ( v2->field_30 < 0 ) | |
4344 // v2->field_30 = 0; | |
4345 // if ( v4->field_30 < 0 ) | |
4346 // v4->field_30 = 0; | |
4347 // v209 = v80; | |
4348 // v210 = v80; | |
4349 // } | |
4350 // } | |
4351 // LOBYTE(v83) = v26->field_38[14]; | |
4352 // if ( (_BYTE)v83 ) | |
4353 // { | |
4354 // if ( (_BYTE)v83 == 99 ) | |
4355 // { | |
4356 // v84 = v2->field_34; | |
4357 // v85 = v4->field_34; | |
4358 // if ( v84 != v85 ) | |
4359 // { | |
4360 // if ( v84 <= v85 ) | |
4361 // { | |
4362 // v2->field_34 = v85; | |
4363 // v208 = v85 - v84; | |
4364 // } | |
4365 // else | |
4366 // { | |
4367 // v4->field_34 = v84; | |
4368 // v207 = v84 - v85; | |
4369 // } | |
4370 // } | |
4371 // } | |
4372 // else | |
4373 // { | |
4374 // v83 = (char)v83; | |
4375 // v2->field_34 += (char)v83; | |
4376 // v4->field_34 += (char)v83; | |
4377 // if ( v2->field_34 < 0 ) | |
4378 // v2->field_34 = 0; | |
4379 // if ( v4->field_34 < 0 ) | |
4380 // v4->field_34 = 0; | |
4381 // v208 = v83; | |
4382 // v207 = v83; | |
4383 // } | |
4384 // } | |
4385 // LOBYTE(v86) = v26->field_38[15]; | |
4386 // if ( (_BYTE)v86 ) | |
4387 // { | |
4388 // if ( (_BYTE)v86 == 99 ) | |
4389 // { | |
4390 // v87 = v2->field_38; | |
4391 // v88 = v4->field_38; | |
4392 // if ( v87 != v88 ) | |
4393 // { | |
4394 // if ( v87 <= v88 ) | |
4395 // { | |
4396 // v2->field_38 = v88; | |
4397 // v197 = v88 - v87; | |
4398 // } | |
4399 // else | |
4400 // { | |
4401 // v4->field_38 = v87; | |
4402 // v206 = v87 - v88; | |
4403 // } | |
4404 // } | |
4405 // } | |
4406 // else | |
4407 // { | |
4408 // v86 = (char)v86; | |
4409 // v2->field_38 += (char)v86; | |
4410 // v4->field_38 += (char)v86; | |
4411 // if ( v2->field_38 < 0 ) | |
4412 // v2->field_38 = 0; | |
4413 // if ( v4->field_38 < 0 ) | |
4414 // v4->field_38 = 0; | |
4415 // v197 = v86; | |
4416 // v206 = v86; | |
4417 // } | |
4418 // } | |
4419 // LOBYTE(v89) = v26->field_48[0]; | |
4420 // if ( v89 ) | |
4421 // { | |
4422 // if ( v89 == 99 ) | |
4423 // { | |
4424 // v90 = v2->field_3C; | |
4425 // v91 = v4->field_3C; | |
4426 // if ( v90 != v91 ) | |
4427 // { | |
4428 // if ( v90 <= v91 ) | |
4429 // { | |
4430 // v205 = v91 > v90; | |
4431 // v2->field_3C = v91; | |
4432 // } | |
4433 // else | |
4434 // { | |
4435 // v204 = 1; | |
4436 // v4->field_3C = v90; | |
4437 // } | |
4438 // } | |
4439 // } | |
4440 // else | |
4441 // { | |
4442 // v89 = v89; | |
4443 // v2->field_3C += v89; | |
4444 // v4->field_3C += v89; | |
4445 // if ( v2->field_3C < 0 ) | |
4446 // v2->field_3C = 0; | |
4447 // if ( v4->field_3C < 0 ) | |
4448 // v4->field_3C = 0; | |
4449 // v205 = v89; | |
4450 // v204 = v89; | |
4451 // } | |
4452 // } | |
4453 // LOBYTE(v92) = v26->field_48[1]; | |
4454 // if ( (_BYTE)v92 ) | |
4455 // { | |
4456 // if ( (_BYTE)v92 == 99 ) | |
4457 // { | |
4458 // v93 = v2->field_40; | |
4459 // v94 = v4->field_40; | |
4460 // if ( v93 != v94 ) | |
4461 // { | |
4462 // if ( v93 <= v94 ) | |
4463 // { | |
4464 // v2->field_40 = v94; | |
4465 // v203 = v94 - v93; | |
4466 // } | |
4467 // else | |
4468 // { | |
4469 // v4->field_40 = v93; | |
4470 // v202 = v93 - v94; | |
4471 // } | |
4472 // } | |
4473 // } | |
4474 // else | |
4475 // { | |
4476 // v92 = (char)v92; | |
4477 // v2->field_40 += (char)v92; | |
4478 // v4->field_40 += (char)v92; | |
4479 // if ( v2->field_40 < 0 ) | |
4480 // v2->field_40 = 0; | |
4481 // if ( v4->field_40 < 0 ) | |
4482 // v4->field_40 = 0; | |
4483 // v203 = v92; | |
4484 // v202 = v92; | |
4485 // } | |
4486 // } | |
4487 // v95 = v26->field_48[2]; | |
4488 // if ( v95 ) | |
4489 // { | |
4490 // v96 = am_40D402(v193, v95); | |
4491 // v97 = v26->field_48[2]; | |
4492 // v196 = v96; | |
4493 // v98 = am_40D402(v189, v97); | |
4494 // v195 = v98; | |
4495 // v99 = v26->field_48[2] - v98; | |
4496 // v192 = v26->field_48[2] - v196; | |
4497 // v191 = v99; | |
4498 // } | |
4499 // LOBYTE(v100) = v26->field_48[3]; | |
4500 // if ( (_BYTE)v100 ) | |
4501 // { | |
4502 // if ( (_BYTE)v100 == 99 ) | |
4503 // { | |
4504 // v101 = v2->field_28; | |
4505 // v102 = v4->field_28; | |
4506 // if ( v101 != v102 ) | |
4507 // { | |
4508 // if ( v101 <= v102 ) | |
4509 // { | |
4510 // v2->field_28 = v102; | |
4511 // v201 = v102 - v101; | |
4512 // } | |
4513 // else | |
4514 // { | |
4515 // v4->field_28 = v101; | |
4516 // v200 = v101 - v102; | |
4517 // } | |
4518 // } | |
4519 // } | |
4520 // else | |
4521 // { | |
4522 // v100 = (char)v100; | |
4523 // v2->field_28 += (char)v100; | |
4524 // v4->field_28 += (char)v100; | |
4525 // if ( v2->field_28 < 0 ) | |
4526 // v2->field_28 = 0; | |
4527 // if ( v4->field_28 < 0 ) | |
4528 // v4->field_28 = 0; | |
4529 // v201 = v100; | |
4530 // v200 = v100; | |
4531 // } | |
4532 // } | |
4533 // LOBYTE(v103) = v26->field_48[4]; | |
4534 // break; | |
4535 // case 0: | |
4536 //LABEL_231: | |
4537 // v104 = pCard->field_48[6]; | |
4538 // v105 = v104 + (pCard->field_48[5] == 1); | |
4539 // v106 = 0; | |
4540 // dword_4FAA68 = v104 + (pCard->field_48[5] == 1); | |
4541 // dword_4FAA64 = v104; | |
4542 // if ( v104 > 0 ) | |
4543 // { | |
4544 // do | |
4545 // { | |
4546 // am_40A283(v193, v105); | |
4547 // ++v106; | |
4548 // } | |
4549 // while ( v106 < pCard->field_48[6] ); | |
4550 // } | |
4551 // v107 = pCard; | |
1185 | 4552 // am_byte_4FAA77 = GetPlayerHandCardCount(v193) > dword_4E1874; |
1183 | 4553 // LOBYTE(v108) = pCard->field_48[7]; |
4554 // if ( (_BYTE)v108 ) | |
4555 // { | |
4556 // if ( (_BYTE)v108 == 99 ) | |
4557 // { | |
4558 // v109 = v2->field_2C; | |
4559 // v110 = v4->field_2C; | |
4560 // if ( v109 < v110 ) | |
4561 // { | |
4562 // v2->field_2C = v110; | |
4563 // v194 = v110 - v109; | |
4564 // } | |
4565 // } | |
4566 // else | |
4567 // { | |
4568 // v108 = (char)v108; | |
4569 // v6 = (char)v108 + v2->field_2C < 0; | |
4570 // v2->field_2C += (char)v108; | |
4571 // if ( v6 ) | |
4572 // v2->field_2C = 0; | |
4573 // v194 = v108; | |
4574 // } | |
4575 // } | |
4576 // LOBYTE(v111) = v107->field_48[8]; | |
4577 // if ( (_BYTE)v111 ) | |
4578 // { | |
4579 // if ( (_BYTE)v111 == 99 ) | |
4580 // { | |
4581 // v112 = v2->field_30; | |
4582 // v113 = v4->field_30; | |
4583 // if ( v112 < v113 ) | |
4584 // { | |
4585 // v2->field_30 = v113; | |
4586 // v210 = v113 - v112; | |
4587 // } | |
4588 // } | |
4589 // else | |
4590 // { | |
4591 // v111 = (char)v111; | |
4592 // v6 = (char)v111 + v2->field_30 < 0; | |
4593 // v2->field_30 += (char)v111; | |
4594 // if ( v6 ) | |
4595 // v2->field_30 = 0; | |
4596 // v210 = v111; | |
4597 // } | |
4598 // } | |
4599 // LOBYTE(v114) = v107->field_48[9]; | |
4600 // if ( (_BYTE)v114 ) | |
4601 // { | |
4602 // if ( (_BYTE)v114 == 99 ) | |
4603 // { | |
4604 // v115 = v2->field_34; | |
4605 // v116 = v4->field_34; | |
4606 // if ( v115 < v116 ) | |
4607 // { | |
4608 // v2->field_34 = v116; | |
4609 // v208 = v116 - v115; | |
4610 // } | |
4611 // } | |
4612 // else | |
4613 // { | |
4614 // v114 = (char)v114; | |
4615 // v6 = (char)v114 + v2->field_34 < 0; | |
4616 // v2->field_34 += (char)v114; | |
4617 // if ( v6 ) | |
4618 // v2->field_34 = 0; | |
4619 // v208 = v114; | |
4620 // } | |
4621 // } | |
4622 // LOBYTE(v117) = v107->field_48[10]; | |
4623 // if ( (_BYTE)v117 ) | |
4624 // { | |
4625 // if ( (_BYTE)v117 == 99 ) | |
4626 // { | |
4627 // v118 = v2->field_38; | |
4628 // v119 = v4->field_38; | |
4629 // if ( v118 < v119 ) | |
4630 // { | |
4631 // v2->field_38 = v119; | |
4632 // v197 = v119 - v118; | |
4633 // } | |
4634 // } | |
4635 // else | |
4636 // { | |
4637 // v117 = (char)v117; | |
4638 // v6 = (char)v117 + v2->field_38 < 0; | |
4639 // v2->field_38 += (char)v117; | |
4640 // if ( v6 ) | |
4641 // v2->field_38 = 0; | |
4642 // v197 = v117; | |
4643 // } | |
4644 // } | |
4645 // LOBYTE(v120) = v107->field_48[11]; | |
4646 // if ( v120 ) | |
4647 // { | |
4648 // if ( v120 == 99 ) | |
4649 // { | |
4650 // v121 = v2->field_3C; | |
4651 // v122 = v4->field_3C; | |
4652 // if ( v121 < v122 ) | |
4653 // { | |
4654 // v2->field_3C = v122; | |
4655 // v205 = v122 - v121; | |
4656 // } | |
4657 // } | |
4658 // else | |
4659 // { | |
4660 // v120 = v120; | |
4661 // v6 = v120 + v2->field_3C < 0; | |
4662 // v2->field_3C += v120; | |
4663 // if ( v6 ) | |
4664 // v2->field_3C = 0; | |
4665 // v205 = v120; | |
4666 // } | |
4667 // } | |
4668 // LOBYTE(v123) = v107->field_48[12]; | |
4669 // if ( (_BYTE)v123 ) | |
4670 // { | |
4671 // if ( (_BYTE)v123 == 99 ) | |
4672 // { | |
4673 // v124 = v2->field_40; | |
4674 // v125 = v4->field_40; | |
4675 // if ( v124 < v125 ) | |
4676 // { | |
4677 // v2->field_40 = v125; | |
4678 // v203 = v125 - v124; | |
4679 // } | |
4680 // } | |
4681 // else | |
4682 // { | |
4683 // v123 = (char)v123; | |
4684 // v6 = (char)v123 + v2->field_40 < 0; | |
4685 // v2->field_40 += (char)v123; | |
4686 // if ( v6 ) | |
4687 // v2->field_40 = 0; | |
4688 // v203 = v123; | |
4689 // } | |
4690 // } | |
4691 // v126 = v107->field_48[13]; | |
4692 // if ( v126 ) | |
4693 // { | |
4694 // v196 = am_40D402(v193, v126); | |
4695 // v192 = v107->field_48[13] - v196; | |
4696 // } | |
4697 // LOBYTE(v127) = v107->field_48[14]; | |
4698 // if ( (_BYTE)v127 ) | |
4699 // { | |
4700 // if ( (_BYTE)v127 == 99 ) | |
4701 // { | |
4702 // v128 = v2->field_28; | |
4703 // v129 = v4->field_28; | |
4704 // if ( v128 < v129 ) | |
4705 // { | |
4706 // v2->field_28 = v129; | |
4707 // v201 = v129 - v128; | |
4708 // } | |
4709 // } | |
4710 // else | |
4711 // { | |
4712 // v127 = (char)v127; | |
4713 // v6 = (char)v127 + v2->field_28 < 0; | |
4714 // v2->field_28 += (char)v127; | |
4715 // if ( v6 ) | |
4716 // v2->field_28 = 0; | |
4717 // v201 = v127; | |
4718 // } | |
4719 // } | |
4720 // LOBYTE(v130) = v107->field_48[15]; | |
4721 // if ( (_BYTE)v130 ) | |
4722 // { | |
4723 // if ( (_BYTE)v130 == 99 ) | |
4724 // { | |
4725 // v131 = v2->field_24; | |
4726 // v132 = v4->field_24; | |
4727 // if ( v131 < v132 ) | |
4728 // { | |
4729 // v2->field_24 = v132; | |
4730 // v199 = v132 - v131; | |
4731 // } | |
4732 // } | |
4733 // else | |
4734 // { | |
4735 // v130 = (char)v130; | |
4736 // v6 = (char)v130 + v2->field_24 < 0; | |
4737 // v2->field_24 += (char)v130; | |
4738 // if ( v6 ) | |
4739 // v2->field_24 = 0; | |
4740 // v199 = v130; | |
4741 // } | |
4742 // } | |
4743 // LOBYTE(v133) = v107->field_58[0]; | |
4744 // if ( (_BYTE)v133 ) | |
4745 // { | |
4746 // if ( (_BYTE)v133 == 99 ) | |
4747 // { | |
4748 // v134 = v2->field_2C; | |
4749 // v135 = v4->field_2C; | |
4750 // if ( v134 > v135 ) | |
4751 // { | |
4752 // v4->field_2C = v134; | |
4753 // v211 = v134 - v135; | |
4754 // } | |
4755 // } | |
4756 // else | |
4757 // { | |
4758 // v133 = (char)v133; | |
4759 // v6 = (char)v133 + v4->field_2C < 0; | |
4760 // v4->field_2C += (char)v133; | |
4761 // if ( v6 ) | |
4762 // v4->field_2C = 0; | |
4763 // v211 = v133; | |
4764 // } | |
4765 // } | |
4766 // LOBYTE(v136) = v107->field_58[1]; | |
4767 // if ( (_BYTE)v136 ) | |
4768 // { | |
4769 // if ( (_BYTE)v136 == 99 ) | |
4770 // { | |
4771 // v137 = v2->field_30; | |
4772 // v138 = v4->field_30; | |
4773 // if ( v137 > v138 ) | |
4774 // { | |
4775 // v4->field_30 = v137; | |
4776 // v209 = v137 - v138; | |
4777 // } | |
4778 // } | |
4779 // else | |
4780 // { | |
4781 // v136 = (char)v136; | |
4782 // v6 = (char)v136 + v4->field_30 < 0; | |
4783 // v4->field_30 += (char)v136; | |
4784 // if ( v6 ) | |
4785 // v4->field_30 = 0; | |
4786 // v209 = v136; | |
4787 // } | |
4788 // } | |
4789 // LOBYTE(v139) = v107->field_58[2]; | |
4790 // if ( (_BYTE)v139 ) | |
4791 // { | |
4792 // if ( (_BYTE)v139 == 99 ) | |
4793 // { | |
4794 // v140 = v2->field_34; | |
4795 // v141 = v4->field_34; | |
4796 // if ( v140 > v141 ) | |
4797 // { | |
4798 // v4->field_34 = v140; | |
4799 // v207 = v140 - v141; | |
4800 // } | |
4801 // } | |
4802 // else | |
4803 // { | |
4804 // v139 = (char)v139; | |
4805 // v6 = (char)v139 + v4->field_34 < 0; | |
4806 // v4->field_34 += (char)v139; | |
4807 // if ( v6 ) | |
4808 // v4->field_34 = 0; | |
4809 // v207 = v139; | |
4810 // } | |
4811 // } | |
4812 // LOBYTE(v142) = v107->field_58[3]; | |
4813 // if ( (_BYTE)v142 ) | |
4814 // { | |
4815 // if ( (_BYTE)v142 == 99 ) | |
4816 // { | |
4817 // v143 = v2->field_38; | |
4818 // v144 = v4->field_38; | |
4819 // if ( v143 > v144 ) | |
4820 // { | |
4821 // v4->field_38 = v143; | |
4822 // v206 = v143 - v144; | |
4823 // } | |
4824 // } | |
4825 // else | |
4826 // { | |
4827 // v142 = (char)v142; | |
4828 // v6 = (char)v142 + v4->field_38 < 0; | |
4829 // v4->field_38 += (char)v142; | |
4830 // if ( v6 ) | |
4831 // v4->field_38 = 0; | |
4832 // v206 = v142; | |
4833 // } | |
4834 // } | |
4835 // LOBYTE(v145) = v107->field_58[4]; | |
4836 // if ( (_BYTE)v145 ) | |
4837 // { | |
4838 // if ( (_BYTE)v145 == 99 ) | |
4839 // { | |
4840 // v146 = v2->field_3C; | |
4841 // v147 = v4->field_3C; | |
4842 // if ( v146 > v147 ) | |
4843 // { | |
4844 // v4->field_3C = v146; | |
4845 // v204 = v146 - v147; | |
4846 // } | |
4847 // } | |
4848 // else | |
4849 // { | |
4850 // v145 = (char)v145; | |
4851 // v6 = (char)v145 + v4->field_3C < 0; | |
4852 // v4->field_3C += (char)v145; | |
4853 // if ( v6 ) | |
4854 // v4->field_3C = 0; | |
4855 // v204 = v145; | |
4856 // } | |
4857 // } | |
4858 // LOBYTE(v148) = v107->field_58[5]; | |
4859 // if ( (_BYTE)v148 ) | |
4860 // { | |
4861 // if ( (_BYTE)v148 == 99 ) | |
4862 // { | |
4863 // v149 = v2->field_40; | |
4864 // v150 = v4->field_40; | |
4865 // if ( v149 > v150 ) | |
4866 // { | |
4867 // v4->field_40 = v149; | |
4868 // v202 = v149 - v150; | |
4869 // } | |
4870 // } | |
4871 // else | |
4872 // { | |
4873 // v148 = (char)v148; | |
4874 // v6 = (char)v148 + v4->field_40 < 0; | |
4875 // v4->field_40 += (char)v148; | |
4876 // if ( v6 ) | |
4877 // v4->field_40 = 0; | |
4878 // v202 = v148; | |
4879 // } | |
4880 // } | |
4881 // v151 = v107->field_58[6]; | |
4882 // if ( v151 ) | |
4883 // { | |
4884 // v195 = am_40D402(v189, v151); | |
4885 // v191 = v107->field_58[6] - v195; | |
4886 // } | |
4887 // LOBYTE(v152) = v107->field_58[7]; | |
4888 // if ( (_BYTE)v152 ) | |
4889 // { | |
4890 // if ( (_BYTE)v152 == 99 ) | |
4891 // { | |
4892 // v153 = v2->field_28; | |
4893 // v154 = v4->field_28; | |
4894 // if ( v153 > v154 ) | |
4895 // { | |
4896 // v4->field_28 = v153; | |
4897 // v200 = v153 - v154; | |
4898 // } | |
4899 // } | |
4900 // else | |
4901 // { | |
4902 // v152 = (char)v152; | |
4903 // v6 = (char)v152 + v4->field_28 < 0; | |
4904 // v4->field_28 += (char)v152; | |
4905 // if ( v6 ) | |
4906 // v4->field_28 = 0; | |
4907 // v200 = v152; | |
4908 // } | |
4909 // } | |
4910 // LOBYTE(v155) = v107->field_58[8]; | |
4911 // if ( (_BYTE)v155 ) | |
4912 // { | |
4913 // if ( (_BYTE)v155 == 99 ) | |
4914 // { | |
4915 // v156 = v2->field_24; | |
4916 // v157 = v4->field_24; | |
4917 // if ( v156 > v157 ) | |
4918 // { | |
4919 // v4->field_24 = v156; | |
4920 // v198 = v156 - v157; | |
4921 // } | |
4922 // } | |
4923 // else | |
4924 // { | |
4925 // v155 = (char)v155; | |
4926 // v6 = (char)v155 + v4->field_24 < 0; | |
4927 // v4->field_24 += (char)v155; | |
4928 // if ( v6 ) | |
4929 // v4->field_24 = 0; | |
4930 // v198 = v155; | |
4931 // } | |
4932 // } | |
4933 // LOBYTE(v158) = v107->field_58[9]; | |
4934 // if ( (_BYTE)v158 ) | |
4935 // { | |
4936 // if ( (_BYTE)v158 == 99 ) | |
4937 // { | |
4938 // v159 = v2->field_2C; | |
4939 // v160 = v4->field_2C; | |
4940 // if ( v159 != v160 ) | |
4941 // { | |
4942 // if ( v159 <= v160 ) | |
4943 // { | |
4944 // v2->field_2C = v160; | |
4945 // v194 = v160 - v159; | |
4946 // } | |
4947 // else | |
4948 // { | |
4949 // v4->field_2C = v159; | |
4950 // v211 = v159 - v160; | |
4951 // } | |
4952 // } | |
4953 // } | |
4954 // else | |
4955 // { | |
4956 // v158 = (char)v158; | |
4957 // v2->field_2C += (char)v158; | |
4958 // v4->field_2C += (char)v158; | |
4959 // if ( v2->field_2C < 0 ) | |
4960 // v2->field_2C = 0; | |
4961 // if ( v4->field_2C < 0 ) | |
4962 // v4->field_2C = 0; | |
4963 // v194 = v158; | |
4964 // v211 = v158; | |
4965 // } | |
4966 // } | |
4967 // LOBYTE(v161) = v107->field_58[10]; | |
4968 // if ( (_BYTE)v161 ) | |
4969 // { | |
4970 // if ( (_BYTE)v161 == 99 ) | |
4971 // { | |
4972 // v162 = v2->field_30; | |
4973 // v163 = v4->field_30; | |
4974 // if ( v162 != v163 ) | |
4975 // { | |
4976 // if ( v162 <= v163 ) | |
4977 // { | |
4978 // v2->field_30 = v163; | |
4979 // v210 = v163 - v162; | |
4980 // } | |
4981 // else | |
4982 // { | |
4983 // v4->field_30 = v162; | |
4984 // v209 = v162 - v163; | |
4985 // } | |
4986 // } | |
4987 // } | |
4988 // else | |
4989 // { | |
4990 // v161 = (char)v161; | |
4991 // v2->field_30 += (char)v161; | |
4992 // v4->field_30 += (char)v161; | |
4993 // if ( v2->field_30 < 0 ) | |
4994 // v2->field_30 = 0; | |
4995 // if ( v4->field_30 < 0 ) | |
4996 // v4->field_30 = 0; | |
4997 // v209 = v161; | |
4998 // v210 = v161; | |
4999 // } | |
5000 // } | |
5001 // LOBYTE(v164) = v107->field_58[11]; | |
5002 // if ( (_BYTE)v164 ) | |
5003 // { | |
5004 // if ( (_BYTE)v164 == 99 ) | |
5005 // { | |
5006 // v165 = v2->field_34; | |
5007 // v166 = v4->field_34; | |
5008 // if ( v165 != v166 ) | |
5009 // { | |
5010 // if ( v165 <= v166 ) | |
5011 // { | |
5012 // v2->field_34 = v166; | |
5013 // v208 = v166 - v165; | |
5014 // } | |
5015 // else | |
5016 // { | |
5017 // v4->field_34 = v165; | |
5018 // v207 = v165 - v166; | |
5019 // } | |
5020 // } | |
5021 // } | |
5022 // else | |
5023 // { | |
5024 // v164 = (char)v164; | |
5025 // v2->field_34 += (char)v164; | |
5026 // v4->field_34 += (char)v164; | |
5027 // if ( v2->field_34 < 0 ) | |
5028 // v2->field_34 = 0; | |
5029 // if ( v4->field_34 < 0 ) | |
5030 // v4->field_34 = 0; | |
5031 // v208 = v164; | |
5032 // v207 = v164; | |
5033 // } | |
5034 // } | |
5035 // LOBYTE(v167) = v107->field_58[12]; | |
5036 // if ( (_BYTE)v167 ) | |
5037 // { | |
5038 // if ( (_BYTE)v167 == 99 ) | |
5039 // { | |
5040 // v168 = v2->field_38; | |
5041 // v169 = v4->field_38; | |
5042 // if ( v168 != v169 ) | |
5043 // { | |
5044 // if ( v168 <= v169 ) | |
5045 // { | |
5046 // v2->field_38 = v169; | |
5047 // v197 = v169 - v168; | |
5048 // } | |
5049 // else | |
5050 // { | |
5051 // v4->field_38 = v168; | |
5052 // v206 = v168 - v169; | |
5053 // } | |
5054 // } | |
5055 // } | |
5056 // else | |
5057 // { | |
5058 // v167 = (char)v167; | |
5059 // v2->field_38 += (char)v167; | |
5060 // v4->field_38 += (char)v167; | |
5061 // if ( v2->field_38 < 0 ) | |
5062 // v2->field_38 = 0; | |
5063 // if ( v4->field_38 < 0 ) | |
5064 // v4->field_38 = 0; | |
5065 // v197 = v167; | |
5066 // v206 = v167; | |
5067 // } | |
5068 // } | |
5069 // LOBYTE(v170) = v107->field_58[13]; | |
5070 // if ( v170 ) | |
5071 // { | |
5072 // if ( v170 == 99 ) | |
5073 // { | |
5074 // v171 = v2->field_3C; | |
5075 // v172 = v4->field_3C; | |
5076 // if ( v171 != v172 ) | |
5077 // { | |
5078 // if ( v171 <= v172 ) | |
5079 // { | |
5080 // v205 = v172 > v171; | |
5081 // v2->field_3C = v172; | |
5082 // } | |
5083 // else | |
5084 // { | |
5085 // v204 = 1; | |
5086 // v4->field_3C = v171; | |
5087 // } | |
5088 // } | |
5089 // } | |
5090 // else | |
5091 // { | |
5092 // v170 = v170; | |
5093 // v2->field_3C += v170; | |
5094 // v4->field_3C += v170; | |
5095 // if ( v2->field_3C < 0 ) | |
5096 // v2->field_3C = 0; | |
5097 // if ( v4->field_3C < 0 ) | |
5098 // v4->field_3C = 0; | |
5099 // v205 = v170; | |
5100 // v204 = v170; | |
5101 // } | |
5102 // } | |
5103 // LOBYTE(v173) = v107->field_58[14]; | |
5104 // if ( (_BYTE)v173 ) | |
5105 // { | |
5106 // if ( (_BYTE)v173 == 99 ) | |
5107 // { | |
5108 // v174 = v2->field_40; | |
5109 // v175 = v4->field_40; | |
5110 // if ( v174 != v175 ) | |
5111 // { | |
5112 // if ( v174 <= v175 ) | |
5113 // { | |
5114 // v2->field_40 = v175; | |
5115 // v203 = v175 - v174; | |
5116 // } | |
5117 // else | |
5118 // { | |
5119 // v4->field_40 = v174; | |
5120 // v202 = v174 - v175; | |
5121 // } | |
5122 // } | |
5123 // } | |
5124 // else | |
5125 // { | |
5126 // v173 = (char)v173; | |
5127 // v2->field_40 += (char)v173; | |
5128 // v4->field_40 += (char)v173; | |
5129 // if ( v2->field_40 < 0 ) | |
5130 // v2->field_40 = 0; | |
5131 // if ( v4->field_40 < 0 ) | |
5132 // v4->field_40 = 0; | |
5133 // v203 = v173; | |
5134 // v202 = v173; | |
5135 // } | |
5136 // } | |
5137 // v176 = v107->field_58[15]; | |
5138 // if ( v176 ) | |
5139 // { | |
5140 // v177 = am_40D402(v193, v176); | |
5141 // v178 = v107->field_58[15]; | |
5142 // v196 = v177; | |
5143 // v179 = am_40D402(v189, v178); | |
5144 // v195 = v179; | |
5145 // v180 = v107->field_58[15] - v179; | |
5146 // v192 = v107->field_58[15] - v196; | |
5147 // v191 = v180; | |
5148 // } | |
5149 // LOBYTE(v181) = LOBYTE(v107->field_68); | |
5150 // if ( (_BYTE)v181 ) | |
5151 // { | |
5152 // if ( (_BYTE)v181 == 99 ) | |
5153 // { | |
5154 // v182 = v2->field_28; | |
5155 // v183 = v4->field_28; | |
5156 // if ( v182 != v183 ) | |
5157 // { | |
5158 // if ( v182 <= v183 ) | |
5159 // { | |
5160 // v2->field_28 = v183; | |
5161 // v201 = v183 - v182; | |
5162 // } | |
5163 // else | |
5164 // { | |
5165 // v4->field_28 = v182; | |
5166 // v200 = v182 - v183; | |
5167 // } | |
5168 // } | |
5169 // } | |
5170 // else | |
5171 // { | |
5172 // v181 = (char)v181; | |
5173 // v2->field_28 += (char)v181; | |
5174 // v4->field_28 += (char)v181; | |
5175 // if ( v2->field_28 < 0 ) | |
5176 // v2->field_28 = 0; | |
5177 // if ( v4->field_28 < 0 ) | |
5178 // v4->field_28 = 0; | |
5179 // v201 = v181; | |
5180 // v200 = v181; | |
5181 // } | |
5182 // } | |
5183 // LOBYTE(v103) = BYTE1(v107->field_68); | |
5184 // break; | |
5185 // } | |
5186 // if ( (_BYTE)v103 ) | |
5187 // { | |
5188 // if ( (_BYTE)v103 == 99 ) | |
5189 // { | |
5190 // v184 = v2->field_24; | |
5191 // v185 = v4->field_24; | |
5192 // if ( v184 != v185 ) | |
5193 // { | |
5194 // if ( v184 <= v185 ) | |
5195 // { | |
5196 // v2->field_24 = v185; | |
5197 // v199 = v185 - v184; | |
5198 // } | |
5199 // else | |
5200 // { | |
5201 // v4->field_24 = v184; | |
5202 // v198 = v184 - v185; | |
5203 // } | |
5204 // } | |
5205 // } | |
5206 // else | |
5207 // { | |
5208 // v103 = (char)v103; | |
5209 // v2->field_24 += (char)v103; | |
5210 // v4->field_24 += (char)v103; | |
5211 // if ( v2->field_24 < 0 ) | |
5212 // v2->field_24 = 0; | |
5213 // if ( v4->field_24 < 0 ) | |
5214 // v4->field_24 = 0; | |
5215 // v199 = v103; | |
5216 // v198 = v103; | |
5217 // } | |
5218 // } | |
5219 // if ( v194 > 0 || v211 > 0 ) | |
5220 // ArcomageGame::PlaySound(0x1Eu); | |
5221 // if ( v194 < 0 || v211 < 0 ) | |
5222 // ArcomageGame::PlaySound(0x1Fu); | |
5223 // if ( v210 > 0 || v209 > 0 ) | |
5224 // ArcomageGame::PlaySound(0x21u); | |
5225 // if ( v210 < 0 || v209 < 0 ) | |
5226 // ArcomageGame::PlaySound(0x22u); | |
5227 // if ( v208 > 0 || v207 > 0 ) | |
5228 // ArcomageGame::PlaySound(0x24u); | |
5229 // if ( v208 < 0 || v207 < 0 ) | |
5230 // ArcomageGame::PlaySound(0x25u); | |
5231 // if ( v197 > 0 || v206 > 0 ) | |
5232 // ArcomageGame::PlaySound(0x27u); | |
5233 // if ( v197 < 0 || v206 < 0 ) | |
5234 // ArcomageGame::PlaySound(0x28u); | |
5235 // if ( v205 > 0 || v204 > 0 ) | |
5236 // ArcomageGame::PlaySound(0x2Au); | |
5237 // if ( v205 < 0 || v204 < 0 ) | |
5238 // ArcomageGame::PlaySound(0x2Bu); | |
5239 // if ( v203 > 0 || v202 > 0 ) | |
5240 // ArcomageGame::PlaySound(0x2Du); | |
5241 // if ( v203 < 0 || v202 < 0 ) | |
5242 // ArcomageGame::PlaySound(0x2Eu); | |
5243 // if ( v192 || v191 || v196 || v195 ) | |
5244 // ArcomageGame::PlaySound(0x30u); | |
5245 // if ( v201 > 0 || v200 > 0 ) | |
5246 // ArcomageGame::PlaySound(0x31u); | |
5247 // if ( v201 < 0 || v200 < 0 ) | |
5248 // ArcomageGame::PlaySound(0x32u); | |
5249 // if ( v199 > 0 || v198 > 0 ) | |
5250 // ArcomageGame::PlaySound(0x34u); | |
5251 // if ( v199 < 0 || v198 < 0 ) | |
5252 // ArcomageGame::PlaySound(0x35u); | |
5253 // if ( v193 ) | |
5254 // { | |
5255 // if ( v194 ) | |
5256 // { | |
5257 // v187.x = 573; | |
5258 // v187.y = 92; | |
5259 // am_40D2B4(&v187, v194); | |
5260 // } | |
5261 // if ( v211 ) | |
5262 // { | |
5263 // v187.x = 26; | |
5264 // v187.y = 92; | |
5265 // am_40D2B4(&v187, v211); | |
5266 // } | |
5267 // if ( v210 ) | |
5268 // { | |
5269 // v187.x = 573; | |
5270 // v187.y = 164; | |
5271 // am_40D2B4(&v187, v210); | |
5272 // } | |
5273 // if ( v209 ) | |
5274 // { | |
5275 // v187.x = 26; | |
5276 // v187.y = 164; | |
5277 // am_40D2B4(&v187, v209); | |
5278 // } | |
5279 // if ( v208 ) | |
5280 // { | |
5281 // v187.x = 573; | |
5282 // v187.y = 236; | |
5283 // am_40D2B4(&v187, v208); | |
5284 // } | |
5285 // if ( v207 ) | |
5286 // { | |
5287 // v187.x = 26; | |
5288 // v187.y = 236; | |
5289 // am_40D2B4(&v187, v207); | |
5290 // } | |
5291 // if ( v197 ) | |
5292 // { | |
5293 // v187.x = 563; | |
5294 // v187.y = 114; | |
5295 // am_40D2B4(&v187, v197); | |
5296 // } | |
5297 // if ( v206 ) | |
5298 // { | |
5299 // v187.x = 16; | |
5300 // v187.y = 114; | |
5301 // am_40D2B4(&v187, v206); | |
5302 // } | |
5303 // if ( v205 ) | |
5304 // { | |
5305 // v187.x = 563; | |
5306 // v187.y = 186; | |
5307 // am_40D2B4(&v187, v205); | |
5308 // } | |
5309 // if ( v204 ) | |
5310 // { | |
5311 // v187.x = 16; | |
5312 // v187.y = 186; | |
5313 // am_40D2B4(&v187, v204); | |
5314 // } | |
5315 // if ( v203 ) | |
5316 // { | |
5317 // v187.x = 563; | |
5318 // v187.y = 258; | |
5319 // am_40D2B4(&v187, v203); | |
5320 // } | |
5321 // if ( v202 ) | |
5322 // { | |
5323 // v187.x = 16; | |
5324 // v187.y = 258; | |
5325 // am_40D2B4(&v187, v202); | |
5326 // } | |
5327 // v186 = 296; | |
5328 // if ( v201 ) | |
5329 // { | |
5330 // v187.x = 442; | |
5331 // v187.y = 296; | |
5332 // am_40D2B4(&v187, v201); | |
5333 // } | |
5334 // if ( v200 ) | |
5335 // { | |
5336 // v187.x = 180; | |
5337 // v187.y = 296; | |
5338 // am_40D2B4(&v187, v200); | |
5339 // } | |
5340 // if ( v199 ) | |
5341 // { | |
5342 // v187.x = 514; | |
5343 // v187.y = 296; | |
5344 // am_40D2B4(&v187, v199); | |
5345 // } | |
5346 // if ( v198 ) | |
5347 // { | |
5348 // v187.x = 122; | |
5349 // v187.y = 296; | |
5350 // am_40D2B4(&v187, v198); | |
5351 // } | |
5352 // if ( v196 ) | |
5353 // { | |
5354 // v187.x = 442; | |
5355 // v187.y = 296; | |
5356 // am_40D2B4(&v187, v196); | |
5357 // } | |
5358 // if ( v192 ) | |
5359 // { | |
5360 // v187.x = 514; | |
5361 // v187.y = 296; | |
5362 // am_40D2B4(&v187, v192); | |
5363 // } | |
5364 // if ( v195 ) | |
5365 // { | |
5366 // v187.x = 180; | |
5367 // v187.y = 296; | |
5368 // am_40D2B4(&v187, v195); | |
5369 // } | |
5370 // if ( v191 ) | |
5371 // { | |
5372 // v187.x = 122; | |
5373 // goto LABEL_567; | |
5374 // } | |
5375 // } | |
5376 // else | |
5377 // { | |
5378 // if ( v194 ) | |
5379 // { | |
5380 // v187.x = 26; | |
5381 // v187.y = 92; | |
5382 // am_40D2B4(&v187, v194); | |
5383 // } | |
5384 // if ( v211 ) | |
5385 // { | |
5386 // v187.x = 573; | |
5387 // v187.y = 92; | |
5388 // am_40D2B4(&v187, v211); | |
5389 // } | |
5390 // if ( v210 ) | |
5391 // { | |
5392 // v187.x = 26; | |
5393 // v187.y = 164; | |
5394 // am_40D2B4(&v187, v210); | |
5395 // } | |
5396 // if ( v209 ) | |
5397 // { | |
5398 // v187.x = 573; | |
5399 // v187.y = 164; | |
5400 // am_40D2B4(&v187, v209); | |
5401 // } | |
5402 // if ( v208 ) | |
5403 // { | |
5404 // v187.x = 26; | |
5405 // v187.y = 236; | |
5406 // am_40D2B4(&v187, v208); | |
5407 // } | |
5408 // if ( v207 ) | |
5409 // { | |
5410 // v187.x = 573; | |
5411 // v187.y = 236; | |
5412 // am_40D2B4(&v187, v207); | |
5413 // } | |
5414 // if ( v197 ) | |
5415 // { | |
5416 // v187.x = 16; | |
5417 // v187.y = 114; | |
5418 // am_40D2B4(&v187, v197); | |
5419 // } | |
5420 // if ( v206 ) | |
5421 // { | |
5422 // v187.x = 563; | |
5423 // v187.y = 114; | |
5424 // am_40D2B4(&v187, v206); | |
5425 // } | |
5426 // if ( v205 ) | |
5427 // { | |
5428 // v187.x = 16; | |
5429 // v187.y = 186; | |
5430 // am_40D2B4(&v187, v205); | |
5431 // } | |
5432 // if ( v204 ) | |
5433 // { | |
5434 // v187.x = 563; | |
5435 // v187.y = 186; | |
5436 // am_40D2B4(&v187, v204); | |
5437 // } | |
5438 // if ( v203 ) | |
5439 // { | |
5440 // v187.x = 16; | |
5441 // v187.y = 258; | |
5442 // am_40D2B4(&v187, v203); | |
5443 // } | |
5444 // if ( v202 ) | |
5445 // { | |
5446 // v187.x = 563; | |
5447 // v187.y = 258; | |
5448 // am_40D2B4(&v187, v202); | |
5449 // } | |
5450 // v186 = 296; | |
5451 // if ( v201 ) | |
5452 // { | |
5453 // v187.x = 180; | |
5454 // v187.y = 296; | |
5455 // am_40D2B4(&v187, v201); | |
5456 // } | |
5457 // if ( v200 ) | |
5458 // { | |
5459 // v187.x = 442; | |
5460 // v187.y = 296; | |
5461 // am_40D2B4(&v187, v200); | |
5462 // } | |
5463 // if ( v199 ) | |
5464 // { | |
5465 // v187.x = 122; | |
5466 // v187.y = 296; | |
5467 // am_40D2B4(&v187, v199); | |
5468 // } | |
5469 // if ( v198 ) | |
5470 // { | |
5471 // v187.x = 514; | |
5472 // v187.y = 296; | |
5473 // am_40D2B4(&v187, v198); | |
5474 // } | |
5475 // if ( v196 ) | |
5476 // { | |
5477 // v187.x = 180; | |
5478 // v187.y = 296; | |
5479 // am_40D2B4(&v187, v196); | |
5480 // } | |
5481 // if ( v192 ) | |
5482 // { | |
5483 // v187.x = 122; | |
5484 // v187.y = 296; | |
5485 // am_40D2B4(&v187, v192); | |
5486 // } | |
5487 // if ( v195 ) | |
5488 // { | |
5489 // v187.x = 442; | |
5490 // v187.y = 296; | |
5491 // am_40D2B4(&v187, v195); | |
5492 // } | |
5493 // if ( v191 ) | |
5494 // { | |
5495 // v187.x = 514; | |
5496 //LABEL_567: | |
5497 // v187.y = v186; | |
5498 // am_40D2B4(&v187, v191); | |
5499 // return; | |
5500 // } | |
5501 // } | |
0 | 5502 } |
5503 | |
5504 | |
5505 | |
5506 | |
5507 //----- (0040D2B4) -------------------------------------------------------- | |
1185 | 5508 int am_40D2B4( POINT* a1, int a2 ) |
5509 { | |
0 | 5510 int v2; // ebp@1 |
1185 | 5511 POINT *v3; // edi@1 |
0 | 5512 int result; // eax@3 |
1194 | 5513 int v6; |
0 | 5514 stru272_stru0 *v8; // ecx@12 |
5515 signed int v11; // [sp+10h] [bp-8h]@1 | |
1194 | 5516 |
0 | 5517 |
5518 v11 = 0; | |
5519 v2 = a2; | |
5520 v3 = a1; | |
1185 | 5521 while ( array_4FABD0[v11].field_0 ) |
5522 { | |
5523 result = array_4FABD0[v11].field_40->_40E2A7(); | |
5524 if ( !result ) | |
5525 { | |
5526 array_4FABD0[v11].field_0 = 0; | |
5527 --v11; | |
5528 } | |
5529 ++v11; | |
5530 if ( v11 >= 10 ) | |
5531 return result; | |
5532 } | |
5533 v6 = v11; | |
5534 array_4FABD0[v11].field_0 = 1; | |
0 | 5535 if ( v2 <= 0 ) |
1185 | 5536 { |
5537 array_4FABD0[v6].field_1 = 0; | |
5538 v2 = -v2; | |
5539 } | |
0 | 5540 else |
1185 | 5541 { |
5542 array_4FABD0[v6].field_1 = 1; | |
5543 } | |
1186 | 5544 array_4FABD0[v6].field_4.field_0 = v3->x - 20; |
5545 array_4FABD0[v6].field_4.field_8 = v3->x + 20; | |
5546 array_4FABD0[v6].field_4.field_4 = v3->y - 20; | |
5547 array_4FABD0[v6].field_4.field_C = v3->y + 20; | |
5548 array_4FABD0[v6].field_4.field_10 = -60; | |
5549 array_4FABD0[v6].field_4.field_14 = 60; | |
5550 array_4FABD0[v6].field_4.field_18 = 180; | |
5551 array_4FABD0[v6].field_4.field_1Cf = 0.5; | |
5552 array_4FABD0[v6].field_4.field_20 = 150; | |
5553 array_4FABD0[v6].field_4.field_24f= 50.0; | |
5554 array_4FABD0[v6].field_4.field_28f = 3.0; | |
5555 array_4FABD0[v6].field_4.field_2Cf = 8.0; | |
5556 array_4FABD0[v6].field_4.field_30 = 5; | |
5557 array_4FABD0[v6].field_4.field_34 = 15; | |
5558 array_4FABD0[v6].field_4.field_38 = &array_4FABD0[v6].field_44[0]; | |
1185 | 5559 v8 = array_4FABD0[v6].field_40; |
1186 | 5560 v8->_40E01A(&array_4FABD0[v6].field_4); |
0 | 5561 if ( 10 * v2 > 150 ) |
1185 | 5562 v2 = 15; |
5563 | |
1184 | 5564 if ( v8->signature != SIG_trpg ) |
0 | 5565 return 2; |
5566 if ( !v8->field_59 ) | |
5567 return 3; | |
5568 v8->field_8 = 10 * v2; | |
5569 v8->field_30 = 0.0; | |
5570 v8->field_58 = 0; | |
5571 v8->field_44 = 0; | |
5572 v8->field_4C = 0; | |
5573 v8->field_48 = 0; | |
5574 v8->field_50 = 0; | |
1185 | 5575 for (int i=0; i<v8->field_4; ++i) |
5576 v8->field_54[i].field_0=0; | |
0 | 5577 return 0; |
5578 } | |
1185 | 5579 |
0 | 5580 |
5581 //----- (0040D402) -------------------------------------------------------- | |
5582 int __fastcall am_40D402(int a1, int a2) | |
5583 { | |
1183 | 5584 ArcomagePlayer *v2; // ecx@1 |
0 | 5585 int v3; // esi@1 |
5586 int result; // eax@3 | |
5587 | |
1183 | 5588 v2 = &am_Players[a1]; |
1197 | 5589 v3 = v2->wall_height; |
0 | 5590 if ( v3 <= 0 ) |
5591 { | |
5592 result = 0; | |
5593 } | |
5594 else | |
5595 { | |
5596 if ( v3 >= -a2 ) | |
5597 { | |
5598 result = a2; | |
1197 | 5599 v2->wall_height = a2 + v3; |
0 | 5600 goto LABEL_7; |
5601 } | |
5602 a2 += v3; | |
5603 result = -v3; | |
1197 | 5604 v2->wall_height = 0; |
0 | 5605 } |
1197 | 5606 v2->tower_height += a2; |
0 | 5607 LABEL_7: |
1197 | 5608 if ( v2->tower_height < 0 ) |
5609 v2->tower_height = 0; | |
0 | 5610 return result; |
5611 } | |
5612 // 40D402: using guessed type int __fastcall am_40D402(uint, uint); | |
5613 | |
5614 //----- (0040D444) -------------------------------------------------------- | |
1197 | 5615 int __cdecl GameResultsApply() |
0 | 5616 { |
5617 int v0; // esi@1 | |
5618 int v1; // edi@1 | |
5619 int v2; // eax@1 | |
5620 int v3; // eax@23 | |
5621 int v4; // edx@25 | |
5622 int v5; // ecx@28 | |
5623 int v6; // eax@28 | |
5624 GUIWindow *v7; // ecx@50 | |
5625 signed int v8; // eax@50 | |
5626 char *v9; // eax@52 | |
5627 signed int v10; // eax@54 | |
5628 char *v11; // esi@59 | |
5629 char *v12; // esi@65 | |
5630 signed int v14; // [sp-4h] [bp-58h]@46 | |
5631 char pText[64]; // [sp+Ch] [bp-48h]@1 | |
5632 int xy[2]; // [sp+4Ch] [bp-8h]@1 | |
5633 | |
5634 v0 = -1; | |
5635 v1 = -1; | |
5636 //nullsub_1(); | |
5637 xy[0] = 0; | |
5638 xy[1] = 0; | |
5639 inv_strcpy("Ïîáåäè", pText); | |
5640 v2 = 0; | |
5641 xy[1] = 160; | |
5642 xy[0] = 320 - 12 * v2 / 2; | |
1183 | 5643 // pPrimaryWindow_draws_text(-1, pText, xy); |
1197 | 5644 if ( am_Players[0].tower_height < max_tower_height ) |
0 | 5645 { |
1197 | 5646 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 5647 goto LABEL_10; |
5648 v0 = 2; | |
5649 } | |
5650 else | |
5651 { | |
1197 | 5652 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 5653 { |
5654 v0 = 1; | |
5655 } | |
5656 else | |
5657 { | |
1197 | 5658 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 5659 { |
5660 v0 = 0; | |
5661 v1 = 4; | |
5662 goto LABEL_10; | |
5663 } | |
1197 | 5664 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 5665 } |
5666 } | |
5667 v1 = 0; | |
5668 LABEL_10: | |
1197 | 5669 if ( am_Players[0].tower_height <= 0 ) |
0 | 5670 { |
1197 | 5671 if ( am_Players[1].tower_height > 0 ) |
0 | 5672 { |
5673 v0 = 2; | |
5674 } | |
5675 else | |
5676 { | |
1197 | 5677 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 5678 { |
5679 LABEL_20: | |
1197 | 5680 if ( am_Players[0].wall_height == am_Players[1].wall_height ) |
0 | 5681 { |
5682 v0 = 0; | |
5683 v1 = 4; | |
5684 } | |
5685 else | |
5686 { | |
1197 | 5687 v0 = (am_Players[0].wall_height <= am_Players[1].wall_height) + 1; |
0 | 5688 v1 = 1; |
5689 } | |
5690 goto LABEL_23; | |
5691 } | |
1197 | 5692 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 5693 } |
5694 goto LABEL_17; | |
5695 } | |
1197 | 5696 if ( am_Players[1].tower_height <= 0 ) |
0 | 5697 { |
5698 v0 = 1; | |
5699 LABEL_17: | |
5700 v1 = 2; | |
5701 } | |
5702 if ( !v0 && v1 == 4 ) | |
5703 goto LABEL_20; | |
5704 LABEL_23: | |
1197 | 5705 v3 = am_Players[0].resource_bricks; |
5706 if ( am_Players[0].resource_bricks <= am_Players[0].resource_gems ) | |
0 | 5707 { |
1197 | 5708 v3 = am_Players[0].resource_beasts; |
5709 v4 = am_Players[0].resource_gems; | |
5710 if ( am_Players[0].resource_gems > am_Players[0].resource_beasts ) | |
0 | 5711 goto LABEL_28; |
5712 } | |
5713 else | |
5714 { | |
1197 | 5715 if ( am_Players[0].resource_bricks <= am_Players[0].resource_beasts ) |
0 | 5716 { |
1197 | 5717 v4 = am_Players[0].resource_beasts; |
0 | 5718 goto LABEL_28; |
5719 } | |
5720 } | |
5721 v4 = v3; | |
5722 LABEL_28: | |
1197 | 5723 v5 = am_Players[1].resource_bricks; |
5724 v6 = am_Players[1].resource_gems; | |
5725 if ( am_Players[1].resource_bricks <= am_Players[1].resource_gems ) | |
0 | 5726 { |
1197 | 5727 v5 = am_Players[1].resource_beasts; |
5728 if ( am_Players[1].resource_gems > am_Players[1].resource_beasts ) | |
0 | 5729 goto LABEL_33; |
5730 goto LABEL_32; | |
5731 } | |
1197 | 5732 v6 = am_Players[1].resource_beasts; |
5733 if ( am_Players[1].resource_bricks > am_Players[1].resource_beasts ) | |
0 | 5734 LABEL_32: |
5735 v6 = v5; | |
5736 LABEL_33: | |
5737 if ( v0 == -1 ) | |
5738 { | |
5739 if ( v1 != -1 ) | |
5740 goto LABEL_49; | |
1197 | 5741 if ( v4 < max_resources_amount ) |
0 | 5742 { |
1197 | 5743 if ( v6 < max_resources_amount ) |
0 | 5744 goto LABEL_49; |
5745 v0 = 2; | |
5746 } | |
5747 else | |
5748 { | |
1197 | 5749 if ( v6 < max_resources_amount ) |
0 | 5750 { |
5751 v0 = 1; | |
5752 } | |
5753 else | |
5754 { | |
5755 if ( v4 == v6 ) | |
5756 goto LABEL_46; | |
5757 v0 = (v4 <= v6) + 1; | |
5758 } | |
5759 } | |
5760 v1 = 3; | |
5761 } | |
5762 if ( !v0 && v1 == 4 ) | |
5763 { | |
5764 if ( v4 != v6 ) | |
5765 { | |
5766 v14 = 5; | |
5767 v0 = (v4 <= v6) + 1; | |
5768 goto LABEL_48; | |
5769 } | |
5770 LABEL_46: | |
5771 v0 = 0; | |
5772 v14 = 4; | |
5773 LABEL_48: | |
5774 v1 = v14; | |
5775 } | |
5776 LABEL_49: | |
5777 pArcomageGame->field_B0 = v1; | |
5778 pArcomageGame->uGameResult = v0; | |
5779 if ( v0 == 1 ) | |
5780 { | |
336 | 5781 v7 = window_SpeakInHouse; |
1197 | 5782 v8 = (signed int)window_SpeakInHouse->par1C; |
0 | 5783 if ( v8 >= 108 ) |
5784 { | |
5785 if ( v8 <= 120 ) | |
5786 { | |
5787 v9 = (char *)&pParty->uNumGoldInBank + v8 + 1; | |
5788 if ( !*v9 ) | |
5789 { | |
5790 *v9 = 1; | |
5791 | |
5792 //auto _a = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v7->ptr_1C] * 100.0); | |
1197 | 5793 auto _a = (signed int)(p2DEvents[(unsigned int)v7->par1C - 1].fPriceMultiplier * 100.0); |
0 | 5794 party_finds_gold(_a, 0); |
5795 } | |
5796 } | |
5797 } | |
5798 v10 = 108; | |
5799 do | |
5800 { | |
5801 if ( !*((unsigned char *)&pParty->uNumGoldInBank + v10 + 1) ) | |
5802 break; | |
5803 ++v10; | |
5804 } | |
5805 while ( v10 <= 120 ); | |
5806 if ( v10 == 121 ) | |
484 | 5807 _449B7E_toggle_bit(pParty->_quest_bits, 238, 1u); |
735 | 5808 v11 = (char *)pParty->pPlayers[0]._guilds_member_bits; |
0 | 5809 do |
5810 { | |
5811 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v11, 1) ) | |
949 | 5812 _449B7E_toggle_bit((unsigned char *)v11, PLAYER_GUILD_BITS__ARCOMAGE_WIN, 1); |
0 | 5813 v11 += 6972; |
5814 } | |
463 | 5815 while ( (signed int)v11 < (signed int)((char *)&pParty->StandartItemsInShops[36] + 2) ); |
949 | 5816 ++pParty->uNumArcomageWins; |
5817 if ( pParty->uNumArcomageWins > 1000000 ) | |
5818 pParty->uNumArcomageWins = 1000000; | |
0 | 5819 } |
5820 else | |
5821 { | |
735 | 5822 v12 = (char *)pParty->pPlayers[0]._guilds_member_bits; |
0 | 5823 do |
5824 { | |
5825 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v12, 1) ) | |
949 | 5826 _449B7E_toggle_bit((unsigned char *)v12, PLAYER_GUILD_BITS__ARCOMAGE_LOSE, 1); |
0 | 5827 v12 += 6972; |
5828 } | |
463 | 5829 while ( (signed int)v12 < (signed int)((char *)&pParty->StandartItemsInShops[36] + 2) ); |
949 | 5830 ++pParty->uNumArcomageLoses; |
5831 if ( pParty->uNumArcomageLoses > 1000000 ) | |
5832 pParty->uNumArcomageLoses = 1000000; | |
0 | 5833 } |
5834 return 0; | |
5835 } | |
5836 | |
5837 | |
5838 | |
5839 //----- (00409C8B) -------------------------------------------------------- | |
1197 | 5840 void PrepareArcomage() |
5841 { | |
0 | 5842 signed __int64 v1; // qax@4 |
5843 int v2; // esi@4 | |
1183 | 5844 int v3; // esi@5 |
0 | 5845 signed int v4; // edi@5 |
5846 int v6; // edx@9 | |
1183 | 5847 RECT pXYZW; // [sp+8h] [bp-1Ch]@5 |
5848 POINT pXY; // [sp+18h] [bp-Ch]@5 | |
0 | 5849 |
5850 pAudioPlayer->StopChannels(-1, -1); | |
5851 strcpy(pArcomageGame->pPlayer1Name, pArcomagePlayer1Name); | |
5852 strcpy(pArcomageGame->pPlayer2Name, pArcomagePlayer2Name); | |
5853 am_byte_4FAA76 = 0; | |
5854 am_byte_4FAA75 = 0; | |
1183 | 5855 |
5856 for (int i=0; i<10; ++i) | |
5857 { | |
5858 v2 = (i+1) % 4; | |
5859 v3 = (i+1) / 4; | |
5860 struct_st1[i].uCardId = -1; | |
5861 struct_st1[i].field_4 = 0; | |
5862 struct_st1[i].field_8.x = 100 * v2 + 120; | |
5863 struct_st1[i].field_8.y = 138 * v3 + 18; | |
5864 struct_st1[i].field_10_xplus = -100 * v2 / 5; | |
5865 struct_st1[i].field_14_y_plus = -138 * v3 / 5; | |
5866 struct_st1[i].field_18_point.x = struct_st1[i].field_8.x; | |
5867 struct_st1[i].field_18_point.y = struct_st1[i].field_8.y; | |
5868 } | |
5869 | |
5870 pXY.x = 0; | |
5871 pXY.y = 0; | |
0 | 5872 ArcomageGame::LoadBackground(); |
1183 | 5873 pXYZW.left = 0; |
5874 pXYZW.right = 640; | |
5875 pXYZW.top = 0; | |
5876 pXYZW.bottom = 480; | |
0 | 5877 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1183 | 5878 Blt_Copy(&pXYZW, &pXY, 2); |
0 | 5879 am_EndScene(); |
5880 pRenderer->Present(); | |
5881 ArcomageGame::LoadSprites(); | |
5882 CallRenderPresent(); | |
1183 | 5883 |
0 | 5884 v4 = 120; |
1183 | 5885 for (int i=0; i<12; ++i) |
5886 am_sounds[i] = pSoundList->LoadSound(v4++, 0); | |
5887 | |
1184 | 5888 |
5889 for (int i=0; i<10; ++i) | |
5890 array_4FABD0[i].field_40->_40DFD1(array_4FABD0[i].field_40); | |
5891 | |
0 | 5892 dword_4FABBC = -1; |
5893 amuint_4FAA4C = -1; | |
5894 byte_4FAA74 = 0; | |
5895 pArcomageGame->field_F4 = 0; | |
5896 byte_4FAA2C = 0; | |
5897 byte_505880 = 0; | |
5898 dword_4FAA70 = 0; | |
5899 am_byte_4FAA77 = 0; | |
1197 | 5900 SetStartGameData(); |
1183 | 5901 am_40A255(); |
0 | 5902 //nullsub_1(); |
1197 | 5903 pArcomageGame->GameOver = 0; |
1183 | 5904 pArcomageGame->pfntComic = pFontComic; |
5905 pArcomageGame->pfntArrus = pFontArrus; | |
0 | 5906 } |
5907 | |
5908 | |
5909 //----- (0040D711) -------------------------------------------------------- | |
5910 ArcomageGame::ArcomageGame() | |
5911 { | |
1183 | 5912 field_4 = 0; |
0 | 5913 //RGBTexture::RGBTexture(&this->pGameBackground); |
5914 //RGBTexture::RGBTexture(&v1->pSprites); | |
1183 | 5915 bGameInProgress = 0; |
5916 field_F9 = 0; | |
0 | 5917 } |
938 | 5918 |
5919 | |
5920 | |
5921 | |
5922 | |
5923 | |
5924 //----- (00409BE8) -------------------------------------------------------- | |
1197 | 5925 void SetStartConditions() |
938 | 5926 { |
1197 | 5927 ArcomageStartConditions *v1; // eax@1 |
1185 | 5928 |
1197 | 5929 v1 = &start_conditions[window_SpeakInHouse->par1C - 108]; |
5930 start_tower_height = v1->tower_height; | |
5931 start_wall_height = v1->wall_height; | |
5932 start_quarry_level = v1->quarry_level - 1; | |
5933 start_magic_level = v1->magic_level - 1; | |
5934 start_might_level = v1->might_level - 1; | |
1185 | 5935 dword_4E1874 = 5; |
1197 | 5936 quarry_bonus = 1; |
5937 magic_bonus = 1; | |
5938 might_bonus = 1; | |
5939 max_tower_height = v1->max_tower; | |
5940 max_resources_amount = v1->max_resources; | |
1185 | 5941 |
5942 dword_4DF3A4 = v1->field_14; | |
5943 | |
1197 | 5944 start_bricks_amount = v1->bricks_amount; |
5945 start_gems_amount = v1->gems_amount; | |
5946 start_beasts_amount = v1->beasts_amount; | |
1185 | 5947 |
1183 | 5948 } |
5949 | |
5950 | |
5951 //----- (0040D75D) -------------------------------------------------------- | |
5952 void pPrimaryWindow_draws_text( int a1, const char *pText, POINT *pXY ) | |
5953 { | |
5954 int v4; // qax@1 | |
5955 v4 = pFontComic->uFontHeight - 3; | |
5956 pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - (v4 >> 1) + 3, 0, pText, 0, 0, 0); | |
5957 } | |
5958 | |
5959 | |
5960 //----- (0040DB27) -------------------------------------------------------- | |
1185 | 5961 void __fastcall DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill) |
1183 | 5962 { |
1185 | 5963 RECT *v3; // esi@1 |
1183 | 5964 |
5965 v3 = pXYZW; | |
5966 pRenderer->BeginScene(); | |
5967 pRenderer->SetRasterClipRect(0, 0, 639u, 479u); | |
5968 if ( bSolidFill ) | |
5969 { | |
1185 | 5970 for ( int i = v3->top; i <= v3->bottom; ++i ) |
5971 pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor); | |
1183 | 5972 } |
5973 else | |
5974 { | |
1185 | 5975 pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor); |
5976 pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor); | |
5977 pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor); | |
5978 pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor); | |
1183 | 5979 } |
5980 pRenderer->EndScene(); | |
5981 } | |
5982 | |
1185 | 5983 |
5984 //----- (0040DBD3) -------------------------------------------------------- | |
5985 void SetPixel( POINT *pTargetXY, unsigned __int16 uColor ) | |
5986 { | |
5987 pRenderer->BeginScene(); | |
5988 if ( pRenderer->uNumSceneBegins ) | |
5989 { | |
5990 int xVal = pTargetXY->x; | |
5991 int yVal = pTargetXY->y; | |
5992 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | |
5993 { | |
5994 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
5995 } | |
5996 pRenderer->EndScene(); | |
5997 } | |
5998 } | |
5999 | |
6000 | |
1183 | 6001 //----- (0040DDB1) -------------------------------------------------------- |
6002 int __fastcall rand_interval(int a, int b) | |
6003 { | |
6004 return a + rand() % (b - a + 1); | |
6005 } | |
6006 | |
6007 //----- (0040DEB4) -------------------------------------------------------- | |
6008 char *__fastcall inv_strcat(const char *Source, char *Dest) | |
6009 { | |
6010 return strcat(Dest, Source); | |
6011 } | |
6012 | |
6013 //----- (0040DEBE) -------------------------------------------------------- | |
6014 char *__fastcall inv_strcpy(const char *Source, char *Dest) | |
6015 { | |
6016 return strcpy(Dest, Source); | |
6017 } | |
6018 | |
6019 //----- (0040DEC8) -------------------------------------------------------- | |
6020 void __fastcall intToString(int val, char *pOut) | |
6021 { | |
6022 sprintf(pOut, "%d", val); | |
6023 } |