comparison mm7_5.cpp @ 190:9b77686e2239

Merge
author Gloval
date Sat, 16 Feb 2013 00:44:38 +0400
parents 038a4d09406f 49728858c35e
children 4813b57396ba
comparison
equal deleted inserted replaced
189:038a4d09406f 190:9b77686e2239
2878 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" 2878 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest"
2879 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) 2879 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() )
2880 { 2880 {
2881 v89 = uActiveCharacter; 2881 v89 = uActiveCharacter;
2882 v176 = 0; 2882 v176 = 0;
2883 v160 = 108; 2883 v160 = SPEECH_108;
2884 LABEL_619: 2884 LABEL_619:
2885 pPlayers[v89]->PlaySound(v160, v176); 2885 pPlayers[v89]->PlaySound((PlayerSpeech)v160, v176);
2886 } 2886 }
2887 } 2887 }
2888 else 2888 else
2889 { 2889 {
2890 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed; 2890 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed;
3021 } 3021 }
3022 v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage; 3022 v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage;
3023 pPlayers[uActiveCharacter]->uQuickSpell = v99; 3023 pPlayers[uActiveCharacter]->uQuickSpell = v99;
3024 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); 3024 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter);
3025 if ( uActiveCharacter ) 3025 if ( uActiveCharacter )
3026 pPlayer10->PlaySound(12, 0); 3026 pPlayer10->PlaySound(SPEECH_12, 0);
3027 byte_506550 = 0; 3027 byte_506550 = 0;
3028 continue; 3028 continue;
3029 case UIMSG_33: 3029 case UIMSG_33:
3030 if ( !uActiveCharacter ) 3030 if ( !uActiveCharacter )
3031 continue; 3031 continue;
3242 stru_506E40.Release(); 3242 stru_506E40.Release();
3243 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); 3243 uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
3244 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); 3244 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
3245 free((void *)uNumSeconds); 3245 free((void *)uNumSeconds);
3246 stru_506E40._40E55E("gamma.pcx", 0); 3246 stru_506E40._40E55E("gamma.pcx", 0);
3247 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0); 3247 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0);
3248 //LABEL_453: 3248 //LABEL_453:
3249 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3249 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3250 continue; 3250 continue;
3251 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 3251 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
3252 //goto LABEL_770; 3252 //goto LABEL_770;
3341 { 3341 {
3342 if ( (uNumSeconds & 0x3F) < 0x3C ) 3342 if ( (uNumSeconds & 0x3F) < 0x3C )
3343 { 3343 {
3344 *(short *)v105 = uNumSeconds + 1; 3344 *(short *)v105 = uNumSeconds + 1;
3345 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; 3345 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F;
3346 pPlayer4->PlaySound(14, 0); 3346 pPlayer4->PlaySound(SPEECH_14, 0);
3347 v165 = 0; 3347 v165 = 0;
3348 v151 = 0; 3348 v151 = 0;
3349 v144 = 0; 3349 v144 = 0;
3350 v139 = 0; 3350 v139 = 0;
3351 v135 = -1; 3351 v135 = -1;
3743 signed int v4; // eax@29 3743 signed int v4; // eax@29
3744 int v5; // ecx@29 3744 int v5; // ecx@29
3745 enum PLAYER_SKILL_TYPE v6; // edi@37 3745 enum PLAYER_SKILL_TYPE v6; // edi@37
3746 GUIWindow *pWindow; // eax@56 3746 GUIWindow *pWindow; // eax@56
3747 unsigned int v8; // edx@56 3747 unsigned int v8; // edx@56
3748 Player *pCurrentPlayer; // edi@57 3748 //Player *pCurrentPlayer; // edi@57
3749 signed int v10; // eax@58 3749 signed int v10; // eax@58
3750 GUIButton *pButton; // eax@59 3750 GUIButton *pButton; // eax@59
3751 unsigned __int8 v12; // sf@62 3751 //unsigned __int8 v12; // sf@62
3752 signed int v13; // eax@64 3752 //signed int v13; // eax@64
3753 unsigned int v14; // eax@66 3753 unsigned int v14; // eax@66
3754 int v15; // edi@70 3754 int v15; // edi@70
3755 char v16; // zf@73 3755 char v16; // zf@73
3756 int v17; // eax@73 3756 int v17; // eax@73
3757 int v19; // edi@116 3757 int v19; // edi@116
3776 signed int v41; // [sp-10h] [bp-20h]@29 3776 signed int v41; // [sp-10h] [bp-20h]@29
3777 int v42; // [sp-10h] [bp-20h]@36 3777 int v42; // [sp-10h] [bp-20h]@36
3778 int v43; // [sp-10h] [bp-20h]@56 3778 int v43; // [sp-10h] [bp-20h]@56
3779 int uNum; // [sp+4h] [bp-Ch]@3 3779 int uNum; // [sp+4h] [bp-Ch]@3
3780 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 3780 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3
3781 int pSex; // [sp+Ch] [bp-4h]@3 3781 //int pSex; // [sp+Ch] [bp-4h]@3
3782 Player *pPlayer; 3782 Player *pPlayer;
3783 3783
3784 if ( pMessageQueue_50CBD0->uNumMessages ) 3784 if ( pMessageQueue_50CBD0->uNumMessages )
3785 { 3785 {
3786 //v0 = pAudioPlayer; 3786 //v0 = pAudioPlayer;
3787 //pPlayer1 = pParty->pPlayers; 3787 //pPlayer1 = pParty->pPlayers;
3788 pPlayer = pParty->pPlayers; 3788 pPlayer = pParty->pPlayers;
3789 do 3789 do
3790 { 3790 {
3791 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex); 3791 int param2;
3792 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &param2);
3793
3792 switch (pUIMessageType) // For buttons of window MainMenu 3794 switch (pUIMessageType) // For buttons of window MainMenu
3793 { 3795 {
3794 case UIMSG_MainMenu_ShowPartyCreationWnd: 3796 case UIMSG_MainMenu_ShowPartyCreationWnd:
3795 { 3797 {
3796 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); 3798 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0);
3811 continue; 3813 continue;
3812 case UIMSG_ExitToWindows: 3814 case UIMSG_ExitToWindows:
3813 { 3815 {
3814 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); 3816 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0);
3815 SetCurrentMenuID(MENU_FINISHED); 3817 SetCurrentMenuID(MENU_FINISHED);
3818 }
3819 continue;
3820 }
3821
3822
3823 switch (pUIMessageType) // For buttons of Party Creation Window
3824 {
3825 case UIMSG_PlayerCreation_SelectAttribute:
3826 {
3827 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3828 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3829 uPlayerCreationUI_SelectedCharacter = uNum;
3830 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3831 }
3832 continue;
3833
3834 case UIMSG_PlayerCreation_VoicePrev:
3835 {
3836 auto player = &pParty->pPlayers[uNum];
3837 auto sex = player->GetSexByVoice();
3838 do
3839 {
3840 if (player->uVoiceID == 0)
3841 player->uVoiceID = 19;
3842 else --player->uVoiceID;
3843 }
3844 while (player->GetSexByVoice() != sex);
3845
3846 pButton = pCreationUI_BtnPressLeft2[uNum];
3847 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1);
3848 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3849 player->PlaySound(SPEECH_PickMe, 0);
3850 }
3851 continue;
3852
3853 case UIMSG_PlayerCreation_VoiceNext:
3854 {
3855 auto player = &pParty->pPlayers[uNum];
3856 auto sex = player->GetSexByVoice();
3857 do
3858 {
3859 player->uVoiceID = (player->uVoiceID + 1) % 20;
3860 }
3861 while (player->GetSexByVoice() != sex);
3862
3863 pButton = pCreationUI_BtnPressRight2[uNum];
3864 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1);
3865 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3866 player->PlaySound(SPEECH_PickMe, 0);
3867 }
3868 continue;
3869
3870 case UIMSG_PlayerCreation_FacePrev:
3871 {
3872 pPlayer = &pParty->pPlayers[uNum];
3873 unsigned char v12 = (char)((int)pPlayer->uFace - 1) < 0;
3874 --pPlayer->uFace;
3875 if ( v12 )
3876 pPlayer->uFace = 19;
3877 pPlayer->uVoiceID = pPlayer->uFace;
3878 pPlayer->SetInitialStats();
3879 pPlayer->SetSexByVoice();
3880 pPlayer->RandomizeName();
3881 v25 = uNum;
3882 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3883 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3884 uPlayerCreationUI_SelectedCharacter = v25;
3885 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressLeft[v25], 1);
3886 //v0 = pAudioPlayer;
3887 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
3888 pPlayer->PlaySound(SPEECH_PickMe, 0);
3889 //v1 = (char *)pParty->pPlayers;
3890 }
3891 continue;
3892
3893 case UIMSG_PlayerCreation_FaceNext:
3894 {
3895 pPlayer = &pParty->pPlayers[uNum];
3896 v20 = (char)((int)pPlayer->uFace + 1) % 20;
3897 pPlayer->uFace = v20;
3898 pPlayer->uVoiceID = v20;
3899 pPlayer->SetInitialStats();
3900 pPlayer->SetSexByVoice();
3901 pPlayer->RandomizeName();
3902 v21 = uNum;
3903 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3904 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3905 uPlayerCreationUI_SelectedCharacter = v21;
3906 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressRight[v21], 1);
3907 //v0 = pAudioPlayer;
3908 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3909 pPlayer->PlaySound(SPEECH_PickMe, 0);
3910 //v1 = (char *)pParty->pPlayers;
3816 } 3911 }
3817 continue; 3912 continue;
3818 } 3913 }
3819 3914
3820 switch (pUIMessageType) // For buttons of window LoadGame 3915 switch (pUIMessageType) // For buttons of window LoadGame
3886 3981
3887 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation 3982 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation
3888 { 3983 {
3889 if ( pUIMessageType > UIMSG_DownArrow ) 3984 if ( pUIMessageType > UIMSG_DownArrow )
3890 { 3985 {
3891 if ( pUIMessageType == UIMSG_SelectFacePlayerBack )
3892 {
3893 pPlayer = &pParty->pPlayers[uNum];
3894 v12 = (char)((int)pPlayer->uFace - 1) < 0;
3895 --pPlayer->uFace;
3896 if ( v12 )
3897 pPlayer->uFace = 19;
3898 pPlayer->uVoiceID = pPlayer->uFace;
3899 pPlayer->SetInitialStats();
3900 pPlayer->SetSexByVoice();
3901 pPlayer->RandomizeName();
3902 v25 = uNum;
3903 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3904 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3905 uPlayerCreationUI_SelectedCharacter = v25;
3906 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0,
3907 (enum WindowType)92, (int)pCreationUI_BtnPressLeft[v25], 1);
3908 //v0 = pAudioPlayer;
3909 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0);
3910 pPlayer->PlaySound(102, 0);
3911 //v1 = (char *)pParty->pPlayers;
3912 continue;
3913 }
3914 if ( pUIMessageType == UIMSG_SelectFacePlayerForward )
3915 {
3916 pPlayer = &pParty->pPlayers[uNum];
3917 v20 = (char)((int)pPlayer->uFace + 1) % 20;
3918 pPlayer->uFace = v20;
3919 pPlayer->uVoiceID = v20;
3920 pPlayer->SetInitialStats();
3921 pPlayer->SetSexByVoice();
3922 pPlayer->RandomizeName();
3923 v21 = uNum;
3924 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3925 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3926 uPlayerCreationUI_SelectedCharacter = v21;
3927 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, (enum WindowType)92,
3928 (int)pCreationUI_BtnPressRight[v21], 1);
3929 //v0 = pAudioPlayer;
3930 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
3931 pPlayer->PlaySound(102, 0);
3932 //v1 = (char *)pParty->pPlayers;
3933 continue;
3934 }
3935 if ( pUIMessageType == UIMSG_AD )//unknow 3986 if ( pUIMessageType == UIMSG_AD )//unknow
3936 { 3987 {
3937 __debugbreak(); 3988 __debugbreak();
3938 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); 3989 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0);
3939 SetCurrentMenuID(MENU_LOADINGPROC); 3990 SetCurrentMenuID(MENU_LOADINGPROC);
3956 pGUIWindow_CurrentMenu->Release(); 4007 pGUIWindow_CurrentMenu->Release();
3957 pEventTimer->Resume(); 4008 pEventTimer->Resume();
3958 pCurrentScreen = SCREEN_GAME; 4009 pCurrentScreen = SCREEN_GAME;
3959 viewparams->bRedrawGameUI = 1; 4010 viewparams->bRedrawGameUI = 1;
3960 } 4011 }
3961 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0); 4012 GUIWindow::Create(602, 450, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0);
3962 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 4013 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3963 continue; 4014 continue;
3964 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; 4015 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
3965 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 4016 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3966 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 4017 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
4044 continue; 4095 continue;
4045 } 4096 }
4046 //VideoPlayer::dtor(); 4097 //VideoPlayer::dtor();
4047 } 4098 }
4048 } 4099 }
4049 else
4050 {
4051 if ( pUIMessageType == UIMSG_PlayerCreationSelectQuality )
4052 {
4053 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
4054 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
4055 uPlayerCreationUI_SelectedCharacter = uNum;
4056 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
4057 continue;
4058 }
4059 if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack )// есть проблема со звуками
4060 {
4061 pCurrentPlayer = &pPlayer[uNum];
4062 pSex = pCurrentPlayer->GetSexByVoice();
4063 do
4064 {
4065 v12 = (pCurrentPlayer->uVoiceID-- - 1) == 0;
4066 if ( v12 )
4067 pCurrentPlayer->uVoiceID = 19;
4068 v13 = pCurrentPlayer->GetSexByVoice();
4069 }
4070 while ( v13 != pSex );
4071 pButton = pCreationUI_BtnPressLeft2[uNum];
4072 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1);
4073 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
4074 pCurrentPlayer->PlaySound(102, 0);
4075 continue;
4076 }
4077 if ( pUIMessageType == UIMSG_PlayerCreationVoiceForward )
4078 {
4079 pCurrentPlayer = &pPlayer[uNum];
4080 pSex = pCurrentPlayer->GetSexByVoice();
4081 do
4082 {
4083 pCurrentPlayer->uVoiceID = (signed int)(pCurrentPlayer->uVoiceID + 1) % 20;
4084 }
4085 while ( pCurrentPlayer->GetSexByVoice() != pSex );
4086 pButton = pCreationUI_BtnPressRight2[uNum];
4087 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1);
4088 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
4089 pCurrentPlayer->PlaySound(102, 0);
4090 continue;
4091 }
4092 }
4093 } 4100 }
4094 else 4101 else
4095 { 4102 {
4096 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) 4103 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill )
4097 { 4104 {
4132 continue; 4139 continue;
4133 } 4140 }
4134 if ( pUIMessageType == UIMSG_PlayerCreationSelectClass ) 4141 if ( pUIMessageType == UIMSG_PlayerCreationSelectClass )
4135 { 4142 {
4136 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); 4143 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum);
4137 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); 4144 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
4138 continue; 4145 continue;
4139 } 4146 }
4140 if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) 4147 if ( pUIMessageType == UIMSG_PlayerCreationClickOK )
4141 { 4148 {
4142 GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); 4149 GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0);
4155 { 4162 {
4156 if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill ) 4163 if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill )
4157 { 4164 {
4158 uPlayerCreationUI_SelectedCharacter = uNum; 4165 uPlayerCreationUI_SelectedCharacter = uNum;
4159 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; 4166 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
4160 pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; 4167 int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem;
4161 v41 = 2; 4168 v41 = 2;
4162 v5 = v4 % 7 + pSex + 7 * uNum; 4169 v5 = v4 % 7 + pSex + 7 * uNum;
4163 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; 4170 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
4164 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) 4171 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
4165 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; 4172 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
5126 stru_50FE08.count = 0; 5133 stru_50FE08.count = 0;
5127 } 5134 }
5128 // 50FE08: using guessed type stru298 stru_50FE08; 5135 // 50FE08: using guessed type stru298 stru_50FE08;
5129 5136
5130 //----- (00439474) -------------------------------------------------------- 5137 //----- (00439474) --------------------------------------------------------
5131 bool __fastcall DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, Vec3_int_ *pVelocity) 5138 void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, Vec3_int_ *pVelocity)
5132 { 5139 {
5133 signed int v3; // eax@1 5140 signed int v3; // eax@1
5134 LayingItem *v4; // ebx@1 5141 LayingItem *v4; // ebx@1
5135 int v5; // edx@3 5142 int v5; // edx@3
5136 bool uPlayerID; // eax@3 5143 bool uPlayerID; // eax@3
5211 v3 = v4->field_58; 5218 v3 = v4->field_58;
5212 v54 = v4->field_58; 5219 v54 = v4->field_58;
5213 } 5220 }
5214 v5 = v3 & 7; 5221 v5 = v3 & 7;
5215 uPlayerID = v3 >> 3; 5222 uPlayerID = v3 >> 3;
5216 if ( v5 != 4 ) 5223 if (v5 != OBJECT_Player)
5217 return uPlayerID; 5224 return;
5218 pPlayer = &pParty->pPlayers[uPlayerID]; 5225 pPlayer = &pParty->pPlayers[uPlayerID];
5219 if ( uPlayerID < 0 && uPlayerID > 3 ) 5226 if ( uPlayerID < 0 && uPlayerID > 3 )
5220 { 5227 {
5221 MessageBoxW(nullptr, L"Invalid player in damageMonsterFromParty!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Damage.cpp:457", 0); 5228 MessageBoxW(nullptr, L"Invalid player in damageMonsterFromParty!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Damage.cpp:457", 0);
5222 } 5229 }
5223 pMonster = &pActors[uActorID_Monster_]; 5230 pMonster = &pActors[uActorID_Monster_];
5224 uPlayerID = pMonster->IsAlive(); 5231 uPlayerID = pMonster->IsAlive();
5225 if ( uPlayerID ) 5232 if ( uPlayerID )
5226 return uPlayerID; 5233 return;
5227 BYTE1(pMonster->uAttributes) |= 0xC0u; 5234 BYTE1(pMonster->uAttributes) |= 0xC0u;
5228 if ( pMonster->uAIState == Fleeing ) 5235 if ( pMonster->uAIState == Fleeing )
5229 pMonster->uAttributes |= 0x20000u; 5236 pMonster->uAttributes |= 0x20000u;
5230 v58 = 0; 5237 v58 = 0;
5231 v53 = 0; 5238 v53 = 0;
5310 uPlayerID = ((unsigned int)(11 * v11) >> 5) + (v12 >> 2) + v10; 5317 uPlayerID = ((unsigned int)(11 * v11) >> 5) + (v12 >> 2) + v10;
5311 v61 = uPlayerID; 5318 v61 = uPlayerID;
5312 if ( uPlayerID >= 2560 ) 5319 if ( uPlayerID >= 2560 )
5313 { 5320 {
5314 if ( v61 >= 5120 && !(BYTE1(pMonster->uAttributes) & 4) ) 5321 if ( v61 >= 5120 && !(BYTE1(pMonster->uAttributes) & 4) )
5315 return uPlayerID; 5322 return;
5316 v61 = 2; 5323 v61 = 2;
5317 } 5324 }
5318 else 5325 else
5319 { 5326 {
5320 v61 = 1; 5327 v61 = 1;
5362 v59 = 0; 5369 v59 = 0;
5363 LABEL_67: 5370 LABEL_67:
5364 if ( !stru_50C198.PlayerHitOrMiss(pPlayer, pMonster, v61, a4) ) 5371 if ( !stru_50C198.PlayerHitOrMiss(pPlayer, pMonster, v61, a4) )
5365 { 5372 {
5366 LABEL_68: 5373 LABEL_68:
5367 LOWORD(uPlayerID) = pPlayer->PlaySound(52, 0); 5374 pPlayer->PlaySound(SPEECH_52, 0);
5368 return uPlayerID; 5375 return;
5369 } 5376 }
5370 goto LABEL_69; 5377 goto LABEL_69;
5371 } 5378 }
5372 if ( v15 == 34 ) 5379 if ( v15 == 34 )
5373 { 5380 {
5514 Actor::Die(uActorID_Monster_); 5521 Actor::Die(uActorID_Monster_);
5515 Actor::_438CF3(uActorID_Monster_); 5522 Actor::_438CF3(uActorID_Monster_);
5516 Actor::_43AC45(uActorID_Monster_, 1); 5523 Actor::_43AC45(uActorID_Monster_, 1);
5517 if ( pMonster->pMonsterInfo.uExp ) 5524 if ( pMonster->pMonsterInfo.uExp )
5518 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp); 5525 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp);
5519 v40 = 51; 5526 v40 = SPEECH_51;
5520 if ( rand() % 100 < 20 ) 5527 if ( rand() % 100 < 20 )
5521 v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1; 5528 v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1;
5522 pPlayer->PlaySound(v40, 0); 5529 pPlayer->PlaySound((PlayerSpeech)v40, 0);
5523 v41 = 0; 5530 v41 = 0;
5524 if ( bShowDamage ) 5531 if ( bShowDamage )
5525 { 5532 {
5526 v50 = (int)pMonster; 5533 v50 = (int)pMonster;
5527 pMonsterName = (char *)uDamageAmount; 5534 pMonsterName = (char *)uDamageAmount;
5584 pVelocity->z = (unsigned __int64)(v59 * (signed __int64)pVelocity->z) >> 16; 5591 pVelocity->z = (unsigned __int64)(v59 * (signed __int64)pVelocity->z) >> 16;
5585 pMonster->vVelocity.x = 50 * LOWORD(pVelocity->x); 5592 pMonster->vVelocity.x = 50 * LOWORD(pVelocity->x);
5586 pMonster->vVelocity.y = 50 * LOWORD(pVelocity->y); 5593 pMonster->vVelocity.y = 50 * LOWORD(pVelocity->y);
5587 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z); 5594 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z);
5588 } 5595 }
5589 return Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster_, 1, v61); 5596 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster_, 1, v61);
5590 } 5597 }
5591 // 4D864C: using guessed type char byte_4D864C; 5598 // 4D864C: using guessed type char byte_4D864C;
5592 5599
5593 5600
5594 //----- (00439FCB) -------------------------------------------------------- 5601 //----- (00439FCB) --------------------------------------------------------
5831 Actor::Die(uActorID); 5838 Actor::Die(uActorID);
5832 Actor::_438CF3(uActorID); 5839 Actor::_438CF3(uActorID);
5833 Actor::_43AC45(uActorID, 1); 5840 Actor::_43AC45(uActorID, 1);
5834 if ( v7->pMonsterInfo.uExp ) 5841 if ( v7->pMonsterInfo.uExp )
5835 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp); 5842 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp);
5836 v34 = 51; 5843 v34 = SPEECH_51;
5837 if ( rand() % 100 < 20 ) 5844 if ( rand() % 100 < 20 )
5838 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1; 5845 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1;
5839 v6->PlaySound(v34, 0); 5846 v6->PlaySound((PlayerSpeech)v34, 0);
5840 } 5847 }
5841 } 5848 }
5842 } 5849 }
5843 } 5850 }
5844 } 5851 }
5859 if ( (double)v6->GetMaxHealth() * 0.25 < v73 ) 5866 if ( (double)v6->GetMaxHealth() * 0.25 < v73 )
5860 { 5867 {
5861 if ( v6->sHealth > 0 ) 5868 if ( v6->sHealth > 0 )
5862 { 5869 {
5863 if ( (double)v6->GetMaxHealth() * 0.25 >= (double)v6->sHealth ) 5870 if ( (double)v6->GetMaxHealth() * 0.25 >= (double)v6->sHealth )
5864 v6->PlaySound(48, 0); 5871 v6->PlaySound(SPEECH_48, 0);
5865 } 5872 }
5866 } 5873 }
5867 } 5874 }
5868 viewparams->bRedrawGameUI = 1; 5875 viewparams->bRedrawGameUI = 1;
5869 return; 5876 return;
5891 v52 = v51; 5898 v52 = v51;
5892 if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) ) 5899 if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) )
5893 { 5900 {
5894 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[637], v45->pName); 5901 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[637], v45->pName);
5895 ShowStatusBarString(pTmpBuf, 2u); 5902 ShowStatusBarString(pTmpBuf, 2u);
5896 v45->PlaySound(6, 0); 5903 v45->PlaySound(SPEECH_6, 0);
5897 return; 5904 return;
5898 } 5905 }
5899 } 5906 }
5900 else 5907 else
5901 { 5908 {
6017 Actor::Die(uActorID); 6024 Actor::Die(uActorID);
6018 Actor::_438CF3(uActorID); 6025 Actor::_438CF3(uActorID);
6019 Actor::_43AC45(uActorID, 1); 6026 Actor::_43AC45(uActorID, 1);
6020 if ( v44->pMonsterInfo.uExp ) 6027 if ( v44->pMonsterInfo.uExp )
6021 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v44->pMonsterInfo.uID].uExp); 6028 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v44->pMonsterInfo.uID].uExp);
6022 v64 = 51; 6029 v64 = SPEECH_51;
6023 if ( rand() % 100 < 20 ) 6030 if ( rand() % 100 < 20 )
6024 v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1; 6031 v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1;
6025 v45->PlaySound(v64, 0); 6032 v45->PlaySound((PlayerSpeech)v64, 0);
6026 } 6033 }
6027 } 6034 }
6028 } 6035 }
6029 } 6036 }
6030 } 6037 }
15293 //goto LABEL_110; 15300 //goto LABEL_110;
15294 pGUIWindow2->Release(); 15301 pGUIWindow2->Release();
15295 continue; 15302 continue;
15296 } 15303 }
15297 v18 = v17 - 1; 15304 v18 = v17 - 1;
15298 if ( pWindowType == WINDOW_5C ) // Change page in AutonotesBook 15305 if ( pWindowType == WINDOW_VoiceSwitcherButton ) // Change page in AutonotesBook
15299 { 15306 {
15300 if ( pWindow->Hint != (char *)1 ) 15307 if ( pWindow->Hint != (char *)1 )
15301 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); 15308 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
15302 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; 15309 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
15303 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]); 15310 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]);
15889 v22 = (int)((char *)v0 + 36 * pOut.z); 15896 v22 = (int)((char *)v0 + 36 * pOut.z);
15890 if ( !BYTE2(pItemsTable->pItems[*(int *)(v22 + 532) + 1].uItemID) ) 15897 if ( !BYTE2(pItemsTable->pItems[*(int *)(v22 + 532) + 1].uItemID) )
15891 *(int *)(v22 + 552) |= 1u; 15898 *(int *)(v22 + 552) |= 1u;
15892 if ( !dword_4E455C ) 15899 if ( !dword_4E455C )
15893 goto LABEL_92; 15900 goto LABEL_92;
15894 v0->PlaySound(16, 0); 15901 v0->PlaySound(SPEECH_16, 0);
15895 goto LABEL_91; 15902 goto LABEL_91;
15896 } 15903 }
15897 if ( v45 ) 15904 if ( v45 )
15898 { 15905 {
15899 if ( *(int *)(a2.y + 532) == 221 ) 15906 if ( *(int *)(a2.y + 532) == 221 )
15930 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, v40, v41, v42); 15937 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, v40, v41, v42);
15931 sub_42F7EB_DropItemAt(0x41Bu, pOut.x, y.y, a2.y, 0, 1, 0, 0, 0); 15938 sub_42F7EB_DropItemAt(0x41Bu, pOut.x, y.y, a2.y, 0, 1, 0, 0, 0);
15932 if ( dword_4E455C ) 15939 if ( dword_4E455C )
15933 { 15940 {
15934 if ( v0->CanAct() ) 15941 if ( v0->CanAct() )
15935 v0->PlaySound(17, 0); 15942 v0->PlaySound(SPEECH_17, 0);
15936 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u); 15943 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u);
15937 LABEL_91: 15944 LABEL_91:
15938 dword_4E455C = 0; 15945 dword_4E455C = 0;
15939 } 15946 }
15940 LABEL_92: 15947 LABEL_92:
15978 } 15985 }
15979 pMouse->RemoveHoldingItem(); 15986 pMouse->RemoveHoldingItem();
15980 dword_50CDCC = 1; 15987 dword_50CDCC = 1;
15981 if ( dword_4E455C ) 15988 if ( dword_4E455C )
15982 { 15989 {
15983 v0->PlaySound(16, 0); 15990 v0->PlaySound(SPEECH_16, 0);
15984 dword_4E455C = 0; 15991 dword_4E455C = 0;
15985 } 15992 }
15986 } 15993 }
15987 15994
15988 15995