changeset 1352:88f80476c99c

Player::PlayEmotion simplified main condition, renamed a few expression enum vals
author Grumpy7
date Sat, 13 Jul 2013 11:56:57 +0200
parents f1209ed77782
children 8f69f77a0067
files Player.cpp Player.h
diffstat 2 files changed, 25 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Sat Jul 13 04:16:30 2013 +0200
+++ b/Player.cpp	Sat Jul 13 11:56:57 2013 +0200
@@ -587,9 +587,8 @@
       if ( pSoundList->pSounds[v17].pSoundData[0] )
         expressionDuration = (sLastTrackLengthMS << 7) / 1000;
     }
-    /*LOWORD(v14) = */PlayEmotion(expression, expressionDuration);
-  }
-  //return v14;
+    PlayEmotion(expression, expressionDuration);
+  }
 }
 // 4948B1: using guessed type int var_1C[5];
 
@@ -604,30 +603,25 @@
 
   //LOWORD(v3) = this->expression;
   //v4 = expr;
-  if (expression != CHARACTER_EXPRESSION_SLEEP &&
-      expression != CHARACTER_EXPRESSION_PERTIFIED || new_expression != CHARACTER_EXPRESSION_58)
-  {
-    int v3 = (unsigned)expression;
-    if ( (signed int)(unsigned __int16)v3 >= 2 )
-    {
-      if ( v3 <= 7 )
-        goto LABEL_12;
-      if ( v3 > 8 )
-      {
-        if ( v3 > 11 )
-        {
-          if ( v3 == CHARACTER_EXPRESSION_PERTIFIED ||( v3 > 97 && v3 <= 99) )
-            return;
-          goto LABEL_15;
-        }
-LABEL_12:
-        if (new_expression != CHARACTER_EXPRESSION_34 && new_expression != CHARACTER_EXPRESSION_35 && new_expression != CHARACTER_EXPRESSION_36)
-          return;
-        goto LABEL_15;
-      }
-    }
-  }
-LABEL_15:
+  unsigned int v3 = expression;
+  if (expression == CHARACTER_EXPRESSION_DEAD || expression == CHARACTER_EXPRESSION_ERADICATED)
+  {
+    return;
+  }
+  else if (expression == CHARACTER_EXPRESSION_PERTIFIED && new_expression != CHARACTER_EXPRESSION_FALLING)
+  {
+    return;
+  }
+  else 
+  {
+    if (expression != CHARACTER_EXPRESSION_SLEEP || new_expression != CHARACTER_EXPRESSION_FALLING)
+    {
+      if (v3 >= 2 && v3 <= 11 && v3 != 8 && !(new_expression == CHARACTER_EXPRESSION_DMGRECVD_MINOR || new_expression == CHARACTER_EXPRESSION_DMGRECVD_MODERATE || new_expression == CHARACTER_EXPRESSION_DMGRECVD_MAJOR))
+      {
+        return;
+      }
+    }
+  }
   //LOWORD(v3) = a3;
   v5 = 0;
   this->uExpressionTimeLength = a3;
--- a/Player.h	Sat Jul 13 04:16:30 2013 +0200
+++ b/Player.h	Sat Jul 13 11:56:57 2013 +0200
@@ -413,9 +413,9 @@
   CHARACTER_EXPRESSION_31 = 31,
   CHARACTER_EXPRESSION_32 = 32,
   CHARACTER_EXPRESSION_33 = 33,
-  CHARACTER_EXPRESSION_34 = 34,
-  CHARACTER_EXPRESSION_35 = 35,
-  CHARACTER_EXPRESSION_36 = 36,
+  CHARACTER_EXPRESSION_DMGRECVD_MINOR = 34,
+  CHARACTER_EXPRESSION_DMGRECVD_MODERATE = 35,
+  CHARACTER_EXPRESSION_DMGRECVD_MAJOR = 36,
   CHARACTER_EXPRESSION_37 = 37,
   CHARACTER_EXPRESSION_38 = 38,
   CHARACTER_EXPRESSION_39 = 39,
@@ -428,7 +428,7 @@
   CHARACTER_EXPRESSION_55 = 55,
   CHARACTER_EXPRESSION_56 = 56,
   CHARACTER_EXPRESSION_57 = 57,
-  CHARACTER_EXPRESSION_58 = 58,
+  CHARACTER_EXPRESSION_FALLING = 58,
 
   // ?
 
@@ -620,8 +620,6 @@
   inline void SetPertified(bool state)   {pConditions[Condition_Pertified] = state;}
   inline void SetEradicated(bool state)  {pConditions[Condition_Eradicated] = state;}
   inline void SetZombie(bool state)      {pConditions[Condition_Zombie] = state;}
-
-
   __int64 pConditions[20];
   unsigned __int64 uExperience;
   char pName[16];