diff Player.cpp @ 1167:15ad868d972f

pPartyBuffs - change plain numbers to enums
author Grumpy7
date Tue, 04 Jun 2013 18:29:35 +0200
parents 29a8defbad9e
children 8c02e6f74b29
line wrap: on
line diff
--- a/Player.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/Player.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -1079,10 +1079,10 @@
         PlaySound((PlayerSpeech)30, 0);
         break;
     case Condition_Weak:
-        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 )
-            {--pParty->pPartyBuffs[13].uPower;
-        if ( pParty->pPartyBuffs[13].uPower < 1u )
-            pParty->pPartyBuffs[13].Reset();
+        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0 )
+            {--pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+        if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+            pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
         return 0;
             }
 
@@ -1115,11 +1115,11 @@
     case Condition_Poison3:
         if ( a3 == 1 )
             {
-            if ( (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 )
+            if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 )
                 {
-                --pParty->pPartyBuffs[13].uPower;
-                if ( pParty->pPartyBuffs[13].uPower < 1u )
-                    pParty->pPartyBuffs[13].Reset();
+                --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+                if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                    pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
                 }
             if ( HasEnchantedItemEquipped(21)
                 || WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR)
@@ -1137,11 +1137,11 @@
     case Condition_Disease3:
         if ( a3 == 1 )
             {            
-            if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 )
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 )
                 {
-                --pParty->pPartyBuffs[13].uPower;
-                if ( pParty->pPartyBuffs[13].uPower < 1u )
-                    pParty->pPartyBuffs[13].Reset();
+                --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+                if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                    pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
                 return 0;
                 }
 
@@ -1155,11 +1155,11 @@
     case Condition_Paralyzed:
         if ( a3 == 1 )
             {
-            if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 )
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 )
                 {
-                --pParty->pPartyBuffs[13].uPower;
-                if ( pParty->pPartyBuffs[13].uPower < 1u )
-                    pParty->pPartyBuffs[13].Reset();
+                --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+                if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                    pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
                 return 0;
                 }
 
@@ -1176,11 +1176,11 @@
             sHealth = 0;
         break;
     case Condition_Dead:
-        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 && pParty->pPartyBuffs[13].uSkill >= 4u )
+        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 && pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uSkill >= 4u )
             {
-            --pParty->pPartyBuffs[13].uPower;
-            if ( pParty->pPartyBuffs[13].uPower < 1u )
-                pParty->pPartyBuffs[13].Reset();
+            --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
             }
 
         PlaySound((PlayerSpeech)33, 0);
@@ -1191,7 +1191,7 @@
         break;
     case Condition_Pertified:
         if ( a3 == 1
-            &&((pParty->pPartyBuffs[13].uExpireTime > 0i64)
+            &&((pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64)
             || HasEnchantedItemEquipped(23)|| 
             WearsItem(ITEM_RELIC_KELEBRIM, EQIUP_ANY) || 
             WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) || 
@@ -1201,11 +1201,11 @@
         PlaySound((PlayerSpeech)34, 0);
         break;
     case Condition_Eradicated:
-        if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 )&&( pParty->pPartyBuffs[13].uSkill >= 4u ))
+        if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0 )&&( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uSkill >= 4u ))
             {
-            --pParty->pPartyBuffs[13].uPower;
-            if ( pParty->pPartyBuffs[13].uPower < 1u )
-                pParty->pPartyBuffs[13].Reset();
+            --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
             return 0;
             }
         PlaySound(SPEECH_35, 0);
@@ -5337,25 +5337,25 @@
       {
         case CHARACTER_ATTRIBUTE_RESIST_BODY:
           v3 = this->pPlayerBuffs[2].uPower;
-          v4 = pParty->pPartyBuffs[1].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower;
           break;
         case CHARACTER_ATTRIBUTE_RESIST_AIR:
           v3 = this->pPlayerBuffs[0].uPower;
-          v4 = pParty->pPartyBuffs[0].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower;
           break;
         case CHARACTER_ATTRIBUTE_RESIST_WATER:
           v3 = this->pPlayerBuffs[22].uPower;
-          v4 = pParty->pPartyBuffs[17].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower;
           break;
         case CHARACTER_ATTRIBUTE_RESIST_EARTH:
           v3 = this->pPlayerBuffs[3].uPower;
-          v4 = pParty->pPartyBuffs[4].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower;
           break;
         default:
           if ( a2 != 14 )
             return result;
           v3 = this->pPlayerBuffs[9].uPower;
-          v4 = pParty->pPartyBuffs[12].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower;
           break;
       }
       return v4 + v3;
@@ -5365,7 +5365,7 @@
       if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS )
       {
         v3 = this->pPlayerBuffs[8].uPower;
-        v4 = pParty->pPartyBuffs[9].uPower;
+        v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower;
         return v4 + v3;
       }
       if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK )
@@ -5376,7 +5376,7 @@
   if ( a2 == 10 )
   {
     v3 = this->pPlayerBuffs[5].uPower;
-    v4 = pParty->pPartyBuffs[6].uPower;
+    v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower;
     return v4 + v3;
   }
   switch ( a2 )
@@ -5402,11 +5402,11 @@
     case CHARACTER_ATTRIBUTE_LUCK:
       v3 = pPlayerBuffs[18].uPower;
 LABEL_5:
-      v4 = pParty->pPartyBuffs[2].uPower;
+      v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
       return v4 + v3;
     case CHARACTER_ATTRIBUTE_AC_BONUS:
       v3 = this->pPlayerBuffs[14].uPower;
-      v4 = pParty->pPartyBuffs[15].uPower;
+      v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower;
       return v4 + v3;
     default:
       return result;
@@ -7406,7 +7406,7 @@
     switch ( VarNum )
     {
       case VAR_Invisible:
-        if ( pParty->pPartyBuffs[11].uExpireTime >0 )
+        if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime >0 )
           return true;
         return false;
       case VAR_NumDeaths:
@@ -7495,7 +7495,7 @@
         return v6;
       case VAR_IsFlying:
         if ( pParty->bFlying
-          && (pParty->pPartyBuffs[7].uExpireTime> 0) )
+          && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) )
           return true;
         return false;
       case VAR_HiredNPCHasSpeciality: