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