diff Player.cpp @ 143:163719cd2aca

DecreaseAttribute
author Ritor1
date Sat, 24 Nov 2012 18:25:13 +0600
parents 3b5267621a5b
children 38a1c8ef6874
line wrap: on
line diff
--- a/Player.cpp	Sat Nov 24 17:22:46 2012 +0600
+++ b/Player.cpp	Sat Nov 24 18:25:13 2012 +0600
@@ -6627,96 +6627,96 @@
 unsigned __int16 Player::DecreaseAttribute(int eAttribute)
 {
   int v2; // eax@1
-  Player *v3; // edx@1
-  int v4; // ecx@1
-  int v5; // ebx@1
-  int v6; // esi@1
+  //Player *pPlayer; // edx@1
+  int pBaseValue; // ecx@1
+  int pDroppedStep; // ebx@1
+  int pStep; // esi@1
   unsigned __int16 result; // ax@7
-  int v8; // edi@8
-  int v9; // edi@12
-  int v10; // edi@16
-  int v11; // edi@20
-  int v12; // edi@24
-  int v13; // edi@28
-  int v14; // edi@32
+  //int v8; // edi@8
+  //int v9; // edi@12
+  //int v10; // edi@16
+  //int v11; // edi@20
+  //int v12; // edi@24
+  //int v13; // edi@28
+  //int v14; // edi@32
   int uMinValue; // [sp+Ch] [bp-4h]@1
 
   v2 = eAttribute + 7 * GetRace();
-  v4 = stru_4ED7B0.race[0].attr[v2].uBaseValue;
-  v5 = stru_4ED7B0.race[0].attr[v2].uDroppedStep;
-  uMinValue = v4 - 2;
-  v6 = stru_4ED7B0.race[0].attr[v2].uBaseStep;
+  pBaseValue = stru_4ED7B0.race[0].attr[v2].uBaseValue;
+  pDroppedStep = stru_4ED7B0.race[0].attr[v2].uDroppedStep;
+  uMinValue = pBaseValue - 2;
+  pStep = stru_4ED7B0.race[0].attr[v2].uBaseStep;
   if ( eAttribute )
   {
     switch ( eAttribute )
     {
-      case 1:
-        result = v3->uIntelligence;
-        v13 = v3->uIntelligence;
-        if ( v13 <= v4 )
-          v6 = v5;
-        if ( v13 - v6 >= uMinValue )
-        {
-          result -= v6;
-          v3->uIntelligence = result;
+      case 1: //Intelligence
+        result = this->uIntelligence;
+        //v13 = this->uIntelligence;
+        if ( result <= pBaseValue )
+          pStep = pDroppedStep;
+        if ( this->uIntelligence - pStep >= uMinValue )
+        {
+          result -= pStep;
+          this->uIntelligence = result;
         }
         break;
-      case 2:
-        result = v3->uWillpower;
-        v12 = v3->uWillpower;
-        if ( v12 <= v4 )
-          v6 = v5;
-        if ( v12 - v6 >= uMinValue )
-        {
-          result -= v6;
-          v3->uWillpower = result;
+      case 2://Willpower
+        result = this->uWillpower;
+        //v12 = this->uWillpower;
+        if ( result <= pBaseValue )
+          pStep = pDroppedStep;
+        if ( result - pStep >= uMinValue )
+        {
+          result -= pStep;
+          this->uWillpower = result;
         }
         break;
-      case 3:
-        result = v3->uEndurance;
-        v11 = v3->uEndurance;
-        if ( v11 <= v4 )
-          v6 = v5;
-        if ( v11 - v6 >= uMinValue )
-        {
-          result -= v6;
-          v3->uEndurance = result;
+      case 3://Endurance
+        result = this->uEndurance;
+        //v11 = this->uEndurance;
+        if ( result <= pBaseValue )
+          pStep = pDroppedStep;
+        if ( result - pStep >= uMinValue )
+        {
+          result -= pStep;
+          this->uEndurance = result;
         }
         break;
-      case 4:
-        result = v3->uAccuracy;
-        v10 = v3->uAccuracy;
-        if ( v10 <= v4 )
-          v6 = v5;
-        if ( v10 - v6 >= uMinValue )
-        {
-          result -= v6;
-          v3->uAccuracy = result;
+      case 4://Accuracy
+        result = this->uAccuracy;
+        //v10 = this->uAccuracy;
+        if ( result <= pBaseValue )
+          pStep = pDroppedStep;
+        if ( result - pStep >= uMinValue )
+        {
+          result -= pStep;
+          this->uAccuracy = result;
         }
         break;
-      case 5:
-        result = v3->uSpeed;
-        v9 = v3->uSpeed;
-        if ( v9 <= v4 )
-          v6 = v5;
-        if ( v9 - v6 >= uMinValue )
-        {
-          result -= v6;
-          v3->uSpeed = result;
+      case 5://Speed
+        result = this->uSpeed;
+        //v9 = this->uSpeed;
+        if ( result <= pBaseValue )
+          pStep = pDroppedStep;
+        if ( result - pStep >= uMinValue )
+        {
+          result -= pStep;
+          this->uSpeed = result;
         }
         break;
       default:
         result = eAttribute - 6;
-        if ( eAttribute == 6 )
-        {
-          result = v3->uLuck;
-          v8 = v3->uLuck;
-          if ( v8 <= v4 )
-            v6 = v5;
-          if ( v8 - v6 >= uMinValue )
+        if ( eAttribute == 6 )//Luck
+        {
+          result = this->uLuck;
+          //v8 = this->uLuck;
+          if ( result <= pBaseValue )
+            pStep = pDroppedStep;
+          if ( result - pStep >= uMinValue )
           {
-            result -= v6;
-            v3->uLuck = result;
+            result -= pStep;
+            this->uLuck = result;
           }
         }
         break;
@@ -6724,14 +6724,14 @@
   }
   else
   {
-    result = v3->uMight;
-    v14 = v3->uMight;
-    if ( v14 <= v4 )
-      v6 = v5;
-    if ( v14 - v6 >= uMinValue )
-    {
-      result -= v6;
-      v3->uMight = result;
+    result = this->uMight;
+    //v14 = this->uMight;
+    if ( result <= pBaseValue )
+      pStep = pDroppedStep;
+    if ( result - pStep >= uMinValue )
+    {
+      result -= pStep;
+      this->uMight = result;
     }
   }
   return result;