Mercurial > mm7
comparison mm7_5.cpp @ 1445:6de9c1316852
Слияние
author | Ritor1 |
---|---|
date | Sat, 03 Aug 2013 00:00:31 +0600 |
parents | 71a2cf416478 |
children | 8b4f4c723edd |
comparison
equal
deleted
inserted
replaced
1444:7b1a94270756 | 1445:6de9c1316852 |
---|---|
110 int v54; // eax@432 | 110 int v54; // eax@432 |
111 int v55; // ecx@432 | 111 int v55; // ecx@432 |
112 int v56; // edx@432 | 112 int v56; // edx@432 |
113 int v57; // eax@432 | 113 int v57; // eax@432 |
114 Player *pPlayer; // edx@442 | 114 Player *pPlayer; // edx@442 |
115 unsigned int v59; // eax@445 | 115 unsigned int pMapNum; // eax@445 |
116 signed int v60; // ST64_4@459 | 116 signed int v60; // ST64_4@459 |
117 NPCData *pNPCData2; // eax@467 | 117 //NPCData *pNPCData2; // eax@467 |
118 unsigned __int64 v62; // kr00_8@467 | 118 //unsigned __int64 v62; // kr00_8@467 |
119 __int16 v63; // dx@479 | 119 __int16 v63; // dx@479 |
120 unsigned int v64; // eax@486 | 120 unsigned int v64; // eax@486 |
121 int v65; // ecx@486 | 121 int v65; // ecx@486 |
122 int v66; // eax@488 | 122 int v66; // eax@488 |
123 char *v67; // eax@489 | 123 char *v67; // eax@489 |
203 int v153; // [sp-4h] [bp-600h]@135 | 203 int v153; // [sp-4h] [bp-600h]@135 |
204 //int v154; // [sp-4h] [bp-600h]@149 | 204 //int v154; // [sp-4h] [bp-600h]@149 |
205 int v155; // [sp-4h] [bp-600h]@165 | 205 int v155; // [sp-4h] [bp-600h]@165 |
206 int v156; // [sp-4h] [bp-600h]@204 | 206 int v156; // [sp-4h] [bp-600h]@204 |
207 //const char *v157; // [sp-4h] [bp-600h]@444 | 207 //const char *v157; // [sp-4h] [bp-600h]@444 |
208 unsigned int v158; // [sp-4h] [bp-600h]@449 | 208 //unsigned int v158; // [sp-4h] [bp-600h]@449 |
209 //__int16 v159; // [sp-4h] [bp-600h]@550 | 209 //__int16 v159; // [sp-4h] [bp-600h]@550 |
210 int v160; // [sp-4h] [bp-600h]@599 | 210 int v160; // [sp-4h] [bp-600h]@599 |
211 const char *v161; // [sp-4h] [bp-600h]@637 | 211 const char *v161; // [sp-4h] [bp-600h]@637 |
212 //int v162; // [sp+0h] [bp-5FCh]@56 | 212 //int v162; // [sp+0h] [bp-5FCh]@56 |
213 //int v163; // [sp+0h] [bp-5FCh]@59 | 213 //int v163; // [sp+0h] [bp-5FCh]@59 |
230 //signed int _this; // [sp+14h] [bp-5E8h]@22 | 230 //signed int _this; // [sp+14h] [bp-5E8h]@22 |
231 signed int thisa; // [sp+14h] [bp-5E8h]@251 | 231 signed int thisa; // [sp+14h] [bp-5E8h]@251 |
232 signed int thisb; // [sp+14h] [bp-5E8h]@272 | 232 signed int thisb; // [sp+14h] [bp-5E8h]@272 |
233 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 | 233 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 |
234 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 | 234 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 |
235 char *thise; // [sp+14h] [bp-5E8h]@445 | 235 char *pMapName; // [sp+14h] [bp-5E8h]@445 |
236 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455 | 236 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455 |
237 int thisg; // [sp+14h] [bp-5E8h]@467 | 237 int thisg; // [sp+14h] [bp-5E8h]@467 |
238 int thish; // [sp+14h] [bp-5E8h]@528 | 238 int thish; // [sp+14h] [bp-5E8h]@528 |
239 signed int thisi; // [sp+14h] [bp-5E8h]@535 | 239 signed int thisi; // [sp+14h] [bp-5E8h]@535 |
240 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604 | 240 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604 |
257 POINT v207; // [sp+68h] [bp-594h]@155 | 257 POINT v207; // [sp+68h] [bp-594h]@155 |
258 POINT v208; // [sp+70h] [bp-58Ch]@397 | 258 POINT v208; // [sp+70h] [bp-58Ch]@397 |
259 POINT v209; // [sp+78h] [bp-584h]@777 | 259 POINT v209; // [sp+78h] [bp-584h]@777 |
260 POINT v210; // [sp+80h] [bp-57Ch]@397 | 260 POINT v210; // [sp+80h] [bp-57Ch]@397 |
261 POINT v211; // [sp+88h] [bp-574h]@704 | 261 POINT v211; // [sp+88h] [bp-574h]@704 |
262 __int64 v212; // [sp+90h] [bp-56Ch]@467 | 262 //__int64 v212; // [sp+90h] [bp-56Ch]@467 |
263 int v213; // [sp+98h] [bp-564h]@385 | 263 int v213; // [sp+98h] [bp-564h]@385 |
264 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380 | 264 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380 |
265 char pOut[32]; // [sp+BCh] [bp-540h]@370 | 265 char pOut[32]; // [sp+BCh] [bp-540h]@370 |
266 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524 | 266 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524 |
267 int v217[9]; // [sp+158h] [bp-4A4h]@652 | 267 int v217[9]; // [sp+158h] [bp-4A4h]@652 |
1664 case UIMSG_OnTravelByFoot: | 1664 case UIMSG_OnTravelByFoot: |
1665 if ( pMessageQueue_50CBD0->uNumMessages ) | 1665 if ( pMessageQueue_50CBD0->uNumMessages ) |
1666 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1666 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1667 dword_50CDC8 = 1; | 1667 dword_50CDC8 = 1; |
1668 sub_42FBDD(); | 1668 sub_42FBDD(); |
1669 pNPCData4 = (NPCData *)GetTravelTime(); | 1669 //pNPCData4 = (NPCData *)GetTravelTime(); |
1670 strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data()); | 1670 strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data()); |
1671 if ( bUnderwater != 1 && pParty->bFlying | 1671 if ( bUnderwater != 1 && pParty->bFlying |
1672 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) | 1672 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) |
1673 { | 1673 { |
1674 viewparams->bRedrawGameUI = 1; | 1674 viewparams->bRedrawGameUI = 1; |
1693 pEventTimer->Pause(); | 1693 pEventTimer->Pause(); |
1694 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); | 1694 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); |
1695 ++pGameLoadingUI_ProgressBar->uProgressMax; | 1695 ++pGameLoadingUI_ProgressBar->uProgressMax; |
1696 SaveGame(1, 0); | 1696 SaveGame(1, 0); |
1697 pGameLoadingUI_ProgressBar->Progress(); | 1697 pGameLoadingUI_ProgressBar->Progress(); |
1698 RestAndHeal(1440 * (signed int)pNPCData4); | 1698 RestAndHeal(1440 * (signed int)GetTravelTime()); |
1699 if ( pParty->uNumFoodRations ) | 1699 if ( pParty->uNumFoodRations ) |
1700 { | 1700 { |
1701 pParty->RestAndHeal(); | 1701 pParty->RestAndHeal(); |
1702 if ( ((pParty->uNumFoodRations - (signed int)pNPCData4) & 0x80000000u) != 0 ) | 1702 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) |
1703 { | 1703 { |
1704 pPlayer7 = pParty->pPlayers; | 1704 pPlayer7 = pParty->pPlayers; |
1705 do | 1705 do |
1706 { | 1706 { |
1707 pPlayer7->SetCondition(1, 0); | 1707 pPlayer7->SetCondition(1, 0); |
1708 ++pPlayer7; | 1708 ++pPlayer7; |
1709 } | 1709 } |
1710 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); | 1710 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); |
1711 ++pParty->days_played_without_rest; | 1711 ++pParty->days_played_without_rest; |
1712 } | 1712 } |
1713 Party::TakeFood((unsigned int)pNPCData4); | 1713 Party::TakeFood((unsigned int)GetTravelTime()); |
1714 } | 1714 } |
1715 else | 1715 else |
1716 { | 1716 { |
1717 pPlayer8 = pParty->pPlayers; | 1717 pPlayer8 = pParty->pPlayers; |
1718 do | 1718 do |
1962 continue; | 1962 continue; |
1963 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; | 1963 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; |
1964 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; | 1964 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; |
1965 if ( bRecallingBeacon ) | 1965 if ( bRecallingBeacon ) |
1966 { | 1966 { |
1967 if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) ) | 1967 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) ) |
1968 continue; | 1968 continue; |
1969 v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; | 1969 v173 = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName; |
1970 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" | 1970 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" |
1971 GameUI_SetFooterString(pTmpBuf.data()); | 1971 GameUI_SetFooterString(pTmpBuf.data()); |
1972 continue; | 1972 continue; |
1973 } | 1973 } |
1974 v59 = pMapStats->GetMapInfo(pCurrentMapName.data()); | 1974 pMapNum = pMapStats->GetMapInfo(pCurrentMapName.data()); |
1975 thise = "Not in Map Stats"; | 1975 pMapName = "Not in Map Stats"; |
1976 if ( v59 ) | 1976 if ( pMapNum ) |
1977 thise = pMapStats->pInfos[v59].pName; | 1977 pMapName = pMapStats->pInfos[pMapNum].pName; |
1978 if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) || !v59 ) | 1978 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum ) |
1979 { | 1979 { |
1980 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s" | 1980 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s" |
1981 GameUI_SetFooterString(pTmpBuf.data()); | 1981 GameUI_SetFooterString(pTmpBuf.data()); |
1982 continue; | 1982 continue; |
1983 } | 1983 } |
1984 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | 1984 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; |
1985 v158 = (unsigned int)thise; | 1985 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s" |
1986 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" | |
1987 GameUI_SetFooterString(pTmpBuf.data()); | 1986 GameUI_SetFooterString(pTmpBuf.data()); |
1988 continue; | 1987 continue; |
1989 case UIMSG_CloseAfterInstallBeacon: | 1988 case UIMSG_CloseAfterInstallBeacon: |
1990 dword_50CDC8 = 1; | 1989 dword_50CDC8 = 1; |
1991 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 1990 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
1996 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 1995 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
1997 ++pMessageQueue_50CBD0->uNumMessages;*/ | 1996 ++pMessageQueue_50CBD0->uNumMessages;*/ |
1998 continue; | 1997 continue; |
1999 case UIMSG_InstallBeacon: | 1998 case UIMSG_InstallBeacon: |
2000 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; | 1999 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; |
2001 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; | 2000 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon ) |
2002 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) | |
2003 continue; | 2001 continue; |
2004 byte_506360 = 1; | 2002 byte_506360 = 1; |
2005 pPlayer9->CanCastSpell(uRequiredMana); | 2003 pPlayer9->CanCastSpell(uRequiredMana); |
2006 if ( pParty->bTurnBasedModeOn ) | 2004 if ( pParty->bTurnBasedModeOn ) |
2007 { | 2005 { |
2015 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | 2013 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); |
2016 } | 2014 } |
2017 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0); | 2015 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0); |
2018 if ( bRecallingBeacon ) | 2016 if ( bRecallingBeacon ) |
2019 { | 2017 { |
2020 if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) ) | 2018 if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) |
2021 { | 2019 { |
2022 SaveGame(1, 0); | 2020 SaveGame(1, 0); |
2023 OnMapLeave(); | 2021 OnMapLeave(); |
2024 strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]); | 2022 strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); |
2025 dword_6BE364_game_settings_1 |= 1; | 2023 dword_6BE364_game_settings_1 |= 1; |
2026 uGameState = GAME_STATE_2; | 2024 uGameState = GAME_STATE_2; |
2027 _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags; | 2025 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
2028 _5B65AC_npcdata_fame_or_other = pNPCData4->fame; | 2026 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; |
2029 _5B65B0_npcdata_rep_or_other = pNPCData4->rep; | 2027 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; |
2030 _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->Location2D); | 2028 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; |
2031 _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->Location2D); | 2029 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; |
2032 dword_5B65C0 = 1; | 2030 dword_5B65C0 = 1; |
2033 } | 2031 } |
2034 else | 2032 else |
2035 { | 2033 { |
2036 pParty->vPosition.x = pNPCData4->uFlags; | 2034 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
2037 pParty->vPosition.y = pNPCData4->fame; | 2035 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; |
2038 pParty->vPosition.z = pNPCData4->rep; | 2036 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; |
2039 pParty->uFallStartY = pParty->vPosition.z; | 2037 pParty->uFallStartY = pParty->vPosition.z; |
2040 pParty->sRotationY = LOWORD(pNPCData4->Location2D); | 2038 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; |
2041 pParty->sRotationX = HIWORD(pNPCData4->Location2D); | 2039 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; |
2042 } | 2040 } |
2043 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 2041 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
2044 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2045 { | |
2046 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2047 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
2048 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2049 ++pMessageQueue_50CBD0->uNumMessages; | |
2050 }*/ | |
2051 //crt_deconstruct_ptr_6A0118(); | |
2052 pBooksWindow->Release(); | 2042 pBooksWindow->Release(); |
2053 pGUIWindow_CurrentMenu->Release(); | 2043 pGUIWindow_CurrentMenu->Release(); |
2054 pBooksWindow = 0; | 2044 pBooksWindow = 0; |
2055 pGUIWindow_CurrentMenu = 0; | 2045 pGUIWindow_CurrentMenu = 0; |
2056 } | 2046 } |
2057 else | 2047 else |
2058 { | 2048 { |
2059 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); | 2049 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); |
2060 SaveScreenshot(a1); | 2050 SaveScreenshot(a1); |
2061 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); | 2051 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); |
2062 v212 = qword_506350 << 7; | 2052 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); |
2063 pNPCData2 = pNPCData4; | 2053 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x; |
2064 thisg = 0; | 2054 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y; |
2065 v62 = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); | 2055 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z; |
2066 pNPCData4->pName = (char *)v62; | 2056 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY); |
2067 pNPCData2->uPortraitID = HIDWORD(v62); | 2057 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX); |
2068 pNPCData2->uFlags = pParty->vPosition.x; | |
2069 pNPCData2->fame = pParty->vPosition.y; | |
2070 pNPCData2->rep = pParty->vPosition.z; | |
2071 LOWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationY); | |
2072 HIWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationX); | |
2073 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) | 2058 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) |
2074 continue; | 2059 continue; |
2075 uAction = 0; | 2060 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg ) |
2076 while ( _stricmp((const char *)pGames_LOD->pSubIndices + uAction, pCurrentMapName.data()) ) | 2061 { |
2077 { | 2062 if ( !_stricmp((const char *)pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName.data()) ) |
2078 ++thisg; | 2063 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg; |
2079 uAction += 32; | 2064 } |
2080 if ( thisg >= (signed int)pGames_LOD->uNumSubDirs / 2 ) | |
2081 continue; | |
2082 } | |
2083 HIWORD(pNPCData4->uProfession) = thisg; | |
2084 } | 2065 } |
2085 continue; | 2066 continue; |
2086 case UIMSG_ClickTownInTP: | 2067 case UIMSG_ClickTownInTP: |
2087 if ( uMessageParam ) | 2068 if ( uMessageParam ) |
2088 { | 2069 { |
3015 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 2996 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3016 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | 2997 GameUI_OnPlayerPortraitLeftClick(uMessageParam); |
3017 continue; | 2998 continue; |
3018 case UIMSG_ShowStatus_Funds: | 2999 case UIMSG_ShowStatus_Funds: |
3019 v174 = (char *)pParty->uNumGoldInBank; | 3000 v174 = (char *)pParty->uNumGoldInBank; |
3020 v158 = pParty->uNumGold + pParty->uNumGoldInBank; | 3001 //v158 = pParty->uNumGold + pParty->uNumGoldInBank; |
3021 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank" | 3002 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank" |
3022 GameUI_SetFooterString(pTmpBuf.data()); | 3003 GameUI_SetFooterString(pTmpBuf.data()); |
3023 continue; | 3004 continue; |
3024 case UIMSG_ShowStatus_DateTime: | 3005 case UIMSG_ShowStatus_DateTime: |
3025 pNPCData4 = (NPCData *)pParty->uCurrentHour; | 3006 pNPCData4 = (NPCData *)pParty->uCurrentHour; |
3026 if ( (signed int)pParty->uCurrentHour <= 12 ) | 3007 if ( (signed int)pParty->uCurrentHour <= 12 ) |
4710 v28 = v17; | 4691 v28 = v17; |
4711 v18 = dword_4F5CC4_ys[1] >= v8; | 4692 v18 = dword_4F5CC4_ys[1] >= v8; |
4712 v19 = 0; | 4693 v19 = 0; |
4713 v29 = 0; | 4694 v29 = 0; |
4714 if ( v17 <= 0 ) | 4695 if ( v17 <= 0 ) |
4715 goto LABEL_29; | 4696 return 0; |
4716 do | 4697 do |
4717 { | 4698 { |
4718 if ( a3a >= 2 ) | 4699 if ( a3a >= 2 ) |
4719 break; | 4700 break; |
4720 v20 = v19; | 4701 v20 = v19; |
4745 v19 = v29++ + 1; | 4726 v19 = v29++ + 1; |
4746 } | 4727 } |
4747 while ( v29 < v28 ); | 4728 while ( v29 < v28 ); |
4748 result = 1; | 4729 result = 1; |
4749 if ( a3a != 1 ) | 4730 if ( a3a != 1 ) |
4750 LABEL_29: | |
4751 result = 0; | 4731 result = 0; |
4752 return result; | 4732 return result; |
4753 } | 4733 } |
4754 | 4734 |
4755 //----- (004077F1) -------------------------------------------------------- | 4735 //----- (004077F1) -------------------------------------------------------- |
4845 dword_4F5BF4_xs[v15 + 1] = dword_4F5BF4_xs[1]; | 4825 dword_4F5BF4_xs[v15 + 1] = dword_4F5BF4_xs[1]; |
4846 dword_4F5B24_ys[v15 + 1] = dword_4F5B24_ys[1]; | 4826 dword_4F5B24_ys[v15 + 1] = dword_4F5B24_ys[1]; |
4847 v25 = 0; | 4827 v25 = 0; |
4848 v16 = dword_4F5B24_ys[1] >= a3; | 4828 v16 = dword_4F5B24_ys[1] >= a3; |
4849 if ( v15 <= 0 ) | 4829 if ( v15 <= 0 ) |
4850 goto LABEL_29; | 4830 return 0; |
4851 do | 4831 do |
4852 { | 4832 { |
4853 if ( a5a >= 2 ) | 4833 if ( a5a >= 2 ) |
4854 break; | 4834 break; |
4855 v17 = v25; | 4835 v17 = v25; |
4880 v16 = v18 >= a3; | 4860 v16 = v18 >= a3; |
4881 } | 4861 } |
4882 while ( v25 < v15 ); | 4862 while ( v25 < v15 ); |
4883 result = 1; | 4863 result = 1; |
4884 if ( a5a != 1 ) | 4864 if ( a5a != 1 ) |
4885 LABEL_29: | |
4886 result = 0; | 4865 result = 0; |
4887 return result; | 4866 return result; |
4888 } | 4867 } |
4889 | 4868 |
4890 //----- (004088E9) -------------------------------------------------------- | 4869 //----- (004088E9) -------------------------------------------------------- |
5191 { | 5170 { |
5192 if ( pParty->pPickedItem.uItemID == 236 ) | 5171 if ( pParty->pPickedItem.uItemID == 236 ) |
5193 { | 5172 { |
5194 v35 = v27->uAttributes; | 5173 v35 = v27->uAttributes; |
5195 if ( v35 & 2 || (v51 & 0x80000000u) != 0 || (signed int)v51 > 12 || (signed int)v28 >= 500 ) | 5174 if ( v35 & 2 || (v51 & 0x80000000u) != 0 || (signed int)v51 > 12 || (signed int)v28 >= 500 ) |
5196 goto LABEL_92; | 5175 { |
5176 pMouse->RemoveHoldingItem(); | |
5177 dword_50CDCC = 1; | |
5178 return; | |
5179 } | |
5197 LOWORD(v35) = v35 | 0x210; | 5180 LOWORD(v35) = v35 | 0x210; |
5198 v27->uAttributes = v35; | 5181 v27->uAttributes = v35; |
5199 } | 5182 } |
5200 else | 5183 else |
5201 { | 5184 { |
5202 if ( (signed int)pParty->pPickedItem.uItemID <= 245 ) | 5185 if ( (signed int)pParty->pPickedItem.uItemID <= 245 ) |
5203 goto LABEL_92; | 5186 { |
5187 pMouse->RemoveHoldingItem(); | |
5188 dword_50CDCC = 1; | |
5189 return; | |
5190 } | |
5204 if ( (signed int)pParty->pPickedItem.uItemID <= 250 ) | 5191 if ( (signed int)pParty->pPickedItem.uItemID <= 250 ) |
5205 { | 5192 { |
5206 v27->UpdateTempBonus(pParty->uTimePlayed); | 5193 v27->UpdateTempBonus(pParty->uTimePlayed); |
5207 v33 = v27->uItemID; | 5194 v33 = v27->uItemID; |
5208 if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65 | 5195 if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65 |
5209 || (pOut.y = v27->uAttributes, pOut.y & 2) | 5196 || (pOut.y = v27->uAttributes, pOut.y & 2) |
5210 || v27->uSpecEnchantmentType | 5197 || v27->uSpecEnchantmentType |
5211 || v27->uEnchantmentType | 5198 || v27->uEnchantmentType |
5212 || v51 && v51 != 1 && v51 != 2 | 5199 || v51 && v51 != 1 && v51 != 2 |
5213 || (signed int)v33 >= 500 ) | 5200 || (signed int)v33 >= 500 ) |
5214 goto LABEL_92; | 5201 { |
5202 pMouse->RemoveHoldingItem(); | |
5203 dword_50CDCC = 1; | |
5204 return; | |
5205 } | |
5215 v34 = *(int *)&aSbwb00[4 * pParty->pPickedItem.uItemID + 4]; | 5206 v34 = *(int *)&aSbwb00[4 * pParty->pPickedItem.uItemID + 4]; |
5216 a2.y = (int)v29 << 7; | 5207 a2.y = (int)v29 << 7; |
5217 v31 = (double)(signed int)((int)v29 << 7); | 5208 v31 = (double)(signed int)((int)v29 << 7); |
5218 v27->uSpecEnchantmentType = v34; | 5209 v27->uSpecEnchantmentType = v34; |
5219 } | 5210 } |
5225 || (pOut.y = v27->uAttributes, pOut.y & 2) | 5216 || (pOut.y = v27->uAttributes, pOut.y & 2) |
5226 || v27->uSpecEnchantmentType | 5217 || v27->uSpecEnchantmentType |
5227 || v27->uEnchantmentType | 5218 || v27->uEnchantmentType |
5228 || v51 && v51 != 1 && v51 != 2 | 5219 || v51 && v51 != 1 && v51 != 2 |
5229 || (signed int)v30 >= 500 ) | 5220 || (signed int)v30 >= 500 ) |
5230 goto LABEL_92; | 5221 { |
5222 pMouse->RemoveHoldingItem(); | |
5223 dword_50CDCC = 1; | |
5224 return; | |
5225 } | |
5231 a2.y = (int)v29 << 7; | 5226 a2.y = (int)v29 << 7; |
5232 v27->uSpecEnchantmentType = 40; | 5227 v27->uSpecEnchantmentType = 40; |
5233 v31 = (double)a2.y; | 5228 v31 = (double)a2.y; |
5234 } | 5229 } |
5235 v32 = pParty->uTimePlayed + (signed int)(signed __int64)(v31 * 0.033333335); | 5230 v32 = pParty->uTimePlayed + (signed int)(signed __int64)(v31 * 0.033333335); |
5238 LOBYTE(v32) = LOBYTE(pOut.y) | 0x18; | 5233 LOBYTE(v32) = LOBYTE(pOut.y) | 0x18; |
5239 HIDWORD(v27->uExpireTime) = HIDWORD(v32); | 5234 HIDWORD(v27->uExpireTime) = HIDWORD(v32); |
5240 v27->uAttributes = v32; | 5235 v27->uAttributes = v32; |
5241 } | 5236 } |
5242 _50C9A8_item_enchantment_timer = 256; | 5237 _50C9A8_item_enchantment_timer = 256; |
5243 goto LABEL_92; | 5238 pMouse->RemoveHoldingItem(); |
5239 dword_50CDCC = 1; | |
5240 return; | |
5244 } | 5241 } |
5245 v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; | 5242 v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; |
5246 if ( v36 < 0.0 ) | 5243 if ( v36 < 0.0 ) |
5247 v36 = 0.0; | 5244 v36 = 0.0; |
5248 if ( v51 != 12 ) | 5245 if ( v51 != 12 ) |
5252 } | 5249 } |
5253 a2.y = v27->uMaxCharges; | 5250 a2.y = v27->uMaxCharges; |
5254 v37 = (signed __int64)((double)a2.y - v36 * (double)a2.y); | 5251 v37 = (signed __int64)((double)a2.y - v36 * (double)a2.y); |
5255 v27->uMaxCharges = v37; | 5252 v27->uMaxCharges = v37; |
5256 v27->uNumCharges = (unsigned __int8)v37; | 5253 v27->uNumCharges = (unsigned __int8)v37; |
5257 goto LABEL_92; | 5254 pMouse->RemoveHoldingItem(); |
5255 dword_50CDCC = 1; | |
5256 return; | |
5258 } | 5257 } |
5259 v14 = v13 - 222; | 5258 v14 = v13 - 222; |
5260 v15 = pParty->pPickedItem.uItemID - 222; | 5259 v15 = pParty->pPickedItem.uItemID - 222; |
5261 v47 = v14; | 5260 v47 = v14; |
5262 y.y = 0; | 5261 y.y = 0; |
5393 LABEL_74: | 5392 LABEL_74: |
5394 v22 = (int)((char *)v0 + 36 * pOut.z); | 5393 v22 = (int)((char *)v0 + 36 * pOut.z); |
5395 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) ) | 5394 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) ) |
5396 *(int *)(v22 + 552) |= 1u; | 5395 *(int *)(v22 + 552) |= 1u; |
5397 if ( !dword_4E455C ) | 5396 if ( !dword_4E455C ) |
5398 goto LABEL_92; | 5397 { |
5398 pMouse->RemoveHoldingItem(); | |
5399 dword_50CDCC = 1; | |
5400 return; | |
5401 } | |
5399 v0->PlaySound(SPEECH_16, 0); | 5402 v0->PlaySound(SPEECH_16, 0); |
5400 goto LABEL_91; | 5403 dword_4E455C = 0; |
5404 pMouse->RemoveHoldingItem(); | |
5405 dword_50CDCC = 1; | |
5406 return; | |
5401 } | 5407 } |
5402 if ( v45 ) | 5408 if ( v45 ) |
5403 { | 5409 { |
5404 if ( *(int *)(a2.y + 532) == 221 ) | 5410 if ( *(int *)(a2.y + 532) == 221 ) |
5405 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID; | 5411 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID; |
5434 if ( dword_4E455C ) | 5440 if ( dword_4E455C ) |
5435 { | 5441 { |
5436 if ( v0->CanAct() ) | 5442 if ( v0->CanAct() ) |
5437 v0->PlaySound(SPEECH_17, 0); | 5443 v0->PlaySound(SPEECH_17, 0); |
5438 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u); | 5444 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u); |
5439 LABEL_91: | |
5440 dword_4E455C = 0; | 5445 dword_4E455C = 0; |
5441 } | 5446 } |
5442 LABEL_92: | |
5443 pMouse->RemoveHoldingItem(); | 5447 pMouse->RemoveHoldingItem(); |
5444 dword_50CDCC = 1; | 5448 dword_50CDCC = 1; |
5445 return; | 5449 return; |
5446 } | 5450 } |
5447 *(int *)(v11 + 536) = v9 + pItemsTable->pItems[pParty->pPickedItem.uItemID].uDamageDice; | 5451 *(int *)(v11 + 536) = v9 + pItemsTable->pItems[pParty->pPickedItem.uItemID].uDamageDice; |