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