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