Mercurial > mm7
comparison Actor.cpp @ 1803:9f93b5700e2d
Merge
author | Nomad |
---|---|
date | Mon, 07 Oct 2013 11:55:35 +0200 |
parents | 2051dfa0a00c |
children | 0f1543750bf8 |
comparison
equal
deleted
inserted
replaced
1802:633f81bb3ae7 | 1803:9f93b5700e2d |
---|---|
44 | 44 |
45 | 45 |
46 | 46 |
47 | 47 |
48 //----- (0041AF52) -------------------------------------------------------- | 48 //----- (0041AF52) -------------------------------------------------------- |
49 void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) | 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 = a1->pMonsterInfo.uHP; | 56 bar_length = 25; |
62 v3 = a2; | 57 if ( actor->pMonsterInfo.uHP > 25 ) |
63 v4 = 25; | 58 { |
64 if ( (signed int)v2 > 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)v2 < 200 ) | 62 } |
68 v4 = a1->pMonsterInfo.uHP; | 63 v10 = bar_length; |
69 } | |
70 v5 = a1->sCurrentHP; | |
71 v10 = v4; | |
72 v9 = uTextureID_mhp_grn; | 64 v9 = uTextureID_mhp_grn; |
73 if ( v5 < (signed int)v2 ) | 65 if ( actor->sCurrentHP < actor->pMonsterInfo.uHP ) |
74 { | 66 { |
75 v6 = (double)(signed int)v2; | 67 v10 = bar_length / actor->pMonsterInfo.uHP * actor->sCurrentHP; |
76 v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); | 68 if ( actor->sCurrentHP <= (signed int)(signed __int64)(0.34 * (double)(signed int)actor->pMonsterInfo.uHP) ) |
77 if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) | 69 v9 = uTextureID_mhp_red; |
78 { | 70 else if ( actor->sCurrentHP <= (signed int)(signed __int64)((double)(signed int)actor->pMonsterInfo.uHP * 0.67) ) |
79 v7 = uTextureID_mhp_red; | 71 v9 = uTextureID_mhp_yel; |
80 v9 = v7; | 72 } |
81 } | 73 uX = window->uFrameX + (signed int)(window->uFrameWidth - bar_length) / 2; |
82 else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) | 74 |
83 { | 75 pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + bar_length, window->uFrameY + 52); |
84 v7 = uTextureID_mhp_yel; | 76 pRenderer->DrawTextureIndexed(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); |
85 v9 = v7; | 77 pRenderer->SetTextureClipRect(uX, window->uFrameY + 32, uX + v10, window->uFrameY + 52); |
86 } | 78 pRenderer->DrawTextureIndexed(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9)); |
87 } | |
88 v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; | |
89 | |
90 pRenderer->SetTextureClipRect(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); | |
91 pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); | |
92 pRenderer->SetTextureClipRect(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); | |
93 pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 34, pIcons_LOD->GetTexture(v9)); | |
94 | 79 |
95 pRenderer->ResetTextureClipRect(); | 80 pRenderer->ResetTextureClipRect(); |
96 pRenderer->DrawTextureIndexed(v8 - 5, v3->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, v3->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 { |