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