changeset 1789:4d70df78baca

Player::AddVariable majority of labels
author Grumpy7
date Thu, 03 Oct 2013 08:06:29 +0200
parents ebde8e43839c
children 5ace90f129d3
files Player.cpp
diffstat 1 files changed, 217 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Thu Oct 03 07:35:20 2013 +0200
+++ b/Player.cpp	Thu Oct 03 08:06:29 2013 +0200
@@ -6224,25 +6224,67 @@
               return;
             case VAR_BaseMight:
               v18 = (__int16 *)&this->uMight;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BaseIntellect:
               v18 = (__int16 *)&this->uIntelligence;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BasePersonality:
               v18 = (__int16 *)&this->uWillpower;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BaseEndurance:
               v18 = (__int16 *)&this->uEndurance;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BaseSpeed:
               v18 = (__int16 *)&this->uSpeed;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BaseAccuracy:
               v18 = (__int16 *)&this->uAccuracy;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BaseLuck:
               v18 = (__int16 *)&this->uLuck;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_FixedFood:
               Party::GiveFood(val);
               sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val);
@@ -6272,7 +6314,14 @@
         }
 LABEL_62:
         v19 = (__int16 *)&this->uMightBonus;
-        goto LABEL_113;
+        *v19 += val;
+        if ( *v19 > 255 )
+          *v19 = 255;
+        v31 = 0;
+        this->PlaySound(SPEECH_91, v31);
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+        PlayAwardSound(uPlayerIdx);
+        return;
       }
       if ( var_type <= VAR_FireResistanceBonus )
       {
@@ -6283,57 +6332,152 @@
             case VAR_ActualIntellect:
 LABEL_66:
               v19 = (__int16 *)&this->uIntelligenceBonus;
-              goto LABEL_113;
+              *v19 += val;
+              if ( *v19 > 255 )
+                *v19 = 255;
+              v31 = 0;
+              this->PlaySound(SPEECH_91, v31);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_ActualPersonality:
 LABEL_67:
               v19 = (__int16 *)&this->uWillpowerBonus;
-              goto LABEL_113;
+              *v19 += val;
+              if ( *v19 > 255 )
+                *v19 = 255;
+              v31 = 0;
+              this->PlaySound(SPEECH_91, v31);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_ActualEndurance:
 LABEL_68:
               v19 = (__int16 *)&this->uEnduranceBonus;
-              goto LABEL_113;
+              *v19 += val;
+              if ( *v19 > 255 )
+                *v19 = 255;
+              v31 = 0;
+              this->PlaySound(SPEECH_91, v31);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_ActualSpeed:
 LABEL_69:
               v19 = (__int16 *)&this->uSpeedBonus;
-              goto LABEL_113;
+              *v19 += val;
+              if ( *v19 > 255 )
+                *v19 = 255;
+              v31 = 0;
+              this->PlaySound(SPEECH_91, v31);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_ActualAccuracy:
 LABEL_70:
               v19 = (__int16 *)&this->uAccuracyBonus;
-              goto LABEL_113;
+              *v19 += val;
+              if ( *v19 > 255 )
+                *v19 = 255;
+              v31 = 0;
+              this->PlaySound(SPEECH_91, v31);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_ActualLuck:
 LABEL_71:
               v19 = (__int16 *)&this->uLuckBonus;
-              goto LABEL_113;
+              *v19 += val;
+              if ( *v19 > 255 )
+                *v19 = 255;
+              v31 = 0;
+              this->PlaySound(SPEECH_91, v31);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_FireResistance:
               v18 = &this->sResFireBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_AirResistance:
               v18 = &this->sResAirBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_WaterResistance:
               v18 = &this->sResWaterBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_EarthResistance:
               v18 = &this->sResEarthBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_SpiritResistance:
               v18 = &this->sResSpiritBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_MindResistance:
               v18 = &this->sResMindBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_BodyResistance:
               v18 = &this->sResBodyBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_LightResistance:
               v18 = &this->sResLightBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_DarkResistance:
               v18 = &this->sResDarkBase;
-              goto LABEL_82;
+              *v18 += val;
+              if ( *v18 > 255 )
+                *v18 = 255;
+              this->PlaySound(SPEECH_92, 0);
+              pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+              PlayAwardSound(uPlayerIdx);
+              return;
             case VAR_MagicResistance:
               v18 = &this->sResMagicBase;
-LABEL_82:
               *v18 += val;
               if ( *v18 > 255 )
                 *v18 = 255;
@@ -6347,7 +6491,6 @@
           return;
         }
         v19 = &this->sResFireBonus;
-LABEL_113:
         *v19 += val;
         if ( *v19 > 255 )
           *v19 = 255;
@@ -6386,31 +6529,74 @@
                 v19 = &this->sResMindBonus;
                 break;
             }
-            goto LABEL_113;
+            *v19 += val;
+            if ( *v19 > 255 )
+              *v19 = 255;
+            v31 = 0;
+            this->PlaySound(SPEECH_91, v31);
+            pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+            PlayAwardSound(uPlayerIdx);
+            return;
           }
           if ( var_type == VAR_LightResistanceBonus )
           {
             v19 = &this->sResLightBonus;
-            goto LABEL_113;
+            *v19 += val;
+            if ( *v19 > 255 )
+              *v19 = 255;
+            v31 = 0;
+            this->PlaySound(SPEECH_91, v31);
+            pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+            PlayAwardSound(uPlayerIdx);
+            return;
           }
           if ( var_type == VAR_DarkResistanceBonus )
           {
             v19 = &this->sResDarkBonus;
-            goto LABEL_113;
+            *v19 += val;
+            if ( *v19 > 255 )
+              *v19 = 255;
+            v31 = 0;
+            this->PlaySound(SPEECH_91, v31);
+            pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+            PlayAwardSound(uPlayerIdx);
+            return;
           }
           if ( var_type == VAR_MagicResistanceBonus )
           {
             v19 = &this->sResMagicBonus;
-            goto LABEL_113;
+            *v19 += val;
+            if ( *v19 > 255 )
+              *v19 = 255;
+            v31 = 0;
+            this->PlaySound(SPEECH_91, v31);
+            pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+            PlayAwardSound(uPlayerIdx);
+            return;
           }
           if ( var_type <= VAR_MagicResistanceBonus || var_type > VAR_DiplomacySkill )
             return;
         }
-        goto LABEL_106;
+        if ( val <= 63 )
+        {
+          *((short *)&this->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&this->pConditions[16] + 2 * var_type) & 63;
+        }
+        else
+        {
+          v20 = (char *)&this->pConditions[16] + 2 * var_type;
+          v21 = *(short *)v20;
+          v22 = (unsigned __int8)val + (v21 & 63);
+          if ( v22 > 60 )
+            LOWORD(v22) = 60;
+          LOBYTE(v21) = v21 & 0xC0;
+          *(short *)v20 = v22 | v21;
+        }
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+        PlayAwardSound(uPlayerIdx);
+        return;
       }
       if ( var_type == VAR_LearningSkill )
       {
-LABEL_106:
         if ( val <= 63 )
         {
           *((short *)&this->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&this->pConditions[16] + 2 * var_type) & 63;