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
|
0
|
288 int v7; // eax@5
|
|
289 int uSkillIdx; // eax@11
|
|
290 unsigned __int8 v9; // zf@37
|
|
291 char v10; // sf@37
|
|
292 unsigned __int8 v11; // of@37
|
|
293 char *v12; // eax@38
|
|
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];
|
|
371 uNumPlayers = 4;
|
0
|
372 while ( 1 )
|
|
373 {
|
54
|
374 if ( !pCharacter->uClass )
|
124
|
375 *(short *)pResMagicBase = v3; //player[i].pResMagicBase
|
54
|
376 uSpellBookPageCount = 0;
|
|
377 v7 = pResMagicBase - 5726;// Skills
|
124
|
378 while ( !*(short *)v7 ) //player[i].skillFire or
|
|
379 //player[i].pActiveSkills[12]
|
0
|
380 {
|
54
|
381 ++uSpellBookPageCount;
|
0
|
382 v7 += 2;
|
54
|
383 if ( uSpellBookPageCount >= 9 )
|
0
|
384 goto LABEL_10;
|
|
385 }
|
54
|
386 pCharacter->pNumSpellBookPage = uSpellBookPageCount;
|
0
|
387 LABEL_10:
|
54
|
388 pCharacter->uExpressionTimePassed = 0;
|
0
|
389 Dst.Reset();
|
|
390 if ( bGiveItems )
|
|
391 {
|
|
392 pItemsTable->GenerateItem(2, 40, &Dst);
|
54
|
393 pCharacter->AddItem2(-1, &Dst);
|
0
|
394 uSkillIdx = 0;
|
|
395 v18 = 0;
|
|
396 do
|
|
397 {
|
54
|
398 if ( pCharacter->pActiveSkills[uSkillIdx] )
|
0
|
399 {
|
|
400 switch ( uSkillIdx )
|
|
401 {
|
|
402 case PLAYER_SKILL_STAFF:
|
|
403 v15 = ITEM_STAFF_1;
|
|
404 goto wear_item;
|
|
405 case PLAYER_SKILL_SWORD:
|
124
|
406 v15 = ITEM_LONGSWORD_1;
|
0
|
407 goto wear_item;
|
|
408 case PLAYER_SKILL_DAGGER:
|
|
409 v15 = ITEM_DAGGER_1;
|
|
410 goto wear_item;
|
|
411 case PLAYER_SKILL_AXE:
|
|
412 v15 = ITEM_AXE_1;
|
|
413 goto wear_item;
|
|
414 case PLAYER_SKILL_SPEAR:
|
|
415 v15 = ITEM_SPEAR_1;
|
|
416 goto wear_item;
|
|
417 case PLAYER_SKILL_BOW:
|
|
418 v15 = ITEM_CROSSBOW_1;
|
|
419 goto wear_item;
|
|
420 case PLAYER_SKILL_MACE:
|
|
421 v15 = ITEM_MACE_1;
|
|
422 goto wear_item;
|
|
423 case PLAYER_SKILL_SHIELD:
|
|
424 v15 = ITEM_BUCKLER_1;
|
|
425 goto wear_item;
|
|
426 case PLAYER_SKILL_LEATHER:
|
|
427 v15 = ITEM_LEATHER_1;
|
|
428 goto wear_item;
|
|
429 case PLAYER_SKILL_CHAIN:
|
|
430 v15 = ITEM_CHAINMAIL_1;
|
|
431 goto wear_item;
|
|
432 case PLAYER_SKILL_PLATE:
|
|
433 v15 = ITEM_PLATE_1;
|
|
434 wear_item:
|
54
|
435 pCharacter->WearItem(v15);
|
0
|
436 break;
|
|
437 case PLAYER_SKILL_FIRE:
|
|
438 v16 = ITEM_SPELLBOOK_FIRE_STRIKE;
|
|
439 goto add_item;
|
|
440 case PLAYER_SKILL_AIR:
|
|
441 v16 = ITEM_SPELLBOOK_AIR_FEATHER_FALL;
|
|
442 goto add_item;
|
|
443 case PLAYER_SKILL_WATER:
|
|
444 v16 = ITEM_SPELLBOOK_WATER_POISON_SPRAY;
|
|
445 goto add_item;
|
|
446 case PLAYER_SKILL_EARTH:
|
|
447 v16 = ITEM_SPELLBOOK_EARTH_SLOW;
|
|
448 goto add_item;
|
|
449 case PLAYER_SKILL_SPIRIT:
|
|
450 v16 = ITEM_SPELLBOOK_SPIRIT_BLESS;
|
|
451 goto add_item;
|
|
452 case PLAYER_SKILL_MIND:
|
|
453 v16 = ITEM_SPELLBOOK_MIND_MIND_BLAST;
|
|
454 goto add_item;
|
|
455 case PLAYER_SKILL_BODY:
|
|
456 v16 = ITEM_SPELLBOOK_BODY_FIRST_AID;
|
|
457 goto add_item;
|
|
458 case PLAYER_SKILL_ITEM_ID:
|
|
459 case PLAYER_SKILL_REPAIR:
|
|
460 case PLAYER_SKILL_MEDITATION:
|
|
461 case PLAYER_SKILL_PERCEPTION:
|
|
462 case PLAYER_SKILL_DIPLOMACY:
|
|
463 case PLAYER_SKILL_TRAP_DISARM:
|
|
464 case PLAYER_SKILL_LEARNING:
|
54
|
465 pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
|
0
|
466 v16 = 5 * (rand() % 3 + 40); // simple reagent
|
|
467 goto add_item;
|
|
468 case PLAYER_SKILL_DODGE:
|
|
469 v16 = ITEM_BOOTS_1;
|
|
470 goto add_item;
|
|
471 case PLAYER_SKILL_UNARMED:
|
|
472 v16 = ITEM_GAUNTLETS_1;
|
|
473 add_item:
|
54
|
474 pCharacter->AddItem(-1, v16);
|
0
|
475 break;
|
|
476 default:
|
|
477 break;
|
|
478 }
|
|
479 }
|
|
480 uSkillIdx = v18 + 1;
|
|
481 v11 = __OFSUB__(v18 + 1, 36);
|
|
482 v9 = v18 == 35;
|
|
483 v10 = v18++ - 35 < 0;
|
|
484 }
|
|
485 while ( (unsigned __int8)(v10 ^ v11) | v9 );
|
54
|
486 v12 = (char *)&pCharacter->pInventoryItems[0].uAttributes;
|
0
|
487 v13 = 138;
|
|
488 do
|
|
489 {
|
|
490 if ( *((int *)v12 - 5) )
|
|
491 *(int *)v12 |= 1u;
|
|
492 v12 += 36;
|
|
493 --v13;
|
|
494 }
|
|
495 while ( v13 );
|
|
496 }
|
54
|
497 pCharacter->sHealth = pCharacter->GetMaxHealth();
|
|
498 pCharacter->sMana = pCharacter->GetMaxMana();
|
|
499 pCharacter++;
|
|
500 v9 = uNumPlayers-- == 1;
|
0
|
501 if ( v9 )
|
|
502 break;
|
54
|
503 pResMagicBase = (int)pCharacter;
|
0
|
504 v3 = 10;
|
|
505 }
|
|
506 }
|
|
507
|
|
508 //----- (004917CE) --------------------------------------------------------
|
|
509 int Party::Reset()
|
|
510 {
|
3
|
511 //Party *v1; // esi@1
|
23
|
512 //unsigned __int64 *pTimePlayed; // edi@1
|
|
513 //bool v3; // edx@1
|
|
514 //Player **v4; // eax@1
|
|
515 //Player *v5; // ecx@1
|
25
|
516 PLAYER_SEX v6; // cl@3
|
|
517 PLAYER_SEX v7; // al@6
|
|
518 PLAYER_SEX v8; // al@9
|
|
519 PLAYER_SEX v9; // cl@12
|
26
|
520 //Player *v12; // edx@17
|
|
521 //signed int v13; // edi@18
|
0
|
522 SpellBuff *v14; // ebx@21
|
|
523 signed int v15; // edi@21
|
|
524
|
3
|
525 field_708 = 15;
|
|
526 sEyelevel = 160;
|
|
527 uFlags2 = 0;
|
|
528 uNumGold = 200;
|
|
529 uNumGoldInBank = 0;
|
|
530 uNumFoodRations = 7;
|
|
531 uAlignment = 1;
|
23
|
532
|
|
533 SetUserInterface(uAlignment, true);
|
|
534
|
|
535 uTimePlayed = 0x21C00u;
|
|
536 uLastRegenerationTime = 0x21C00;
|
|
537
|
|
538 bTurnBasedModeOn = false;
|
|
539
|
0
|
540 uActiveCharacter = 1;
|
3
|
541 ::pPlayers[0] = pPlayers;
|
23
|
542 for (uint i = 0; i < 4; ++i)
|
|
543 ::pPlayers[i + 1] = &pPlayers[i];
|
|
544
|
0
|
545 pPlayers[0].Reset(0);
|
41
|
546 pPlayers[1].Reset(4);
|
|
547 pPlayers[2].Reset(24);
|
|
548 pPlayers[3].Reset(32);
|
3
|
549 pPlayers[0].uFace = 17;
|
|
550 pPlayers[0].field_1924 = 17;
|
|
551 pPlayers[0].uVoiceID = 17;
|
|
552 pPlayers[0].SetInitialStats();
|
25
|
553
|
3
|
554 switch ( pPlayers[0].uVoiceID )
|
0
|
555 {
|
|
556 case 0u:
|
|
557 case 1u:
|
|
558 case 2u:
|
|
559 case 3u:
|
|
560 case 8u:
|
|
561 case 9u:
|
|
562 case 0xCu:
|
|
563 case 0xDu:
|
|
564 case 0x10u:
|
|
565 case 0x11u:
|
|
566 case 0x14u:
|
|
567 case 0x17u:
|
25
|
568 default:
|
|
569 v6 = SEX_MALE;
|
0
|
570 break;
|
|
571 case 4u:
|
|
572 case 5u:
|
|
573 case 6u:
|
|
574 case 7u:
|
|
575 case 0xAu:
|
|
576 case 0xBu:
|
|
577 case 0xEu:
|
|
578 case 0xFu:
|
|
579 case 0x12u:
|
|
580 case 0x13u:
|
|
581 case 0x15u:
|
|
582 case 0x18u:
|
25
|
583 v6 = SEX_FEMALE;
|
0
|
584 break;
|
|
585 }
|
3
|
586 pPlayers[0].uSex = v6;
|
|
587 pPlayers[0].RandomizeName();
|
|
588 strcpy(pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]);
|
25
|
589
|
|
590
|
3
|
591 pPlayers[1].uFace = 3;
|
|
592 pPlayers[1].field_1924 = 3;
|
|
593 pPlayers[1].uVoiceID = 3;
|
|
594 pPlayers[1].SetInitialStats();
|
25
|
595 v7 = SEX_MALE;
|
3
|
596 switch (pPlayers[1].uVoiceID)
|
0
|
597 {
|
|
598 case 0u:
|
|
599 case 1u:
|
|
600 case 2u:
|
|
601 case 3u:
|
|
602 case 8u:
|
|
603 case 9u:
|
|
604 case 0xCu:
|
|
605 case 0xDu:
|
|
606 case 0x10u:
|
|
607 case 0x11u:
|
|
608 case 0x14u:
|
|
609 case 0x17u:
|
25
|
610 v7 = SEX_MALE;
|
0
|
611 break;
|
|
612 case 4u:
|
|
613 case 5u:
|
|
614 case 6u:
|
|
615 case 7u:
|
|
616 case 0xAu:
|
|
617 case 0xBu:
|
|
618 case 0xEu:
|
|
619 case 0xFu:
|
|
620 case 0x12u:
|
|
621 case 0x13u:
|
|
622 case 0x15u:
|
|
623 case 0x18u:
|
25
|
624 v7 = SEX_FEMALE;
|
0
|
625 break;
|
|
626 default:
|
|
627 break;
|
|
628 }
|
|
629 pPlayers[1].uSex = v7;
|
|
630 pPlayers[1].RandomizeName();
|
3
|
631 strcpy(pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]);
|
0
|
632 pPlayers[2].uFace = 14;
|
|
633 pPlayers[2].field_1924 = 14;
|
|
634 pPlayers[2].uVoiceID = 14;
|
|
635 pPlayers[2].SetInitialStats();
|
25
|
636 v8 = SEX_MALE;
|
3
|
637 switch (pPlayers[2].uVoiceID)
|
0
|
638 {
|
|
639 case 0u:
|
|
640 case 1u:
|
|
641 case 2u:
|
|
642 case 3u:
|
|
643 case 8u:
|
|
644 case 9u:
|
|
645 case 0xCu:
|
|
646 case 0xDu:
|
|
647 case 0x10u:
|
|
648 case 0x11u:
|
|
649 case 0x14u:
|
|
650 case 0x17u:
|
25
|
651 v8 = SEX_MALE;
|
0
|
652 break;
|
|
653 case 4u:
|
|
654 case 5u:
|
|
655 case 6u:
|
|
656 case 7u:
|
|
657 case 0xAu:
|
|
658 case 0xBu:
|
|
659 case 0xEu:
|
|
660 case 0xFu:
|
|
661 case 0x12u:
|
|
662 case 0x13u:
|
|
663 case 0x15u:
|
|
664 case 0x18u:
|
25
|
665 v8 = SEX_FEMALE;
|
0
|
666 break;
|
|
667 default:
|
|
668 break;
|
|
669 }
|
|
670 pPlayers[2].uSex = v8;
|
|
671 pPlayers[2].RandomizeName();
|
3
|
672 strcpy(pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]);
|
0
|
673 pPlayers[3].uFace = 10;
|
|
674 pPlayers[3].field_1924 = 10;
|
|
675 pPlayers[3].uVoiceID = 10;
|
|
676 pPlayers[3].SetInitialStats();
|
25
|
677 v9 = SEX_MALE;
|
3
|
678 switch (pPlayers[3].uVoiceID)
|
0
|
679 {
|
|
680 case 0u:
|
|
681 case 1u:
|
|
682 case 2u:
|
|
683 case 3u:
|
|
684 case 8u:
|
|
685 case 9u:
|
|
686 case 0xCu:
|
|
687 case 0xDu:
|
|
688 case 0x10u:
|
|
689 case 0x11u:
|
|
690 case 0x14u:
|
|
691 case 0x17u:
|
25
|
692 v9 = SEX_MALE;
|
0
|
693 break;
|
|
694 case 4u:
|
|
695 case 5u:
|
|
696 case 6u:
|
|
697 case 7u:
|
|
698 case 0xAu:
|
|
699 case 0xBu:
|
|
700 case 0xEu:
|
|
701 case 0xFu:
|
|
702 case 0x12u:
|
|
703 case 0x13u:
|
|
704 case 0x15u:
|
|
705 case 0x18u:
|
25
|
706 v9 = SEX_FEMALE;
|
0
|
707 break;
|
|
708 default:
|
|
709 break;
|
|
710 }
|
3
|
711 pPlayers[3].uSex = v9;
|
0
|
712 pPlayers[3].RandomizeName();
|
3
|
713 strcpy(pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]);
|
26
|
714
|
|
715
|
|
716
|
|
717 for (uint i = 0; i < 4; ++i)
|
0
|
718 {
|
26
|
719 pPlayers[i].uTimeToRecovery = 0;
|
|
720 for (uint j = 0; j < 20; ++j)
|
|
721 pPlayers[i].pConditions[j] = 0;
|
|
722
|
|
723 for (uint j = 0; j < 24; ++j)
|
|
724 pPlayers[i].pPlayerBuffs[j].Reset();
|
|
725
|
|
726 pPlayers[i].uExpressionID = 1;
|
|
727 pPlayers[i].uExpressionTimePassed = 0;
|
|
728 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128;
|
0
|
729 }
|
26
|
730
|
|
731 for (uint i = 1; i < 20; ++i)
|
|
732 pPartyBuffs[i].Reset();
|
|
733
|
|
734
|
0
|
735 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
|
3
|
736 uFlags = 0;
|
26
|
737
|
|
738 memset(_award_bits, 0, 64);
|
|
739 _449B7E_toggle_bit(_award_bits, 1, 1);
|
|
740 _449B7E_toggle_bit(_award_bits, 2, 1);
|
|
741 _449B7E_toggle_bit(_award_bits, 3, 1);
|
|
742 _449B7E_toggle_bit(_award_bits, 4, 1);
|
|
743 _449B7E_toggle_bit(_award_bits, 5, 1);
|
|
744 _449B7E_toggle_bit(_award_bits, 6, 1);
|
|
745
|
|
746
|
0
|
747 memcpy(pNPCStats->pNewNPCData, &pNPCStats, 0x94BCu);
|
|
748 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
|
|
749 pNPCStats->pNewNPCData[3].uFlags |= 0x80u;
|
|
750 _494035_timed_effects__water_walking_damage__etc();
|
|
751 pEventTimer->Pause();
|
|
752 return 0;
|
|
753 }
|
|
754
|
|
755
|
|
756
|
|
757 //----- (0043AD34) --------------------------------------------------------
|
|
758 void Party::Yell()
|
|
759 {
|
|
760 void *v0; // esi@5
|
|
761 int v1; // edi@9
|
|
762 int v2; // ebx@9
|
|
763 int v3; // eax@9
|
|
764 unsigned int v4; // [sp+8h] [bp-4h]@4
|
|
765
|
|
766 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 )
|
|
767 pParty->pPartyBuffs[11].Reset();
|
|
768 if ( pParty->bTurnBasedModeOn != 1 )
|
|
769 {
|
|
770 v4 = 0;
|
|
771 if ( (signed int)uNumActors > 0 )
|
|
772 {
|
|
773 v0 = &pActors[0].pMonsterInfo.uMovementType;
|
|
774 do
|
|
775 {
|
|
776 if ( ((Actor *)((char *)v0 - 59))->Actor::CanAct() && *((char *)v0 + 2) != 4 && *(char *)v0 != 5 )
|
|
777 {
|
|
778 v1 = abs(*(short *)((char *)v0 + 83) - pParty->vPosition.x);
|
58
|
779 v2 = abs(*(short *)((char *)v0 + 85) - pParty->vPosition.y);
|
|
780 v3 = abs(*(short *)((char *)v0 + 87) - pParty->vPosition.z);
|
0
|
781 if ( (double)sub_4621DA(v1, v2, v3) < 512.0 )
|
|
782 Actor::_402968(v4, 4, 0, 0);
|
|
783 }
|
|
784 ++v4;
|
|
785 v0 = (char *)v0 + 836;
|
|
786 }
|
|
787 while ( (signed int)v4 < (signed int)uNumActors );
|
|
788 }
|
|
789 }
|
|
790 }
|
|
791
|
|
792 //----- (00491BF9) --------------------------------------------------------
|
|
793 void Party::ResetPosMiscAndSpellBuffs()
|
|
794 {
|
|
795 Party *v1; // esi@1
|
|
796 char *v2; // edi@1
|
|
797 SpellBuff *v3; // ebx@2
|
|
798 SpellBuff *v4; // esi@5
|
|
799 signed int v5; // edi@5
|
|
800 signed int v6; // [sp+8h] [bp-8h]@1
|
|
801 signed int v7; // [sp+Ch] [bp-4h]@2
|
|
802
|
|
803 v1 = this;
|
|
804 this->vPosition.y = 0;
|
|
805 this->vPosition.z = 0;
|
|
806 this->vPosition.x = 0;
|
|
807 this->uFallStartY = 0;
|
|
808 this->sRotationY = 0;
|
|
809 this->sRotationX = 0;
|
|
810 this->uFallSpeed = 0;
|
|
811 this->field_28 = 0;
|
|
812 this->uDefaultPartyHeight = 120;
|
|
813 this->field_14 = 37;
|
|
814 this->field_18 = 25;
|
|
815 this->uWalkSpeed = 384;
|
|
816 this->field_20_prolly_turn_speed = 90;
|
|
817 this->field_24 = 5;
|
|
818 this->field_6FC = 0;
|
|
819 this->field_708 = 15;
|
|
820 this->field_0 = 25;
|
|
821 v2 = (char *)this->pPlayers[0].pPlayerBuffs;
|
|
822 v6 = 4;
|
|
823 do
|
|
824 {
|
|
825 v3 = (SpellBuff *)v2;
|
|
826 v7 = 24;
|
|
827 do
|
|
828 {
|
|
829 v3->Reset();
|
|
830 ++v3;
|
|
831 --v7;
|
|
832 }
|
|
833 while ( v7 );
|
|
834 v2 += 6972;
|
|
835 --v6;
|
|
836 }
|
|
837 while ( v6 );
|
|
838 v4 = v1->pPartyBuffs;
|
|
839 v5 = 20;
|
|
840 do
|
|
841 {
|
|
842 v4->Reset();
|
|
843 ++v4;
|
|
844 --v5;
|
|
845 }
|
|
846 while ( v5 );
|
|
847 }
|
|
848
|
|
849 //----- (004909F4) --------------------------------------------------------
|
|
850 void Party::_4909F4()
|
|
851 {
|
|
852 char *v1; // esi@2
|
|
853 unsigned int v2; // eax@3
|
|
854 __int16 v3; // cx@5
|
|
855 int v4; // edx@27
|
|
856 signed int v5; // eax@52
|
|
857 PlayerFrame *v6; // edx@53
|
|
858 char *v7; // esi@60
|
|
859 signed int v8; // ebp@61
|
|
860 int v9; // ebx@62
|
|
861 unsigned int v10; // edi@62
|
|
862 signed int v11; // [sp+0h] [bp-4h]@2
|
|
863
|
|
864 if ( dword_A75070 != stru_51076C.field_8 )
|
|
865 {
|
|
866 dword_A75070 = stru_51076C.field_8;
|
|
867 v1 = (char *)&this->pPlayers[0].uExpressionID;
|
|
868 v11 = 4;
|
|
869 do
|
|
870 {
|
23
|
871 v2 = ((Player *)(v1 - 6812))->GetMajorConditionIdx();
|
0
|
872 if ( v2 == 18 || v2 == 17 )
|
|
873 {
|
|
874 *((short *)v1 + 1) += LOWORD(pMiscTimer->uTimeElapsed);
|
|
875 if ( *((short *)v1 + 1) >= *((short *)v1 + 2) )
|
|
876 {
|
|
877 if ( *(short *)v1 != 1 || rand() % 5 )
|
|
878 {
|
|
879 *((short *)v1 + 1) = 0;
|
|
880 *(short *)v1 = 1;
|
|
881 *((short *)v1 + 2) = rand() % 256 + 32;
|
|
882 }
|
|
883 else
|
|
884 {
|
|
885 v4 = rand() % 100;
|
|
886 if ( v4 >= 25 )
|
|
887 {
|
|
888 if ( v4 >= 31 )
|
|
889 {
|
|
890 if ( v4 >= 37 )
|
|
891 {
|
|
892 if ( v4 >= 43 )
|
|
893 {
|
|
894 if ( v4 >= 46 )
|
|
895 {
|
|
896 if ( v4 >= 52 )
|
|
897 {
|
|
898 if ( v4 >= 58 )
|
|
899 {
|
|
900 if ( v4 >= 64 )
|
|
901 {
|
|
902 if ( v4 >= 70 )
|
|
903 {
|
|
904 if ( v4 >= 76 )
|
|
905 {
|
|
906 if ( v4 >= 82 )
|
|
907 {
|
|
908 if ( v4 >= 88 )
|
|
909 *(short *)v1 = (v4 >= 94) + 29;
|
|
910 else
|
|
911 *(short *)v1 = 57;
|
|
912 }
|
|
913 else
|
|
914 {
|
|
915 *(short *)v1 = 56;
|
|
916 }
|
|
917 }
|
|
918 else
|
|
919 {
|
|
920 *(short *)v1 = 55;
|
|
921 }
|
|
922 }
|
|
923 else
|
|
924 {
|
|
925 *(short *)v1 = 54;
|
|
926 }
|
|
927 }
|
|
928 else
|
|
929 {
|
|
930 *(short *)v1 = 20;
|
|
931 }
|
|
932 }
|
|
933 else
|
|
934 {
|
|
935 *(short *)v1 = 19;
|
|
936 }
|
|
937 }
|
|
938 else
|
|
939 {
|
|
940 *(short *)v1 = 18;
|
|
941 }
|
|
942 }
|
|
943 else
|
|
944 {
|
|
945 *(short *)v1 = 17;
|
|
946 }
|
|
947 }
|
|
948 else
|
|
949 {
|
|
950 *(short *)v1 = 16;
|
|
951 }
|
|
952 }
|
|
953 else
|
|
954 {
|
|
955 *(short *)v1 = 15;
|
|
956 }
|
|
957 }
|
|
958 else
|
|
959 {
|
|
960 *(short *)v1 = 14;
|
|
961 }
|
|
962 }
|
|
963 else
|
|
964 {
|
|
965 *(short *)v1 = 13;
|
|
966 }
|
|
967 v5 = 0;
|
|
968 *((short *)v1 + 1) = 0;
|
|
969 if ( (signed int)pPlayerFrameTable->uNumFrames <= 0 )
|
|
970 {
|
|
971 LABEL_56:
|
|
972 v5 = 0;
|
|
973 }
|
|
974 else
|
|
975 {
|
|
976 v6 = pPlayerFrameTable->pFrames;
|
|
977 while ( v6->uSequenceID != *(short *)v1 )
|
|
978 {
|
|
979 ++v5;
|
|
980 ++v6;
|
|
981 if ( v5 >= (signed int)pPlayerFrameTable->uNumFrames )
|
|
982 goto LABEL_56;
|
|
983 }
|
|
984 }
|
|
985 *((short *)v1 + 2) = 8 * pPlayerFrameTable->pFrames[v5].uAnimLength;
|
|
986 }
|
|
987 }
|
|
988 }
|
|
989 else
|
|
990 {
|
|
991 v3 = *(short *)v1;
|
|
992 if ( *(short *)v1 != 34 && v3 != 35 && v3 != 36
|
|
993 || (signed int)(pMiscTimer->uTimeElapsed + *((short *)v1 + 1)) >= *((short *)v1 + 2) )
|
|
994 {
|
|
995 *((short *)v1 + 2) = 0;
|
|
996 *((short *)v1 + 1) = 0;
|
|
997 switch ( v2 )
|
|
998 {
|
|
999 case 0xEu:
|
|
1000 *(short *)v1 = 98;
|
|
1001 break;
|
|
1002 case 0xFu:
|
|
1003 *(short *)v1 = 12;
|
|
1004 break;
|
|
1005 case 0x10u:
|
|
1006 *(short *)v1 = 99;
|
|
1007 break;
|
|
1008 case 0u:
|
|
1009 *(short *)v1 = 2;
|
|
1010 break;
|
|
1011 case 1u:
|
|
1012 *(short *)v1 = 3;
|
|
1013 break;
|
|
1014 case 2u:
|
|
1015 *(short *)v1 = 4;
|
|
1016 break;
|
|
1017 case 3u:
|
|
1018 *(short *)v1 = 5;
|
|
1019 break;
|
|
1020 case 4u:
|
|
1021 *(short *)v1 = 6;
|
|
1022 break;
|
|
1023 case 5u:
|
|
1024 *(short *)v1 = 7;
|
|
1025 break;
|
|
1026 case 6u:
|
|
1027 case 8u:
|
|
1028 case 0xAu:
|
|
1029 *(short *)v1 = 8;
|
|
1030 break;
|
|
1031 case 7u:
|
|
1032 case 9u:
|
|
1033 case 0xBu:
|
|
1034 *(short *)v1 = 9;
|
|
1035 break;
|
|
1036 case 0xCu:
|
|
1037 *(short *)v1 = 10;
|
|
1038 break;
|
|
1039 case 0xDu:
|
|
1040 *(short *)v1 = 11;
|
|
1041 break;
|
|
1042 default:
|
|
1043 break;
|
|
1044 }
|
|
1045 }
|
|
1046 else
|
|
1047 {
|
|
1048 *((short *)v1 + 1) += LOWORD(pMiscTimer->uTimeElapsed);
|
|
1049 }
|
|
1050 }
|
|
1051 v1 += 6972;
|
|
1052 --v11;
|
|
1053 }
|
|
1054 while ( v11 );
|
|
1055 v7 = (char *)&pParty->pHirelings[0].evtb;
|
|
1056 do
|
|
1057 {
|
|
1058 v8 = *((int *)v7 + 1);
|
|
1059 if ( v8 )
|
|
1060 {
|
|
1061 v9 = *((int *)v7 - 1);
|
|
1062 v10 = pMiscTimer->uTimeElapsed + *(int *)v7;
|
|
1063 if ( (signed int)v10 >= v8 )
|
|
1064 {
|
|
1065 v9 = 0;
|
|
1066 v8 = 0;
|
|
1067 v10 = 0;
|
|
1068 memset(v7 - 44, 0, 0x4Cu);
|
|
1069 pParty->field_709 = 0;
|
|
1070 sub_44A56A();
|
|
1071 viewparams->bRedrawGameUI = 1;
|
|
1072 }
|
|
1073 *(int *)v7 = v10;
|
|
1074 *((int *)v7 + 1) = v8;
|
|
1075 *((int *)v7 - 1) = v9;
|
|
1076 }
|
|
1077 v7 += 76;
|
|
1078 }
|
|
1079 while ( (signed int)v7 < (signed int)&pParty->field_777C[1] );
|
|
1080 }
|
|
1081 }
|
|
1082 // A75070: using guessed type int dword_A75070;
|
|
1083
|
|
1084 //----- (00490D02) --------------------------------------------------------
|
|
1085 void Party::RestAndHeal()
|
|
1086 {
|
|
1087 SpellBuff *v1; // esi@1
|
|
1088 Player *v2; // esi@4
|
|
1089 signed int v3; // ebx@4
|
|
1090 SpellBuff *v4; // edi@4
|
|
1091 int v5; // eax@9
|
|
1092 char v6; // zf@9
|
|
1093 char *v7; // eax@10
|
|
1094 signed int v8; // ecx@10
|
|
1095 int v9; // eax@18
|
|
1096 int v10; // eax@25
|
|
1097 signed int v11; // ecx@26
|
|
1098 signed int v12; // [sp-4h] [bp-1Ch]@26
|
|
1099 Party *v13; // [sp+Ch] [bp-Ch]@1
|
|
1100 signed int v14; // [sp+10h] [bp-8h]@10
|
|
1101 signed int v15; // [sp+14h] [bp-4h]@3
|
|
1102
|
|
1103 v13 = this;
|
|
1104 v1 = pParty->pPartyBuffs;
|
|
1105 do
|
|
1106 {
|
|
1107 v1->Reset();
|
|
1108 ++v1;
|
|
1109 }
|
|
1110 while ( (signed int)v1 < (signed int)pParty->pPlayers );
|
|
1111 v15 = 0;
|
|
1112 do
|
|
1113 {
|
|
1114 v2 = &pParty->pPlayers[v15];
|
|
1115 v3 = 20;
|
|
1116 v4 = v2->pPlayerBuffs;
|
|
1117 do
|
|
1118 {
|
|
1119 v4->Reset();
|
|
1120 ++v4;
|
|
1121 --v3;
|
|
1122 }
|
|
1123 while ( v3 );
|
|
1124 v2->Zero();
|
|
1125 if ( v2->pConditions[14] || v2->pConditions[15] || v2->pConditions[16] )
|
|
1126 goto LABEL_33;
|
|
1127 LODWORD(v2->pConditions[13]) = 0;
|
|
1128 HIDWORD(v2->pConditions[13]) = 0;
|
|
1129 LODWORD(v2->pConditions[4]) = 0;
|
|
1130 HIDWORD(v2->pConditions[4]) = 0;
|
|
1131 LODWORD(v2->pConditions[2]) = 0;
|
|
1132 HIDWORD(v2->pConditions[2]) = 0;
|
|
1133 LODWORD(v2->pConditions[3]) = 0;
|
|
1134 HIDWORD(v2->pConditions[3]) = 0;
|
|
1135 LODWORD(v2->pConditions[1]) = 0;
|
|
1136 HIDWORD(v2->pConditions[1]) = 0;
|
|
1137 v2->uTimeToRecovery = 0;
|
|
1138 v2->sHealth = v2->GetMaxHealth();
|
|
1139 v5 = v2->GetMaxMana();
|
|
1140 v6 = v2->uClass == 35;
|
|
1141 v2->sMana = v5;
|
|
1142 if ( v6 )
|
|
1143 {
|
|
1144 v14 = 0;
|
|
1145 v7 = &v2->pInventoryItems[0].field_1A;
|
|
1146 v8 = 138;
|
|
1147 do
|
|
1148 {
|
|
1149 if ( *(int *)(v7 - 26) == 601 && (unsigned __int8)*v7 == v15 + 1 )
|
|
1150 v14 = 1;
|
|
1151 v7 += 36;
|
|
1152 --v8;
|
|
1153 }
|
|
1154 while ( v8 );
|
|
1155 if ( !v14 )
|
|
1156 {
|
|
1157 v2->sHealth = v2->GetMaxHealth() / 2;
|
|
1158 v2->sMana = v2->GetMaxMana() / 2;
|
|
1159 }
|
|
1160 }
|
|
1161 if ( !v2->pConditions[17] )
|
|
1162 {
|
|
1163 if ( v2->pConditions[10] || v2->pConditions[11] )
|
|
1164 {
|
|
1165 v11 = 4;
|
|
1166 v12 = 4;
|
|
1167 }
|
|
1168 else
|
|
1169 {
|
|
1170 if ( !v2->pConditions[8] && !v2->pConditions[9] )
|
|
1171 {
|
|
1172 if ( !v2->pConditions[6] && !v2->pConditions[7] )
|
|
1173 goto LABEL_30;
|
|
1174 v2->sHealth /= 2;
|
|
1175 v10 = v2->sMana / 2;
|
|
1176 goto LABEL_29;
|
|
1177 }
|
|
1178 v11 = 3;
|
|
1179 v12 = 3;
|
|
1180 }
|
|
1181 v2->sHealth /= v11;
|
|
1182 v10 = v2->sMana / v12;
|
|
1183 LABEL_29:
|
|
1184 v2->sMana = v10;
|
|
1185 goto LABEL_30;
|
|
1186 }
|
|
1187 v9 = v2->sHealth;
|
|
1188 v2->sMana = 0;
|
|
1189 v2->sHealth = v9 / 2;
|
|
1190 LABEL_30:
|
|
1191 if ( v2->pConditions[5] )
|
|
1192 v2->sMana = 0;
|
|
1193 _4909F4();
|
|
1194 LABEL_33:
|
|
1195 ++v15;
|
|
1196 }
|
|
1197 while ( v15 < 4 );
|
|
1198 pParty->field_764 = 0;
|
|
1199 } |