Mercurial > mm7
annotate Arcomage.cpp @ 1460:ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
author | Gloval |
---|---|
date | Wed, 21 Aug 2013 20:58:36 +0400 |
parents | 28f87f5234a1 |
children | 845907a747d3 |
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); | |
61 void __thiscall am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb | |
62 void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4); | |
63 void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3); | |
64 void __cdecl am_EndScene(); | |
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 // v2 = retzero_sub_40DFA7((int)dword_4FAA28); |
1276 // v1 = 1000; | |
1277 // dword_4FAA70 = v2 / 1000; | |
1278 dword_4FAA70 = 0; | |
0 | 1279 } |
1280 else | |
1281 { | |
1282 dword_4FAA70 = -1; | |
1283 } | |
1284 pVideoPlayer->BinkUpdatePalette(dword_4FAA28); | |
1183 | 1285 |
1184 | 1286 for(int i=0; i<10; ++i) |
1287 { | |
1200 | 1288 array_4FABD0[i].field_40->Empty(1,1); |
1289 array_4FABD0[i].field_40->Dtor(); | |
1184 | 1290 } |
1038 | 1291 |
0 | 1292 pArcomageGame->pGameBackground.Release(); |
1293 pArcomageGame->pSprites.Release(); | |
1294 pArcomageGame->bGameInProgress = 0; | |
1295 viewparams->bRedrawGameUI = 1; | |
1296 if ( pVideoPlayer->AnyMovieLoaded() ) | |
1297 pVideoPlayer->_4BF5B2(); | |
1183 | 1298 for(int i=0; i<12; ++i) |
1299 pSoundList->UnloadSound(am_sounds[i], 1); | |
1300 | |
0 | 1301 } |
938 | 1302 |
1303 | |
1304 | |
0 | 1305 |
1306 //----- (00409FE9) -------------------------------------------------------- | |
1197 | 1307 void SetStartGameData() |
1185 | 1308 { |
1194 | 1309 |
1310 signed int j; // edx@7 | |
1311 int card_id_counter; // edx@13 | |
1312 signed int i; // ecx@13 | |
1313 signed int card_dispenser_counter; // eax@13 | |
0 | 1314 |
1197 | 1315 current_player_num = dword_505890; |
1316 SetStartConditions(); | |
1194 | 1317 for(i=0; i<2; ++i ) |
0 | 1318 { |
1194 | 1319 if ( i ) |
0 | 1320 { |
1194 | 1321 strcpy(am_Players[1].pPlayerName, pArcomageGame->pPlayer2Name); |
0 | 1322 if ( byte_4E185C ) |
1197 | 1323 am_Players[1].IsHisTurn = 0; |
0 | 1324 else |
1197 | 1325 am_Players[1].IsHisTurn = 1; |
0 | 1326 } |
1327 else | |
1328 { | |
1194 | 1329 strcpy(am_Players[0].pPlayerName, pArcomageGame->pPlayer1Name); |
1197 | 1330 am_Players[0].IsHisTurn = 1; |
0 | 1331 } |
1200 | 1332 am_Players[i].tower_height = start_tower_height; |
1333 am_Players[i].wall_height = start_wall_height; | |
1334 am_Players[i].quarry_level = start_quarry_level; | |
1335 am_Players[i].magic_level = start_magic_level; | |
1336 am_Players[i].zoo_level = start_zoo_level; | |
1197 | 1337 am_Players[i].resource_bricks = start_bricks_amount; |
1338 am_Players[i].resource_gems = start_gems_amount; | |
1339 am_Players[i].resource_beasts = start_beasts_amount; | |
1194 | 1340 |
1341 for (j=0; j<10; ++j ) | |
0 | 1342 { |
1194 | 1343 am_Players[i].cards_at_hand[j] = -1; |
0 | 1344 if ( am_byte_4E185D ) |
1345 { | |
1256 | 1346 am_Players[i].card_shift[j].x = -1; |
1347 am_Players[i].card_shift[j].y = -1; | |
0 | 1348 } |
1349 else | |
1350 { | |
1256 | 1351 am_Players[i].card_shift[j].x = 0; |
1352 am_Players[i].card_shift[j].y = 0; | |
0 | 1353 } |
1263 | 1354 } |
0 | 1355 } |
1194 | 1356 strcpy(deckMaster.name, pDeckMaster); |
1357 for (i=0, card_dispenser_counter=-2, card_id_counter=0; i<DECK_SIZE; ++i, ++card_dispenser_counter) | |
1185 | 1358 { |
1194 | 1359 deckMaster.cardsInUse[i] = 0; |
1360 deckMaster.cards_IDs[i] =card_id_counter; | |
1361 switch ( card_dispenser_counter ) | |
1185 | 1362 { |
0 | 1363 case 0: |
1364 case 2: | |
1365 case 6: | |
1366 case 9: | |
1367 case 13: | |
1368 case 18: | |
1369 case 23: | |
1370 case 33: | |
1371 case 36: | |
1372 case 38: | |
1373 case 44: | |
1374 case 46: | |
1375 case 52: | |
1376 case 57: | |
1377 case 69: | |
1378 case 71: | |
1379 case 75: | |
1380 case 79: | |
1381 case 81: | |
1382 case 84: | |
1383 case 89: | |
1185 | 1384 break; |
1385 default: | |
1194 | 1386 ++card_id_counter; |
1185 | 1387 } |
1388 } | |
1389 | |
1197 | 1390 FillPlayerDeck(); |
0 | 1391 } |
1392 | |
1393 //----- (0040A198) -------------------------------------------------------- | |
1197 | 1394 void FillPlayerDeck() |
1194 | 1395 { |
1263 | 1396 signed int m; |
1397 int rand_deck_pos; | |
1398 char card_taken_flags[DECK_SIZE]; | |
1194 | 1399 int i,j; |
0 | 1400 |
1218 | 1401 ArcomageGame::PlaySound(20); |
1194 | 1402 memset(deckMaster.cardsInUse, 0,DECK_SIZE ); |
1403 memset(card_taken_flags, 0, DECK_SIZE); | |
1404 | |
1405 for (i=0; i<2; ++i) | |
0 | 1406 { |
1194 | 1407 for (j=0; j<10; ++j) |
0 | 1408 { |
1194 | 1409 if ( am_Players[i].cards_at_hand[j] > -1 ) |
0 | 1410 { |
1263 | 1411 for (m = 0; m<DECK_SIZE; ++m) |
1194 | 1412 { |
1263 | 1413 if (deckMaster.cards_IDs[m] == am_Players[i].cards_at_hand[j] && deckMaster.cardsInUse[m] == 0) |
1194 | 1414 { |
1263 | 1415 deckMaster.cardsInUse[m] = 1; |
1194 | 1416 break; |
1417 } | |
1418 } | |
0 | 1419 } |
1420 } | |
1421 } | |
1194 | 1422 |
1423 for (i=0; i<DECK_SIZE; ++i) | |
0 | 1424 { |
1425 do | |
1263 | 1426 rand_deck_pos = rand() % DECK_SIZE; |
1427 while (card_taken_flags[rand_deck_pos] == 1 ); | |
1428 | |
1429 card_taken_flags[rand_deck_pos]=1; | |
1430 playDeck.cards_IDs[i] = deckMaster.cards_IDs[rand_deck_pos]; | |
1431 playDeck.cardsInUse[i] = deckMaster.cardsInUse[rand_deck_pos]; | |
0 | 1432 } |
1194 | 1433 |
1200 | 1434 deck_walk_index = 0; |
0 | 1435 amuint_4FABC4 = -1; |
1436 pArcomageGame->field_F6 = 1; | |
1194 | 1437 |
0 | 1438 } |
1439 | |
1440 //----- (0040A255) -------------------------------------------------------- | |
1200 | 1441 void InitalHandsFill() |
1183 | 1442 { |
1200 | 1443 for (int i = 0; i < minimum_cards_at_hand; ++i ) |
0 | 1444 { |
1200 | 1445 GetNextCardFromDeck(0); |
1446 GetNextCardFromDeck(1); | |
0 | 1447 } |
1448 pArcomageGame->field_F6 = 1; | |
1183 | 1449 |
0 | 1450 } |
1451 // 4E1874: using guessed type int dword_4E1874; | |
1452 | |
1453 //----- (0040A283) -------------------------------------------------------- | |
1200 | 1454 void GetNextCardFromDeck( int player_num ) |
1183 | 1455 { |
1200 | 1456 signed int deck_index; // eax@1 |
1457 int new_card_id; // edi@1 | |
1458 signed int card_slot_indx; // eax@7 | |
1459 | |
1460 deck_index = deck_walk_index; | |
1461 for(;;) | |
0 | 1462 { |
1200 | 1463 if ( deck_index >= DECK_SIZE ) |
0 | 1464 { |
1197 | 1465 FillPlayerDeck(); |
1200 | 1466 deck_index = deck_walk_index; |
0 | 1467 } |
1200 | 1468 if ( !playDeck.cardsInUse[deck_index] ) |
1186 | 1469 { |
1200 | 1470 new_card_id = playDeck.cards_IDs[deck_index]; |
1471 ++deck_index; | |
1472 deck_walk_index = deck_index; | |
1473 break; | |
1186 | 1474 } |
1200 | 1475 ++deck_index; |
1476 deck_walk_index = deck_index; | |
0 | 1477 } |
1200 | 1478 |
1197 | 1479 ArcomageGame::PlaySound(21); |
1200 | 1480 card_slot_indx = GetEmptyCardSlotIndex(player_num); |
1481 if ( card_slot_indx != -1 ) | |
0 | 1482 { |
1200 | 1483 amuint_4FAA4C = card_slot_indx; |
1484 am_Players[player_num].cards_at_hand[card_slot_indx] = new_card_id; | |
1256 | 1485 am_Players[player_num].card_shift[card_slot_indx].x = rand_interval(-4, 4); |
1486 am_Players[player_num].card_shift[card_slot_indx].y = rand_interval(-4, 4); | |
0 | 1487 pArcomageGame->field_F6 = 1; |
1488 byte_4FAA2D = 1; | |
1489 } | |
1183 | 1490 |
0 | 1491 } |
1186 | 1492 |
0 | 1493 |
1494 //----- (0040A324) -------------------------------------------------------- | |
1185 | 1495 int GetEmptyCardSlotIndex( int player_num ) |
1496 { | |
1497 int i; | |
1498 for (i=0; i<10; ++i ) | |
1499 { | |
1500 if (am_Players[player_num].cards_at_hand[i]==-1) | |
1501 break; | |
1502 } | |
1503 if ( i >= 10 ) | |
1504 return -1; | |
1505 else | |
1506 return i; | |
0 | 1507 } |
1508 | |
1509 //----- (0040A346) -------------------------------------------------------- | |
1197 | 1510 void IncreaseResourcesInTurn( int player_num ) |
1185 | 1511 { |
1197 | 1512 am_Players[player_num].resource_bricks += quarry_bonus + am_Players[player_num].quarry_level; |
1513 am_Players[player_num].resource_gems += magic_bonus + am_Players[player_num].magic_level; | |
1263 | 1514 am_Players[player_num].resource_beasts += zoo_bonus + am_Players[player_num].zoo_level; |
0 | 1515 } |
1183 | 1516 |
0 | 1517 |
1518 //----- (0040A383) -------------------------------------------------------- | |
1256 | 1519 void TurnChange() |
1520 { | |
1263 | 1521 |
1522 char player_name[64]; // [sp+4h] [bp-64h]@4 | |
1523 // RECT v6; // [sp+44h] [bp-24h]@6 | |
1194 | 1524 |
0 | 1525 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7 |
1194 | 1526 POINT v11; // [sp+60h] [bp-8h]@4 |
0 | 1527 |
1528 if ( !pArcomageGame->field_F4 ) | |
1529 { | |
1197 | 1530 if ( am_Players[0].IsHisTurn != 1 || am_Players[1].IsHisTurn != 1 ) |
0 | 1531 { |
1197 | 1532 ++current_player_num; |
0 | 1533 am_byte_4FAA75 = 1; |
1197 | 1534 if ( current_player_num >= 2 ) |
1535 current_player_num = 0; | |
0 | 1536 } |
1537 else | |
1538 { | |
1539 //nullsub_1(); | |
1218 | 1540 // v11.x = 0; |
1541 // v11.y = 0; | |
1263 | 1542 strcpy(player_name,"The Next Player is: ");//"Ñëåä" |
1218 | 1543 // v0 = 0; |
1194 | 1544 v11.y = 200; |
1218 | 1545 v11.x = 320; // - 12 * v0 / 2; |
1263 | 1546 pPrimaryWindow_draws_text(-1, player_name, &v11); |
0 | 1547 am_byte_4FAA75 = 1; |
1263 | 1548 ++current_player_num; |
1549 if ( current_player_num >= 2 ) | |
1197 | 1550 current_player_num = 0; |
1263 | 1551 strcpy(player_name, am_Players[current_player_num].pPlayerName); |
1218 | 1552 // v4 = 0; |
1194 | 1553 v11.y = 260; |
1218 | 1554 v11.x = 320;// - 12 * v4 / 2; |
1263 | 1555 pPrimaryWindow_draws_text(-1, player_name, &v11); |
1197 | 1556 /* v6.left = 0; |
1194 | 1557 v6.right = 640; |
1558 v6.top = 0; | |
1197 | 1559 v6.bottom = 480;*/ |
0 | 1560 //nullsub_1(); |
1561 CallRenderPresent(); | |
1562 //nullsub_1(); | |
1563 while ( 1 ) | |
1263 | 1564 { |
0 | 1565 while ( !ArcomageGame::MsgLoop(20, &v10) ) |
1566 ; | |
1263 | 1567 if ( v10.field_0 == 1 ) |
1568 { | |
1569 if ( v10.field_4 ) | |
1570 break; | |
1571 //nullsub_1(); | |
1572 continue; | |
1573 } | |
1574 if (( v10.field_0 > 4 )&& ( v10.field_0 <= 8 )) | |
1575 break; | |
1576 if ( v10.field_0 == 10 ) | |
1577 { | |
1578 pArcomageGame->field_F4 = 1; | |
1579 byte_4FAA74 = 1; | |
1580 break; | |
1581 } | |
0 | 1582 } |
1197 | 1583 /* v11.x = 0; |
1194 | 1584 v11.y = 0; |
1585 v6.left = 0; | |
1586 v6.right = 640; | |
1587 v6.top = 0; | |
1197 | 1588 v6.bottom = 480;*/ |
0 | 1589 //nullsub_1(); |
1590 CallRenderPresent(); | |
1591 } | |
1592 } | |
1593 } | |
1594 | |
1595 | |
1596 //----- (0040A514) -------------------------------------------------------- | |
1197 | 1597 bool IsGameOver() |
1183 | 1598 { |
0 | 1599 bool result; // eax@1 |
1183 | 1600 |
1601 result = false; | |
1602 for(int i=0; i<2; ++i) | |
0 | 1603 { |
1197 | 1604 if ( am_Players[i].tower_height <= 0 ) |
1605 result = true; | |
1606 if ( am_Players[i].tower_height >= max_tower_height ) | |
1183 | 1607 result = true; |
1197 | 1608 if ( am_Players[i].resource_bricks >= max_resources_amount |
1609 || am_Players[i].resource_gems >= max_resources_amount | |
1610 || am_Players[i].resource_beasts >= max_resources_amount ) | |
1183 | 1611 result = true; |
0 | 1612 } |
1183 | 1613 |
0 | 1614 if ( result ) |
1615 byte_4FAA2C = 1; | |
1616 return result; | |
1617 } | |
1197 | 1618 |
0 | 1619 |
1620 //----- (0040A560) -------------------------------------------------------- | |
1256 | 1621 char PlayerTurn( int player_num ) |
1622 { | |
0 | 1623 int v1; // ebp@0 |
1624 unsigned __int64 v2; // qax@3 | |
1625 unsigned __int64 v3; // kr00_8@3 | |
1218 | 1626 |
0 | 1627 int v5; // esi@67 |
1628 char Dest[100]; // [sp+8h] [bp-A8h]@67 | |
1629 int v8; // [sp+6Ch] [bp-44h]@3 | |
1194 | 1630 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75 |
0 | 1631 int v10[4]; // [sp+80h] [bp-30h]@69 |
1194 | 1632 POINT pTargetXY; // [sp+90h] [bp-20h]@75 |
0 | 1633 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8 |
1263 | 1634 int animation_stage; // [sp+A4h] [bp-Ch]@1 |
0 | 1635 char v15; // [sp+AEh] [bp-2h]@63 |
1263 | 1636 bool break_loop; // [sp+AFh] [bp-1h]@1 |
0 | 1637 |
1638 uCardID = -1; | |
1263 | 1639 break_loop = false; |
1640 animation_stage = 20; | |
0 | 1641 byte_4FAA00 = 0; |
1642 dword_4FAA68 = 0; | |
1643 amuint_4FAA38 = 10; | |
1644 amuint_4FAA34 = 5; | |
1645 if ( amuint_4FAA4C != -1 ) | |
1646 byte_4FAA2D = 1; | |
1647 do | |
1648 { | |
1194 | 1649 |
0 | 1650 do |
1651 { | |
1194 | 1652 v3 = pEventTimer->Time() - pArcomageGame->event_timer_time; |
0 | 1653 } |
1194 | 1654 while (v3 < 6); |
1655 | |
1246 | 1656 pArcomageGame->event_timer_time = (unsigned int )pEventTimer->Time(); |
0 | 1657 if ( pArcomageGame->field_F4 ) |
1263 | 1658 break_loop = 1; |
0 | 1659 ArcomageGame::MsgLoop(0, &a2); |
1660 switch ( a2.field_0 ) | |
1661 { | |
1662 case 2: | |
1663 if ( a2.field_4 == 129 && a2.field_8 == 1 ) | |
1664 { | |
1665 pAudioPlayer->StopChannels(-1, -1); | |
1666 dword_4FAA68 = 0; | |
1263 | 1667 break_loop = true; |
1185 | 1668 pArcomageGame->field_F4 = 1; |
0 | 1669 } |
1670 break; | |
1671 case 9: | |
1672 pArcomageGame->field_F6 = 1; | |
1673 break; | |
1194 | 1674 case 10: |
0 | 1675 pAudioPlayer->StopChannels(-1, -1); |
1676 byte_4FAA74 = 1; | |
1263 | 1677 break_loop = true; |
0 | 1678 pArcomageGame->field_F4 = 1; |
1679 break; | |
1680 } | |
1218 | 1681 |
1263 | 1682 if (am_Players[current_player_num].IsHisTurn != 1 && |
1683 !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D ) | |
0 | 1684 { |
1685 if ( am_byte_4FAA75 ) | |
1686 am_byte_4FAA76 = 1; | |
1256 | 1687 OpponentsAITurn(current_player_num); |
0 | 1688 byte_4FAA2E = 1; |
1689 } | |
1690 if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 ) | |
1691 amuint_4FAA38 = 10; | |
1218 | 1692 if ( byte_4FAA2E || byte_4FAA2D ||am_Players[current_player_num].IsHisTurn != 1 ) |
0 | 1693 { |
1694 pArcomageGame->field_F6 = 1; | |
1695 if ( byte_4FAA2D ) | |
1696 { | |
1697 --amuint_4FAA38; | |
1698 if ( amuint_4FAA38 < 0 ) | |
1699 { | |
1700 byte_4FAA2D = 0; | |
1701 amuint_4FAA38 = 10; | |
1263 | 1702 break_loop = false; |
0 | 1703 } |
1704 } | |
1705 if ( byte_4FAA2E ) | |
1706 { | |
1263 | 1707 --animation_stage; |
1708 if ( animation_stage < 0 ) | |
0 | 1709 { |
1710 if ( dword_4FAA68 > 1 ) | |
1711 { | |
1712 --dword_4FAA68; | |
1713 byte_4FAA00 = 0; | |
1714 } | |
1715 else | |
1716 { | |
1263 | 1717 break_loop = true; |
0 | 1718 } |
1719 byte_4FAA2E = 0; | |
1263 | 1720 animation_stage = 20; |
0 | 1721 } |
1722 } | |
1723 } | |
1724 else | |
1725 { | |
1263 | 1726 if ( need_to_discard_card ) |
0 | 1727 { |
1256 | 1728 if ( a2.field_0 == 7 && DiscardCard(player_num, current_card_slot_index) ) |
0 | 1729 { |
1730 if ( am_byte_4FAA75 ) | |
1731 am_byte_4FAA76 = 1; | |
1732 if ( dword_4FAA64 > 0 ) | |
1733 { | |
1734 --dword_4FAA64; | |
1263 | 1735 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
0 | 1736 } |
1737 byte_4FAA2E = 1; | |
1738 } | |
1256 | 1739 if ( a2.field_0 == 8 && DiscardCard(player_num, current_card_slot_index) ) |
0 | 1740 { |
1741 if ( am_byte_4FAA75 ) | |
1742 am_byte_4FAA76 = 1; | |
1743 if ( dword_4FAA64 > 0 ) | |
1744 { | |
1745 --dword_4FAA64; | |
1263 | 1746 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
0 | 1747 } |
1748 byte_4FAA2E = 1; | |
1749 } | |
1750 } | |
1751 else | |
1752 { | |
1753 if ( a2.field_0 == 7 ) | |
1754 { | |
1200 | 1755 if ( PlayCard(player_num, current_card_slot_index) ) |
0 | 1756 { |
1757 byte_4FAA2E = 1; | |
1758 if ( am_byte_4FAA75 ) | |
1759 am_byte_4FAA76 = 1; | |
1760 } | |
1761 } | |
1762 if ( a2.field_0 == 8 ) | |
1763 { | |
1256 | 1764 if ( DiscardCard(player_num, current_card_slot_index) ) |
0 | 1765 { |
1766 byte_4FAA2E = 1; | |
1767 if ( am_byte_4FAA75 ) | |
1768 am_byte_4FAA76 = 1; | |
1769 } | |
1770 } | |
1771 } | |
1772 } | |
1773 //nullsub_1(); | |
1218 | 1774 //if ( false ) |
1775 //{ | |
1776 // if ( !v15 ) | |
1777 // { | |
1778 // //nullsub_1(); | |
1779 // v15 = 1; | |
1780 // } | |
1781 //} | |
1782 //else | |
1783 //{ | |
1784 // v15 = 0; | |
1785 // } | |
1786 //if ( false ) | |
1787 //{ | |
1788 // //nullsub_1(); | |
1789 // //nullsub_1(); | |
1790 // // assert(false && "Invalid strcpy params"); | |
1791 // // inv_strcpy(nullptr, Dest); | |
1792 // v5 = 0;//unk::const_0(&unk_4E19FC, 0); | |
1793 // //nullsub_1(); | |
1794 // if ( v5 == 1 ) | |
1795 // { | |
1796 // pAudioPlayer->StopChannels(-1, -1); | |
1797 // v16 = 1; | |
1798 // pArcomageGame->field_F4 = 1; | |
1799 // dword_4FAA68 = 0; | |
1800 // } | |
1801 // /*v10[0] = 0; | |
1802 // v10[2] = 640; | |
1803 // v10[1] = 0; | |
1804 // v10[3] = 480;*/ | |
1805 // //nullsub_1(); | |
1806 //} | |
1209 | 1807 if ( dword_4FABB8 != DrawCardsRectangles(player_num) ) |
0 | 1808 { |
1263 | 1809 dword_4FABB8 = DrawCardsRectangles(player_num); |
1810 pArcomageGame->field_F6 = 1; | |
1209 | 1811 } |
0 | 1812 if ( pArcomageGame->field_F6 ) |
1813 { | |
1263 | 1814 DrawGameUI(animation_stage); |
0 | 1815 DoBlt_Copy(pArcomageGame->pBackgroundPixels); |
1816 pArcomageGame->field_F6 = 0; | |
1817 } | |
1818 if ( pArcomageGame->field_F9 ) | |
1819 { | |
1194 | 1820 pTargetXY.x = 0; |
1821 pTargetXY.y = 0; | |
1822 pSrcXYZW.left = 0; | |
1823 pSrcXYZW.right = 640; | |
1824 pSrcXYZW.top = 0; | |
1825 pSrcXYZW.bottom = 480; | |
0 | 1826 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1194 | 1827 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
0 | 1828 am_EndScene(); |
1263 | 1829 DrawGameUI(animation_stage); |
0 | 1830 pRenderer->Present(); |
1831 pArcomageGame->field_F9 = 0; | |
1832 } | |
1833 } | |
1263 | 1834 while ( !break_loop ); |
0 | 1835 return dword_4FAA68 > 0; |
1836 } | |
1194 | 1837 |
0 | 1838 |
1839 //----- (0040A9AF) -------------------------------------------------------- | |
1263 | 1840 void DrawGameUI( int animation_stage ) |
1185 | 1841 { |
1842 | |
0 | 1843 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1197 | 1844 DrawRectanglesForText(); |
0 | 1845 am_EndScene(); |
1197 | 1846 |
0 | 1847 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1209 | 1848 DrawCards(); |
1197 | 1849 DrawPlayersTowers(); |
1850 DrawPlayersWall(); | |
1851 DrawPlayersText(); | |
0 | 1852 am_EndScene(); |
1197 | 1853 |
0 | 1854 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1263 | 1855 DrawCardAnimation(animation_stage); |
1185 | 1856 |
1857 for( int i=0; i<10; ++i) | |
1858 { | |
1263 | 1859 if (array_4FABD0[i].have_effect) |
1860 array_4FABD0[i].field_40->DrawEffect(); | |
1185 | 1861 } |
1200 | 1862 current_card_slot_index = DrawCardsRectangles(current_player_num); |
1263 | 1863 DrawSparks(); |
0 | 1864 am_EndScene(); |
1865 } | |
1866 | |
1867 //----- (0040AA4E) -------------------------------------------------------- | |
1263 | 1868 void DrawSparks() |
1185 | 1869 { |
1263 | 1870 int rgb_pixel_color; // [sp-4h] [bp-2Ch]@4 |
1871 unsigned int pixel_color; | |
1185 | 1872 |
1873 for (int i=0; i<10; ++i) | |
0 | 1874 { |
1263 | 1875 if(array_4FABD0[i].have_effect && (array_4FABD0[i].field_40->_40E2A7()==2)) |
1185 | 1876 { |
1263 | 1877 rgb_pixel_color = 0x0000FF00; |
1878 if ( !array_4FABD0[i].effect_sign ) | |
1879 rgb_pixel_color = 0x000000FF; | |
1880 | |
1881 pixel_color = R8G8B8_to_TargetFormat(rgb_pixel_color); | |
1185 | 1882 for(int j=0; j<150; ++j ) |
1883 { | |
1263 | 1884 if (array_4FABD0[i].effect_sparks[j].have_spark > 0) |
1185 | 1885 { |
1886 if (j%2) | |
1263 | 1887 SetPixel(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color); |
1185 | 1888 else |
1263 | 1889 SetPixel2sq(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color); |
1185 | 1890 } |
1891 } | |
1892 } | |
0 | 1893 } |
1185 | 1894 |
0 | 1895 } |
1896 | |
1897 //----- (0040AB0A) -------------------------------------------------------- | |
1197 | 1898 void DrawRectanglesForText() |
1899 { | |
1183 | 1900 |
1901 RECT pSrcRect; // [sp+Ch] [bp-18h]@1 | |
1902 POINT pTargetXY; // [sp+1Ch] [bp-8h]@1 | |
1197 | 1903 //resources rectangles |
1263 | 1904 pSrcRect.left = 765; |
1183 | 1905 pSrcRect.top = 0; |
1906 pSrcRect.right = 843; | |
1907 pSrcRect.bottom = 216; | |
1908 | |
1909 pTargetXY.x = 8; | |
1910 pTargetXY.y = 56; | |
1911 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
1912 | |
1913 pTargetXY.x = 555; | |
1914 pTargetXY.y = 56; | |
1915 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
1916 | |
1197 | 1917 //players name rectangle |
1183 | 1918 pSrcRect.left = 283; |
1263 | 1919 pSrcRect.top = 166; |
1183 | 1920 pSrcRect.right = 361; |
1921 pSrcRect.bottom = 190; | |
1922 pTargetXY.x = 8; | |
1923 pTargetXY.y = 13; | |
1924 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1925 | |
1926 pTargetXY.x = 555; | |
1927 pTargetXY.y = 13; | |
1928 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1929 | |
1241 | 1930 //tower height rectangle |
1183 | 1931 pSrcRect.left = 234; |
1263 | 1932 pSrcRect.top = 166; |
1183 | 1933 pSrcRect.right = 283; |
1934 pSrcRect.bottom = 190; | |
1935 pTargetXY.x = 100; | |
1936 pTargetXY.y = 296; | |
1937 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1938 | |
1939 pTargetXY.x = 492; | |
1940 pTargetXY.y = 296; | |
1941 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1942 | |
1241 | 1943 //wall height rectangle |
1263 | 1944 pSrcRect.left = 192; |
1945 pSrcRect.top = 166; | |
1183 | 1946 pSrcRect.right = 234; |
1947 pSrcRect.bottom = 190; | |
1948 pTargetXY.x = 168; | |
1949 pTargetXY.y = 296; | |
1950 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
1951 | |
1952 pTargetXY.x = 430; | |
1953 pTargetXY.y = 296; | |
1954 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
0 | 1955 } |
1956 | |
1957 //----- (0040AC5F) -------------------------------------------------------- | |
1197 | 1958 void DrawPlayersText() |
1959 { | |
1960 | |
1961 int res_value; // ecx@18 | |
1962 char text_buff[32]; // [sp+Ch] [bp-28h]@2 | |
1963 POINT text_position; // [sp+2Ch] [bp-8h]@2 | |
0 | 1964 |
1263 | 1965 if ( need_to_discard_card ) |
0 | 1966 { |
1209 | 1967 strcpy(text_buff, pGlobalTXT_LocalizationStrings[266]);// DISCARD A CARD |
1197 | 1968 text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2; |
1969 text_position.y = 306; | |
1970 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
0 | 1971 } |
1209 | 1972 strcpy( text_buff, am_Players[0].pPlayerName); |
1197 | 1973 if ( !current_player_num ) |
1209 | 1974 strcat(text_buff, "***"); |
1197 | 1975 text_position.x = 47 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1976 text_position.y = 21; | |
1977 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
1978 | |
1209 | 1979 strcpy(text_buff, am_Players[1].pPlayerName); |
1197 | 1980 if ( current_player_num == 1 ) |
1209 | 1981 strcat(text_buff, "***" ); |
1197 | 1982 text_position.x = 595 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
1983 text_position.y = 21; | |
1984 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
1985 | |
1986 intToString(am_Players[0].tower_height, text_buff); | |
1987 text_position.x = 123 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
1988 text_position.y = 305; | |
1989 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
1990 | |
1991 intToString(am_Players[1].tower_height, text_buff); | |
1992 text_position.x = 515 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
1993 text_position.y = 305; | |
1994 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
1995 | |
1996 intToString(am_Players[0].wall_height, text_buff); | |
1997 text_position.x = 188 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
1998 text_position.y = 305; | |
1999 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2000 | |
2001 intToString(am_Players[1].wall_height, text_buff); | |
2002 text_position.x = 451 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2003 text_position.y = 305; | |
2004 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2005 | |
2006 res_value = am_Players[0].quarry_level; | |
1263 | 2007 if ( use_start_bonus ) |
1197 | 2008 res_value =am_Players[0].quarry_level + quarry_bonus; |
2009 intToString(res_value, text_buff); | |
2010 text_position.x = 14;// - 6 * 0 / 2; | |
2011 text_position.y = 92; | |
2012 DrawPlayerLevels(-1, text_buff, &text_position); | |
2013 | |
2014 res_value = am_Players[1].quarry_level; | |
1263 | 2015 if ( use_start_bonus ) |
1197 | 2016 res_value = am_Players[1].quarry_level + quarry_bonus; |
2017 intToString(res_value, text_buff); | |
2018 // v2 = 0; | |
2019 text_position.y = 92; | |
2020 text_position.x = 561; //- 6 * v2 / 2; | |
2021 DrawPlayerLevels(-1, text_buff, &text_position); | |
2022 | |
2023 res_value = am_Players[0].magic_level; | |
1263 | 2024 if ( use_start_bonus ) |
1197 | 2025 res_value = am_Players[0].magic_level + magic_bonus; |
2026 intToString(res_value, text_buff); | |
2027 // v4 = 0; | |
2028 text_position.y = 164; | |
2029 text_position.x = 14; //- 6 * v4 / 2; | |
2030 DrawPlayerLevels(-1, text_buff, &text_position); | |
2031 | |
2032 res_value = am_Players[1].magic_level; | |
1263 | 2033 if ( use_start_bonus ) |
2034 res_value = am_Players[1].magic_level + magic_bonus; | |
1197 | 2035 intToString(res_value, text_buff); |
2036 // v6 = 0; | |
2037 text_position.y = 164; | |
2038 text_position.x = 561; //- 6 * v6 / 2; | |
2039 DrawPlayerLevels(-1, text_buff, &text_position); | |
2040 | |
1200 | 2041 res_value = am_Players[0].zoo_level; |
1263 | 2042 if ( use_start_bonus ) |
1201 | 2043 res_value = am_Players[0].zoo_level + zoo_bonus; |
1197 | 2044 intToString(res_value, text_buff); |
2045 // v8 = 0; | |
2046 text_position.y = 236; | |
2047 text_position.x = 14;// - 6 * v8 / 2; | |
2048 DrawPlayerLevels(-1, text_buff, &text_position); | |
2049 | |
1200 | 2050 res_value = am_Players[1].zoo_level; |
1263 | 2051 if ( use_start_bonus ) |
1201 | 2052 res_value = am_Players[1].zoo_level + zoo_bonus; |
1197 | 2053 intToString(res_value, text_buff); |
2054 // v10 = 0; | |
2055 text_position.y = 236; | |
2056 text_position.x = 561;// - 6 * v10 / 2; | |
2057 DrawPlayerLevels(-1, text_buff, &text_position); | |
2058 | |
2059 intToString(am_Players[0].resource_bricks, text_buff); | |
2060 text_position.y = 114; | |
2061 text_position.x = 10; | |
2062 DrawBricksCount(-1, text_buff, &text_position); | |
2063 | |
2064 intToString(am_Players[1].resource_bricks, text_buff); | |
2065 text_position.x = 557; | |
2066 text_position.y = 114; | |
2067 DrawBricksCount(-1, text_buff, &text_position); | |
2068 | |
2069 intToString(am_Players[0].resource_gems, text_buff); | |
2070 text_position.x = 10; | |
2071 text_position.y = 186; | |
2072 DrawGemsCount(-1, text_buff, &text_position); | |
2073 | |
2074 intToString(am_Players[1].resource_gems, text_buff); | |
2075 text_position.x = 557; | |
2076 text_position.y = 186; | |
2077 DrawGemsCount(-1, text_buff, &text_position); | |
2078 | |
2079 intToString(am_Players[0].resource_beasts, text_buff); | |
2080 text_position.x = 10; | |
2081 text_position.y = 258; | |
2082 DrawBeastsCount(-1, text_buff, &text_position); | |
2083 | |
2084 intToString(am_Players[1].resource_beasts, text_buff); | |
2085 text_position.x = 557; | |
2086 text_position.y = 258; | |
2087 DrawBeastsCount(-1, text_buff, &text_position); | |
0 | 2088 } |
1197 | 2089 |
0 | 2090 |
2091 //----- (0040B102) -------------------------------------------------------- | |
1197 | 2092 void DrawPlayerLevels( int a1, char *text, POINT *pXY ) |
0 | 2093 { |
1194 | 2094 char *v3; // esi@1 |
2095 unsigned char test_char; // bl@2 | |
2096 int v7; // eax@3 | |
2097 RECT pSrcRect; | |
2098 POINT pTargetPoint; | |
2099 | |
2100 v3 = text; | |
2101 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2102 pTargetPoint.x = pXY->x; | |
2103 pTargetPoint.y = pXY->y; | |
2104 do | |
2105 { | |
2106 test_char = *v3; | |
2107 ++v3; | |
2108 if ( test_char ) | |
2109 { | |
2110 v7 = 22 * test_char; | |
2111 pSrcRect.right = v7 - 842; | |
2112 pSrcRect.left = v7 - 864; | |
2113 pSrcRect.top = 190; | |
2114 pSrcRect.bottom = 207; | |
2115 Blt_Chroma(&pSrcRect, &pTargetPoint, pArcomageGame->field_54, 1); | |
2116 pTargetPoint.x += 22; | |
2117 } | |
2118 } | |
2119 while ( test_char!= 0 ); | |
2120 am_EndScene(); | |
0 | 2121 } |
2122 | |
2123 //----- (0040B17E) -------------------------------------------------------- | |
1197 | 2124 void DrawBricksCount( int a1, char* text, POINT *pXY ) |
0 | 2125 { |
1194 | 2126 |
2127 char *v3; // esi@1 | |
2128 unsigned char test_char; // bl@2 | |
2129 int v7; // eax@3 | |
2130 RECT pSrcRect; | |
2131 POINT pTargetPoint; | |
2132 | |
2133 v3 = text; | |
2134 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2135 pTargetPoint.x = pXY->x; | |
2136 pTargetPoint.y = pXY->y; | |
2137 do | |
2138 { | |
2139 test_char = *v3; | |
2140 ++v3; | |
2141 if ( test_char ) | |
2142 { | |
2143 v7 = 13 * test_char; | |
1197 | 2144 pSrcRect.left = v7 - 370; |
2145 pSrcRect.right = v7 - 357; | |
1194 | 2146 pSrcRect.top = 128; |
2147 pSrcRect.bottom = 138; | |
2148 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2149 pTargetPoint.x += 13; | |
2150 } | |
2151 } | |
2152 while ( test_char!= 0 ); | |
2153 am_EndScene(); | |
2154 | |
0 | 2155 } |
2156 | |
2157 //----- (0040B1F3) -------------------------------------------------------- | |
1197 | 2158 void DrawGemsCount( int a1, char* text, POINT* pXY ) |
0 | 2159 { |
1194 | 2160 |
2161 char *v3; // esi@1 | |
2162 unsigned char test_char; // bl@2 | |
2163 int v7; // eax@3 | |
2164 RECT pSrcRect; | |
2165 POINT pTargetPoint; | |
2166 | |
2167 v3 = text; | |
2168 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2169 pTargetPoint.x = pXY->x; | |
2170 pTargetPoint.y = pXY->y; | |
2171 do | |
2172 { | |
2173 test_char = *v3; | |
2174 ++v3; | |
2175 if ( test_char ) | |
2176 { | |
2177 v7 = 13 * test_char; | |
1197 | 2178 pSrcRect.left = v7 - 370; |
2179 pSrcRect.right = v7 - 357; | |
1194 | 2180 pSrcRect.top = 138; |
2181 pSrcRect.bottom = 148; | |
2182 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2183 pTargetPoint.x += 13; | |
2184 } | |
2185 } | |
2186 while ( test_char!= 0 ); | |
2187 am_EndScene(); | |
2188 | |
0 | 2189 } |
2190 | |
2191 //----- (0040B268) -------------------------------------------------------- | |
1197 | 2192 void DrawBeastsCount( int a1, char *text, POINT *pXY ) |
0 | 2193 { |
1194 | 2194 |
2195 char *v3; // esi@1 | |
2196 unsigned char test_char; // bl@2 | |
2197 int v7; // eax@3 | |
2198 RECT pSrcRect; | |
2199 POINT pTargetPoint; | |
2200 | |
2201 v3 = text; | |
2202 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2203 pTargetPoint.x = pXY->x; | |
2204 pTargetPoint.y = pXY->y; | |
2205 do | |
2206 { | |
2207 test_char = *v3; | |
2208 ++v3; | |
2209 if ( test_char ) | |
2210 { | |
2211 v7 = 13 * test_char; | |
1197 | 2212 pSrcRect.left = v7 - 370; |
2213 pSrcRect.right = v7 - 357; | |
1194 | 2214 pSrcRect.top = 148; |
2215 pSrcRect.bottom = 158; | |
2216 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2217 pTargetPoint.x += 13; | |
2218 } | |
2219 } | |
2220 while ( test_char!= 0 ); | |
2221 am_EndScene(); | |
2222 | |
0 | 2223 } |
2224 | |
2225 //----- (0040B2DD) -------------------------------------------------------- | |
1197 | 2226 void DrawPlayersTowers() |
2227 { | |
2228 int tower_height; // eax@1 | |
2229 int tower_top; // esi@3 | |
1194 | 2230 RECT pSrcXYZW; // [sp+0h] [bp-18h]@3 |
2231 POINT pTargetXY; // [sp+10h] [bp-8h]@3 | |
2232 | |
1197 | 2233 tower_height= am_Players[0].tower_height; |
2234 if ( am_Players[0].tower_height > max_tower_height ) | |
2235 tower_height = max_tower_height; | |
1194 | 2236 pSrcXYZW.top = 0; |
2237 pSrcXYZW.left = 892; | |
2238 pSrcXYZW.right = 937; | |
1197 | 2239 tower_top = 200 * tower_height / max_tower_height; |
2240 pSrcXYZW.bottom = tower_top; | |
1194 | 2241 pTargetXY.x = 102; |
1197 | 2242 pTargetXY.y = 297 - tower_top; |
1194 | 2243 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
2244 | |
2245 pSrcXYZW.top = 0; | |
2246 pSrcXYZW.left = 384; | |
2247 pSrcXYZW.right = 452; | |
2248 pSrcXYZW.bottom = 94; | |
1197 | 2249 pTargetXY.y = 203 - tower_top; |
1194 | 2250 pTargetXY.x = 91; |
2251 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2252 | |
1197 | 2253 |
2254 tower_height = am_Players[1].tower_height; | |
2255 if (am_Players[1].tower_height > max_tower_height ) | |
2256 tower_height = max_tower_height; | |
2257 tower_top = 200 * tower_height / max_tower_height; | |
2258 pSrcXYZW.top = 0; | |
2259 pSrcXYZW.left = 892; | |
2260 pSrcXYZW.right = 937; | |
2261 pSrcXYZW.bottom = tower_top; | |
2262 | |
1194 | 2263 pTargetXY.x = 494; |
1197 | 2264 pTargetXY.y = 297 - tower_top; |
1194 | 2265 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
1197 | 2266 //draw tower up cone |
2267 pSrcXYZW.left = 384; | |
2268 pSrcXYZW.right = 452; | |
2269 pSrcXYZW.top = 94; | |
1194 | 2270 pSrcXYZW.bottom = 188; |
1197 | 2271 |
1194 | 2272 pTargetXY.x = 483; |
1197 | 2273 pTargetXY.y = 203 - tower_top; |
1194 | 2274 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); |
2275 | |
0 | 2276 } |
2277 // 4E1884: using guessed type int dword_4E1884; | |
2278 | |
2279 //----- (0040B400) -------------------------------------------------------- | |
1197 | 2280 void DrawPlayersWall() |
2281 { | |
1194 | 2282 int v0; // eax@1 |
2283 int v1; // eax@4 | |
2284 LONG v2; // ecx@4 | |
2285 int v3; // eax@5 | |
2286 int v4; // eax@8 | |
2287 LONG v5; // esi@8 | |
2288 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4 | |
2289 POINT pTargetXY; // [sp+14h] [bp-8h]@4 | |
2290 | |
1197 | 2291 v0 = am_Players[0].wall_height; |
1218 | 2292 |
2293 if ( am_Players[0].wall_height > 100 ) | |
1194 | 2294 v0 = 100; |
1218 | 2295 |
2296 if ( am_Players[0].wall_height > 0 ) | |
2297 { | |
2298 | |
1194 | 2299 pSrcXYZW.top = 0; |
2300 pSrcXYZW.left = 843; | |
2301 v1 = 200 * v0 / 100; | |
2302 pSrcXYZW.right = 867; | |
2303 pSrcXYZW.bottom = v1; | |
2304 pTargetXY.x = 177; | |
2305 pTargetXY.y = 297 - v1; | |
2306 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
1218 | 2307 } |
2308 | |
1197 | 2309 v3 = am_Players[1].wall_height; |
1218 | 2310 if ( am_Players[1].wall_height > 100 ) |
2311 v3 = 100; | |
2312 | |
2313 | |
1247 | 2314 if ( am_Players[1].wall_height > 0 ) |
1218 | 2315 { |
2316 | |
1194 | 2317 pSrcXYZW.top = 0; |
2318 pSrcXYZW.left = 843; | |
2319 v4 = 200 * v3 / 100; | |
2320 pSrcXYZW.right = 867; | |
2321 pSrcXYZW.bottom = v4; | |
2322 pTargetXY.x = 439; | |
2323 pTargetXY.y = 297 - v4; | |
2324 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
1218 | 2325 } |
0 | 2326 } |
2327 | |
2328 //----- (0040B4B9) -------------------------------------------------------- | |
1209 | 2329 void DrawCards() |
2330 { | |
1200 | 2331 |
2332 int v0; // esi@1 | |
2333 char v1; // bl@1 | |
2334 int v2; // edi@1 | |
2335 int v3; // edx@2 | |
2336 int v4; // eax@3 | |
2337 int v5; // ecx@3 | |
2338 int v6; // eax@3 | |
2339 unsigned int v7; // ecx@4 | |
2340 int v8; // eax@16 | |
2341 int v9; // ecx@16 | |
2342 int v10; // eax@16 | |
2343 signed int v11; // edi@18 | |
2344 signed int v12; // esi@20 | |
2345 int v13; // ecx@20 | |
2346 int v14; // eax@23 | |
2347 signed int v15; // eax@25 | |
2348 int v16; // ecx@25 | |
2349 POINT *v17; // esi@26 | |
2350 signed int v18; // eax@29 | |
2351 Acromage_st1 *v19; // ecx@29 | |
2352 int v20; // ecx@31 | |
2353 int v21; // [sp-4h] [bp-2Ch]@8 | |
2354 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@8 | |
2355 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@1 | |
2356 int v24; // [sp+24h] [bp-4h]@1 | |
2357 | |
2358 v0 = GetPlayerHandCardCount(current_player_num); | |
2359 v2 = 0; | |
2360 pTargetXY.y = 327; | |
2361 v24 = (640 - 96 * v0) / (v0 + 1); | |
2362 pTargetXY.x = (640 - 96 * v0) / (v0 + 1); | |
2363 while ( v2 < v0 ) | |
2364 { | |
2365 v3 = current_player_num; | |
1241 | 2366 if ( am_byte_4E185D) |
1200 | 2367 { |
2368 | |
1256 | 2369 pTargetXY.x += am_Players[current_player_num].card_shift[v2].x ; |
2370 pTargetXY.y += am_Players[current_player_num].card_shift[v2].y; | |
1200 | 2371 } |
2372 v7 = am_Players[current_player_num].cards_at_hand[v2]; | |
2373 if ( v7 == -1 ) | |
2374 { | |
2375 ++v0; | |
2376 goto LABEL_15; | |
2377 } | |
2378 if ( v2 != amuint_4FAA4C ) | |
2379 { | |
2380 if ( am_Players[current_player_num].IsHisTurn == 0 && byte_505881 == 0 ) | |
2381 { | |
2382 pSrcXYZW.left = 192; | |
2383 pSrcXYZW.right = 288; | |
2384 pSrcXYZW.top = 0; | |
2385 pSrcXYZW.bottom = 128; | |
2386 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2387 goto LABEL_13; | |
2388 } | |
2389 pArcomageGame->GetCardRect(v7, &pSrcXYZW); | |
2390 if ( !CanCardBePlayed(current_player_num, v2) ) | |
2391 { | |
2392 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2393 goto LABEL_13; | |
2394 } | |
2395 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2396 | |
2397 } | |
2398 LABEL_13: | |
2399 v3 = current_player_num; | |
2400 pTargetXY.x += v24 + 96; | |
2401 LABEL_15: | |
1241 | 2402 if ( am_byte_4E185D ) |
1200 | 2403 { |
1256 | 2404 pTargetXY.x -= am_Players[current_player_num].card_shift[v2].x ; |
2405 pTargetXY.y -= am_Players[current_player_num].card_shift[v2].y ; | |
1200 | 2406 } |
2407 ++v2; | |
2408 } | |
2409 | |
2410 for (v11=0; v11<10; ++v11) | |
2411 { | |
2412 if ( am_byte_4FAA76 == 0 ) | |
2413 { | |
2414 if ( shown_cards[v11].uCardId != -1 ) | |
2415 { | |
2416 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW); | |
2417 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0); | |
2418 } | |
2419 if ( shown_cards[v11].field_4 != 0 ) | |
2420 { | |
2421 pTargetXY.x = shown_cards[v11].field_18_point.x + 12; | |
2422 pTargetXY.y = shown_cards[v11].field_18_point.y + 40; | |
2423 pSrcXYZW.left = 843; | |
2424 pSrcXYZW.right = 916; | |
2425 pSrcXYZW.top = 200; | |
2426 pSrcXYZW.bottom = 216; | |
2427 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2428 } | |
2429 } | |
2430 else if ( amuint_4FAA34 <= 0 ) | |
2431 { | |
2432 if ( v11 == 9 ) | |
2433 { | |
2434 am_byte_4FAA76 = 0; | |
2435 am_byte_4FAA75 = 0; | |
2436 amuint_4FAA34 = 5; | |
2437 } | |
2438 if ( shown_cards[v11].uCardId != -1 ) | |
2439 amuint_4FABC4 = shown_cards[v11].uCardId; | |
2440 shown_cards[v11].uCardId = -1; | |
2441 shown_cards[v11].field_18_point.x = shown_cards[v11].field_8.x; | |
2442 shown_cards[v11].field_18_point.y = shown_cards[v11].field_8.y; | |
2443 shown_cards[v11].field_4 = 0; | |
2444 } | |
2445 else | |
2446 { | |
2447 if ( shown_cards[v11].uCardId != -1 ) | |
2448 { | |
2449 shown_cards[v11].field_18_point.x += shown_cards[v11].field_10_xplus; | |
2450 shown_cards[v11].field_18_point.y += shown_cards[v11].field_14_y_plus; | |
2451 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW); | |
2452 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0); | |
2453 } | |
2454 } | |
2455 } | |
2456 if ( am_byte_4FAA76 != 0 ) | |
2457 --amuint_4FAA34; | |
2458 | |
2459 pSrcXYZW.left = 192; | |
2460 pSrcXYZW.right = 288; | |
2461 pSrcXYZW.top = 0; | |
2462 pSrcXYZW.bottom = 128; | |
2463 pTargetXY.x = 120; | |
2464 pTargetXY.y = 18; | |
2465 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2466 | |
0 | 2467 } |
2468 | |
2469 | |
2470 //----- (0040B76F) -------------------------------------------------------- | |
1218 | 2471 void DrawCardAnimation( int animation_stage ) |
2472 { | |
1209 | 2473 |
2474 int v1; // eax@3 | |
2475 int v2; // eax@3 | |
2476 int v3; // esi@4 | |
2477 int v4; // eax@4 | |
2478 POINT *v5; // edx@6 | |
2479 RECT *v6; // ecx@6 | |
1218 | 2480 |
1209 | 2481 int v8; // eax@15 |
2482 Acromage_st1 *v9; // ecx@15 | |
2483 int v10; // ecx@19 | |
2484 int v11; // eax@20 | |
2485 int v12; // ecx@20 | |
2486 int v13; // eax@20 | |
2487 unsigned int v14; // ecx@21 | |
2488 double v15; // st7@22 | |
2489 POINT *v16; // edx@23 | |
2490 int v17; // eax@32 | |
2491 char v18; // zf@37 | |
2492 int v19; // eax@41 | |
2493 int v20; // eax@46 | |
2494 int v21; // ecx@46 | |
2495 int v22; // eax@46 | |
2496 int v23; // [sp-4h] [bp-2Ch]@28 | |
2497 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6 | |
2498 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20 | |
2499 int v26; // [sp+24h] [bp-4h]@1 | |
2500 | |
1218 | 2501 v26 = animation_stage; |
1209 | 2502 if ( amuint_4FAA4C != -1 ) |
2503 { | |
2504 if ( amuint_4FAA38 >= 9 ) | |
2505 { | |
2506 am_uint_4FAA44_blt_xy.y = 18; | |
2507 am_uint_4FAA44_blt_xy.x = 120; | |
2508 v1 = GetPlayerHandCardCount(current_player_num); | |
2509 v2 = (640 - 96 * v1) / v1 + 96; | |
2510 if ( am_byte_4E185D ) | |
2511 { | |
2512 // v3 = 188 * current_player_num + 8 * amuint_4FAA4C; | |
2513 // amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 + *(am_Players[0].arr_6C[0] + v3) - 120) / 10; | |
1256 | 2514 amuint_4FAA3C_blt_xy.x=(amuint_4FAA4C * v2 + am_Players[current_player_num].card_shift[amuint_4FAA4C].x-120)/10; |
2515 v4 = (am_Players[current_player_num].card_shift[amuint_4FAA4C].y+309) /10;//(*(&am_Players[0].arr_6C[0][1] + v3) + 309) / 10; | |
1209 | 2516 } |
2517 else | |
2518 { | |
2519 amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 - 120) / 10; | |
2520 v4 = 30; | |
2521 } | |
2522 am_uint_4FAA44_blt_xy.y += v4; | |
2523 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
1218 | 2524 |
1209 | 2525 amuint_4FAA3C_blt_xy.y = v4; |
1218 | 2526 |
1209 | 2527 pSrcXYZW.left = 192; |
1218 | 2528 pSrcXYZW.top = 0; |
1209 | 2529 pSrcXYZW.right = 288; |
2530 pSrcXYZW.bottom = 128; | |
1218 | 2531 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2); |
1209 | 2532 } |
1218 | 2533 else |
2534 { | |
2535 | |
2536 | |
2537 pSrcXYZW.left = 192; | |
2538 pSrcXYZW.top = 0; | |
2539 pSrcXYZW.right = 288; | |
1209 | 2540 pSrcXYZW.bottom = 128; |
2541 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
2542 am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y; | |
2543 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2); | |
1218 | 2544 if ( !amuint_4FAA38 ) |
2545 { | |
2546 | |
1209 | 2547 amuint_4FAA4C = -1; |
1218 | 2548 } |
2549 } | |
1209 | 2550 } |
2551 LABEL_11: | |
1218 | 2552 |
1209 | 2553 if ( uCardID != -1 ) |
2554 { | |
2555 if ( v26 <= 10 ) | |
2556 { | |
2557 if ( v26 == 10 ) | |
2558 { | |
2559 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); | |
2560 // v8 = 0; | |
2561 for (v8=0; v8<10; ++v8) | |
2562 { | |
2563 if (shown_cards[v8].uCardId==-1) | |
2564 { | |
2565 shown_cards[v8].uCardId = uCardID; | |
2566 shown_cards[v8].field_4 = 1; | |
2567 break; | |
2568 } | |
2569 } | |
2570 /* v9 = shown_cards; | |
2571 while ( v9->uCardId != -1 ) | |
2572 { | |
2573 ++v9; | |
2574 ++v8; | |
2575 if ( v9 >= &dword_4FABB8 ) | |
2576 goto LABEL_20; | |
2577 } | |
2578 | |
2579 v10 = v8; | |
2580 shown_cards[v10].uCardId = uCardID; | |
2581 shown_cards[v10].field_4 = 1;*/ | |
2582 //LABEL_20: | |
2583 pTargetXY.x = shown_cards[v8].field_8.x; | |
2584 pTargetXY.y = shown_cards[v8].field_8.y; | |
2585 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2586 uCardID = -1; | |
2587 } | |
2588 } | |
2589 else | |
2590 { | |
2591 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); | |
2592 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2593 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
2594 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); | |
2595 } | |
2596 } | |
1218 | 2597 |
1209 | 2598 if ( played_card_id != -1 ) |
2599 { | |
2600 v15 = v26; | |
2601 if ( v15 > 15.0 ) | |
2602 { | |
2603 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2604 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2605 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
1218 | 2606 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 2); |
1209 | 2607 return; |
2608 } | |
2609 if ( v15 == 15.0 ) | |
2610 { | |
1218 | 2611 ApplyCardToPlayer(current_player_num, played_card_id); |
1209 | 2612 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); |
2613 pTargetXY.x = 272; | |
2614 pTargetXY.y = 173; | |
2615 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2616 return; | |
2617 } | |
2618 if ( v15 == 5.0 ) | |
2619 { | |
2620 amuint_4FAA5C_blt_xy.x = 272; | |
2621 amuint_4FAA5C_blt_xy.y = 173; | |
2622 for (v17=0; v17<10; ++v17) | |
2623 { | |
2624 if (shown_cards[v17].uCardId==-1) | |
2625 break; | |
2626 } | |
1263 | 2627 |
1209 | 2628 amuint_4FAA54_blt_xy.x = (shown_cards[v17].field_8.x - 272) / 5; |
2629 amuint_4FAA54_blt_xy.y = (shown_cards[v17].field_8.y - 173) / 5; | |
2630 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2631 pTargetXY.x = 272; | |
2632 pTargetXY.y = 173; | |
2633 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2634 return; | |
2635 } | |
2636 if ( v15 >= 5.0 ) | |
2637 { | |
2638 v18 = v26 == 0; | |
2639 } | |
2640 else | |
2641 { | |
2642 v18 = v26 == 0; | |
2643 if ( v26 > 0 ) | |
2644 { | |
2645 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2646 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2647 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
2648 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); | |
2649 return; | |
2650 } | |
2651 } | |
2652 if ( !v18 ) | |
2653 { | |
2654 | |
1218 | 2655 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); |
1209 | 2656 pTargetXY.x = 272; |
2657 pTargetXY.y = 173; | |
2658 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2659 return; | |
2660 } | |
1218 | 2661 |
1209 | 2662 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); |
2663 for (v19=0; v19<10; ++v19) | |
2664 { | |
2665 if (shown_cards[v19].uCardId==-1) | |
2666 { | |
2667 shown_cards[v19].uCardId = played_card_id; | |
2668 break; | |
1218 | 2669 } |
1209 | 2670 } |
1218 | 2671 pTargetXY.x = shown_cards[v19].field_8.x; |
1209 | 2672 pTargetXY.y = shown_cards[v19].field_8.y; |
2673 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2674 played_card_id = -1; | |
2675 } | |
0 | 2676 } |
2677 | |
2678 //----- (0040BB12) -------------------------------------------------------- | |
1183 | 2679 void ArcomageGame::GetCardRect(unsigned int uCardID, RECT *pCardRect) |
0 | 2680 { |
2681 int v3; // edx@1 | |
2682 int v4; // ecx@1 | |
2683 | |
2684 v3 = pCards[uCardID].slot % 10; | |
2685 v4 = (pCards[uCardID].slot / 10 << 7) + 220; | |
1183 | 2686 pCardRect->top = v4; |
2687 pCardRect->left = 96 * v3; | |
2688 pCardRect->bottom = v4 + 128; | |
2689 pCardRect->right = 96 * v3 + 96; | |
0 | 2690 } |
2691 | |
2692 //----- (0040BB49) -------------------------------------------------------- | |
1185 | 2693 int GetPlayerHandCardCount( int player_num ) |
2694 { | |
2695 int card_count; // eax@1 | |
2696 | |
2697 card_count = 0; | |
2698 for(int i=0; i<10; ++i) | |
2699 { | |
2700 if (am_Players[player_num].cards_at_hand[i]!=-1) | |
2701 ++card_count; | |
2702 } | |
2703 return card_count; | |
2704 | |
0 | 2705 } |
2706 | |
2707 //----- (0040BB67) -------------------------------------------------------- | |
1200 | 2708 signed int DrawCardsRectangles( int player_num ) |
2709 { | |
1241 | 2710 //need do fix rectangle not fit to card |
1200 | 2711 |
2712 //int v1; // esi@1 | |
1194 | 2713 signed int result; // eax@1 |
2714 int v3; // ebx@1 | |
2715 char v4; // zf@1 | |
2716 int v5; // eax@3 | |
2717 int v6; // eax@4 | |
2718 int v7; // ecx@6 | |
2719 char *v8; // eax@6 | |
2720 int v9; // eax@10 | |
2721 int v10; // ecx@10 | |
2722 int v11; // eax@10 | |
2723 char v12; // ch@2@11 | |
2724 int v13; // ST00_4@12 | |
2725 unsigned __int16 v14; // ax@12 | |
2726 int v15; // eax@13 | |
2727 int v16; // ecx@13 | |
2728 int v17; // eax@13 | |
2729 char v18; // al@16 | |
2730 char v19; // ch@2@16 | |
2731 int v20; // ST00_4@19 | |
2732 unsigned __int16 v21; // ax@19 | |
2733 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3 | |
2734 stru273 v26; // [sp+1Ch] [bp-2Ch]@2 | |
2735 int v25; // [sp+2Ch] [bp-1Ch]@3 | |
2736 __int32 var18; // [sp+30h] [bp-18h]@3 | |
2737 int i; // [sp+34h] [bp-14h]@4 | |
2738 int v28; // [sp+38h] [bp-10h]@1 | |
2739 int hand_index; // [sp+3Ch] [bp-Ch]@3 | |
2740 int v30; // [sp+40h] [bp-8h]@1 | |
2741 char v31; // [sp+44h] [bp-4h]@12 | |
2742 char v32; // [sp+45h] [bp-3h]@12 | |
2743 char v33; // [sp+46h] [bp-2h]@12 | |
2744 | |
1200 | 2745 |
1194 | 2746 v30 = 0; |
2747 result = -1; | |
2748 //v3 = 188 * a1; | |
1200 | 2749 |
1194 | 2750 //v4 = LOBYTE(am_Players[a1].field_20) == 0; |
2751 v28 = -1; | |
1200 | 2752 if ( am_Players[player_num].IsHisTurn ) |
1194 | 2753 { |
0 | 2754 if ( v26._40DD2F() ) |
2755 { | |
1200 | 2756 v5 = GetPlayerHandCardCount(player_num); |
1194 | 2757 hand_index = 0; |
2758 v25 = v5; | |
2759 pXYZW.top = 327; | |
2760 pXYZW.bottom = 455; | |
2761 pXYZW.left = (640 - 96 * v5) / (v5 + 1); | |
2762 var18 = pXYZW.left + 96; | |
2763 pXYZW.right = pXYZW.left + 96; | |
2764 if ( v5 > 0 ) | |
0 | 2765 { |
1194 | 2766 // v6 = 47 * v1; |
1200 | 2767 // for ( i = player_num; ; v6 = i ) |
2768 for(;;) | |
1194 | 2769 { |
2770 v7 = v30; | |
2771 // v8 = &am_Players[0].cards_at_hand[v30 + v6]; | |
2772 | |
2773 for (v7=0; v7<10; ++v7) | |
2774 { | |
1200 | 2775 if (am_Players[player_num].cards_at_hand[v7]!= -1 ) |
1194 | 2776 break; |
2777 } | |
2778 //if ( *v8 ) | |
2779 // { | |
2780 // do | |
2781 // { | |
2782 // //v8 += 4; | |
2783 // ++v7; | |
2784 // } | |
2785 // while ( *v8 == -1 ); | |
2786 v30 = v7; | |
2787 // } | |
2788 if ( am_byte_4E185D ) | |
2789 { | |
2790 // v9 = v3 + 8 * v7; | |
1256 | 2791 v10 = am_Players[player_num].card_shift[v7].x;//*(am_player[0].arr_6C[0] + v9); |
2792 v11 = am_Players[player_num].card_shift[v7].y;//*(&am_player[0].arr_6C[0][1] + v9); | |
1194 | 2793 pXYZW.left += v10; |
2794 pXYZW.right += v10; | |
2795 pXYZW.top += v11; | |
2796 pXYZW.bottom += v11; | |
2797 } | |
2798 if (v26.Inside(&pXYZW) ) | |
2799 break; | |
2800 | |
2801 v13=0; | |
2802 v14 = R8G8B8_to_TargetFormat(v13); | |
2803 DrawRect(&pXYZW, v14, 0); | |
2804 pXYZW.left += var18; | |
2805 pXYZW.right += var18; | |
2806 if ( am_byte_4E185D ) | |
2807 { | |
1256 | 2808 v16 = am_Players[player_num].card_shift[v30].x;//*(am_player[0].arr_6C[0] + v15); |
2809 v17 = am_Players[player_num].card_shift[v30].y;//*(&am_player[0].arr_6C[0][1] + v15); | |
1194 | 2810 pXYZW.left -= v16; |
2811 pXYZW.right -= v16; | |
2812 pXYZW.top -= v17; | |
2813 pXYZW.bottom -= v17; | |
2814 } | |
2815 ++v30; | |
2816 ++hand_index; | |
2817 if ( hand_index >= v25 ) | |
2818 return v28; | |
2819 } | |
2820 v28 = hand_index; | |
1197 | 2821 v18 = CanCardBePlayed(player_num, hand_index); |
1194 | 2822 if ( v18 ) |
2823 { | |
2824 v20=0x00FFFFFF; | |
2825 } | |
2826 else | |
2827 { | |
2828 v20=0x000000FF; | |
2829 } | |
2830 | |
2831 v21 = R8G8B8_to_TargetFormat(v20); | |
2832 DrawRect(&pXYZW, v21, 0); | |
0 | 2833 } |
2834 } | |
1194 | 2835 result = v28; |
0 | 2836 } |
1194 | 2837 return result; |
2838 | |
2839 | |
0 | 2840 } |
2841 // 4E185D: using guessed type char am_byte_4E185D; | |
2842 | |
2843 //----- (0040BCFB) -------------------------------------------------------- | |
1256 | 2844 bool DiscardCard( int player_num, signed int card_slot_index ) |
1200 | 2845 { |
0 | 2846 int v2; // esi@2 |
2847 signed int v3; // edi@2 | |
2848 char *v4; // eax@2 | |
2849 int v5; // ecx@7 | |
2850 int v6; // ebx@7 | |
2851 int v7; // esi@8 | |
2852 int v8; // eax@8 | |
2853 int v9; // esi@8 | |
2854 int v10; // ecx@8 | |
2855 int v11; // eax@8 | |
2856 int v12; // eax@8 | |
2857 signed int v13; // edx@9 | |
2858 unsigned int v14; // eax@12 | |
2859 char result; // al@12 | |
1194 | 2860 int i; |
0 | 2861 |
1200 | 2862 if ( card_slot_index <= -1 ) |
1209 | 2863 return false; |
0 | 2864 v2 = 0; |
1194 | 2865 |
2866 for(i=0; i<10; ++i) | |
0 | 2867 { |
1200 | 2868 if ( am_Players[player_num].cards_at_hand[i] != -1 ) |
0 | 2869 { |
1200 | 2870 if ( card_slot_index == v2 ) |
0 | 2871 break; |
2872 ++v2; | |
2873 } | |
2874 } | |
1194 | 2875 |
1263 | 2876 if ( pCards[am_Players[player_num].cards_at_hand[i]].can_be_discarded) |
0 | 2877 { |
1209 | 2878 ArcomageGame::PlaySound(22); |
1197 | 2879 v8 = GetPlayerHandCardCount(current_player_num); |
1256 | 2880 v10=am_Players[player_num].card_shift[i].x + (640 - 96 * v8) / (v8 + 1); |
1209 | 2881 amuint_4FAA5C_blt_xy.x = v10; |
1256 | 2882 amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[i].y + 327;//v11; |
0 | 2883 v12 = 0; |
1209 | 2884 |
0 | 2885 if ( !am_byte_4FAA75 ) |
2886 { | |
1209 | 2887 for (v12=0; v12<10; ++v12) |
2888 { | |
2889 if (shown_cards[v12].uCardId== -1) | |
2890 break; | |
2891 } | |
0 | 2892 } |
2893 pArcomageGame->field_F6 = 1; | |
1209 | 2894 amuint_4FAA54_blt_xy.x = (shown_cards[v12].field_8.x - v10) / 10; |
2895 amuint_4FAA54_blt_xy.y = (shown_cards[v12].field_8.y - 327) / 10; | |
2896 uCardID = am_Players[player_num].cards_at_hand[i]; | |
2897 am_Players[player_num].cards_at_hand[i] = -1; | |
1263 | 2898 need_to_discard_card = 0; |
1209 | 2899 return true; |
0 | 2900 } |
2901 else | |
1209 | 2902 return false; |
0 | 2903 } |
1263 | 2904 |
0 | 2905 |
2906 //----- (0040BE0E) -------------------------------------------------------- | |
1197 | 2907 bool PlayCard( int player_num, signed int card_slot_num ) |
2908 { | |
1247 | 2909 |
0 | 2910 int v3; // ebp@1 |
2911 int v4; // ecx@2 | |
1183 | 2912 ArcomagePlayer *v5; // esi@2 |
1263 | 2913 int card_index; // edi@2 |
0 | 2914 int v7; // eax@2 |
2915 int v8; // ebx@8 | |
1263 | 2916 int cards_at_hand; // eax@8 |
0 | 2917 int v10; // ebx@8 |
2918 int v11; // ebp@8 | |
2919 int v12; // ecx@8 | |
2920 int v13; // eax@8 | |
1263 | 2921 ArcomageCard *pCard; // eax@8 |
0 | 2922 int v15; // ecx@8 |
2923 int v16; // ecx@8 | |
2924 | |
1197 | 2925 if ( card_slot_num <= -1 ) |
2926 return false; | |
1263 | 2927 |
0 | 2928 v4 = 0; |
1263 | 2929 for (card_index=0; card_index<10; ++card_index) |
0 | 2930 { |
1263 | 2931 if ( am_Players[player_num].cards_at_hand[card_index] != -1 ) |
0 | 2932 { |
1197 | 2933 if ( card_slot_num == v4 ) |
0 | 2934 break; |
2935 ++v4; | |
2936 } | |
2937 } | |
1209 | 2938 |
1263 | 2939 if (CanCardBePlayed(player_num, card_index) ) |
0 | 2940 { |
1209 | 2941 ArcomageGame::PlaySound(23); |
1263 | 2942 cards_at_hand = GetPlayerHandCardCount(current_player_num); |
0 | 2943 pArcomageGame->field_F6 = 1; |
1263 | 2944 v12 = am_Players[player_num].card_shift[card_index].x + |
2945 (640 - 96 * cards_at_hand) / (cards_at_hand + 1)+ | |
2946 96 * card_index ; | |
2947 | |
1185 | 2948 // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327; |
1218 | 2949 amuint_4FAA5C_blt_xy.x = v12;//v12; |
1263 | 2950 amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[card_index].y + 327;//v13; |
1209 | 2951 |
2952 amuint_4FAA54_blt_xy.x = (272 - v12) / 5; | |
2953 amuint_4FAA54_blt_xy.y = -30; | |
1200 | 2954 |
1263 | 2955 pCard = &pCards[am_Players[player_num].cards_at_hand[card_index]]; |
2956 am_Players[player_num].resource_bricks -= pCard->needed_bricks; | |
2957 am_Players[player_num].resource_beasts -= pCard->needed_beasts; | |
2958 am_Players[player_num].resource_gems -= pCard->needed_gems; | |
2959 played_card_id = am_Players[player_num].cards_at_hand[card_index]; | |
2960 am_Players[player_num].cards_at_hand[card_index] = -1; | |
2961 return true; | |
0 | 2962 } |
2963 else | |
1197 | 2964 return false; |
2965 | |
0 | 2966 } |
2967 | |
2968 //----- (0040BF15) -------------------------------------------------------- | |
1197 | 2969 bool CanCardBePlayed( int player_num, int hand_card_indx ) |
1185 | 2970 { |
0 | 2971 bool result; // eax@1 |
1197 | 2972 ArcomageCard *test_card; // ecx@1 |
2973 ArcomagePlayer *pPlayer; // esi@1 | |
2974 | |
2975 pPlayer = &am_Players[player_num]; | |
1185 | 2976 result = true; |
1197 | 2977 test_card = &pCards[am_Players[player_num].cards_at_hand[hand_card_indx]]; |
2978 if ( test_card->needed_quarry_level > pPlayer->quarry_level ) | |
1185 | 2979 result = false; |
1197 | 2980 if ( test_card->needed_magic_level > pPlayer->magic_level ) |
1185 | 2981 result = false; |
1200 | 2982 if ( test_card->needed_might_level > pPlayer->zoo_level ) |
1185 | 2983 result = false; |
1197 | 2984 if ( test_card->needed_bricks > pPlayer->resource_bricks ) |
1185 | 2985 result = false; |
1197 | 2986 if ( test_card->needed_gems > pPlayer->resource_gems ) |
1185 | 2987 result = false; |
1197 | 2988 if ( test_card->needed_beasts > pPlayer->resource_beasts ) |
1185 | 2989 result = false; |
0 | 2990 return result; |
2991 } | |
2992 | |
2993 | |
2994 | |
2995 | |
2996 //----- (0040BF77) -------------------------------------------------------- | |
1218 | 2997 void ApplyCardToPlayer( int player_num, unsigned int uCardID ) |
2998 { | |
1245 | 2999 |
3000 | |
3001 #define APPLY_TO_PLAYER( PLAYER, ENEMY,FIELD, VAL, RES )\ | |
1246 | 3002 if (VAL != 0) {\ |
3003 if (VAL == 99) {\ | |
3004 if ( PLAYER->##FIELD < ENEMY->##FIELD ) {\ | |
3005 PLAYER->##FIELD = ENEMY->##FIELD;\ | |
3006 RES = ENEMY->##FIELD - PLAYER->##FIELD;\ | |
3007 }\ | |
3008 } else {\ | |
3009 PLAYER->##FIELD += (signed int)(VAL);\ | |
3010 if ( PLAYER->##FIELD<0 ) PLAYER->##FIELD= 0;\ | |
3011 RES = (signed int)(VAL);\ | |
1245 | 3012 }\ |
1246 | 3013 } |
1245 | 3014 |
3015 #define APPLY_TO_ENEMY( PLAYER, ENEMY,FIELD, VAL, RES ) APPLY_TO_PLAYER(ENEMY, PLAYER, FIELD, VAL, RES) | |
3016 | |
3017 #define APPLY_TO_BOTH( PLAYER, ENEMY, FIELD, VAL, RES_P, RES_E ) \ | |
1246 | 3018 if ( VAL != 0) {\ |
3019 if ( VAL == 99 ) { \ | |
1245 | 3020 if ( PLAYER->##FIELD != ENEMY->##FIELD ) { \ |
3021 if ( PLAYER->##FIELD <= ENEMY->##FIELD ) { \ | |
3022 PLAYER->##FIELD = ENEMY->##FIELD; \ | |
3023 RES_P = ENEMY->##FIELD - PLAYER->##FIELD; \ | |
3024 } else { \ | |
3025 ENEMY->##FIELD = PLAYER->##FIELD; \ | |
3026 RES_E = PLAYER->##FIELD - ENEMY->##FIELD; \ | |
3027 } \ | |
3028 }\ | |
1246 | 3029 } else { \ |
1245 | 3030 PLAYER->##FIELD += (signed int)(VAL);\ |
3031 ENEMY->##FIELD += (signed int)(VAL); if (PLAYER->##FIELD < 0 ) {PLAYER->##FIELD = 0;} \ | |
3032 if ( ENEMY->##FIELD < 0 ) {ENEMY->##FIELD = 0;} \ | |
1246 | 3033 RES_P = (signed int)(VAL); RES_E = (signed int)(VAL); \ |
3034 }\ | |
3035 } | |
1245 | 3036 ArcomagePlayer *player; // esi@1 |
3037 int v3; // eax@1 | |
3038 ArcomagePlayer *enemy; // edi@1 | |
3039 int v5; // eax@2 | |
3040 char v6; // sf@2 | |
3041 unsigned __int8 v7; // of@2 | |
3042 int v8; // eax@3 | |
3043 int v9; // eax@4 | |
3044 char v10; // zf@5 | |
3045 int v11; // eax@8 | |
3046 unsigned __int8 v12; // zf@8 | |
3047 char v13; // sf@8 | |
3048 unsigned __int8 v14; // of@8 | |
3049 int v15; // eax@9 | |
3050 int v16; // eax@10 | |
3051 char v17; // zf@12 | |
3052 char v18; // al@15 | |
3053 int v19; // eax@16 | |
3054 int v20; // eax@17 | |
3055 int v21; // eax@22 | |
3056 int v22; // eax@23 | |
3057 int v23; // eax@26 | |
3058 signed int v24; // ebx@26 | |
3059 int v103; | |
3060 int v104; | |
3061 | |
3062 POINT v184; // [sp+Ch] [bp-64h]@488 | |
3063 int enemy_num; // [sp+14h] [bp-5Ch]@1 | |
3064 ArcomageCard *pCard; // [sp+18h] [bp-58h]@1 | |
3065 int buildings_e; // [sp+1Ch] [bp-54h]@1 | |
3066 int buildings_p; // [sp+20h] [bp-50h]@1 | |
3067 int quarry_p; // [sp+28h] [bp-48h]@1 | |
3068 int dmg_e; // [sp+2Ch] [bp-44h]@1 | |
3069 int dmg_p; // [sp+30h] [bp-40h]@1 | |
3070 int bricks_p; // [sp+34h] [bp-3Ch]@1 | |
3071 int tower_e; // [sp+38h] [bp-38h]@1 | |
3072 int tower_p; // [sp+3Ch] [bp-34h]@1 | |
3073 int wall_e; // [sp+40h] [bp-30h]@1 | |
3074 int wall_p; // [sp+44h] [bp-2Ch]@1 | |
3075 int beasts_e; // [sp+48h] [bp-28h]@1 | |
3076 int beasts_p; // [sp+4Ch] [bp-24h]@1 | |
3077 int gems_e; // [sp+50h] [bp-20h]@1 | |
3078 int gems_p; // [sp+54h] [bp-1Ch]@1 | |
3079 int bricks_e; // [sp+58h] [bp-18h]@1 | |
3080 int zoo_e; // [sp+5Ch] [bp-14h]@1 | |
3081 int zoo_p; // [sp+60h] [bp-10h]@1 | |
3082 int magic_e; // [sp+64h] [bp-Ch]@1 | |
3083 int magic_p; // [sp+68h] [bp-8h]@1 | |
3084 int quarry_e; // [sp+6Ch] [bp-4h]@1 | |
3085 | |
1246 | 3086 quarry_p = 0; |
3087 magic_p = 0; | |
3088 zoo_p = 0; | |
3089 bricks_p = 0; | |
3090 gems_p = 0; | |
3091 beasts_p = 0; | |
3092 wall_p = 0; | |
3093 tower_p = 0; | |
1245 | 3094 buildings_p = 0; |
1246 | 3095 dmg_p = 0; |
3096 quarry_e = 0; | |
3097 magic_e = 0; | |
3098 zoo_e = 0; | |
3099 bricks_e = 0; | |
3100 gems_e = 0; | |
3101 beasts_e = 0; | |
3102 wall_e = 0; | |
3103 tower_e = 0; | |
1245 | 3104 buildings_e = 0; |
1246 | 3105 dmg_e = 0; |
1245 | 3106 |
3107 player = &am_Players[player_num]; | |
3108 pCard = &pCards[uCardID]; | |
3109 enemy_num = (player_num + 1) % 2; | |
3110 enemy = &am_Players[enemy_num]; | |
3111 switch ( pCard->compare_param ) | |
3112 { | |
3113 case 2: | |
3114 v5 = player->quarry_level; | |
3115 v7 = __OFSUB__(v5, enemy->quarry_level); | |
3116 v6 = v5 - enemy->quarry_level < 0; | |
1263 | 3117 v18 = v6 ^ v7; |
3118 goto LABEL_25; | |
1245 | 3119 case 3: |
3120 v8 = player->magic_level; | |
3121 v7 = __OFSUB__(v8, enemy->magic_level); | |
3122 v6 = v8 - enemy->magic_level < 0; | |
1263 | 3123 v18 = v6 ^ v7; |
3124 goto LABEL_25; | |
1245 | 3125 case 4: |
3126 v9 = player->zoo_level; | |
3127 v7 = __OFSUB__(v9, enemy->zoo_level); | |
3128 v6 = v9 - enemy->zoo_level < 0; | |
1263 | 3129 v18 = v6 ^ v7; |
3130 goto LABEL_25; | |
1245 | 3131 case 5: |
3132 v10 = player->quarry_level == enemy->quarry_level; | |
1263 | 3133 v18 = v10; |
3134 goto LABEL_25; | |
1245 | 3135 case 6: |
3136 v10 = player->magic_level == enemy->magic_level; | |
1263 | 3137 v18 = v10; |
3138 goto LABEL_25; | |
1245 | 3139 case 7: |
3140 v10 = player->zoo_level == enemy->zoo_level; | |
1263 | 3141 v18 = v10; |
3142 goto LABEL_25; | |
1245 | 3143 case 8: |
3144 v11 = player->quarry_level; | |
3145 v14 = __OFSUB__(v11, enemy->quarry_level); | |
3146 v12 = v11 == enemy->quarry_level; | |
3147 v13 = v11 - enemy->quarry_level < 0; | |
1263 | 3148 v18 = !((v13 ^ v14) | v12); |
3149 goto LABEL_25; | |
1245 | 3150 case 9: |
3151 v15 = player->magic_level; | |
3152 v14 = __OFSUB__(v15, enemy->magic_level); | |
3153 v12 = v15 == enemy->magic_level; | |
3154 v13 = v15 - enemy->magic_level < 0; | |
1263 | 3155 v18 = !((v13 ^ v14) | v12); |
3156 goto LABEL_25; | |
1245 | 3157 case 10: |
3158 v16 = player->zoo_level; | |
3159 v14 = __OFSUB__(v16, enemy->zoo_level); | |
3160 v12 = v16 == enemy->zoo_level; | |
3161 v13 = v16 - enemy->zoo_level < 0; | |
1263 | 3162 v18 = !((v13 ^ v14) | v12); |
3163 goto LABEL_25; | |
1245 | 3164 case 11: |
3165 v10 = player->wall_height == 0; | |
1263 | 3166 v18 = v10; |
3167 goto LABEL_25; | |
1245 | 3168 case 12: |
3169 v17 = player->wall_height == 0; | |
1263 | 3170 v18 = !v17; |
3171 goto LABEL_25; | |
1245 | 3172 case 13: |
3173 v10 = enemy->wall_height == 0; | |
1263 | 3174 v18 = v10; |
3175 goto LABEL_25; | |
1245 | 3176 case 14: |
3177 v17 = enemy->wall_height == 0; | |
3178 v18 = !v17; | |
3179 goto LABEL_25; | |
3180 case 15: | |
3181 v19 = player->wall_height; | |
3182 v7 = __OFSUB__(v19, enemy->wall_height); | |
3183 v6 = v19 - enemy->wall_height < 0; | |
1263 | 3184 v18 = v6 ^ v7; |
3185 goto LABEL_25; | |
1245 | 3186 case 16: |
3187 v20 = player->tower_height; | |
3188 v7 = __OFSUB__(v20, enemy->tower_height); | |
3189 v6 = v20 - enemy->tower_height < 0; | |
3190 v18 = v6 ^ v7; | |
3191 goto LABEL_25; | |
3192 case 17: | |
3193 v10 = player->wall_height == enemy->wall_height; | |
1263 | 3194 v18 = v10; |
3195 goto LABEL_25; | |
1245 | 3196 case 18: |
3197 v10 = player->tower_height == enemy->tower_height; | |
3198 v18 = v10; | |
3199 goto LABEL_25; | |
3200 case 19: | |
3201 v21 = player->wall_height; | |
3202 v14 = __OFSUB__(v21, enemy->wall_height); | |
3203 v12 = v21 == enemy->wall_height; | |
3204 v13 = v21 - enemy->wall_height < 0; | |
1263 | 3205 v18 = !((v13 ^ v14) | v12); |
3206 goto LABEL_25; | |
1245 | 3207 case 20: |
3208 v22 = player->tower_height; | |
3209 v14 = __OFSUB__(v22, enemy->tower_height); | |
3210 v12 = v22 == enemy->tower_height; | |
3211 v13 = v22 - enemy->tower_height < 0; | |
3212 v18 = !((v13 ^ v14) | v12); | |
3213 LABEL_25: | |
3214 if ( v18 ) | |
3215 goto LABEL_26; | |
3216 goto LABEL_231; | |
3217 default: | |
3218 LABEL_26: | |
1263 | 3219 v23 = pCard->draw_extra_card_count; |
1245 | 3220 v24 = 0; |
3221 dword_4FAA68 = v23 + (pCard->field_30 == 1); | |
3222 dword_4FAA64 = v23; | |
3223 if ( v23 > 0 ) | |
3224 { | |
3225 do | |
3226 { | |
3227 GetNextCardFromDeck(player_num); | |
3228 ++v24; | |
3229 } | |
1263 | 3230 while ( v24 < pCard->draw_extra_card_count ); |
1245 | 3231 } |
3232 | |
1263 | 3233 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
1245 | 3234 |
3235 | |
3236 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl, quarry_p); | |
3237 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl, magic_p); | |
3238 APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl, zoo_p); | |
3239 APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks, bricks_p); | |
3240 APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems, gems_p); | |
3241 APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts, beasts_p); | |
1246 | 3242 if ( pCard->to_player_buildings ) |
1245 | 3243 { |
1246 | 3244 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings); |
3245 buildings_p = (signed int)pCard->to_player_buildings - dmg_p; | |
1245 | 3246 } |
1246 | 3247 APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall, wall_p); |
3248 APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower, tower_p); | |
1245 | 3249 |
3250 APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl, quarry_e); | |
3251 APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl, magic_e); | |
3252 APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl, zoo_e); | |
3253 APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks, bricks_e); | |
3254 APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems, gems_e); | |
3255 APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts, beasts_e); | |
3256 if ( pCard->to_enemy_buildings ) | |
3257 { | |
1246 | 3258 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings); |
3259 buildings_e = (signed int)pCard->to_enemy_buildings - dmg_e; | |
1245 | 3260 } |
3261 APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall, wall_e); | |
3262 APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower, tower_e); | |
3263 | |
3264 APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl, quarry_p, quarry_e); | |
3265 APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl, magic_p, magic_e); | |
3266 APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl, zoo_p, zoo_e); | |
3267 APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks, bricks_p, bricks_e); | |
3268 APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems, gems_p, gems_e); | |
3269 APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts, beasts_p, beasts_e); | |
3270 if ( pCard->to_pl_enm_buildings ) | |
3271 { | |
1246 | 3272 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings); |
3273 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings); | |
3274 buildings_p = (signed int)pCard->to_pl_enm_buildings - dmg_p; | |
3275 buildings_e = (signed int)pCard->to_pl_enm_buildings - dmg_e; | |
1245 | 3276 } |
3277 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall, wall_p, wall_e); | |
3278 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower, tower_p, tower_e); | |
3279 break; | |
3280 case 0: | |
3281 LABEL_231: | |
3282 v103 = pCard->can_draw_extra_card2; | |
3283 v104 = 0; | |
3284 dword_4FAA68 = v103 + (pCard->field_4D == 1); | |
3285 dword_4FAA64 = v103; | |
3286 if ( v103 > 0 ) | |
3287 { | |
3288 do | |
3289 { | |
3290 GetNextCardFromDeck(player_num); | |
3291 ++v104; | |
3292 } | |
3293 while ( v104 < pCard->can_draw_extra_card2 ); | |
3294 } | |
3295 | |
1263 | 3296 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
1245 | 3297 |
3298 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl2, quarry_p); | |
3299 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl2, magic_p); | |
3300 APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl2, zoo_p); | |
3301 APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks2, bricks_p); | |
3302 APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems2, gems_p); | |
3303 APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts2, beasts_p); | |
3304 if ( pCard->to_player_buildings2 ) | |
3305 { | |
1246 | 3306 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings2); |
3307 buildings_p = (signed int)pCard->to_player_buildings2 - dmg_p; | |
1245 | 3308 } |
3309 APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall2, wall_p); | |
3310 APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower2, tower_p); | |
3311 | |
3312 APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl2, quarry_e); | |
3313 APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl2, magic_e); | |
3314 APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl2, zoo_e); | |
3315 APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks2, bricks_e); | |
3316 APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems2, gems_e); | |
3317 APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts2, beasts_e); | |
3318 if ( pCard->to_enemy_buildings2 ) | |
3319 { | |
1246 | 3320 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings2); |
3321 buildings_e = (signed int)pCard->to_enemy_buildings2 - dmg_e; | |
1245 | 3322 } |
3323 APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall2, wall_e); | |
3324 APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower2, tower_e); | |
3325 | |
3326 APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl2, quarry_p, quarry_e); | |
3327 APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl2, magic_p, magic_e); | |
3328 APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl2, zoo_p, zoo_e); | |
3329 APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks2, bricks_p, bricks_e); | |
3330 APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems2, gems_p, gems_e); | |
3331 APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts2, beasts_p, beasts_e); | |
3332 | |
3333 if ( pCard->to_pl_enm_buildings2 ) | |
3334 { | |
1246 | 3335 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings2); |
3336 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings2); | |
3337 buildings_p = (signed int)pCard->to_pl_enm_buildings2 - dmg_p; | |
3338 buildings_e = (signed int)pCard->to_pl_enm_buildings2 - dmg_e; | |
1245 | 3339 } |
3340 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall2, wall_p, wall_e); | |
3341 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower2, tower_p, tower_e); | |
3342 break; | |
3343 } | |
3344 // } | |
3345 if ( quarry_p > 0 || quarry_e > 0 ) | |
3346 pArcomageGame->PlaySound(30); | |
3347 if ( quarry_p < 0 || quarry_e < 0 ) | |
3348 pArcomageGame->PlaySound(31); | |
3349 if ( magic_p > 0 || magic_e > 0 ) | |
3350 pArcomageGame->PlaySound(33); | |
3351 if ( magic_p < 0 || magic_e < 0 ) | |
3352 pArcomageGame->PlaySound(34); | |
3353 if ( zoo_p > 0 || zoo_e > 0 ) | |
3354 pArcomageGame->PlaySound(36); | |
3355 if ( zoo_p < 0 || zoo_e < 0 ) | |
3356 pArcomageGame->PlaySound(37); | |
3357 if ( bricks_p > 0 || bricks_e > 0 ) | |
3358 pArcomageGame->PlaySound(39); | |
3359 if ( bricks_p < 0 || bricks_e < 0 ) | |
3360 pArcomageGame->PlaySound(40); | |
3361 if ( gems_p > 0 || gems_e > 0 ) | |
3362 pArcomageGame->PlaySound(42); | |
3363 if ( gems_p < 0 || gems_e < 0 ) | |
3364 pArcomageGame->PlaySound(43); | |
3365 if ( beasts_p > 0 || beasts_e > 0 ) | |
3366 pArcomageGame->PlaySound(45u); | |
3367 if ( beasts_p < 0 || beasts_e < 0 ) | |
3368 pArcomageGame->PlaySound(46); | |
3369 if ( buildings_p || buildings_e || dmg_p || dmg_e ) | |
3370 pArcomageGame->PlaySound(48); | |
3371 if ( wall_p > 0 || wall_e > 0 ) | |
3372 pArcomageGame->PlaySound(49); | |
3373 if ( wall_p < 0 || wall_e < 0 ) | |
3374 pArcomageGame->PlaySound(50); | |
3375 if ( tower_p > 0 || tower_e > 0 ) | |
3376 pArcomageGame->PlaySound(52); | |
3377 if ( tower_p < 0 || tower_e < 0 ) | |
3378 pArcomageGame->PlaySound(53); | |
3379 if ( player_num ) | |
3380 { | |
3381 if ( quarry_p ) | |
3382 { | |
3383 v184.x = 573; | |
3384 v184.y = 92; | |
3385 am_40D2B4(&v184, quarry_p); | |
3386 } | |
3387 if ( quarry_e ) | |
3388 { | |
3389 v184.x = 26; | |
3390 v184.y = 92; | |
3391 am_40D2B4(&v184, quarry_e); | |
3392 } | |
3393 if ( magic_p ) | |
3394 { | |
3395 v184.x = 573; | |
3396 v184.y = 164; | |
3397 am_40D2B4(&v184, magic_p); | |
3398 } | |
3399 if ( magic_e ) | |
3400 { | |
3401 v184.x = 26; | |
3402 v184.y = 164; | |
3403 am_40D2B4(&v184, magic_e); | |
3404 } | |
3405 if ( zoo_p ) | |
3406 { | |
3407 v184.x = 573; | |
3408 v184.y = 236; | |
3409 am_40D2B4(&v184, zoo_p); | |
3410 } | |
3411 if ( zoo_e ) | |
3412 { | |
3413 v184.x = 26; | |
3414 v184.y = 236; | |
3415 am_40D2B4(&v184, zoo_e); | |
3416 } | |
3417 if ( bricks_p ) | |
3418 { | |
3419 v184.x = 563; | |
3420 v184.y = 114; | |
3421 am_40D2B4(&v184, bricks_p); | |
3422 } | |
3423 if ( bricks_e ) | |
3424 { | |
3425 v184.x = 16; | |
3426 v184.y = 114; | |
3427 am_40D2B4(&v184, bricks_e); | |
3428 } | |
3429 if ( gems_p ) | |
3430 { | |
3431 v184.x = 563; | |
3432 v184.y = 186; | |
3433 am_40D2B4(&v184, gems_p); | |
3434 } | |
3435 if ( gems_e ) | |
3436 { | |
3437 v184.x = 16; | |
3438 v184.y = 186; | |
3439 am_40D2B4(&v184, gems_e); | |
3440 } | |
3441 if ( beasts_p ) | |
3442 { | |
3443 v184.x = 563; | |
3444 v184.y = 258; | |
3445 am_40D2B4(&v184, beasts_p); | |
3446 } | |
3447 if ( beasts_e ) | |
3448 { | |
3449 v184.x = 16; | |
3450 v184.y = 258; | |
3451 am_40D2B4(&v184, beasts_e); | |
3452 } | |
3453 if ( wall_p ) | |
3454 { | |
3455 v184.x = 442; | |
3456 v184.y = 296; | |
3457 am_40D2B4(&v184, wall_p); | |
3458 } | |
3459 if ( wall_e ) | |
3460 { | |
3461 v184.x = 180; | |
3462 v184.y = 296; | |
3463 am_40D2B4(&v184, wall_e); | |
3464 } | |
3465 if ( tower_p ) | |
3466 { | |
3467 v184.x = 514; | |
3468 v184.y = 296; | |
3469 am_40D2B4(&v184, tower_p); | |
3470 } | |
3471 if ( tower_e ) | |
3472 { | |
3473 v184.x = 122; | |
3474 v184.y = 296; | |
3475 am_40D2B4(&v184, tower_e); | |
3476 } | |
3477 if ( dmg_p ) | |
3478 { | |
3479 v184.x = 442; | |
3480 v184.y = 296; | |
3481 am_40D2B4(&v184, dmg_p); | |
3482 } | |
3483 if ( buildings_p ) | |
3484 { | |
3485 v184.x = 514; | |
3486 v184.y = 296; | |
3487 am_40D2B4(&v184, buildings_p); | |
3488 } | |
3489 if ( dmg_e ) | |
3490 { | |
3491 v184.x = 180; | |
3492 v184.y = 296; | |
3493 am_40D2B4(&v184, dmg_e); | |
3494 } | |
3495 if ( buildings_e ) | |
3496 { | |
3497 v184.x = 122; | |
3498 v184.y = 296; | |
3499 am_40D2B4(&v184, buildings_e); | |
3500 } | |
3501 } | |
3502 else | |
3503 { | |
3504 if ( quarry_p ) | |
3505 { | |
3506 v184.x = 26; | |
3507 v184.y = 92; | |
3508 am_40D2B4(&v184, quarry_p); | |
3509 } | |
3510 if ( quarry_e ) | |
3511 { | |
3512 v184.x = 573; | |
3513 v184.y = 92; | |
3514 am_40D2B4(&v184, quarry_e); | |
3515 } | |
3516 if ( magic_p ) | |
3517 { | |
3518 v184.x = 26; | |
3519 v184.y = 164; | |
3520 am_40D2B4(&v184, magic_p); | |
3521 } | |
3522 if ( magic_e ) | |
3523 { | |
3524 v184.x = 573; | |
3525 v184.y = 164; | |
3526 am_40D2B4(&v184, magic_e); | |
3527 } | |
3528 if ( zoo_p ) | |
3529 { | |
3530 v184.x = 26; | |
3531 v184.y = 236; | |
3532 am_40D2B4(&v184, zoo_p); | |
3533 } | |
3534 if ( zoo_e ) | |
3535 { | |
3536 v184.x = 573; | |
3537 v184.y = 236; | |
3538 am_40D2B4(&v184, zoo_e); | |
3539 } | |
3540 if ( bricks_p ) | |
3541 { | |
3542 v184.x = 16; | |
3543 v184.y = 114; | |
3544 am_40D2B4(&v184, bricks_p); | |
3545 } | |
3546 if ( bricks_e ) | |
3547 { | |
3548 v184.x = 563; | |
3549 v184.y = 114; | |
3550 am_40D2B4(&v184, bricks_e); | |
3551 } | |
3552 if ( gems_p ) | |
3553 { | |
3554 v184.x = 16; | |
3555 v184.y = 186; | |
3556 am_40D2B4(&v184, gems_p); | |
3557 } | |
3558 if ( gems_e ) | |
3559 { | |
3560 v184.x = 563; | |
3561 v184.y = 186; | |
3562 am_40D2B4(&v184, gems_e); | |
3563 } | |
3564 if ( beasts_p ) | |
3565 { | |
3566 v184.x = 16; | |
3567 v184.y = 258; | |
3568 am_40D2B4(&v184, beasts_p); | |
3569 } | |
3570 if ( beasts_e ) | |
3571 { | |
3572 v184.x = 563; | |
3573 v184.y = 258; | |
3574 am_40D2B4(&v184, beasts_e); | |
3575 } | |
3576 if ( wall_p ) | |
3577 { | |
3578 v184.x = 180; | |
3579 v184.y = 296; | |
3580 am_40D2B4(&v184, wall_p); | |
3581 } | |
3582 if ( wall_e ) | |
3583 { | |
3584 v184.x = 442; | |
3585 v184.y = 296; | |
3586 am_40D2B4(&v184, wall_e); | |
3587 } | |
3588 if ( tower_p ) | |
3589 { | |
3590 v184.x = 122; | |
3591 v184.y = 296; | |
3592 am_40D2B4(&v184, tower_p); | |
3593 } | |
3594 if ( tower_e ) | |
3595 { | |
3596 v184.x = 514; | |
3597 v184.y = 296; | |
3598 am_40D2B4(&v184, tower_e); | |
3599 } | |
3600 if ( dmg_p ) | |
3601 { | |
3602 v184.x = 180; | |
3603 v184.y = 296; | |
3604 am_40D2B4(&v184, dmg_p); | |
3605 } | |
3606 if ( buildings_p ) | |
3607 { | |
3608 v184.x = 122; | |
3609 v184.y = 296; | |
3610 am_40D2B4(&v184, buildings_p); | |
3611 } | |
3612 if ( dmg_e ) | |
3613 { | |
3614 v184.x = 442; | |
3615 v184.y = 296; | |
3616 am_40D2B4(&v184, dmg_e); | |
3617 } | |
3618 if ( buildings_e ) | |
3619 { | |
3620 v184.x = 514; | |
3621 v184.y = 296; | |
3622 am_40D2B4(&v184, buildings_e); | |
3623 } | |
3624 } | |
3625 #undef APPLY_TO_BOTH | |
3626 #undef APPLY_TO_ENEMY | |
3627 #undef APPLY_TO_PLAYER | |
3628 | |
0 | 3629 } |
3630 | |
3631 | |
3632 | |
3633 | |
3634 //----- (0040D2B4) -------------------------------------------------------- | |
1263 | 3635 int am_40D2B4( POINT* startXY, int effect_value ) |
1185 | 3636 { |
0 | 3637 int v2; // ebp@1 |
1185 | 3638 POINT *v3; // edi@1 |
0 | 3639 int result; // eax@3 |
1194 | 3640 int v6; |
0 | 3641 stru272_stru0 *v8; // ecx@12 |
3642 signed int v11; // [sp+10h] [bp-8h]@1 | |
1194 | 3643 |
0 | 3644 |
3645 v11 = 0; | |
1263 | 3646 v2 = effect_value; |
3647 | |
3648 while ( array_4FABD0[v11].have_effect ) | |
1185 | 3649 { |
3650 result = array_4FABD0[v11].field_40->_40E2A7(); | |
3651 if ( !result ) | |
3652 { | |
1263 | 3653 array_4FABD0[v11].have_effect = 0; |
1185 | 3654 --v11; |
3655 } | |
3656 ++v11; | |
3657 if ( v11 >= 10 ) | |
3658 return result; | |
3659 } | |
3660 v6 = v11; | |
1263 | 3661 array_4FABD0[v11].have_effect = 1; |
3662 if ( effect_value <= 0 ) | |
1185 | 3663 { |
1263 | 3664 array_4FABD0[v6].effect_sign = 0; |
3665 effect_value = -effect_value; | |
1185 | 3666 } |
0 | 3667 else |
1185 | 3668 { |
1263 | 3669 array_4FABD0[v6].effect_sign = 1; |
1185 | 3670 } |
1263 | 3671 array_4FABD0[v6].field_4.effect_area.left = startXY->x - 20; |
3672 array_4FABD0[v6].field_4.effect_area.right = startXY->x + 20; | |
3673 array_4FABD0[v6].field_4.effect_area.top = startXY->y - 20; | |
3674 array_4FABD0[v6].field_4.effect_area.bottom = startXY->y + 20; | |
1186 | 3675 array_4FABD0[v6].field_4.field_10 = -60; |
3676 array_4FABD0[v6].field_4.field_14 = 60; | |
3677 array_4FABD0[v6].field_4.field_18 = 180; | |
3678 array_4FABD0[v6].field_4.field_1Cf = 0.5; | |
3679 array_4FABD0[v6].field_4.field_20 = 150; | |
3680 array_4FABD0[v6].field_4.field_24f= 50.0; | |
3681 array_4FABD0[v6].field_4.field_28f = 3.0; | |
3682 array_4FABD0[v6].field_4.field_2Cf = 8.0; | |
3683 array_4FABD0[v6].field_4.field_30 = 5; | |
3684 array_4FABD0[v6].field_4.field_34 = 15; | |
1263 | 3685 array_4FABD0[v6].field_4.sparks_array = &array_4FABD0[v6].effect_sparks[0]; |
1185 | 3686 v8 = array_4FABD0[v6].field_40; |
1263 | 3687 v8->StartFill(&array_4FABD0[v6].field_4); |
3688 if ( 10 * effect_value > 150 ) | |
3689 effect_value = 15; | |
1185 | 3690 |
1184 | 3691 if ( v8->signature != SIG_trpg ) |
0 | 3692 return 2; |
3693 if ( !v8->field_59 ) | |
3694 return 3; | |
1263 | 3695 v8->position_in_sparks_arr = 10 * effect_value; |
0 | 3696 v8->field_30 = 0.0; |
3697 v8->field_58 = 0; | |
3698 v8->field_44 = 0; | |
3699 v8->field_4C = 0; | |
3700 v8->field_48 = 0; | |
3701 v8->field_50 = 0; | |
1185 | 3702 for (int i=0; i<v8->field_4; ++i) |
1263 | 3703 v8->field_54[i].have_spark=0; |
0 | 3704 return 0; |
3705 } | |
1185 | 3706 |
0 | 3707 |
3708 //----- (0040D402) -------------------------------------------------------- | |
1246 | 3709 int ApplyDamageToBuildings( int player_num, int damage ) |
1218 | 3710 { |
1183 | 3711 ArcomagePlayer *v2; // ecx@1 |
0 | 3712 int v3; // esi@1 |
3713 int result; // eax@3 | |
3714 | |
1218 | 3715 |
3716 v3 = am_Players[player_num].wall_height; | |
0 | 3717 if ( v3 <= 0 ) |
3718 { | |
3719 result = 0; | |
3720 } | |
3721 else | |
3722 { | |
1218 | 3723 if ( v3 >= -damage ) |
0 | 3724 { |
1218 | 3725 result = damage; |
3726 am_Players[player_num].wall_height += damage; | |
1209 | 3727 |
0 | 3728 } |
1209 | 3729 else |
3730 { | |
1218 | 3731 damage += v3; |
0 | 3732 result = -v3; |
1218 | 3733 am_Players[player_num].wall_height = 0; |
3734 am_Players[player_num].tower_height += damage; | |
1209 | 3735 } |
0 | 3736 } |
1209 | 3737 |
1218 | 3738 if ( am_Players[player_num].tower_height < 0 ) |
3739 am_Players[player_num].tower_height = 0; | |
0 | 3740 return result; |
3741 } | |
3742 // 40D402: using guessed type int __fastcall am_40D402(uint, uint); | |
3743 | |
3744 //----- (0040D444) -------------------------------------------------------- | |
1218 | 3745 void GameResultsApply() |
3746 { | |
0 | 3747 int v0; // esi@1 |
3748 int v1; // edi@1 | |
3749 int v2; // eax@1 | |
3750 int v3; // eax@23 | |
3751 int v4; // edx@25 | |
3752 int v5; // ecx@28 | |
3753 int v6; // eax@28 | |
3754 GUIWindow *v7; // ecx@50 | |
3755 signed int v8; // eax@50 | |
1218 | 3756 char v9; // eax@52 |
0 | 3757 signed int v10; // eax@54 |
3758 char *v11; // esi@59 | |
3759 char *v12; // esi@65 | |
3760 signed int v14; // [sp-4h] [bp-58h]@46 | |
3761 char pText[64]; // [sp+Ch] [bp-48h]@1 | |
1218 | 3762 POINT xy; // [sp+4Ch] [bp-8h]@1 |
0 | 3763 |
3764 v0 = -1; | |
3765 v1 = -1; | |
3766 //nullsub_1(); | |
1218 | 3767 xy.x = 0; |
3768 xy.y = 0; | |
3769 strcpy(pText, "The Winner is: ");//"Ïîáåäè" | |
3770 // v2 = 0; | |
3771 xy.y = 160; | |
3772 xy.x = 320; //- 12 * v2 / 2; | |
1183 | 3773 // pPrimaryWindow_draws_text(-1, pText, xy); |
1197 | 3774 if ( am_Players[0].tower_height < max_tower_height ) |
0 | 3775 { |
1197 | 3776 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 3777 goto LABEL_10; |
3778 v0 = 2; | |
3779 } | |
3780 else | |
3781 { | |
1197 | 3782 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 3783 { |
3784 v0 = 1; | |
3785 } | |
3786 else | |
3787 { | |
1197 | 3788 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 3789 { |
3790 v0 = 0; | |
3791 v1 = 4; | |
3792 goto LABEL_10; | |
3793 } | |
1197 | 3794 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 3795 } |
3796 } | |
3797 v1 = 0; | |
3798 LABEL_10: | |
1197 | 3799 if ( am_Players[0].tower_height <= 0 ) |
0 | 3800 { |
1197 | 3801 if ( am_Players[1].tower_height > 0 ) |
0 | 3802 { |
3803 v0 = 2; | |
3804 } | |
3805 else | |
3806 { | |
1197 | 3807 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 3808 { |
3809 LABEL_20: | |
1197 | 3810 if ( am_Players[0].wall_height == am_Players[1].wall_height ) |
0 | 3811 { |
3812 v0 = 0; | |
3813 v1 = 4; | |
3814 } | |
3815 else | |
3816 { | |
1197 | 3817 v0 = (am_Players[0].wall_height <= am_Players[1].wall_height) + 1; |
0 | 3818 v1 = 1; |
3819 } | |
3820 goto LABEL_23; | |
3821 } | |
1197 | 3822 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 3823 } |
3824 goto LABEL_17; | |
3825 } | |
1197 | 3826 if ( am_Players[1].tower_height <= 0 ) |
0 | 3827 { |
3828 v0 = 1; | |
3829 LABEL_17: | |
3830 v1 = 2; | |
3831 } | |
3832 if ( !v0 && v1 == 4 ) | |
3833 goto LABEL_20; | |
3834 LABEL_23: | |
1197 | 3835 v3 = am_Players[0].resource_bricks; |
3836 if ( am_Players[0].resource_bricks <= am_Players[0].resource_gems ) | |
0 | 3837 { |
1197 | 3838 v3 = am_Players[0].resource_beasts; |
3839 v4 = am_Players[0].resource_gems; | |
3840 if ( am_Players[0].resource_gems > am_Players[0].resource_beasts ) | |
0 | 3841 goto LABEL_28; |
3842 } | |
3843 else | |
3844 { | |
1197 | 3845 if ( am_Players[0].resource_bricks <= am_Players[0].resource_beasts ) |
0 | 3846 { |
1197 | 3847 v4 = am_Players[0].resource_beasts; |
0 | 3848 goto LABEL_28; |
3849 } | |
3850 } | |
3851 v4 = v3; | |
3852 LABEL_28: | |
1197 | 3853 v5 = am_Players[1].resource_bricks; |
3854 v6 = am_Players[1].resource_gems; | |
3855 if ( am_Players[1].resource_bricks <= am_Players[1].resource_gems ) | |
0 | 3856 { |
1197 | 3857 v5 = am_Players[1].resource_beasts; |
3858 if ( am_Players[1].resource_gems > am_Players[1].resource_beasts ) | |
0 | 3859 goto LABEL_33; |
3860 goto LABEL_32; | |
3861 } | |
1197 | 3862 v6 = am_Players[1].resource_beasts; |
3863 if ( am_Players[1].resource_bricks > am_Players[1].resource_beasts ) | |
0 | 3864 LABEL_32: |
3865 v6 = v5; | |
3866 LABEL_33: | |
3867 if ( v0 == -1 ) | |
3868 { | |
3869 if ( v1 != -1 ) | |
3870 goto LABEL_49; | |
1197 | 3871 if ( v4 < max_resources_amount ) |
0 | 3872 { |
1197 | 3873 if ( v6 < max_resources_amount ) |
0 | 3874 goto LABEL_49; |
3875 v0 = 2; | |
3876 } | |
3877 else | |
3878 { | |
1197 | 3879 if ( v6 < max_resources_amount ) |
0 | 3880 { |
3881 v0 = 1; | |
3882 } | |
3883 else | |
3884 { | |
3885 if ( v4 == v6 ) | |
3886 goto LABEL_46; | |
3887 v0 = (v4 <= v6) + 1; | |
3888 } | |
3889 } | |
3890 v1 = 3; | |
3891 } | |
3892 if ( !v0 && v1 == 4 ) | |
3893 { | |
3894 if ( v4 != v6 ) | |
3895 { | |
3896 v14 = 5; | |
3897 v0 = (v4 <= v6) + 1; | |
3898 goto LABEL_48; | |
3899 } | |
3900 LABEL_46: | |
3901 v0 = 0; | |
3902 v14 = 4; | |
3903 LABEL_48: | |
3904 v1 = v14; | |
3905 } | |
3906 LABEL_49: | |
3907 pArcomageGame->field_B0 = v1; | |
3908 pArcomageGame->uGameResult = v0; | |
3909 if ( v0 == 1 ) | |
3910 { | |
1218 | 3911 |
1197 | 3912 v8 = (signed int)window_SpeakInHouse->par1C; |
1218 | 3913 if (( v8 >= 108 )&&( v8 <= 120 )) |
0 | 3914 { |
1218 | 3915 if ( !pParty->pArcomageWins[v8-108] ) |
0 | 3916 { |
1218 | 3917 pParty->pArcomageWins[v8-108] = 1; |
3918 auto _a = (signed int)(p2DEvents[ window_SpeakInHouse->par1C - 1].fPriceMultiplier * 100.0); | |
0 | 3919 party_finds_gold(_a, 0); |
3920 } | |
1218 | 3921 |
0 | 3922 } |
3923 v10 = 108; | |
3924 do | |
3925 { | |
1218 | 3926 if ( !pParty->pArcomageWins[v10-108] ) |
0 | 3927 break; |
3928 ++v10; | |
3929 } | |
3930 while ( v10 <= 120 ); | |
1218 | 3931 |
0 | 3932 if ( v10 == 121 ) |
484 | 3933 _449B7E_toggle_bit(pParty->_quest_bits, 238, 1u); |
1218 | 3934 |
3935 | |
3936 for (int i=0; i<4; ++i ) | |
0 | 3937 { |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1393
diff
changeset
|
3938 v11 = (char *)&pParty->pPlayers[i]._achieved_awards_bits; |
0 | 3939 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v11, 1) ) |
949 | 3940 _449B7E_toggle_bit((unsigned char *)v11, PLAYER_GUILD_BITS__ARCOMAGE_WIN, 1); |
1218 | 3941 |
0 | 3942 } |
1218 | 3943 |
949 | 3944 ++pParty->uNumArcomageWins; |
3945 if ( pParty->uNumArcomageWins > 1000000 ) | |
3946 pParty->uNumArcomageWins = 1000000; | |
0 | 3947 } |
3948 else | |
3949 { | |
1218 | 3950 for (int i=0; i<4; ++i ) |
3951 { | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1393
diff
changeset
|
3952 v12 = (char *)&pParty->pPlayers[i]._achieved_awards_bits; |
0 | 3953 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v12, 1) ) |
949 | 3954 _449B7E_toggle_bit((unsigned char *)v12, PLAYER_GUILD_BITS__ARCOMAGE_LOSE, 1); |
0 | 3955 } |
1218 | 3956 |
949 | 3957 ++pParty->uNumArcomageLoses; |
3958 if ( pParty->uNumArcomageLoses > 1000000 ) | |
3959 pParty->uNumArcomageLoses = 1000000; | |
0 | 3960 } |
3961 } | |
3962 | |
3963 | |
3964 | |
3965 //----- (00409C8B) -------------------------------------------------------- | |
1197 | 3966 void PrepareArcomage() |
3967 { | |
0 | 3968 signed __int64 v1; // qax@4 |
3969 int v2; // esi@4 | |
1183 | 3970 int v3; // esi@5 |
0 | 3971 signed int v4; // edi@5 |
3972 int v6; // edx@9 | |
1183 | 3973 RECT pXYZW; // [sp+8h] [bp-1Ch]@5 |
3974 POINT pXY; // [sp+18h] [bp-Ch]@5 | |
0 | 3975 |
3976 pAudioPlayer->StopChannels(-1, -1); | |
1201 | 3977 strcpy(pArcomageGame->pPlayer1Name, Player1Name); |
3978 strcpy(pArcomageGame->pPlayer2Name, Player2Name); | |
0 | 3979 am_byte_4FAA76 = 0; |
3980 am_byte_4FAA75 = 0; | |
1183 | 3981 |
3982 for (int i=0; i<10; ++i) | |
3983 { | |
3984 v2 = (i+1) % 4; | |
3985 v3 = (i+1) / 4; | |
1200 | 3986 shown_cards[i].uCardId = -1; |
3987 shown_cards[i].field_4 = 0; | |
3988 shown_cards[i].field_8.x = 100 * v2 + 120; | |
3989 shown_cards[i].field_8.y = 138 * v3 + 18; | |
3990 shown_cards[i].field_10_xplus = -100 * v2 / 5; | |
3991 shown_cards[i].field_14_y_plus = -138 * v3 / 5; | |
3992 shown_cards[i].field_18_point.x = shown_cards[i].field_8.x; | |
3993 shown_cards[i].field_18_point.y = shown_cards[i].field_8.y; | |
1183 | 3994 } |
3995 | |
3996 pXY.x = 0; | |
3997 pXY.y = 0; | |
0 | 3998 ArcomageGame::LoadBackground(); |
1183 | 3999 pXYZW.left = 0; |
4000 pXYZW.right = 640; | |
4001 pXYZW.top = 0; | |
4002 pXYZW.bottom = 480; | |
0 | 4003 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1183 | 4004 Blt_Copy(&pXYZW, &pXY, 2); |
0 | 4005 am_EndScene(); |
4006 pRenderer->Present(); | |
4007 ArcomageGame::LoadSprites(); | |
4008 CallRenderPresent(); | |
1183 | 4009 |
0 | 4010 v4 = 120; |
1183 | 4011 for (int i=0; i<12; ++i) |
4012 am_sounds[i] = pSoundList->LoadSound(v4++, 0); | |
4013 | |
1184 | 4014 for (int i=0; i<10; ++i) |
1263 | 4015 stru272_stru0::Ctor(&array_4FABD0[i].field_40); |
1184 | 4016 |
1200 | 4017 current_card_slot_index = -1; |
0 | 4018 amuint_4FAA4C = -1; |
4019 byte_4FAA74 = 0; | |
4020 pArcomageGame->field_F4 = 0; | |
4021 byte_4FAA2C = 0; | |
4022 byte_505880 = 0; | |
4023 dword_4FAA70 = 0; | |
1263 | 4024 need_to_discard_card = 0; |
1197 | 4025 SetStartGameData(); |
1200 | 4026 InitalHandsFill(); |
0 | 4027 //nullsub_1(); |
1197 | 4028 pArcomageGame->GameOver = 0; |
1183 | 4029 pArcomageGame->pfntComic = pFontComic; |
4030 pArcomageGame->pfntArrus = pFontArrus; | |
0 | 4031 } |
4032 | |
4033 | |
4034 //----- (0040D711) -------------------------------------------------------- | |
4035 ArcomageGame::ArcomageGame() | |
4036 { | |
1183 | 4037 field_4 = 0; |
0 | 4038 //RGBTexture::RGBTexture(&this->pGameBackground); |
4039 //RGBTexture::RGBTexture(&v1->pSprites); | |
1183 | 4040 bGameInProgress = 0; |
4041 field_F9 = 0; | |
0 | 4042 } |
938 | 4043 |
4044 | |
4045 //----- (00409BE8) -------------------------------------------------------- | |
1197 | 4046 void SetStartConditions() |
938 | 4047 { |
1256 | 4048 const ArcomageStartConditions *st_cond; // eax@1 |
1185 | 4049 |
1200 | 4050 st_cond = &start_conditions[window_SpeakInHouse->par1C - 108]; |
4051 start_tower_height = st_cond->tower_height; | |
4052 start_wall_height = st_cond->wall_height; | |
4053 start_quarry_level = st_cond->quarry_level - 1; | |
4054 start_magic_level = st_cond->magic_level - 1; | |
4055 start_zoo_level = st_cond->zoo_level - 1; | |
4056 minimum_cards_at_hand = 5; | |
1197 | 4057 quarry_bonus = 1; |
4058 magic_bonus = 1; | |
1201 | 4059 zoo_bonus = 1; |
1200 | 4060 max_tower_height = st_cond->max_tower; |
4061 max_resources_amount = st_cond->max_resources; | |
4062 | |
1256 | 4063 opponent_mastery = st_cond->mastery_lvl; |
1200 | 4064 |
4065 start_bricks_amount = st_cond->bricks_amount; | |
4066 start_gems_amount = st_cond->gems_amount; | |
4067 start_beasts_amount = st_cond->beasts_amount; | |
1185 | 4068 |
1183 | 4069 } |
4070 | |
4071 | |
4072 //----- (0040D75D) -------------------------------------------------------- | |
4073 void pPrimaryWindow_draws_text( int a1, const char *pText, POINT *pXY ) | |
4074 { | |
1256 | 4075 pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - ((pFontComic->uFontHeight - 3) >> 1) + 3, 0, pText, 0, 0, 0); |
1183 | 4076 } |
4077 | |
4078 | |
4079 //----- (0040DB27) -------------------------------------------------------- | |
1263 | 4080 void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill ) |
1183 | 4081 { |
1185 | 4082 RECT *v3; // esi@1 |
1183 | 4083 |
4084 v3 = pXYZW; | |
4085 pRenderer->BeginScene(); | |
4086 pRenderer->SetRasterClipRect(0, 0, 639u, 479u); | |
4087 if ( bSolidFill ) | |
4088 { | |
1185 | 4089 for ( int i = v3->top; i <= v3->bottom; ++i ) |
4090 pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor); | |
1183 | 4091 } |
4092 else | |
4093 { | |
1185 | 4094 pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor); |
4095 pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor); | |
4096 pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor); | |
4097 pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor); | |
1183 | 4098 } |
4099 pRenderer->EndScene(); | |
4100 } | |
4101 | |
1263 | 4102 void SetPixel2sq( POINT *pTargetXY, unsigned __int16 uColor ) |
4103 { | |
4104 pRenderer->BeginScene(); | |
4105 if ( pRenderer->uNumSceneBegins ) | |
4106 { | |
4107 int xVal = pTargetXY->x; | |
4108 int yVal = pTargetXY->y; | |
4109 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | |
4110 { | |
4111 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
4112 pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
4113 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor; | |
4114 pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor; | |
4115 } | |
4116 pRenderer->EndScene(); | |
4117 } | |
4118 } | |
1185 | 4119 |
4120 //----- (0040DBD3) -------------------------------------------------------- | |
4121 void SetPixel( POINT *pTargetXY, unsigned __int16 uColor ) | |
4122 { | |
4123 pRenderer->BeginScene(); | |
4124 if ( pRenderer->uNumSceneBegins ) | |
4125 { | |
4126 int xVal = pTargetXY->x; | |
4127 int yVal = pTargetXY->y; | |
4128 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | |
4129 { | |
4130 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
4131 } | |
4132 pRenderer->EndScene(); | |
4133 } | |
4134 } | |
4135 | |
4136 | |
1183 | 4137 //----- (0040DDB1) -------------------------------------------------------- |
1263 | 4138 int rand_interval( int min, int max ) |
1183 | 4139 { |
1263 | 4140 return min + rand() % (max - min + 1); |
1183 | 4141 } |
4142 | |
4143 | |
4144 //----- (0040DEC8) -------------------------------------------------------- | |
4145 void __fastcall intToString(int val, char *pOut) | |
4146 { | |
4147 sprintf(pOut, "%d", val); | |
4148 } | |
1303 | 4149 |
4150 void set_stru1_field_8_InArcomage(int inValue) | |
4151 { | |
4152 switch(inValue) | |
4153 { | |
4154 case 91:LOBYTE(pArcomageGame->stru1.field_8) = 123;break; | |
4155 case 92:LOBYTE(pArcomageGame->stru1.field_8) = 124;break; | |
4156 case 93:LOBYTE(pArcomageGame->stru1.field_8) = 125;break; | |
4157 case 96:LOBYTE(pArcomageGame->stru1.field_8) = 126;break; | |
4158 case 61:LOBYTE(pArcomageGame->stru1.field_8) = 43;break; | |
4159 case 55:LOBYTE(pArcomageGame->stru1.field_8) = 38;break; | |
4160 case 56:LOBYTE(pArcomageGame->stru1.field_8) = 42;break; | |
4161 case 57:LOBYTE(pArcomageGame->stru1.field_8) = 40;break; | |
4162 case 59:LOBYTE(pArcomageGame->stru1.field_8) = 58;break; | |
4163 case 54:LOBYTE(pArcomageGame->stru1.field_8) = 94;break; | |
4164 case 50:LOBYTE(pArcomageGame->stru1.field_8) = 64;break; | |
4165 case 51:LOBYTE(pArcomageGame->stru1.field_8) = 35;break; | |
4166 case 52:LOBYTE(pArcomageGame->stru1.field_8) = 36;break; | |
4167 case 53:LOBYTE(pArcomageGame->stru1.field_8) = 37;break; | |
4168 case 49:LOBYTE(pArcomageGame->stru1.field_8) = 33;break; | |
4169 case 39:LOBYTE(pArcomageGame->stru1.field_8) = 34;break; | |
4170 case 44:LOBYTE(pArcomageGame->stru1.field_8) = 60;break; | |
4171 case 46:LOBYTE(pArcomageGame->stru1.field_8) = 62;break; | |
4172 case 47:LOBYTE(pArcomageGame->stru1.field_8) = 63;break; | |
4173 case 48:LOBYTE(pArcomageGame->stru1.field_8) = 41;break; | |
4174 default:LOBYTE(pArcomageGame->stru1.field_8) = inValue;break; | |
4175 } | |
4176 } |