comparison Arcomage/Arcomage.cpp @ 2508:491f0babd563

use_music_folder
author Ritor1
date Thu, 02 Oct 2014 11:52:31 +0600
parents a77c34acdbc9
children 1bcadc6dd203
comparison
equal deleted inserted replaced
2507:6dcc6e8dd041 2508:491f0babd563
533 case 10: 533 case 10:
534 case 11: 534 case 11:
535 case 13: 535 case 13:
536 play_sound_id = SOUND_Arcomage_130; 536 play_sound_id = SOUND_Arcomage_130;
537 break; 537 break;
538 case 55u: 538 case 55:
539 play_sound_id = SOUND_Arcomage_131; 539 play_sound_id = SOUND_Arcomage_131;
540 break; 540 break;
541 case 49: 541 case 49:
542 case 51: 542 case 51:
543 play_sound_id = SOUND_Arcomage_WallUpgrade; 543 play_sound_id = SOUND_Arcomage_WallUpgrade;
973 int all_player_cards_count; // eax@9 973 int all_player_cards_count; // eax@9
974 int random_card_slot; // edi@9 974 int random_card_slot; // edi@9
975 ArcomageCard *v12; // ecx@20 975 ArcomageCard *v12; // ecx@20
976 int v56; // ecx@141 976 int v56; // ecx@141
977 int v57; // edx@141 977 int v57; // edx@141
978 // int v64; // eax@169
979 // ArcomageCard *pCard; // ecx@169
980 // char v66; // dl@169
981 // char v67; // dl@173
982 // int v68; // edx@174
983 int v132; // [sp-14h] [bp-14h]@0 978 int v132; // [sp-14h] [bp-14h]@0
984 ArcomagePlayer *enemy; // [sp-10h] [bp-10h]@5 979 ArcomagePlayer *enemy; // [sp-10h] [bp-10h]@5
985 ArcomagePlayer *player; // [sp-Ch] [bp-Ch]@5 980 ArcomagePlayer *player; // [sp-Ch] [bp-Ch]@5
986 981
987 byte_4FAA00 = 1; 982 byte_4FAA00 = 1;
1325 1320
1326 //----- (0040A383) -------------------------------------------------------- 1321 //----- (0040A383) --------------------------------------------------------
1327 void TurnChange() 1322 void TurnChange()
1328 { 1323 {
1329 char player_name[64]; // [sp+4h] [bp-64h]@4 1324 char player_name[64]; // [sp+4h] [bp-64h]@4
1330 // RECT v6; // [sp+44h] [bp-24h]@6
1331 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7 1325 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7
1332 POINT v11; // [sp+60h] [bp-8h]@4 1326 POINT v11; // [sp+60h] [bp-8h]@4
1333 1327
1334 if ( !pArcomageGame->field_F4 ) 1328 if ( !pArcomageGame->field_F4 )
1335 { 1329 {
1420 } 1414 }
1421 1415
1422 //----- (0040A560) -------------------------------------------------------- 1416 //----- (0040A560) --------------------------------------------------------
1423 char PlayerTurn( int player_num ) 1417 char PlayerTurn( int player_num )
1424 { 1418 {
1425 // int v1; // ebp@0
1426 // unsigned __int64 v2; // qax@3
1427 unsigned __int64 v3; // kr00_8@3 1419 unsigned __int64 v3; // kr00_8@3
1428 1420
1429 // int v5; // esi@67
1430 // char Dest[100]; // [sp+8h] [bp-A8h]@67
1431 // int v8; // [sp+6Ch] [bp-44h]@3
1432 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75 1421 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75
1433 // int v10[4]; // [sp+80h] [bp-30h]@69
1434 POINT pTargetXY; // [sp+90h] [bp-20h]@75 1422 POINT pTargetXY; // [sp+90h] [bp-20h]@75
1435 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8 1423 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8
1436 int animation_stage; // [sp+A4h] [bp-Ch]@1 1424 int animation_stage; // [sp+A4h] [bp-Ch]@1
1437 // char v15; // [sp+AEh] [bp-2h]@63
1438 bool break_loop; // [sp+AFh] [bp-1h]@1 1425 bool break_loop; // [sp+AFh] [bp-1h]@1
1439 1426
1440 uCardID = -1; 1427 uCardID = -1;
1441 break_loop = false; 1428 break_loop = false;
1442 animation_stage = 20; 1429 animation_stage = 20;
2065 //----- (0040B400) -------------------------------------------------------- 2052 //----- (0040B400) --------------------------------------------------------
2066 void DrawPlayersWall() 2053 void DrawPlayersWall()
2067 { 2054 {
2068 int v0; // eax@1 2055 int v0; // eax@1
2069 int v1; // eax@4 2056 int v1; // eax@4
2070 // LONG v2; // ecx@4
2071 int v3; // eax@5 2057 int v3; // eax@5
2072 int v4; // eax@8 2058 int v4; // eax@8
2073 // LONG v5; // esi@8
2074 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4 2059 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4
2075 POINT pTargetXY; // [sp+14h] [bp-8h]@4 2060 POINT pTargetXY; // [sp+14h] [bp-8h]@4
2076 2061
2077 v0 = am_Players[0].wall_height; 2062 v0 = am_Players[0].wall_height;
2078 2063
2108 2093
2109 //----- (0040B4B9) -------------------------------------------------------- 2094 //----- (0040B4B9) --------------------------------------------------------
2110 void DrawCards() 2095 void DrawCards()
2111 { 2096 {
2112 int v0; // esi@1 2097 int v0; // esi@1
2113 // char v1; // bl@1
2114 int v2; // edi@1 2098 int v2; // edi@1
2115 //int v3; // edx@2
2116 // int v4; // eax@3
2117 // int v5; // ecx@3
2118 // int v6; // eax@3
2119 unsigned int v7; // ecx@4 2099 unsigned int v7; // ecx@4
2120 // int v8; // eax@16
2121 // int v9; // ecx@16
2122 // int v10; // eax@16
2123 signed int v11; // edi@18 2100 signed int v11; // edi@18
2124 // signed int v12; // esi@20
2125 // int v13; // ecx@20
2126 // int v14; // eax@23
2127 // signed int v15; // eax@25
2128 // int v16; // ecx@25
2129 // POINT *v17; // esi@26
2130 // signed int v18; // eax@29
2131 // AcromageCardOnTable *v19; // ecx@29
2132 // int v20; // ecx@31
2133 // int v21; // [sp-4h] [bp-2Ch]@8
2134 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@8 2101 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@8
2135 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@1 2102 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@1
2136 int v24; // [sp+24h] [bp-4h]@1 2103 int v24; // [sp+24h] [bp-4h]@1
2137 2104
2138 v0 = GetPlayerHandCardCount(current_player_num); 2105 v0 = GetPlayerHandCardCount(current_player_num);
2249 //----- (0040B76F) -------------------------------------------------------- 2216 //----- (0040B76F) --------------------------------------------------------
2250 void DrawCardAnimation( int animation_stage ) 2217 void DrawCardAnimation( int animation_stage )
2251 { 2218 {
2252 int v1; // eax@3 2219 int v1; // eax@3
2253 int v2; // eax@3 2220 int v2; // eax@3
2254 // int v3; // esi@4
2255 int v4; // eax@4 2221 int v4; // eax@4
2256 // POINT *v5; // edx@6
2257 // RECT *v6; // ecx@6
2258 int v8; // eax@15 2222 int v8; // eax@15
2259 // AcromageCardOnTable *v9; // ecx@15
2260 // int v10; // ecx@19
2261 // int v11; // eax@20
2262 // int v12; // ecx@20
2263 // int v13; // eax@20
2264 // unsigned int v14; // ecx@21
2265 double v15; // st7@22 2223 double v15; // st7@22
2266 // POINT *v16; // edx@23
2267 int v17; // eax@32 2224 int v17; // eax@32
2268 char v18; // zf@37 2225 char v18; // zf@37
2269 int v19; // eax@41 2226 int v19; // eax@41
2270 // int v20; // eax@46
2271 // int v21; // ecx@46
2272 // int v22; // eax@46
2273 // int v23; // [sp-4h] [bp-2Ch]@28
2274 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6 2227 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6
2275 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20 2228 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20
2276 int v26; // [sp+24h] [bp-4h]@1 2229 int v26; // [sp+24h] [bp-4h]@1
2277 2230
2278 v26 = animation_stage; 2231 v26 = animation_stage;
2466 2419
2467 //----- (0040BB67) -------------------------------------------------------- 2420 //----- (0040BB67) --------------------------------------------------------
2468 signed int DrawCardsRectangles( int player_num ) 2421 signed int DrawCardsRectangles( int player_num )
2469 { 2422 {
2470 int v5; // eax@3 2423 int v5; // eax@3
2471 // int i; // ecx@6
2472 int color; // ST00_4@19 2424 int color; // ST00_4@19
2473 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3 2425 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3
2474 stru273 v26; // [sp+1Ch] [bp-2Ch]@2 2426 stru273 v26; // [sp+1Ch] [bp-2Ch]@2
2475 __int32 var18; // [sp+30h] [bp-18h]@3 2427 __int32 var18; // [sp+30h] [bp-18h]@3
2476 int hand_index; // [sp+3Ch] [bp-Ch]@3 2428 int hand_index; // [sp+3Ch] [bp-Ch]@3
2531 2483
2532 //----- (0040BCFB) -------------------------------------------------------- 2484 //----- (0040BCFB) --------------------------------------------------------
2533 bool DiscardCard( int player_num, signed int card_slot_index ) 2485 bool DiscardCard( int player_num, signed int card_slot_index )
2534 { 2486 {
2535 int v2; // esi@2 2487 int v2; // esi@2
2536 // signed int v3; // edi@2
2537 // char *v4; // eax@2
2538 // int v5; // ecx@7
2539 // int v6; // ebx@7
2540 // int v7; // esi@8
2541 int v8; // eax@8 2488 int v8; // eax@8
2542 // int v9; // esi@8
2543 int v10; // ecx@8 2489 int v10; // ecx@8
2544 // int v11; // eax@8
2545 int v12; // eax@8 2490 int v12; // eax@8
2546 // signed int v13; // edx@9
2547 // unsigned int v14; // eax@12
2548 // char result; // al@12
2549 int i; 2491 int i;
2550 2492
2551 if ( card_slot_index <= -1 ) 2493 if ( card_slot_index <= -1 )
2552 return false; 2494 return false;
2553 v2 = 0; 2495 v2 = 0;
2592 } 2534 }
2593 2535
2594 //----- (0040BE0E) -------------------------------------------------------- 2536 //----- (0040BE0E) --------------------------------------------------------
2595 bool PlayCard( int player_num, int card_slot_num ) 2537 bool PlayCard( int player_num, int card_slot_num )
2596 { 2538 {
2597 // int v3; // ebp@1
2598 int v4; // ecx@2 2539 int v4; // ecx@2
2599 // ArcomagePlayer *v5; // esi@2
2600 int card_index; // edi@2 2540 int card_index; // edi@2
2601 // int v7; // eax@2
2602 // int v8; // ebx@8
2603 int cards_at_hand; // eax@8 2541 int cards_at_hand; // eax@8
2604 // int v10; // ebx@8
2605 // int v11; // ebp@8
2606 int v12; // ecx@8 2542 int v12; // ecx@8
2607 // int v13; // eax@8
2608 ArcomageCard *pCard; // eax@8 2543 ArcomageCard *pCard; // eax@8
2609 // int v15; // ecx@8
2610 // int v16; // ecx@8
2611 2544
2612 if ( card_slot_num <= -1 ) 2545 if ( card_slot_num <= -1 )
2613 return false; 2546 return false;
2614 2547
2615 v4 = 0; 2548 v4 = 0;
2716 if ( ENEMY->##FIELD < 0 ) {ENEMY->##FIELD = 0;} \ 2649 if ( ENEMY->##FIELD < 0 ) {ENEMY->##FIELD = 0;} \
2717 RES_P = (signed int)(VAL); RES_E = (signed int)(VAL); \ 2650 RES_P = (signed int)(VAL); RES_E = (signed int)(VAL); \
2718 }\ 2651 }\
2719 } 2652 }
2720 ArcomagePlayer *player; // esi@1 2653 ArcomagePlayer *player; // esi@1
2721 // int v3; // eax@1
2722 ArcomagePlayer *enemy; // edi@1 2654 ArcomagePlayer *enemy; // edi@1
2723 // int v5; // eax@2
2724 // char v6; // sf@2
2725 // unsigned __int8 v7; // of@2
2726 // int v8; // eax@3
2727 // int v9; // eax@4
2728 // char v10; // zf@5
2729 // int v11; // eax@8
2730 // unsigned __int8 v12; // zf@8
2731 // char v13; // sf@8
2732 // unsigned __int8 v14; // of@8
2733 // int v15; // eax@9
2734 // int v16; // eax@10
2735 // char v17; // zf@12
2736 // char v18; // al@15
2737 // int v19; // eax@16
2738 // int v20; // eax@17
2739 // int v21; // eax@22
2740 // int v22; // eax@23
2741 int v23; // eax@26 2655 int v23; // eax@26
2742 signed int v24; // ebx@26 2656 signed int v24; // ebx@26
2743 int v103; 2657 int v103;
2744 int v104; 2658 int v104;
2745 2659
2870 if ( player->tower_height < enemy->tower_height ) 2784 if ( player->tower_height < enemy->tower_height )
2871 goto LABEL_26; 2785 goto LABEL_26;
2872 goto LABEL_231; 2786 goto LABEL_231;
2873 default: 2787 default:
2874 LABEL_26: 2788 LABEL_26:
2875 v23 = pCard->draw_extra_card_count; 2789 dword_4FAA68 = pCard->draw_extra_card_count + (pCard->field_30 == 1);
2876 v24 = 0; 2790 dword_4FAA64 = pCard->draw_extra_card_count;
2877 dword_4FAA68 = v23 + (pCard->field_30 == 1); 2791 for ( uint i = 0; i < pCard->draw_extra_card_count; i++ )
2878 dword_4FAA64 = v23; 2792 GetNextCardFromDeck(player_num);
2879 if ( v23 > 0 )
2880 {
2881 do
2882 {
2883 GetNextCardFromDeck(player_num);
2884 ++v24;
2885 }
2886 while ( v24 < pCard->draw_extra_card_count );
2887 }
2888 2793
2889 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; 2794 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand;
2890 2795
2891 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl, quarry_p); 2796 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl, quarry_p);
2892 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl, magic_p); 2797 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl, magic_p);
2932 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall, wall_p, wall_e); 2837 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall, wall_p, wall_e);
2933 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower, tower_p, tower_e); 2838 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower, tower_p, tower_e);
2934 break; 2839 break;
2935 case 0: 2840 case 0:
2936 LABEL_231: 2841 LABEL_231:
2937 v103 = pCard->can_draw_extra_card2; 2842 dword_4FAA68 = pCard->can_draw_extra_card2 + (pCard->field_4D == 1);
2938 v104 = 0; 2843 dword_4FAA64 = pCard->can_draw_extra_card2;
2939 dword_4FAA68 = v103 + (pCard->field_4D == 1); 2844 for ( uint i = 0; i < pCard->can_draw_extra_card2; i++ )
2940 dword_4FAA64 = v103; 2845 GetNextCardFromDeck(player_num);
2941 if ( v103 > 0 )
2942 {
2943 do
2944 {
2945 GetNextCardFromDeck(player_num);
2946 ++v104;
2947 }
2948 while ( v104 < pCard->can_draw_extra_card2 );
2949 }
2950 2846
2951 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; 2847 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand;
2952 2848
2953 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl2, quarry_p); 2849 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl2, quarry_p);
2954 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl2, magic_p); 2850 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl2, magic_p);
3285 3181
3286 //----- (0040D2B4) -------------------------------------------------------- 3182 //----- (0040D2B4) --------------------------------------------------------
3287 int am_40D2B4( POINT* startXY, int effect_value ) 3183 int am_40D2B4( POINT* startXY, int effect_value )
3288 { 3184 {
3289 int v2; // ebp@1 3185 int v2; // ebp@1
3290 // POINT *v3; // edi@1
3291 int result; // eax@3 3186 int result; // eax@3
3292 int v6; 3187 int v6;
3293 stru272_stru0 *v8; // ecx@12 3188 stru272_stru0 *v8; // ecx@12
3294 signed int v11; // [sp+10h] [bp-8h]@1 3189 signed int v11; // [sp+10h] [bp-8h]@1
3295 3190
3354 } 3249 }
3355 3250
3356 //----- (0040D402) -------------------------------------------------------- 3251 //----- (0040D402) --------------------------------------------------------
3357 int ApplyDamageToBuildings( int player_num, int damage ) 3252 int ApplyDamageToBuildings( int player_num, int damage )
3358 { 3253 {
3359 // ArcomagePlayer *v2; // ecx@1
3360 int v3; // esi@1 3254 int v3; // esi@1
3361 int result; // eax@3 3255 int result; // eax@3
3362 3256
3363 v3 = am_Players[player_num].wall_height; 3257 v3 = am_Players[player_num].wall_height;
3364 //if ( v3 <= 0 ) 3258 //if ( v3 <= 0 )
3390 int winner; // esi@1 3284 int winner; // esi@1
3391 int victory_type; // edi@1 3285 int victory_type; // edi@1
3392 int pl_resource; // edx@25 3286 int pl_resource; // edx@25
3393 int en_resource; // eax@28 3287 int en_resource; // eax@28
3394 unsigned int tavern_num; // eax@54 3288 unsigned int tavern_num; // eax@54
3395 // char pText[64]; // [sp+Ch] [bp-48h]@1
3396 // POINT xy; // [sp+4Ch] [bp-8h]@1
3397 3289
3398 winner = -1; 3290 winner = -1;
3399 victory_type = -1; 3291 victory_type = -1;
3400 //nullsub_1(); 3292 //nullsub_1();
3401 /*strcpy(pText, "The Winner is: ");//"Победил: " Ritor1: архаизм 3293 /*strcpy(pText, "The Winner is: ");//"Победил: " Ritor1: архаизм
3568 } 3460 }
3569 3461
3570 //----- (00409C8B) -------------------------------------------------------- 3462 //----- (00409C8B) --------------------------------------------------------
3571 void ArcomageGame::PrepareArcomage() 3463 void ArcomageGame::PrepareArcomage()
3572 { 3464 {
3573 // signed __int64 v1; // qax@4
3574 int v2; // esi@4 3465 int v2; // esi@4
3575 int v3; // esi@5 3466 int v3; // esi@5
3576 signed int v4; // edi@5 3467 signed int v4; // edi@5
3577 // int v6; // edx@9
3578 RECT pXYZW; // [sp+8h] [bp-1Ch]@5 3468 RECT pXYZW; // [sp+8h] [bp-1Ch]@5
3579 POINT pXY; // [sp+18h] [bp-Ch]@5 3469 POINT pXY; // [sp+18h] [bp-Ch]@5
3580 3470
3581 pAudioPlayer->StopChannels(-1, -1); 3471 pAudioPlayer->StopChannels(-1, -1);
3582 strcpy(pArcomageGame->pPlayer1Name, Player1Name); 3472 strcpy(pArcomageGame->pPlayer1Name, Player1Name);