changeset 1763:20223822fabc

m
author Ritor1
date Tue, 01 Oct 2013 10:43:46 +0600
parents 2b8b748a222a
children 2051dfa0a00c
files Actor.cpp Actor.h Player.cpp
diffstat 3 files changed, 26 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Tue Oct 01 09:33:38 2013 +0600
+++ b/Actor.cpp	Tue Oct 01 10:43:46 2013 +0600
@@ -48,53 +48,38 @@
 //----- (0041AF52) --------------------------------------------------------
 void Actor::DrawHealthBar(Actor *actor, GUIWindow *window)
 {
-  //unsigned int v2; // eax@1
-  //GUIWindow *v3; // edi@1
-  unsigned int v4; // esi@1
-  //signed int v5; // ebx@4
-  //double v6; // st7@5
-  //unsigned int v7; // eax@6
-  unsigned int v8; // ebx@10
+  unsigned int bar_length; // esi@1
+  unsigned int uX; // ebx@10
   unsigned int v9; // [sp+14h] [bp-Ch]@4
   unsigned int v10; // [sp+1Ch] [bp-4h]@4
 
-  //v2 = actor->pMonsterInfo.uHP;
-  //v3 = window;
-  v4 = 25;
-  if ( (signed int)actor->pMonsterInfo.uHP > 25 )
+  bar_length = 25;
+  if ( actor->pMonsterInfo.uHP > 25 )
   {
-    v4 = 200;
-    if ( (signed int)actor->pMonsterInfo.uHP < 200 )
-      v4 = actor->pMonsterInfo.uHP;
+    bar_length = 200;
+    if ( actor->pMonsterInfo.uHP < 200 )
+      bar_length = actor->pMonsterInfo.uHP;
   }
-  //v5 = actor->sCurrentHP;
-  v10 = v4;
+  v10 = bar_length;
   v9 = uTextureID_mhp_grn;
-  if ( actor->sCurrentHP < (signed int)actor->pMonsterInfo.uHP )
+  if ( actor->sCurrentHP < actor->pMonsterInfo.uHP )
   {
-    //v6 = (double)(signed int)actor->pMonsterInfo.uHP;
-    v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)actor->pMonsterInfo.uHP * (double)actor->sCurrentHP);
+    v10 = bar_length / actor->pMonsterInfo.uHP * actor->sCurrentHP;
     if ( actor->sCurrentHP <= (signed int)(signed __int64)(0.34 * (double)(signed int)actor->pMonsterInfo.uHP) )
-    {
-      //v7 = uTextureID_mhp_red;
       v9 = uTextureID_mhp_red;
-    }
     else if ( actor->sCurrentHP <= (signed int)(signed __int64)((double)(signed int)actor->pMonsterInfo.uHP * 0.67) )
-    {
-      //v7 = uTextureID_mhp_yel;
       v9 = uTextureID_mhp_yel;
-    }
   }
-  v8 = window->uFrameX + (signed int)(window->uFrameWidth - v4) / 2;
+  uX = window->uFrameX + (signed int)(window->uFrameWidth - bar_length) / 2;
 
-  pRenderer->SetTextureClipRect(v8, window->uFrameY + 32, v8 + v4, window->uFrameY + 52);
-  pRenderer->DrawTextureIndexed(v8, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd));
-  pRenderer->SetTextureClipRect(v8, window->uFrameY + 32, v8 + v10, window->uFrameY + 52);
-  pRenderer->DrawTextureIndexed(v8, window->uFrameY + 34, pIcons_LOD->GetTexture(v9));
+  pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + bar_length, window->uFrameY + 52);
+  pRenderer->DrawTextureIndexed(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd));
+  pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + v10, window->uFrameY + 52);
+  pRenderer->DrawTextureIndexed(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9));
 
   pRenderer->ResetTextureClipRect();
-  pRenderer->DrawTextureIndexed(v8 - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl));
-  pRenderer->DrawTextureIndexed(v8 + v4, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr));
+  pRenderer->DrawTextureIndexed(uX - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl));
+  pRenderer->DrawTextureIndexed(uX + bar_length, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr));
 }
 
 //----- (00448A40) --------------------------------------------------------
@@ -227,7 +212,6 @@
   }
 }
 
-  
 //----- (0040894B) --------------------------------------------------------
 bool Actor::CanAct()
 {
@@ -1910,16 +1894,13 @@
 //----- (00403E61) --------------------------------------------------------
 void __fastcall Actor::StandAwhile(unsigned int uActorID)
 {
-  Actor *v1; // esi@1
-
-  v1 = &pActors[uActorID];
-  v1->uCurrentActionLength = rand() % 128 + 128;
-  v1->uCurrentActionTime = 0;
-  v1->uAIState = Standing;
-  v1->vVelocity.z = 0;
-  v1->vVelocity.y = 0;
-  v1->vVelocity.x = 0;
-  v1->UpdateAnimation();
+  pActors[uActorID].uCurrentActionLength = rand() % 128 + 128;
+  pActors[uActorID].uCurrentActionTime = 0;
+  pActors[uActorID].uAIState = Standing;
+  pActors[uActorID].vVelocity.z = 0;
+  pActors[uActorID].vVelocity.y = 0;
+  pActors[uActorID].vVelocity.x = 0;
+  pActors[uActorID].UpdateAnimation();
 }
 
 //----- (00403C6C) --------------------------------------------------------
--- a/Actor.h	Tue Oct 01 09:33:38 2013 +0600
+++ b/Actor.h	Tue Oct 01 10:43:46 2013 +0600
@@ -237,7 +237,7 @@
   static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive);
   static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle);
   static void ApplyFineForKillingPeasant(unsigned int uActorID);
-  static void DrawHealthBar(Actor *a1, struct GUIWindow *a2);
+  static void DrawHealthBar(Actor *actor, struct GUIWindow *window);
   static int _43B3E0_CalcDamage(Actor *a1, signed int a2);
   static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
 
--- a/Player.cpp	Tue Oct 01 09:33:38 2013 +0600
+++ b/Player.cpp	Tue Oct 01 10:43:46 2013 +0600
@@ -2649,7 +2649,7 @@
       if (SkillToMastery(pActiveSkills[weapon->GetPlayerSkillType()]) >= 2 )  // Expert   Sword, Axe & Bow   reduce recovery
         sword_axe_bow_recovery_reduction = pActiveSkills[weapon_desc->uSkillType] & 0x3F;
     }
-    if (weapon_desc->uSkillType == PLAYER_SKILL_BLASTER)
+    if (weapon->GetPlayerSkillType() == PLAYER_SKILL_BLASTER)
       shooting_laser = true;
   }