Mercurial > mm7
changeset 1796:722883bd7fed
Merge
author | Ritor1 |
---|---|
date | Wed, 02 Oct 2013 18:27:48 +0600 |
parents | db16b4d76f9d (current diff) 53c0453f4eb2 (diff) |
children | 6e513e042e0e |
files | |
diffstat | 6 files changed, 115 insertions(+), 138 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Wed Oct 02 18:27:27 2013 +0600 +++ b/Actor.cpp Wed Oct 02 18:27:48 2013 +0600 @@ -46,55 +46,40 @@ //----- (0041AF52) -------------------------------------------------------- -void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) +void Actor::DrawHealthBar(Actor *actor, GUIWindow *window) { - unsigned int v2; // eax@1 - GUIWindow *v3; // edi@1 - unsigned int v4; // esi@1 - signed int v5; // ebx@4 - double v6; // st7@5 - unsigned int v7; // eax@6 - unsigned int v8; // ebx@10 + unsigned int bar_length; // esi@1 + unsigned int uX; // ebx@10 unsigned int v9; // [sp+14h] [bp-Ch]@4 unsigned int v10; // [sp+1Ch] [bp-4h]@4 - v2 = a1->pMonsterInfo.uHP; - v3 = a2; - v4 = 25; - if ( (signed int)v2 > 25 ) + bar_length = 25; + if ( actor->pMonsterInfo.uHP > 25 ) { - v4 = 200; - if ( (signed int)v2 < 200 ) - v4 = a1->pMonsterInfo.uHP; + bar_length = 200; + if ( actor->pMonsterInfo.uHP < 200 ) + bar_length = actor->pMonsterInfo.uHP; } - v5 = a1->sCurrentHP; - v10 = v4; + v10 = bar_length; v9 = uTextureID_mhp_grn; - if ( v5 < (signed int)v2 ) + if ( actor->sCurrentHP < actor->pMonsterInfo.uHP ) { - v6 = (double)(signed int)v2; - v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); - if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) - { - v7 = uTextureID_mhp_red; - v9 = v7; - } - else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) - { - v7 = uTextureID_mhp_yel; - v9 = v7; - } + v10 = bar_length / actor->pMonsterInfo.uHP * actor->sCurrentHP; + if ( actor->sCurrentHP <= (signed int)(signed __int64)(0.34 * (double)(signed int)actor->pMonsterInfo.uHP) ) + v9 = uTextureID_mhp_red; + else if ( actor->sCurrentHP <= (signed int)(signed __int64)((double)(signed int)actor->pMonsterInfo.uHP * 0.67) ) + v9 = uTextureID_mhp_yel; } - v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; + uX = window->uFrameX + (signed int)(window->uFrameWidth - bar_length) / 2; - pRenderer->SetTextureClipRect(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); - pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); - pRenderer->SetTextureClipRect(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); - pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 34, pIcons_LOD->GetTexture(v9)); + pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + bar_length, window->uFrameY + 52); + pRenderer->DrawTextureIndexed(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); + pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + v10, window->uFrameY + 52); + pRenderer->DrawTextureIndexed(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9)); pRenderer->ResetTextureClipRect(); - pRenderer->DrawTextureIndexed(v8 - 5, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); - pRenderer->DrawTextureIndexed(v8 + v4, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); + pRenderer->DrawTextureIndexed(uX - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); + pRenderer->DrawTextureIndexed(uX + bar_length, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); } //----- (00448A40) -------------------------------------------------------- @@ -227,7 +212,6 @@ } } - //----- (0040894B) -------------------------------------------------------- bool Actor::CanAct() { @@ -1910,16 +1894,13 @@ //----- (00403E61) -------------------------------------------------------- void __fastcall Actor::StandAwhile(unsigned int uActorID) { - Actor *v1; // esi@1 - - v1 = &pActors[uActorID]; - v1->uCurrentActionLength = rand() % 128 + 128; - v1->uCurrentActionTime = 0; - v1->uAIState = Standing; - v1->vVelocity.z = 0; - v1->vVelocity.y = 0; - v1->vVelocity.x = 0; - v1->UpdateAnimation(); + pActors[uActorID].uCurrentActionLength = rand() % 128 + 128; + pActors[uActorID].uCurrentActionTime = 0; + pActors[uActorID].uAIState = Standing; + pActors[uActorID].vVelocity.z = 0; + pActors[uActorID].vVelocity.y = 0; + pActors[uActorID].vVelocity.x = 0; + pActors[uActorID].UpdateAnimation(); } //----- (00403C6C) -------------------------------------------------------- @@ -3012,7 +2993,7 @@ break; } - if (rand() % 100 < 20) + if (rand() % 100 < 20 && drop.uItemID != 0) { sub_42F7EB_DropItemAt(pItemsTable->pItems[drop.uItemID].uSpriteID, actor->vPosition.x,
--- a/Actor.h Wed Oct 02 18:27:27 2013 +0600 +++ b/Actor.h Wed Oct 02 18:27:48 2013 +0600 @@ -237,7 +237,7 @@ static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive); static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle); static void ApplyFineForKillingPeasant(unsigned int uActorID); - static void DrawHealthBar(Actor *a1, struct GUIWindow *a2); + static void DrawHealthBar(Actor *actor, struct GUIWindow *window); static int _43B3E0_CalcDamage(Actor *a1, signed int a2); static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
--- a/Items.h Wed Oct 02 18:27:27 2013 +0600 +++ b/Items.h Wed Oct 02 18:27:48 2013 +0600 @@ -273,11 +273,11 @@ // 72 Prevents falling damage. int uNumCharges; //10 unsigned int uAttributes; //14 - unsigned __int8 uBodyAnchor; - char uMaxCharges; - char uHolderPlayer; - char field_1B; - unsigned __int64 uExpireTime; + unsigned __int8 uBodyAnchor; //18 + char uMaxCharges; //19 + char uHolderPlayer; //1A + char field_1B; //1B + unsigned __int64 uExpireTime; //1C }; #pragma pack(pop)
--- a/Player.cpp Wed Oct 02 18:27:27 2013 +0600 +++ b/Player.cpp Wed Oct 02 18:27:48 2013 +0600 @@ -2564,7 +2564,6 @@ int Player::GetAttackRecoveryTime(bool bRangedAttack) { ItemGen *weapon = nullptr; - ItemDesc *weapon_desc = nullptr; uint weapon_recovery = base_recovery_times_per_weapon_type[0]; if (bRangedAttack) { @@ -2647,9 +2646,9 @@ (weapon->GetPlayerSkillType() == PLAYER_SKILL_SWORD || weapon->GetPlayerSkillType() == PLAYER_SKILL_AXE || weapon->GetPlayerSkillType() == PLAYER_SKILL_BOW) ) { if (SkillToMastery(pActiveSkills[weapon->GetPlayerSkillType()]) >= 2 ) // Expert Sword, Axe & Bow reduce recovery - sword_axe_bow_recovery_reduction = pActiveSkills[weapon_desc->uSkillType] & 0x3F; - } - if (weapon_desc->uSkillType == PLAYER_SKILL_BLASTER) + sword_axe_bow_recovery_reduction = pActiveSkills[weapon->GetPlayerSkillType()] & 0x3F; + } + if (weapon->GetPlayerSkillType() == PLAYER_SKILL_BLASTER) shooting_laser = true; } @@ -5515,8 +5514,7 @@ || var_type > VAR_History_28 || (v22 = var_type - VAR_History_0, pParty->PartyTimes.HistoryEventTimes[v22]) || (pParty->PartyTimes.HistoryEventTimes[v22] = pParty->uTimePlayed, - v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0, - v23) ) + pStorylineText->StoreLine[v22].pText == 0) )//*(&pStorylineText->field_0 + 3 * v22) == 0, return; bFlashHistoryBook = 1; } @@ -5579,18 +5577,18 @@ this->classType = (PLAYER_CLASS_TYPE)var_value; if ( (char)var_value == PLAYER_CLASS_LICH ) { - v9 = NULL; for (int i = 0; i < 138; i++) { v9 = &this->pInventoryItemList[i]; if (v9->uItemID == ITEM_LICH_JAR_EMPTY) + { + v9->uItemID = ITEM_LICH_JAR_FULL; + v9->uHolderPlayer = currPlayerId + 1; + v10 = (int)((char *)this + 36 * 138); + *(int *)(v10 + 532) = 601; + *(char *)(v10 + 558) = currPlayerId + 1; break; - } - if (v9 != NULL && v9->uItemID != ITEM_LICH_JAR_EMPTY) - { - v10 = (int)((char *)this + 36 * 138); //originally 36 * v8. the code got to this condition only if v8 was equal to 138 - *(int *)(v10 + 532) = 601; - *(char *)(v10 + 558) = currPlayerId + 1; + } } if ( this->sResFireBase < 20 ) this->sResFireBase = 20; @@ -5602,10 +5600,9 @@ this->sResEarthBase = 20; this->sResMindBase = 200; this->sResBodyBase = 200; - v11 = this->GetSexByVoice(); this->uPrevVoiceID = this->uVoiceID; this->uPrevFace = this->uCurrentFace; - if ( v11 ) + if ( IsFemale() ) { this->uCurrentFace = 21; this->uVoiceID = 21; @@ -5857,10 +5854,10 @@ { v16 = (int)((char *)&this->pConditions[16] + 2 * var_type); v17 = *(char *)v16; - if ( var_value <= VAR_BodyResistanceBonus ) + if ( var_value <= 63 ) { LOWORD(v15) = (unsigned __int8)var_value; - v18 = v15 | v17 & VAR_BodyResistanceBonus; + v18 = v15 | v17 & 63; } else {
--- a/mm7_2.cpp Wed Oct 02 18:27:27 2013 +0600 +++ b/mm7_2.cpp Wed Oct 02 18:27:48 2013 +0600 @@ -5104,6 +5104,7 @@ } bool new_sky = false; +bool new_draw_object_dist = true; bool change_seasons = false; bool all_magic = true; bool wizard_eye = false; @@ -5398,7 +5399,12 @@ mipmapping_building_mm3 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm3", 4096, pIniFilename); pODMRenderParams->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename); pODMRenderParams->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename); - pODMRenderParams->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 8192, pIniFilename); + + int dist = 0x2000; + extern bool new_draw_object_dist; + if ( new_draw_object_dist ) + dist = 0x6000; + pODMRenderParams->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", dist, pIniFilename); wchar_t pDefaultSkyTextureW[1024]; GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
--- a/mm7_6.cpp Wed Oct 02 18:27:27 2013 +0600 +++ b/mm7_6.cpp Wed Oct 02 18:27:48 2013 +0600 @@ -45,12 +45,12 @@ //----- (00424EE0) -------------------------------------------------------- int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) { - unsigned int v1; // edx@1 + //unsigned int v1; // edx@1 double v2; // st7@1 signed int v3; // edi@1 char *v4; // esi@4 char *v5; // ecx@4 - unsigned int v6; // eax@4 + //unsigned int v6; // eax@4 char *v7; // edx@4 double v8; // st6@10 double v9; // st5@10 @@ -74,18 +74,16 @@ char *v27; // [sp+2Ch] [bp-8h]@4 char *v28; // [sp+30h] [bp-4h]@4 - v1 = uVertexID; v2 = (double)pODMRenderParams->shading_dist_mist; memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); v3 = 0; v22 = 0; - if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) + if ( array_50AC10[0].vWorldViewPosition.x <= (double)pODMRenderParams->shading_dist_mist ) v3 = 1; if ( (signed int)(uVertexID + 1) <= 1 ) return 0; v4 = (char *)&array_507D30[0].vWorldViewPosition.z; v5 = (char *)&array_507D30[0].vWorldViewPosition.y; - v6 = v1; v23 = (char *)&array_507D30[0].flt_2C; v26 = (char *)&array_507D30[0]._rhw; v24 = array_507D30; @@ -95,27 +93,26 @@ v27 = (char *)&array_507D30[0].v; v28 = (char *)&array_507D30[0].u; v7 = (char *)&array_50AC10[0].v; - v18 = v6; - do + for ( v18 = 1; v18 <= uVertexID; ++v18 ) { - v19 = v2 >= *((float *)v7 + 5); + v19 = v2 >= array_50AC10[v18].vWorldViewPosition.x; if ( v3 != v19 ) { if ( v19 ) { - v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); - *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); - *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); - *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); - v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; + v8 = (v2 - array_50AC10[v18 - 1].vWorldViewPosition.x) / (array_50AC10[v18].vWorldViewPosition.x - array_50AC10[v18 - 1].vWorldViewPosition.x); + *(float *)v5 = (array_50AC10[v18].vWorldViewPosition.y - array_50AC10[v18 - 1].vWorldViewPosition.y) * v8 + array_50AC10[v18 - 1].vWorldViewPosition.y; + *(float *)v4 = (array_50AC10[v18].vWorldViewPosition.z - array_50AC10[v18 - 1].vWorldViewPosition.z) * v8 + array_50AC10[v18 - 1].vWorldViewPosition.z; + *(float *)v28 = (array_50AC10[v18].u - array_50AC10[v18 - 1].u) * v8 + array_50AC10[v18 - 1].u; + v9 = (array_50AC10[v18].v - array_50AC10[v18 - 1].v) * v8 + array_50AC10[v18 - 1].v; } else { - v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); - *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); - *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); - *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); - v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); + v10 = (v2 - array_50AC10[v18].vWorldViewPosition.x) / (array_50AC10[v18 - 1].vWorldViewPosition.x - array_50AC10[v18].vWorldViewPosition.x); + *(float *)v5 = (array_50AC10[v18 - 1].vWorldViewPosition.y - array_50AC10[v18].vWorldViewPosition.y) * v10 + array_50AC10[v18].vWorldViewPosition.y; + *(float *)v4 = (array_50AC10[v18 - 1].vWorldViewPosition.z - array_50AC10[v18].vWorldViewPosition.z) * v10 + array_50AC10[v18].vWorldViewPosition.z; + *(float *)v28 = (array_50AC10[v18 - 1].u - array_50AC10[v18].u) * v10 + array_50AC10[v18].u; + v9 = (array_50AC10[v18 - 1].v - array_50AC10[v18].v) * v10 + array_50AC10[v18].v; } *(float *)v27 = v9; *(float *)v25 = v2; @@ -199,9 +196,9 @@ } v3 = v19; v7 += 48; - --v18; + //--v18; } - while ( v18 ); + //while ( v18 ); result = v22; if ( v22 < 3 ) return 0; @@ -251,7 +248,7 @@ } else { - if ( pActor->array_000234[3].GetItemEquipType() == 18 ) + if ( pActor->array_000234[3].uItemID != 0 && pActor->array_000234[3].GetItemEquipType() == 18 ) { v14 = pActor->array_000234[3].uSpecEnchantmentType; pActor->array_000234[3].Reset(); @@ -262,7 +259,6 @@ } } } - pActor->uCarriedItemID = 1; if ( pActor->uCarriedItemID ) { Dst.Reset(); @@ -326,21 +322,21 @@ pParty->SetHoldingItem(&Dst); v13 = 1; } - goto LABEL_44; + v8 = pParty; + goto LABEL_45; } if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) { -LABEL_44: v8 = pParty; goto LABEL_45; } pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; if ( v14 ) - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10); + sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);//Вы нашли ^I[%d] золот^L[ой;ых;ых] и предмет (%s)! else - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10); - ShowStatusBarString(pTmpBuf2.data(), 2u); + sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);//Вы нашли ^Pv[%s]! + ShowStatusBarString(pTmpBuf2.data(), 2); v8 = pParty; if ( !pParty->AddItemToParty(&Dst) ) pParty->SetHoldingItem(&Dst); @@ -892,9 +888,6 @@ v5 = pActor->pActorBuffs[14].uPower; switch ( a2 ) { - case 4: - v6 = pActor->pMonsterInfo.uResPhysical; - break; case 0: v6 = pActor->pMonsterInfo.uResFire; v4 = v5; @@ -911,6 +904,9 @@ v6 = pActor->pMonsterInfo.uResEarth; v4 = v5; break; + case 4: + v6 = pActor->pMonsterInfo.uResPhysical; + break; case 6: v6 = pActor->pMonsterInfo.uResSpirit; break; @@ -961,50 +957,47 @@ //----- (00427662) -------------------------------------------------------- bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) { - Actor *v3; // edi@2 - signed int v4; // esi@2 + signed int resist; // esi@2 bool result; // eax@13 switch ( uType ) { - case 0u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResFire; - case 1u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResAir; - case 2u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResWater; - case 3u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResEarth; - case 7u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResMind; - case 6u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResSpirit; - case 8u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResBody; - case 9u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResLight; - case 0xAu: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResDark; - case 4u: - v3 = pActor; - v4 = pActor->pMonsterInfo.uResPhysical; + case 0: + resist = pActor->pMonsterInfo.uResFire; + break; + case 1: + resist = pActor->pMonsterInfo.uResAir; + break; + case 2: + resist = pActor->pMonsterInfo.uResWater; + break; + case 3: + resist = pActor->pMonsterInfo.uResEarth; + break; + case 4: + resist = pActor->pMonsterInfo.uResPhysical; + break; + case 6: + resist = pActor->pMonsterInfo.uResSpirit; + break; + case 7: + resist = pActor->pMonsterInfo.uResMind; + case 8: + resist = pActor->pMonsterInfo.uResBody; + break; + case 9: + resist = pActor->pMonsterInfo.uResLight; + break; + case 10: + resist = pActor->pMonsterInfo.uResDark; break; default: return 1; } - if ( v4 < 200 ) - result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; + if ( resist < 200 ) + result = rand() % (signed int)(((unsigned int)pActor->pMonsterInfo.uLevel >> 2) + resist + 30) < 30; else - result = 0; + result = 0; return result; }