Mercurial > mm7
diff mm7_3.cpp @ 1048:d36681a9e4f8
Слияние
author | Ritor1 |
---|---|
date | Thu, 23 May 2013 11:17:01 +0600 |
parents | ff2d888f8033 |
children | d48c762de563 |
line wrap: on
line diff
--- a/mm7_3.cpp Thu May 23 11:16:46 2013 +0600 +++ b/mm7_3.cpp Thu May 23 11:17:01 2013 +0600 @@ -1662,8 +1662,8 @@ auto player = pParty->pPlayers + i; if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, 8)) { - player->ReceiveDamage((pParty->uFallStartY - party_z) * (0.1f * player->GetMaxHealth()) / 256, 4); - v10 = (double)(20 - player->_48EA1B_get_static_effect(player->GetActualEndurance())) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; + player->ReceiveDamage((pParty->uFallStartY - party_z) * (0.1f * player->GetMaxHealth()) / 256, DMGT_PHISYCAL); + v10 = (double)(20 - player->GetParameterBonus(player->GetActualEndurance())) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; player->SetRecoveryTime((signed __int64)v10); } } @@ -2301,8 +2301,8 @@ { player->ReceiveDamage( (signed int)((pParty->uFallStartY - pZ) * (unsigned __int64)(player->GetMaxHealth() / 10)) / 256, - 4); - v105 = 20 - player->_48EA1B_get_static_effect(player->GetActualEndurance()); + DMGT_PHISYCAL); + v105 = 20 - player->GetParameterBonus(player->GetActualEndurance()); player->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); } //} @@ -3081,9 +3081,9 @@ v110 = (*v74)->GetMaxHealth(); (*v74)->ReceiveDamage( (signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256, - 4); + DMGT_PHISYCAL); v75 = (*v74)->GetActualEndurance(); - v110 = 20 - (*v74)->_48EA1B_get_static_effect(v75); + v110 = 20 - (*v74)->GetParameterBonus(v75); (*v74)->SetRecoveryTime( (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); ++v74; @@ -3203,9 +3203,9 @@ v110 = (*v84)->GetMaxHealth(); (*v84)->ReceiveDamage( (signed int)((pParty->uFallStartY - v81) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256, - 4); + DMGT_PHISYCAL); v85 = (*v84)->GetActualEndurance(); - v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85); + v110 = 20 - (*v84)->GetParameterBonus(v85); (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); ++v84; } @@ -12041,113 +12041,6 @@ LoadLevel_InitializeLevelStr(); } -//----- (004443D5) -------------------------------------------------------- -char *__cdecl _4443D5_GetMinimapRightClickText() -{ - int v0; // ST20_4@1 - unsigned int v1; // esi@1 - signed int v2; // ebx@1 - double v3; // st7@1 - int v4; // esi@3 - int v5; // edi@4 - int v6; // eax@4 - int v7; // eax@4 - BSPModel *v8; // ecx@4 - unsigned __int8 v9; // zf@5 - char v10; // sf@5 - unsigned __int8 v11; // of@5 - ODMFace *v12; // eax@6 - __int16 v13; // cx@6 - const char *v14; // eax@8 - const char *v15; // edi@8 - char *result; // eax@12 - unsigned int v17; // eax@14 - unsigned int v18; // [sp+Ch] [bp-20h]@1 - int v19; // [sp+10h] [bp-1Ch]@1 - int v20; // [sp+14h] [bp-18h]@1 - char *v21; // [sp+18h] [bp-14h]@1 - unsigned int pY; // [sp+1Ch] [bp-10h]@1 - int v23; // [sp+20h] [bp-Ch]@1 - int v24; // [sp+24h] [bp-8h]@1 - int pX; // [sp+28h] [bp-4h]@1 - - v24 = pParty->vPosition.x; - v0 = pParty->vPosition.y; - v1 = pOutdoor->uNumBModels; - *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789; - v2 = 0; - v18 = pOutdoor->uNumBModels; - v21 = 0; - pMouse->GetClickPos((unsigned int *)&pX, &pY); - v3 = 1.0 / *(float *)&v23; - v23 = pX - 557; - v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24); - v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3); - if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) ) - { -LABEL_14: - v17 = pMapStats->GetMapInfo(pCurrentMapName); - if ( v17 == v2 ) - result = "No Maze Info for this maze on file!"; - else - result = pMapStats->pInfos[v17].pName; - } - else - { - v4 = 0; - while ( 1 ) - { - pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19; - pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20; - v5 = abs((signed)pY); - v6 = abs((signed)pX); - v7 = int_get_vector_length(v6, v5, v2); - v8 = &pOutdoor->pBModels[0]; - if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius ) - { - v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2); - v9 = pOutdoor->pBModels[v4].uNumFaces == v2; - v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0; - v24 = v2; - if ( !((unsigned __int8)(v10 ^ v11) | v9) ) - { - do - { - v12 = &v8[v4].pFaces[v2 / 0x134u]; - v13 = v12->sCogTriggeredID; - if ( v13 ) - { - if ( !(BYTE2(v12->uAttributes) & 0x10) ) - { - v14 = GetEventHintString(v13); - v15 = v14; - if ( v14 ) - { - if ( _strcmpi(v14, "") ) - v21 = (char *)v15; - } - } - } - ++v24; - v8 = pOutdoor->pBModels; - v2 += 308; - } - while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces ); - } - result = v21; - v2 = 0; - if ( v21 ) - break; - } - ++v23; - ++v4; - if ( v23 >= (signed int)v18 ) - goto LABEL_14; - } - } - return result; -} - //----- (00444564) -------------------------------------------------------- const char *__cdecl sub_444564() { @@ -12232,102 +12125,6 @@ return result; } -//----- (00444A51) -------------------------------------------------------- -void TransitionUI_Draw() -{ - MapInfo *pMapInfo; // esi@5 - char *v1; // eax@6 - std::string v3; // [sp-18h] [bp-84h]@11 - unsigned int v4; // [sp-10h] [bp-7Ch]@12 - int v5; // [sp-Ch] [bp-78h]@12 - const char *v6; // [sp-8h] [bp-74h]@11 - signed int v7; // [sp-4h] [bp-70h]@11 - GUIWindow v8; // [sp+Ch] [bp-60h]@1 - unsigned int v9; // [sp+60h] [bp-Ch]@1 - unsigned int v10; // [sp+64h] [bp-8h]@1 - int a3; // [sp+6Bh] [bp-1h]@11 - - memcpy(&v8, pPrimaryWindow, sizeof(v8)); - v10 = pMapStats->GetMapInfo(pCurrentMapName); - v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name); - pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); - pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C)); - pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside); - uTextureID_right_panel_loop = uTextureID_right_panel; - pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_right_panel)); - pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u)); - pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u)); - if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != ' ' ) - v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name); - pMapInfo = &pMapStats->pInfos[v10]; - v8.uFrameX = 493; - v8.uFrameWidth = 126; - v8.uFrameZ = 366; - v8.DrawTitleText(pFontCreate, 0, 5u, 0, pMapInfo->pName, 3); - v8.uFrameX = 483; - v8.uFrameWidth = 148; - v8.uFrameZ = 334; - - v1 = ""; - if ( uCurrentHouse_Animation ) - { - v1 = pTransitionStrings[uCurrentHouse_Animation]; - v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101; - v8.DrawTitleText(pFontCreate, 0, v4, 0, v1, 3); - } - else if ( v10 ) - { - sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?" - v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf, &v8, 0, 0)) / 2 + 101; - v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf, 3); - } - else assert(false); - - _unused_5B5924_is_travel_ui_drawn = true; -} - -//----- (00444C8F) -------------------------------------------------------- -void UI_CreateTravelDialogue() -{ - //signed int v0; // eax@1 - unsigned int v1; // eax@6 - GUIWindow *result; // eax@9 - //const char *v3; // [sp-4h] [bp-2Ch]@2 - char pContainer[32]; // [sp+0h] [bp-28h]@1 - - pEventTimer->Pause(); - /*v0 = const_2(); - sprintf(pContainer, "evt%02d", v0); - if ( pParty->uAlignment ) - { - if ( pParty->uAlignment != 2 ) - goto LABEL_6; - v3 = "-c"; - } - else - { - v3 = "-b"; - } - strcat(pContainer, v3); -LABEL_6:*/ - switch (pParty->alignment) - { - case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break; - case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break; - case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; - default: assert(false); - } - - pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); - pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE); - v1 = pMapStats->GetMapInfo(pCurrentMapName); - if ( v1 ) - sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s" - else - strcpy(sHouseName, pGlobalTXT_LocalizationStrings[79]);// "Exit" - pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, (int)sHouseName); -} - //----- (00444D80) -------------------------------------------------------- signed int __cdecl GetTravelTime() { @@ -12348,123 +12145,6 @@ } // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot; -//----- (00444DCA) -------------------------------------------------------- -void __cdecl TravelUI_Draw() -{ - unsigned int v0; // edi@1 - MapInfo *v1; // edi@2 - signed int v3; // eax@2 - int v4; // eax@5 - const char *v5; // [sp-Ch] [bp-90h]@3 - signed int v6; // [sp-8h] [bp-8Ch]@3 - GUIWindow v7; // [sp+Ch] [bp-78h]@1 - char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1 - unsigned int v9; // [sp+80h] [bp-4h]@1 - - memcpy(&v7, pPrimaryWindow, sizeof(v7)); - v9 = pMapStats->GetMapInfo(pCurrentMapName); - pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20); - v0 = pMapStats->GetMapInfo(pDestinationMapName); - pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); - pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]); - pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside); - pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_x_u)); - pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_ok_u)); - if ( v0 ) - { - v1 = &pMapStats->pInfos[v0]; - v7.uFrameX = 493; - v7.uFrameWidth = 126; - v7.uFrameZ = 366; - v7.DrawTitleText(pFontCreate, 0, 4u, 0, v1->pName, 3); - v7.uFrameX = 483; - v7.uFrameWidth = 148; - v7.uFrameZ = 334; - v3 = GetTravelTime(); - if ( v3 == 1 ) - { - v6 = 1; - v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s." - } - else - { - v6 = v3; - v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s." - } - sprintfex(pTmpBuf, v5, v6, v1->pName); - strcat(pTmpBuf, "\n \n"); - sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName); - strcat(pTmpBuf, pTmpBuf2); - v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0); - v7.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3u); - _unused_5B5924_is_travel_ui_drawn = 1; - } -} - -//----- (00444FBE) -------------------------------------------------------- -void __cdecl DrawBranchlessDialogueUI() -{ - GUIFont *v0; // esi@1 - int v1; // esi@4 - char *v2; // eax@6 - int v3; // edi@12 - char Str[200]; // [sp+Ch] [bp-120h]@12 - GUIWindow v5; // [sp+D4h] [bp-58h]@4 - GUIFont *pFont; // [sp+128h] [bp-4h]@1 - - v0 = pFontArrus; - pFont = pFontArrus; - if ( current_npc_text && !byte_5B0938[0] ) - strcpy(byte_5B0938, current_npc_text); - v5.uFrameWidth = game_viewport_width; - v5.uFrameZ = 452; - v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7; - if ( 352 - v1 < 8 ) - { - pFont = pFontCreate; - v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7; - } - pRenderer->_4A6A68( - 8u, - 352 - v1, - (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), - (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v1); - pRenderer->DrawTextureIndexed(8u, 347 - v1, pTexture_591428); - v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0); - pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0); - pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); - if ( pGUIWindow2->field_40 != 1 ) - { - if ( pGUIWindow2->field_40 == 2 ) - { - pGUIWindow2->field_40 = 0; - strcpy(GameUI_Footer_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer); -LABEL_16: - sub_4452BB(); - return; - } - if ( pGUIWindow2->field_40 != 3 ) - return; - pGUIWindow2->field_40 = 0; -LABEL_15: - memset(GameUI_Footer_TimedString, 0, 0xC8u); - goto LABEL_16; - } - if ( pGUIWindow2->ptr_1C == (void *)26 ) - { - sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer); - v3 = pFontLucida->GetLineWidth(Str); - pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0); - pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida); - return; - } - if ( pKeyActionMap->pPressedKeysBuffer[0] ) - { - pKeyActionMap->_459ED1(0); - goto LABEL_15; - } -} - //----- (004451A8) -------------------------------------------------------- void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4) { @@ -12524,359 +12204,6 @@ return pNPCTopics[407].pTopic; } -//----- (00445350) -------------------------------------------------------- -void __cdecl DrawDialogueUI() -{ - NPCData *pNPC; // ebx@2 - int pGreetType; // eax@2 - unsigned __int16 v2; // di@2 - //unsigned int v3; // eax@2 - char *v4; // esi@3 - //int v5; // eax@11 - //char *v6; // ecx@13 - //char *v7; // eax@16 - //unsigned int v8; // edi@19 - //char *v9; // ecx@27 - char *v10; // eax@29 - //int v11; // eax@30 - int v12; // esi@39 - char *v13; // eax@41 - GUIButton *v14; // eax@43 - //GUIButton *v15; // edi@43 - signed int v16; // eax@44 - //unsigned int v23; // eax@53 - //const char *v24; // eax@59 - //unsigned __int16 v30; // cx@83 - int v31; // ecx@86 - int v32; // ebx@93 - unsigned int v33; // eax@93 - GUIWindow *v34; // ecx@93 - int v35; // esi@93 - int i; // eax@93 - GUIButton *v37; // eax@94 - int v38; // eax@95 - signed int v39; // esi@99 - signed int v40; // eax@102 - unsigned int v41; // ebx@102 - int v42; // edi@102 - GUIButton *v43; // esi@103 - int v44; // eax@104 - unsigned int v45; // ecx@104 - unsigned __int16 *v46; // edx@104 - unsigned __int16 v47; // ax@104 - GUIWindow pWindow; // [sp+4h] [bp-110h]@39 - int v49; // [sp+Ch] [bp-108h]@39 - int v50; // [sp+14h] [bp-100h]@39 - GUIWindow v51; // [sp+58h] [bp-BCh]@2 - GUIWindow v52; // [sp+ACh] [bp-68h]@42 - char *Str; // [sp+100h] [bp-14h]@104 - //int v54; // [sp+104h] [bp-10h]@2 - //unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82 - GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 - char *pInString=NULL; // [sp+110h] [bp-4h]@32 - - if ( !pDialogueWindow ) - return; - memcpy(&v51, pDialogueWindow, sizeof(v51)); - pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); - pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); - v51.uFrameWidth -= 10; - v51.uFrameZ -= 10; - //v54 = v1; - TargetColor(0xFFu, 0xFFu, 0xFFu); - TargetColor(0xE1u, 0xCDu, 0x23u); - v2 = TargetColor(0x15u, 0x99u, 0xE9u); - pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); - pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0)); - pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); - pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); - - if (pNPC->uProfession) - { - assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text - sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s - } - else - strcpy(pTmpBuf, pNPC->pName); - - v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); - pParty->GetPartyFame(); - - pInString = nullptr; - switch (uDialogueType) - { - case DIALOGUE_13: - pInString = BuilDialogueString(pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); - break; - - case DIALOGUE_PROFESSION_DETAILS: - { - auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; - - if (dialogue_show_profession_details) - pInString = BuilDialogueString(prof->pBenefits, uActiveCharacter - 1, 0, 0, 0, 0); - else if (pNPC->Hired()) - pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); - else - pInString = BuilDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); - } - break; - - - case DIALOGUE_ARENA_WELCOME: - pInString = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" - break; - - case DIALOGUE_ARENA_FIGHT_NOT_OVER_YET: - pInString = pGlobalTXT_LocalizationStrings[577]; //"Get back in there you wimps:" - break; - - case DIALOGUE_ARENA_REWARD: - sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold." - pInString = pTmpBuf; - break; - - case DIALOGUE_ARENA_ALREADY_WON: - pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" - break; - - default: - if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0]) - { - pInString = (char *)current_npc_text; - } - else if (pGreetType == 1)//QuestNPC_greet - { - if (pNPC->greet) - { - if ((pNPC->uFlags & 3) == 2) - pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2; - else - pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; - } - } - else if (pGreetType == 2)//HiredNPC_greet - { - auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; - - if (pNPC->Hired()) - pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); - else - pInString = BuilDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); - } - break; - } - - if (pInString) - { - pWindow.uFrameWidth = game_viewport_width; - pWindow.uFrameZ = 452; - auto font = pFontArrus; - v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; - if ( 352 - v12 < 8 ) - { - font = pFontCreate; - v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; - } - if (uTextureID_Leather != -1) - pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); - pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); - v13 = FitTextInAWindow(pInString, font, &pWindow, 0xDu, 0); - pDialogueWindow->DrawText(font, 13, 354 - v12, 0, v13, 0, 0, 0); - } - - - memcpy(&v52, pDialogueWindow, sizeof(v52)); - v52.uFrameX = 483; - v52.uFrameWidth = 148; - v52.uFrameZ = 334; - for (int i = v52.pStartingPosActiveItem; - i < v52.pStartingPosActiveItem + v52.pNumPresenceButton; ++i) - { - v14 = v52.GetControl(i); - //v15 = v14; - if ( !v14 ) - break; - v16 = v14->msg_param; - - if ( v16 > 88 ) - v14->pButtonName[0] = 0; - else if (v16 == 88) - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord - else if (v16 == 87) - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight - else if (v16 == 86) - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire - else if (v16 == 85) - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page - else if (v16 == 77) - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details - else if (v16 == 76) - { - if (pNPC->Hired()) - sprintf(v14->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s - else - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire - } - else if (v16 == 24) - { - __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - v14->pButtonName[0] = 0; - v14->msg_param = 0; - } - else - strcpy(v14->pButtonName, topic); - } - else if (v16 == 9) - strcpy(v14->pButtonName, GetProfessionActionText(pNPC->uProfession)); - else if (v16 == 19) - { - // __debugbreak(); // learn conditions of this event Scavenger Hunt - auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - v14->pButtonName[0] = 0; - v14->msg_param = 0; - } - else strcpy(v14->pButtonName, topic); - } - else if (v16 == 20) - { - //__debugbreak(); // learn conditions of this event instruments - auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - v14->pButtonName[0] = 0; - v14->msg_param = 0; - } - else strcpy(v14->pButtonName, topic); - } - else if (v16 == 21) - { - //__debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - v14->pButtonName[0] = 0; - v14->msg_param = 0; - } - else strcpy(v14->pButtonName, topic); - } - else if (v16 == 22) - { - //__debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - v14->pButtonName[0] = 0; - v14->msg_param = 0; - } - else strcpy(v14->pButtonName, topic); - } - else if (v16 == 23) - { - //__debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - v14->pButtonName[0] = 0; - v14->msg_param = 0; - } - else strcpy(v14->pButtonName, topic); - } - else if (v16 == 13) - { - if (pNPC->Hired()) - sprintf(v14->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s - else - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join - } - else - v14->pButtonName[0] = 0; - - - if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1) - { - int num_dead_actors = 0; - pInString = 0; - for (uint i = 0; i < uNumActors; ++i) - { - if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || - pActors[i].uAIState == Disabled) - ++num_dead_actors; - else - { - int sumonner_type = PID_TYPE(pActors[i].uSummonerID); - if (sumonner_type == OBJECT_Player) - ++num_dead_actors; - } - } - if (num_dead_actors == uNumActors) - strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize - } - } - - - v32 = 0; - //pInString = (char *)TargetColor(0xFFu, 0xFFu, 0xFFu); - v33 = TargetColor(0xE1u, 0xCDu, 0x23u); - v34 = pDialogueWindow; - //v54 = v33; - v35 = pDialogueWindow->pStartingPosActiveItem; - for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) - { - v37 = v34->GetControl(v35); - if ( !v37 ) - { - v34 = pDialogueWindow; - break; - } - v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0); - v34 = pDialogueWindow; - v32 += v38; - ++v35; - } - v39 = v34->pNumPresenceButton; - if ( v39 ) - { - pOutString = (GUIFont *)((174 - v32) / v39); - if ( (174 - v32) / v39 > 32 ) - pOutString = (GUIFont *)32; - int v55 = 1; - v40 = 174 - (int)pOutString * v39 - v32; - v41 = v34->pStartingPosActiveItem; - v42 = v40 / 2 - (signed int)pOutString / 2 + 138; - if ( (signed int)v41 < (signed int)(v41 + v39) ) - { - do - { - v43 = v34->GetControl(v41); - if ( !v43 ) - break; - v43->uY = (unsigned int)((char *)pOutString + v42); - Str = v43->pButtonName; - v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0); - v45 = v43->uY; - v46 = (unsigned short *)v55; - v43->uHeight = v44; - v42 = v45 + v44 - 1; - v43->uW = v42; - v47 = v33; - if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 ) - v47 = TargetColor(0xFFu, 0xFFu, 0xFFu); - v52.DrawTitleText(pFontArrus, 0, v45, v47, Str, 3u); - v34 = pDialogueWindow; - ++v55; - ++v41; - } - while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); - } - } - pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); -} //----- (00445C8B) -------------------------------------------------------- int __fastcall GetGreetType(signed int SpeakingNPC_ID) @@ -14429,13 +13756,8 @@ _5B65A8_npcdata_uflags_or_other = 0; } } -// 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other; -// 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other; -// 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other; -// 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other; -// 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other; -// 5B65BC: using guessed type int dword_5B65BC; -// 5B65C0: using guessed type int dword_5B65C0; + + //----- (00449A49) -------------------------------------------------------- __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2) @@ -14532,7 +13854,7 @@ //----- (00449B57) -------------------------------------------------------- bool _449B57_test_bit( unsigned __int8 *a1, __int16 a2 ) - { +{ return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8); } @@ -14550,23 +13872,6 @@ pArray[v3 / 8] &= ~set_bit; } -//----- (0044A56A) -------------------------------------------------------- -void __cdecl Party__CountHirelings() -{ - pParty->field_70A = 0; - - for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) - { - auto npc = pNPCStats->pNewNPCData + i; - if (npc->Hired() && - (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))) - { - if (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) - ++pParty->field_70A; - } - } -} - //----- (0044C175) -------------------------------------------------------- void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds) { @@ -14583,7 +13888,7 @@ } //----- (0044C1D0) -------------------------------------------------------- -void __cdecl ShowNothingHereStatus() +void ShowNothingHereStatus() { if ( !GameUI_Footer_TimeLeft ) ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here @@ -14621,20 +13926,27 @@ //----- (0044C2F4) -------------------------------------------------------- int LevelDecoration::IsInteractive() { - signed int v1; // eax@1 - - v1 = this->uDecorationDescID; - if ( v1 > 34 ) - { - if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 ) - return 1; - } - else - { - if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) ) - return 1; - } - return 0; + switch (uDecorationDescID) + { + case 4: // trash pile + case 5: // campfire + case 6: // cauldron + case 11: // fruit plate + case 13: // trash pile + case 14: // dirt + case 24: // keg + case 184: // fire + case 187: // fire + case 190: // fire + return true; + } + + if (uDecorationDescID >= 206 && uDecorationDescID <= 209) // lighthouse fire + return true; + if (uDecorationDescID >= 210 && uDecorationDescID <= 221) // magic pedistal + return true; + + return false; } //----- (0044C362) -------------------------------------------------------- @@ -14655,6 +13967,7 @@ float v13; // ST14_4@1 double v14; // ST0C_8@1 + assert(false); //v1 = this; v2 = (double)this->x * 0.000015258789; v3 = v2; @@ -15239,7 +14552,7 @@ { pPlayer = *v8; if ( !(*v8)->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] ) - pPlayer->ReceiveDamage(v4, 5); + pPlayer->ReceiveDamage(v4, DMGT_5); ++v8; } while ( (signed int)v8 <= (signed int)&pPlayers[4] );