Mercurial > might-and-magic-trilogy
diff Player.cpp @ 85:1265125099c7
22.10.12
author | Ritor1 |
---|---|
date | Mon, 22 Oct 2012 09:18:21 +0600 |
parents | 93bf1d5f6a6d |
children | 7071e4688db6 |
line wrap: on
line diff
--- a/Player.cpp Thu Oct 18 09:12:15 2012 +0600 +++ b/Player.cpp Mon Oct 22 09:18:21 2012 +0600 @@ -6879,33 +6879,44 @@ __int16 Player::GetStatColor(unsigned int uStat) { Player *v2; // edi@1 - __int16 v3; // si@1 - int v4; // eax@1 + __int16 uWhite; // si@1 +// int uStartingHP; // eax@1 int v5; // edx@1 - unsigned __int8 v6; // zf@1 - char v7; // sf@1 + // unsigned __int8 v6; // zf@1 + // char v7; // sf@1 unsigned __int8 v8; // of@1 __int16 result; // ax@2 - __int16 v10; // [sp+8h] [bp-8h]@1 - __int16 v11; // [sp+Ch] [bp-4h]@1 + __int16 uGreen; // [sp+8h] [bp-8h]@1 + __int16 uRed; // [sp+Ch] [bp-4h]@1 v2 = this; - v11 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0); - v10 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); - v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - v4 = stru_4ED7B0.race[0].attr[uStat + 7 * GetRace()].uBaseValue; - v8 = __OFSUB__(v5, v4); - v6 = v5 == v4; - v7 = v5 - v4 < 0; - if ( v5 >= v4 ) - { - result = v10; - if ( (unsigned __int8)(v7 ^ v8) | v6 ) - result = v3; + uRed = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0); + uGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); + uWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + v8 = stru_4ED7B0.race[GetRace()].attr[uStat].uBaseValue; + + int attribute_value = 0; + switch (uStat) + { + case 0: attribute_value = uMight; break; + 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 6: attribute_value = uLuck; break; + }; + + v5 = attribute_value; + if ( v5 >= v8 ) + { + result = uGreen; + if ( v5 == v8 ) + result = uWhite; } else { - result = v11; + result = uRed; } return result; }