Mercurial > mm7
comparison Party.cpp @ 97:8c0fcfa72fce
Слияние
author | Ritor1 |
---|---|
date | Thu, 07 Feb 2013 13:54:32 +0600 |
parents | d61f6bc04bf2 |
children | 01ab35c85832 |
comparison
equal
deleted
inserted
replaced
96:bb449743ee81 | 97:8c0fcfa72fce |
---|---|
80 int Party::GetNextActiveCharacter() | 80 int Party::GetNextActiveCharacter() |
81 { | 81 { |
82 Party *v1; // esi@1 | 82 Party *v1; // esi@1 |
83 int v2; // eax@4 | 83 int v2; // eax@4 |
84 signed int v4; // ecx@6 | 84 signed int v4; // ecx@6 |
85 char *v5; // edx@6 | 85 Player *v5; // edx@6 |
86 Player *v6; // eax@7 | 86 Player *v6; // eax@7 |
87 char *v7; // ecx@23 | 87 Player *v7; // ecx@23 |
88 signed int v8; // esi@23 | 88 signed int v8; // esi@23 |
89 signed int v9; // edx@23 | 89 signed int v9; // edx@23 |
90 Player **v10; // edi@23 | 90 Player **v10; // edi@23 |
91 Player *v11; // eax@24 | 91 Player *v11; // eax@24 |
92 int v12; // [sp+Ch] [bp-4h]@1 | 92 int v12; // [sp+Ch] [bp-4h]@1 |
99 return 0; | 99 return 0; |
100 v2 = pTurnEngine->pQueue[0].uPackedID >> 3; | 100 v2 = pTurnEngine->pQueue[0].uPackedID >> 3; |
101 return v2 + 1; | 101 return v2 + 1; |
102 } | 102 } |
103 v4 = 0; | 103 v4 = 0; |
104 v5 = (char *)&v1->pPlayers[0].uTimeToRecovery; | 104 v5 = v1->pPlayers;//[0].uTimeToRecovery; |
105 while ( 1 ) | 105 while ( 1 ) |
106 { | 106 { |
107 v6 = ::pPlayers[v4 + 1]; | 107 v6 = ::pPlayers[v4 + 1]; |
108 if ( v6->pConditions[2] | 108 if ( v6->pConditions[2] |
109 || v6->pConditions[12] | 109 || v6->pConditions[12] |
110 || v6->pConditions[13] | 110 || v6->pConditions[13] |
111 || v6->pConditions[14] | 111 || v6->pConditions[14] |
112 || v6->pConditions[15] | 112 || v6->pConditions[15] |
113 || v6->pConditions[16] | 113 || v6->pConditions[16] |
114 || *(short *)v5 ) | 114 || v5->uTimeToRecovery ) |
115 { | 115 { |
116 byte_AE3368[v4] = 1; | 116 byte_AE3368[v4] = 1; |
117 goto LABEL_21; | |
118 } | 117 } |
119 if ( !byte_AE3368[v4] ) | 118 else if ( !byte_AE3368[v4] ) |
120 break; | 119 break; |
121 LABEL_21: | |
122 ++v4; | 120 ++v4; |
123 v5 += 6972; | 121 ++v5; |
124 if ( v4 >= 4 ) | 122 if ( v4 >= 4 ) |
125 goto LABEL_16; | 123 break; |
126 } | 124 } |
127 v12 = v4; | 125 if(v4<4) |
128 byte_AE3368[v4] = 1; | 126 { |
129 LABEL_16: | 127 v12 = v4; |
128 byte_AE3368[v4] = 1; | |
129 } | |
130 if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] ) | 130 if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] ) |
131 memset(byte_AE3368, 0, 4u); | 131 memset(byte_AE3368, 0, 4u); |
132 v2 = v12; | 132 v2 = v12; |
133 if ( v12 ) | 133 if ( v12 ) |
134 return v2 + 1; | 134 return v2 + 1; |
135 v7 = (char *)&v1->pPlayers[0].uSpeedBonus; | 135 v7 = v1->pPlayers;//[0].uSpeedBonus; |
136 v8 = 0; | 136 v8 = 0; |
137 v9 = 1; | 137 v9 = 1; |
138 v10 = &::pPlayers[1]; | 138 v10 = &::pPlayers[1]; |
139 while ( 2 ) | 139 while ( 2 ) |
140 { | 140 { |
143 && !v11->pConditions[12] | 143 && !v11->pConditions[12] |
144 && !v11->pConditions[13] | 144 && !v11->pConditions[13] |
145 && !v11->pConditions[14] | 145 && !v11->pConditions[14] |
146 && !v11->pConditions[15] | 146 && !v11->pConditions[15] |
147 && !v11->pConditions[16] | 147 && !v11->pConditions[16] |
148 && !*((short *)v7 + 3123) ) | 148 && !v7->uTimeToRecovery ) |
149 { | 149 { |
150 if ( v12 ) | 150 if ( v12 ) |
151 { | 151 { |
152 if ( *(short *)v7 > v8 ) | 152 if ( v7->uSpeedBonus > v8 ) |
153 { | 153 { |
154 v8 = *(short *)v7; | 154 v8 = v7->uSpeedBonus; |
155 goto LABEL_35; | 155 v12 = v9; |
156 } | 156 } |
157 } | 157 } |
158 else | 158 else |
159 { | 159 { |
160 v8 = *(short *)v7; | 160 v8 = *(short *)v7; |
161 LABEL_35: | |
162 v12 = v9; | 161 v12 = v9; |
163 } | 162 } |
164 } | 163 } |
165 ++v10; | 164 ++v10; |
166 ++v9; | 165 ++v9; |
167 v7 += 6972; | 166 ++v7; |
168 if ( v9 - 1 < 4 ) | 167 if ( v9 - 1 < 4 ) |
169 continue; | 168 continue; |
170 return v12; | 169 return v12; |
171 } | 170 } |
172 } | 171 } |
173 | 172 |
174 | 173 |
175 //----- (00493244) -------------------------------------------------------- | 174 //----- (00493244) -------------------------------------------------------- |
176 bool Party::HasItem(unsigned int uItemID) | 175 bool Party::HasItem(unsigned int uItemID) |
177 { | 176 { |
178 char *v2; // edx@1 | 177 Player *v2; // edx@1 |
179 signed int v3; // ecx@2 | 178 signed int v3; // ecx@2 |
180 ItemGen *v4; // eax@2 | 179 ItemGen *v4; // eax@2 |
181 | 180 |
182 v2 = (char *)pParty->pPlayers[0].pInventoryItems; | 181 v2 = pParty->pPlayers;//[0].pInventoryItems; |
183 while ( 2 ) | 182 while ( v2 <= &pParty->pPlayers[3] ) |
184 { | 183 { |
185 v3 = 0; | 184 v3 = 0; |
186 v4 = (ItemGen *)v2; | 185 v4 = v2->pInventoryItems; |
187 do | 186 do |
188 { | 187 { |
189 if ( v4->uItemID == uItemID ) | 188 if ( v4->uItemID == uItemID ) |
190 return 1; | 189 return 1; |
191 ++v3; | 190 ++v3; |
192 ++v4; | 191 ++v4; |
193 } | 192 } |
194 while ( v3 < 138 ); | 193 while ( v3 < 138 ); |
195 v2 += 6972; | 194 ++v2; |
196 if ( (signed int)v2 < (signed int)&pParty->field_777C[85] ) | |
197 continue; | |
198 break; | |
199 } | 195 } |
200 return 0; | 196 return 0; |
201 } | 197 } |
202 | 198 |
203 | 199 |
259 | 255 |
260 //----- (0049135E) -------------------------------------------------------- | 256 //----- (0049135E) -------------------------------------------------------- |
261 unsigned int Party::GetPartyFame() | 257 unsigned int Party::GetPartyFame() |
262 { | 258 { |
263 signed int v1; // eax@1 | 259 signed int v1; // eax@1 |
264 char *v2; // ecx@1 | 260 Player *v2; // ecx@1 |
265 signed int v3; // edx@1 | 261 signed int v3; // edx@1 |
266 | 262 |
267 v1 = 0; | 263 v1 = 0; |
268 v2 = (char *)&this->pPlayers[0].uExperience; | 264 v2 = this->pPlayers;//[0].uExperience; |
269 v3 = 4; // (E exp) / 1000 | 265 v3 = 4; // (E exp) / 1000 |
270 do | 266 do |
271 { | 267 { |
272 v1 += *(int *)v2; | 268 v1 += (int)v2->uExperience; // needs review |
273 v2 += 6972; | 269 ++v2; |
274 --v3; | 270 --v3; |
275 } | 271 } |
276 while ( v3 ); | 272 while ( v3 ); |
277 return v1 / 1000; | 273 return v1 / 1000; |
278 } | 274 } |
776 | 772 |
777 | 773 |
778 //----- (0043AD34) -------------------------------------------------------- | 774 //----- (0043AD34) -------------------------------------------------------- |
779 void Party::Yell() | 775 void Party::Yell() |
780 { | 776 { |
781 void *v0; // esi@5 | 777 Actor *v0; // esi@5 |
782 int v1; // edi@9 | 778 int v1; // edi@9 |
783 int v2; // ebx@9 | 779 int v2; // ebx@9 |
784 int v3; // eax@9 | 780 int v3; // eax@9 |
785 unsigned int v4; // [sp+8h] [bp-4h]@4 | 781 unsigned int v4; // [sp+8h] [bp-4h]@4 |
786 | 782 |
789 if ( pParty->bTurnBasedModeOn != 1 ) | 785 if ( pParty->bTurnBasedModeOn != 1 ) |
790 { | 786 { |
791 v4 = 0; | 787 v4 = 0; |
792 if ( (signed int)uNumActors > 0 ) | 788 if ( (signed int)uNumActors > 0 ) |
793 { | 789 { |
794 v0 = &pActors[0].pMonsterInfo.uMovementType; | 790 v0 = pActors;//[0].pMonsterInfo.uMovementType; |
795 do | 791 do |
796 { | 792 { |
797 if ( ((Actor *)((char *)v0 - 59))->Actor::CanAct() && *((char *)v0 + 2) != 4 && *(char *)v0 != 5 ) | 793 if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != 4 && v0->pMonsterInfo.uMovementType != 5 ) |
798 { | 794 { |
799 v1 = abs(*(short *)((char *)v0 + 83) - pParty->vPosition.x); | 795 v1 = abs(v0->vPosition.x - pParty->vPosition.x); |
800 v2 = abs(*(short *)((char *)v0 + 85) - pParty->vPosition.y); | 796 v2 = abs(v0->vPosition.y - pParty->vPosition.y); |
801 v3 = abs(*(short *)((char *)v0 + 87) - pParty->vPosition.z); | 797 v3 = abs(v0->vPosition.z - pParty->vPosition.z); |
802 if ( (double)sub_4621DA(v1, v2, v3) < 512.0 ) | 798 if ( (double)sub_4621DA(v1, v2, v3) < 512.0 ) |
803 Actor::_402968(v4, 4, 0, 0); | 799 Actor::_402968(v4, 4, 0, 0); |
804 } | 800 } |
805 ++v4; | 801 ++v4; |
806 v0 = (char *)v0 + 836; | 802 ++v0; |
807 } | 803 } |
808 while ( (signed int)v4 < (signed int)uNumActors ); | 804 while ( (signed int)v4 < (signed int)uNumActors ); |
809 } | 805 } |
810 } | 806 } |
811 } | 807 } |
812 | 808 |
813 //----- (00491BF9) -------------------------------------------------------- | 809 //----- (00491BF9) -------------------------------------------------------- |
814 void Party::ResetPosMiscAndSpellBuffs() | 810 void Party::ResetPosMiscAndSpellBuffs() |
815 { | 811 { |
816 Party *v1; // esi@1 | 812 Party *v1; // esi@1 |
817 char *v2; // edi@1 | 813 Player *v2; // edi@1 |
818 SpellBuff *v3; // ebx@2 | 814 SpellBuff *v3; // ebx@2 |
819 SpellBuff *v4; // esi@5 | 815 SpellBuff *v4; // esi@5 |
820 signed int v5; // edi@5 | 816 signed int v5; // edi@5 |
821 signed int v6; // [sp+8h] [bp-8h]@1 | 817 signed int v6; // [sp+8h] [bp-8h]@1 |
822 signed int v7; // [sp+Ch] [bp-4h]@2 | 818 signed int v7; // [sp+Ch] [bp-4h]@2 |
837 this->field_20_prolly_turn_speed = 90; | 833 this->field_20_prolly_turn_speed = 90; |
838 this->field_24 = 5; | 834 this->field_24 = 5; |
839 this->field_6FC = 0; | 835 this->field_6FC = 0; |
840 this->field_708 = 15; | 836 this->field_708 = 15; |
841 this->field_0 = 25; | 837 this->field_0 = 25; |
842 v2 = (char *)this->pPlayers[0].pPlayerBuffs; | 838 v2 = this->pPlayers;//[0].pPlayerBuffs; |
843 v6 = 4; | 839 v6 = 4; |
844 do | 840 do |
845 { | 841 { |
846 v3 = (SpellBuff *)v2; | 842 v3 = v2->pPlayerBuffs; |
847 v7 = 24; | 843 v7 = 24; |
848 do | 844 do |
849 { | 845 { |
850 v3->Reset(); | 846 v3->Reset(); |
851 ++v3; | 847 ++v3; |
852 --v7; | 848 --v7; |
853 } | 849 } |
854 while ( v7 ); | 850 while ( v7 ); |
855 v2 += 6972; | 851 ++v2; |
856 --v6; | 852 --v6; |
857 } | 853 } |
858 while ( v6 ); | 854 while ( v6 ); |
859 v4 = v1->pPartyBuffs; | 855 v4 = v1->pPartyBuffs; |
860 v5 = 20; | 856 v5 = 20; |