comparison Actor.cpp @ 1763:20223822fabc

m
author Ritor1
date Tue, 01 Oct 2013 10:43:46 +0600
parents 5be18330f9a3
children 2051dfa0a00c
comparison
equal deleted inserted replaced
1762:2b8b748a222a 1763:20223822fabc
46 46
47 47
48 //----- (0041AF52) -------------------------------------------------------- 48 //----- (0041AF52) --------------------------------------------------------
49 void Actor::DrawHealthBar(Actor *actor, GUIWindow *window) 49 void Actor::DrawHealthBar(Actor *actor, GUIWindow *window)
50 { 50 {
51 //unsigned int v2; // eax@1 51 unsigned int bar_length; // esi@1
52 //GUIWindow *v3; // edi@1 52 unsigned int uX; // ebx@10
53 unsigned int v4; // esi@1
54 //signed int v5; // ebx@4
55 //double v6; // st7@5
56 //unsigned int v7; // eax@6
57 unsigned int v8; // ebx@10
58 unsigned int v9; // [sp+14h] [bp-Ch]@4 53 unsigned int v9; // [sp+14h] [bp-Ch]@4
59 unsigned int v10; // [sp+1Ch] [bp-4h]@4 54 unsigned int v10; // [sp+1Ch] [bp-4h]@4
60 55
61 //v2 = actor->pMonsterInfo.uHP; 56 bar_length = 25;
62 //v3 = window; 57 if ( actor->pMonsterInfo.uHP > 25 )
63 v4 = 25; 58 {
64 if ( (signed int)actor->pMonsterInfo.uHP > 25 ) 59 bar_length = 200;
65 { 60 if ( actor->pMonsterInfo.uHP < 200 )
66 v4 = 200; 61 bar_length = actor->pMonsterInfo.uHP;
67 if ( (signed int)actor->pMonsterInfo.uHP < 200 ) 62 }
68 v4 = actor->pMonsterInfo.uHP; 63 v10 = bar_length;
69 }
70 //v5 = actor->sCurrentHP;
71 v10 = v4;
72 v9 = uTextureID_mhp_grn; 64 v9 = uTextureID_mhp_grn;
73 if ( actor->sCurrentHP < (signed int)actor->pMonsterInfo.uHP ) 65 if ( actor->sCurrentHP < actor->pMonsterInfo.uHP )
74 { 66 {
75 //v6 = (double)(signed int)actor->pMonsterInfo.uHP; 67 v10 = bar_length / actor->pMonsterInfo.uHP * actor->sCurrentHP;
76 v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)actor->pMonsterInfo.uHP * (double)actor->sCurrentHP);
77 if ( actor->sCurrentHP <= (signed int)(signed __int64)(0.34 * (double)(signed int)actor->pMonsterInfo.uHP) ) 68 if ( actor->sCurrentHP <= (signed int)(signed __int64)(0.34 * (double)(signed int)actor->pMonsterInfo.uHP) )
78 {
79 //v7 = uTextureID_mhp_red;
80 v9 = uTextureID_mhp_red; 69 v9 = uTextureID_mhp_red;
81 }
82 else if ( actor->sCurrentHP <= (signed int)(signed __int64)((double)(signed int)actor->pMonsterInfo.uHP * 0.67) ) 70 else if ( actor->sCurrentHP <= (signed int)(signed __int64)((double)(signed int)actor->pMonsterInfo.uHP * 0.67) )
83 {
84 //v7 = uTextureID_mhp_yel;
85 v9 = uTextureID_mhp_yel; 71 v9 = uTextureID_mhp_yel;
86 } 72 }
87 } 73 uX = window->uFrameX + (signed int)(window->uFrameWidth - bar_length) / 2;
88 v8 = window->uFrameX + (signed int)(window->uFrameWidth - v4) / 2; 74
89 75 pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + bar_length, window->uFrameY + 52);
90 pRenderer->SetTextureClipRect(v8, window->uFrameY + 32, v8 + v4, window->uFrameY + 52); 76 pRenderer->DrawTextureIndexed(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd));
91 pRenderer->DrawTextureIndexed(v8, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); 77 pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + v10, window->uFrameY + 52);
92 pRenderer->SetTextureClipRect(v8, window->uFrameY + 32, v8 + v10, window->uFrameY + 52); 78 pRenderer->DrawTextureIndexed(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9));
93 pRenderer->DrawTextureIndexed(v8, window->uFrameY + 34, pIcons_LOD->GetTexture(v9));
94 79
95 pRenderer->ResetTextureClipRect(); 80 pRenderer->ResetTextureClipRect();
96 pRenderer->DrawTextureIndexed(v8 - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); 81 pRenderer->DrawTextureIndexed(uX - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl));
97 pRenderer->DrawTextureIndexed(v8 + v4, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); 82 pRenderer->DrawTextureIndexed(uX + bar_length, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr));
98 } 83 }
99 84
100 //----- (00448A40) -------------------------------------------------------- 85 //----- (00448A40) --------------------------------------------------------
101 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) 86 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
102 { 87 {
225 } 210 }
226 } 211 }
227 } 212 }
228 } 213 }
229 214
230
231 //----- (0040894B) -------------------------------------------------------- 215 //----- (0040894B) --------------------------------------------------------
232 bool Actor::CanAct() 216 bool Actor::CanAct()
233 { 217 {
234 bool isparalyzed; // esi@1 218 bool isparalyzed; // esi@1
235 bool isstoned; // edi@2 219 bool isstoned; // edi@2
1908 } 1892 }
1909 1893
1910 //----- (00403E61) -------------------------------------------------------- 1894 //----- (00403E61) --------------------------------------------------------
1911 void __fastcall Actor::StandAwhile(unsigned int uActorID) 1895 void __fastcall Actor::StandAwhile(unsigned int uActorID)
1912 { 1896 {
1913 Actor *v1; // esi@1 1897 pActors[uActorID].uCurrentActionLength = rand() % 128 + 128;
1914 1898 pActors[uActorID].uCurrentActionTime = 0;
1915 v1 = &pActors[uActorID]; 1899 pActors[uActorID].uAIState = Standing;
1916 v1->uCurrentActionLength = rand() % 128 + 128; 1900 pActors[uActorID].vVelocity.z = 0;
1917 v1->uCurrentActionTime = 0; 1901 pActors[uActorID].vVelocity.y = 0;
1918 v1->uAIState = Standing; 1902 pActors[uActorID].vVelocity.x = 0;
1919 v1->vVelocity.z = 0; 1903 pActors[uActorID].UpdateAnimation();
1920 v1->vVelocity.y = 0;
1921 v1->vVelocity.x = 0;
1922 v1->UpdateAnimation();
1923 } 1904 }
1924 1905
1925 //----- (00403C6C) -------------------------------------------------------- 1906 //----- (00403C6C) --------------------------------------------------------
1926 void Actor::AI_MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0) 1907 void Actor::AI_MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0)
1927 { 1908 {