Mercurial > mm7
annotate Party.cpp @ 1380:635500df9320
Слияние
author | Ritor1 |
---|---|
date | Tue, 16 Jul 2013 14:11:43 +0600 |
parents | 9014784ae84f |
children | b51332ab228f |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1071
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1071
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1071
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1071
diff
changeset
|
4 |
130 | 5 #include <assert.h> |
6 | |
0 | 7 #include "Party.h" |
8 #include "MapInfo.h" | |
9 #include "Time.h" | |
10 #include "AudioPlayer.h" | |
11 #include "IconFrameTable.h" | |
12 #include "Mouse.h" | |
13 #include "PlayerFrameTable.h" | |
14 #include "TurnEngine.h" | |
15 #include "Viewport.h" | |
16 #include "Actor.h" | |
17 #include "GUIWindow.h" | |
189 | 18 #include "texts.h" |
0 | 19 |
20 #include "mm7_data.h" | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
783
diff
changeset
|
21 #include "MM7.h" |
1295 | 22 #include "Outdoor.h" |
23 #include "Indoor.h" | |
1297 | 24 #include "Texture.h" |
25 #include "LOD.h" | |
26 #include "Sprites.h" | |
27 #include "SpriteObject.h" | |
28 #include "ObjectList.h" | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
29 #include "Conditions.h" |
0 | 30 |
31 Party *pParty; // idb | |
32 | |
33 struct ActionQueue *pPartyActionQueue = new ActionQueue; | |
34 | |
35 | |
36 | |
1035 | 37 |
38 | |
39 //----- (0044A56A) -------------------------------------------------------- | |
40 void Party::CountHirelings() | |
41 { | |
42 field_70A = 0; | |
43 | |
44 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
45 { | |
46 auto npc = pNPCStats->pNewNPCData + i; | |
47 if (npc->Hired() && | |
48 (!pHirelings[0].pName || strcmp(npc->pName, pHirelings[0].pName))) | |
49 { | |
50 if (!pHirelings[1].pName || strcmp(npc->pName, pHirelings[1].pName)) | |
51 ++field_70A; | |
52 } | |
53 } | |
54 } | |
55 | |
56 | |
783 | 57 // inlined |
58 //----- (mm6c::004858D0) -------------------------------------------------- | |
59 void Party::Zero() | |
60 { | |
61 | |
62 uFlags2 = 0; | |
63 uNumGoldInBank = 0; | |
64 | |
65 uCurrentYear = 0; | |
66 uCurrentMonth = 0; | |
67 uCurrentMonthWeek = 0; | |
68 uDaysPlayed = 0; | |
69 uCurrentHour = 0; | |
70 uCurrentMinute = 0; | |
71 uCurrentTimeSecond = 0; | |
72 | |
73 field_6FC = 0; | |
74 days_played_without_rest = 0; | |
75 | |
76 vPosition.y = 0; | |
77 vPosition.z = 0; | |
78 vPosition.x = 0; | |
79 uFallStartY = 0; | |
80 sRotationY = 0; | |
81 sRotationX = 0; | |
82 uFallSpeed = 0; | |
83 field_28 = 0; | |
84 uDefaultPartyHeight = 120; | |
85 field_14 = 37; | |
86 y_rotation_granularity = 25; | |
87 uWalkSpeed = 384; | |
88 y_rotation_speed = 90; | |
89 field_24 = 5; | |
90 field_6FC = 0; | |
91 field_708 = 15; | |
92 field_0 = 25; | |
93 } | |
94 | |
95 //inlined | |
96 //----- (mm6c::0045BE90) -------------------------------------------------- | |
97 void ActionQueue::Reset() | |
98 { | |
99 uNumActions = 0; | |
100 } | |
0 | 101 |
102 //----- (004760C1) -------------------------------------------------------- | |
103 void ActionQueue::Add(PartyAction action) | |
104 { | |
105 if (uNumActions < 30) | |
106 pActions[uNumActions++] = action; | |
107 } | |
108 | |
109 //----- (00497FC5) -------------------------------------------------------- | |
110 bool Party::_497FC5_check_party_perception_against_level() | |
111 { | |
112 int uMaxPerception; // edi@1 | |
113 Player *v2; // esi@1 | |
114 signed int v3; // ebx@1 | |
115 Player *v4; // ecx@2 | |
116 signed int v5; // eax@3 | |
117 bool result; // eax@7 | |
118 | |
119 uMaxPerception = 0; | |
120 v2 = this->pPlayers; | |
121 v3 = 4; | |
122 do | |
123 { | |
124 if ( v2->CanAct() ) | |
125 { | |
126 v5 = v2->GetPerception(); | |
127 if ( v5 > uMaxPerception ) | |
128 uMaxPerception = v5; | |
129 } | |
130 ++v2; | |
131 --v3; | |
132 } | |
133 while ( v3 ); | |
134 if ( uLevelMapStatsID && (signed int)uLevelMapStatsID < 77 ) | |
135 result = uMaxPerception >= 2 * pMapStats->pInfos[uLevelMapStatsID]._per; | |
136 else | |
137 result = 0; | |
138 return result; | |
139 } | |
140 | |
141 //----- (004936E1) -------------------------------------------------------- | |
142 void Party::SetHoldingItem(ItemGen *pItem) | |
143 { | |
144 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
201 | 145 memcpy(&pPickedItem, pItem, sizeof(pPickedItem)); |
146 pMouse->SetCursorBitmapFromItemID(pPickedItem.uItemID); | |
0 | 147 } |
148 | |
149 //----- (0049370F) -------------------------------------------------------- | |
150 int Party::GetNextActiveCharacter() | |
151 { | |
152 Party *v1; // esi@1 | |
153 int v2; // eax@4 | |
154 signed int v4; // ecx@6 | |
89 | 155 Player *v5; // edx@6 |
0 | 156 Player *v6; // eax@7 |
89 | 157 Player *v7; // ecx@23 |
0 | 158 signed int v8; // esi@23 |
159 signed int v9; // edx@23 | |
160 Player **v10; // edi@23 | |
161 Player *v11; // eax@24 | |
162 int v12; // [sp+Ch] [bp-4h]@1 | |
163 | |
164 v1 = this; | |
165 v12 = 0; | |
166 if ( pParty->bTurnBasedModeOn == 1 ) | |
167 { | |
1340 | 168 if ( pTurnEngine->turn_stage != 2 || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) != OBJECT_Player) |
0 | 169 return 0; |
848 | 170 v2 = PID_ID(pTurnEngine->pQueue[0].uPackedID); |
0 | 171 return v2 + 1; |
172 } | |
173 v4 = 0; | |
89 | 174 v5 = v1->pPlayers;//[0].uTimeToRecovery; |
0 | 175 while ( 1 ) |
176 { | |
177 v6 = ::pPlayers[v4 + 1]; | |
178 if ( v6->pConditions[2] | |
179 || v6->pConditions[12] | |
180 || v6->pConditions[13] | |
181 || v6->pConditions[14] | |
182 || v6->pConditions[15] | |
183 || v6->pConditions[16] | |
89 | 184 || v5->uTimeToRecovery ) |
0 | 185 { |
186 byte_AE3368[v4] = 1; | |
187 } | |
89 | 188 else if ( !byte_AE3368[v4] ) |
0 | 189 break; |
190 ++v4; | |
89 | 191 ++v5; |
0 | 192 if ( v4 >= 4 ) |
89 | 193 break; |
0 | 194 } |
89 | 195 if(v4<4) |
196 { | |
197 v12 = v4; | |
198 byte_AE3368[v4] = 1; | |
199 } | |
0 | 200 if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] ) |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
201 memset(byte_AE3368.data(), 0, 4u); |
0 | 202 v2 = v12; |
203 if ( v12 ) | |
204 return v2 + 1; | |
89 | 205 v7 = v1->pPlayers;//[0].uSpeedBonus; |
0 | 206 v8 = 0; |
207 v9 = 1; | |
208 v10 = &::pPlayers[1]; | |
209 while ( 2 ) | |
210 { | |
211 v11 = *v10; | |
212 if ( !(*v10)->pConditions[2] | |
213 && !v11->pConditions[12] | |
214 && !v11->pConditions[13] | |
215 && !v11->pConditions[14] | |
216 && !v11->pConditions[15] | |
217 && !v11->pConditions[16] | |
89 | 218 && !v7->uTimeToRecovery ) |
0 | 219 { |
220 if ( v12 ) | |
221 { | |
89 | 222 if ( v7->uSpeedBonus > v8 ) |
0 | 223 { |
89 | 224 v8 = v7->uSpeedBonus; |
225 v12 = v9; | |
0 | 226 } |
227 } | |
228 else | |
229 { | |
230 v8 = *(short *)v7; | |
231 v12 = v9; | |
232 } | |
233 } | |
234 ++v10; | |
235 ++v9; | |
89 | 236 ++v7; |
0 | 237 if ( v9 - 1 < 4 ) |
238 continue; | |
239 return v12; | |
240 } | |
241 } | |
242 | |
243 | |
244 //----- (00493244) -------------------------------------------------------- | |
245 bool Party::HasItem(unsigned int uItemID) | |
246 { | |
89 | 247 Player *v2; // edx@1 |
0 | 248 signed int v3; // ecx@2 |
249 ItemGen *v4; // eax@2 | |
250 | |
89 | 251 v2 = pParty->pPlayers;//[0].pInventoryItems; |
252 while ( v2 <= &pParty->pPlayers[3] ) | |
0 | 253 { |
254 v3 = 0; | |
89 | 255 v4 = v2->pInventoryItems; |
0 | 256 do |
257 { | |
258 if ( v4->uItemID == uItemID ) | |
259 return 1; | |
260 ++v3; | |
261 ++v4; | |
262 } | |
263 while ( v3 < 138 ); | |
89 | 264 ++v2; |
0 | 265 } |
266 return 0; | |
267 } | |
268 | |
269 | |
270 //----- (00492AD5) -------------------------------------------------------- | |
593 | 271 void Party::SetFood(unsigned int uNumFood) |
0 | 272 { |
273 pUIAnim_Food->uAnimTime = 0; | |
274 pParty->uNumFoodRations = uNumFood; | |
592 | 275 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength; |
0 | 276 } |
277 | |
278 //----- (00492B03) -------------------------------------------------------- | |
279 void Party::TakeFood(unsigned int uNumFood) | |
280 { | |
592 | 281 if (pParty->uNumFoodRations <= uNumFood) |
282 pParty->uNumFoodRations = 0; | |
0 | 283 else |
592 | 284 pParty->uNumFoodRations -= uNumFood; |
285 | |
0 | 286 pUIAnim_Food->uAnimTime = 0; |
592 | 287 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength; |
0 | 288 } |
289 | |
290 //----- (00492B42) -------------------------------------------------------- | |
592 | 291 void Party::GiveFood(unsigned int _this) |
0 | 292 { |
293 pParty->uNumFoodRations += _this; | |
294 pUIAnim_Food->uAnimTime = 0; | |
592 | 295 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength; |
0 | 296 } |
297 | |
298 //----- (00492B70) -------------------------------------------------------- | |
299 void Party::SetGold(unsigned int uNumGold) | |
300 { | |
301 pParty->uNumGold = uNumGold; | |
302 pUIAnim_Gold->uAnimTime = 0; | |
592 | 303 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength; |
0 | 304 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); |
305 } | |
306 | |
307 //----- (00492BB6) -------------------------------------------------------- | |
308 void Party::TakeGold(unsigned int uNumGold) | |
309 { | |
310 if ( uNumGold <= pParty->uNumGold ) | |
311 pParty->uNumGold -= uNumGold; | |
312 else | |
313 pParty->uNumGold = 0; | |
314 pUIAnim_Gold->uAnimTime = 0; | |
592 | 315 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength; |
0 | 316 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); |
317 } | |
318 | |
319 //----- (0049135E) -------------------------------------------------------- | |
320 unsigned int Party::GetPartyFame() | |
321 { | |
566 | 322 unsigned __int64 total_exp = 0; |
323 for (uint i = 0; i < 4; ++i) | |
324 total_exp += pPlayers[i].uExperience; | |
325 return total_exp / 1000; | |
0 | 326 } |
327 | |
328 //----- (0049137D) -------------------------------------------------------- | |
329 void Party::CreateDefaultParty(char bGiveItems) | |
330 { | |
331 Party *pParty; // esi@1 | |
332 signed __int16 v3; // ax@1 | |
135 | 333 //int pResMagicBase; // ecx@1 |
0 | 334 Player *pCharacter; // esi@3 |
321 | 335 //signed int uSpellBookPageCount; // edx@5 |
0 | 336 int pMagicSkills; // eax@5 |
337 int uSkillIdx; // eax@11 | |
338 //unsigned __int8 v9; // zf@37 | |
339 //char v10; // sf@37 | |
340 //unsigned __int8 v11; // of@37 | |
1071 | 341 ItemGen *pItems; // eax@38 |
0 | 342 signed int v13; // ecx@38 |
343 int uMaxSP; // eax@42 | |
344 unsigned int v15; // [sp-4h] [bp-44h]@14 | |
345 unsigned int v16; // [sp-4h] [bp-44h]@26 | |
346 int v17; // [sp+10h] [bp-30h]@1 | |
347 int v18; // [sp+14h] [bp-2Ch]@11 | |
348 signed int uNumPlayers; // [sp+18h] [bp-28h]@1 | |
349 ItemGen Dst; // [sp+1Ch] [bp-24h]@10 | |
350 | |
130 | 351 |
0 | 352 pParty = this; |
130 | 353 |
354 pHireling1Name[0] = 0; | |
355 pHireling2Name[0] = 0; | |
134 | 356 pParty->field_709 = 0; |
130 | 357 memset(pHirelings, 0, 2 * sizeof(*pHirelings)); |
358 | |
0 | 359 strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan |
1014 | 360 pParty->pPlayers[0].uPrevFace = 17; |
361 pParty->pPlayers[0].uCurrentFace = 17; | |
362 pParty->pPlayers[0].uPrevVoiceID = 17; | |
0 | 363 pParty->pPlayers[0].uVoiceID = 17; |
364 pParty->pPlayers[0].uMight = 30; | |
365 pParty->pPlayers[0].uIntelligence = 5; | |
366 pParty->pPlayers[0].uWillpower = 5; | |
367 pParty->pPlayers[0].uEndurance = 13; | |
368 pParty->pPlayers[0].uAccuracy = 13; | |
369 pParty->pPlayers[0].uSpeed = 14; | |
370 pParty->pPlayers[0].uLuck = 7; | |
135 | 371 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather |
372 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_ARMSMASTER] = 1; // armsmaster | |
373 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_BOW] = 1; // bow | |
374 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_SWORD] = 1; // sword | |
1014 | 375 pParty->pPlayers[1].uPrevFace = 3; |
376 pParty->pPlayers[1].uCurrentFace = 3; | |
377 pParty->pPlayers[1].uPrevVoiceID = 3; | |
0 | 378 pParty->pPlayers[1].uVoiceID = 3; |
379 strcpy(pParty->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); //Roderic | |
380 pParty->pPlayers[1].uMight = 13; | |
381 pParty->pPlayers[1].uIntelligence = 9; | |
382 pParty->pPlayers[1].uWillpower = 9; | |
383 pParty->pPlayers[1].uEndurance = 13; | |
384 pParty->pPlayers[1].uAccuracy = 13; | |
385 pParty->pPlayers[1].uSpeed = 13; | |
386 pParty->pPlayers[1].uLuck = 13; | |
135 | 387 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather |
388 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_STEALING] = 1; // stealing | |
389 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_DAGGER] = 1; // dagger | |
390 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_TRAP_DISARM] = 1; // disarm trap | |
1014 | 391 pParty->pPlayers[2].uPrevFace = 14; |
392 pParty->pPlayers[2].uCurrentFace = 14; | |
393 pParty->pPlayers[2].uPrevVoiceID = 14; | |
0 | 394 pParty->pPlayers[2].uVoiceID = 14; |
395 strcpy(pParty->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); // Serena | |
396 pParty->pPlayers[2].uMight = 12; | |
397 pParty->pPlayers[2].uIntelligence = 9; | |
398 pParty->pPlayers[2].uWillpower = 20; | |
399 pParty->pPlayers[2].uEndurance = 22; | |
400 pParty->pPlayers[2].uAccuracy = 7; | |
401 pParty->pPlayers[2].uSpeed = 13; | |
402 pParty->pPlayers[2].uLuck = 7; | |
135 | 403 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_ALCHEMY] = 1; // alchemy |
404 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather | |
405 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_BODY] = 1; // body | |
406 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_MACE] = 1; // mace | |
0 | 407 strcpy(pParty->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); // Alexis |
408 v3 = 10; | |
1014 | 409 pParty->pPlayers[3].uPrevFace = 10; |
410 pParty->pPlayers[3].uCurrentFace = 10; | |
135 | 411 //pResMagicBase = (int)&pParty->pPlayers[0].sResMagicBase; |
0 | 412 pParty->pPlayers[3].uEndurance = 13; |
413 pParty->pPlayers[3].uAccuracy = 13; | |
414 pParty->pPlayers[3].uSpeed = 13; | |
1014 | 415 pParty->pPlayers[3].uPrevVoiceID = 10; |
0 | 416 pParty->pPlayers[3].uVoiceID = 10; |
417 pParty->pPlayers[3].uMight = 5; | |
418 pParty->pPlayers[3].uIntelligence = 30; | |
419 pParty->pPlayers[3].uWillpower = 9; | |
420 pParty->pPlayers[3].uLuck = 7; | |
135 | 421 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather |
422 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_AIR] = 1; // air | |
423 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_FIRE] = 1; // fire | |
424 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_STAFF] = 1; // staff | |
0 | 425 //uNumPlayers = 4; |
426 //while ( 1 ) | |
427 for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++) | |
428 { | |
135 | 429 pCharacter = &pParty->pPlayers[uNumPlayers]; |
430 if (pCharacter->classType == PLAYER_CLASS_KNIGHT) | |
431 pCharacter->sResMagicBase = v3; //player[i].pResMagicBase | |
321 | 432 //uSpellBookPageCount = 0; |
0 | 433 //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills |
434 //while ( !*(short *)pMagicSkills ) //player[i].skillFire | |
321 | 435 pCharacter->lastOpenedSpellbookPage = 0; |
0 | 436 for (int i = 0; i < 9; i++)//for Magic Book |
437 { | |
438 //++uSpellBookPageCount; | |
439 //pMagicSkills++; | |
440 //if ( uSpellBookPageCount >= 9 ) | |
441 //goto LABEL_10; | |
442 if (pPlayers[uNumPlayers].pActiveSkills[12+i]) | |
321 | 443 { |
444 pCharacter->lastOpenedSpellbookPage = i; | |
445 break; | |
446 } | |
0 | 447 } |
448 //LABEL_10: | |
449 pCharacter->uExpressionTimePassed = 0; | |
450 Dst.Reset(); | |
451 if ( bGiveItems ) | |
452 { | |
439 | 453 pItemsTable->GenerateItem(2, 40, &Dst); //ring |
0 | 454 pCharacter->AddItem2(-1, &Dst); |
455 //uSkillIdx = 0; | |
456 //v18 = 0; | |
457 //do | |
458 for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++) | |
459 { | |
460 if ( pCharacter->pActiveSkills[uSkillIdx] ) | |
461 { | |
462 switch ( uSkillIdx ) | |
463 { | |
464 case PLAYER_SKILL_STAFF: | |
465 v15 = ITEM_STAFF_1; | |
466 pCharacter->WearItem(v15); | |
467 break; | |
468 case PLAYER_SKILL_SWORD: | |
469 v15 = ITEM_LONGSWORD_1; | |
470 pCharacter->WearItem(v15); | |
471 break; | |
472 case PLAYER_SKILL_DAGGER: | |
473 v15 = ITEM_DAGGER_1; | |
474 pCharacter->WearItem(v15); | |
475 break; | |
476 case PLAYER_SKILL_AXE: | |
477 v15 = ITEM_AXE_1; | |
478 pCharacter->WearItem(v15); | |
479 break; | |
480 case PLAYER_SKILL_SPEAR: | |
481 v15 = ITEM_SPEAR_1; | |
482 pCharacter->WearItem(v15); | |
483 break; | |
484 case PLAYER_SKILL_BOW: | |
485 v15 = ITEM_CROSSBOW_1; | |
486 pCharacter->WearItem(v15); | |
487 break; | |
488 case PLAYER_SKILL_MACE: | |
489 v15 = ITEM_MACE_1; | |
490 pCharacter->WearItem(v15); | |
491 break; | |
492 case PLAYER_SKILL_SHIELD: | |
493 v15 = ITEM_BUCKLER_1; | |
494 pCharacter->WearItem(v15); | |
495 break; | |
496 case PLAYER_SKILL_LEATHER: | |
497 v15 = ITEM_LEATHER_1; | |
498 pCharacter->WearItem(v15); | |
499 break; | |
500 case PLAYER_SKILL_CHAIN: | |
501 v15 = ITEM_CHAINMAIL_1; | |
502 pCharacter->WearItem(v15); | |
503 break; | |
504 case PLAYER_SKILL_PLATE: | |
505 v15 = ITEM_PLATE_1; | |
506 pCharacter->WearItem(v15); | |
507 break; | |
508 case PLAYER_SKILL_FIRE: | |
509 v16 = ITEM_SPELLBOOK_FIRE_STRIKE; | |
510 pCharacter->AddItem(-1, v16); | |
511 break; | |
512 case PLAYER_SKILL_AIR: | |
513 v16 = ITEM_SPELLBOOK_AIR_FEATHER_FALL; | |
514 pCharacter->AddItem(-1, v16); | |
515 break; | |
516 case PLAYER_SKILL_WATER: | |
517 v16 = ITEM_SPELLBOOK_WATER_POISON_SPRAY; | |
518 pCharacter->AddItem(-1, v16); | |
519 break; | |
520 case PLAYER_SKILL_EARTH: | |
521 v16 = ITEM_SPELLBOOK_EARTH_SLOW; | |
522 pCharacter->AddItem(-1, v16); | |
523 break; | |
524 case PLAYER_SKILL_SPIRIT: | |
525 v16 = ITEM_SPELLBOOK_SPIRIT_BLESS; | |
526 pCharacter->AddItem(-1, v16); | |
527 break; | |
528 case PLAYER_SKILL_MIND: | |
529 v16 = ITEM_SPELLBOOK_MIND_MIND_BLAST; | |
530 pCharacter->AddItem(-1, v16); | |
531 break; | |
532 case PLAYER_SKILL_BODY: | |
533 v16 = ITEM_SPELLBOOK_BODY_FIRST_AID; | |
534 pCharacter->AddItem(-1, v16); | |
535 break; | |
536 case PLAYER_SKILL_ITEM_ID: | |
537 case PLAYER_SKILL_REPAIR: | |
538 case PLAYER_SKILL_MEDITATION: | |
539 case PLAYER_SKILL_PERCEPTION: | |
540 case PLAYER_SKILL_DIPLOMACY: | |
541 case PLAYER_SKILL_TRAP_DISARM: | |
542 case PLAYER_SKILL_LEARNING: | |
543 pCharacter->AddItem(-1, ITEM_POTION_BOTTLE); | |
544 v16 = 5 * (rand() % 3 + 40); // simple reagent | |
545 pCharacter->AddItem(-1, v16); | |
546 break; | |
547 case PLAYER_SKILL_DODGE: | |
548 v16 = ITEM_BOOTS_1; | |
549 pCharacter->AddItem(-1, v16); | |
550 break; | |
551 case PLAYER_SKILL_UNARMED: | |
552 v16 = ITEM_GAUNTLETS_1; | |
553 pCharacter->AddItem(-1, v16); | |
554 break; | |
555 default: | |
556 break; | |
557 } | |
558 } | |
559 //uSkillIdx = v18 + 1; | |
560 //v11 = uSkillIdx > 36; | |
561 //v9 = v18 == 35; | |
562 //v10 = uSkillIdx - 35 < 0; | |
563 } | |
564 //while (uSkillIdx < 36); | |
1071 | 565 pItems = pCharacter->pInventoryItems; |
0 | 566 //v13 = 138; |
1071 | 567 for (int i = 0; i < 138; i++) |
0 | 568 { |
1071 | 569 if ( pItems->uItemID ) |
570 pItems->uAttributes |= 1; | |
571 ++pItems; | |
0 | 572 //--v13; |
573 } | |
574 //while ( v13 ); | |
575 } | |
576 pCharacter->sHealth = pCharacter->GetMaxHealth(); | |
577 pCharacter->sMana = pCharacter->GetMaxMana(); | |
135 | 578 //pCharacter++; |
0 | 579 //uNumPlayers--; |
580 //if (!uNumPlayers) | |
581 //break; | |
135 | 582 //pResMagicBase = (int)pCharacter; |
0 | 583 v3 = 10; |
584 } | |
585 } | |
586 | |
587 //----- (004917CE) -------------------------------------------------------- | |
588 int Party::Reset() | |
589 { | |
590 //Party *v1; // esi@1 | |
591 //unsigned __int64 *pTimePlayed; // edi@1 | |
592 //bool v3; // edx@1 | |
593 //Player **v4; // eax@1 | |
594 //Player *v5; // ecx@1 | |
595 PLAYER_SEX pSex; // cl@3 | |
596 PLAYER_SEX v7; // al@6 | |
597 PLAYER_SEX v8; // al@9 | |
598 PLAYER_SEX v9; // cl@12 | |
599 //Player *v12; // edx@17 | |
600 //signed int v13; // edi@18 | |
601 SpellBuff *v14; // ebx@21 | |
602 signed int v15; // edi@21 | |
783 | 603 |
604 Zero(); | |
0 | 605 |
606 field_708 = 15; | |
607 sEyelevel = 160; | |
608 uNumGold = 200; | |
609 uNumFoodRations = 7; | |
610 | |
783 | 611 |
373 | 612 alignment = PartyAlignment_Neutral; |
613 SetUserInterface(alignment, true); | |
0 | 614 |
615 uTimePlayed = 0x21C00u; | |
616 uLastRegenerationTime = 0x21C00; | |
617 | |
618 bTurnBasedModeOn = false; | |
619 | |
620 uActiveCharacter = 1; | |
621 ::pPlayers[0] = pPlayers; | |
622 for (uint i = 0; i < 4; ++i) | |
623 ::pPlayers[i + 1] = &pPlayers[i]; | |
624 | |
135 | 625 pPlayers[0].Reset(PLAYER_CLASS_KNIGHT); |
626 pPlayers[1].Reset(PLAYER_CLASS_THEIF); | |
627 pPlayers[2].Reset(PLAYER_CLASS_CLERIC); | |
628 pPlayers[3].Reset(PLAYER_CLASS_SORCERER); | |
1014 | 629 pPlayers[0].uCurrentFace = 17; |
630 pPlayers[0].uPrevVoiceID = 17; | |
0 | 631 pPlayers[0].uVoiceID = 17; |
632 pPlayers[0].SetInitialStats(); | |
633 | |
634 switch ( pPlayers[0].uVoiceID ) | |
635 { | |
636 case 0: | |
637 case 1: | |
638 case 2: | |
639 case 3: | |
640 case 8: | |
641 case 9: | |
642 case 12: | |
643 case 13: | |
644 case 16: | |
645 case 17: | |
646 case 20: | |
647 case 23: | |
648 default: | |
649 pSex = SEX_MALE; | |
650 break; | |
651 case 4: | |
652 case 5: | |
653 case 6: | |
654 case 7: | |
655 case 10: | |
656 case 11: | |
657 case 14: | |
658 case 15: | |
659 case 18: | |
660 case 19: | |
661 case 21: | |
662 case 24: | |
663 pSex = SEX_FEMALE; | |
664 break; | |
665 } | |
666 pPlayers[0].uSex = pSex; | |
667 pPlayers[0].RandomizeName(); | |
668 strcpy(pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); | |
669 | |
670 | |
1014 | 671 pPlayers[1].uCurrentFace = 3; |
672 pPlayers[1].uPrevVoiceID = 3; | |
0 | 673 pPlayers[1].uVoiceID = 3; |
674 pPlayers[1].SetInitialStats(); | |
675 v7 = SEX_MALE; | |
676 switch (pPlayers[1].uVoiceID) | |
677 { | |
678 case 0: | |
679 case 1: | |
680 case 2: | |
681 case 3: | |
682 case 8: | |
683 case 9: | |
684 case 0xCu: | |
685 case 0xDu: | |
686 case 0x10u: | |
687 case 0x11u: | |
688 case 0x14u: | |
689 case 0x17u: | |
690 v7 = SEX_MALE; | |
691 break; | |
692 case 4: | |
693 case 5: | |
694 case 6: | |
695 case 7: | |
696 case 0xAu: | |
697 case 0xBu: | |
698 case 0xEu: | |
699 case 0xFu: | |
700 case 0x12u: | |
701 case 0x13u: | |
702 case 0x15u: | |
703 case 0x18u: | |
704 v7 = SEX_FEMALE; | |
705 break; | |
706 default: | |
707 break; | |
708 } | |
709 pPlayers[1].uSex = v7; | |
710 pPlayers[1].RandomizeName(); | |
711 strcpy(pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); | |
1014 | 712 pPlayers[2].uCurrentFace = 14; |
713 pPlayers[2].uPrevVoiceID = 14; | |
0 | 714 pPlayers[2].uVoiceID = 14; |
715 pPlayers[2].SetInitialStats(); | |
716 v8 = SEX_MALE; | |
717 switch (pPlayers[2].uVoiceID) | |
718 { | |
719 case 0: | |
720 case 1: | |
721 case 2: | |
722 case 3: | |
723 case 8: | |
724 case 9: | |
725 case 0xCu: | |
726 case 0xDu: | |
727 case 0x10u: | |
728 case 0x11u: | |
729 case 0x14u: | |
730 case 0x17u: | |
731 v8 = SEX_MALE; | |
732 break; | |
733 case 4: | |
734 case 5: | |
735 case 6: | |
736 case 7: | |
737 case 0xAu: | |
738 case 0xBu: | |
739 case 0xEu: | |
740 case 0xFu: | |
741 case 0x12u: | |
742 case 0x13u: | |
743 case 0x15u: | |
744 case 0x18u: | |
745 v8 = SEX_FEMALE; | |
746 break; | |
747 default: | |
748 break; | |
749 } | |
750 pPlayers[2].uSex = v8; | |
751 pPlayers[2].RandomizeName(); | |
752 strcpy(pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); | |
1014 | 753 pPlayers[3].uCurrentFace = 10; |
754 pPlayers[3].uPrevVoiceID = 10; | |
0 | 755 pPlayers[3].uVoiceID = 10; |
756 pPlayers[3].SetInitialStats(); | |
757 v9 = SEX_MALE; | |
758 switch (pPlayers[3].uVoiceID) | |
759 { | |
760 case 0u: | |
761 case 1u: | |
762 case 2u: | |
763 case 3u: | |
764 case 8u: | |
765 case 9u: | |
766 case 0xCu: | |
767 case 0xDu: | |
768 case 0x10u: | |
769 case 0x11u: | |
770 case 0x14u: | |
771 case 0x17u: | |
772 v9 = SEX_MALE; | |
773 break; | |
774 case 4u: | |
775 case 5u: | |
776 case 6u: | |
777 case 7u: | |
778 case 0xAu: | |
779 case 0xBu: | |
780 case 0xEu: | |
781 case 0xFu: | |
782 case 0x12u: | |
783 case 0x13u: | |
784 case 0x15u: | |
785 case 0x18u: | |
786 v9 = SEX_FEMALE; | |
787 break; | |
788 default: | |
789 break; | |
790 } | |
791 pPlayers[3].uSex = v9; | |
792 pPlayers[3].RandomizeName(); | |
793 strcpy(pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); | |
794 | |
795 | |
796 | |
797 for (uint i = 0; i < 4; ++i) | |
798 { | |
799 pPlayers[i].uTimeToRecovery = 0; | |
800 for (uint j = 0; j < 20; ++j) | |
801 pPlayers[i].pConditions[j] = 0; | |
802 | |
803 for (uint j = 0; j < 24; ++j) | |
804 pPlayers[i].pPlayerBuffs[j].Reset(); | |
805 | |
130 | 806 pPlayers[i].expression = CHARACTER_EXPRESSION_1; |
0 | 807 pPlayers[i].uExpressionTimePassed = 0; |
808 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128; | |
809 } | |
810 | |
811 for (uint i = 1; i < 20; ++i) | |
812 pPartyBuffs[i].Reset(); | |
813 | |
814 | |
1035 | 815 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; // default character ui - stats |
0 | 816 uFlags = 0; |
1310 | 817 memset(_autonote_bits, 0, 26); |
484 | 818 memset(_quest_bits, 0, 64); |
598 | 819 memset(pIsArtifactFound, 0, 29); |
1035 | 820 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1); |
821 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1); | |
822 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1); | |
823 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_PLATE_ACTIVE, 1); | |
824 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1); | |
825 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1); | |
0 | 826 |
487 | 827 memset(field_3C._shop_ban_times,0,53*sizeof(__int64)); |
0 | 828 |
829 memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu); | |
830 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u); | |
655 | 831 pNPCStats->pNewNPCData[3].uFlags |= 128;//|= 0x80u; Lady Margaret |
0 | 832 _494035_timed_effects__water_walking_damage__etc(); |
833 pEventTimer->Pause(); | |
834 return 0; | |
835 } | |
836 | |
837 | |
838 //----- (0043AD34) -------------------------------------------------------- | |
839 void Party::Yell() | |
840 { | |
90 | 841 Actor *v0; // esi@5 |
0 | 842 int v1; // edi@9 |
843 int v2; // ebx@9 | |
844 int v3; // eax@9 | |
845 unsigned int v4; // [sp+8h] [bp-4h]@4 | |
846 | |
1167 | 847 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0 ) |
848 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
0 | 849 if ( pParty->bTurnBasedModeOn != 1 ) |
850 { | |
851 v4 = 0; | |
852 if ( (signed int)uNumActors > 0 ) | |
853 { | |
1202 | 854 v0 = pActors.data();//[0].pMonsterInfo.uMovementType; |
0 | 855 do |
856 { | |
1035 | 857 if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long && v0->pMonsterInfo.uMovementType != 5 ) |
0 | 858 { |
90 | 859 v1 = abs(v0->vPosition.x - pParty->vPosition.x); |
860 v2 = abs(v0->vPosition.y - pParty->vPosition.y); | |
861 v3 = abs(v0->vPosition.z - pParty->vPosition.z); | |
322 | 862 if (int_get_vector_length(v1, v2, v3) < 512) |
1060 | 863 Actor::AI_Flee(v4, 4, 0, 0); |
0 | 864 } |
865 ++v4; | |
90 | 866 ++v0; |
0 | 867 } |
868 while ( (signed int)v4 < (signed int)uNumActors ); | |
869 } | |
870 } | |
871 } | |
872 | |
873 //----- (00491BF9) -------------------------------------------------------- | |
874 void Party::ResetPosMiscAndSpellBuffs() | |
875 { | |
876 Party *v1; // esi@1 | |
89 | 877 Player *v2; // edi@1 |
0 | 878 SpellBuff *v3; // ebx@2 |
879 SpellBuff *v4; // esi@5 | |
880 signed int v5; // edi@5 | |
881 signed int v6; // [sp+8h] [bp-8h]@1 | |
882 signed int v7; // [sp+Ch] [bp-4h]@2 | |
883 | |
884 v1 = this; | |
885 this->vPosition.y = 0; | |
886 this->vPosition.z = 0; | |
887 this->vPosition.x = 0; | |
888 this->uFallStartY = 0; | |
889 this->sRotationY = 0; | |
890 this->sRotationX = 0; | |
891 this->uFallSpeed = 0; | |
892 this->field_28 = 0; | |
893 this->uDefaultPartyHeight = 120; | |
894 this->field_14 = 37; | |
120 | 895 this->y_rotation_granularity = 25; |
0 | 896 this->uWalkSpeed = 384; |
122 | 897 this->y_rotation_speed = 90; |
0 | 898 this->field_24 = 5; |
899 this->field_6FC = 0; | |
900 this->field_708 = 15; | |
901 this->field_0 = 25; | |
89 | 902 v2 = this->pPlayers;//[0].pPlayerBuffs; |
0 | 903 v6 = 4; |
904 do | |
905 { | |
89 | 906 v3 = v2->pPlayerBuffs; |
0 | 907 v7 = 24; |
908 do | |
909 { | |
910 v3->Reset(); | |
911 ++v3; | |
912 --v7; | |
913 } | |
914 while ( v7 ); | |
89 | 915 ++v2; |
0 | 916 --v6; |
917 } | |
918 while ( v6 ); | |
919 v4 = v1->pPartyBuffs; | |
920 v5 = 20; | |
921 do | |
922 { | |
923 v4->Reset(); | |
924 ++v4; | |
925 --v5; | |
926 } | |
927 while ( v5 ); | |
928 } | |
929 | |
930 //----- (004909F4) -------------------------------------------------------- | |
130 | 931 void Party::UpdatePlayersAndHirelingsEmotions() |
0 | 932 { |
130 | 933 //Player *v1; // esi@2 |
934 //unsigned int v2; // eax@3 | |
935 //__int16 v3; // cx@5 | |
0 | 936 int v4; // edx@27 |
130 | 937 //signed int v5; // eax@52 |
938 //PlayerFrame *v6; // edx@53 | |
939 //NPCData *v7; // esi@60 | |
940 //signed int v8; // ebp@61 | |
941 //int v9; // ebx@62 | |
942 //unsigned int v10; // edi@62 | |
943 //signed int v11; // [sp+0h] [bp-4h]@2 | |
944 | |
945 //v1 = this->pPlayers;//(char *)&this->pPlayers[0].uExpressionID; | |
946 for (int i = 0; i < 4; ++i) | |
0 | 947 { |
130 | 948 auto player = pPlayers + i; |
949 player->uExpressionTimePassed += (unsigned short)pMiscTimer->uTimeElapsed; | |
950 | |
951 | |
952 auto condition = player->GetMajorConditionIdx(); | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
953 if (condition == Condition_Good || condition == Condition_Zombie) |
0 | 954 { |
130 | 955 if (player->uExpressionTimePassed < player->uExpressionTimeLength) |
956 continue; | |
957 | |
958 player->uExpressionTimePassed = 0; | |
959 if (player->expression != 1 || rand() % 5) | |
0 | 960 { |
130 | 961 player->expression = CHARACTER_EXPRESSION_1; |
962 player->uExpressionTimeLength = rand() % 256 + 32; | |
0 | 963 } |
964 else | |
965 { | |
130 | 966 v4 = rand() % 100; |
967 if (v4 < 25) player->expression = CHARACTER_EXPRESSION_13; | |
968 else if (v4 < 31) player->expression = CHARACTER_EXPRESSION_14; | |
969 else if (v4 < 37) player->expression = CHARACTER_EXPRESSION_15; | |
970 else if (v4 < 43) player->expression = CHARACTER_EXPRESSION_16; | |
971 else if (v4 < 46) player->expression = CHARACTER_EXPRESSION_17; | |
972 else if (v4 < 52) player->expression = CHARACTER_EXPRESSION_18; | |
973 else if (v4 < 58) player->expression = CHARACTER_EXPRESSION_19; | |
974 else if (v4 < 64) player->expression = CHARACTER_EXPRESSION_20; | |
975 else if (v4 < 70) player->expression = CHARACTER_EXPRESSION_54; | |
976 else if (v4 < 76) player->expression = CHARACTER_EXPRESSION_55; | |
977 else if (v4 < 82) player->expression = CHARACTER_EXPRESSION_56; | |
978 else if (v4 < 88) player->expression = CHARACTER_EXPRESSION_57; | |
979 else if (v4 < 94) player->expression = CHARACTER_EXPRESSION_29; | |
980 else player->expression = CHARACTER_EXPRESSION_30; | |
981 } | |
982 | |
983 for (int j = 0; j < pPlayerFrameTable->uNumFrames; ++j) | |
984 { | |
985 auto frame = pPlayerFrameTable->pFrames + j; | |
986 if (frame->expression == player->expression) | |
0 | 987 { |
130 | 988 player->uExpressionTimeLength = 8 * pPlayerFrameTable->pFrames[j].uAnimLength; |
989 break; | |
0 | 990 } |
991 } | |
992 } | |
130 | 993 else if (player->expression != 34 && |
994 player->expression != 35 && | |
995 player->expression != 36 || | |
996 player->uExpressionTimePassed >= player->uExpressionTimeLength) | |
0 | 997 { |
130 | 998 player->uExpressionTimeLength = 0; |
999 player->uExpressionTimePassed = 0; | |
1000 | |
1001 switch (condition) | |
0 | 1002 { |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1003 case Condition_Dead: player->expression = CHARACTER_EXPRESSION_DEAD; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1004 case Condition_Pertified: player->expression = CHARACTER_EXPRESSION_PERTIFIED; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1005 case Condition_Eradicated: player->expression = CHARACTER_EXPRESSION_ERADICATED; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1006 case Condition_Cursed: player->expression = CHARACTER_EXPRESSION_CURSED; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1007 case Condition_Weak: player->expression = CHARACTER_EXPRESSION_WEAK; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1008 case Condition_Sleep: player->expression = CHARACTER_EXPRESSION_SLEEP; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1009 case Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1010 case Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1011 case Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1012 case Condition_Poison1: |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1013 case Condition_Poison2: |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1014 case Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1015 case Condition_Disease1: |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1016 case Condition_Disease2: |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1017 case Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1018 case Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1359
diff
changeset
|
1019 case Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break; |
130 | 1020 default: |
1021 assert(false); | |
0 | 1022 } |
1023 } | |
130 | 1024 } |
1025 | |
1026 | |
1027 for (int i = 0; i < 2; ++i) | |
1028 { | |
1029 auto hireling = pParty->pHirelings + i; | |
291 | 1030 if (!hireling->evt_C) |
130 | 1031 continue; |
1032 | |
291 | 1033 hireling->evt_B += pMiscTimer->uTimeElapsed; |
1034 if (hireling->evt_B >= hireling->evt_C) | |
130 | 1035 { |
291 | 1036 hireling->evt_A = 0; |
1037 hireling->evt_B = 0; | |
1038 hireling->evt_C = 0; | |
130 | 1039 |
1040 assert(sizeof(NPCData) == 0x4C); | |
1041 memset(hireling, 0, sizeof(*hireling)); | |
1042 | |
1043 pParty->field_709 = 0; | |
1035 | 1044 pParty->CountHirelings(); |
1045 viewparams->bRedrawGameUI = true; | |
130 | 1046 } |
0 | 1047 } |
1048 } | |
1049 | |
1050 //----- (00490D02) -------------------------------------------------------- | |
1051 void Party::RestAndHeal() | |
1052 { | |
910 | 1053 Player *pPlayer; // esi@4 |
83 | 1054 ItemGen *v7; // eax@10 |
0 | 1055 signed int v11; // ecx@26 |
1056 signed int v12; // [sp-4h] [bp-1Ch]@26 | |
910 | 1057 bool have_vessels_soul; // [sp+10h] [bp-8h]@10 |
0 | 1058 |
910 | 1059 /* v1 = pParty->pPartyBuffs; |
0 | 1060 do |
1061 { | |
1062 v1->Reset(); | |
1063 ++v1; | |
1064 } | |
1065 while ( (signed int)v1 < (signed int)pParty->pPlayers ); | |
1066 v15 = 0; | |
1067 do | |
1068 { | |
910 | 1069 pPlayer = &pParty->pPlayers[v15]; |
0 | 1070 v3 = 20; |
910 | 1071 v4 = pPlayer->pPlayerBuffs; |
0 | 1072 do |
1073 { | |
1074 v4->Reset(); | |
1075 ++v4; | |
1076 --v3; | |
1077 } | |
910 | 1078 while ( v3 );*/ |
1079 for ( uint i = 0; i < 20; ++i ) | |
1080 pParty->pPartyBuffs[i].Reset(); | |
1081 for ( int pPlayerID = 0; pPlayerID < 4; ++pPlayerID ) | |
1082 { | |
1083 pPlayer = &pParty->pPlayers[pPlayerID]; | |
1084 for ( uint i = 0; i < 20; ++i ) | |
1085 pPlayer->pPlayerBuffs[i].Reset(); | |
1086 | |
1087 pPlayer->Zero(); | |
1088 if ( pPlayer->pConditions[14] || pPlayer->pConditions[15] || pPlayer->pConditions[16] )//Dead/Petrified/Eradicated | |
1089 continue; | |
1090 pPlayer->pConditions[13] = 0;//Unconcious | |
1091 pPlayer->pConditions[4] = 0;//Drunk | |
1092 pPlayer->pConditions[3] = 0;//Fear | |
1093 pPlayer->pConditions[2] = 0;//Sleep | |
1094 pPlayer->pConditions[1] = 0;//Weak | |
1095 pPlayer->uTimeToRecovery = 0; | |
1096 pPlayer->sHealth = pPlayer->GetMaxHealth(); | |
1097 pPlayer->sMana = pPlayer->GetMaxMana(); | |
1098 if ( pPlayer->classType == PLAYER_CLASS_LICH ) | |
0 | 1099 { |
910 | 1100 have_vessels_soul = false; |
1101 v7 = pPlayer->pInventoryItems;//[0].field_1A; | |
1102 for ( uint i = 138; i; --i ) | |
0 | 1103 { |
910 | 1104 if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer == pPlayerID + 1 ) |
1105 have_vessels_soul = true; | |
83 | 1106 ++v7; |
0 | 1107 } |
910 | 1108 if ( !have_vessels_soul ) |
0 | 1109 { |
910 | 1110 pPlayer->sHealth = pPlayer->GetMaxHealth() / 2; |
1111 pPlayer->sMana = pPlayer->GetMaxMana() / 2; | |
0 | 1112 } |
1113 } | |
910 | 1114 if ( !pPlayer->pConditions[17] )// Zombie |
0 | 1115 { |
910 | 1116 if ( pPlayer->pConditions[10] || pPlayer->pConditions[11] ) |
0 | 1117 { |
1118 v11 = 4; | |
1119 v12 = 4; | |
1120 } | |
1121 else | |
1122 { | |
910 | 1123 if ( !pPlayer->pConditions[8] && !pPlayer->pConditions[9] ) |
0 | 1124 { |
910 | 1125 if ( !pPlayer->pConditions[6] && !pPlayer->pConditions[7] ) |
1126 { | |
1127 if ( pPlayer->pConditions[5] ) | |
1128 pPlayer->sMana = 0; | |
1129 UpdatePlayersAndHirelingsEmotions(); | |
1130 continue; | |
1131 } | |
1132 pPlayer->sHealth /= 2; | |
1133 pPlayer->sMana = pPlayer->sMana / 2; | |
1134 if ( pPlayer->pConditions[5] ) | |
1135 pPlayer->sMana = 0; | |
1136 UpdatePlayersAndHirelingsEmotions(); | |
1137 continue; | |
0 | 1138 } |
1139 v11 = 3; | |
1140 v12 = 3; | |
1141 } | |
910 | 1142 pPlayer->sHealth /= v11; |
1143 pPlayer->sMana = pPlayer->sMana / v12; | |
1144 if ( pPlayer->pConditions[5] ) | |
1145 pPlayer->sMana = 0; | |
1146 UpdatePlayersAndHirelingsEmotions(); | |
1147 continue; | |
0 | 1148 } |
910 | 1149 pPlayer->sMana = 0; |
1150 pPlayer->sHealth = pPlayer->sHealth / 2; | |
1151 if ( pPlayer->pConditions[5] ) | |
1152 pPlayer->sMana = 0; | |
130 | 1153 UpdatePlayersAndHirelingsEmotions(); |
0 | 1154 } |
766 | 1155 pParty->days_played_without_rest = 0; |
1295 | 1156 } |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1157 |
1295 | 1158 //----- (004938D1) -------------------------------------------------------- |
1159 void __fastcall Rest(unsigned int uHoursToSleep) | |
1160 { | |
1161 unsigned int v1; // esi@1 | |
1162 double v2; // st7@3 | |
1163 Player **v3; // esi@3 | |
1164 | |
1165 v1 = uHoursToSleep; | |
1166 if ( uHoursToSleep > 240 ) | |
1167 InitializeActors(); | |
1168 v2 = (double)(7680 * v1) * 0.033333335; | |
1169 pParty->uTimePlayed += (signed __int64)v2; | |
1170 v3 = &pPlayers[1]; | |
1171 do | |
1172 { | |
1173 (*v3)->Recover((signed __int64)v2); | |
1174 ++v3; | |
1175 } | |
1176 while ( (signed int)v3 <= (signed int)&pPlayers[4] ); | |
1177 _494035_timed_effects__water_walking_damage__etc(); | |
1178 } | |
1179 //----- (004B1BDB) -------------------------------------------------------- | |
1180 void __stdcall RestAndHeal(__int64 uNumMinutes) | |
1181 { | |
1182 signed __int64 v1; // ST2C_8@1 | |
1183 signed __int64 v2; // qax@1 | |
1184 signed __int64 v3; // ST1C_8@1 | |
1185 unsigned __int64 v4; // qax@1 | |
1186 unsigned int v5; // ebx@1 | |
1187 Player *v6; // ebx@1 | |
1188 | |
1189 pParty->pHirelings[0].bHasUsedTheAbility = 0; | |
1190 pParty->pHirelings[1].bHasUsedTheAbility = 0; | |
1191 pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335); | |
1192 v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375); | |
1193 v2 = v1 / 60 / 60; | |
1194 v3 = v2; | |
1195 v4 = (unsigned int)v2 / 0x18; | |
1196 v5 = (unsigned int)(v4 / 7) >> 2; | |
1197 pParty->uCurrentTimeSecond = v1 % 60; | |
1198 pParty->uCurrentMinute = v1 / 60 % 60; | |
1199 pParty->uCurrentHour = v3 % 24; | |
1200 pParty->uCurrentMonthWeek = v4 / 7 & 3; | |
1201 pParty->uDaysPlayed = (unsigned int)v4 % 0x1C; | |
1202 pParty->uCurrentMonth = v5 % 0xC; | |
1203 pParty->uCurrentYear = v5 / 0xC + game_starting_year; | |
1204 pParty->RestAndHeal(); | |
1205 dword_507B94 = 1; | |
1206 v6 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay; | |
1207 do | |
1208 { | |
1209 v6->uTimeToRecovery = 0; | |
1210 memset(&v6->uTimeToRecovery, 0, 4u); | |
1211 ++v6; | |
1212 } | |
1213 while ( v6 <= &pParty->pPlayers[3] ); | |
1214 pParty->UpdatePlayersAndHirelingsEmotions(); | |
1215 } | |
1297 | 1216 //----- (0041F5BE) -------------------------------------------------------- |
1217 void __cdecl Sleep6Hours() | |
1218 { | |
1219 if ( _506F18_num_hours_to_sleep < 6 ) | |
1220 { | |
1221 pParty->pPlayers[3].SetAsleep(false); | |
1222 pParty->pPlayers[2].SetAsleep(false); | |
1223 pParty->pPlayers[1].SetAsleep(false); | |
1224 pParty->pPlayers[0].SetAsleep(false); | |
1225 if ( _506F18_num_hours_to_sleep ) | |
1226 { | |
1227 Rest(_506F18_num_hours_to_sleep); | |
1228 _506F18_num_hours_to_sleep = 0; | |
1229 LoadActualSkyFrame(); | |
1230 } | |
1231 if ( dword_506F14 == 2 ) | |
1232 { | |
1233 pGUIWindow_CurrentMenu->Release(); | |
1234 pEventTimer->Resume(); | |
1235 if ( pTexture_RestUI_CurrentSkyFrame ) | |
1236 pTexture_RestUI_CurrentSkyFrame->Release(); | |
1237 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
1238 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
1239 pTexture_RestUI_CurrentHourglassFrame = 0; | |
1240 pTexture_RestUI_CurrentSkyFrame = 0; | |
1241 pIcons_LOD->_4114F2(); | |
1242 pIcons_LOD->SyncLoadedFilesCount(); | |
1243 pCurrentScreen = SCREEN_GAME; | |
1244 viewparams->bRedrawGameUI = 1; | |
1245 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
1246 { | |
1247 pOutdoor->UpdateSunlightVectors(); | |
1248 pOutdoor->UpdateFog(); | |
1249 } | |
1250 } | |
1251 dword_506F14 = 0; | |
1252 } | |
1253 else | |
1254 { | |
1255 Rest(6u); | |
1256 _506F18_num_hours_to_sleep -= 6; | |
1257 LoadActualSkyFrame(); | |
1258 } | |
1259 viewparams->bRedrawGameUI = 1; | |
1260 } | |
1261 | |
1295 | 1262 //----- (0047752B) -------------------------------------------------------- |
1263 int __cdecl GetPartyReputation() | |
1264 { | |
1265 DDM_DLV_Header *v0; // ebx@1 | |
1266 signed int v1; // esi@3 | |
1267 | |
1268 v0 = &pOutdoor->ddm; | |
1269 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
1270 v0 = &pIndoor->dlv; | |
1271 v1 = 0; | |
1272 if ( CheckHiredNPCSpeciality(Pirate) ) | |
1273 v1 += 5; | |
1274 if ( CheckHiredNPCSpeciality(Burglar) ) | |
1275 v1 += 5; | |
1276 if ( CheckHiredNPCSpeciality(Gypsy) ) | |
1277 v1 += 5; | |
1278 if ( CheckHiredNPCSpeciality(Duper) ) | |
1279 v1 += 5; | |
1280 if ( CheckHiredNPCSpeciality(FallenWizard) ) | |
1281 v1 += 5; | |
1282 return v1 + v0->uReputation; | |
1296 | 1283 } |
1284 //----- (004269A2) -------------------------------------------------------- | |
1285 void __fastcall GivePartyExp(unsigned int pEXPNum) | |
1286 { | |
1287 signed int pActivePlayerCount; // ecx@1 | |
1288 int pLearningPercent; // eax@13 | |
1289 | |
1290 pActivePlayerCount = 0; | |
1291 for ( uint i = 0; i < 4; ++i ) | |
1292 { | |
1293 if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] ) | |
1294 pActivePlayerCount ++; | |
1295 } | |
1296 if ( pActivePlayerCount ) | |
1297 { | |
1298 pEXPNum = pEXPNum / pActivePlayerCount; | |
1299 for ( uint i = 0; i < 4; ++i ) | |
1300 { | |
1301 if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] ) | |
1302 { | |
1303 if ( pEXPNum ) | |
1304 { | |
1305 pLearningPercent = pParty->pPlayers[i].GetLearningPercent(); | |
1306 pEXPNum = pEXPNum + pEXPNum * pLearningPercent / 100; | |
1307 pParty->pPlayers[i].uExperience += pEXPNum; | |
1308 if ( pParty->pPlayers[i].uExperience > 4000000000i64 ) | |
1309 { | |
1310 pParty->pPlayers[i].uExperience = 0; | |
1311 } | |
1312 } | |
1313 } | |
1314 } | |
1315 } | |
1316 } | |
1297 | 1317 //----- (00420C05) -------------------------------------------------------- |
1318 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) | |
1319 { | |
1320 unsigned int v2; // edi@1 | |
1321 int v3; // ebp@1 | |
1322 unsigned int v4; // esi@1 | |
1323 int v5; // ecx@6 | |
1324 NPCData *v6; // eax@6 | |
1325 signed int v7; // edx@8 | |
1326 signed int v8; // ebx@10 | |
1327 char *v9; // edi@11 | |
1328 signed int v10; // ecx@17 | |
1329 int v11; // eax@21 | |
1330 NPCData *v12; // ecx@21 | |
1331 unsigned int v13; // ecx@23 | |
1332 signed int v14; // [sp+Ch] [bp-4h]@6 | |
1333 | |
1334 v2 = 0; | |
1335 v3 = 0; | |
1336 v4 = uNumGold; | |
1337 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | |
1338 { | |
1339 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | |
1340 { | |
1341 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | |
1342 } | |
1343 else | |
1344 { | |
1345 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | |
1346 pTmpBuf2[0] = 0; | |
1347 } | |
1348 } | |
1349 else | |
1350 { | |
1351 v14 = 0; | |
1352 v5 = 0; | |
1353 v6 = pParty->pHirelings; | |
1354 do | |
1355 { | |
1356 if ( v6->pName ) | |
1357 { | |
1358 v7 = v14++; | |
1359 pTmpBuf[v7] = v5; | |
1360 } | |
1361 ++v6; | |
1362 ++v5; | |
1363 } | |
1364 while ( (signed int)v6 < (signed int)&pParty->pPickedItem ); | |
1365 v8 = 0; | |
1366 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
1367 { | |
1368 v9 = (char *)pNPCStats->pNewNPCData; | |
1369 do | |
1370 { | |
1371 if ( v9[8] & 0x80 | |
1372 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName)) | |
1373 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) ) | |
1374 { | |
1375 v10 = v14++; | |
1376 pTmpBuf[v10] = v8 + 2; | |
1377 } | |
1378 ++v8; | |
1379 v9 += 76; | |
1380 } | |
1381 while ( v8 < (signed int)pNPCStats->uNumNewNPCs ); | |
1382 v2 = 0; | |
1383 } | |
1384 if ( v14 > 0 ) | |
1385 { | |
1386 do | |
1387 { | |
1388 v11 = (unsigned __int8)pTmpBuf[v2]; | |
1389 v12 = &pNPCStats->pNPCData[v11 + 499]; | |
1390 if ( (unsigned __int8)pTmpBuf[v2] < 2 ) | |
1391 v12 = &pParty->pHirelings[v11]; | |
1392 v13 = v12->uProfession; | |
1393 if ( v13 ) | |
1394 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); | |
1395 ++v2; | |
1396 } | |
1397 while ( (signed int)v2 < v14 ); | |
1398 } | |
1399 if ( CheckHiredNPCSpeciality(Factor) ) | |
1400 v4 += (signed int)(10 * v4) / 100; | |
1401 if ( CheckHiredNPCSpeciality(Banker) ) | |
1402 v4 += (signed int)(20 * v4) / 100; | |
1403 if ( CheckHiredNPCSpeciality(Pirate) ) | |
1404 v4 += (signed int)(10 * v4) / 100; | |
1405 if ( v3 ) | |
1406 { | |
1407 v3 = (signed int)(v4 * v3 / 100) / 100; | |
1408 if ( v3 < 1 ) | |
1409 v3 = 1; | |
1410 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | |
1411 } | |
1412 else | |
1413 { | |
1414 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | |
1415 } | |
1416 v2 = 0; | |
1417 } | |
1418 pParty->uNumGold += v4 - v3; | |
1419 pUIAnim_Gold->uAnimTime = v2; | |
1420 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | |
1421 if ( pTmpBuf2[0] ) | |
1422 ShowStatusBarString(pTmpBuf2.data(), 2u); | |
1423 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | |
1424 } | |
1425 //----- (00421B2C) -------------------------------------------------------- | |
1426 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() | |
1427 { | |
1428 unsigned int v0; // eax@2 | |
1429 Texture *v1; // ebx@2 | |
1430 int v2; // eax@3 | |
1431 Player *v3; // esi@5 | |
1432 int v4; // eax@6 | |
1433 unsigned __int16 v5; // dx@11 | |
1434 signed int v6; // eax@11 | |
1435 char *v7; // edi@12 | |
1436 __int16 v8; // ax@16 | |
1437 SpriteObject a1; // [sp+4h] [bp-78h]@11 | |
1438 int v11; // [sp+74h] [bp-8h]@2 | |
1439 int v12; // [sp+78h] [bp-4h]@5 | |
1440 | |
1441 if ( !pParty->pPickedItem.uItemID ) | |
1442 return 1; | |
1443 v0 = pIcons_LOD->LoadTexture( | |
1444 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
1445 TEXTURE_16BIT_PALETTE); | |
1446 v1 = pIcons_LOD->GetTexture(v0); | |
1447 v11 = areWeLoadingTexture; | |
1448 if ( uActiveCharacter | |
1449 && (v2 = pPlayers[uActiveCharacter]->AddItem(-1, pParty->pPickedItem.uItemID)) != 0 ) | |
1450 { | |
1451 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u); | |
1452 pMouse->RemoveHoldingItem(); | |
1453 } | |
1454 else | |
1455 { | |
1456 v12 = 0; | |
1457 v3 = pParty->pPlayers; | |
1458 while ( v3 <= &pParty->pPlayers[3] ) | |
1459 { | |
1460 v4 = v3->AddItem(-1, pParty->pPickedItem.uItemID); | |
1461 if ( v4 ) | |
1462 { | |
1364
9014784ae84f
Fixing an ancient bug in sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents:
1361
diff
changeset
|
1463 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4 - 1], &pParty->pPickedItem, 0x24u); |
1297 | 1464 pMouse->RemoveHoldingItem(); |
1465 break; | |
1466 } | |
1467 ++v12; | |
1468 ++v3; | |
1469 } | |
1470 if ( v12 == 4 ) | |
1471 { | |
1472 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
1473 v6 = 0; | |
1474 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
1475 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
1476 { | |
1477 LOWORD(v6) = 0; | |
1478 } | |
1479 else | |
1480 { | |
1481 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
1482 while ( v5 != *(short *)v7 ) | |
1483 { | |
1484 ++v6; | |
1485 v7 += 56; | |
1486 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
1487 { | |
1488 LOWORD(v6) = 0; | |
1489 break; | |
1490 } | |
1491 } | |
1492 } | |
1493 a1.spell_caster_pid = OBJECT_Player; | |
1494 a1.uObjectDescID = v6; | |
1495 a1.vPosition.y = pParty->vPosition.y; | |
1496 a1.vPosition.x = pParty->vPosition.x; | |
1497 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
1498 a1.uSoundID = 0; | |
1499 a1.uFacing = 0; | |
1500 a1.uAttributes = 8; | |
1501 v8 = pIndoor->GetSector( | |
1502 pParty->vPosition.x, | |
1503 pParty->vPosition.y, | |
1504 pParty->sEyelevel + pParty->vPosition.z); | |
1505 a1.uSpriteFrameID = 0; | |
1506 a1.uSectorID = v8; | |
1507 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24)); | |
1508 a1.Create(pParty->sRotationY, 184, 200, 0); | |
1509 pMouse->RemoveHoldingItem(); | |
1510 } | |
1511 } | |
1512 if ( !v11 ) | |
1513 { | |
1514 v1->Release(); | |
1515 pIcons_LOD->SyncLoadedFilesCount(); | |
1516 } | |
1517 return 1; | |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1518 } |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1519 |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1520 |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1521 bool Party::IsPartyEvil() |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1522 { |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1523 return _449B57_test_bit(_quest_bits, 100); |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1524 } |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1525 |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1526 bool Party::IsPartyGood() |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1527 { |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1340
diff
changeset
|
1528 return _449B57_test_bit(_quest_bits, 99); |
1297 | 1529 } |