0
|
1 #include "Party.h"
|
|
2 #include "MapInfo.h"
|
|
3 #include "Time.h"
|
|
4 #include "AudioPlayer.h"
|
|
5 #include "IconFrameTable.h"
|
|
6 #include "Mouse.h"
|
|
7 #include "PlayerFrameTable.h"
|
|
8 #include "TurnEngine.h"
|
|
9 #include "stru279.h"
|
|
10 #include "Viewport.h"
|
|
11 #include "Actor.h"
|
|
12 #include "GUIWindow.h"
|
|
13
|
|
14 #include "mm7_data.h"
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22 Party *pParty; // idb
|
|
23
|
27
|
24 struct ActionQueue *pPartyActionQueue = new ActionQueue;
|
0
|
25
|
|
26
|
|
27
|
|
28
|
|
29 //----- (004760C1) --------------------------------------------------------
|
|
30 void ActionQueue::Add(PartyAction action)
|
|
31 {
|
|
32 if (uNumActions < 30)
|
|
33 pActions[uNumActions++] = action;
|
|
34 }
|
|
35
|
|
36 //----- (00497FC5) --------------------------------------------------------
|
|
37 bool Party::_497FC5_check_party_perception_against_level()
|
|
38 {
|
|
39 int uMaxPerception; // edi@1
|
|
40 Player *v2; // esi@1
|
|
41 signed int v3; // ebx@1
|
|
42 Player *v4; // ecx@2
|
|
43 signed int v5; // eax@3
|
|
44 bool result; // eax@7
|
|
45
|
|
46 uMaxPerception = 0;
|
|
47 v2 = this->pPlayers;
|
|
48 v3 = 4;
|
|
49 do
|
|
50 {
|
|
51 if ( v2->CanAct() )
|
|
52 {
|
|
53 v5 = v2->GetPerception();
|
|
54 if ( v5 > uMaxPerception )
|
|
55 uMaxPerception = v5;
|
|
56 }
|
|
57 ++v2;
|
|
58 --v3;
|
|
59 }
|
|
60 while ( v3 );
|
|
61 if ( uLevelMapStatsID && (signed int)uLevelMapStatsID < 77 )
|
|
62 result = uMaxPerception >= 2 * pMapStats->pInfos[uLevelMapStatsID]._per;
|
|
63 else
|
|
64 result = 0;
|
|
65 return result;
|
|
66 }
|
|
67
|
|
68 //----- (004936E1) --------------------------------------------------------
|
|
69 void Party::SetHoldingItem(ItemGen *pItem)
|
|
70 {
|
|
71 Party *v2; // esi@1
|
|
72
|
|
73 v2 = this;
|
|
74 sub_421B2C_PlaceInInventory_or_DropPickedItem();
|
|
75 memcpy(&v2->pPickedItem, pItem, sizeof(v2->pPickedItem));
|
|
76 pMouse->SetCursorBitmapFromItemID(v2->pPickedItem.uItemID);
|
|
77 }
|
|
78
|
|
79 //----- (0049370F) --------------------------------------------------------
|
|
80 int Party::GetNextActiveCharacter()
|
|
81 {
|
|
82 Party *v1; // esi@1
|
|
83 int v2; // eax@4
|
|
84 signed int v4; // ecx@6
|
|
85 char *v5; // edx@6
|
|
86 Player *v6; // eax@7
|
|
87 char *v7; // ecx@23
|
|
88 signed int v8; // esi@23
|
|
89 signed int v9; // edx@23
|
|
90 Player **v10; // edi@23
|
|
91 Player *v11; // eax@24
|
|
92 int v12; // [sp+Ch] [bp-4h]@1
|
|
93
|
|
94 v1 = this;
|
|
95 v12 = 0;
|
|
96 if ( pParty->bTurnBasedModeOn == 1 )
|
|
97 {
|
|
98 if ( pTurnEngine->field_4 != 2 || (pTurnEngine->pQueue[0].uPackedID & 7) != 4 )
|
|
99 return 0;
|
|
100 v2 = pTurnEngine->pQueue[0].uPackedID >> 3;
|
|
101 return v2 + 1;
|
|
102 }
|
|
103 v4 = 0;
|
|
104 v5 = (char *)&v1->pPlayers[0].uTimeToRecovery;
|
|
105 while ( 1 )
|
|
106 {
|
|
107 v6 = ::pPlayers[v4 + 1];
|
|
108 if ( v6->pConditions[2]
|
|
109 || v6->pConditions[12]
|
|
110 || v6->pConditions[13]
|
|
111 || v6->pConditions[14]
|
|
112 || v6->pConditions[15]
|
|
113 || v6->pConditions[16]
|
|
114 || *(short *)v5 )
|
|
115 {
|
|
116 byte_AE3368[v4] = 1;
|
|
117 goto LABEL_21;
|
|
118 }
|
|
119 if ( !byte_AE3368[v4] )
|
|
120 break;
|
|
121 LABEL_21:
|
|
122 ++v4;
|
|
123 v5 += 6972;
|
|
124 if ( v4 >= 4 )
|
|
125 goto LABEL_16;
|
|
126 }
|
|
127 v12 = v4;
|
|
128 byte_AE3368[v4] = 1;
|
|
129 LABEL_16:
|
|
130 if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] )
|
|
131 memset(byte_AE3368, 0, 4u);
|
|
132 v2 = v12;
|
|
133 if ( v12 )
|
|
134 return v2 + 1;
|
|
135 v7 = (char *)&v1->pPlayers[0].uSpeedBonus;
|
|
136 v8 = 0;
|
|
137 v9 = 1;
|
|
138 v10 = &::pPlayers[1];
|
|
139 while ( 2 )
|
|
140 {
|
|
141 v11 = *v10;
|
|
142 if ( !(*v10)->pConditions[2]
|
|
143 && !v11->pConditions[12]
|
|
144 && !v11->pConditions[13]
|
|
145 && !v11->pConditions[14]
|
|
146 && !v11->pConditions[15]
|
|
147 && !v11->pConditions[16]
|
|
148 && !*((short *)v7 + 3123) )
|
|
149 {
|
|
150 if ( v12 )
|
|
151 {
|
|
152 if ( *(short *)v7 > v8 )
|
|
153 {
|
|
154 v8 = *(short *)v7;
|
|
155 goto LABEL_35;
|
|
156 }
|
|
157 }
|
|
158 else
|
|
159 {
|
|
160 v8 = *(short *)v7;
|
|
161 LABEL_35:
|
|
162 v12 = v9;
|
|
163 }
|
|
164 }
|
|
165 ++v10;
|
|
166 ++v9;
|
|
167 v7 += 6972;
|
|
168 if ( v9 - 1 < 4 )
|
|
169 continue;
|
|
170 return v12;
|
|
171 }
|
|
172 }
|
|
173
|
|
174
|
|
175 //----- (00493244) --------------------------------------------------------
|
|
176 bool Party::HasItem(unsigned int uItemID)
|
|
177 {
|
|
178 char *v2; // edx@1
|
|
179 signed int v3; // ecx@2
|
|
180 ItemGen *v4; // eax@2
|
|
181
|
|
182 v2 = (char *)pParty->pPlayers[0].pInventoryItems;
|
|
183 while ( 2 )
|
|
184 {
|
|
185 v3 = 0;
|
|
186 v4 = (ItemGen *)v2;
|
|
187 do
|
|
188 {
|
|
189 if ( v4->uItemID == uItemID )
|
|
190 return 1;
|
|
191 ++v3;
|
|
192 ++v4;
|
|
193 }
|
|
194 while ( v3 < 138 );
|
|
195 v2 += 6972;
|
|
196 if ( (signed int)v2 < (signed int)&pParty->field_777C[85] )
|
|
197 continue;
|
|
198 break;
|
|
199 }
|
|
200 return 0;
|
|
201 }
|
|
202
|
|
203
|
|
204 //----- (00492AD5) --------------------------------------------------------
|
|
205 __int16 Party::SetFood(unsigned int uNumFood)
|
|
206 {
|
|
207 __int16 result; // ax@1
|
|
208
|
|
209 pUIAnim_Food->uAnimTime = 0;
|
|
210 pParty->uNumFoodRations = uNumFood;
|
|
211 result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
212 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
213 return result;
|
|
214 }
|
|
215
|
|
216 //----- (00492B03) --------------------------------------------------------
|
|
217 void Party::TakeFood(unsigned int uNumFood)
|
|
218 {
|
|
219 if ( ((pParty->uNumFoodRations - uNumFood) & 0x80000000u) == 0 )
|
|
220 pParty->uNumFoodRations -= uNumFood;
|
|
221 else
|
|
222 pParty->uNumFoodRations = 0;
|
|
223 pUIAnim_Food->uAnimTime = 0;
|
|
224 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
225 }
|
|
226
|
|
227 //----- (00492B42) --------------------------------------------------------
|
|
228 __int16 Party::GiveFood(unsigned int _this)
|
|
229 {
|
|
230 __int16 result; // ax@1
|
|
231
|
|
232 pParty->uNumFoodRations += _this;
|
|
233 pUIAnim_Food->uAnimTime = 0;
|
|
234 result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
235 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
236 return result;
|
|
237 }
|
|
238
|
|
239 //----- (00492B70) --------------------------------------------------------
|
|
240 void Party::SetGold(unsigned int uNumGold)
|
|
241 {
|
|
242 pParty->uNumGold = uNumGold;
|
|
243 pUIAnim_Gold->uAnimTime = 0;
|
|
244 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
|
|
245 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
|
|
246 }
|
|
247
|
|
248 //----- (00492BB6) --------------------------------------------------------
|
|
249 void Party::TakeGold(unsigned int uNumGold)
|
|
250 {
|
|
251 if ( uNumGold <= pParty->uNumGold )
|
|
252 pParty->uNumGold -= uNumGold;
|
|
253 else
|
|
254 pParty->uNumGold = 0;
|
|
255 pUIAnim_Gold->uAnimTime = 0;
|
|
256 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
|
|
257 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
|
|
258 }
|
|
259
|
|
260 //----- (0049135E) --------------------------------------------------------
|
|
261 unsigned int Party::GetPartyFame()
|
|
262 {
|
|
263 signed int v1; // eax@1
|
|
264 char *v2; // ecx@1
|
|
265 signed int v3; // edx@1
|
|
266
|
|
267 v1 = 0;
|
|
268 v2 = (char *)&this->pPlayers[0].uExperience;
|
|
269 v3 = 4; // (E exp) / 1000
|
|
270 do
|
|
271 {
|
|
272 v1 += *(int *)v2;
|
|
273 v2 += 6972;
|
|
274 --v3;
|
|
275 }
|
|
276 while ( v3 );
|
|
277 return v1 / 1000;
|
|
278 }
|
|
279
|
|
280 //----- (0049137D) --------------------------------------------------------
|
|
281 void Party::CreateDefaultParty(char bGiveItems)
|
|
282 {
|
54
|
283 Party *pParty; // esi@1
|
0
|
284 signed __int16 v3; // ax@1
|
54
|
285 int pResMagicBase; // ecx@1
|
|
286 Player *pCharacter; // esi@3
|
|
287 signed int uSpellBookPageCount; // edx@5
|
151
|
288 int pMagicSkills; // eax@5
|
0
|
289 int uSkillIdx; // eax@11
|
139
|
290 //unsigned __int8 v9; // zf@37
|
|
291 //char v10; // sf@37
|
|
292 //unsigned __int8 v11; // of@37
|
138
|
293 char *pAttributes; // eax@38
|
0
|
294 signed int v13; // ecx@38
|
54
|
295 int uMaxSP; // eax@42
|
0
|
296 unsigned int v15; // [sp-4h] [bp-44h]@14
|
|
297 unsigned int v16; // [sp-4h] [bp-44h]@26
|
|
298 int v17; // [sp+10h] [bp-30h]@1
|
|
299 int v18; // [sp+14h] [bp-2Ch]@11
|
54
|
300 signed int uNumPlayers; // [sp+18h] [bp-28h]@1
|
0
|
301 ItemGen Dst; // [sp+1Ch] [bp-24h]@10
|
|
302
|
54
|
303 pParty = this;
|
|
304 strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan
|
|
305 pParty->pPlayers[0].field_1928 = 17;
|
|
306 pParty->pPlayers[0].uFace = 17;
|
|
307 pParty->pPlayers[0].field_1924 = 17;
|
|
308 pParty->pPlayers[0].uVoiceID = 17;
|
|
309 pParty->pPlayers[0].uMight = 30;
|
|
310 pParty->pPlayers[0].uIntelligence = 5;
|
|
311 pParty->pPlayers[0].uWillpower = 5;
|
|
312 pParty->pPlayers[0].uEndurance = 13;
|
|
313 pParty->pPlayers[0].uAccuracy = 13;
|
|
314 pParty->pPlayers[0].uSpeed = 14;
|
|
315 pParty->pPlayers[0].uLuck = 7;
|
|
316 pParty->pPlayers[0].pActiveSkills[9] = 1; // leather
|
|
317 pParty->pPlayers[0].pActiveSkills[33] = 1; // armsmaster
|
|
318 pParty->pPlayers[0].pActiveSkills[5] = 1; // bow
|
|
319 pParty->pPlayers[0].pActiveSkills[1] = 1; // sword
|
|
320 pParty->pPlayers[1].field_1928 = 3;
|
|
321 pParty->pPlayers[1].uFace = 3;
|
|
322 pParty->pPlayers[1].field_1924 = 3;
|
|
323 pParty->pPlayers[1].uVoiceID = 3;
|
|
324 strcpy(pParty->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); //Roderic
|
|
325 pParty->pPlayers[1].uMight = 13;
|
|
326 pParty->pPlayers[1].uIntelligence = 9;
|
|
327 pParty->pPlayers[1].uWillpower = 9;
|
|
328 pParty->pPlayers[1].uEndurance = 13;
|
|
329 pParty->pPlayers[1].uAccuracy = 13;
|
|
330 pParty->pPlayers[1].uSpeed = 13;
|
|
331 pParty->pPlayers[1].uLuck = 13;
|
|
332 pParty->pPlayers[1].pActiveSkills[9] = 1; // leather
|
|
333 pParty->pPlayers[1].pActiveSkills[34] = 1; // stealing
|
|
334 pParty->pPlayers[1].pActiveSkills[2] = 1; // dagger
|
|
335 pParty->pPlayers[1].pActiveSkills[29] = 1; // disarm trap
|
|
336 pParty->pPlayers[2].field_1928 = 14;
|
|
337 pParty->pPlayers[2].uFace = 14;
|
|
338 pParty->pPlayers[2].field_1924 = 14;
|
|
339 pParty->pPlayers[2].uVoiceID = 14;
|
|
340 strcpy(pParty->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); // Serena
|
|
341 pParty->pPlayers[2].uMight = 12;
|
|
342 pParty->pPlayers[2].uIntelligence = 9;
|
|
343 pParty->pPlayers[2].uWillpower = 20;
|
|
344 pParty->pPlayers[2].uEndurance = 22;
|
|
345 pParty->pPlayers[2].uAccuracy = 7;
|
|
346 pParty->pPlayers[2].uSpeed = 13;
|
|
347 pParty->pPlayers[2].uLuck = 7;
|
|
348 pParty->pPlayers[2].pActiveSkills[35] = 1; // alchemy
|
|
349 pParty->pPlayers[2].pActiveSkills[9] = 1; // leather
|
|
350 pParty->pPlayers[2].pActiveSkills[18] = 1; // body
|
|
351 pParty->pPlayers[2].pActiveSkills[6] = 1; // mace
|
|
352 strcpy(pParty->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); // Alexis
|
0
|
353 v3 = 10;
|
54
|
354 pParty->pPlayers[3].field_1928 = 10;
|
|
355 pParty->pPlayers[3].uFace = 10;
|
|
356 pResMagicBase = (int)&pParty->pPlayers[0].sResMagicBase;
|
|
357 pParty->pPlayers[3].uEndurance = 13;
|
|
358 pParty->pPlayers[3].uAccuracy = 13;
|
|
359 pParty->pPlayers[3].uSpeed = 13;
|
|
360 pParty->pPlayers[3].field_1924 = 10;
|
|
361 pParty->pPlayers[3].uVoiceID = 10;
|
|
362 pParty->pPlayers[3].uMight = 5;
|
|
363 pParty->pPlayers[3].uIntelligence = 30;
|
|
364 pParty->pPlayers[3].uWillpower = 9;
|
|
365 pParty->pPlayers[3].uLuck = 7;
|
|
366 pParty->pPlayers[3].pActiveSkills[9] = 1; // leather
|
|
367 pParty->pPlayers[3].pActiveSkills[13] = 1; // air
|
|
368 pParty->pPlayers[3].pActiveSkills[12] = 1; // fire
|
|
369 pParty->pPlayers[3].pActiveSkills[0] = 1; // staff
|
|
370 pCharacter = &pParty->pPlayers[0];
|
151
|
371 //uNumPlayers = 4;
|
|
372 //while ( 1 )
|
|
373 for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++)
|
0
|
374 {
|
54
|
375 if ( !pCharacter->uClass )
|
124
|
376 *(short *)pResMagicBase = v3; //player[i].pResMagicBase
|
54
|
377 uSpellBookPageCount = 0;
|
151
|
378 //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills
|
|
379 //while ( !*(short *)pMagicSkills ) //player[i].skillFire
|
152
|
380 for (int i = 0; i < 9; i++)//for Magic Book
|
0
|
381 {
|
151
|
382 //++uSpellBookPageCount;
|
|
383 //pMagicSkills++;
|
|
384 //if ( uSpellBookPageCount >= 9 )
|
|
385 //goto LABEL_10;
|
|
386 if (pPlayers[uNumPlayers].pActiveSkills[12+i])
|
|
387 ++uSpellBookPageCount;
|
0
|
388 }
|
54
|
389 pCharacter->pNumSpellBookPage = uSpellBookPageCount;
|
151
|
390 //LABEL_10:
|
54
|
391 pCharacter->uExpressionTimePassed = 0;
|
0
|
392 Dst.Reset();
|
|
393 if ( bGiveItems )
|
|
394 {
|
|
395 pItemsTable->GenerateItem(2, 40, &Dst);
|
54
|
396 pCharacter->AddItem2(-1, &Dst);
|
151
|
397 //uSkillIdx = 0;
|
|
398 //v18 = 0;
|
|
399 //do
|
|
400 for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++)
|
0
|
401 {
|
54
|
402 if ( pCharacter->pActiveSkills[uSkillIdx] )
|
0
|
403 {
|
|
404 switch ( uSkillIdx )
|
|
405 {
|
|
406 case PLAYER_SKILL_STAFF:
|
|
407 v15 = ITEM_STAFF_1;
|
|
408 goto wear_item;
|
|
409 case PLAYER_SKILL_SWORD:
|
124
|
410 v15 = ITEM_LONGSWORD_1;
|
0
|
411 goto wear_item;
|
|
412 case PLAYER_SKILL_DAGGER:
|
|
413 v15 = ITEM_DAGGER_1;
|
|
414 goto wear_item;
|
|
415 case PLAYER_SKILL_AXE:
|
|
416 v15 = ITEM_AXE_1;
|
|
417 goto wear_item;
|
|
418 case PLAYER_SKILL_SPEAR:
|
|
419 v15 = ITEM_SPEAR_1;
|
|
420 goto wear_item;
|
|
421 case PLAYER_SKILL_BOW:
|
|
422 v15 = ITEM_CROSSBOW_1;
|
|
423 goto wear_item;
|
|
424 case PLAYER_SKILL_MACE:
|
|
425 v15 = ITEM_MACE_1;
|
|
426 goto wear_item;
|
|
427 case PLAYER_SKILL_SHIELD:
|
|
428 v15 = ITEM_BUCKLER_1;
|
|
429 goto wear_item;
|
|
430 case PLAYER_SKILL_LEATHER:
|
|
431 v15 = ITEM_LEATHER_1;
|
|
432 goto wear_item;
|
|
433 case PLAYER_SKILL_CHAIN:
|
|
434 v15 = ITEM_CHAINMAIL_1;
|
|
435 goto wear_item;
|
|
436 case PLAYER_SKILL_PLATE:
|
|
437 v15 = ITEM_PLATE_1;
|
|
438 wear_item:
|
54
|
439 pCharacter->WearItem(v15);
|
0
|
440 break;
|
|
441 case PLAYER_SKILL_FIRE:
|
|
442 v16 = ITEM_SPELLBOOK_FIRE_STRIKE;
|
|
443 goto add_item;
|
|
444 case PLAYER_SKILL_AIR:
|
|
445 v16 = ITEM_SPELLBOOK_AIR_FEATHER_FALL;
|
|
446 goto add_item;
|
|
447 case PLAYER_SKILL_WATER:
|
|
448 v16 = ITEM_SPELLBOOK_WATER_POISON_SPRAY;
|
|
449 goto add_item;
|
|
450 case PLAYER_SKILL_EARTH:
|
|
451 v16 = ITEM_SPELLBOOK_EARTH_SLOW;
|
|
452 goto add_item;
|
|
453 case PLAYER_SKILL_SPIRIT:
|
|
454 v16 = ITEM_SPELLBOOK_SPIRIT_BLESS;
|
|
455 goto add_item;
|
|
456 case PLAYER_SKILL_MIND:
|
|
457 v16 = ITEM_SPELLBOOK_MIND_MIND_BLAST;
|
|
458 goto add_item;
|
|
459 case PLAYER_SKILL_BODY:
|
|
460 v16 = ITEM_SPELLBOOK_BODY_FIRST_AID;
|
|
461 goto add_item;
|
|
462 case PLAYER_SKILL_ITEM_ID:
|
|
463 case PLAYER_SKILL_REPAIR:
|
|
464 case PLAYER_SKILL_MEDITATION:
|
|
465 case PLAYER_SKILL_PERCEPTION:
|
|
466 case PLAYER_SKILL_DIPLOMACY:
|
|
467 case PLAYER_SKILL_TRAP_DISARM:
|
|
468 case PLAYER_SKILL_LEARNING:
|
54
|
469 pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
|
0
|
470 v16 = 5 * (rand() % 3 + 40); // simple reagent
|
|
471 goto add_item;
|
|
472 case PLAYER_SKILL_DODGE:
|
|
473 v16 = ITEM_BOOTS_1;
|
|
474 goto add_item;
|
|
475 case PLAYER_SKILL_UNARMED:
|
|
476 v16 = ITEM_GAUNTLETS_1;
|
|
477 add_item:
|
54
|
478 pCharacter->AddItem(-1, v16);
|
0
|
479 break;
|
|
480 default:
|
|
481 break;
|
|
482 }
|
|
483 }
|
151
|
484 //uSkillIdx = v18 + 1;
|
139
|
485 //v11 = uSkillIdx > 36;
|
|
486 //v9 = v18 == 35;
|
|
487 //v10 = uSkillIdx - 35 < 0;
|
0
|
488 }
|
151
|
489 //while (uSkillIdx < 36);
|
138
|
490 pAttributes = (char *)&pCharacter->pInventoryItems[0].uAttributes;
|
|
491 //v13 = 138;
|
|
492 for (v13 = 138; v13 > 0; --v13)
|
0
|
493 {
|
138
|
494 if ( *((int *)pAttributes - 5) )
|
|
495 *(int *)pAttributes |= 1;
|
|
496 pAttributes += 36;
|
|
497 //--v13;
|
0
|
498 }
|
138
|
499 //while ( v13 );
|
0
|
500 }
|
54
|
501 pCharacter->sHealth = pCharacter->GetMaxHealth();
|
|
502 pCharacter->sMana = pCharacter->GetMaxMana();
|
|
503 pCharacter++;
|
151
|
504 //uNumPlayers--;
|
|
505 //if (!uNumPlayers)
|
|
506 //break;
|
54
|
507 pResMagicBase = (int)pCharacter;
|
0
|
508 v3 = 10;
|
|
509 }
|
|
510 }
|
|
511
|
|
512 //----- (004917CE) --------------------------------------------------------
|
|
513 int Party::Reset()
|
|
514 {
|
3
|
515 //Party *v1; // esi@1
|
23
|
516 //unsigned __int64 *pTimePlayed; // edi@1
|
|
517 //bool v3; // edx@1
|
|
518 //Player **v4; // eax@1
|
|
519 //Player *v5; // ecx@1
|
25
|
520 PLAYER_SEX v6; // cl@3
|
|
521 PLAYER_SEX v7; // al@6
|
|
522 PLAYER_SEX v8; // al@9
|
|
523 PLAYER_SEX v9; // cl@12
|
26
|
524 //Player *v12; // edx@17
|
|
525 //signed int v13; // edi@18
|
0
|
526 SpellBuff *v14; // ebx@21
|
|
527 signed int v15; // edi@21
|
|
528
|
3
|
529 field_708 = 15;
|
|
530 sEyelevel = 160;
|
|
531 uFlags2 = 0;
|
|
532 uNumGold = 200;
|
|
533 uNumGoldInBank = 0;
|
|
534 uNumFoodRations = 7;
|
|
535 uAlignment = 1;
|
23
|
536
|
|
537 SetUserInterface(uAlignment, true);
|
|
538
|
|
539 uTimePlayed = 0x21C00u;
|
|
540 uLastRegenerationTime = 0x21C00;
|
|
541
|
|
542 bTurnBasedModeOn = false;
|
|
543
|
0
|
544 uActiveCharacter = 1;
|
3
|
545 ::pPlayers[0] = pPlayers;
|
23
|
546 for (uint i = 0; i < 4; ++i)
|
|
547 ::pPlayers[i + 1] = &pPlayers[i];
|
|
548
|
0
|
549 pPlayers[0].Reset(0);
|
41
|
550 pPlayers[1].Reset(4);
|
|
551 pPlayers[2].Reset(24);
|
|
552 pPlayers[3].Reset(32);
|
3
|
553 pPlayers[0].uFace = 17;
|
|
554 pPlayers[0].field_1924 = 17;
|
|
555 pPlayers[0].uVoiceID = 17;
|
|
556 pPlayers[0].SetInitialStats();
|
25
|
557
|
3
|
558 switch ( pPlayers[0].uVoiceID )
|
0
|
559 {
|
|
560 case 0u:
|
|
561 case 1u:
|
|
562 case 2u:
|
|
563 case 3u:
|
|
564 case 8u:
|
|
565 case 9u:
|
|
566 case 0xCu:
|
|
567 case 0xDu:
|
|
568 case 0x10u:
|
|
569 case 0x11u:
|
|
570 case 0x14u:
|
|
571 case 0x17u:
|
25
|
572 default:
|
|
573 v6 = SEX_MALE;
|
0
|
574 break;
|
|
575 case 4u:
|
|
576 case 5u:
|
|
577 case 6u:
|
|
578 case 7u:
|
|
579 case 0xAu:
|
|
580 case 0xBu:
|
|
581 case 0xEu:
|
|
582 case 0xFu:
|
|
583 case 0x12u:
|
|
584 case 0x13u:
|
|
585 case 0x15u:
|
|
586 case 0x18u:
|
25
|
587 v6 = SEX_FEMALE;
|
0
|
588 break;
|
|
589 }
|
3
|
590 pPlayers[0].uSex = v6;
|
|
591 pPlayers[0].RandomizeName();
|
|
592 strcpy(pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]);
|
25
|
593
|
|
594
|
3
|
595 pPlayers[1].uFace = 3;
|
|
596 pPlayers[1].field_1924 = 3;
|
|
597 pPlayers[1].uVoiceID = 3;
|
|
598 pPlayers[1].SetInitialStats();
|
25
|
599 v7 = SEX_MALE;
|
3
|
600 switch (pPlayers[1].uVoiceID)
|
0
|
601 {
|
|
602 case 0u:
|
|
603 case 1u:
|
|
604 case 2u:
|
|
605 case 3u:
|
|
606 case 8u:
|
|
607 case 9u:
|
|
608 case 0xCu:
|
|
609 case 0xDu:
|
|
610 case 0x10u:
|
|
611 case 0x11u:
|
|
612 case 0x14u:
|
|
613 case 0x17u:
|
25
|
614 v7 = SEX_MALE;
|
0
|
615 break;
|
|
616 case 4u:
|
|
617 case 5u:
|
|
618 case 6u:
|
|
619 case 7u:
|
|
620 case 0xAu:
|
|
621 case 0xBu:
|
|
622 case 0xEu:
|
|
623 case 0xFu:
|
|
624 case 0x12u:
|
|
625 case 0x13u:
|
|
626 case 0x15u:
|
|
627 case 0x18u:
|
25
|
628 v7 = SEX_FEMALE;
|
0
|
629 break;
|
|
630 default:
|
|
631 break;
|
|
632 }
|
|
633 pPlayers[1].uSex = v7;
|
|
634 pPlayers[1].RandomizeName();
|
3
|
635 strcpy(pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]);
|
0
|
636 pPlayers[2].uFace = 14;
|
|
637 pPlayers[2].field_1924 = 14;
|
|
638 pPlayers[2].uVoiceID = 14;
|
|
639 pPlayers[2].SetInitialStats();
|
25
|
640 v8 = SEX_MALE;
|
3
|
641 switch (pPlayers[2].uVoiceID)
|
0
|
642 {
|
|
643 case 0u:
|
|
644 case 1u:
|
|
645 case 2u:
|
|
646 case 3u:
|
|
647 case 8u:
|
|
648 case 9u:
|
|
649 case 0xCu:
|
|
650 case 0xDu:
|
|
651 case 0x10u:
|
|
652 case 0x11u:
|
|
653 case 0x14u:
|
|
654 case 0x17u:
|
25
|
655 v8 = SEX_MALE;
|
0
|
656 break;
|
|
657 case 4u:
|
|
658 case 5u:
|
|
659 case 6u:
|
|
660 case 7u:
|
|
661 case 0xAu:
|
|
662 case 0xBu:
|
|
663 case 0xEu:
|
|
664 case 0xFu:
|
|
665 case 0x12u:
|
|
666 case 0x13u:
|
|
667 case 0x15u:
|
|
668 case 0x18u:
|
25
|
669 v8 = SEX_FEMALE;
|
0
|
670 break;
|
|
671 default:
|
|
672 break;
|
|
673 }
|
|
674 pPlayers[2].uSex = v8;
|
|
675 pPlayers[2].RandomizeName();
|
3
|
676 strcpy(pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]);
|
0
|
677 pPlayers[3].uFace = 10;
|
|
678 pPlayers[3].field_1924 = 10;
|
|
679 pPlayers[3].uVoiceID = 10;
|
|
680 pPlayers[3].SetInitialStats();
|
25
|
681 v9 = SEX_MALE;
|
3
|
682 switch (pPlayers[3].uVoiceID)
|
0
|
683 {
|
|
684 case 0u:
|
|
685 case 1u:
|
|
686 case 2u:
|
|
687 case 3u:
|
|
688 case 8u:
|
|
689 case 9u:
|
|
690 case 0xCu:
|
|
691 case 0xDu:
|
|
692 case 0x10u:
|
|
693 case 0x11u:
|
|
694 case 0x14u:
|
|
695 case 0x17u:
|
25
|
696 v9 = SEX_MALE;
|
0
|
697 break;
|
|
698 case 4u:
|
|
699 case 5u:
|
|
700 case 6u:
|
|
701 case 7u:
|
|
702 case 0xAu:
|
|
703 case 0xBu:
|
|
704 case 0xEu:
|
|
705 case 0xFu:
|
|
706 case 0x12u:
|
|
707 case 0x13u:
|
|
708 case 0x15u:
|
|
709 case 0x18u:
|
25
|
710 v9 = SEX_FEMALE;
|
0
|
711 break;
|
|
712 default:
|
|
713 break;
|
|
714 }
|
3
|
715 pPlayers[3].uSex = v9;
|
0
|
716 pPlayers[3].RandomizeName();
|
3
|
717 strcpy(pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]);
|
26
|
718
|
|
719
|
|
720
|
|
721 for (uint i = 0; i < 4; ++i)
|
0
|
722 {
|
26
|
723 pPlayers[i].uTimeToRecovery = 0;
|
|
724 for (uint j = 0; j < 20; ++j)
|
|
725 pPlayers[i].pConditions[j] = 0;
|
|
726
|
|
727 for (uint j = 0; j < 24; ++j)
|
|
728 pPlayers[i].pPlayerBuffs[j].Reset();
|
|
729
|
|
730 pPlayers[i].uExpressionID = 1;
|
|
731 pPlayers[i].uExpressionTimePassed = 0;
|
|
732 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128;
|
0
|
733 }
|
26
|
734
|
|
735 for (uint i = 1; i < 20; ++i)
|
|
736 pPartyBuffs[i].Reset();
|
|
737
|
|
738
|
0
|
739 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
|
3
|
740 uFlags = 0;
|
26
|
741
|
|
742 memset(_award_bits, 0, 64);
|
|
743 _449B7E_toggle_bit(_award_bits, 1, 1);
|
|
744 _449B7E_toggle_bit(_award_bits, 2, 1);
|
|
745 _449B7E_toggle_bit(_award_bits, 3, 1);
|
|
746 _449B7E_toggle_bit(_award_bits, 4, 1);
|
|
747 _449B7E_toggle_bit(_award_bits, 5, 1);
|
|
748 _449B7E_toggle_bit(_award_bits, 6, 1);
|
|
749
|
|
750
|
0
|
751 memcpy(pNPCStats->pNewNPCData, &pNPCStats, 0x94BCu);
|
|
752 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
|
|
753 pNPCStats->pNewNPCData[3].uFlags |= 0x80u;
|
|
754 _494035_timed_effects__water_walking_damage__etc();
|
|
755 pEventTimer->Pause();
|
|
756 return 0;
|
|
757 }
|
|
758
|
|
759
|
|
760
|
|
761 //----- (0043AD34) --------------------------------------------------------
|
|
762 void Party::Yell()
|
|
763 {
|
|
764 void *v0; // esi@5
|
|
765 int v1; // edi@9
|
|
766 int v2; // ebx@9
|
|
767 int v3; // eax@9
|
|
768 unsigned int v4; // [sp+8h] [bp-4h]@4
|
|
769
|
|
770 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 )
|
|
771 pParty->pPartyBuffs[11].Reset();
|
|
772 if ( pParty->bTurnBasedModeOn != 1 )
|
|
773 {
|
|
774 v4 = 0;
|
|
775 if ( (signed int)uNumActors > 0 )
|
|
776 {
|
|
777 v0 = &pActors[0].pMonsterInfo.uMovementType;
|
|
778 do
|
|
779 {
|
|
780 if ( ((Actor *)((char *)v0 - 59))->Actor::CanAct() && *((char *)v0 + 2) != 4 && *(char *)v0 != 5 )
|
|
781 {
|
|
782 v1 = abs(*(short *)((char *)v0 + 83) - pParty->vPosition.x);
|
58
|
783 v2 = abs(*(short *)((char *)v0 + 85) - pParty->vPosition.y);
|
|
784 v3 = abs(*(short *)((char *)v0 + 87) - pParty->vPosition.z);
|
0
|
785 if ( (double)sub_4621DA(v1, v2, v3) < 512.0 )
|
|
786 Actor::_402968(v4, 4, 0, 0);
|
|
787 }
|
|
788 ++v4;
|
|
789 v0 = (char *)v0 + 836;
|
|
790 }
|
|
791 while ( (signed int)v4 < (signed int)uNumActors );
|
|
792 }
|
|
793 }
|
|
794 }
|
|
795
|
|
796 //----- (00491BF9) --------------------------------------------------------
|
|
797 void Party::ResetPosMiscAndSpellBuffs()
|
|
798 {
|
|
799 Party *v1; // esi@1
|
|
800 char *v2; // edi@1
|
|
801 SpellBuff *v3; // ebx@2
|
|
802 SpellBuff *v4; // esi@5
|
|
803 signed int v5; // edi@5
|
|
804 signed int v6; // [sp+8h] [bp-8h]@1
|
|
805 signed int v7; // [sp+Ch] [bp-4h]@2
|
|
806
|
|
807 v1 = this;
|
|
808 this->vPosition.y = 0;
|
|
809 this->vPosition.z = 0;
|
|
810 this->vPosition.x = 0;
|
|
811 this->uFallStartY = 0;
|
|
812 this->sRotationY = 0;
|
|
813 this->sRotationX = 0;
|
|
814 this->uFallSpeed = 0;
|
|
815 this->field_28 = 0;
|
|
816 this->uDefaultPartyHeight = 120;
|
|
817 this->field_14 = 37;
|
|
818 this->field_18 = 25;
|
|
819 this->uWalkSpeed = 384;
|
|
820 this->field_20_prolly_turn_speed = 90;
|
|
821 this->field_24 = 5;
|
|
822 this->field_6FC = 0;
|
|
823 this->field_708 = 15;
|
|
824 this->field_0 = 25;
|
|
825 v2 = (char *)this->pPlayers[0].pPlayerBuffs;
|
|
826 v6 = 4;
|
|
827 do
|
|
828 {
|
|
829 v3 = (SpellBuff *)v2;
|
|
830 v7 = 24;
|
|
831 do
|
|
832 {
|
|
833 v3->Reset();
|
|
834 ++v3;
|
|
835 --v7;
|
|
836 }
|
|
837 while ( v7 );
|
|
838 v2 += 6972;
|
|
839 --v6;
|
|
840 }
|
|
841 while ( v6 );
|
|
842 v4 = v1->pPartyBuffs;
|
|
843 v5 = 20;
|
|
844 do
|
|
845 {
|
|
846 v4->Reset();
|
|
847 ++v4;
|
|
848 --v5;
|
|
849 }
|
|
850 while ( v5 );
|
|
851 }
|
|
852
|
|
853 //----- (004909F4) --------------------------------------------------------
|
|
854 void Party::_4909F4()
|
|
855 {
|
|
856 char *v1; // esi@2
|
|
857 unsigned int v2; // eax@3
|
|
858 __int16 v3; // cx@5
|
|
859 int v4; // edx@27
|
|
860 signed int v5; // eax@52
|
|
861 PlayerFrame *v6; // edx@53
|
|
862 char *v7; // esi@60
|
|
863 signed int v8; // ebp@61
|
|
864 int v9; // ebx@62
|
|
865 unsigned int v10; // edi@62
|
|
866 signed int v11; // [sp+0h] [bp-4h]@2
|
|
867
|
|
868 if ( dword_A75070 != stru_51076C.field_8 )
|
|
869 {
|
|
870 dword_A75070 = stru_51076C.field_8;
|
|
871 v1 = (char *)&this->pPlayers[0].uExpressionID;
|
|
872 v11 = 4;
|
|
873 do
|
|
874 {
|
23
|
875 v2 = ((Player *)(v1 - 6812))->GetMajorConditionIdx();
|
0
|
876 if ( v2 == 18 || v2 == 17 )
|
|
877 {
|
|
878 *((short *)v1 + 1) += LOWORD(pMiscTimer->uTimeElapsed);
|
|
879 if ( *((short *)v1 + 1) >= *((short *)v1 + 2) )
|
|
880 {
|
|
881 if ( *(short *)v1 != 1 || rand() % 5 )
|
|
882 {
|
|
883 *((short *)v1 + 1) = 0;
|
|
884 *(short *)v1 = 1;
|
|
885 *((short *)v1 + 2) = rand() % 256 + 32;
|
|
886 }
|
|
887 else
|
|
888 {
|
|
889 v4 = rand() % 100;
|
|
890 if ( v4 >= 25 )
|
|
891 {
|
|
892 if ( v4 >= 31 )
|
|
893 {
|
|
894 if ( v4 >= 37 )
|
|
895 {
|
|
896 if ( v4 >= 43 )
|
|
897 {
|
|
898 if ( v4 >= 46 )
|
|
899 {
|
|
900 if ( v4 >= 52 )
|
|
901 {
|
|
902 if ( v4 >= 58 )
|
|
903 {
|
|
904 if ( v4 >= 64 )
|
|
905 {
|
|
906 if ( v4 >= 70 )
|
|
907 {
|
|
908 if ( v4 >= 76 )
|
|
909 {
|
|
910 if ( v4 >= 82 )
|
|
911 {
|
|
912 if ( v4 >= 88 )
|
|
913 *(short *)v1 = (v4 >= 94) + 29;
|
|
914 else
|
|
915 *(short *)v1 = 57;
|
|
916 }
|
|
917 else
|
|
918 {
|
|
919 *(short *)v1 = 56;
|
|
920 }
|
|
921 }
|
|
922 else
|
|
923 {
|
|
924 *(short *)v1 = 55;
|
|
925 }
|
|
926 }
|
|
927 else
|
|
928 {
|
|
929 *(short *)v1 = 54;
|
|
930 }
|
|
931 }
|
|
932 else
|
|
933 {
|
|
934 *(short *)v1 = 20;
|
|
935 }
|
|
936 }
|
|
937 else
|
|
938 {
|
|
939 *(short *)v1 = 19;
|
|
940 }
|
|
941 }
|
|
942 else
|
|
943 {
|
|
944 *(short *)v1 = 18;
|
|
945 }
|
|
946 }
|
|
947 else
|
|
948 {
|
|
949 *(short *)v1 = 17;
|
|
950 }
|
|
951 }
|
|
952 else
|
|
953 {
|
|
954 *(short *)v1 = 16;
|
|
955 }
|
|
956 }
|
|
957 else
|
|
958 {
|
|
959 *(short *)v1 = 15;
|
|
960 }
|
|
961 }
|
|
962 else
|
|
963 {
|
|
964 *(short *)v1 = 14;
|
|
965 }
|
|
966 }
|
|
967 else
|
|
968 {
|
|
969 *(short *)v1 = 13;
|
|
970 }
|
|
971 v5 = 0;
|
|
972 *((short *)v1 + 1) = 0;
|
|
973 if ( (signed int)pPlayerFrameTable->uNumFrames <= 0 )
|
|
974 {
|
|
975 LABEL_56:
|
|
976 v5 = 0;
|
|
977 }
|
|
978 else
|
|
979 {
|
|
980 v6 = pPlayerFrameTable->pFrames;
|
|
981 while ( v6->uSequenceID != *(short *)v1 )
|
|
982 {
|
|
983 ++v5;
|
|
984 ++v6;
|
|
985 if ( v5 >= (signed int)pPlayerFrameTable->uNumFrames )
|
|
986 goto LABEL_56;
|
|
987 }
|
|
988 }
|
|
989 *((short *)v1 + 2) = 8 * pPlayerFrameTable->pFrames[v5].uAnimLength;
|
|
990 }
|
|
991 }
|
|
992 }
|
|
993 else
|
|
994 {
|
|
995 v3 = *(short *)v1;
|
|
996 if ( *(short *)v1 != 34 && v3 != 35 && v3 != 36
|
|
997 || (signed int)(pMiscTimer->uTimeElapsed + *((short *)v1 + 1)) >= *((short *)v1 + 2) )
|
|
998 {
|
|
999 *((short *)v1 + 2) = 0;
|
|
1000 *((short *)v1 + 1) = 0;
|
|
1001 switch ( v2 )
|
|
1002 {
|
|
1003 case 0xEu:
|
|
1004 *(short *)v1 = 98;
|
|
1005 break;
|
|
1006 case 0xFu:
|
|
1007 *(short *)v1 = 12;
|
|
1008 break;
|
|
1009 case 0x10u:
|
|
1010 *(short *)v1 = 99;
|
|
1011 break;
|
|
1012 case 0u:
|
|
1013 *(short *)v1 = 2;
|
|
1014 break;
|
|
1015 case 1u:
|
|
1016 *(short *)v1 = 3;
|
|
1017 break;
|
|
1018 case 2u:
|
|
1019 *(short *)v1 = 4;
|
|
1020 break;
|
|
1021 case 3u:
|
|
1022 *(short *)v1 = 5;
|
|
1023 break;
|
|
1024 case 4u:
|
|
1025 *(short *)v1 = 6;
|
|
1026 break;
|
|
1027 case 5u:
|
|
1028 *(short *)v1 = 7;
|
|
1029 break;
|
|
1030 case 6u:
|
|
1031 case 8u:
|
|
1032 case 0xAu:
|
|
1033 *(short *)v1 = 8;
|
|
1034 break;
|
|
1035 case 7u:
|
|
1036 case 9u:
|
|
1037 case 0xBu:
|
|
1038 *(short *)v1 = 9;
|
|
1039 break;
|
|
1040 case 0xCu:
|
|
1041 *(short *)v1 = 10;
|
|
1042 break;
|
|
1043 case 0xDu:
|
|
1044 *(short *)v1 = 11;
|
|
1045 break;
|
|
1046 default:
|
|
1047 break;
|
|
1048 }
|
|
1049 }
|
|
1050 else
|
|
1051 {
|
|
1052 *((short *)v1 + 1) += LOWORD(pMiscTimer->uTimeElapsed);
|
|
1053 }
|
|
1054 }
|
|
1055 v1 += 6972;
|
|
1056 --v11;
|
|
1057 }
|
|
1058 while ( v11 );
|
|
1059 v7 = (char *)&pParty->pHirelings[0].evtb;
|
|
1060 do
|
|
1061 {
|
|
1062 v8 = *((int *)v7 + 1);
|
|
1063 if ( v8 )
|
|
1064 {
|
|
1065 v9 = *((int *)v7 - 1);
|
|
1066 v10 = pMiscTimer->uTimeElapsed + *(int *)v7;
|
|
1067 if ( (signed int)v10 >= v8 )
|
|
1068 {
|
|
1069 v9 = 0;
|
|
1070 v8 = 0;
|
|
1071 v10 = 0;
|
|
1072 memset(v7 - 44, 0, 0x4Cu);
|
|
1073 pParty->field_709 = 0;
|
|
1074 sub_44A56A();
|
|
1075 viewparams->bRedrawGameUI = 1;
|
|
1076 }
|
|
1077 *(int *)v7 = v10;
|
|
1078 *((int *)v7 + 1) = v8;
|
|
1079 *((int *)v7 - 1) = v9;
|
|
1080 }
|
|
1081 v7 += 76;
|
|
1082 }
|
|
1083 while ( (signed int)v7 < (signed int)&pParty->field_777C[1] );
|
|
1084 }
|
|
1085 }
|
|
1086 // A75070: using guessed type int dword_A75070;
|
|
1087
|
|
1088 //----- (00490D02) --------------------------------------------------------
|
|
1089 void Party::RestAndHeal()
|
|
1090 {
|
|
1091 SpellBuff *v1; // esi@1
|
|
1092 Player *v2; // esi@4
|
|
1093 signed int v3; // ebx@4
|
|
1094 SpellBuff *v4; // edi@4
|
|
1095 int v5; // eax@9
|
|
1096 char v6; // zf@9
|
|
1097 char *v7; // eax@10
|
|
1098 signed int v8; // ecx@10
|
|
1099 int v9; // eax@18
|
|
1100 int v10; // eax@25
|
|
1101 signed int v11; // ecx@26
|
|
1102 signed int v12; // [sp-4h] [bp-1Ch]@26
|
|
1103 Party *v13; // [sp+Ch] [bp-Ch]@1
|
|
1104 signed int v14; // [sp+10h] [bp-8h]@10
|
|
1105 signed int v15; // [sp+14h] [bp-4h]@3
|
|
1106
|
|
1107 v13 = this;
|
|
1108 v1 = pParty->pPartyBuffs;
|
|
1109 do
|
|
1110 {
|
|
1111 v1->Reset();
|
|
1112 ++v1;
|
|
1113 }
|
|
1114 while ( (signed int)v1 < (signed int)pParty->pPlayers );
|
|
1115 v15 = 0;
|
|
1116 do
|
|
1117 {
|
|
1118 v2 = &pParty->pPlayers[v15];
|
|
1119 v3 = 20;
|
|
1120 v4 = v2->pPlayerBuffs;
|
|
1121 do
|
|
1122 {
|
|
1123 v4->Reset();
|
|
1124 ++v4;
|
|
1125 --v3;
|
|
1126 }
|
|
1127 while ( v3 );
|
|
1128 v2->Zero();
|
|
1129 if ( v2->pConditions[14] || v2->pConditions[15] || v2->pConditions[16] )
|
|
1130 goto LABEL_33;
|
|
1131 LODWORD(v2->pConditions[13]) = 0;
|
|
1132 HIDWORD(v2->pConditions[13]) = 0;
|
|
1133 LODWORD(v2->pConditions[4]) = 0;
|
|
1134 HIDWORD(v2->pConditions[4]) = 0;
|
|
1135 LODWORD(v2->pConditions[2]) = 0;
|
|
1136 HIDWORD(v2->pConditions[2]) = 0;
|
|
1137 LODWORD(v2->pConditions[3]) = 0;
|
|
1138 HIDWORD(v2->pConditions[3]) = 0;
|
|
1139 LODWORD(v2->pConditions[1]) = 0;
|
|
1140 HIDWORD(v2->pConditions[1]) = 0;
|
|
1141 v2->uTimeToRecovery = 0;
|
|
1142 v2->sHealth = v2->GetMaxHealth();
|
|
1143 v5 = v2->GetMaxMana();
|
|
1144 v6 = v2->uClass == 35;
|
|
1145 v2->sMana = v5;
|
|
1146 if ( v6 )
|
|
1147 {
|
|
1148 v14 = 0;
|
|
1149 v7 = &v2->pInventoryItems[0].field_1A;
|
|
1150 v8 = 138;
|
|
1151 do
|
|
1152 {
|
|
1153 if ( *(int *)(v7 - 26) == 601 && (unsigned __int8)*v7 == v15 + 1 )
|
|
1154 v14 = 1;
|
|
1155 v7 += 36;
|
|
1156 --v8;
|
|
1157 }
|
|
1158 while ( v8 );
|
|
1159 if ( !v14 )
|
|
1160 {
|
|
1161 v2->sHealth = v2->GetMaxHealth() / 2;
|
|
1162 v2->sMana = v2->GetMaxMana() / 2;
|
|
1163 }
|
|
1164 }
|
|
1165 if ( !v2->pConditions[17] )
|
|
1166 {
|
|
1167 if ( v2->pConditions[10] || v2->pConditions[11] )
|
|
1168 {
|
|
1169 v11 = 4;
|
|
1170 v12 = 4;
|
|
1171 }
|
|
1172 else
|
|
1173 {
|
|
1174 if ( !v2->pConditions[8] && !v2->pConditions[9] )
|
|
1175 {
|
|
1176 if ( !v2->pConditions[6] && !v2->pConditions[7] )
|
|
1177 goto LABEL_30;
|
|
1178 v2->sHealth /= 2;
|
|
1179 v10 = v2->sMana / 2;
|
|
1180 goto LABEL_29;
|
|
1181 }
|
|
1182 v11 = 3;
|
|
1183 v12 = 3;
|
|
1184 }
|
|
1185 v2->sHealth /= v11;
|
|
1186 v10 = v2->sMana / v12;
|
|
1187 LABEL_29:
|
|
1188 v2->sMana = v10;
|
|
1189 goto LABEL_30;
|
|
1190 }
|
|
1191 v9 = v2->sHealth;
|
|
1192 v2->sMana = 0;
|
|
1193 v2->sHealth = v9 / 2;
|
|
1194 LABEL_30:
|
|
1195 if ( v2->pConditions[5] )
|
|
1196 v2->sMana = 0;
|
|
1197 _4909F4();
|
|
1198 LABEL_33:
|
|
1199 ++v15;
|
|
1200 }
|
|
1201 while ( v15 < 4 );
|
|
1202 pParty->field_764 = 0;
|
|
1203 } |