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