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