Mercurial > mm7
diff Player.cpp @ 298:055cea8660e5
Слияние
author | Ritor1 |
---|---|
date | Tue, 19 Feb 2013 09:14:16 +0600 |
parents | ada52edca264 4776715a964b |
children | b0db84628733 |
line wrap: on
line diff
--- a/Player.cpp Tue Feb 19 09:13:51 2013 +0600 +++ b/Player.cpp Tue Feb 19 09:14:16 2013 +0600 @@ -31,7 +31,7 @@ /* 381 */ #pragma pack(push, 1) -struct PlayerCreation_AttributeProp +struct PlayerCreation_AttributeProps { unsigned __int8 uBaseValue; char uMaxValue; @@ -42,26 +42,16 @@ #pragma pack(push, 1) -struct PlayerCreation_AttributePropsByRace -{ - PlayerCreation_AttributeProp attr[7]; -}; - -struct PlayerCreation_AttributeProps -{ - union - { - unsigned __int8 _[4][7][4]; - PlayerCreation_AttributePropsByRace race[4]; - }; -}; + + + #pragma pack(pop) -PlayerCreation_AttributeProps stru_4ED7B0 = -{ - 11, 25, 1, 1, 11, 25, 1, 1, 11, 25, 1, 1, 9, 25, 1, 1, 11, 25, 1, 1, 11, 25, 1, 1, 9, 25, 1, 1, - 7, 15, 2, 1, 14, 30, 1, 2, 11, 25, 1, 1, 7, 15, 2, 1, 14, 30, 1, 2, 11, 25, 1, 1, 9, 20, 1, 1, - 14, 30, 1, 2, 7, 15, 2, 1, 7, 15, 2, 1, 11, 25, 1, 1, 11, 25, 1, 1, 14, 30, 1, 2, 9, 20, 1, 1, - 14, 30, 1, 2, 11, 25, 1, 1, 11, 25, 1, 1, 14, 30, 1, 2, 7, 15, 2, 1, 7, 15, 2, 1, 9, 20, 1, 1 +PlayerCreation_AttributeProps StatTable[4][7] = //0x4ED7B0 +{ + {{11, 25, 1, 1}, {11, 25, 1, 1}, {11, 25, 1, 1}, { 9, 25, 1, 1}, {11, 25, 1, 1}, {11, 25, 1, 1}, {9, 25, 1, 1},}, + {{ 7, 15, 2, 1}, {14, 30, 1, 2}, {11, 25, 1, 1}, { 7, 15, 2, 1}, {14, 30, 1, 2}, {11, 25, 1, 1}, {9, 20, 1, 1},}, + {{14, 30, 1, 2}, { 7, 15, 2, 1}, { 7, 15, 2, 1}, {11, 25, 1, 1}, {11, 25, 1, 1}, {14, 30, 1, 2}, {9, 20, 1, 1},}, + {{14, 30, 1, 2}, {11, 25, 1, 1}, {11, 25, 1, 1}, {14, 30, 1, 2}, { 7, 15, 2, 1}, { 7, 15, 2, 1}, {9, 20, 1, 1}} }; @@ -173,16 +163,16 @@ v0 = pParty->pPlayers[v1].uMight; } v3 = v2 + v9; - v4 = stru_4ED7B0.race[0].attr[v3].uBaseValue; + v4 = StatTable[0][v3].uBaseValue; if ( v0 >= v4 ) { - v5 = stru_4ED7B0.race[0].attr[v3].uDroppedStep; - v6 = stru_4ED7B0.race[0].attr[v3].uBaseStep; + v5 = StatTable[0][v3].uDroppedStep; + v6 = StatTable[0][v3].uBaseStep; } else { - v5 = stru_4ED7B0.race[0].attr[v3].uBaseStep; - v6 = stru_4ED7B0.race[0].attr[v3].uDroppedStep; + v5 = StatTable[0][v3].uBaseStep; + v6 = StatTable[0][v3].uDroppedStep; } v8 += v5 * (v4 - v0) / v6; ++v9; @@ -1744,6 +1734,7 @@ v4->pInventoryIndices[a4] = a3 + 1; return 1; } + // 506128: using guessed type int areWeLoadingTexture; //----- (00492A36) -------------------------------------------------------- @@ -3349,19 +3340,13 @@ //----- (0048D62C) -------------------------------------------------------- int Player::GetEquippedItemEquipType(unsigned int uEquipSlot) { - return pItemsTable->pItems[*(int *)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 - * *(&this->pEquipment.uOffHand - + uEquipSlot) - + 5]].uEquipType; + return pItemsTable->pItems[pInventoryItems[pEquipment.pIndices[uEquipSlot]-1].uItemID].uEquipType; } //----- (0048D651) -------------------------------------------------------- int Player::GetEquippedItemSkillType(enum ITEM_EQUIP_TYPE uEquipSlot) { - return pItemsTable->pItems[*(int *)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 - * *(&this->pEquipment.uOffHand - + uEquipSlot) - + 5]].uSkillType; + return pItemsTable->pItems[pInventoryItems[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uSkillType; } //----- (0048D676) -------------------------------------------------------- @@ -6454,13 +6439,13 @@ void Player::SetInitialStats() { auto v1 = GetRace(); - uMight = stru_4ED7B0.race[v1].attr[0].uBaseValue; - uIntelligence = stru_4ED7B0.race[v1].attr[1].uBaseValue; - uWillpower = stru_4ED7B0.race[v1].attr[2].uBaseValue; - uEndurance = stru_4ED7B0.race[v1].attr[3].uBaseValue; - uAccuracy = stru_4ED7B0.race[v1].attr[4].uBaseValue; - uSpeed = stru_4ED7B0.race[v1].attr[5].uBaseValue; - uLuck = stru_4ED7B0.race[v1].attr[6].uBaseValue; + uMight = StatTable[v1][0].uBaseValue; + uIntelligence = StatTable[v1][1].uBaseValue; + uWillpower = StatTable[v1][2].uBaseValue; + uEndurance = StatTable[v1][3].uBaseValue; + uAccuracy = StatTable[v1][4].uBaseValue; + uSpeed = StatTable[v1][5].uBaseValue; + uLuck = StatTable[v1][6].uBaseValue; } //----- (004901FC) -------------------------------------------------------- @@ -6643,10 +6628,10 @@ int uMinValue; // [sp+Ch] [bp-4h]@1 v2 = eAttribute + 7 * GetRace(); - pBaseValue = stru_4ED7B0.race[0].attr[v2].uBaseValue; - pDroppedStep = stru_4ED7B0.race[0].attr[v2].uDroppedStep; + pBaseValue = StatTable[0][v2].uBaseValue; + pDroppedStep = StatTable[0][v2].uDroppedStep; uMinValue = pBaseValue - 2; - pStep = stru_4ED7B0.race[0].attr[v2].uBaseStep; + pStep = StatTable[0][v2].uBaseStep; switch ( eAttribute ) { case CHARACTER_MIGHT: @@ -6710,10 +6695,10 @@ v2 = this; v3 = eAttribute + 7 * GetRace(); - v4 = stru_4ED7B0.race[0].attr[v3].uMaxValue; - v5 = stru_4ED7B0.race[0].attr[v3].uBaseStep; - v9 = stru_4ED7B0.race[0].attr[v3].uBaseValue; - v10 = stru_4ED7B0.race[0].attr[v3].uDroppedStep; + v4 = StatTable[0][v3].uMaxValue; + v5 = StatTable[0][v3].uBaseStep; + v9 = StatTable[0][v3].uBaseValue; + v10 = StatTable[0][v3].uDroppedStep; PlayerCreation_ComputeAttributeBonus(); if ( eAttribute ) { @@ -6833,25 +6818,18 @@ } //----- (004907E7) -------------------------------------------------------- -unsigned int Player::GetStatColor(int uStat) -{ - //Player *v2; // edi@1 - unsigned int uWhite; // si@1 -// int uStartingHP; // eax@1 - //int v5; // edx@1 - // unsigned __int8 v6; // zf@1 - // char v7; // sf@1 - int v8; // of@1 - //__int16 result; // ax@2 - unsigned int uGreen; // [sp+8h] [bp-8h]@1 - unsigned int uRed; // [sp+Ch] [bp-4h]@1 - int attribute_value; - - //v2 = this; +__int16 Player::GetStatColor(unsigned int uStat) +{ + __int16 uWhite; // si@1 + int attribute_value; // edx@1 + unsigned __int8 v8; // of@1 + __int16 uGreen; // [sp+8h] [bp-8h]@1 + __int16 uRed; // [sp+Ch] [bp-4h]@1 + uRed = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0); uGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); uWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - v8 = stru_4ED7B0.race[GetRace()].attr[uStat].uBaseValue; + v8 = StatTable[GetRace()][uStat].uBaseValue; switch (uStat) { @@ -6859,8 +6837,8 @@ case 1: attribute_value = uIntelligence; break; case 2: attribute_value = uWillpower; break; case 3: attribute_value = uEndurance; break; - case 4: attribute_value = uSpeed; break; - case 5: attribute_value = uAccuracy; break; + case 4: attribute_value = uAccuracy; break; + case 5: attribute_value = uSpeed; break; case 6: attribute_value = uLuck; break; };