Mercurial > mm7
comparison mm7_2.cpp @ 1052:d48c762de563
-nomarg
author | Nomad |
---|---|
date | Thu, 23 May 2013 18:26:05 +0200 |
parents | 05c62d166182 |
children | cbb1baa606aa |
comparison
equal
deleted
inserted
replaced
1051:05c62d166182 | 1052:d48c762de563 |
---|---|
3818 Actor *v6; // esi@16 | 3818 Actor *v6; // esi@16 |
3819 char *v7; // ebx@16 | 3819 char *v7; // ebx@16 |
3820 MonsterDesc *v8; // edi@16 | 3820 MonsterDesc *v8; // edi@16 |
3821 unsigned __int16 v9; // ax@16 | 3821 unsigned __int16 v9; // ax@16 |
3822 int v10; // ebx@16 | 3822 int v10; // ebx@16 |
3823 int v11; // edi@16 | 3823 //int v11; // edi@16 |
3824 int v12; // eax@16 | 3824 //int v12; // eax@16 |
3825 int v13; // ecx@16 | 3825 //int v13; // ecx@16 |
3826 int v14; // ebx@16 | 3826 //int v14; // ebx@16 |
3827 const char *v15; // [sp-4h] [bp-24h]@2 | 3827 const char *v15; // [sp-4h] [bp-24h]@2 |
3828 unsigned __int16 v16; // [sp+0h] [bp-20h]@1 | 3828 //unsigned __int16 v16; // [sp+0h] [bp-20h]@1 |
3829 int v17; // [sp+4h] [bp-1Ch]@1 | 3829 //int v17; // [sp+4h] [bp-1Ch]@1 |
3830 unsigned int uFaceID; // [sp+8h] [bp-18h]@16 | 3830 unsigned int uFaceID; // [sp+8h] [bp-18h]@16 |
3831 int v19; // [sp+Ch] [bp-14h]@16 | 3831 int v19; // [sp+Ch] [bp-14h]@16 |
3832 size_t v20; // [sp+10h] [bp-10h]@6 | 3832 size_t v20; // [sp+10h] [bp-10h]@6 |
3833 int v21; // [sp+14h] [bp-Ch]@14 | 3833 int v21; // [sp+14h] [bp-Ch]@14 |
3834 int v22; // [sp+18h] [bp-8h]@14 | 3834 //int v22; // [sp+18h] [bp-8h]@14 |
3835 unsigned int v23; // [sp+1Ch] [bp-4h]@6 | 3835 unsigned int v23; // [sp+1Ch] [bp-4h]@6 |
3836 | 3836 |
3837 v16 = a2; | 3837 //v16 = a2; |
3838 v17 = a1; | 3838 //v17 = a1; |
3839 if ( a2 == 4 ) | 3839 if ( a2 == 4 ) |
3840 { | 3840 { |
3841 v15 = "Elemental Light C"; | 3841 v15 = "Elemental Light C"; |
3842 } | 3842 } |
3843 else | 3843 else if ( a2 == 3 ) |
3844 { | |
3845 if ( a2 == 3 ) | |
3846 v15 = "Elemental Light B"; | 3844 v15 = "Elemental Light B"; |
3847 else | 3845 else |
3848 v15 = "Elemental Light A"; | 3846 v15 = "Elemental Light A"; |
3849 } | 3847 |
3850 v23 = pMonsterList->GetMonsterIDByName(v15); | 3848 v23 = pMonsterList->GetMonsterIDByName(v15); |
3851 v3 = 0; | 3849 v3 = 0; |
3852 v20 = uNumActors; | 3850 v20 = uNumActors; |
3853 if ( (signed int)uNumActors > 0 ) | 3851 if ( (signed int)uNumActors > 0 ) |
3854 { | 3852 { |
3855 v4 = pActors;//[0].uAIState; | 3853 v4 = pActors;//[0].uAIState; |
3856 while ( v4->uAIState != Removed ) | 3854 while ( v4->uAIState != Removed ) |
3857 { | 3855 { |
3858 ++v3; | 3856 ++v3; |
3859 ++v4; | 3857 ++v4; |
3860 if ( v3 >= (signed int)uNumActors ) | 3858 if ( v3 >= (signed int)uNumActors ) |
3861 break; | 3859 break; |
3862 } | 3860 } |
3863 if( v3 < (signed int)uNumActors ) | 3861 if( v3 < (signed int)uNumActors ) |
3864 v20 = v3; | 3862 v20 = v3; |
3865 } | 3863 } |
3866 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) ) | 3864 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) ) |
3867 { | 3865 { |
3868 v21 = 0; | 3866 v21 = 0; |
3869 v22 = pParty->vPosition.z; | 3867 //v22 = pParty->vPosition.z; |
3870 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | 3868 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
3871 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | 3869 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
3872 v6 = &pActors[v20]; | 3870 v6 = &pActors[v20]; |
3873 v7 = (char *)&pMonsterStats->pInfos[v23 + 1]; | 3871 v7 = (char *)&pMonsterStats->pInfos[v23 + 1]; |
3874 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64; | 3872 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64; |
3884 v6->pMonsterInfo.uTreasureDiceRolls = 0; | 3882 v6->pMonsterInfo.uTreasureDiceRolls = 0; |
3885 v6->pMonsterInfo.uTreasureType = 0; | 3883 v6->pMonsterInfo.uTreasureType = 0; |
3886 v6->pMonsterInfo.uExp = 0; | 3884 v6->pMonsterInfo.uExp = 0; |
3887 v6->uMovementSpeed = v9; | 3885 v6->uMovementSpeed = v9; |
3888 v10 = rand() % 2048; | 3886 v10 = rand() % 2048; |
3889 v11 = ((unsigned __int64)(stru_5C6E00->Cos(v10) * (signed __int64)v19) >> 16) + pParty->vPosition.x; | 3887 //v11 = pParty->vPosition.x + fixpoint_sub0(stru_5C6E00->Cos(v10), v19); |
3890 uFaceID = stru_5C6E00->Sin(v10); | 3888 uFaceID = stru_5C6E00->Sin(v10); |
3891 v23 = (unsigned __int64)(uFaceID * (signed __int64)v19) >> 16; | 3889 //v12 = pParty->vPosition.y; |
3892 v12 = pParty->vPosition.y; | 3890 //v13 = fixpoint_sub0(uFaceID, v19); |
3893 v13 = (unsigned __int64)(uFaceID * (signed __int64)v19) >> 16; | 3891 //v14 = pParty->vPosition.y + fixpoint_sub0(uFaceID, v19); |
3894 v6->vInitialPosition.x = v11; | 3892 //LOWORD(v12) = v22; |
3895 v14 = v13 + v12; | 3893 v6->vInitialPosition.x = pParty->vPosition.x + fixpoint_sub0(stru_5C6E00->Cos(v10), v19); |
3896 LOWORD(v12) = v22; | 3894 v6->vPosition.x = v6->vInitialPosition.x; |
3897 v6->vInitialPosition.z = v22; | 3895 v6->vInitialPosition.y = pParty->vPosition.y + fixpoint_sub0(uFaceID, v19); |
3898 v6->vPosition.z = v12; | 3896 v6->vPosition.y = v6->vInitialPosition.y; |
3899 LOWORD(v12) = v21; | 3897 v6->vInitialPosition.z = pParty->vPosition.z; |
3900 v6->vPosition.x = v11; | 3898 v6->vPosition.z = v6->vInitialPosition.z; |
3901 v6->vInitialPosition.y = v14; | 3899 //LOWORD(v12) = v21; |
3902 v6->vPosition.y = v14; | |
3903 v6->uTetherDistance = 256; | 3900 v6->uTetherDistance = 256; |
3904 v6->uSectorID = v12; | 3901 v6->uSectorID = v21; |
3905 v6->PrepareSprites(0); | 3902 v6->PrepareSprites(0); |
3906 v6->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 3903 v6->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
3907 v6->uAlly = 9999; | 3904 v6->uAlly = 9999; |
3908 v6->uGroup = 0; | 3905 v6->uGroup = 0; |
3909 v6->uCurrentActionTime = 0; | 3906 v6->uCurrentActionTime = 0; |
3910 v6->uAIState = Summoned; | 3907 v6->uAIState = Summoned; |
3911 v6->uCurrentActionLength = 256; | 3908 v6->uCurrentActionLength = 256; |
3912 v6->UpdateAnimation(); | 3909 v6->UpdateAnimation(); |
3913 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor | 3910 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor |
3914 || (v22 = pParty->vPosition.z, | 3911 || (result = pIndoor->GetSector(v6->vPosition.x, v6->vPosition.y, v6->vPosition.z), |
3915 result = pIndoor->GetSector(v11, v14, pParty->vPosition.z), | |
3916 result == v21) | 3912 result == v21) |
3917 && (result = BLV_GetFloorLevel(v11, v14, v22, result, &uFaceID), result != -30000) | 3913 && (result = BLV_GetFloorLevel(v6->vPosition.x, v6->vPosition.y, v6->vPosition.z, result, &uFaceID), result != -30000) |
3918 && (result = abs(result - v22), result <= 1024) ) | 3914 && (result = abs(result - pParty->vPosition.z), result <= 1024) ) |
3919 { | 3915 { |
3920 if ( v20 == uNumActors ) | 3916 if ( v20 == uNumActors ) |
3921 ++uNumActors; | 3917 ++uNumActors; |
3922 v6->uSummonerID = PID(OBJECT_Player,v17); | 3918 v6->uSummonerID = PID(OBJECT_Player, a1); |
3923 result = v6->pActorBuffs[2].Apply( | 3919 result = v6->pActorBuffs[2].Apply(pParty->uTimePlayed + (a3 * 128) / 30.0f, |
3924 pParty->uTimePlayed + (signed __int64)((double)(a3 << 7) * 0.033333335), | 3920 a2, |
3925 v16, | 3921 a1, |
3926 v17, | |
3927 0, | 3922 0, |
3928 0); | 3923 0); |
3929 } | 3924 } |
3930 } | 3925 } |
3931 return result; | 3926 return result; |
7205 return 0; | 7200 return 0; |
7206 } | 7201 } |
7207 if ( wParam == VK_ESCAPE ) | 7202 if ( wParam == VK_ESCAPE ) |
7208 { | 7203 { |
7209 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0); | 7204 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0); |
7210 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
7211 { | |
7212 v12 = window_SpeakInHouse == 0; | |
7213 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
7214 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12; | |
7215 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
7216 ++pMessageQueue_50CBD0->uNumMessages; | |
7217 }*/ | |
7218 return 0; | 7205 return 0; |
7219 } | 7206 } |
7220 if ( wParam <= VK_HOME ) | 7207 if ( wParam <= VK_HOME ) |
7221 return 0; | 7208 return 0; |
7222 if ( wParam > VK_DOWN ) | 7209 if ( wParam > VK_DOWN ) |
7229 v36 = 273; | 7216 v36 = 273; |
7230 v35 = hWnd; | 7217 v35 = hWnd; |
7231 SendMessageA(hWnd, WM_COMMAND, v37, v38); | 7218 SendMessageA(hWnd, WM_COMMAND, v37, v38); |
7232 return 0; | 7219 return 0; |
7233 } | 7220 } |
7234 if ( pCurrentScreen | 7221 if ( pCurrentScreen != SCREEN_GAME |
7235 && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) | 7222 && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) |
7236 return 0; | 7223 return 0; |
7237 } | 7224 } |
7238 if ( !viewparams->field_4C ) | 7225 if ( !viewparams->field_4C ) |
7239 UI_OnKeyDown(wParam); | 7226 UI_OnKeyDown(wParam); |
9320 | 9307 |
9321 IntegrityTest(); | 9308 IntegrityTest(); |
9322 char test[1024]; | 9309 char test[1024]; |
9323 sprintfex(test, "^Pi[%s]: знахар^R[ь;ка;]", "Золтан"); | 9310 sprintfex(test, "^Pi[%s]: знахар^R[ь;ка;]", "Золтан"); |
9324 | 9311 |
9325 | 9312 bool bNoMargareth = false; |
9326 if (pCmdLine && *pCmdLine) | 9313 if (pCmdLine && *pCmdLine) |
9327 { | 9314 { |
9328 if (wcsstr(pCmdLine, L"-usedefs")) | 9315 if (wcsstr(pCmdLine, L"-usedefs")) |
9329 bDebugResouces = 1; | 9316 bDebugResouces = 1; |
9330 if (wcsstr(pCmdLine, L"-window")) | 9317 if (wcsstr(pCmdLine, L"-window")) |
9347 } | 9334 } |
9348 if (wcsstr(pCmdLine, L"-nocd")) | 9335 if (wcsstr(pCmdLine, L"-nocd")) |
9349 bNoCD = true; | 9336 bNoCD = true; |
9350 if (wcsstr(pCmdLine, L"-new_sky")) | 9337 if (wcsstr(pCmdLine, L"-new_sky")) |
9351 new_sky = true; | 9338 new_sky = true; |
9339 if (wcsstr(pCmdLine, L"-nomarg")) | |
9340 bNoMargareth = true; | |
9352 } | 9341 } |
9353 | 9342 |
9354 | 9343 |
9355 /*v8 = _4AC1C9_get_cpu_speed(0, (Vec4_int_ *)a2); | 9344 /*v8 = _4AC1C9_get_cpu_speed(0, (Vec4_int_ *)a2); |
9356 Rect.left = *(int *)v8; | 9345 Rect.left = *(int *)v8; |
9422 } | 9411 } |
9423 DeleteCCharFont(); | 9412 DeleteCCharFont(); |
9424 bFlashQuestBook = true; | 9413 bFlashQuestBook = true; |
9425 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0); | 9414 pGame->pCShow->PlayMovie(MOVIE_Emerald, 0); |
9426 SaveNewGame(); | 9415 SaveNewGame(); |
9416 | |
9417 if (bNoMargareth) | |
9418 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_MARGARETH_OFF, 1); | |
9427 pGame->Loop(); | 9419 pGame->Loop(); |
9428 | 9420 |
9429 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU) | 9421 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU) |
9430 { | 9422 { |
9431 SetCurrentMenuID(MENU_NEWGAME); | 9423 SetCurrentMenuID(MENU_NEWGAME); |