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