Mercurial > mm7
changeset 1407:d4f57df4c299
PlayerSpeechID and uSpeakingCharacter
author | Ritor1 |
---|---|
date | Tue, 23 Jul 2013 16:34:00 +0600 |
parents | d071e0e9ba75 |
children | 204cce84300b |
files | Chest.cpp Indoor.cpp Player.cpp UI/UIHouses.cpp UI/UIShops.cpp UI/UiGame.cpp mm7_5.cpp mm7_data.cpp mm7_data.h |
diffstat | 9 files changed, 35 insertions(+), 55 deletions(-) [+] |
line wrap: on
line diff
--- a/Chest.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/Chest.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -52,7 +52,7 @@ int pObjectZ; // edi@21 double dir_x; // st7@23 double dir_y; // st6@23 - double v20; // st7@23 + double length_vector; // st7@23 int pDepth; // ecx@26 Vec3_int_ v; // ST4C_12@28 bool flag_shout; // edi@28 @@ -116,8 +116,8 @@ dir_x = (double)pParty->vPosition.x - (double)pObjectX; dir_y = (double)pParty->vPosition.y - (double)pObjectY; dir_z = ( (double)pParty->sEyelevel + (double)pParty->vPosition.z ) - (double)pObjectZ; - v20 = sqrt( (dir_x * dir_x) + (dir_y * dir_y) + (dir_z * dir_z) ); - if ( v20 <= 1.0 ) + length_vector = sqrt( (dir_x * dir_x) + (dir_y * dir_y) + (dir_z * dir_z) ); + if ( length_vector <= 1.0 ) { *(float *)&sRotX = 0.0; *(float *)&sRotY = 0.0; @@ -129,8 +129,8 @@ sRotY = stru_5C6E00->Atan2(dir_y * dir_y, (signed __int64)dir_z); } pDepth = 256; - if ( v20 < 256.0 ) - pDepth = (signed __int64)v20 / 4; + if ( length_vector < 256.0 ) + pDepth = (signed __int64)length_vector / 4; v.x = pObjectX; v.y = pObjectY; v.z = pObjectZ; @@ -170,7 +170,7 @@ { qword_A750D8 = 256i64; PlayerSpeechID = SPEECH_5; - word_A750E2 = uActiveCharacter; + uSpeakingCharacter = uActiveCharacter; } pIcons_LOD->RemoveTexturesPackFromTextureList(); dword_507CD8 = 0;
--- a/Indoor.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/Indoor.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -4012,7 +4012,7 @@ { qword_A750D8 = 256i64; PlayerSpeechID = SPEECH_46; - word_A750E2 = LOWORD(v34[rand() % v30]); + uSpeakingCharacter = LOWORD(v34[rand() % v30]); } } }
--- a/Player.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/Player.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -9360,7 +9360,7 @@ { qword_A750D8 = 256i64; PlayerSpeechID = SPEECH_44; - word_A750E2 = uActorID + 1; + uSpeakingCharacter = uActorID + 1; } return; }
--- a/UI/UIHouses.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/UI/UIHouses.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -587,11 +587,8 @@ //----- (004B1E92) -------------------------------------------------------- void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound) { - //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) ) - if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId ) - pAudioPlayer->PlaySound( - //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)), - (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)), + if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId ) + pAudioPlayer->PlaySound((SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)), 806, 0, -1, 0, 0, 0, 0); } @@ -2538,7 +2535,7 @@ PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful); dialog_menu_id = HOUSE_DIALOGUE_NULL; sub_4BD8B5(); - sub_4B1D27(); + GetHouseGoodbyeSpeech(); pVideoPlayer->Unload(); window_SpeakInHouse->Release(); window_SpeakInHouse = 0;
--- a/UI/UIShops.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/UI/UIShops.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -2642,20 +2642,14 @@ } } //----- (004B1D27) -------------------------------------------------------- -void __cdecl sub_4B1D27() +void __cdecl GetHouseGoodbyeSpeech() { - int v0; // edx@2 - unsigned int v1; // ecx@7 signed int v2; // edi@10 - int v3; // esi@10 - __int16 v4; // ax@15 signed int v5; // edi@20 - int v6; // esi@20 int v7[4]; // [sp+Ch] [bp-10h]@12 if ( in_current_building_type > 0 ) { - v0 = 3; if ( in_current_building_type > BildingType_MagicShop ) { if ( in_current_building_type == BildingType_Bank ) @@ -2668,39 +2662,32 @@ if ( in_current_building_type != BildingType_Temple ) return; } - v1 = (unsigned int)window_SpeakInHouse->ptr_1C; - PlayHouseSound(v1, (HouseSoundID)v0); + PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2); return; } - v1 = (unsigned int)window_SpeakInHouse->ptr_1C; - if ( (signed __int64)pParty->field_3C._shop_ban_times[v1 ]<= (signed __int64)pParty->uTimePlayed ) + if ( (signed __int64)pParty->field_3C._shop_ban_times[(unsigned int)window_SpeakInHouse->ptr_1C]<= (signed __int64)pParty->uTimePlayed ) { - if ( pParty->uNumGold <= 0x2710 ) + if ( pParty->uNumGold <= 10000 ) { if ( !dword_F8B1E4 ) return; - v0 = 4; - PlayHouseSound(v1, (HouseSoundID)v0); + PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye); return; } - PlayHouseSound(v1, (HouseSoundID)(dword_F8B1E4 + 3)); + PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)(dword_F8B1E4 + 3)); if ( !dword_F8B1E4 && !qword_A750D8 ) { v5 = 0; - v6 = 1; - do + for ( uint i = 1; i <= 4; ++i ) { - if ( pPlayers[v6]->CanAct() ) - v7[v5++] = v6; - ++v6; + if ( pPlayers[i]->CanAct() ) + v7[v5++] = i; } - while ( v6 <= 4 ); if ( v5 ) { qword_A750D8 = 256i64; PlayerSpeechID = SPEECH_80; - v4 = LOWORD(v7[rand() % v5]); - word_A750E2 = v4; + uSpeakingCharacter = v7[rand() % v5]; return; } } @@ -2710,20 +2697,16 @@ if ( !qword_A750D8 ) { v2 = 0; - v3 = 1; - do + for ( uint i = 1; i <= 4; ++i ) { - if ( pPlayers[v3]->CanAct() ) - v7[v2++] = v3; - ++v3; + if ( pPlayers[i]->CanAct() ) + v7[v2++] = i; } - while ( v3 <= 4 ); if ( v2 ) { qword_A750D8 = 256i64; PlayerSpeechID = SPEECH_80; - v4 = LOWORD(v7[rand() % v2]); - word_A750E2 = v4; + uSpeakingCharacter = v7[rand() % v2]; return; } }
--- a/UI/UiGame.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/UI/UiGame.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -2192,23 +2192,23 @@ int v16; // eax@57 int v19; // eax@62 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 - unsigned int v22; // [sp+14h] [bp-4h]@1 + //unsigned int v22; // [sp+14h] [bp-4h]@1 - v22 = _this; + //v22 = _this; if ( qword_A750D8 ) { qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; if ( qword_A750D8 <= 0 ) { - if ( pPlayers[word_A750E2]->CanAct() ) - pPlayers[word_A750E2]->PlaySound(PlayerSpeechID, 0); + if ( pPlayers[uSpeakingCharacter]->CanAct() ) + pPlayers[uSpeakingCharacter]->PlaySound(PlayerSpeechID, 0); qword_A750D8 = 0i64; } } for (uint i = 0; i < 4; ++i) { - Player* pPlayer = pParty->pPlayers + i; + Player* pPlayer = &pParty->pPlayers[i]; if (pPlayer->IsEradicated()) { @@ -2263,7 +2263,7 @@ pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); else pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); - if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) + if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) { pPlayer->field_1AA2 = pFrame->uTextureID - 1; pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID];
--- a/mm7_5.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/mm7_5.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -1306,7 +1306,7 @@ if ( sub_4BD8B5() ) continue; } - sub_4B1D27(); + GetHouseGoodbyeSpeech(); pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0); pVideoPlayer->Unload(); pGUIWindow_CurrentMenu = window_SpeakInHouse;
--- a/mm7_data.cpp Tue Jul 23 15:41:45 2013 +0600 +++ b/mm7_data.cpp Tue Jul 23 16:34:00 2013 +0600 @@ -1338,7 +1338,7 @@ std::array<struct Player *, 5> pPlayers; __int64 qword_A750D8; // weak enum PlayerSpeech PlayerSpeechID; -__int16 word_A750E2; // weak +int uSpeakingCharacter; // weak std::array<char *, 36> pClassNames; std::array<char *, 19> aCharacterConditionNames; std::array<char *, 38> pSkillNames;
--- a/mm7_data.h Tue Jul 23 15:41:45 2013 +0600 +++ b/mm7_data.h Tue Jul 23 16:34:00 2013 +0600 @@ -994,7 +994,7 @@ extern std::array<struct Player *, 5> pPlayers; extern __int64 qword_A750D8; // weak extern enum PlayerSpeech PlayerSpeechID; -extern __int16 word_A750E2; // weak +extern int uSpeakingCharacter; // weak extern std::array<char *, 36> pClassNames; extern std::array<char *, 19> aCharacterConditionNames; extern std::array<char *, 38> pSkillNames; @@ -1439,7 +1439,7 @@ void __thiscall sub_4B1523(int *_this); void __cdecl ShowPopupShopItem(); void __stdcall RestAndHeal(__int64 uNumMinutes); // idb -void __cdecl sub_4B1D27(); +void __cdecl GetHouseGoodbyeSpeech(); void __cdecl sub_4B1ECE(); void __fastcall ClickNPCTopic(signed int uMessageParam);