Mercurial > mm7
annotate Arcomage.cpp @ 1769:d45164042a9d
Player::SetVariable removing LABEL_170
author | Grumpy7 |
---|---|
date | Tue, 01 Oct 2013 07:33:52 +0200 |
parents | 4da5644df18f |
children | 35c1e4ff6ba7 |
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> |
6 | |
1254 | 7 #include "Render.h" |
0 | 8 #include "Arcomage.h" |
9 #include "VideoPlayer.h" | |
10 #include "AudioPlayer.h" | |
11 #include "Mouse.h" | |
12 #include "Game.h" | |
13 #include "Viewport.h" | |
14 #include "Time.h" | |
15 #include "GUIFont.h" | |
16 #include "Party.h" | |
17 #include "GUIWindow.h" | |
18 #include "Events2D.h" | |
19 #include "VectorTypes.h" | |
189 | 20 #include "texts.h" |
1183 | 21 #include <windef.h> |
1262 | 22 #include "mm7_data.h" |
0 | 23 |
24 | |
25 | |
1197 | 26 void SetStartConditions(); |
27 void SetStartGameData(); | |
28 void FillPlayerDeck(); | |
1200 | 29 void InitalHandsFill(); |
30 void GetNextCardFromDeck(int player_num); | |
1185 | 31 int GetEmptyCardSlotIndex(int player_num); |
1197 | 32 void IncreaseResourcesInTurn(int player_num); |
1263 | 33 void TurnChange(); |
1256 | 34 bool IsGameOver(); |
35 int CalculateCardPower(ArcomagePlayer* player, ArcomagePlayer* enemy, ArcomageCard* pCard, int mastery); | |
36 char PlayerTurn(int player_num); | |
1263 | 37 void DrawGameUI(int animation_stage); |
38 void DrawSparks(); | |
1197 | 39 void DrawRectanglesForText(); |
40 void DrawPlayersText(); | |
1263 | 41 void DrawPlayerLevels(int a1, char *text, POINT *pXY); |
42 void DrawBricksCount(int a1, char* text, POINT *pXY); | |
1197 | 43 void DrawGemsCount(int a1, char* text, POINT* pXY); |
1263 | 44 void DrawBeastsCount(int a1, char *text, POINT *pXY); |
1209 | 45 void DrawPlayersTowers(); |
46 void DrawPlayersWall(); | |
47 void DrawCards(); | |
1218 | 48 void DrawCardAnimation(int a1); |
1185 | 49 int GetPlayerHandCardCount(int player_num); |
1679 | 50 int DrawCardsRectangles(int player_num); |
51 bool DiscardCard(int player_num, int card_slot_index); | |
52 bool PlayCard(int player_num, int card_slot_num); | |
1200 | 53 bool CanCardBePlayed(int player_num, int hand_card_indx); |
1263 | 54 void ApplyCardToPlayer(int player_num, unsigned int uCardID); |
1185 | 55 int am_40D2B4(POINT* a1, int a2); // weak |
1246 | 56 int ApplyDamageToBuildings(int player_num, int damage); // weak |
1218 | 57 void GameResultsApply(); |
1183 | 58 |
1679 | 59 void am_DrawText(int a1, const char *pText, POINT *pXY); |
1458 | 60 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb |
1183 | 61 void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4); |
62 void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3); | |
1458 | 63 void am_EndScene(); |
1263 | 64 void DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill); |
1679 | 65 void DrawSquare( POINT *pTargetXY, unsigned __int16 uColor ); |
66 void DrawPixel(POINT *pTargetXY, unsigned __int16 uColor); | |
1263 | 67 int rand_interval(int min, int max); // idb |
1679 | 68 void __fastcall am_IntToString(int val, char *pOut); |
938 | 69 |
1393 | 70 //----- (0040DEDB) -------------------------------------------------------- |
71 unsigned int R8G8B8_to_TargetFormat(int uColor) | |
72 { | |
73 return TargetColor(LOBYTE(uColor), BYTE1(uColor), BYTE2(uColor)); | |
74 } | |
75 | |
938 | 76 /* 388 */ |
77 #pragma pack(push, 1) | |
1197 | 78 struct ArcomageStartConditions |
938 | 79 { |
1197 | 80 __int16 max_tower; |
81 __int16 max_resources; | |
82 __int16 tower_height; | |
83 __int16 wall_height; | |
84 __int16 quarry_level; | |
85 __int16 magic_level; | |
1200 | 86 __int16 zoo_level; |
1197 | 87 __int16 bricks_amount; |
88 __int16 gems_amount; | |
89 __int16 beasts_amount; | |
1256 | 90 int mastery_lvl; |
938 | 91 }; |
92 #pragma pack(pop) | |
1256 | 93 const ArcomageStartConditions start_conditions[13] = |
938 | 94 { |
95 { 30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0}, | |
96 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1}, | |
97 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 2}, | |
98 { 75, 200, 25, 10, 3, 3, 3, 5, 5, 5, 2}, | |
99 { 75, 200, 20, 10, 3, 3, 3, 5, 5, 5, 1}, | |
100 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 1}, | |
101 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 2}, | |
102 {150, 400, 20, 10, 5, 5, 5, 25, 25, 25, 0}, | |
103 {200, 500, 20, 10, 1, 1, 1, 15, 15, 15, 2}, | |
104 {100, 300, 20, 50, 1, 1, 5, 5, 5, 25, 0}, | |
105 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 2}, | |
106 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 1}, | |
107 {100, 300, 50, 50, 5, 3, 5, 20, 10, 20, 0} | |
108 }; | |
109 | |
1184 | 110 #define SIG_trpg 0x67707274 |
111 #define SIG_xxxx 0x78787878 | |
0 | 112 |
113 ArcomageGame *pArcomageGame = new ArcomageGame; | |
1194 | 114 |
1679 | 115 ArcomagePlayer am_Players[2]; // 00505708 |
116 AcromageCardOnTable shown_cards[10]; // 004FAA78 | |
117 stru272 array_4FABD0[10]; // 4FABD0 | |
118 | |
119 | |
120 ArcomageDeck playDeck; // 00505288 | |
121 ArcomageDeck deckMaster; // 005054C8 | |
1201 | 122 |
123 char Player2Name[] = "Enemy"; | |
124 char Player1Name[] = "Player"; | |
0 | 125 |
126 /* 267 */ | |
127 #pragma pack(push, 1) | |
128 struct stru273 | |
129 { | |
130 bool _40DD2F(); | |
1185 | 131 bool Inside(RECT*pXYZW); |
0 | 132 |
133 int x; | |
134 int y; | |
1263 | 135 char curr_mouse_left; |
136 char mouse_left_state_changed; | |
137 char curr_mouse_right; | |
138 char mouse_right_state_changed; | |
0 | 139 }; |
140 #pragma pack(pop) | |
141 | |
1186 | 142 |
1256 | 143 #pragma pack(push, 1) |
144 struct am_2 | |
145 { | |
146 int slot_index; | |
147 int card_power; | |
148 }; | |
149 #pragma pack(pop) | |
150 | |
1263 | 151 am_2 cards_power[10]; |
1256 | 152 std::array<__int16, 12> am_sounds; |
153 | |
1218 | 154 char byte_4E185C = 1; // weak |
155 char am_byte_4E185D = 1; // weak | |
1263 | 156 char use_start_bonus = 1; // weak |
1185 | 157 |
1201 | 158 int start_tower_height; |
159 int start_wall_height; | |
160 int start_quarry_level; | |
161 int start_magic_level; | |
162 int start_zoo_level; | |
163 | |
164 | |
1679 | 165 int minimum_cards_at_hand = 5; // 004E1874 |
1201 | 166 int quarry_bonus = 1; |
167 int magic_bonus = 1; | |
168 int zoo_bonus = 1; | |
169 | |
170 int max_tower_height = 50; | |
171 int max_resources_amount = 100 ; | |
1185 | 172 |
1256 | 173 int opponent_mastery = 1 ; // weak |
1185 | 174 |
1679 | 175 bool am_gameover; // 004FAA2C |
1186 | 176 char byte_4FAA2D; // weak |
177 | |
1679 | 178 int current_player_num; // 004FAA6C |
179 char need_to_discard_card; // 04FAA77 | |
180 | |
181 int current_card_slot_index; // 004FABBC | |
182 int played_card_id; // 4FABC0 | |
183 int uCardID; // 4FAA50 | |
184 | |
185 int deck_walk_index; // 004FABC8 | |
1201 | 186 |
187 int start_bricks_amount; | |
188 int start_gems_amount; | |
189 int start_beasts_amount; | |
1197 | 190 |
1209 | 191 POINT amuint_4FAA3C_blt_xy; |
192 POINT am_uint_4FAA44_blt_xy; | |
193 POINT amuint_4FAA54_blt_xy; | |
194 POINT amuint_4FAA5C_blt_xy; | |
195 | |
1245 | 196 int dword_4FAA64; // weak |
197 int dword_4FAA68; // weak | |
1209 | 198 |
199 int dword_4FABB8; // weak | |
200 | |
1256 | 201 char byte_4FAA00; // weak |
202 | |
203 int amuint_4FAA34; // weak | |
204 int amuint_4FAA38; // weak | |
205 int amuint_4FAA4C; // weak | |
206 | |
207 char byte_4FAA2E; // weak | |
208 | |
209 int dword_4FAA70; // weak | |
210 char byte_4FAA74; // weak | |
211 char am_byte_4FAA75; // weak | |
212 char am_byte_4FAA76; // weak | |
213 | |
214 int amuint_4FABC4; // weak | |
215 | |
216 | |
217 char byte_505880; // weak | |
218 char byte_505881; // weak | |
0 | 219 |
220 //----- (0040DD2F) -------------------------------------------------------- | |
221 bool stru273::_40DD2F() | |
222 { | |
223 | |
224 this->x = pArcomageGame->mouse_x; | |
225 this->y = pArcomageGame->mouse_y; | |
1263 | 226 this->curr_mouse_left = pArcomageGame->mouse_left; |
227 this->mouse_left_state_changed = pArcomageGame->mouse_left == pArcomageGame->prev_mouse_left; | |
228 this->curr_mouse_right = pArcomageGame->mouse_right; | |
229 this->mouse_right_state_changed = pArcomageGame->mouse_right == pArcomageGame->prev_mouse_right; | |
230 pArcomageGame->prev_mouse_left = pArcomageGame->mouse_left; | |
231 pArcomageGame->prev_mouse_right = pArcomageGame->mouse_right; | |
1183 | 232 return true; |
0 | 233 } |
234 | |
235 //----- (0040DD93) -------------------------------------------------------- | |
1185 | 236 bool stru273::Inside(RECT*pXYZW ) |
237 { | |
238 | |
239 return (x >= pXYZW->left) && (x <= pXYZW->right) && | |
240 (y>= pXYZW->top) && (y <= pXYZW->bottom); | |
0 | 241 } |
242 | |
1184 | 243 //----- (0040DFD1) -------------------------------------------------------- |
1679 | 244 stru272_stru0 *stru272_stru0::New() |
245 { | |
246 stru272_stru0 *v2 = (stru272_stru0 *)malloc(0x5Cu); | |
1184 | 247 v2->signature = SIG_trpg; |
1263 | 248 v2->position_in_sparks_arr = 0; |
1184 | 249 v2->field_30 = 0.0; |
250 v2->field_58 = 0; | |
251 v2->field_59 = 0; | |
1679 | 252 |
253 return v2; | |
254 } | |
1184 | 255 |
256 //----- (0040DFFE) -------------------------------------------------------- | |
1679 | 257 int stru272_stru0::Free() |
1184 | 258 { |
259 | |
260 if ( this->signature == SIG_trpg ) | |
261 { | |
262 this->signature = SIG_xxxx; | |
263 free(this); | |
264 return 0; | |
265 } | |
266 else | |
267 return 2; | |
268 | |
269 } | |
270 | |
271 //----- (0040E01A) -------------------------------------------------------- | |
1263 | 272 int stru272_stru0::StartFill( stru272_stru2* a2 ) |
1184 | 273 { |
274 auto a1 = this; | |
275 if ( a1->signature == SIG_trpg ) | |
276 { | |
1186 | 277 a1->field_4 = a2->field_20; |
1263 | 278 a1->field_C = a2->effect_area.left << 16; |
279 a1->field_10 = a2->effect_area.top << 16; | |
280 a1->field_14 = a2->effect_area.right << 16; | |
281 a1->field_18 = a2->effect_area.bottom << 16; | |
1186 | 282 a1->field_1C = a2->field_10; |
283 a1->field_20 = a2->field_14; | |
284 a1->field_24 = a2->field_18; | |
285 a1->field_28 = (float)(a2->field_1Cf * 65536.0); | |
286 a1->field_2C = a2->field_24f; | |
287 a1->field_34 = (int)(a2->field_28f * 65536.0); | |
288 a1->field_38 = (int)(a2->field_2Cf * 65536.0); | |
289 a1->field_3C = a2->field_30; | |
290 a1->field_40 = a2->field_34; | |
1263 | 291 a1->field_54 = a2->sparks_array; |
1184 | 292 a1->field_59 = 1; |
1186 | 293 |
1185 | 294 return 0; |
1184 | 295 } |
296 else | |
1185 | 297 return 2; |
1184 | 298 } |
299 | |
300 //----- (0040E0F5) -------------------------------------------------------- | |
1679 | 301 int stru272_stru0::Clear(char a2, char a3) |
1184 | 302 { |
1185 | 303 if ( signature == SIG_trpg) |
1184 | 304 { |
305 if ( a2 ) | |
306 { | |
1263 | 307 position_in_sparks_arr = 0; |
1185 | 308 field_30 = 0.0; |
1184 | 309 } |
1185 | 310 if ( field_59 && a3 ) |
1184 | 311 { |
1185 | 312 |
313 for (int i=0; i<field_4; ++i) | |
1263 | 314 field_54[i].have_spark = 0; |
1185 | 315 field_58 = 0; |
1184 | 316 } |
1185 | 317 return 0; |
1184 | 318 } |
319 else | |
1185 | 320 return 2; |
1184 | 321 } |
322 | |
323 //----- (0040E133) -------------------------------------------------------- | |
1263 | 324 int stru272_stru0::DrawEffect() |
1184 | 325 { |
1186 | 326 |
1184 | 327 stru272_stru0 *v1; // edi@1 |
328 int v3; // ST18_4@3 | |
329 double v4; // st7@3 | |
330 double v5; // st6@4 | |
331 char v6; // bl@8 | |
1186 | 332 stru272_stru1 *v7; // esi@8 |
1184 | 333 int v8; // ecx@10 |
334 signed int v9; // eax@10 | |
335 int v10; // ecx@10 | |
336 signed int v11; // eax@10 | |
1186 | 337 int v12; // ebx@12 |
338 int v13; // ST1C_4@12 | |
339 int v14; // ebx@12 | |
340 int v15; // ST1C_4@12 | |
341 signed int v16; // edx@12 | |
342 int v17; // ebx@12 | |
343 int v18; // ST1C_4@12 | |
344 signed int v19; // edx@12 | |
345 int v20; // [sp+8h] [bp-10h]@8 | |
346 int v21; // [sp+Ch] [bp-Ch]@8 | |
347 float v22; // [sp+14h] [bp-4h]@3 | |
1184 | 348 |
349 v1 = this; | |
350 if ( this->signature != SIG_trpg ) | |
351 return 2; | |
1263 | 352 v3 = this->position_in_sparks_arr; |
1186 | 353 v22 = this->field_30; |
354 v4 = v3; | |
1184 | 355 if ( v3 > 0 ) |
356 { | |
1186 | 357 v5 = v22 + this->field_2C; |
358 v22 = v5; | |
1184 | 359 if ( v5 > v4 ) |
1186 | 360 v22 = v4; |
1184 | 361 } |
1186 | 362 if ( v22 >= 1.0 || this->field_58 ) |
1184 | 363 { |
364 v6 = 0; | |
1186 | 365 v7 = this->field_54; |
366 v20 = this->field_28; | |
367 v21 = this->field_4; | |
1263 | 368 while ( v7->have_spark <= 0 ) |
1184 | 369 { |
1186 | 370 if ( v22 >= 1.0 ) |
1184 | 371 { |
1186 | 372 v12 = v1->field_40; |
373 v13 = v1->field_3C; | |
1263 | 374 v7->have_spark = rand_interval(v13,v12); |
1186 | 375 v7->field_14 = (rand() % 17 - 8) << 16; |
376 v7->field_18 = (rand() % 17 - 8) << 16; | |
1263 | 377 |
1186 | 378 v14 = v1->field_14 - 1; |
379 v15 = v1->field_C; | |
1263 | 380 v16 = rand_interval(v15,v14); |
1186 | 381 v7->field_C = v16; |
1263 | 382 v7->spark_position.x = v16 >> 16; |
1186 | 383 |
384 v17 = v1->field_18 - 1; | |
385 v18 = v1->field_10; | |
1263 | 386 v19 = rand_interval(v17, v18); |
1186 | 387 v7->field_10 = v19; |
1263 | 388 v7->spark_position.y = v19 >> 16; |
389 --v1->position_in_sparks_arr; | |
390 v22 = v22 - 1.0; | |
1184 | 391 goto LABEL_13; |
392 } | |
393 LABEL_14: | |
1186 | 394 ++v7; |
395 --v21; | |
396 if ( !v21 ) | |
1184 | 397 { |
398 v1->field_58 = v6; | |
1186 | 399 v1->field_30 = v22; |
1184 | 400 return 0; |
401 } | |
402 } | |
1186 | 403 v8 = v7->field_14; |
1263 | 404 --v7->have_spark; |
1186 | 405 v9 = v8 + v7->field_C; |
406 | |
407 v10 = v20 + v7->field_18; | |
408 v7->field_C = v9; | |
1263 | 409 v7->spark_position.x = v9 >> 16; |
1186 | 410 |
411 v11 = v10 + v7->field_10; | |
412 v7->field_18 = v10; | |
413 v7->field_10 = v11; | |
1263 | 414 v7->spark_position.y = v11 >> 16; |
1184 | 415 LABEL_13: |
416 v6 = 1; | |
417 goto LABEL_14; | |
418 } | |
419 return 0; | |
420 } | |
421 | |
422 //----- (0040E2A7) -------------------------------------------------------- | |
423 int stru272_stru0::_40E2A7() | |
424 { | |
1185 | 425 |
426 if (signature == SIG_trpg ) | |
1184 | 427 { |
1263 | 428 if ( position_in_sparks_arr <= 0 ) |
1185 | 429 return field_58 != 0 ? 2 : 0; |
1184 | 430 else |
1185 | 431 return 1; |
1184 | 432 } |
433 else | |
1185 | 434 return 3; |
1184 | 435 } |
0 | 436 |
437 | |
438 //----- (0040DFAF) -------------------------------------------------------- | |
439 void ArcomageGame::OnMouseClick(char right_left, bool bDown) | |
440 { | |
441 if ( right_left ) | |
442 pArcomageGame->mouse_right = bDown; | |
443 else | |
444 pArcomageGame->mouse_left = bDown; | |
445 } | |
446 | |
447 //----- (0040DFC1) -------------------------------------------------------- | |
1532 | 448 void ArcomageGame::OnMouseMove(int x, int y) |
0 | 449 { |
1532 | 450 pArcomageGame->mouse_x = x; |
451 pArcomageGame->mouse_y = y; | |
0 | 452 } |
453 | |
454 | |
455 //----- (0040DF47) -------------------------------------------------------- | |
456 void DoBlt_Copy(unsigned __int16 *pPixels) | |
457 { | |
1183 | 458 RECT pSrcRect; |
459 POINT pTargetPoint; // [sp+1Ch] [bp-8h]@1 | |
460 | |
0 | 461 pRenderer->Present(); |
1183 | 462 |
463 pTargetPoint.x = 0; | |
464 pTargetPoint.y = 0; | |
465 | |
1256 | 466 pSrcRect.left = 0; |
467 pSrcRect.top = 0; | |
468 pSrcRect.right = 640; | |
1183 | 469 pSrcRect.bottom = 480; |
470 | |
0 | 471 pRenderer->BeginScene(); |
1183 | 472 pArcomageGame->pBlit_Copy_pixels = pPixels; |
473 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
0 | 474 pRenderer->EndScene(); |
475 pArcomageGame->pBlit_Copy_pixels = 0; | |
476 } | |
477 | |
478 //----- (0040DDC9) -------------------------------------------------------- | |
1183 | 479 void ArcomageGame::PlaySound( unsigned int event_id ) |
480 { | |
481 SoundID play_sound_id; // eax@10 | |
482 | |
483 switch ( event_id ) | |
484 { | |
485 case 40: | |
486 case 43: | |
487 case 46: | |
488 play_sound_id = SOUND_Arcomage_LoseResources; | |
489 break; | |
490 case 39: | |
491 case 41: | |
492 case 42: | |
493 case 44: | |
494 case 45: | |
495 case 47: | |
496 play_sound_id = SOUND_Arcomage_AddResources; | |
497 break; | |
498 case 0: | |
499 case 12: | |
500 case 14: | |
501 case 15: | |
502 case 16: | |
503 case 48: | |
504 case 50: | |
505 case 53: | |
506 play_sound_id = SOUND_Arcomage_TowerWallDamage; | |
507 break; | |
508 case 21: | |
509 case 22: | |
510 case 23: | |
511 play_sound_id = SOUND_Arcomage_DrawCard; | |
512 break; | |
513 case 56: | |
514 play_sound_id = SOUND_Arcomage_124; | |
0 | 515 break; |
1183 | 516 case 31: |
517 case 34: | |
518 case 37: | |
519 play_sound_id = SOUND_Arcomage_ProductionDamage; | |
520 break; | |
521 case 1: | |
522 case 30: | |
523 case 32: | |
524 case 33: | |
525 case 35: | |
526 case 36: | |
527 case 38: | |
528 play_sound_id = SOUND_Arcomage_ProductionUpgrade; | |
529 break; | |
530 case 20: | |
531 play_sound_id = SOUND_Arcomage_127; | |
532 break; | |
533 case 3: | |
534 play_sound_id = SOUND_Arcomage_128; | |
535 break; | |
536 case 52: | |
537 case 54: | |
538 play_sound_id = SOUND_Arcomage_TowerUpgrade; | |
539 break; | |
540 case 10: | |
541 case 11: | |
542 case 13: | |
543 play_sound_id = SOUND_Arcomage_130; | |
544 break; | |
545 case 55u: | |
546 play_sound_id = SOUND_Arcomage_131; | |
547 break; | |
548 case 49: | |
549 case 51: | |
550 play_sound_id = SOUND_Arcomage_WallUpgrade; | |
551 break; | |
552 default: | |
0 | 553 return; |
1183 | 554 } |
555 pAudioPlayer->PlaySound(play_sound_id, 0, 0, -1, 0, 0, 0, 0); | |
0 | 556 } |
557 | |
558 //----- (0040DC2D) -------------------------------------------------------- | |
559 bool ArcomageGame::MsgLoop(int a1, ArcomageGame_stru1 *a2) | |
560 { | |
561 void *v2; // ebp@1 | |
562 BOOL v3; // eax@1 | |
1183 | 563 //int v4; // edx@6 |
564 //int v5; // edx@6 | |
565 //int v6; // eax@6 | |
566 //int v7; // edx@7 | |
0 | 567 |
568 v2 = a2; | |
569 pArcomageGame->field_0 = 0; | |
570 pArcomageGame->stru1.field_0 = 0; | |
571 v3 = PeekMessageA(&pArcomageGame->msg, 0, 0, 0, PM_REMOVE); | |
572 if ( pArcomageGame->msg.message == WM_QUIT ) | |
573 Game_DeinitializeAndTerminate(0); | |
574 if ( v3 > 0 ) | |
575 { | |
576 TranslateMessage(&pArcomageGame->msg); | |
577 DispatchMessageA(&pArcomageGame->msg); | |
578 } | |
1038 | 579 /*if (pAsyncMouse) |
0 | 580 { |
581 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse); | |
582 v4 = *((unsigned int *)pAsyncMouse + 7); | |
583 pArcomageGame->mouse_x = *((unsigned int *)pAsyncMouse + 6); | |
584 pArcomageGame->mouse_y = v4; | |
585 v5 = *((unsigned int *)pAsyncMouse + 27); | |
586 v6 = *(unsigned int *)v5; | |
587 if ( *(unsigned int *)v5 != v5 ) | |
588 { | |
589 do | |
590 { | |
591 v7 = *(unsigned int *)(v6 + 20); | |
592 if ( v7 & 1 ) | |
593 { | |
594 pArcomageGame->stru1.field_0 = 7; | |
595 } | |
596 else | |
597 { | |
598 if ( v7 & 2 ) | |
599 pArcomageGame->stru1.field_0 = 8; | |
600 } | |
601 v6 = *(unsigned int *)v6; | |
602 } | |
603 while ( v6 != *((unsigned int *)pAsyncMouse + 27) ); | |
604 } | |
605 pAsyncMouse->_46B944(); | |
606 if ( !*((unsigned char *)pAsyncMouse + 90) ) | |
607 pArcomageGame->field_F6 = 1; | |
608 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse); | |
1038 | 609 }*/ |
0 | 610 memcpy(v2, &pArcomageGame->stru1, 0xCu); |
611 return pArcomageGame->stru1.field_0 != 0; | |
612 } | |
613 | |
614 | |
615 //----- (0040D7D5) -------------------------------------------------------- | |
616 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3) | |
617 { | |
618 pRenderer->BeginScene(); | |
1183 | 619 pArcomageGame->pBlit_Copy_pixels = pPcxPixels; |
0 | 620 } |
621 | |
622 //----- (0040D7EC) -------------------------------------------------------- | |
1183 | 623 void __fastcall Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode) |
0 | 624 { |
1183 | 625 |
626 unsigned __int16 *pSrc; // eax@2 | |
627 unsigned __int16 *dest_surf_pos; // edi@3 | |
628 int uSrcTotalWidth; // ecx@4 | |
629 unsigned int v10; // esi@9 | |
630 int v21; // [sp+Ch] [bp-18h]@8 | |
631 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9 | |
632 __int32 src_width; // [sp+14h] [bp-10h]@3 | |
633 __int32 src_height; // [sp+18h] [bp-Ch]@3 | |
634 int uSrcPitch; // [sp+1Ch] [bp-8h]@5 | |
635 | |
636 | |
637 if ( !pRenderer->uNumSceneBegins ) | |
638 return; | |
639 if ( !pArcomageGame->pBlit_Copy_pixels ) | |
0 | 640 return; |
1183 | 641 |
642 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch]; | |
643 src_width = pSrcRect->right - pSrcRect->left; | |
644 src_height = pSrcRect->bottom - pSrcRect->top; | |
645 | |
646 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels ) | |
647 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth; | |
648 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels ) | |
649 uSrcTotalWidth = pArcomageGame->pSprites.uWidth; | |
650 | |
651 //v20 = 157; | |
652 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp"; | |
653 //v21 = &v18; | |
654 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a); | |
655 //466D09_xcpt_string(&v21, v18, v19, v20); | |
656 //pSrc = pArcomageGame.pBlit_Copy_pixels; | |
657 //LABEL_9: | |
658 pSrc = pArcomageGame->pBlit_Copy_pixels; | |
659 uSrcPitch = uSrcTotalWidth; | |
660 | |
661 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top]; | |
662 v10 = 0xFFu >> (8 - (unsigned __int8)pRenderer->uTargetBBits); | |
663 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF); | |
664 | |
665 | |
666 if ( blend_mode == 2 ) | |
0 | 667 { |
1194 | 668 uSrcPitch = (uSrcPitch - src_width); |
1183 | 669 for (int i=0; i< src_height; ++i) |
670 { | |
671 for (int j=0; j< src_width; ++j) | |
672 { | |
673 if ( *src_surf_pos != v10 ) | |
674 *dest_surf_pos = *src_surf_pos; | |
675 ++dest_surf_pos; | |
676 ++src_surf_pos; | |
677 } | |
678 src_surf_pos+=uSrcPitch; | |
679 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
680 } | |
0 | 681 } |
1183 | 682 else |
0 | 683 { |
1194 | 684 uSrcPitch = (uSrcPitch - src_width); |
1183 | 685 for (int i=0; i< src_height; ++i) |
0 | 686 { |
1183 | 687 for (int j=0; j< src_width; ++j) |
0 | 688 { |
1183 | 689 if ( *src_surf_pos != v10 ) |
690 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1)); | |
691 ++dest_surf_pos; | |
692 ++src_surf_pos; | |
0 | 693 } |
1183 | 694 src_surf_pos+=uSrcPitch; |
695 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
0 | 696 } |
697 } | |
1183 | 698 |
0 | 699 } |
700 | |
701 //----- (0040D9B1) -------------------------------------------------------- | |
1183 | 702 void Blt_Copy( RECT *pSrcRect, POINT *pTargetPoint, int blend_mode ) |
0 | 703 { |
1183 | 704 |
705 unsigned __int16 *pSrc; // eax@2 | |
706 unsigned __int16 *dest_surf_pos; // edi@3 | |
707 int uSrcTotalWidth; // ecx@4 | |
708 int v21; // [sp+Ch] [bp-18h]@8 | |
709 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9 | |
710 __int32 src_width; // [sp+14h] [bp-10h]@3 | |
711 __int32 src_height; // [sp+18h] [bp-Ch]@3 | |
712 int uSrcPitch; // [sp+1Ch] [bp-8h]@5 | |
713 | |
714 if ( !pRenderer->uNumSceneBegins ) | |
715 return; | |
716 if ( !pArcomageGame->pBlit_Copy_pixels ) | |
717 return; | |
718 | |
719 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch]; | |
720 src_width = pSrcRect->right - pSrcRect->left; | |
721 src_height = pSrcRect->bottom - pSrcRect->top; | |
722 | |
723 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels ) | |
724 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth; | |
725 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels ) | |
726 uSrcTotalWidth = pArcomageGame->pSprites.uWidth; | |
727 | |
728 //v20 = 157; | |
729 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp"; | |
730 //v21 = &v18; | |
731 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a); | |
732 //466D09_xcpt_string(&v21, v18, v19, v20); | |
733 //pSrc = pArcomageGame.pBlit_Copy_pixels; | |
734 //LABEL_9: | |
735 pSrc = pArcomageGame->pBlit_Copy_pixels; | |
736 uSrcPitch = uSrcTotalWidth; | |
737 | |
738 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top]; | |
739 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF); | |
740 | |
741 if ( blend_mode == 2 ) | |
0 | 742 { |
1194 | 743 uSrcPitch = (uSrcPitch - src_width); |
1183 | 744 for (int i=0; i< src_height; ++i) |
745 { | |
746 for (int j=0; j< src_width; ++j) | |
747 { | |
748 *dest_surf_pos = *src_surf_pos; | |
749 ++dest_surf_pos; | |
750 ++src_surf_pos; | |
751 } | |
752 src_surf_pos+=uSrcPitch; | |
753 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
754 } | |
0 | 755 } |
1183 | 756 else |
0 | 757 { |
1194 | 758 uSrcPitch = (uSrcPitch - src_width); |
1183 | 759 for (int i=0; i< src_height; ++i) |
0 | 760 { |
1183 | 761 for (int j=0; j< src_width; ++j) |
762 { | |
763 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1)); | |
764 ++dest_surf_pos; | |
765 ++src_surf_pos; | |
766 } | |
767 src_surf_pos+=uSrcPitch; | |
768 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
0 | 769 } |
770 } | |
771 } | |
772 | |
773 //----- (0040DB10) -------------------------------------------------------- | |
1183 | 774 void am_EndScene() |
0 | 775 { |
776 pRenderer->EndScene(); | |
1183 | 777 pArcomageGame->pBlit_Copy_pixels = NULL; |
0 | 778 } |
779 | |
780 //----- (0040D7B7) -------------------------------------------------------- | |
781 bool ArcomageGame::LoadSprites() | |
782 { | |
783 pArcomageGame->pSprites.Load("sprites.pcx", 2); | |
784 pArcomageGame->pSpritesPixels = pArcomageGame->pSprites.pPixels; | |
1183 | 785 return true; |
0 | 786 } |
787 | |
788 //----- (0040D799) -------------------------------------------------------- | |
789 bool ArcomageGame::LoadBackground() | |
790 { | |
791 pArcomageGame->pGameBackground.Load("layout.pcx", 2); | |
792 pArcomageGame->pBackgroundPixels = pArcomageGame->pGameBackground.pPixels; | |
1183 | 793 return true; |
0 | 794 } |
795 | |
1256 | 796 int CalculateCardPower(ArcomagePlayer* player, ArcomagePlayer* enemy, ArcomageCard* pCard, int mastery) |
797 { | |
798 enum V_INDX{ | |
799 P_TOWER_M10, | |
800 P_WALL_M10, | |
801 E_TOWER, | |
802 E_WALL, | |
803 E_BUILDINGS, | |
804 E_QUARRY, | |
805 E_MAGIC, | |
806 E_ZOO, | |
807 E_RES, | |
808 V_INDEX_MAX | |
809 }; | |
810 | |
811 const int mastery_coeff[V_INDEX_MAX][2]= {{10, 5}, //P_TOWER_M10 | |
812 {2, 1}, //P_WALL_M10 | |
813 {1, 10}, //E_TOWER | |
814 {1, 3}, //E_WALL | |
815 {1, 7}, //E_BUILDINGS | |
816 {1, 5}, //E_QUARRY | |
817 {1, 40}, //E_MAGIC | |
818 {1, 40}, //E_ZOO | |
819 {1, 2} //E_RES | |
820 }; | |
821 int card_power= 0; | |
822 int element_power; | |
823 | |
824 | |
825 if ( pCard->to_player_tower == 99 || pCard->to_pl_enm_tower == 99|| | |
826 pCard->to_player_tower2 == 99 || pCard->to_pl_enm_tower2 == 99 ) | |
827 element_power = enemy->tower_height - player->tower_height; | |
828 else | |
829 element_power = pCard->to_player_tower + pCard->to_pl_enm_tower + pCard->to_player_tower2 + pCard->to_pl_enm_tower2; | |
830 | |
831 if ( player->tower_height >= 10 ) | |
832 card_power += mastery_coeff[P_TOWER_M10][mastery]*element_power; | |
833 else | |
834 card_power += 20*element_power; | |
835 | |
836 | |
837 if ( pCard->to_player_wall == 99 || pCard->to_pl_enm_wall == 99 || | |
838 pCard->to_player_wall2 == 99 || pCard->to_pl_enm_wall2 == 99 ) | |
839 element_power = enemy->wall_height - player->wall_height; | |
840 else | |
841 element_power = pCard->to_player_wall + pCard->to_pl_enm_wall + | |
842 pCard->to_player_wall2 + pCard->to_pl_enm_wall2; | |
843 if ( player->wall_height >= 10 ) | |
844 card_power += mastery_coeff[P_WALL_M10][mastery]*element_power; //1 | |
845 else | |
846 card_power += 5*element_power; | |
847 | |
848 | |
849 card_power += 7 * (pCard->to_player_buildings + pCard->to_pl_enm_buildings + | |
850 pCard->to_player_buildings2 + pCard->to_pl_enm_buildings2); | |
851 | |
852 if ( pCard->to_player_quarry_lvl == 99 || pCard->to_pl_enm_quarry_lvl == 99 || | |
853 pCard->to_player_quarry_lvl2 == 99 || pCard->to_pl_enm_quarry_lvl2 == 99 ) | |
854 element_power = enemy->quarry_level - player->quarry_level; | |
855 else | |
856 element_power = pCard->to_player_quarry_lvl + pCard->to_pl_enm_quarry_lvl + | |
857 pCard->to_player_quarry_lvl2 + pCard->to_pl_enm_quarry_lvl; | |
858 | |
859 card_power += 40 * element_power; | |
860 | |
861 if ( pCard->to_player_magic_lvl == 99 || pCard->to_pl_enm_magic_lvl == 99 || | |
862 pCard->to_player_magic_lvl2 == 99 || pCard->to_pl_enm_magic_lvl2 == 99 ) | |
863 element_power = enemy->magic_level - player->magic_level; | |
864 else | |
865 element_power = pCard->to_player_magic_lvl + pCard->to_pl_enm_magic_lvl + | |
866 pCard->to_player_magic_lvl2 + pCard->to_pl_enm_magic_lvl2; | |
867 card_power += 40 *element_power; | |
868 | |
869 if ( pCard->to_player_zoo_lvl == 99 || pCard->to_pl_enm_zoo_lvl == 99 || | |
870 pCard->to_player_zoo_lvl2 == 99 || pCard->to_pl_enm_zoo_lvl2 == 99 ) | |
871 element_power = enemy->zoo_level - player->zoo_level; | |
872 else | |
873 element_power = pCard->to_player_zoo_lvl + pCard->to_pl_enm_zoo_lvl + | |
874 pCard->to_player_zoo_lvl2 + pCard->to_pl_enm_zoo_lvl2; | |
875 card_power += 40 *element_power; | |
876 | |
877 if ( pCard->to_player_bricks == 99 || pCard->to_pl_enm_bricks == 99 || | |
878 pCard->to_player_bricks2 == 99 || pCard->to_pl_enm_bricks2 == 99 ) | |
879 element_power = enemy->resource_bricks - player->resource_bricks; | |
880 else | |
881 element_power = pCard->to_player_bricks + pCard->to_pl_enm_bricks + | |
882 pCard->to_player_bricks2 + pCard->to_pl_enm_bricks2; | |
883 card_power += 2 *element_power; | |
884 | |
885 | |
886 if ( pCard->to_player_gems == 99 || pCard->to_pl_enm_gems == 99 || | |
887 pCard->to_player_gems2 == 99 || pCard->to_pl_enm_gems2 == 99 ) | |
888 element_power = enemy->resource_gems - player->resource_gems; | |
889 else | |
890 element_power = pCard->to_player_gems + pCard->to_pl_enm_gems + | |
891 pCard->to_player_gems2 + pCard->to_pl_enm_gems2; | |
892 card_power += 2 *element_power; | |
893 | |
894 if ( pCard->to_player_beasts == 99 || pCard->to_pl_enm_beasts == 99 || | |
895 pCard->to_player_beasts2 == 99 || pCard->to_pl_enm_beasts2 == 99 ) | |
896 element_power = enemy->resource_beasts - player->resource_beasts; | |
897 else | |
898 element_power = pCard->to_player_beasts + pCard->to_pl_enm_beasts + | |
899 pCard->to_player_beasts2 + pCard->to_pl_enm_beasts2; | |
900 card_power += 2 *element_power; | |
901 | |
902 if ( pCard->to_enemy_tower == 99 || pCard->to_enemy_tower2 == 99 ) | |
903 element_power = player->tower_height - enemy->tower_height; | |
904 else | |
905 element_power = -(pCard->to_enemy_tower + pCard->to_enemy_tower2); | |
906 card_power += mastery_coeff[E_TOWER][mastery]*element_power; | |
907 | |
908 if ( pCard->to_enemy_wall == 99 || pCard->to_enemy_wall2 == 99 ) | |
909 element_power = player->wall_height - enemy->wall_height; | |
910 else | |
911 element_power = -(pCard->to_enemy_wall + pCard->to_enemy_wall2); | |
912 card_power += mastery_coeff[E_WALL][mastery]*element_power; | |
913 | |
914 card_power -= mastery_coeff[E_BUILDINGS][mastery]*(pCard->to_enemy_buildings + pCard->to_enemy_buildings2); | |
915 | |
916 if ( pCard->to_enemy_quarry_lvl == 99 || pCard->to_enemy_quarry_lvl2 == 99 ) | |
917 element_power = player->quarry_level - enemy->quarry_level; //5 | |
918 else | |
919 element_power = -(pCard->to_enemy_quarry_lvl + pCard->to_enemy_quarry_lvl2); //5 | |
920 card_power += mastery_coeff[E_QUARRY][mastery]*element_power; | |
921 | |
922 if ( pCard->to_enemy_magic_lvl == 99 || pCard->to_enemy_magic_lvl2 == 99 ) | |
923 element_power = player->magic_level - enemy->magic_level; //40 | |
924 else | |
925 element_power = -(pCard->to_enemy_magic_lvl + pCard->to_enemy_magic_lvl2); | |
926 card_power += mastery_coeff[E_MAGIC][mastery]*element_power; | |
927 | |
928 if ( pCard->to_enemy_zoo_lvl == 99 || pCard->to_enemy_zoo_lvl2 == 99 ) | |
929 element_power = player->zoo_level - enemy->zoo_level; //40 | |
930 else | |
931 element_power = -(pCard->to_enemy_zoo_lvl + pCard->to_enemy_zoo_lvl2); | |
932 card_power += mastery_coeff[E_ZOO][mastery]*element_power; | |
933 | |
934 if ( pCard->to_enemy_bricks == 99 || pCard->to_enemy_bricks2 == 99 ) | |
935 element_power = player->resource_bricks - enemy->resource_bricks; //2 | |
936 else | |
937 element_power = -(pCard->to_enemy_bricks + pCard->to_enemy_bricks2); | |
938 card_power += mastery_coeff[E_RES][mastery]*element_power; | |
939 | |
940 if ( pCard->to_enemy_gems == 99 || pCard->to_enemy_gems2 == 99 ) | |
941 element_power = player->resource_gems - enemy->resource_gems; //2 | |
942 else | |
943 element_power = -(pCard->to_enemy_gems + pCard->to_enemy_gems2); | |
944 card_power += mastery_coeff[E_RES][mastery]*element_power; | |
945 | |
946 if ( pCard->to_enemy_beasts == 99 || pCard->to_enemy_beasts2 == 99 ) | |
947 element_power = player->resource_beasts - enemy->resource_beasts; //2 | |
948 else | |
949 element_power = -(pCard->to_enemy_beasts + pCard->to_enemy_beasts2); | |
950 card_power += mastery_coeff[E_RES][mastery]*element_power; | |
951 | |
952 if ( pCard->field_30 || pCard->field_4D ) | |
953 card_power *= 10; | |
954 | |
955 if ( pCard->field_24 == 1 ) | |
956 element_power = player->resource_bricks - pCard->needed_bricks; | |
957 else if ( pCard->field_24 == 2 ) | |
958 element_power = player->resource_gems - pCard->needed_gems; | |
959 else if (pCard->field_24 == 3) | |
960 element_power = player->resource_beasts - pCard->needed_beasts; | |
961 if ( element_power > 3 ) | |
962 element_power = 3; | |
963 card_power += 5 * element_power; | |
964 | |
965 if ( enemy->tower_height <= pCard->to_enemy_tower2 + pCard->to_enemy_tower ) | |
966 card_power += 9999; | |
967 | |
968 if (pCard->to_enemy_tower2 + pCard->to_enemy_tower + | |
969 pCard->to_enemy_wall + pCard->to_enemy_wall2 + | |
970 pCard->to_enemy_buildings + pCard->to_enemy_buildings2 >= enemy->wall_height + enemy->tower_height) | |
971 card_power += 9999; | |
972 | |
973 if ( (pCard->to_player_tower2 + pCard->to_pl_enm_tower2 + | |
974 pCard->to_player_tower + pCard->to_pl_enm_tower + player->tower_height) >= max_tower_height ) | |
975 card_power += 9999; | |
976 | |
977 return card_power; | |
978 } | |
979 | |
980 | |
0 | 981 //----- (00408BB4) -------------------------------------------------------- |
1256 | 982 bool OpponentsAITurn(int player_num) |
0 | 983 { |
1256 | 984 char result; // al@3 |
985 signed int v2; // ebx@8 | |
986 int v3; // esi@8 | |
987 int all_player_cards_count; // eax@9 | |
988 int random_card_slot; // edi@9 | |
989 int v6; // eax@11 | |
990 signed int v7; // eax@11 | |
991 int v8; // ebx@5 | |
992 int v9; // eax@5 | |
993 int v10; // ecx@18 | |
994 int v11; // eax@20 | |
995 ArcomageCard *v12; // ecx@20 | |
996 char v13; // dl@20 | |
997 char v14; // dl@24 | |
998 int v15; // edx@25 | |
999 int v16; // edx@27 | |
1000 char v17; // dl@31 | |
1001 int v18; // edx@32 | |
1002 char v19; // dl@35 | |
1003 char v20; // dl@39 | |
1004 int v21; // edx@40 | |
1005 char v22; // dl@45 | |
1006 int v23; // edx@46 | |
1007 char v24; // dl@52 | |
1008 int v25; // edx@53 | |
1009 char v26; // dl@58 | |
1010 int v27; // edx@59 | |
1011 char v28; // dl@64 | |
1012 int v29; // edx@65 | |
1013 char v30; // dl@70 | |
1014 int v31; // edx@71 | |
1015 char v32; // dl@76 | |
1016 int v33; // edx@77 | |
1017 char v34; // dl@82 | |
1018 int v35; // edx@83 | |
1019 char v36; // dl@86 | |
1020 char v37; // dl@90 | |
1021 int v38; // edi@93 | |
1022 char v39; // dl@93 | |
1023 int v40; // esi@93 | |
1024 char v41; // bl@94 | |
1025 char v42; // dl@98 | |
1026 char v43; // dl@102 | |
1027 char v44; // dl@106 | |
1028 char v45; // dl@110 | |
1029 char v46; // dl@114 | |
1030 ArcomagePlayer *v47; // ebx@115 | |
1031 ArcomagePlayer *v48; // edx@115 | |
1032 int v49; // esi@123 | |
1033 int v50; // edx@123 | |
1034 int v51; // edx@126 | |
1035 int v52; // esi@129 | |
1036 int v53; // edi@137 | |
1037 int j; // esi@137 | |
1038 am_2 *v55; // eax@139 | |
1039 int v56; // ecx@141 | |
1040 int v57; // edx@141 | |
1041 int v58; // ebx@141 | |
1042 int v59; // eax@144 | |
1043 int v60; // esi@145 | |
1044 int v61; // ebx@4 | |
1045 int v62; // eax@4 | |
1046 int v63; // ecx@167 | |
1047 int v64; // eax@169 | |
1048 ArcomageCard *pCard; // ecx@169 | |
1049 char v66; // dl@169 | |
1050 char v67; // dl@173 | |
1051 int v68; // edx@174 | |
1052 int v69; // edx@176 | |
1053 char v70; // dl@180 | |
1054 char v71; // dl@183 | |
1055 char v72; // dl@187 | |
1056 int v73; // edx@188 | |
1057 char v74; // dl@193 | |
1058 char v75; // dl@199 | |
1059 int v76; // edx@200 | |
1060 char v77; // dl@205 | |
1061 int v78; // edx@206 | |
1062 char v79; // dl@211 | |
1063 int v80; // edx@212 | |
1064 char v81; // dl@217 | |
1065 int v82; // edx@218 | |
1066 char v83; // dl@223 | |
1067 int v84; // edx@224 | |
1068 char v85; // dl@229 | |
1069 int v86; // edx@230 | |
1070 char v87; // dl@233 | |
1071 int v88; // edx@234 | |
1072 char v89; // dl@237 | |
1073 int v90; // edx@238 | |
1074 int v91; // esi@240 | |
1075 char v92; // dl@240 | |
1076 int v93; // esi@240 | |
1077 char v94; // bl@241 | |
1078 int v95; // edx@243 | |
1079 int v96; // edi@244 | |
1080 char v97; // dl@245 | |
1081 int v98; // edx@246 | |
1082 char v99; // dl@249 | |
1083 int v100; // edx@250 | |
1084 char v101; // dl@253 | |
1085 int v102; // edx@254 | |
1086 char v103; // dl@257 | |
1087 int v104; // edx@258 | |
1088 char v105; // dl@261 | |
1089 ArcomagePlayer *v106; // ebx@262 | |
1090 ArcomagePlayer *v107; // edx@262 | |
1091 int v108; // esi@270 | |
1092 int v109; // edx@270 | |
1093 int v110; // edx@273 | |
1094 int v111; // esi@276 | |
1095 int v112; // edi@284 | |
1096 // int j; // esi@284 | |
1097 am_2 *v114; // eax@286 | |
1098 int v115; // ecx@288 | |
1099 int v116; // edx@288 | |
1100 int v117; // ebx@288 | |
1101 int v118; // eax@291 | |
1102 int v119; // esi@292 | |
1103 int v120; // [sp-28h] [bp-28h]@129 | |
1104 int v121; // [sp-28h] [bp-28h]@276 | |
1105 int k; // [sp-24h] [bp-24h]@18 | |
1106 int i; // [sp-24h] [bp-24h]@167 | |
1107 int v124; // [sp-20h] [bp-20h]@5 | |
1108 int v125; // [sp-20h] [bp-20h]@4 | |
1109 int v126; // [sp-1Ch] [bp-1Ch]@17 | |
1110 int v127; // [sp-1Ch] [bp-1Ch]@139 | |
1111 int v128; // [sp-1Ch] [bp-1Ch]@166 | |
1112 int v129; // [sp-1Ch] [bp-1Ch]@286 | |
1113 int v130; // [sp-18h] [bp-18h]@5 | |
1114 int cards_count; // [sp-18h] [bp-18h]@4 | |
1115 int v132; // [sp-14h] [bp-14h]@0 | |
1116 int v133; // [sp-14h] [bp-14h]@93 | |
1117 int v134; // [sp-14h] [bp-14h]@129 | |
1118 int v135; // [sp-14h] [bp-14h]@240 | |
1119 int v136; // [sp-14h] [bp-14h]@276 | |
1120 ArcomagePlayer *enemy; // [sp-10h] [bp-10h]@5 | |
1121 ArcomagePlayer *enemy1; // [sp-10h] [bp-10h]@4 | |
1122 ArcomagePlayer *player; // [sp-Ch] [bp-Ch]@5 | |
1123 ArcomagePlayer *player1; // [sp-Ch] [bp-Ch]@4 | |
1124 char v141; // [sp-8h] [bp-8h]@35 | |
1125 char v142; // [sp-8h] [bp-8h]@183 | |
1126 char v143; // [sp-5h] [bp-5h]@20 | |
1127 char v144; // [sp-5h] [bp-5h]@169 | |
1128 | |
1129 byte_4FAA00 = 1; | |
1130 if ( opponent_mastery == 0) | |
1131 { | |
1263 | 1132 if ( need_to_discard_card==0 ) //am_byte_4FAA77 |
1256 | 1133 { |
1134 for(int i = 0; i<10 ; ++i ) | |
1135 { | |
1136 all_player_cards_count = GetPlayerHandCardCount(player_num); | |
1137 random_card_slot = rand_interval(0, all_player_cards_count - 1); | |
1138 if ( CanCardBePlayed(player_num, random_card_slot) ) | |
1139 return PlayCard(player_num, random_card_slot); | |
1140 } | |
1141 } | |
1142 all_player_cards_count = GetPlayerHandCardCount(player_num); | |
1143 random_card_slot= rand_interval(0, all_player_cards_count - 1); | |
1144 return DiscardCard(player_num, random_card_slot); | |
1145 } | |
1146 else if (( opponent_mastery == 1 )|| ( opponent_mastery == 2 )) | |
1147 { | |
1148 player = &am_Players[player_num]; | |
1149 enemy = &am_Players[(player_num + 1) % 2]; | |
1150 all_player_cards_count = GetPlayerHandCardCount(player_num); | |
1151 for(int i = 0; i<10 ; ++i ) | |
1152 { | |
1153 if ( i >= all_player_cards_count ) | |
1154 { | |
1263 | 1155 cards_power[i].slot_index = -1; |
1156 cards_power[i].card_power = -9999; | |
1256 | 1157 } |
1158 else | |
1159 { | |
1263 | 1160 cards_power[i].slot_index = i; |
1161 cards_power[i].card_power = 0; | |
1256 | 1162 } |
1163 } | |
1164 for(int i = 0; i< all_player_cards_count ; ++i ) | |
1165 { | |
1263 | 1166 v12 = &pCards[am_Players[player_num].cards_at_hand[cards_power[i].slot_index]]; |
1167 cards_power[i].card_power = CalculateCardPower(player, enemy, v12, opponent_mastery-1); | |
1256 | 1168 } |
1169 | |
1170 for (int j = all_player_cards_count - 1; j >= 0; --j ) | |
1171 { | |
1172 for (int m=0; m<j; ++m ) | |
1173 { | |
1263 | 1174 if ( cards_power[m].card_power < cards_power[m+1].card_power ) |
1256 | 1175 { |
1263 | 1176 v56 = cards_power[m].slot_index; |
1177 v57 = cards_power[m].card_power; | |
1178 cards_power[m].slot_index = cards_power[m+1].slot_index; | |
1179 cards_power[m].card_power = cards_power[m+1].card_power; | |
1180 cards_power[m+1].slot_index = v56; | |
1181 cards_power[m+1].card_power = v57; | |
1256 | 1182 } |
1183 } | |
1184 } | |
1185 v59 = all_player_cards_count - 1; | |
1263 | 1186 if ( need_to_discard_card ) |
1256 | 1187 { |
1188 if ( all_player_cards_count - 1 >= 0 ) | |
1189 { | |
1263 | 1190 while ( !pCards[am_Players[player_num].cards_at_hand[cards_power[v59].slot_index]].can_be_discarded ) |
1256 | 1191 { |
1192 --v59; | |
1193 if ( v59 < 0 ) | |
1194 return DiscardCard(player_num, v132); | |
1195 } | |
1263 | 1196 v132 = cards_power[v59].slot_index; |
1256 | 1197 } |
1198 } | |
1199 else | |
1200 { | |
1201 v60 = 0; | |
1202 if ( all_player_cards_count - 1 >= 0 ) | |
1203 { | |
1263 | 1204 while ( !pCards[am_Players[player_num].cards_at_hand[cards_power[v59].slot_index]].can_be_discarded ) |
1256 | 1205 { |
1206 --v59; | |
1207 if ( v59 < 0 ) | |
1208 goto LABEL_150; | |
1209 } | |
1263 | 1210 v132 = cards_power[v59].slot_index; |
1256 | 1211 } |
1212 LABEL_150: | |
1263 | 1213 if ( (all_player_cards_count - 1)> 0 ) |
1256 | 1214 { |
1263 | 1215 while ( !CanCardBePlayed(player_num, cards_power[v60].slot_index) || cards_power[v60].card_power < 0 ) |
1256 | 1216 { |
1217 ++v60; | |
1263 | 1218 if ( v60 >= all_player_cards_count - 1 ) |
1256 | 1219 return DiscardCard(player_num, v132); |
1220 } | |
1263 | 1221 return PlayCard(player_num, cards_power[v60].slot_index); |
1256 | 1222 } |
1223 } | |
1224 return DiscardCard(player_num, v132); | |
1225 } | |
1226 | |
1227 | |
1183 | 1228 return true;//result != 0; |
0 | 1229 } |
1230 | |
1231 | |
1232 | |
1233 //----- (00409E6A) -------------------------------------------------------- | |
1234 void ArcomageGame::Loop() | |
1235 { | |
1236 int v0; // edx@2 | |
1237 int v1; // ecx@14 | |
1238 signed int v2; // eax@15 | |
1239 stru272 *v3; // esi@17 | |
1240 __int16 *v4; // esi@23 | |
1241 | |
1197 | 1242 while ( !pArcomageGame->GameOver ) |
0 | 1243 { |
1244 pArcomageGame->field_F6 = 1; | |
1245 byte_4FAA24 = 1; | |
1197 | 1246 IncreaseResourcesInTurn(current_player_num); |
0 | 1247 LABEL_8: |
1185 | 1248 while ( byte_4FAA24 ) |
0 | 1249 { |
1200 | 1250 played_card_id = -1; |
1251 GetNextCardFromDeck(current_player_num); | |
0 | 1252 while ( 1 ) |
1253 { | |
1256 | 1254 byte_4FAA24 = PlayerTurn(current_player_num); |
1200 | 1255 if ( GetPlayerHandCardCount(current_player_num) <= minimum_cards_at_hand ) |
0 | 1256 break; |
1263 | 1257 need_to_discard_card = 1; |
0 | 1258 if ( pArcomageGame->field_F4 ) |
1259 goto LABEL_8; | |
1260 } | |
1263 | 1261 need_to_discard_card = 0; |
1185 | 1262 } |
1197 | 1263 pArcomageGame->GameOver = IsGameOver(); |
1264 if ( !pArcomageGame->GameOver ) | |
1256 | 1265 TurnChange(); |
0 | 1266 if ( pArcomageGame->field_F4 ) |
1197 | 1267 pArcomageGame->GameOver = 1; |
0 | 1268 } |
1197 | 1269 GameResultsApply(); |
1679 | 1270 if ( am_gameover ) |
0 | 1271 { |
1183 | 1272 dword_4FAA70 = 0; |
0 | 1273 } |
1274 else | |
1275 { | |
1276 dword_4FAA70 = -1; | |
1277 } | |
1183 | 1278 |
1184 | 1279 for(int i=0; i<10; ++i) |
1679 | 1280 { |
1281 array_4FABD0[i].field_40->Clear(1, 1); | |
1282 array_4FABD0[i].field_40->Free(); | |
1283 } | |
1038 | 1284 |
0 | 1285 pArcomageGame->pGameBackground.Release(); |
1286 pArcomageGame->pSprites.Release(); | |
1679 | 1287 pArcomageGame->bGameInProgress = false; |
1288 viewparams->bRedrawGameUI = true; | |
0 | 1289 if ( pVideoPlayer->AnyMovieLoaded() ) |
1290 pVideoPlayer->_4BF5B2(); | |
1183 | 1291 for(int i=0; i<12; ++i) |
1292 pSoundList->UnloadSound(am_sounds[i], 1); | |
0 | 1293 } |
938 | 1294 |
1295 | |
1296 | |
0 | 1297 |
1298 //----- (00409FE9) -------------------------------------------------------- | |
1197 | 1299 void SetStartGameData() |
1679 | 1300 { |
1194 | 1301 signed int j; // edx@7 |
1302 int card_id_counter; // edx@13 | |
1303 signed int i; // ecx@13 | |
1304 signed int card_dispenser_counter; // eax@13 | |
0 | 1305 |
1197 | 1306 current_player_num = dword_505890; |
1307 SetStartConditions(); | |
1194 | 1308 for(i=0; i<2; ++i ) |
0 | 1309 { |
1194 | 1310 if ( i ) |
0 | 1311 { |
1194 | 1312 strcpy(am_Players[1].pPlayerName, pArcomageGame->pPlayer2Name); |
0 | 1313 if ( byte_4E185C ) |
1197 | 1314 am_Players[1].IsHisTurn = 0; |
0 | 1315 else |
1197 | 1316 am_Players[1].IsHisTurn = 1; |
0 | 1317 } |
1318 else | |
1319 { | |
1194 | 1320 strcpy(am_Players[0].pPlayerName, pArcomageGame->pPlayer1Name); |
1197 | 1321 am_Players[0].IsHisTurn = 1; |
0 | 1322 } |
1200 | 1323 am_Players[i].tower_height = start_tower_height; |
1324 am_Players[i].wall_height = start_wall_height; | |
1325 am_Players[i].quarry_level = start_quarry_level; | |
1326 am_Players[i].magic_level = start_magic_level; | |
1327 am_Players[i].zoo_level = start_zoo_level; | |
1197 | 1328 am_Players[i].resource_bricks = start_bricks_amount; |
1329 am_Players[i].resource_gems = start_gems_amount; | |
1330 am_Players[i].resource_beasts = start_beasts_amount; | |
1194 | 1331 |
1332 for (j=0; j<10; ++j ) | |
0 | 1333 { |
1194 | 1334 am_Players[i].cards_at_hand[j] = -1; |
0 | 1335 if ( am_byte_4E185D ) |
1336 { | |
1256 | 1337 am_Players[i].card_shift[j].x = -1; |
1338 am_Players[i].card_shift[j].y = -1; | |
0 | 1339 } |
1340 else | |
1341 { | |
1256 | 1342 am_Players[i].card_shift[j].x = 0; |
1343 am_Players[i].card_shift[j].y = 0; | |
0 | 1344 } |
1263 | 1345 } |
0 | 1346 } |
1679 | 1347 strcpy(deckMaster.name, "Master Deck"); |
1194 | 1348 for (i=0, card_dispenser_counter=-2, card_id_counter=0; i<DECK_SIZE; ++i, ++card_dispenser_counter) |
1185 | 1349 { |
1194 | 1350 deckMaster.cardsInUse[i] = 0; |
1351 deckMaster.cards_IDs[i] =card_id_counter; | |
1352 switch ( card_dispenser_counter ) | |
1185 | 1353 { |
0 | 1354 case 0: |
1355 case 2: | |
1356 case 6: | |
1357 case 9: | |
1358 case 13: | |
1359 case 18: | |
1360 case 23: | |
1361 case 33: | |
1362 case 36: | |
1363 case 38: | |
1364 case 44: | |
1365 case 46: | |
1366 case 52: | |
1367 case 57: | |
1368 case 69: | |
1369 case 71: | |
1370 case 75: | |
1371 case 79: | |
1372 case 81: | |
1373 case 84: | |
1374 case 89: | |
1185 | 1375 break; |
1376 default: | |
1194 | 1377 ++card_id_counter; |
1185 | 1378 } |
1379 } | |
1380 | |
1197 | 1381 FillPlayerDeck(); |
0 | 1382 } |
1383 | |
1384 //----- (0040A198) -------------------------------------------------------- | |
1197 | 1385 void FillPlayerDeck() |
1194 | 1386 { |
1263 | 1387 signed int m; |
1388 int rand_deck_pos; | |
1389 char card_taken_flags[DECK_SIZE]; | |
1194 | 1390 int i,j; |
0 | 1391 |
1218 | 1392 ArcomageGame::PlaySound(20); |
1194 | 1393 memset(deckMaster.cardsInUse, 0,DECK_SIZE ); |
1394 memset(card_taken_flags, 0, DECK_SIZE); | |
1395 | |
1396 for (i=0; i<2; ++i) | |
0 | 1397 { |
1194 | 1398 for (j=0; j<10; ++j) |
0 | 1399 { |
1194 | 1400 if ( am_Players[i].cards_at_hand[j] > -1 ) |
0 | 1401 { |
1263 | 1402 for (m = 0; m<DECK_SIZE; ++m) |
1194 | 1403 { |
1263 | 1404 if (deckMaster.cards_IDs[m] == am_Players[i].cards_at_hand[j] && deckMaster.cardsInUse[m] == 0) |
1194 | 1405 { |
1263 | 1406 deckMaster.cardsInUse[m] = 1; |
1194 | 1407 break; |
1408 } | |
1409 } | |
0 | 1410 } |
1411 } | |
1412 } | |
1194 | 1413 |
1414 for (i=0; i<DECK_SIZE; ++i) | |
0 | 1415 { |
1416 do | |
1263 | 1417 rand_deck_pos = rand() % DECK_SIZE; |
1418 while (card_taken_flags[rand_deck_pos] == 1 ); | |
1419 | |
1420 card_taken_flags[rand_deck_pos]=1; | |
1421 playDeck.cards_IDs[i] = deckMaster.cards_IDs[rand_deck_pos]; | |
1422 playDeck.cardsInUse[i] = deckMaster.cardsInUse[rand_deck_pos]; | |
0 | 1423 } |
1194 | 1424 |
1200 | 1425 deck_walk_index = 0; |
0 | 1426 amuint_4FABC4 = -1; |
1427 pArcomageGame->field_F6 = 1; | |
1194 | 1428 |
0 | 1429 } |
1430 | |
1431 //----- (0040A255) -------------------------------------------------------- | |
1200 | 1432 void InitalHandsFill() |
1183 | 1433 { |
1200 | 1434 for (int i = 0; i < minimum_cards_at_hand; ++i ) |
0 | 1435 { |
1200 | 1436 GetNextCardFromDeck(0); |
1437 GetNextCardFromDeck(1); | |
0 | 1438 } |
1439 pArcomageGame->field_F6 = 1; | |
1183 | 1440 |
0 | 1441 } |
1442 // 4E1874: using guessed type int dword_4E1874; | |
1443 | |
1444 //----- (0040A283) -------------------------------------------------------- | |
1200 | 1445 void GetNextCardFromDeck( int player_num ) |
1183 | 1446 { |
1200 | 1447 signed int deck_index; // eax@1 |
1448 int new_card_id; // edi@1 | |
1449 signed int card_slot_indx; // eax@7 | |
1450 | |
1451 deck_index = deck_walk_index; | |
1452 for(;;) | |
0 | 1453 { |
1200 | 1454 if ( deck_index >= DECK_SIZE ) |
0 | 1455 { |
1197 | 1456 FillPlayerDeck(); |
1200 | 1457 deck_index = deck_walk_index; |
0 | 1458 } |
1200 | 1459 if ( !playDeck.cardsInUse[deck_index] ) |
1186 | 1460 { |
1200 | 1461 new_card_id = playDeck.cards_IDs[deck_index]; |
1462 ++deck_index; | |
1463 deck_walk_index = deck_index; | |
1464 break; | |
1186 | 1465 } |
1200 | 1466 ++deck_index; |
1467 deck_walk_index = deck_index; | |
0 | 1468 } |
1200 | 1469 |
1197 | 1470 ArcomageGame::PlaySound(21); |
1200 | 1471 card_slot_indx = GetEmptyCardSlotIndex(player_num); |
1472 if ( card_slot_indx != -1 ) | |
0 | 1473 { |
1200 | 1474 amuint_4FAA4C = card_slot_indx; |
1475 am_Players[player_num].cards_at_hand[card_slot_indx] = new_card_id; | |
1256 | 1476 am_Players[player_num].card_shift[card_slot_indx].x = rand_interval(-4, 4); |
1477 am_Players[player_num].card_shift[card_slot_indx].y = rand_interval(-4, 4); | |
0 | 1478 pArcomageGame->field_F6 = 1; |
1479 byte_4FAA2D = 1; | |
1480 } | |
1183 | 1481 |
0 | 1482 } |
1186 | 1483 |
0 | 1484 |
1485 //----- (0040A324) -------------------------------------------------------- | |
1185 | 1486 int GetEmptyCardSlotIndex( int player_num ) |
1487 { | |
1488 int i; | |
1489 for (i=0; i<10; ++i ) | |
1490 { | |
1491 if (am_Players[player_num].cards_at_hand[i]==-1) | |
1492 break; | |
1493 } | |
1494 if ( i >= 10 ) | |
1495 return -1; | |
1496 else | |
1497 return i; | |
0 | 1498 } |
1499 | |
1500 //----- (0040A346) -------------------------------------------------------- | |
1679 | 1501 void IncreaseResourcesInTurn(int player_num) |
1185 | 1502 { |
1197 | 1503 am_Players[player_num].resource_bricks += quarry_bonus + am_Players[player_num].quarry_level; |
1504 am_Players[player_num].resource_gems += magic_bonus + am_Players[player_num].magic_level; | |
1263 | 1505 am_Players[player_num].resource_beasts += zoo_bonus + am_Players[player_num].zoo_level; |
0 | 1506 } |
1183 | 1507 |
0 | 1508 |
1509 //----- (0040A383) -------------------------------------------------------- | |
1256 | 1510 void TurnChange() |
1679 | 1511 { |
1263 | 1512 char player_name[64]; // [sp+4h] [bp-64h]@4 |
1513 // RECT v6; // [sp+44h] [bp-24h]@6 | |
1194 | 1514 |
0 | 1515 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7 |
1194 | 1516 POINT v11; // [sp+60h] [bp-8h]@4 |
0 | 1517 |
1518 if ( !pArcomageGame->field_F4 ) | |
1519 { | |
1197 | 1520 if ( am_Players[0].IsHisTurn != 1 || am_Players[1].IsHisTurn != 1 ) |
0 | 1521 { |
1197 | 1522 ++current_player_num; |
0 | 1523 am_byte_4FAA75 = 1; |
1197 | 1524 if ( current_player_num >= 2 ) |
1525 current_player_num = 0; | |
0 | 1526 } |
1527 else | |
1528 { | |
1529 //nullsub_1(); | |
1218 | 1530 // v11.x = 0; |
1531 // v11.y = 0; | |
1679 | 1532 strcpy(player_name, "The Next Player is: ");//"Ñëåä" |
1218 | 1533 // v0 = 0; |
1194 | 1534 v11.y = 200; |
1218 | 1535 v11.x = 320; // - 12 * v0 / 2; |
1679 | 1536 am_DrawText(-1, player_name, &v11); |
0 | 1537 am_byte_4FAA75 = 1; |
1263 | 1538 ++current_player_num; |
1539 if ( current_player_num >= 2 ) | |
1197 | 1540 current_player_num = 0; |
1263 | 1541 strcpy(player_name, am_Players[current_player_num].pPlayerName); |
1218 | 1542 // v4 = 0; |
1194 | 1543 v11.y = 260; |
1218 | 1544 v11.x = 320;// - 12 * v4 / 2; |
1679 | 1545 am_DrawText(-1, player_name, &v11); |
1197 | 1546 /* v6.left = 0; |
1194 | 1547 v6.right = 640; |
1548 v6.top = 0; | |
1197 | 1549 v6.bottom = 480;*/ |
0 | 1550 //nullsub_1(); |
1679 | 1551 pRenderer->Present(); |
0 | 1552 //nullsub_1(); |
1553 while ( 1 ) | |
1263 | 1554 { |
0 | 1555 while ( !ArcomageGame::MsgLoop(20, &v10) ) |
1556 ; | |
1263 | 1557 if ( v10.field_0 == 1 ) |
1558 { | |
1559 if ( v10.field_4 ) | |
1560 break; | |
1561 //nullsub_1(); | |
1562 continue; | |
1563 } | |
1564 if (( v10.field_0 > 4 )&& ( v10.field_0 <= 8 )) | |
1565 break; | |
1566 if ( v10.field_0 == 10 ) | |
1567 { | |
1568 pArcomageGame->field_F4 = 1; | |
1569 byte_4FAA74 = 1; | |
1570 break; | |
1571 } | |
0 | 1572 } |
1197 | 1573 /* v11.x = 0; |
1194 | 1574 v11.y = 0; |
1575 v6.left = 0; | |
1576 v6.right = 640; | |
1577 v6.top = 0; | |
1197 | 1578 v6.bottom = 480;*/ |
0 | 1579 //nullsub_1(); |
1679 | 1580 pRenderer->Present(); |
0 | 1581 } |
1582 } | |
1583 } | |
1584 | |
1585 | |
1586 //----- (0040A514) -------------------------------------------------------- | |
1197 | 1587 bool IsGameOver() |
1679 | 1588 { |
0 | 1589 bool result; // eax@1 |
1183 | 1590 |
1591 result = false; | |
1592 for(int i=0; i<2; ++i) | |
0 | 1593 { |
1197 | 1594 if ( am_Players[i].tower_height <= 0 ) |
1595 result = true; | |
1596 if ( am_Players[i].tower_height >= max_tower_height ) | |
1183 | 1597 result = true; |
1197 | 1598 if ( am_Players[i].resource_bricks >= max_resources_amount |
1599 || am_Players[i].resource_gems >= max_resources_amount | |
1600 || am_Players[i].resource_beasts >= max_resources_amount ) | |
1183 | 1601 result = true; |
0 | 1602 } |
1679 | 1603 |
1604 return am_gameover = result; | |
0 | 1605 } |
1197 | 1606 |
0 | 1607 |
1608 //----- (0040A560) -------------------------------------------------------- | |
1256 | 1609 char PlayerTurn( int player_num ) |
1610 { | |
0 | 1611 int v1; // ebp@0 |
1612 unsigned __int64 v2; // qax@3 | |
1613 unsigned __int64 v3; // kr00_8@3 | |
1218 | 1614 |
0 | 1615 int v5; // esi@67 |
1616 char Dest[100]; // [sp+8h] [bp-A8h]@67 | |
1617 int v8; // [sp+6Ch] [bp-44h]@3 | |
1194 | 1618 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75 |
0 | 1619 int v10[4]; // [sp+80h] [bp-30h]@69 |
1194 | 1620 POINT pTargetXY; // [sp+90h] [bp-20h]@75 |
0 | 1621 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8 |
1263 | 1622 int animation_stage; // [sp+A4h] [bp-Ch]@1 |
0 | 1623 char v15; // [sp+AEh] [bp-2h]@63 |
1263 | 1624 bool break_loop; // [sp+AFh] [bp-1h]@1 |
0 | 1625 |
1626 uCardID = -1; | |
1263 | 1627 break_loop = false; |
1628 animation_stage = 20; | |
0 | 1629 byte_4FAA00 = 0; |
1630 dword_4FAA68 = 0; | |
1631 amuint_4FAA38 = 10; | |
1632 amuint_4FAA34 = 5; | |
1633 if ( amuint_4FAA4C != -1 ) | |
1634 byte_4FAA2D = 1; | |
1635 do | |
1636 { | |
1194 | 1637 |
0 | 1638 do |
1639 { | |
1194 | 1640 v3 = pEventTimer->Time() - pArcomageGame->event_timer_time; |
0 | 1641 } |
1194 | 1642 while (v3 < 6); |
1643 | |
1679 | 1644 pArcomageGame->event_timer_time = (unsigned int)pEventTimer->Time(); |
0 | 1645 if ( pArcomageGame->field_F4 ) |
1263 | 1646 break_loop = 1; |
0 | 1647 ArcomageGame::MsgLoop(0, &a2); |
1648 switch ( a2.field_0 ) | |
1649 { | |
1650 case 2: | |
1651 if ( a2.field_4 == 129 && a2.field_8 == 1 ) | |
1652 { | |
1653 pAudioPlayer->StopChannels(-1, -1); | |
1654 dword_4FAA68 = 0; | |
1263 | 1655 break_loop = true; |
1185 | 1656 pArcomageGame->field_F4 = 1; |
0 | 1657 } |
1658 break; | |
1659 case 9: | |
1660 pArcomageGame->field_F6 = 1; | |
1661 break; | |
1194 | 1662 case 10: |
0 | 1663 pAudioPlayer->StopChannels(-1, -1); |
1664 byte_4FAA74 = 1; | |
1263 | 1665 break_loop = true; |
0 | 1666 pArcomageGame->field_F4 = 1; |
1667 break; | |
1668 } | |
1218 | 1669 |
1263 | 1670 if (am_Players[current_player_num].IsHisTurn != 1 && |
1671 !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D ) | |
0 | 1672 { |
1673 if ( am_byte_4FAA75 ) | |
1674 am_byte_4FAA76 = 1; | |
1256 | 1675 OpponentsAITurn(current_player_num); |
0 | 1676 byte_4FAA2E = 1; |
1677 } | |
1678 if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 ) | |
1679 amuint_4FAA38 = 10; | |
1218 | 1680 if ( byte_4FAA2E || byte_4FAA2D ||am_Players[current_player_num].IsHisTurn != 1 ) |
0 | 1681 { |
1682 pArcomageGame->field_F6 = 1; | |
1683 if ( byte_4FAA2D ) | |
1684 { | |
1685 --amuint_4FAA38; | |
1686 if ( amuint_4FAA38 < 0 ) | |
1687 { | |
1688 byte_4FAA2D = 0; | |
1689 amuint_4FAA38 = 10; | |
1263 | 1690 break_loop = false; |
0 | 1691 } |
1692 } | |
1693 if ( byte_4FAA2E ) | |
1694 { | |
1263 | 1695 --animation_stage; |
1696 if ( animation_stage < 0 ) | |
0 | 1697 { |
1698 if ( dword_4FAA68 > 1 ) | |
1699 { | |
1700 --dword_4FAA68; | |
1701 byte_4FAA00 = 0; | |
1702 } | |
1703 else | |
1704 { | |
1263 | 1705 break_loop = true; |
0 | 1706 } |
1707 byte_4FAA2E = 0; | |
1263 | 1708 animation_stage = 20; |
0 | 1709 } |
1710 } | |
1711 } | |
1712 else | |
1713 { | |
1263 | 1714 if ( need_to_discard_card ) |
0 | 1715 { |
1256 | 1716 if ( a2.field_0 == 7 && DiscardCard(player_num, current_card_slot_index) ) |
0 | 1717 { |
1718 if ( am_byte_4FAA75 ) | |
1719 am_byte_4FAA76 = 1; | |
1720 if ( dword_4FAA64 > 0 ) | |
1721 { | |
1722 --dword_4FAA64; | |
1263 | 1723 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
0 | 1724 } |
1725 byte_4FAA2E = 1; | |
1726 } | |
1256 | 1727 if ( a2.field_0 == 8 && DiscardCard(player_num, current_card_slot_index) ) |
0 | 1728 { |
1729 if ( am_byte_4FAA75 ) | |
1730 am_byte_4FAA76 = 1; | |
1731 if ( dword_4FAA64 > 0 ) | |
1732 { | |
1733 --dword_4FAA64; | |
1263 | 1734 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
0 | 1735 } |
1736 byte_4FAA2E = 1; | |
1737 } | |
1738 } | |
1739 else | |
1740 { | |
1741 if ( a2.field_0 == 7 ) | |
1742 { | |
1200 | 1743 if ( PlayCard(player_num, current_card_slot_index) ) |
0 | 1744 { |
1745 byte_4FAA2E = 1; | |
1746 if ( am_byte_4FAA75 ) | |
1747 am_byte_4FAA76 = 1; | |
1748 } | |
1749 } | |
1750 if ( a2.field_0 == 8 ) | |
1751 { | |
1256 | 1752 if ( DiscardCard(player_num, current_card_slot_index) ) |
0 | 1753 { |
1754 byte_4FAA2E = 1; | |
1755 if ( am_byte_4FAA75 ) | |
1756 am_byte_4FAA76 = 1; | |
1757 } | |
1758 } | |
1759 } | |
1760 } | |
1761 //nullsub_1(); | |
1218 | 1762 //if ( false ) |
1763 //{ | |
1764 // if ( !v15 ) | |
1765 // { | |
1766 // //nullsub_1(); | |
1767 // v15 = 1; | |
1768 // } | |
1769 //} | |
1770 //else | |
1771 //{ | |
1772 // v15 = 0; | |
1773 // } | |
1774 //if ( false ) | |
1775 //{ | |
1776 // //nullsub_1(); | |
1777 // //nullsub_1(); | |
1778 // // assert(false && "Invalid strcpy params"); | |
1779 // // inv_strcpy(nullptr, Dest); | |
1780 // v5 = 0;//unk::const_0(&unk_4E19FC, 0); | |
1781 // //nullsub_1(); | |
1782 // if ( v5 == 1 ) | |
1783 // { | |
1784 // pAudioPlayer->StopChannels(-1, -1); | |
1785 // v16 = 1; | |
1786 // pArcomageGame->field_F4 = 1; | |
1787 // dword_4FAA68 = 0; | |
1788 // } | |
1789 // /*v10[0] = 0; | |
1790 // v10[2] = 640; | |
1791 // v10[1] = 0; | |
1792 // v10[3] = 480;*/ | |
1793 // //nullsub_1(); | |
1794 //} | |
1209 | 1795 if ( dword_4FABB8 != DrawCardsRectangles(player_num) ) |
0 | 1796 { |
1263 | 1797 dword_4FABB8 = DrawCardsRectangles(player_num); |
1798 pArcomageGame->field_F6 = 1; | |
1209 | 1799 } |
0 | 1800 if ( pArcomageGame->field_F6 ) |
1801 { | |
1263 | 1802 DrawGameUI(animation_stage); |
0 | 1803 DoBlt_Copy(pArcomageGame->pBackgroundPixels); |
1804 pArcomageGame->field_F6 = 0; | |
1805 } | |
1806 if ( pArcomageGame->field_F9 ) | |
1807 { | |
1194 | 1808 pTargetXY.x = 0; |
1809 pTargetXY.y = 0; | |
1810 pSrcXYZW.left = 0; | |
1811 pSrcXYZW.right = 640; | |
1812 pSrcXYZW.top = 0; | |
1813 pSrcXYZW.bottom = 480; | |
0 | 1814 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1194 | 1815 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
0 | 1816 am_EndScene(); |
1263 | 1817 DrawGameUI(animation_stage); |
0 | 1818 pRenderer->Present(); |
1819 pArcomageGame->field_F9 = 0; | |
1820 } | |
1821 } | |
1263 | 1822 while ( !break_loop ); |
0 | 1823 return dword_4FAA68 > 0; |
1824 } | |
1194 | 1825 |
0 | 1826 |
1827 //----- (0040A9AF) -------------------------------------------------------- | |
1263 | 1828 void DrawGameUI( int animation_stage ) |
1679 | 1829 { |
0 | 1830 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1197 | 1831 DrawRectanglesForText(); |
0 | 1832 am_EndScene(); |
1197 | 1833 |
0 | 1834 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1209 | 1835 DrawCards(); |
1197 | 1836 DrawPlayersTowers(); |
1837 DrawPlayersWall(); | |
1838 DrawPlayersText(); | |
0 | 1839 am_EndScene(); |
1197 | 1840 |
0 | 1841 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1263 | 1842 DrawCardAnimation(animation_stage); |
1185 | 1843 |
1844 for( int i=0; i<10; ++i) | |
1845 { | |
1263 | 1846 if (array_4FABD0[i].have_effect) |
1847 array_4FABD0[i].field_40->DrawEffect(); | |
1185 | 1848 } |
1200 | 1849 current_card_slot_index = DrawCardsRectangles(current_player_num); |
1263 | 1850 DrawSparks(); |
0 | 1851 am_EndScene(); |
1852 } | |
1853 | |
1854 //----- (0040AA4E) -------------------------------------------------------- | |
1263 | 1855 void DrawSparks() |
1185 | 1856 { |
1263 | 1857 int rgb_pixel_color; // [sp-4h] [bp-2Ch]@4 |
1858 unsigned int pixel_color; | |
1185 | 1859 |
1860 for (int i=0; i<10; ++i) | |
0 | 1861 { |
1263 | 1862 if(array_4FABD0[i].have_effect && (array_4FABD0[i].field_40->_40E2A7()==2)) |
1185 | 1863 { |
1263 | 1864 rgb_pixel_color = 0x0000FF00; |
1865 if ( !array_4FABD0[i].effect_sign ) | |
1866 rgb_pixel_color = 0x000000FF; | |
1867 | |
1868 pixel_color = R8G8B8_to_TargetFormat(rgb_pixel_color); | |
1185 | 1869 for(int j=0; j<150; ++j ) |
1870 { | |
1263 | 1871 if (array_4FABD0[i].effect_sparks[j].have_spark > 0) |
1185 | 1872 { |
1873 if (j%2) | |
1679 | 1874 DrawPixel(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color); |
1185 | 1875 else |
1679 | 1876 DrawSquare(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color); |
1185 | 1877 } |
1878 } | |
1879 } | |
0 | 1880 } |
1185 | 1881 |
0 | 1882 } |
1883 | |
1884 //----- (0040AB0A) -------------------------------------------------------- | |
1197 | 1885 void DrawRectanglesForText() |
1679 | 1886 { |
1183 | 1887 RECT pSrcRect; // [sp+Ch] [bp-18h]@1 |
1888 POINT pTargetXY; // [sp+1Ch] [bp-8h]@1 | |
1679 | 1889 |
1197 | 1890 //resources rectangles |
1263 | 1891 pSrcRect.left = 765; |
1183 | 1892 pSrcRect.top = 0; |
1893 pSrcRect.right = 843; | |
1894 pSrcRect.bottom = 216; | |
1895 | |
1896 pTargetXY.x = 8; | |
1897 pTargetXY.y = 56; | |
1898 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
1899 | |
1900 pTargetXY.x = 555; | |
1901 pTargetXY.y = 56; | |
1902 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
1903 | |
1197 | 1904 //players name rectangle |
1183 | 1905 pSrcRect.left = 283; |
1263 | 1906 pSrcRect.top = 166; |
1183 | 1907 pSrcRect.right = 361; |
1908 pSrcRect.bottom = 190; | |
1909 pTargetXY.x = 8; | |
1910 pTargetXY.y = 13; | |
1911 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1912 | |
1913 pTargetXY.x = 555; | |
1914 pTargetXY.y = 13; | |
1915 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1916 | |
1241 | 1917 //tower height rectangle |
1183 | 1918 pSrcRect.left = 234; |
1263 | 1919 pSrcRect.top = 166; |
1183 | 1920 pSrcRect.right = 283; |
1921 pSrcRect.bottom = 190; | |
1922 pTargetXY.x = 100; | |
1923 pTargetXY.y = 296; | |
1924 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1925 | |
1926 pTargetXY.x = 492; | |
1927 pTargetXY.y = 296; | |
1928 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1929 | |
1241 | 1930 //wall height rectangle |
1263 | 1931 pSrcRect.left = 192; |
1932 pSrcRect.top = 166; | |
1183 | 1933 pSrcRect.right = 234; |
1934 pSrcRect.bottom = 190; | |
1935 pTargetXY.x = 168; | |
1936 pTargetXY.y = 296; | |
1937 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1938 | |
1939 pTargetXY.x = 430; | |
1940 pTargetXY.y = 296; | |
1941 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
0 | 1942 } |
1943 | |
1944 //----- (0040AC5F) -------------------------------------------------------- | |
1197 | 1945 void DrawPlayersText() |
1946 { | |
1947 | |
1948 int res_value; // ecx@18 | |
1949 char text_buff[32]; // [sp+Ch] [bp-28h]@2 | |
1950 POINT text_position; // [sp+2Ch] [bp-8h]@2 | |
0 | 1951 |
1263 | 1952 if ( need_to_discard_card ) |
0 | 1953 { |
1209 | 1954 strcpy(text_buff, pGlobalTXT_LocalizationStrings[266]);// DISCARD A CARD |
1197 | 1955 text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2; |
1956 text_position.y = 306; | |
1679 | 1957 am_DrawText(-1, text_buff, &text_position); |
0 | 1958 } |
1209 | 1959 strcpy( text_buff, am_Players[0].pPlayerName); |
1197 | 1960 if ( !current_player_num ) |
1209 | 1961 strcat(text_buff, "***"); |
1197 | 1962 text_position.x = 47 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1963 text_position.y = 21; | |
1679 | 1964 am_DrawText(-1, text_buff, &text_position); |
1197 | 1965 |
1209 | 1966 strcpy(text_buff, am_Players[1].pPlayerName); |
1197 | 1967 if ( current_player_num == 1 ) |
1209 | 1968 strcat(text_buff, "***" ); |
1197 | 1969 text_position.x = 595 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1970 text_position.y = 21; | |
1679 | 1971 am_DrawText(-1, text_buff, &text_position); |
1972 | |
1973 am_IntToString(am_Players[0].tower_height, text_buff); | |
1197 | 1974 text_position.x = 123 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1975 text_position.y = 305; | |
1679 | 1976 am_DrawText(-1, text_buff, &text_position); |
1977 | |
1978 am_IntToString(am_Players[1].tower_height, text_buff); | |
1197 | 1979 text_position.x = 515 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1980 text_position.y = 305; | |
1679 | 1981 am_DrawText(-1, text_buff, &text_position); |
1982 | |
1983 am_IntToString(am_Players[0].wall_height, text_buff); | |
1197 | 1984 text_position.x = 188 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1985 text_position.y = 305; | |
1679 | 1986 am_DrawText(-1, text_buff, &text_position); |
1987 | |
1988 am_IntToString(am_Players[1].wall_height, text_buff); | |
1197 | 1989 text_position.x = 451 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1990 text_position.y = 305; | |
1679 | 1991 am_DrawText(-1, text_buff, &text_position); |
1197 | 1992 |
1993 res_value = am_Players[0].quarry_level; | |
1263 | 1994 if ( use_start_bonus ) |
1197 | 1995 res_value =am_Players[0].quarry_level + quarry_bonus; |
1679 | 1996 am_IntToString(res_value, text_buff); |
1197 | 1997 text_position.x = 14;// - 6 * 0 / 2; |
1998 text_position.y = 92; | |
1999 DrawPlayerLevels(-1, text_buff, &text_position); | |
2000 | |
2001 res_value = am_Players[1].quarry_level; | |
1263 | 2002 if ( use_start_bonus ) |
1197 | 2003 res_value = am_Players[1].quarry_level + quarry_bonus; |
1679 | 2004 am_IntToString(res_value, text_buff); |
1197 | 2005 // v2 = 0; |
2006 text_position.y = 92; | |
2007 text_position.x = 561; //- 6 * v2 / 2; | |
2008 DrawPlayerLevels(-1, text_buff, &text_position); | |
2009 | |
2010 res_value = am_Players[0].magic_level; | |
1263 | 2011 if ( use_start_bonus ) |
1197 | 2012 res_value = am_Players[0].magic_level + magic_bonus; |
1679 | 2013 am_IntToString(res_value, text_buff); |
1197 | 2014 // v4 = 0; |
2015 text_position.y = 164; | |
2016 text_position.x = 14; //- 6 * v4 / 2; | |
2017 DrawPlayerLevels(-1, text_buff, &text_position); | |
2018 | |
2019 res_value = am_Players[1].magic_level; | |
1263 | 2020 if ( use_start_bonus ) |
2021 res_value = am_Players[1].magic_level + magic_bonus; | |
1679 | 2022 am_IntToString(res_value, text_buff); |
1197 | 2023 // v6 = 0; |
2024 text_position.y = 164; | |
2025 text_position.x = 561; //- 6 * v6 / 2; | |
2026 DrawPlayerLevels(-1, text_buff, &text_position); | |
2027 | |
1200 | 2028 res_value = am_Players[0].zoo_level; |
1263 | 2029 if ( use_start_bonus ) |
1201 | 2030 res_value = am_Players[0].zoo_level + zoo_bonus; |
1679 | 2031 am_IntToString(res_value, text_buff); |
1197 | 2032 // v8 = 0; |
2033 text_position.y = 236; | |
2034 text_position.x = 14;// - 6 * v8 / 2; | |
2035 DrawPlayerLevels(-1, text_buff, &text_position); | |
2036 | |
1200 | 2037 res_value = am_Players[1].zoo_level; |
1263 | 2038 if ( use_start_bonus ) |
1201 | 2039 res_value = am_Players[1].zoo_level + zoo_bonus; |
1679 | 2040 am_IntToString(res_value, text_buff); |
1197 | 2041 // v10 = 0; |
2042 text_position.y = 236; | |
2043 text_position.x = 561;// - 6 * v10 / 2; | |
2044 DrawPlayerLevels(-1, text_buff, &text_position); | |
2045 | |
1679 | 2046 am_IntToString(am_Players[0].resource_bricks, text_buff); |
1197 | 2047 text_position.y = 114; |
2048 text_position.x = 10; | |
2049 DrawBricksCount(-1, text_buff, &text_position); | |
2050 | |
1679 | 2051 am_IntToString(am_Players[1].resource_bricks, text_buff); |
1197 | 2052 text_position.x = 557; |
2053 text_position.y = 114; | |
2054 DrawBricksCount(-1, text_buff, &text_position); | |
2055 | |
1679 | 2056 am_IntToString(am_Players[0].resource_gems, text_buff); |
1197 | 2057 text_position.x = 10; |
2058 text_position.y = 186; | |
2059 DrawGemsCount(-1, text_buff, &text_position); | |
2060 | |
1679 | 2061 am_IntToString(am_Players[1].resource_gems, text_buff); |
1197 | 2062 text_position.x = 557; |
2063 text_position.y = 186; | |
2064 DrawGemsCount(-1, text_buff, &text_position); | |
2065 | |
1679 | 2066 am_IntToString(am_Players[0].resource_beasts, text_buff); |
1197 | 2067 text_position.x = 10; |
2068 text_position.y = 258; | |
2069 DrawBeastsCount(-1, text_buff, &text_position); | |
2070 | |
1679 | 2071 am_IntToString(am_Players[1].resource_beasts, text_buff); |
1197 | 2072 text_position.x = 557; |
2073 text_position.y = 258; | |
2074 DrawBeastsCount(-1, text_buff, &text_position); | |
0 | 2075 } |
1197 | 2076 |
0 | 2077 |
2078 //----- (0040B102) -------------------------------------------------------- | |
1197 | 2079 void DrawPlayerLevels( int a1, char *text, POINT *pXY ) |
0 | 2080 { |
1194 | 2081 char *v3; // esi@1 |
2082 unsigned char test_char; // bl@2 | |
2083 int v7; // eax@3 | |
2084 RECT pSrcRect; | |
2085 POINT pTargetPoint; | |
2086 | |
2087 v3 = text; | |
2088 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2089 pTargetPoint.x = pXY->x; | |
2090 pTargetPoint.y = pXY->y; | |
2091 do | |
2092 { | |
2093 test_char = *v3; | |
2094 ++v3; | |
2095 if ( test_char ) | |
2096 { | |
2097 v7 = 22 * test_char; | |
2098 pSrcRect.right = v7 - 842; | |
2099 pSrcRect.left = v7 - 864; | |
2100 pSrcRect.top = 190; | |
2101 pSrcRect.bottom = 207; | |
2102 Blt_Chroma(&pSrcRect, &pTargetPoint, pArcomageGame->field_54, 1); | |
2103 pTargetPoint.x += 22; | |
2104 } | |
2105 } | |
2106 while ( test_char!= 0 ); | |
2107 am_EndScene(); | |
0 | 2108 } |
2109 | |
2110 //----- (0040B17E) -------------------------------------------------------- | |
1197 | 2111 void DrawBricksCount( int a1, char* text, POINT *pXY ) |
0 | 2112 { |
1194 | 2113 |
2114 char *v3; // esi@1 | |
2115 unsigned char test_char; // bl@2 | |
2116 int v7; // eax@3 | |
2117 RECT pSrcRect; | |
2118 POINT pTargetPoint; | |
2119 | |
2120 v3 = text; | |
2121 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2122 pTargetPoint.x = pXY->x; | |
2123 pTargetPoint.y = pXY->y; | |
2124 do | |
2125 { | |
2126 test_char = *v3; | |
2127 ++v3; | |
2128 if ( test_char ) | |
2129 { | |
2130 v7 = 13 * test_char; | |
1197 | 2131 pSrcRect.left = v7 - 370; |
2132 pSrcRect.right = v7 - 357; | |
1194 | 2133 pSrcRect.top = 128; |
2134 pSrcRect.bottom = 138; | |
2135 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2136 pTargetPoint.x += 13; | |
2137 } | |
2138 } | |
2139 while ( test_char!= 0 ); | |
2140 am_EndScene(); | |
2141 | |
0 | 2142 } |
2143 | |
2144 //----- (0040B1F3) -------------------------------------------------------- | |
1197 | 2145 void DrawGemsCount( int a1, char* text, POINT* pXY ) |
0 | 2146 { |
1194 | 2147 |
2148 char *v3; // esi@1 | |
2149 unsigned char test_char; // bl@2 | |
2150 int v7; // eax@3 | |
2151 RECT pSrcRect; | |
2152 POINT pTargetPoint; | |
2153 | |
2154 v3 = text; | |
2155 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2156 pTargetPoint.x = pXY->x; | |
2157 pTargetPoint.y = pXY->y; | |
2158 do | |
2159 { | |
2160 test_char = *v3; | |
2161 ++v3; | |
2162 if ( test_char ) | |
2163 { | |
2164 v7 = 13 * test_char; | |
1197 | 2165 pSrcRect.left = v7 - 370; |
2166 pSrcRect.right = v7 - 357; | |
1194 | 2167 pSrcRect.top = 138; |
2168 pSrcRect.bottom = 148; | |
2169 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2170 pTargetPoint.x += 13; | |
2171 } | |
2172 } | |
2173 while ( test_char!= 0 ); | |
2174 am_EndScene(); | |
2175 | |
0 | 2176 } |
2177 | |
2178 //----- (0040B268) -------------------------------------------------------- | |
1197 | 2179 void DrawBeastsCount( int a1, char *text, POINT *pXY ) |
0 | 2180 { |
1194 | 2181 |
2182 char *v3; // esi@1 | |
2183 unsigned char test_char; // bl@2 | |
2184 int v7; // eax@3 | |
2185 RECT pSrcRect; | |
2186 POINT pTargetPoint; | |
2187 | |
2188 v3 = text; | |
2189 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2190 pTargetPoint.x = pXY->x; | |
2191 pTargetPoint.y = pXY->y; | |
2192 do | |
2193 { | |
2194 test_char = *v3; | |
2195 ++v3; | |
2196 if ( test_char ) | |
2197 { | |
2198 v7 = 13 * test_char; | |
1197 | 2199 pSrcRect.left = v7 - 370; |
2200 pSrcRect.right = v7 - 357; | |
1194 | 2201 pSrcRect.top = 148; |
2202 pSrcRect.bottom = 158; | |
2203 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2204 pTargetPoint.x += 13; | |
2205 } | |
2206 } | |
2207 while ( test_char!= 0 ); | |
2208 am_EndScene(); | |
2209 | |
0 | 2210 } |
2211 | |
2212 //----- (0040B2DD) -------------------------------------------------------- | |
1197 | 2213 void DrawPlayersTowers() |
2214 { | |
2215 int tower_height; // eax@1 | |
2216 int tower_top; // esi@3 | |
1194 | 2217 RECT pSrcXYZW; // [sp+0h] [bp-18h]@3 |
2218 POINT pTargetXY; // [sp+10h] [bp-8h]@3 | |
2219 | |
1197 | 2220 tower_height= am_Players[0].tower_height; |
2221 if ( am_Players[0].tower_height > max_tower_height ) | |
2222 tower_height = max_tower_height; | |
1194 | 2223 pSrcXYZW.top = 0; |
2224 pSrcXYZW.left = 892; | |
2225 pSrcXYZW.right = 937; | |
1197 | 2226 tower_top = 200 * tower_height / max_tower_height; |
2227 pSrcXYZW.bottom = tower_top; | |
1194 | 2228 pTargetXY.x = 102; |
1197 | 2229 pTargetXY.y = 297 - tower_top; |
1194 | 2230 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
2231 | |
2232 pSrcXYZW.top = 0; | |
2233 pSrcXYZW.left = 384; | |
2234 pSrcXYZW.right = 452; | |
2235 pSrcXYZW.bottom = 94; | |
1197 | 2236 pTargetXY.y = 203 - tower_top; |
1194 | 2237 pTargetXY.x = 91; |
2238 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2239 | |
1197 | 2240 |
2241 tower_height = am_Players[1].tower_height; | |
2242 if (am_Players[1].tower_height > max_tower_height ) | |
2243 tower_height = max_tower_height; | |
2244 tower_top = 200 * tower_height / max_tower_height; | |
2245 pSrcXYZW.top = 0; | |
2246 pSrcXYZW.left = 892; | |
2247 pSrcXYZW.right = 937; | |
2248 pSrcXYZW.bottom = tower_top; | |
2249 | |
1194 | 2250 pTargetXY.x = 494; |
1197 | 2251 pTargetXY.y = 297 - tower_top; |
1194 | 2252 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
1197 | 2253 //draw tower up cone |
2254 pSrcXYZW.left = 384; | |
2255 pSrcXYZW.right = 452; | |
2256 pSrcXYZW.top = 94; | |
1194 | 2257 pSrcXYZW.bottom = 188; |
1197 | 2258 |
1194 | 2259 pTargetXY.x = 483; |
1197 | 2260 pTargetXY.y = 203 - tower_top; |
1194 | 2261 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); |
2262 | |
0 | 2263 } |
2264 // 4E1884: using guessed type int dword_4E1884; | |
2265 | |
2266 //----- (0040B400) -------------------------------------------------------- | |
1197 | 2267 void DrawPlayersWall() |
2268 { | |
1194 | 2269 int v0; // eax@1 |
2270 int v1; // eax@4 | |
2271 LONG v2; // ecx@4 | |
2272 int v3; // eax@5 | |
2273 int v4; // eax@8 | |
2274 LONG v5; // esi@8 | |
2275 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4 | |
2276 POINT pTargetXY; // [sp+14h] [bp-8h]@4 | |
2277 | |
1197 | 2278 v0 = am_Players[0].wall_height; |
1218 | 2279 |
2280 if ( am_Players[0].wall_height > 100 ) | |
1194 | 2281 v0 = 100; |
1218 | 2282 |
2283 if ( am_Players[0].wall_height > 0 ) | |
2284 { | |
2285 | |
1194 | 2286 pSrcXYZW.top = 0; |
2287 pSrcXYZW.left = 843; | |
2288 v1 = 200 * v0 / 100; | |
2289 pSrcXYZW.right = 867; | |
2290 pSrcXYZW.bottom = v1; | |
2291 pTargetXY.x = 177; | |
2292 pTargetXY.y = 297 - v1; | |
2293 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
1218 | 2294 } |
2295 | |
1197 | 2296 v3 = am_Players[1].wall_height; |
1218 | 2297 if ( am_Players[1].wall_height > 100 ) |
2298 v3 = 100; | |
2299 | |
2300 | |
1247 | 2301 if ( am_Players[1].wall_height > 0 ) |
1218 | 2302 { |
2303 | |
1194 | 2304 pSrcXYZW.top = 0; |
2305 pSrcXYZW.left = 843; | |
2306 v4 = 200 * v3 / 100; | |
2307 pSrcXYZW.right = 867; | |
2308 pSrcXYZW.bottom = v4; | |
2309 pTargetXY.x = 439; | |
2310 pTargetXY.y = 297 - v4; | |
2311 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
1218 | 2312 } |
0 | 2313 } |
2314 | |
2315 //----- (0040B4B9) -------------------------------------------------------- | |
1209 | 2316 void DrawCards() |
2317 { | |
1200 | 2318 |
2319 int v0; // esi@1 | |
2320 char v1; // bl@1 | |
2321 int v2; // edi@1 | |
2322 int v3; // edx@2 | |
2323 int v4; // eax@3 | |
2324 int v5; // ecx@3 | |
2325 int v6; // eax@3 | |
2326 unsigned int v7; // ecx@4 | |
2327 int v8; // eax@16 | |
2328 int v9; // ecx@16 | |
2329 int v10; // eax@16 | |
2330 signed int v11; // edi@18 | |
2331 signed int v12; // esi@20 | |
2332 int v13; // ecx@20 | |
2333 int v14; // eax@23 | |
2334 signed int v15; // eax@25 | |
2335 int v16; // ecx@25 | |
2336 POINT *v17; // esi@26 | |
2337 signed int v18; // eax@29 | |
1679 | 2338 AcromageCardOnTable *v19; // ecx@29 |
1200 | 2339 int v20; // ecx@31 |
2340 int v21; // [sp-4h] [bp-2Ch]@8 | |
2341 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@8 | |
2342 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@1 | |
2343 int v24; // [sp+24h] [bp-4h]@1 | |
2344 | |
2345 v0 = GetPlayerHandCardCount(current_player_num); | |
2346 v2 = 0; | |
2347 pTargetXY.y = 327; | |
2348 v24 = (640 - 96 * v0) / (v0 + 1); | |
2349 pTargetXY.x = (640 - 96 * v0) / (v0 + 1); | |
2350 while ( v2 < v0 ) | |
2351 { | |
2352 v3 = current_player_num; | |
1241 | 2353 if ( am_byte_4E185D) |
1200 | 2354 { |
2355 | |
1256 | 2356 pTargetXY.x += am_Players[current_player_num].card_shift[v2].x ; |
2357 pTargetXY.y += am_Players[current_player_num].card_shift[v2].y; | |
1200 | 2358 } |
2359 v7 = am_Players[current_player_num].cards_at_hand[v2]; | |
2360 if ( v7 == -1 ) | |
2361 { | |
2362 ++v0; | |
2363 goto LABEL_15; | |
2364 } | |
2365 if ( v2 != amuint_4FAA4C ) | |
2366 { | |
2367 if ( am_Players[current_player_num].IsHisTurn == 0 && byte_505881 == 0 ) | |
2368 { | |
2369 pSrcXYZW.left = 192; | |
2370 pSrcXYZW.right = 288; | |
2371 pSrcXYZW.top = 0; | |
2372 pSrcXYZW.bottom = 128; | |
2373 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2374 goto LABEL_13; | |
2375 } | |
2376 pArcomageGame->GetCardRect(v7, &pSrcXYZW); | |
2377 if ( !CanCardBePlayed(current_player_num, v2) ) | |
2378 { | |
2379 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2380 goto LABEL_13; | |
2381 } | |
2382 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2383 | |
2384 } | |
2385 LABEL_13: | |
2386 v3 = current_player_num; | |
2387 pTargetXY.x += v24 + 96; | |
2388 LABEL_15: | |
1241 | 2389 if ( am_byte_4E185D ) |
1200 | 2390 { |
1256 | 2391 pTargetXY.x -= am_Players[current_player_num].card_shift[v2].x ; |
2392 pTargetXY.y -= am_Players[current_player_num].card_shift[v2].y ; | |
1200 | 2393 } |
2394 ++v2; | |
2395 } | |
2396 | |
2397 for (v11=0; v11<10; ++v11) | |
2398 { | |
2399 if ( am_byte_4FAA76 == 0 ) | |
2400 { | |
2401 if ( shown_cards[v11].uCardId != -1 ) | |
2402 { | |
2403 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW); | |
2404 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0); | |
2405 } | |
2406 if ( shown_cards[v11].field_4 != 0 ) | |
2407 { | |
2408 pTargetXY.x = shown_cards[v11].field_18_point.x + 12; | |
2409 pTargetXY.y = shown_cards[v11].field_18_point.y + 40; | |
2410 pSrcXYZW.left = 843; | |
2411 pSrcXYZW.right = 916; | |
2412 pSrcXYZW.top = 200; | |
2413 pSrcXYZW.bottom = 216; | |
2414 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2415 } | |
2416 } | |
2417 else if ( amuint_4FAA34 <= 0 ) | |
2418 { | |
2419 if ( v11 == 9 ) | |
2420 { | |
2421 am_byte_4FAA76 = 0; | |
2422 am_byte_4FAA75 = 0; | |
2423 amuint_4FAA34 = 5; | |
2424 } | |
2425 if ( shown_cards[v11].uCardId != -1 ) | |
2426 amuint_4FABC4 = shown_cards[v11].uCardId; | |
2427 shown_cards[v11].uCardId = -1; | |
2428 shown_cards[v11].field_18_point.x = shown_cards[v11].field_8.x; | |
2429 shown_cards[v11].field_18_point.y = shown_cards[v11].field_8.y; | |
2430 shown_cards[v11].field_4 = 0; | |
2431 } | |
2432 else | |
2433 { | |
2434 if ( shown_cards[v11].uCardId != -1 ) | |
2435 { | |
2436 shown_cards[v11].field_18_point.x += shown_cards[v11].field_10_xplus; | |
2437 shown_cards[v11].field_18_point.y += shown_cards[v11].field_14_y_plus; | |
2438 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW); | |
2439 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0); | |
2440 } | |
2441 } | |
2442 } | |
2443 if ( am_byte_4FAA76 != 0 ) | |
2444 --amuint_4FAA34; | |
2445 | |
2446 pSrcXYZW.left = 192; | |
2447 pSrcXYZW.right = 288; | |
2448 pSrcXYZW.top = 0; | |
2449 pSrcXYZW.bottom = 128; | |
2450 pTargetXY.x = 120; | |
2451 pTargetXY.y = 18; | |
2452 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2453 | |
0 | 2454 } |
2455 | |
2456 | |
2457 //----- (0040B76F) -------------------------------------------------------- | |
1218 | 2458 void DrawCardAnimation( int animation_stage ) |
2459 { | |
1209 | 2460 |
2461 int v1; // eax@3 | |
2462 int v2; // eax@3 | |
2463 int v3; // esi@4 | |
2464 int v4; // eax@4 | |
2465 POINT *v5; // edx@6 | |
2466 RECT *v6; // ecx@6 | |
1218 | 2467 |
1209 | 2468 int v8; // eax@15 |
1679 | 2469 AcromageCardOnTable *v9; // ecx@15 |
1209 | 2470 int v10; // ecx@19 |
2471 int v11; // eax@20 | |
2472 int v12; // ecx@20 | |
2473 int v13; // eax@20 | |
2474 unsigned int v14; // ecx@21 | |
2475 double v15; // st7@22 | |
2476 POINT *v16; // edx@23 | |
2477 int v17; // eax@32 | |
2478 char v18; // zf@37 | |
2479 int v19; // eax@41 | |
2480 int v20; // eax@46 | |
2481 int v21; // ecx@46 | |
2482 int v22; // eax@46 | |
2483 int v23; // [sp-4h] [bp-2Ch]@28 | |
2484 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6 | |
2485 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20 | |
2486 int v26; // [sp+24h] [bp-4h]@1 | |
2487 | |
1218 | 2488 v26 = animation_stage; |
1209 | 2489 if ( amuint_4FAA4C != -1 ) |
2490 { | |
2491 if ( amuint_4FAA38 >= 9 ) | |
2492 { | |
2493 am_uint_4FAA44_blt_xy.y = 18; | |
2494 am_uint_4FAA44_blt_xy.x = 120; | |
2495 v1 = GetPlayerHandCardCount(current_player_num); | |
2496 v2 = (640 - 96 * v1) / v1 + 96; | |
2497 if ( am_byte_4E185D ) | |
2498 { | |
2499 // v3 = 188 * current_player_num + 8 * amuint_4FAA4C; | |
2500 // amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 + *(am_Players[0].arr_6C[0] + v3) - 120) / 10; | |
1256 | 2501 amuint_4FAA3C_blt_xy.x=(amuint_4FAA4C * v2 + am_Players[current_player_num].card_shift[amuint_4FAA4C].x-120)/10; |
2502 v4 = (am_Players[current_player_num].card_shift[amuint_4FAA4C].y+309) /10;//(*(&am_Players[0].arr_6C[0][1] + v3) + 309) / 10; | |
1209 | 2503 } |
2504 else | |
2505 { | |
2506 amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 - 120) / 10; | |
2507 v4 = 30; | |
2508 } | |
2509 am_uint_4FAA44_blt_xy.y += v4; | |
2510 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
1218 | 2511 |
1209 | 2512 amuint_4FAA3C_blt_xy.y = v4; |
1218 | 2513 |
1209 | 2514 pSrcXYZW.left = 192; |
1218 | 2515 pSrcXYZW.top = 0; |
1209 | 2516 pSrcXYZW.right = 288; |
2517 pSrcXYZW.bottom = 128; | |
1218 | 2518 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2); |
1209 | 2519 } |
1218 | 2520 else |
2521 { | |
2522 | |
2523 | |
2524 pSrcXYZW.left = 192; | |
2525 pSrcXYZW.top = 0; | |
2526 pSrcXYZW.right = 288; | |
1209 | 2527 pSrcXYZW.bottom = 128; |
2528 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
2529 am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y; | |
2530 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2); | |
1218 | 2531 if ( !amuint_4FAA38 ) |
2532 { | |
2533 | |
1209 | 2534 amuint_4FAA4C = -1; |
1218 | 2535 } |
2536 } | |
1209 | 2537 } |
2538 LABEL_11: | |
1218 | 2539 |
1209 | 2540 if ( uCardID != -1 ) |
2541 { | |
2542 if ( v26 <= 10 ) | |
2543 { | |
2544 if ( v26 == 10 ) | |
2545 { | |
2546 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); | |
2547 // v8 = 0; | |
2548 for (v8=0; v8<10; ++v8) | |
2549 { | |
2550 if (shown_cards[v8].uCardId==-1) | |
2551 { | |
2552 shown_cards[v8].uCardId = uCardID; | |
2553 shown_cards[v8].field_4 = 1; | |
2554 break; | |
2555 } | |
2556 } | |
2557 /* v9 = shown_cards; | |
2558 while ( v9->uCardId != -1 ) | |
2559 { | |
2560 ++v9; | |
2561 ++v8; | |
2562 if ( v9 >= &dword_4FABB8 ) | |
2563 goto LABEL_20; | |
2564 } | |
2565 | |
2566 v10 = v8; | |
2567 shown_cards[v10].uCardId = uCardID; | |
2568 shown_cards[v10].field_4 = 1;*/ | |
2569 //LABEL_20: | |
2570 pTargetXY.x = shown_cards[v8].field_8.x; | |
2571 pTargetXY.y = shown_cards[v8].field_8.y; | |
2572 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2573 uCardID = -1; | |
2574 } | |
2575 } | |
2576 else | |
2577 { | |
2578 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); | |
2579 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2580 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
2581 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); | |
2582 } | |
2583 } | |
1218 | 2584 |
1209 | 2585 if ( played_card_id != -1 ) |
2586 { | |
2587 v15 = v26; | |
2588 if ( v15 > 15.0 ) | |
2589 { | |
2590 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2591 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2592 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
1218 | 2593 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 2); |
1209 | 2594 return; |
2595 } | |
2596 if ( v15 == 15.0 ) | |
2597 { | |
1218 | 2598 ApplyCardToPlayer(current_player_num, played_card_id); |
1209 | 2599 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); |
2600 pTargetXY.x = 272; | |
2601 pTargetXY.y = 173; | |
2602 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2603 return; | |
2604 } | |
2605 if ( v15 == 5.0 ) | |
2606 { | |
2607 amuint_4FAA5C_blt_xy.x = 272; | |
2608 amuint_4FAA5C_blt_xy.y = 173; | |
2609 for (v17=0; v17<10; ++v17) | |
2610 { | |
2611 if (shown_cards[v17].uCardId==-1) | |
2612 break; | |
2613 } | |
1263 | 2614 |
1209 | 2615 amuint_4FAA54_blt_xy.x = (shown_cards[v17].field_8.x - 272) / 5; |
2616 amuint_4FAA54_blt_xy.y = (shown_cards[v17].field_8.y - 173) / 5; | |
2617 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2618 pTargetXY.x = 272; | |
2619 pTargetXY.y = 173; | |
2620 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2621 return; | |
2622 } | |
2623 if ( v15 >= 5.0 ) | |
2624 { | |
2625 v18 = v26 == 0; | |
2626 } | |
2627 else | |
2628 { | |
2629 v18 = v26 == 0; | |
2630 if ( v26 > 0 ) | |
2631 { | |
2632 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2633 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2634 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
2635 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); | |
2636 return; | |
2637 } | |
2638 } | |
2639 if ( !v18 ) | |
2640 { | |
2641 | |
1218 | 2642 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); |
1209 | 2643 pTargetXY.x = 272; |
2644 pTargetXY.y = 173; | |
2645 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2646 return; | |
2647 } | |
1218 | 2648 |
1209 | 2649 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); |
2650 for (v19=0; v19<10; ++v19) | |
2651 { | |
2652 if (shown_cards[v19].uCardId==-1) | |
2653 { | |
2654 shown_cards[v19].uCardId = played_card_id; | |
2655 break; | |
1218 | 2656 } |
1209 | 2657 } |
1218 | 2658 pTargetXY.x = shown_cards[v19].field_8.x; |
1209 | 2659 pTargetXY.y = shown_cards[v19].field_8.y; |
2660 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2661 played_card_id = -1; | |
2662 } | |
0 | 2663 } |
2664 | |
2665 //----- (0040BB12) -------------------------------------------------------- | |
1183 | 2666 void ArcomageGame::GetCardRect(unsigned int uCardID, RECT *pCardRect) |
0 | 2667 { |
2668 int v3; // edx@1 | |
2669 int v4; // ecx@1 | |
2670 | |
2671 v3 = pCards[uCardID].slot % 10; | |
2672 v4 = (pCards[uCardID].slot / 10 << 7) + 220; | |
1183 | 2673 pCardRect->top = v4; |
2674 pCardRect->left = 96 * v3; | |
2675 pCardRect->bottom = v4 + 128; | |
2676 pCardRect->right = 96 * v3 + 96; | |
0 | 2677 } |
2678 | |
2679 //----- (0040BB49) -------------------------------------------------------- | |
1185 | 2680 int GetPlayerHandCardCount( int player_num ) |
2681 { | |
2682 int card_count; // eax@1 | |
2683 | |
2684 card_count = 0; | |
2685 for(int i=0; i<10; ++i) | |
2686 { | |
2687 if (am_Players[player_num].cards_at_hand[i]!=-1) | |
2688 ++card_count; | |
2689 } | |
2690 return card_count; | |
2691 | |
0 | 2692 } |
2693 | |
2694 //----- (0040BB67) -------------------------------------------------------- | |
1200 | 2695 signed int DrawCardsRectangles( int player_num ) |
1679 | 2696 { |
1200 | 2697 //int v1; // esi@1 |
1194 | 2698 signed int result; // eax@1 |
2699 int v3; // ebx@1 | |
2700 char v4; // zf@1 | |
2701 int v5; // eax@3 | |
2702 int v6; // eax@4 | |
2703 int v7; // ecx@6 | |
2704 char *v8; // eax@6 | |
2705 int v9; // eax@10 | |
2706 int v10; // ecx@10 | |
2707 int v11; // eax@10 | |
2708 char v12; // ch@2@11 | |
2709 int v13; // ST00_4@12 | |
2710 unsigned __int16 v14; // ax@12 | |
2711 int v15; // eax@13 | |
2712 int v16; // ecx@13 | |
2713 int v17; // eax@13 | |
2714 char v18; // al@16 | |
2715 char v19; // ch@2@16 | |
2716 int v20; // ST00_4@19 | |
2717 unsigned __int16 v21; // ax@19 | |
2718 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3 | |
2719 stru273 v26; // [sp+1Ch] [bp-2Ch]@2 | |
2720 int v25; // [sp+2Ch] [bp-1Ch]@3 | |
2721 __int32 var18; // [sp+30h] [bp-18h]@3 | |
2722 int i; // [sp+34h] [bp-14h]@4 | |
2723 int v28; // [sp+38h] [bp-10h]@1 | |
2724 int hand_index; // [sp+3Ch] [bp-Ch]@3 | |
2725 int v30; // [sp+40h] [bp-8h]@1 | |
2726 char v31; // [sp+44h] [bp-4h]@12 | |
2727 char v32; // [sp+45h] [bp-3h]@12 | |
2728 char v33; // [sp+46h] [bp-2h]@12 | |
2729 | |
1679 | 2730 __debugbreak(); // need do fix rectangle not fit to card |
1200 | 2731 |
1194 | 2732 v30 = 0; |
2733 result = -1; | |
2734 //v3 = 188 * a1; | |
1200 | 2735 |
1194 | 2736 //v4 = LOBYTE(am_Players[a1].field_20) == 0; |
2737 v28 = -1; | |
1200 | 2738 if ( am_Players[player_num].IsHisTurn ) |
1194 | 2739 { |
0 | 2740 if ( v26._40DD2F() ) |
2741 { | |
1200 | 2742 v5 = GetPlayerHandCardCount(player_num); |
1194 | 2743 hand_index = 0; |
2744 v25 = v5; | |
2745 pXYZW.top = 327; | |
2746 pXYZW.bottom = 455; | |
2747 pXYZW.left = (640 - 96 * v5) / (v5 + 1); | |
2748 var18 = pXYZW.left + 96; | |
2749 pXYZW.right = pXYZW.left + 96; | |
2750 if ( v5 > 0 ) | |
0 | 2751 { |
1194 | 2752 // v6 = 47 * v1; |
1200 | 2753 // for ( i = player_num; ; v6 = i ) |
2754 for(;;) | |
1194 | 2755 { |
2756 v7 = v30; | |
2757 // v8 = &am_Players[0].cards_at_hand[v30 + v6]; | |
2758 | |
2759 for (v7=0; v7<10; ++v7) | |
2760 { | |
1200 | 2761 if (am_Players[player_num].cards_at_hand[v7]!= -1 ) |
1194 | 2762 break; |
2763 } | |
2764 //if ( *v8 ) | |
2765 // { | |
2766 // do | |
2767 // { | |
2768 // //v8 += 4; | |
2769 // ++v7; | |
2770 // } | |
2771 // while ( *v8 == -1 ); | |
2772 v30 = v7; | |
2773 // } | |
2774 if ( am_byte_4E185D ) | |
2775 { | |
2776 // v9 = v3 + 8 * v7; | |
1256 | 2777 v10 = am_Players[player_num].card_shift[v7].x;//*(am_player[0].arr_6C[0] + v9); |
2778 v11 = am_Players[player_num].card_shift[v7].y;//*(&am_player[0].arr_6C[0][1] + v9); | |
1194 | 2779 pXYZW.left += v10; |
2780 pXYZW.right += v10; | |
2781 pXYZW.top += v11; | |
2782 pXYZW.bottom += v11; | |
2783 } | |
2784 if (v26.Inside(&pXYZW) ) | |
2785 break; | |
2786 | |
2787 v13=0; | |
2788 v14 = R8G8B8_to_TargetFormat(v13); | |
2789 DrawRect(&pXYZW, v14, 0); | |
2790 pXYZW.left += var18; | |
2791 pXYZW.right += var18; | |
2792 if ( am_byte_4E185D ) | |
2793 { | |
1256 | 2794 v16 = am_Players[player_num].card_shift[v30].x;//*(am_player[0].arr_6C[0] + v15); |
2795 v17 = am_Players[player_num].card_shift[v30].y;//*(&am_player[0].arr_6C[0][1] + v15); | |
1194 | 2796 pXYZW.left -= v16; |
2797 pXYZW.right -= v16; | |
2798 pXYZW.top -= v17; | |
2799 pXYZW.bottom -= v17; | |
2800 } | |
2801 ++v30; | |
2802 ++hand_index; | |
2803 if ( hand_index >= v25 ) | |
2804 return v28; | |
2805 } | |
2806 v28 = hand_index; | |
1197 | 2807 v18 = CanCardBePlayed(player_num, hand_index); |
1194 | 2808 if ( v18 ) |
2809 { | |
2810 v20=0x00FFFFFF; | |
2811 } | |
2812 else | |
2813 { | |
2814 v20=0x000000FF; | |
2815 } | |
2816 | |
2817 v21 = R8G8B8_to_TargetFormat(v20); | |
2818 DrawRect(&pXYZW, v21, 0); | |
0 | 2819 } |
2820 } | |
1194 | 2821 result = v28; |
0 | 2822 } |
1194 | 2823 return result; |
2824 | |
2825 | |
0 | 2826 } |
2827 // 4E185D: using guessed type char am_byte_4E185D; | |
2828 | |
2829 //----- (0040BCFB) -------------------------------------------------------- | |
1256 | 2830 bool DiscardCard( int player_num, signed int card_slot_index ) |
1200 | 2831 { |
0 | 2832 int v2; // esi@2 |
2833 signed int v3; // edi@2 | |
2834 char *v4; // eax@2 | |
2835 int v5; // ecx@7 | |
2836 int v6; // ebx@7 | |
2837 int v7; // esi@8 | |
2838 int v8; // eax@8 | |
2839 int v9; // esi@8 | |
2840 int v10; // ecx@8 | |
2841 int v11; // eax@8 | |
2842 int v12; // eax@8 | |
2843 signed int v13; // edx@9 | |
2844 unsigned int v14; // eax@12 | |
2845 char result; // al@12 | |
1194 | 2846 int i; |
0 | 2847 |
1200 | 2848 if ( card_slot_index <= -1 ) |
1209 | 2849 return false; |
0 | 2850 v2 = 0; |
1194 | 2851 |
2852 for(i=0; i<10; ++i) | |
0 | 2853 { |
1200 | 2854 if ( am_Players[player_num].cards_at_hand[i] != -1 ) |
0 | 2855 { |
1200 | 2856 if ( card_slot_index == v2 ) |
0 | 2857 break; |
2858 ++v2; | |
2859 } | |
2860 } | |
1194 | 2861 |
1263 | 2862 if ( pCards[am_Players[player_num].cards_at_hand[i]].can_be_discarded) |
0 | 2863 { |
1209 | 2864 ArcomageGame::PlaySound(22); |
1197 | 2865 v8 = GetPlayerHandCardCount(current_player_num); |
1256 | 2866 v10=am_Players[player_num].card_shift[i].x + (640 - 96 * v8) / (v8 + 1); |
1209 | 2867 amuint_4FAA5C_blt_xy.x = v10; |
1256 | 2868 amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[i].y + 327;//v11; |
0 | 2869 v12 = 0; |
1209 | 2870 |
0 | 2871 if ( !am_byte_4FAA75 ) |
2872 { | |
1209 | 2873 for (v12=0; v12<10; ++v12) |
2874 { | |
2875 if (shown_cards[v12].uCardId== -1) | |
2876 break; | |
2877 } | |
0 | 2878 } |
2879 pArcomageGame->field_F6 = 1; | |
1209 | 2880 amuint_4FAA54_blt_xy.x = (shown_cards[v12].field_8.x - v10) / 10; |
2881 amuint_4FAA54_blt_xy.y = (shown_cards[v12].field_8.y - 327) / 10; | |
2882 uCardID = am_Players[player_num].cards_at_hand[i]; | |
2883 am_Players[player_num].cards_at_hand[i] = -1; | |
1263 | 2884 need_to_discard_card = 0; |
1209 | 2885 return true; |
0 | 2886 } |
2887 else | |
1209 | 2888 return false; |
0 | 2889 } |
1263 | 2890 |
0 | 2891 |
2892 //----- (0040BE0E) -------------------------------------------------------- | |
1679 | 2893 bool PlayCard( int player_num, int card_slot_num ) |
2894 { | |
0 | 2895 int v3; // ebp@1 |
2896 int v4; // ecx@2 | |
1183 | 2897 ArcomagePlayer *v5; // esi@2 |
1263 | 2898 int card_index; // edi@2 |
0 | 2899 int v7; // eax@2 |
2900 int v8; // ebx@8 | |
1263 | 2901 int cards_at_hand; // eax@8 |
0 | 2902 int v10; // ebx@8 |
2903 int v11; // ebp@8 | |
2904 int v12; // ecx@8 | |
2905 int v13; // eax@8 | |
1263 | 2906 ArcomageCard *pCard; // eax@8 |
0 | 2907 int v15; // ecx@8 |
2908 int v16; // ecx@8 | |
2909 | |
1197 | 2910 if ( card_slot_num <= -1 ) |
2911 return false; | |
1263 | 2912 |
0 | 2913 v4 = 0; |
1263 | 2914 for (card_index=0; card_index<10; ++card_index) |
0 | 2915 { |
1263 | 2916 if ( am_Players[player_num].cards_at_hand[card_index] != -1 ) |
0 | 2917 { |
1197 | 2918 if ( card_slot_num == v4 ) |
0 | 2919 break; |
2920 ++v4; | |
2921 } | |
2922 } | |
1209 | 2923 |
1263 | 2924 if (CanCardBePlayed(player_num, card_index) ) |
0 | 2925 { |
1209 | 2926 ArcomageGame::PlaySound(23); |
1263 | 2927 cards_at_hand = GetPlayerHandCardCount(current_player_num); |
0 | 2928 pArcomageGame->field_F6 = 1; |
1263 | 2929 v12 = am_Players[player_num].card_shift[card_index].x + |
2930 (640 - 96 * cards_at_hand) / (cards_at_hand + 1)+ | |
2931 96 * card_index ; | |
2932 | |
1185 | 2933 // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327; |
1218 | 2934 amuint_4FAA5C_blt_xy.x = v12;//v12; |
1263 | 2935 amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[card_index].y + 327;//v13; |
1209 | 2936 |
2937 amuint_4FAA54_blt_xy.x = (272 - v12) / 5; | |
2938 amuint_4FAA54_blt_xy.y = -30; | |
1200 | 2939 |
1263 | 2940 pCard = &pCards[am_Players[player_num].cards_at_hand[card_index]]; |
2941 am_Players[player_num].resource_bricks -= pCard->needed_bricks; | |
2942 am_Players[player_num].resource_beasts -= pCard->needed_beasts; | |
2943 am_Players[player_num].resource_gems -= pCard->needed_gems; | |
2944 played_card_id = am_Players[player_num].cards_at_hand[card_index]; | |
2945 am_Players[player_num].cards_at_hand[card_index] = -1; | |
2946 return true; | |
0 | 2947 } |
2948 else | |
1197 | 2949 return false; |
2950 | |
0 | 2951 } |
2952 | |
2953 //----- (0040BF15) -------------------------------------------------------- | |
1679 | 2954 bool CanCardBePlayed(int player_num, int hand_card_indx) |
2955 { | |
0 | 2956 bool result; // eax@1 |
1197 | 2957 ArcomageCard *test_card; // ecx@1 |
2958 ArcomagePlayer *pPlayer; // esi@1 | |
2959 | |
2960 pPlayer = &am_Players[player_num]; | |
1185 | 2961 result = true; |
1197 | 2962 test_card = &pCards[am_Players[player_num].cards_at_hand[hand_card_indx]]; |
2963 if ( test_card->needed_quarry_level > pPlayer->quarry_level ) | |
1185 | 2964 result = false; |
1197 | 2965 if ( test_card->needed_magic_level > pPlayer->magic_level ) |
1185 | 2966 result = false; |
1679 | 2967 if ( test_card->needed_zoo_level > pPlayer->zoo_level ) |
1185 | 2968 result = false; |
1197 | 2969 if ( test_card->needed_bricks > pPlayer->resource_bricks ) |
1185 | 2970 result = false; |
1197 | 2971 if ( test_card->needed_gems > pPlayer->resource_gems ) |
1185 | 2972 result = false; |
1197 | 2973 if ( test_card->needed_beasts > pPlayer->resource_beasts ) |
1185 | 2974 result = false; |
0 | 2975 return result; |
2976 } | |
2977 | |
2978 | |
2979 | |
2980 | |
2981 //----- (0040BF77) -------------------------------------------------------- | |
1218 | 2982 void ApplyCardToPlayer( int player_num, unsigned int uCardID ) |
2983 { | |
1245 | 2984 |
2985 | |
2986 #define APPLY_TO_PLAYER( PLAYER, ENEMY,FIELD, VAL, RES )\ | |
1246 | 2987 if (VAL != 0) {\ |
2988 if (VAL == 99) {\ | |
2989 if ( PLAYER->##FIELD < ENEMY->##FIELD ) {\ | |
2990 PLAYER->##FIELD = ENEMY->##FIELD;\ | |
2991 RES = ENEMY->##FIELD - PLAYER->##FIELD;\ | |
2992 }\ | |
2993 } else {\ | |
2994 PLAYER->##FIELD += (signed int)(VAL);\ | |
2995 if ( PLAYER->##FIELD<0 ) PLAYER->##FIELD= 0;\ | |
2996 RES = (signed int)(VAL);\ | |
1245 | 2997 }\ |
1246 | 2998 } |
1245 | 2999 |
3000 #define APPLY_TO_ENEMY( PLAYER, ENEMY,FIELD, VAL, RES ) APPLY_TO_PLAYER(ENEMY, PLAYER, FIELD, VAL, RES) | |
3001 | |
3002 #define APPLY_TO_BOTH( PLAYER, ENEMY, FIELD, VAL, RES_P, RES_E ) \ | |
1246 | 3003 if ( VAL != 0) {\ |
3004 if ( VAL == 99 ) { \ | |
1245 | 3005 if ( PLAYER->##FIELD != ENEMY->##FIELD ) { \ |
3006 if ( PLAYER->##FIELD <= ENEMY->##FIELD ) { \ | |
3007 PLAYER->##FIELD = ENEMY->##FIELD; \ | |
3008 RES_P = ENEMY->##FIELD - PLAYER->##FIELD; \ | |
3009 } else { \ | |
3010 ENEMY->##FIELD = PLAYER->##FIELD; \ | |
3011 RES_E = PLAYER->##FIELD - ENEMY->##FIELD; \ | |
3012 } \ | |
3013 }\ | |
1246 | 3014 } else { \ |
1245 | 3015 PLAYER->##FIELD += (signed int)(VAL);\ |
3016 ENEMY->##FIELD += (signed int)(VAL); if (PLAYER->##FIELD < 0 ) {PLAYER->##FIELD = 0;} \ | |
3017 if ( ENEMY->##FIELD < 0 ) {ENEMY->##FIELD = 0;} \ | |
1246 | 3018 RES_P = (signed int)(VAL); RES_E = (signed int)(VAL); \ |
3019 }\ | |
3020 } | |
1245 | 3021 ArcomagePlayer *player; // esi@1 |
3022 int v3; // eax@1 | |
3023 ArcomagePlayer *enemy; // edi@1 | |
3024 int v5; // eax@2 | |
3025 char v6; // sf@2 | |
3026 unsigned __int8 v7; // of@2 | |
3027 int v8; // eax@3 | |
3028 int v9; // eax@4 | |
3029 char v10; // zf@5 | |
3030 int v11; // eax@8 | |
3031 unsigned __int8 v12; // zf@8 | |
3032 char v13; // sf@8 | |
3033 unsigned __int8 v14; // of@8 | |
3034 int v15; // eax@9 | |
3035 int v16; // eax@10 | |
3036 char v17; // zf@12 | |
3037 char v18; // al@15 | |
3038 int v19; // eax@16 | |
3039 int v20; // eax@17 | |
3040 int v21; // eax@22 | |
3041 int v22; // eax@23 | |
3042 int v23; // eax@26 | |
3043 signed int v24; // ebx@26 | |
3044 int v103; | |
3045 int v104; | |
3046 | |
3047 POINT v184; // [sp+Ch] [bp-64h]@488 | |
3048 int enemy_num; // [sp+14h] [bp-5Ch]@1 | |
3049 ArcomageCard *pCard; // [sp+18h] [bp-58h]@1 | |
3050 int buildings_e; // [sp+1Ch] [bp-54h]@1 | |
3051 int buildings_p; // [sp+20h] [bp-50h]@1 | |
3052 int quarry_p; // [sp+28h] [bp-48h]@1 | |
3053 int dmg_e; // [sp+2Ch] [bp-44h]@1 | |
3054 int dmg_p; // [sp+30h] [bp-40h]@1 | |
3055 int bricks_p; // [sp+34h] [bp-3Ch]@1 | |
3056 int tower_e; // [sp+38h] [bp-38h]@1 | |
3057 int tower_p; // [sp+3Ch] [bp-34h]@1 | |
3058 int wall_e; // [sp+40h] [bp-30h]@1 | |
3059 int wall_p; // [sp+44h] [bp-2Ch]@1 | |
3060 int beasts_e; // [sp+48h] [bp-28h]@1 | |
3061 int beasts_p; // [sp+4Ch] [bp-24h]@1 | |
3062 int gems_e; // [sp+50h] [bp-20h]@1 | |
3063 int gems_p; // [sp+54h] [bp-1Ch]@1 | |
3064 int bricks_e; // [sp+58h] [bp-18h]@1 | |
3065 int zoo_e; // [sp+5Ch] [bp-14h]@1 | |
3066 int zoo_p; // [sp+60h] [bp-10h]@1 | |
3067 int magic_e; // [sp+64h] [bp-Ch]@1 | |
3068 int magic_p; // [sp+68h] [bp-8h]@1 | |
3069 int quarry_e; // [sp+6Ch] [bp-4h]@1 | |
3070 | |
1246 | 3071 quarry_p = 0; |
3072 magic_p = 0; | |
3073 zoo_p = 0; | |
3074 bricks_p = 0; | |
3075 gems_p = 0; | |
3076 beasts_p = 0; | |
3077 wall_p = 0; | |
3078 tower_p = 0; | |
1245 | 3079 buildings_p = 0; |
1246 | 3080 dmg_p = 0; |
3081 quarry_e = 0; | |
3082 magic_e = 0; | |
3083 zoo_e = 0; | |
3084 bricks_e = 0; | |
3085 gems_e = 0; | |
3086 beasts_e = 0; | |
3087 wall_e = 0; | |
3088 tower_e = 0; | |
1245 | 3089 buildings_e = 0; |
1246 | 3090 dmg_e = 0; |
1245 | 3091 |
3092 player = &am_Players[player_num]; | |
3093 pCard = &pCards[uCardID]; | |
3094 enemy_num = (player_num + 1) % 2; | |
3095 enemy = &am_Players[enemy_num]; | |
3096 switch ( pCard->compare_param ) | |
3097 { | |
3098 case 2: | |
3099 v5 = player->quarry_level; | |
3100 v7 = __OFSUB__(v5, enemy->quarry_level); | |
3101 v6 = v5 - enemy->quarry_level < 0; | |
1263 | 3102 v18 = v6 ^ v7; |
3103 goto LABEL_25; | |
1245 | 3104 case 3: |
3105 v8 = player->magic_level; | |
3106 v7 = __OFSUB__(v8, enemy->magic_level); | |
3107 v6 = v8 - enemy->magic_level < 0; | |
1263 | 3108 v18 = v6 ^ v7; |
3109 goto LABEL_25; | |
1245 | 3110 case 4: |
3111 v9 = player->zoo_level; | |
3112 v7 = __OFSUB__(v9, enemy->zoo_level); | |
3113 v6 = v9 - enemy->zoo_level < 0; | |
1263 | 3114 v18 = v6 ^ v7; |
3115 goto LABEL_25; | |
1245 | 3116 case 5: |
3117 v10 = player->quarry_level == enemy->quarry_level; | |
1263 | 3118 v18 = v10; |
3119 goto LABEL_25; | |
1245 | 3120 case 6: |
3121 v10 = player->magic_level == enemy->magic_level; | |
1263 | 3122 v18 = v10; |
3123 goto LABEL_25; | |
1245 | 3124 case 7: |
3125 v10 = player->zoo_level == enemy->zoo_level; | |
1263 | 3126 v18 = v10; |
3127 goto LABEL_25; | |
1245 | 3128 case 8: |
3129 v11 = player->quarry_level; | |
3130 v14 = __OFSUB__(v11, enemy->quarry_level); | |
3131 v12 = v11 == enemy->quarry_level; | |
3132 v13 = v11 - enemy->quarry_level < 0; | |
1263 | 3133 v18 = !((v13 ^ v14) | v12); |
3134 goto LABEL_25; | |
1245 | 3135 case 9: |
3136 v15 = player->magic_level; | |
3137 v14 = __OFSUB__(v15, enemy->magic_level); | |
3138 v12 = v15 == enemy->magic_level; | |
3139 v13 = v15 - enemy->magic_level < 0; | |
1263 | 3140 v18 = !((v13 ^ v14) | v12); |
3141 goto LABEL_25; | |
1245 | 3142 case 10: |
3143 v16 = player->zoo_level; | |
3144 v14 = __OFSUB__(v16, enemy->zoo_level); | |
3145 v12 = v16 == enemy->zoo_level; | |
3146 v13 = v16 - enemy->zoo_level < 0; | |
1263 | 3147 v18 = !((v13 ^ v14) | v12); |
3148 goto LABEL_25; | |
1245 | 3149 case 11: |
3150 v10 = player->wall_height == 0; | |
1263 | 3151 v18 = v10; |
3152 goto LABEL_25; | |
1245 | 3153 case 12: |
3154 v17 = player->wall_height == 0; | |
1263 | 3155 v18 = !v17; |
3156 goto LABEL_25; | |
1245 | 3157 case 13: |
3158 v10 = enemy->wall_height == 0; | |
1263 | 3159 v18 = v10; |
3160 goto LABEL_25; | |
1245 | 3161 case 14: |
3162 v17 = enemy->wall_height == 0; | |
3163 v18 = !v17; | |
3164 goto LABEL_25; | |
3165 case 15: | |
3166 v19 = player->wall_height; | |
3167 v7 = __OFSUB__(v19, enemy->wall_height); | |
3168 v6 = v19 - enemy->wall_height < 0; | |
1263 | 3169 v18 = v6 ^ v7; |
3170 goto LABEL_25; | |
1245 | 3171 case 16: |
3172 v20 = player->tower_height; | |
3173 v7 = __OFSUB__(v20, enemy->tower_height); | |
3174 v6 = v20 - enemy->tower_height < 0; | |
3175 v18 = v6 ^ v7; | |
3176 goto LABEL_25; | |
3177 case 17: | |
3178 v10 = player->wall_height == enemy->wall_height; | |
1263 | 3179 v18 = v10; |
3180 goto LABEL_25; | |
1245 | 3181 case 18: |
3182 v10 = player->tower_height == enemy->tower_height; | |
3183 v18 = v10; | |
3184 goto LABEL_25; | |
3185 case 19: | |
3186 v21 = player->wall_height; | |
3187 v14 = __OFSUB__(v21, enemy->wall_height); | |
3188 v12 = v21 == enemy->wall_height; | |
3189 v13 = v21 - enemy->wall_height < 0; | |
1263 | 3190 v18 = !((v13 ^ v14) | v12); |
3191 goto LABEL_25; | |
1245 | 3192 case 20: |
3193 v22 = player->tower_height; | |
3194 v14 = __OFSUB__(v22, enemy->tower_height); | |
3195 v12 = v22 == enemy->tower_height; | |
3196 v13 = v22 - enemy->tower_height < 0; | |
3197 v18 = !((v13 ^ v14) | v12); | |
3198 LABEL_25: | |
3199 if ( v18 ) | |
3200 goto LABEL_26; | |
3201 goto LABEL_231; | |
3202 default: | |
3203 LABEL_26: | |
1263 | 3204 v23 = pCard->draw_extra_card_count; |
1245 | 3205 v24 = 0; |
3206 dword_4FAA68 = v23 + (pCard->field_30 == 1); | |
3207 dword_4FAA64 = v23; | |
3208 if ( v23 > 0 ) | |
3209 { | |
3210 do | |
3211 { | |
3212 GetNextCardFromDeck(player_num); | |
3213 ++v24; | |
3214 } | |
1263 | 3215 while ( v24 < pCard->draw_extra_card_count ); |
1245 | 3216 } |
3217 | |
1263 | 3218 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
1245 | 3219 |
3220 | |
3221 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl, quarry_p); | |
3222 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl, magic_p); | |
3223 APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl, zoo_p); | |
3224 APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks, bricks_p); | |
3225 APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems, gems_p); | |
3226 APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts, beasts_p); | |
1246 | 3227 if ( pCard->to_player_buildings ) |
1245 | 3228 { |
1246 | 3229 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings); |
3230 buildings_p = (signed int)pCard->to_player_buildings - dmg_p; | |
1245 | 3231 } |
1246 | 3232 APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall, wall_p); |
3233 APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower, tower_p); | |
1245 | 3234 |
3235 APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl, quarry_e); | |
3236 APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl, magic_e); | |
3237 APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl, zoo_e); | |
3238 APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks, bricks_e); | |
3239 APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems, gems_e); | |
3240 APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts, beasts_e); | |
3241 if ( pCard->to_enemy_buildings ) | |
3242 { | |
1246 | 3243 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings); |
3244 buildings_e = (signed int)pCard->to_enemy_buildings - dmg_e; | |
1245 | 3245 } |
3246 APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall, wall_e); | |
3247 APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower, tower_e); | |
3248 | |
3249 APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl, quarry_p, quarry_e); | |
3250 APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl, magic_p, magic_e); | |
3251 APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl, zoo_p, zoo_e); | |
3252 APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks, bricks_p, bricks_e); | |
3253 APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems, gems_p, gems_e); | |
3254 APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts, beasts_p, beasts_e); | |
3255 if ( pCard->to_pl_enm_buildings ) | |
3256 { | |
1246 | 3257 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings); |
3258 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings); | |
3259 buildings_p = (signed int)pCard->to_pl_enm_buildings - dmg_p; | |
3260 buildings_e = (signed int)pCard->to_pl_enm_buildings - dmg_e; | |
1245 | 3261 } |
3262 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall, wall_p, wall_e); | |
3263 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower, tower_p, tower_e); | |
3264 break; | |
3265 case 0: | |
3266 LABEL_231: | |
3267 v103 = pCard->can_draw_extra_card2; | |
3268 v104 = 0; | |
3269 dword_4FAA68 = v103 + (pCard->field_4D == 1); | |
3270 dword_4FAA64 = v103; | |
3271 if ( v103 > 0 ) | |
3272 { | |
3273 do | |
3274 { | |
3275 GetNextCardFromDeck(player_num); | |
3276 ++v104; | |
3277 } | |
3278 while ( v104 < pCard->can_draw_extra_card2 ); | |
3279 } | |
3280 | |
1263 | 3281 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
1245 | 3282 |
3283 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl2, quarry_p); | |
3284 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl2, magic_p); | |
3285 APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl2, zoo_p); | |
3286 APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks2, bricks_p); | |
3287 APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems2, gems_p); | |
3288 APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts2, beasts_p); | |
3289 if ( pCard->to_player_buildings2 ) | |
3290 { | |
1246 | 3291 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings2); |
3292 buildings_p = (signed int)pCard->to_player_buildings2 - dmg_p; | |
1245 | 3293 } |
3294 APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall2, wall_p); | |
3295 APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower2, tower_p); | |
3296 | |
3297 APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl2, quarry_e); | |
3298 APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl2, magic_e); | |
3299 APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl2, zoo_e); | |
3300 APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks2, bricks_e); | |
3301 APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems2, gems_e); | |
3302 APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts2, beasts_e); | |
3303 if ( pCard->to_enemy_buildings2 ) | |
3304 { | |
1246 | 3305 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings2); |
3306 buildings_e = (signed int)pCard->to_enemy_buildings2 - dmg_e; | |
1245 | 3307 } |
3308 APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall2, wall_e); | |
3309 APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower2, tower_e); | |
3310 | |
3311 APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl2, quarry_p, quarry_e); | |
3312 APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl2, magic_p, magic_e); | |
3313 APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl2, zoo_p, zoo_e); | |
3314 APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks2, bricks_p, bricks_e); | |
3315 APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems2, gems_p, gems_e); | |
3316 APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts2, beasts_p, beasts_e); | |
3317 | |
3318 if ( pCard->to_pl_enm_buildings2 ) | |
3319 { | |
1246 | 3320 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings2); |
3321 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings2); | |
3322 buildings_p = (signed int)pCard->to_pl_enm_buildings2 - dmg_p; | |
3323 buildings_e = (signed int)pCard->to_pl_enm_buildings2 - dmg_e; | |
1245 | 3324 } |
3325 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall2, wall_p, wall_e); | |
3326 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower2, tower_p, tower_e); | |
3327 break; | |
3328 } | |
3329 // } | |
3330 if ( quarry_p > 0 || quarry_e > 0 ) | |
3331 pArcomageGame->PlaySound(30); | |
3332 if ( quarry_p < 0 || quarry_e < 0 ) | |
3333 pArcomageGame->PlaySound(31); | |
3334 if ( magic_p > 0 || magic_e > 0 ) | |
3335 pArcomageGame->PlaySound(33); | |
3336 if ( magic_p < 0 || magic_e < 0 ) | |
3337 pArcomageGame->PlaySound(34); | |
3338 if ( zoo_p > 0 || zoo_e > 0 ) | |
3339 pArcomageGame->PlaySound(36); | |
3340 if ( zoo_p < 0 || zoo_e < 0 ) | |
3341 pArcomageGame->PlaySound(37); | |
3342 if ( bricks_p > 0 || bricks_e > 0 ) | |
3343 pArcomageGame->PlaySound(39); | |
3344 if ( bricks_p < 0 || bricks_e < 0 ) | |
3345 pArcomageGame->PlaySound(40); | |
3346 if ( gems_p > 0 || gems_e > 0 ) | |
3347 pArcomageGame->PlaySound(42); | |
3348 if ( gems_p < 0 || gems_e < 0 ) | |
3349 pArcomageGame->PlaySound(43); | |
3350 if ( beasts_p > 0 || beasts_e > 0 ) | |
3351 pArcomageGame->PlaySound(45u); | |
3352 if ( beasts_p < 0 || beasts_e < 0 ) | |
3353 pArcomageGame->PlaySound(46); | |
3354 if ( buildings_p || buildings_e || dmg_p || dmg_e ) | |
3355 pArcomageGame->PlaySound(48); | |
3356 if ( wall_p > 0 || wall_e > 0 ) | |
3357 pArcomageGame->PlaySound(49); | |
3358 if ( wall_p < 0 || wall_e < 0 ) | |
3359 pArcomageGame->PlaySound(50); | |
3360 if ( tower_p > 0 || tower_e > 0 ) | |
3361 pArcomageGame->PlaySound(52); | |
3362 if ( tower_p < 0 || tower_e < 0 ) | |
3363 pArcomageGame->PlaySound(53); | |
3364 if ( player_num ) | |
3365 { | |
3366 if ( quarry_p ) | |
3367 { | |
3368 v184.x = 573; | |
3369 v184.y = 92; | |
3370 am_40D2B4(&v184, quarry_p); | |
3371 } | |
3372 if ( quarry_e ) | |
3373 { | |
3374 v184.x = 26; | |
3375 v184.y = 92; | |
3376 am_40D2B4(&v184, quarry_e); | |
3377 } | |
3378 if ( magic_p ) | |
3379 { | |
3380 v184.x = 573; | |
3381 v184.y = 164; | |
3382 am_40D2B4(&v184, magic_p); | |
3383 } | |
3384 if ( magic_e ) | |
3385 { | |
3386 v184.x = 26; | |
3387 v184.y = 164; | |
3388 am_40D2B4(&v184, magic_e); | |
3389 } | |
3390 if ( zoo_p ) | |
3391 { | |
3392 v184.x = 573; | |
3393 v184.y = 236; | |
3394 am_40D2B4(&v184, zoo_p); | |
3395 } | |
3396 if ( zoo_e ) | |
3397 { | |
3398 v184.x = 26; | |
3399 v184.y = 236; | |
3400 am_40D2B4(&v184, zoo_e); | |
3401 } | |
3402 if ( bricks_p ) | |
3403 { | |
3404 v184.x = 563; | |
3405 v184.y = 114; | |
3406 am_40D2B4(&v184, bricks_p); | |
3407 } | |
3408 if ( bricks_e ) | |
3409 { | |
3410 v184.x = 16; | |
3411 v184.y = 114; | |
3412 am_40D2B4(&v184, bricks_e); | |
3413 } | |
3414 if ( gems_p ) | |
3415 { | |
3416 v184.x = 563; | |
3417 v184.y = 186; | |
3418 am_40D2B4(&v184, gems_p); | |
3419 } | |
3420 if ( gems_e ) | |
3421 { | |
3422 v184.x = 16; | |
3423 v184.y = 186; | |
3424 am_40D2B4(&v184, gems_e); | |
3425 } | |
3426 if ( beasts_p ) | |
3427 { | |
3428 v184.x = 563; | |
3429 v184.y = 258; | |
3430 am_40D2B4(&v184, beasts_p); | |
3431 } | |
3432 if ( beasts_e ) | |
3433 { | |
3434 v184.x = 16; | |
3435 v184.y = 258; | |
3436 am_40D2B4(&v184, beasts_e); | |
3437 } | |
3438 if ( wall_p ) | |
3439 { | |
3440 v184.x = 442; | |
3441 v184.y = 296; | |
3442 am_40D2B4(&v184, wall_p); | |
3443 } | |
3444 if ( wall_e ) | |
3445 { | |
3446 v184.x = 180; | |
3447 v184.y = 296; | |
3448 am_40D2B4(&v184, wall_e); | |
3449 } | |
3450 if ( tower_p ) | |
3451 { | |
3452 v184.x = 514; | |
3453 v184.y = 296; | |
3454 am_40D2B4(&v184, tower_p); | |
3455 } | |
3456 if ( tower_e ) | |
3457 { | |
3458 v184.x = 122; | |
3459 v184.y = 296; | |
3460 am_40D2B4(&v184, tower_e); | |
3461 } | |
3462 if ( dmg_p ) | |
3463 { | |
3464 v184.x = 442; | |
3465 v184.y = 296; | |
3466 am_40D2B4(&v184, dmg_p); | |
3467 } | |
3468 if ( buildings_p ) | |
3469 { | |
3470 v184.x = 514; | |
3471 v184.y = 296; | |
3472 am_40D2B4(&v184, buildings_p); | |
3473 } | |
3474 if ( dmg_e ) | |
3475 { | |
3476 v184.x = 180; | |
3477 v184.y = 296; | |
3478 am_40D2B4(&v184, dmg_e); | |
3479 } | |
3480 if ( buildings_e ) | |
3481 { | |
3482 v184.x = 122; | |
3483 v184.y = 296; | |
3484 am_40D2B4(&v184, buildings_e); | |
3485 } | |
3486 } | |
3487 else | |
3488 { | |
3489 if ( quarry_p ) | |
3490 { | |
3491 v184.x = 26; | |
3492 v184.y = 92; | |
3493 am_40D2B4(&v184, quarry_p); | |
3494 } | |
3495 if ( quarry_e ) | |
3496 { | |
3497 v184.x = 573; | |
3498 v184.y = 92; | |
3499 am_40D2B4(&v184, quarry_e); | |
3500 } | |
3501 if ( magic_p ) | |
3502 { | |
3503 v184.x = 26; | |
3504 v184.y = 164; | |
3505 am_40D2B4(&v184, magic_p); | |
3506 } | |
3507 if ( magic_e ) | |
3508 { | |
3509 v184.x = 573; | |
3510 v184.y = 164; | |
3511 am_40D2B4(&v184, magic_e); | |
3512 } | |
3513 if ( zoo_p ) | |
3514 { | |
3515 v184.x = 26; | |
3516 v184.y = 236; | |
3517 am_40D2B4(&v184, zoo_p); | |
3518 } | |
3519 if ( zoo_e ) | |
3520 { | |
3521 v184.x = 573; | |
3522 v184.y = 236; | |
3523 am_40D2B4(&v184, zoo_e); | |
3524 } | |
3525 if ( bricks_p ) | |
3526 { | |
3527 v184.x = 16; | |
3528 v184.y = 114; | |
3529 am_40D2B4(&v184, bricks_p); | |
3530 } | |
3531 if ( bricks_e ) | |
3532 { | |
3533 v184.x = 563; | |
3534 v184.y = 114; | |
3535 am_40D2B4(&v184, bricks_e); | |
3536 } | |
3537 if ( gems_p ) | |
3538 { | |
3539 v184.x = 16; | |
3540 v184.y = 186; | |
3541 am_40D2B4(&v184, gems_p); | |
3542 } | |
3543 if ( gems_e ) | |
3544 { | |
3545 v184.x = 563; | |
3546 v184.y = 186; | |
3547 am_40D2B4(&v184, gems_e); | |
3548 } | |
3549 if ( beasts_p ) | |
3550 { | |
3551 v184.x = 16; | |
3552 v184.y = 258; | |
3553 am_40D2B4(&v184, beasts_p); | |
3554 } | |
3555 if ( beasts_e ) | |
3556 { | |
3557 v184.x = 563; | |
3558 v184.y = 258; | |
3559 am_40D2B4(&v184, beasts_e); | |
3560 } | |
3561 if ( wall_p ) | |
3562 { | |
3563 v184.x = 180; | |
3564 v184.y = 296; | |
3565 am_40D2B4(&v184, wall_p); | |
3566 } | |
3567 if ( wall_e ) | |
3568 { | |
3569 v184.x = 442; | |
3570 v184.y = 296; | |
3571 am_40D2B4(&v184, wall_e); | |
3572 } | |
3573 if ( tower_p ) | |
3574 { | |
3575 v184.x = 122; | |
3576 v184.y = 296; | |
3577 am_40D2B4(&v184, tower_p); | |
3578 } | |
3579 if ( tower_e ) | |
3580 { | |
3581 v184.x = 514; | |
3582 v184.y = 296; | |
3583 am_40D2B4(&v184, tower_e); | |
3584 } | |
3585 if ( dmg_p ) | |
3586 { | |
3587 v184.x = 180; | |
3588 v184.y = 296; | |
3589 am_40D2B4(&v184, dmg_p); | |
3590 } | |
3591 if ( buildings_p ) | |
3592 { | |
3593 v184.x = 122; | |
3594 v184.y = 296; | |
3595 am_40D2B4(&v184, buildings_p); | |
3596 } | |
3597 if ( dmg_e ) | |
3598 { | |
3599 v184.x = 442; | |
3600 v184.y = 296; | |
3601 am_40D2B4(&v184, dmg_e); | |
3602 } | |
3603 if ( buildings_e ) | |
3604 { | |
3605 v184.x = 514; | |
3606 v184.y = 296; | |
3607 am_40D2B4(&v184, buildings_e); | |
3608 } | |
3609 } | |
3610 #undef APPLY_TO_BOTH | |
3611 #undef APPLY_TO_ENEMY | |
3612 #undef APPLY_TO_PLAYER | |
3613 | |
0 | 3614 } |
3615 | |
3616 | |
3617 | |
3618 | |
3619 //----- (0040D2B4) -------------------------------------------------------- | |
1263 | 3620 int am_40D2B4( POINT* startXY, int effect_value ) |
1185 | 3621 { |
0 | 3622 int v2; // ebp@1 |
1185 | 3623 POINT *v3; // edi@1 |
0 | 3624 int result; // eax@3 |
1194 | 3625 int v6; |
0 | 3626 stru272_stru0 *v8; // ecx@12 |
3627 signed int v11; // [sp+10h] [bp-8h]@1 | |
1194 | 3628 |
0 | 3629 |
3630 v11 = 0; | |
1263 | 3631 v2 = effect_value; |
3632 | |
3633 while ( array_4FABD0[v11].have_effect ) | |
1185 | 3634 { |
3635 result = array_4FABD0[v11].field_40->_40E2A7(); | |
3636 if ( !result ) | |
3637 { | |
1263 | 3638 array_4FABD0[v11].have_effect = 0; |
1185 | 3639 --v11; |
3640 } | |
3641 ++v11; | |
3642 if ( v11 >= 10 ) | |
3643 return result; | |
3644 } | |
3645 v6 = v11; | |
1263 | 3646 array_4FABD0[v11].have_effect = 1; |
3647 if ( effect_value <= 0 ) | |
1185 | 3648 { |
1263 | 3649 array_4FABD0[v6].effect_sign = 0; |
3650 effect_value = -effect_value; | |
1185 | 3651 } |
0 | 3652 else |
1185 | 3653 { |
1263 | 3654 array_4FABD0[v6].effect_sign = 1; |
1185 | 3655 } |
1263 | 3656 array_4FABD0[v6].field_4.effect_area.left = startXY->x - 20; |
3657 array_4FABD0[v6].field_4.effect_area.right = startXY->x + 20; | |
3658 array_4FABD0[v6].field_4.effect_area.top = startXY->y - 20; | |
3659 array_4FABD0[v6].field_4.effect_area.bottom = startXY->y + 20; | |
1186 | 3660 array_4FABD0[v6].field_4.field_10 = -60; |
3661 array_4FABD0[v6].field_4.field_14 = 60; | |
3662 array_4FABD0[v6].field_4.field_18 = 180; | |
3663 array_4FABD0[v6].field_4.field_1Cf = 0.5; | |
3664 array_4FABD0[v6].field_4.field_20 = 150; | |
3665 array_4FABD0[v6].field_4.field_24f= 50.0; | |
3666 array_4FABD0[v6].field_4.field_28f = 3.0; | |
3667 array_4FABD0[v6].field_4.field_2Cf = 8.0; | |
3668 array_4FABD0[v6].field_4.field_30 = 5; | |
3669 array_4FABD0[v6].field_4.field_34 = 15; | |
1263 | 3670 array_4FABD0[v6].field_4.sparks_array = &array_4FABD0[v6].effect_sparks[0]; |
1185 | 3671 v8 = array_4FABD0[v6].field_40; |
1263 | 3672 v8->StartFill(&array_4FABD0[v6].field_4); |
3673 if ( 10 * effect_value > 150 ) | |
3674 effect_value = 15; | |
1185 | 3675 |
1184 | 3676 if ( v8->signature != SIG_trpg ) |
0 | 3677 return 2; |
3678 if ( !v8->field_59 ) | |
3679 return 3; | |
1263 | 3680 v8->position_in_sparks_arr = 10 * effect_value; |
0 | 3681 v8->field_30 = 0.0; |
3682 v8->field_58 = 0; | |
3683 v8->field_44 = 0; | |
3684 v8->field_4C = 0; | |
3685 v8->field_48 = 0; | |
3686 v8->field_50 = 0; | |
1185 | 3687 for (int i=0; i<v8->field_4; ++i) |
1263 | 3688 v8->field_54[i].have_spark=0; |
0 | 3689 return 0; |
3690 } | |
1185 | 3691 |
0 | 3692 |
3693 //----- (0040D402) -------------------------------------------------------- | |
1246 | 3694 int ApplyDamageToBuildings( int player_num, int damage ) |
1218 | 3695 { |
1183 | 3696 ArcomagePlayer *v2; // ecx@1 |
0 | 3697 int v3; // esi@1 |
3698 int result; // eax@3 | |
3699 | |
1218 | 3700 |
3701 v3 = am_Players[player_num].wall_height; | |
0 | 3702 if ( v3 <= 0 ) |
3703 { | |
3704 result = 0; | |
3705 } | |
3706 else | |
3707 { | |
1218 | 3708 if ( v3 >= -damage ) |
0 | 3709 { |
1218 | 3710 result = damage; |
3711 am_Players[player_num].wall_height += damage; | |
1209 | 3712 |
0 | 3713 } |
1209 | 3714 else |
3715 { | |
1218 | 3716 damage += v3; |
0 | 3717 result = -v3; |
1218 | 3718 am_Players[player_num].wall_height = 0; |
3719 am_Players[player_num].tower_height += damage; | |
1209 | 3720 } |
0 | 3721 } |
1209 | 3722 |
1218 | 3723 if ( am_Players[player_num].tower_height < 0 ) |
3724 am_Players[player_num].tower_height = 0; | |
0 | 3725 return result; |
3726 } | |
3727 // 40D402: using guessed type int __fastcall am_40D402(uint, uint); | |
3728 | |
3729 //----- (0040D444) -------------------------------------------------------- | |
1218 | 3730 void GameResultsApply() |
3731 { | |
0 | 3732 int v0; // esi@1 |
3733 int v1; // edi@1 | |
3734 int v2; // eax@1 | |
3735 int v3; // eax@23 | |
3736 int v4; // edx@25 | |
3737 int v5; // ecx@28 | |
3738 int v6; // eax@28 | |
3739 GUIWindow *v7; // ecx@50 | |
3740 signed int v8; // eax@50 | |
1218 | 3741 char v9; // eax@52 |
0 | 3742 signed int v10; // eax@54 |
3743 char *v11; // esi@59 | |
3744 char *v12; // esi@65 | |
3745 signed int v14; // [sp-4h] [bp-58h]@46 | |
3746 char pText[64]; // [sp+Ch] [bp-48h]@1 | |
1218 | 3747 POINT xy; // [sp+4Ch] [bp-8h]@1 |
0 | 3748 |
3749 v0 = -1; | |
3750 v1 = -1; | |
3751 //nullsub_1(); | |
1218 | 3752 xy.x = 0; |
3753 xy.y = 0; | |
3754 strcpy(pText, "The Winner is: ");//"Ïîáåäè" | |
3755 // v2 = 0; | |
3756 xy.y = 160; | |
3757 xy.x = 320; //- 12 * v2 / 2; | |
1679 | 3758 // am_DrawText(-1, pText, xy); |
1197 | 3759 if ( am_Players[0].tower_height < max_tower_height ) |
0 | 3760 { |
1197 | 3761 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 3762 goto LABEL_10; |
3763 v0 = 2; | |
3764 } | |
3765 else | |
3766 { | |
1197 | 3767 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 3768 { |
3769 v0 = 1; | |
3770 } | |
3771 else | |
3772 { | |
1197 | 3773 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 3774 { |
3775 v0 = 0; | |
3776 v1 = 4; | |
3777 goto LABEL_10; | |
3778 } | |
1197 | 3779 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 3780 } |
3781 } | |
3782 v1 = 0; | |
3783 LABEL_10: | |
1197 | 3784 if ( am_Players[0].tower_height <= 0 ) |
0 | 3785 { |
1197 | 3786 if ( am_Players[1].tower_height > 0 ) |
0 | 3787 { |
3788 v0 = 2; | |
3789 } | |
3790 else | |
3791 { | |
1197 | 3792 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 3793 { |
3794 LABEL_20: | |
1197 | 3795 if ( am_Players[0].wall_height == am_Players[1].wall_height ) |
0 | 3796 { |
3797 v0 = 0; | |
3798 v1 = 4; | |
3799 } | |
3800 else | |
3801 { | |
1197 | 3802 v0 = (am_Players[0].wall_height <= am_Players[1].wall_height) + 1; |
0 | 3803 v1 = 1; |
3804 } | |
3805 goto LABEL_23; | |
3806 } | |
1197 | 3807 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 3808 } |
3809 goto LABEL_17; | |
3810 } | |
1197 | 3811 if ( am_Players[1].tower_height <= 0 ) |
0 | 3812 { |
3813 v0 = 1; | |
3814 LABEL_17: | |
3815 v1 = 2; | |
3816 } | |
3817 if ( !v0 && v1 == 4 ) | |
3818 goto LABEL_20; | |
3819 LABEL_23: | |
1197 | 3820 v3 = am_Players[0].resource_bricks; |
3821 if ( am_Players[0].resource_bricks <= am_Players[0].resource_gems ) | |
0 | 3822 { |
1197 | 3823 v3 = am_Players[0].resource_beasts; |
3824 v4 = am_Players[0].resource_gems; | |
3825 if ( am_Players[0].resource_gems > am_Players[0].resource_beasts ) | |
0 | 3826 goto LABEL_28; |
3827 } | |
3828 else | |
3829 { | |
1197 | 3830 if ( am_Players[0].resource_bricks <= am_Players[0].resource_beasts ) |
0 | 3831 { |
1197 | 3832 v4 = am_Players[0].resource_beasts; |
0 | 3833 goto LABEL_28; |
3834 } | |
3835 } | |
3836 v4 = v3; | |
3837 LABEL_28: | |
1197 | 3838 v5 = am_Players[1].resource_bricks; |
3839 v6 = am_Players[1].resource_gems; | |
3840 if ( am_Players[1].resource_bricks <= am_Players[1].resource_gems ) | |
0 | 3841 { |
1197 | 3842 v5 = am_Players[1].resource_beasts; |
3843 if ( am_Players[1].resource_gems > am_Players[1].resource_beasts ) | |
0 | 3844 goto LABEL_33; |
3845 goto LABEL_32; | |
3846 } | |
1197 | 3847 v6 = am_Players[1].resource_beasts; |
3848 if ( am_Players[1].resource_bricks > am_Players[1].resource_beasts ) | |
0 | 3849 LABEL_32: |
3850 v6 = v5; | |
3851 LABEL_33: | |
3852 if ( v0 == -1 ) | |
3853 { | |
3854 if ( v1 != -1 ) | |
3855 goto LABEL_49; | |
1197 | 3856 if ( v4 < max_resources_amount ) |
0 | 3857 { |
1197 | 3858 if ( v6 < max_resources_amount ) |
0 | 3859 goto LABEL_49; |
3860 v0 = 2; | |
3861 } | |
3862 else | |
3863 { | |
1197 | 3864 if ( v6 < max_resources_amount ) |
0 | 3865 { |
3866 v0 = 1; | |
3867 } | |
3868 else | |
3869 { | |
3870 if ( v4 == v6 ) | |
3871 goto LABEL_46; | |
3872 v0 = (v4 <= v6) + 1; | |
3873 } | |
3874 } | |
3875 v1 = 3; | |
3876 } | |
3877 if ( !v0 && v1 == 4 ) | |
3878 { | |
3879 if ( v4 != v6 ) | |
3880 { | |
3881 v14 = 5; | |
3882 v0 = (v4 <= v6) + 1; | |
3883 goto LABEL_48; | |
3884 } | |
3885 LABEL_46: | |
3886 v0 = 0; | |
3887 v14 = 4; | |
3888 LABEL_48: | |
3889 v1 = v14; | |
3890 } | |
3891 LABEL_49: | |
3892 pArcomageGame->field_B0 = v1; | |
3893 pArcomageGame->uGameResult = v0; | |
3894 if ( v0 == 1 ) | |
3895 { | |
1218 | 3896 |
1197 | 3897 v8 = (signed int)window_SpeakInHouse->par1C; |
1218 | 3898 if (( v8 >= 108 )&&( v8 <= 120 )) |
0 | 3899 { |
1218 | 3900 if ( !pParty->pArcomageWins[v8-108] ) |
0 | 3901 { |
1218 | 3902 pParty->pArcomageWins[v8-108] = 1; |
3903 auto _a = (signed int)(p2DEvents[ window_SpeakInHouse->par1C - 1].fPriceMultiplier * 100.0); | |
0 | 3904 party_finds_gold(_a, 0); |
3905 } | |
1218 | 3906 |
0 | 3907 } |
3908 v10 = 108; | |
3909 do | |
3910 { | |
1218 | 3911 if ( !pParty->pArcomageWins[v10-108] ) |
0 | 3912 break; |
3913 ++v10; | |
3914 } | |
3915 while ( v10 <= 120 ); | |
1218 | 3916 |
0 | 3917 if ( v10 == 121 ) |
484 | 3918 _449B7E_toggle_bit(pParty->_quest_bits, 238, 1u); |
1218 | 3919 |
3920 | |
3921 for (int i=0; i<4; ++i ) | |
0 | 3922 { |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1393
diff
changeset
|
3923 v11 = (char *)&pParty->pPlayers[i]._achieved_awards_bits; |
0 | 3924 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v11, 1) ) |
949 | 3925 _449B7E_toggle_bit((unsigned char *)v11, PLAYER_GUILD_BITS__ARCOMAGE_WIN, 1); |
1218 | 3926 |
0 | 3927 } |
1218 | 3928 |
949 | 3929 ++pParty->uNumArcomageWins; |
3930 if ( pParty->uNumArcomageWins > 1000000 ) | |
3931 pParty->uNumArcomageWins = 1000000; | |
0 | 3932 } |
3933 else | |
3934 { | |
1218 | 3935 for (int i=0; i<4; ++i ) |
3936 { | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1393
diff
changeset
|
3937 v12 = (char *)&pParty->pPlayers[i]._achieved_awards_bits; |
0 | 3938 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v12, 1) ) |
949 | 3939 _449B7E_toggle_bit((unsigned char *)v12, PLAYER_GUILD_BITS__ARCOMAGE_LOSE, 1); |
0 | 3940 } |
1218 | 3941 |
949 | 3942 ++pParty->uNumArcomageLoses; |
3943 if ( pParty->uNumArcomageLoses > 1000000 ) | |
3944 pParty->uNumArcomageLoses = 1000000; | |
0 | 3945 } |
3946 } | |
3947 | |
3948 | |
3949 | |
3950 //----- (00409C8B) -------------------------------------------------------- | |
1197 | 3951 void PrepareArcomage() |
3952 { | |
0 | 3953 signed __int64 v1; // qax@4 |
3954 int v2; // esi@4 | |
1183 | 3955 int v3; // esi@5 |
0 | 3956 signed int v4; // edi@5 |
3957 int v6; // edx@9 | |
1183 | 3958 RECT pXYZW; // [sp+8h] [bp-1Ch]@5 |
3959 POINT pXY; // [sp+18h] [bp-Ch]@5 | |
0 | 3960 |
3961 pAudioPlayer->StopChannels(-1, -1); | |
1201 | 3962 strcpy(pArcomageGame->pPlayer1Name, Player1Name); |
3963 strcpy(pArcomageGame->pPlayer2Name, Player2Name); | |
0 | 3964 am_byte_4FAA76 = 0; |
3965 am_byte_4FAA75 = 0; | |
1183 | 3966 |
3967 for (int i=0; i<10; ++i) | |
3968 { | |
3969 v2 = (i+1) % 4; | |
3970 v3 = (i+1) / 4; | |
1200 | 3971 shown_cards[i].uCardId = -1; |
3972 shown_cards[i].field_4 = 0; | |
3973 shown_cards[i].field_8.x = 100 * v2 + 120; | |
3974 shown_cards[i].field_8.y = 138 * v3 + 18; | |
3975 shown_cards[i].field_10_xplus = -100 * v2 / 5; | |
3976 shown_cards[i].field_14_y_plus = -138 * v3 / 5; | |
3977 shown_cards[i].field_18_point.x = shown_cards[i].field_8.x; | |
3978 shown_cards[i].field_18_point.y = shown_cards[i].field_8.y; | |
1183 | 3979 } |
3980 | |
3981 pXY.x = 0; | |
3982 pXY.y = 0; | |
0 | 3983 ArcomageGame::LoadBackground(); |
1183 | 3984 pXYZW.left = 0; |
3985 pXYZW.right = 640; | |
3986 pXYZW.top = 0; | |
3987 pXYZW.bottom = 480; | |
0 | 3988 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1183 | 3989 Blt_Copy(&pXYZW, &pXY, 2); |
0 | 3990 am_EndScene(); |
3991 pRenderer->Present(); | |
3992 ArcomageGame::LoadSprites(); | |
1679 | 3993 pRenderer->Present(); |
1183 | 3994 |
0 | 3995 v4 = 120; |
1183 | 3996 for (int i=0; i<12; ++i) |
3997 am_sounds[i] = pSoundList->LoadSound(v4++, 0); | |
3998 | |
1184 | 3999 for (int i=0; i<10; ++i) |
1679 | 4000 array_4FABD0[i].field_40 = stru272_stru0::New(); |
1184 | 4001 |
1200 | 4002 current_card_slot_index = -1; |
0 | 4003 amuint_4FAA4C = -1; |
4004 byte_4FAA74 = 0; | |
4005 pArcomageGame->field_F4 = 0; | |
1679 | 4006 am_gameover = false; |
0 | 4007 byte_505880 = 0; |
4008 dword_4FAA70 = 0; | |
1263 | 4009 need_to_discard_card = 0; |
1197 | 4010 SetStartGameData(); |
1200 | 4011 InitalHandsFill(); |
0 | 4012 //nullsub_1(); |
1197 | 4013 pArcomageGame->GameOver = 0; |
1183 | 4014 pArcomageGame->pfntComic = pFontComic; |
4015 pArcomageGame->pfntArrus = pFontArrus; | |
0 | 4016 } |
4017 | |
4018 | |
4019 //----- (0040D711) -------------------------------------------------------- | |
4020 ArcomageGame::ArcomageGame() | |
4021 { | |
1183 | 4022 field_4 = 0; |
0 | 4023 //RGBTexture::RGBTexture(&this->pGameBackground); |
4024 //RGBTexture::RGBTexture(&v1->pSprites); | |
1183 | 4025 bGameInProgress = 0; |
4026 field_F9 = 0; | |
0 | 4027 } |
938 | 4028 |
4029 | |
4030 //----- (00409BE8) -------------------------------------------------------- | |
1197 | 4031 void SetStartConditions() |
938 | 4032 { |
1256 | 4033 const ArcomageStartConditions *st_cond; // eax@1 |
1185 | 4034 |
1200 | 4035 st_cond = &start_conditions[window_SpeakInHouse->par1C - 108]; |
4036 start_tower_height = st_cond->tower_height; | |
4037 start_wall_height = st_cond->wall_height; | |
4038 start_quarry_level = st_cond->quarry_level - 1; | |
4039 start_magic_level = st_cond->magic_level - 1; | |
4040 start_zoo_level = st_cond->zoo_level - 1; | |
4041 minimum_cards_at_hand = 5; | |
1197 | 4042 quarry_bonus = 1; |
4043 magic_bonus = 1; | |
1201 | 4044 zoo_bonus = 1; |
1200 | 4045 max_tower_height = st_cond->max_tower; |
4046 max_resources_amount = st_cond->max_resources; | |
4047 | |
1256 | 4048 opponent_mastery = st_cond->mastery_lvl; |
1200 | 4049 |
4050 start_bricks_amount = st_cond->bricks_amount; | |
4051 start_gems_amount = st_cond->gems_amount; | |
4052 start_beasts_amount = st_cond->beasts_amount; | |
1185 | 4053 |
1183 | 4054 } |
4055 | |
4056 | |
4057 //----- (0040D75D) -------------------------------------------------------- | |
1679 | 4058 void am_DrawText( int a1, const char *pText, POINT *pXY ) |
1183 | 4059 { |
1256 | 4060 pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - ((pFontComic->uFontHeight - 3) >> 1) + 3, 0, pText, 0, 0, 0); |
1183 | 4061 } |
4062 | |
4063 | |
4064 //----- (0040DB27) -------------------------------------------------------- | |
1263 | 4065 void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill ) |
1183 | 4066 { |
1185 | 4067 RECT *v3; // esi@1 |
1183 | 4068 |
4069 v3 = pXYZW; | |
4070 pRenderer->BeginScene(); | |
4071 pRenderer->SetRasterClipRect(0, 0, 639u, 479u); | |
4072 if ( bSolidFill ) | |
4073 { | |
1185 | 4074 for ( int i = v3->top; i <= v3->bottom; ++i ) |
4075 pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor); | |
1183 | 4076 } |
4077 else | |
4078 { | |
1185 | 4079 pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor); |
4080 pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor); | |
4081 pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor); | |
4082 pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor); | |
1183 | 4083 } |
4084 pRenderer->EndScene(); | |
4085 } | |
4086 | |
1679 | 4087 void DrawSquare( POINT *pTargetXY, unsigned __int16 uColor ) |
1263 | 4088 { |
4089 pRenderer->BeginScene(); | |
4090 if ( pRenderer->uNumSceneBegins ) | |
4091 { | |
4092 int xVal = pTargetXY->x; | |
4093 int yVal = pTargetXY->y; | |
4094 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | |
4095 { | |
4096 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
4097 pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
4098 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor; | |
4099 pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor; | |
4100 } | |
4101 pRenderer->EndScene(); | |
4102 } | |
4103 } | |
1185 | 4104 |
4105 //----- (0040DBD3) -------------------------------------------------------- | |
1679 | 4106 void DrawPixel( POINT *pTargetXY, unsigned __int16 uColor ) |
1185 | 4107 { |
4108 pRenderer->BeginScene(); | |
4109 if ( pRenderer->uNumSceneBegins ) | |
4110 { | |
4111 int xVal = pTargetXY->x; | |
4112 int yVal = pTargetXY->y; | |
4113 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | |
4114 { | |
4115 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
4116 } | |
4117 pRenderer->EndScene(); | |
4118 } | |
4119 } | |
4120 | |
4121 | |
1183 | 4122 //----- (0040DDB1) -------------------------------------------------------- |
1263 | 4123 int rand_interval( int min, int max ) |
1183 | 4124 { |
1263 | 4125 return min + rand() % (max - min + 1); |
1183 | 4126 } |
4127 | |
4128 | |
4129 //----- (0040DEC8) -------------------------------------------------------- | |
1679 | 4130 void __fastcall am_IntToString(int val, char *pOut) |
1183 | 4131 { |
1679 | 4132 sprintfex(pOut, "%d", val); |
1183 | 4133 } |
1303 | 4134 |
4135 void set_stru1_field_8_InArcomage(int inValue) | |
4136 { | |
4137 switch(inValue) | |
4138 { | |
4139 case 91:LOBYTE(pArcomageGame->stru1.field_8) = 123;break; | |
4140 case 92:LOBYTE(pArcomageGame->stru1.field_8) = 124;break; | |
4141 case 93:LOBYTE(pArcomageGame->stru1.field_8) = 125;break; | |
4142 case 96:LOBYTE(pArcomageGame->stru1.field_8) = 126;break; | |
4143 case 61:LOBYTE(pArcomageGame->stru1.field_8) = 43;break; | |
4144 case 55:LOBYTE(pArcomageGame->stru1.field_8) = 38;break; | |
4145 case 56:LOBYTE(pArcomageGame->stru1.field_8) = 42;break; | |
4146 case 57:LOBYTE(pArcomageGame->stru1.field_8) = 40;break; | |
4147 case 59:LOBYTE(pArcomageGame->stru1.field_8) = 58;break; | |
4148 case 54:LOBYTE(pArcomageGame->stru1.field_8) = 94;break; | |
4149 case 50:LOBYTE(pArcomageGame->stru1.field_8) = 64;break; | |
4150 case 51:LOBYTE(pArcomageGame->stru1.field_8) = 35;break; | |
4151 case 52:LOBYTE(pArcomageGame->stru1.field_8) = 36;break; | |
4152 case 53:LOBYTE(pArcomageGame->stru1.field_8) = 37;break; | |
4153 case 49:LOBYTE(pArcomageGame->stru1.field_8) = 33;break; | |
4154 case 39:LOBYTE(pArcomageGame->stru1.field_8) = 34;break; | |
4155 case 44:LOBYTE(pArcomageGame->stru1.field_8) = 60;break; | |
4156 case 46:LOBYTE(pArcomageGame->stru1.field_8) = 62;break; | |
4157 case 47:LOBYTE(pArcomageGame->stru1.field_8) = 63;break; | |
4158 case 48:LOBYTE(pArcomageGame->stru1.field_8) = 41;break; | |
4159 default:LOBYTE(pArcomageGame->stru1.field_8) = inValue;break; | |
4160 } | |
4161 } |