annotate Party.cpp @ 2464:104fdbea0386

cleaning project part 2
author zipi
date Sun, 17 Aug 2014 17:49:34 +0100
parents f4af3b203f65
children b054ea5daf45
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2402
diff changeset
4
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2242
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2256
diff changeset
6 #include "ErrorHandling.h"
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
7
0
Ritor1
parents:
diff changeset
8 #include "Party.h"
Ritor1
parents:
diff changeset
9 #include "MapInfo.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 2024
diff changeset
10 #include "Timer.h"
0
Ritor1
parents:
diff changeset
11 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
12 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
13 #include "Mouse.h"
Ritor1
parents:
diff changeset
14 #include "PlayerFrameTable.h"
Ritor1
parents:
diff changeset
15 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
16 #include "Viewport.h"
Ritor1
parents:
diff changeset
17 #include "Actor.h"
Ritor1
parents:
diff changeset
18 #include "GUIWindow.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 141
diff changeset
19 #include "texts.h"
0
Ritor1
parents:
diff changeset
20
Ritor1
parents:
diff changeset
21 #include "mm7_data.h"
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 783
diff changeset
22 #include "MM7.h"
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
23 #include "Outdoor.h"
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
24 #include "Indoor.h"
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
25 #include "Texture.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
26 #include "LOD.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
27 #include "Sprites.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
28 #include "SpriteObject.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
29 #include "ObjectList.h"
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
30 #include "Conditions.h"
0
Ritor1
parents:
diff changeset
31
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
32
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
33 #include "Game.h"
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
34
0
Ritor1
parents:
diff changeset
35 Party *pParty; // idb
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37 struct ActionQueue *pPartyActionQueue = new ActionQueue;
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
40 std::array<bool, 4> playerAlreadyPicked; // byte_AE3368_
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
41 char PickedPlayer2_unused; // byte_AE3369_
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
42 char PickedPlayer3_unused; // byte_AE336A_
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
43 char PickedPlayer4_unused; // byte_AE336B_
0
Ritor1
parents:
diff changeset
44
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
45
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
46
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
47 //----- (0044A56A) --------------------------------------------------------
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
48 void Party::CountHirelings()
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
49 {
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
50 field_70A = 0;
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
51
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
52 for (unsigned int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
53 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1898
diff changeset
54 NPCData* npc = &pNPCStats->pNewNPCData[i];
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
55 if (npc->Hired() &&
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
56 (!pHirelings[0].pName || strcmp(npc->pName, pHirelings[0].pName)))
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
57 {
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
58 if (!pHirelings[1].pName || strcmp(npc->pName, pHirelings[1].pName))
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
59 ++field_70A;
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
60 }
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
61 }
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
62 }
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
63
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
64
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
65 // inlined
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
66 //----- (mm6c::004858D0) --------------------------------------------------
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
67 void Party::Zero()
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
68 {
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
69 uFlags2 = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
70 uNumGoldInBank = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
71
2159
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
72 uCurrentYear = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
73 uCurrentMonth = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
74 uCurrentMonthWeek = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
75 uDaysPlayed = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
76 uCurrentHour = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
77 uCurrentMinute = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
78 uCurrentTimeSecond = 0;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
79
2159
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
80 field_6FC = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
81 days_played_without_rest = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
82 vPosition.x = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
83 vPosition.y = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
84 vPosition.z = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
85 uFallStartY = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
86 sRotationY = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
87 sRotationX = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
88 uFallSpeed = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
89 field_28 = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
90 uDefaultPartyHeight = 192;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
91 field_14_radius = 37;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
92 y_rotation_granularity = 25;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
93 y_rotation_speed = 90;
1425
16a24dc103e7 uninitialized Party::walk_sound_timer leads to crash
Nomad
parents: 1405
diff changeset
94
2159
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
95 uWalkSpeed = 384;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
96 walk_sound_timer = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
97
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
98 field_24 = 5;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
99 field_6FC = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
100 field_708 = 15;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
101 field_0 = 25;
1425
16a24dc103e7 uninitialized Party::walk_sound_timer leads to crash
Nomad
parents: 1405
diff changeset
102
2159
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
103 uNumDeaths = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
104 uNumPrisonTerms = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
105 uNumBountiesCollected = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
106 monster_for_hunting_killed.fill(0);
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
107 monster_id_for_hunting.fill(0);
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
108 memset(_quest_bits, 0, sizeof(_quest_bits));
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
109 pArcomageWins.fill(0);
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
110 uNumArenaPageWins = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
111 uNumArenaSquireWins = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
112 uNumArenaKnightWins = 0;
67a83bc1a7de uDefaultPartyHeight = 192
Ritor1
parents: 2154
diff changeset
113 uNumArenaLordWins = 0;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
114 }
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
115
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
116 //inlined
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
117 //----- (mm6c::0045BE90) --------------------------------------------------
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
118 void ActionQueue::Reset()
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
119 {
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
120 uNumActions = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
121 }
0
Ritor1
parents:
diff changeset
122
Ritor1
parents:
diff changeset
123 //----- (004760C1) --------------------------------------------------------
Ritor1
parents:
diff changeset
124 void ActionQueue::Add(PartyAction action)
Ritor1
parents:
diff changeset
125 {
Ritor1
parents:
diff changeset
126 if (uNumActions < 30)
Ritor1
parents:
diff changeset
127 pActions[uNumActions++] = action;
Ritor1
parents:
diff changeset
128 }
Ritor1
parents:
diff changeset
129
Ritor1
parents:
diff changeset
130 //----- (00497FC5) --------------------------------------------------------
Ritor1
parents:
diff changeset
131 bool Party::_497FC5_check_party_perception_against_level()
Ritor1
parents:
diff changeset
132 {
Ritor1
parents:
diff changeset
133 int uMaxPerception; // edi@1
Ritor1
parents:
diff changeset
134 signed int v5; // eax@3
Ritor1
parents:
diff changeset
135 bool result; // eax@7
Ritor1
parents:
diff changeset
136
Ritor1
parents:
diff changeset
137 uMaxPerception = 0;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
138 for (int i = 0; i < 4; i++)
0
Ritor1
parents:
diff changeset
139 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
140 if ( this->pPlayers[i].CanAct() )
0
Ritor1
parents:
diff changeset
141 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
142 v5 = this->pPlayers[i].GetPerception();
0
Ritor1
parents:
diff changeset
143 if ( v5 > uMaxPerception )
Ritor1
parents:
diff changeset
144 uMaxPerception = v5;
Ritor1
parents:
diff changeset
145 }
Ritor1
parents:
diff changeset
146 }
Ritor1
parents:
diff changeset
147 if ( uLevelMapStatsID && (signed int)uLevelMapStatsID < 77 )
Ritor1
parents:
diff changeset
148 result = uMaxPerception >= 2 * pMapStats->pInfos[uLevelMapStatsID]._per;
Ritor1
parents:
diff changeset
149 else
Ritor1
parents:
diff changeset
150 result = 0;
Ritor1
parents:
diff changeset
151 return result;
Ritor1
parents:
diff changeset
152 }
Ritor1
parents:
diff changeset
153
Ritor1
parents:
diff changeset
154 //----- (004936E1) --------------------------------------------------------
Ritor1
parents:
diff changeset
155 void Party::SetHoldingItem(ItemGen *pItem)
Ritor1
parents:
diff changeset
156 {
Ritor1
parents:
diff changeset
157 sub_421B2C_PlaceInInventory_or_DropPickedItem();
201
30aa44013f7a On Items
Nomad
parents: 198
diff changeset
158 memcpy(&pPickedItem, pItem, sizeof(pPickedItem));
30aa44013f7a On Items
Nomad
parents: 198
diff changeset
159 pMouse->SetCursorBitmapFromItemID(pPickedItem.uItemID);
0
Ritor1
parents:
diff changeset
160 }
Ritor1
parents:
diff changeset
161
Ritor1
parents:
diff changeset
162 //----- (0049370F) --------------------------------------------------------
Ritor1
parents:
diff changeset
163 int Party::GetNextActiveCharacter()
Ritor1
parents:
diff changeset
164 {
Ritor1
parents:
diff changeset
165 int v2; // eax@4
Ritor1
parents:
diff changeset
166 signed int v8; // esi@23
Ritor1
parents:
diff changeset
167 int v12; // [sp+Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
168
Ritor1
parents:
diff changeset
169 v12 = 0;
Ritor1
parents:
diff changeset
170 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
171 {
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2196
diff changeset
172 if ( pTurnEngine->turn_stage != TE_ATTACK || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) != OBJECT_Player)
0
Ritor1
parents:
diff changeset
173 return 0;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 828
diff changeset
174 v2 = PID_ID(pTurnEngine->pQueue[0].uPackedID);
0
Ritor1
parents:
diff changeset
175 return v2 + 1;
Ritor1
parents:
diff changeset
176 }
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
177
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
178 if ( playerAlreadyPicked[0] && playerAlreadyPicked[1] && playerAlreadyPicked[2] && playerAlreadyPicked[3] )
1868
351b4ff10ac1 changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents: 1861
diff changeset
179 playerAlreadyPicked.fill(false);
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
180 for (int i = 0; i < 4; i++)
0
Ritor1
parents:
diff changeset
181 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2044
diff changeset
182 if ( !this->pPlayers[i].CanAct() || this->pPlayers[i].uTimeToRecovery > 0)
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
183 playerAlreadyPicked[i] = true;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
184 else if ( !playerAlreadyPicked[i] )
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
185 {
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
186 playerAlreadyPicked[i] = true;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
187 if (i > 0) //TODO check if this condition really should be here. it is equal to the original source but still seems kind of weird
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
188 return i + 1;
0
Ritor1
parents:
diff changeset
189 break;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
190 }
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
191 }
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
192
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
193 for (int i = 0; i < 4; i++)
0
Ritor1
parents:
diff changeset
194 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2044
diff changeset
195 if ( this->pPlayers[i].CanAct() && this->pPlayers[i].uTimeToRecovery == 0 )
0
Ritor1
parents:
diff changeset
196 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
197 if ( v12 == 0 || this->pPlayers[i].uSpeedBonus > v8 )
0
Ritor1
parents:
diff changeset
198 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
199 v8 = this->pPlayers[i].uSpeedBonus;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
200 v12 = i + 1;
0
Ritor1
parents:
diff changeset
201 }
Ritor1
parents:
diff changeset
202 }
Ritor1
parents:
diff changeset
203 }
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
204 return v12;
0
Ritor1
parents:
diff changeset
205 }
Ritor1
parents:
diff changeset
206
Ritor1
parents:
diff changeset
207
Ritor1
parents:
diff changeset
208 //----- (00493244) --------------------------------------------------------
Ritor1
parents:
diff changeset
209 bool Party::HasItem(unsigned int uItemID)
Ritor1
parents:
diff changeset
210 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
211 for (int player = 0; player < 4; player++)
0
Ritor1
parents:
diff changeset
212 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
213 for (int itemPos = 0; itemPos < 138; itemPos++)
0
Ritor1
parents:
diff changeset
214 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
215 if (pParty->pPlayers[player].pOwnItems[itemPos].uItemID == uItemID)
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
216 return true;
0
Ritor1
parents:
diff changeset
217 }
Ritor1
parents:
diff changeset
218 }
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
219 return false;
0
Ritor1
parents:
diff changeset
220 }
Ritor1
parents:
diff changeset
221
Ritor1
parents:
diff changeset
222
Ritor1
parents:
diff changeset
223 //----- (00492AD5) --------------------------------------------------------
593
Nomad
parents: 592
diff changeset
224 void Party::SetFood(unsigned int uNumFood)
0
Ritor1
parents:
diff changeset
225 {
Ritor1
parents:
diff changeset
226 pUIAnim_Food->uAnimTime = 0;
Ritor1
parents:
diff changeset
227 pParty->uNumFoodRations = uNumFood;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
228 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
229 }
Ritor1
parents:
diff changeset
230
Ritor1
parents:
diff changeset
231 //----- (00492B03) --------------------------------------------------------
Ritor1
parents:
diff changeset
232 void Party::TakeFood(unsigned int uNumFood)
Ritor1
parents:
diff changeset
233 {
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
234 if (pParty->uNumFoodRations <= uNumFood)
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
235 pParty->uNumFoodRations = 0;
0
Ritor1
parents:
diff changeset
236 else
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
237 pParty->uNumFoodRations -= uNumFood;
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
238
0
Ritor1
parents:
diff changeset
239 pUIAnim_Food->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
240 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
241 }
Ritor1
parents:
diff changeset
242
Ritor1
parents:
diff changeset
243 //----- (00492B42) --------------------------------------------------------
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
244 void Party::GiveFood(unsigned int _this)
0
Ritor1
parents:
diff changeset
245 {
Ritor1
parents:
diff changeset
246 pParty->uNumFoodRations += _this;
Ritor1
parents:
diff changeset
247 pUIAnim_Food->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
248 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
249 }
Ritor1
parents:
diff changeset
250
Ritor1
parents:
diff changeset
251 //----- (00492B70) --------------------------------------------------------
Ritor1
parents:
diff changeset
252 void Party::SetGold(unsigned int uNumGold)
Ritor1
parents:
diff changeset
253 {
Ritor1
parents:
diff changeset
254 pParty->uNumGold = uNumGold;
Ritor1
parents:
diff changeset
255 pUIAnim_Gold->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
256 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
257 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
258 }
Ritor1
parents:
diff changeset
259
Ritor1
parents:
diff changeset
260 //----- (00492BB6) --------------------------------------------------------
Ritor1
parents:
diff changeset
261 void Party::TakeGold(unsigned int uNumGold)
Ritor1
parents:
diff changeset
262 {
Ritor1
parents:
diff changeset
263 if ( uNumGold <= pParty->uNumGold )
Ritor1
parents:
diff changeset
264 pParty->uNumGold -= uNumGold;
Ritor1
parents:
diff changeset
265 else
Ritor1
parents:
diff changeset
266 pParty->uNumGold = 0;
Ritor1
parents:
diff changeset
267 pUIAnim_Gold->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
268 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
269 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
270 }
Ritor1
parents:
diff changeset
271
Ritor1
parents:
diff changeset
272 //----- (0049135E) --------------------------------------------------------
Ritor1
parents:
diff changeset
273 unsigned int Party::GetPartyFame()
Ritor1
parents:
diff changeset
274 {
566
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
275 unsigned __int64 total_exp = 0;
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
276 for (uint i = 0; i < 4; ++i)
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
277 total_exp += pPlayers[i].uExperience;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
278 return (unsigned int)(min(total_exp / 1000, UINT_MAX)); //min wasn't present, but could be incorrect without it
0
Ritor1
parents:
diff changeset
279 }
Ritor1
parents:
diff changeset
280
Ritor1
parents:
diff changeset
281 //----- (0049137D) --------------------------------------------------------
Ritor1
parents:
diff changeset
282 void Party::CreateDefaultParty(char bGiveItems)
Ritor1
parents:
diff changeset
283 {
Ritor1
parents:
diff changeset
284 Player *pCharacter; // esi@3
Ritor1
parents:
diff changeset
285 int uSkillIdx; // eax@11
Ritor1
parents:
diff changeset
286 unsigned int v16; // [sp-4h] [bp-44h]@26
Ritor1
parents:
diff changeset
287 signed int uNumPlayers; // [sp+18h] [bp-28h]@1
Ritor1
parents:
diff changeset
288 ItemGen Dst; // [sp+1Ch] [bp-24h]@10
Ritor1
parents:
diff changeset
289
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
290 pHireling1Name[0] = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
291 pHireling2Name[0] = 0;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
292 this->hirelingScrollPosition = 0;
1868
351b4ff10ac1 changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents: 1861
diff changeset
293 memset(&pHirelings, 0, sizeof(pHirelings));
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
294
0
Ritor1
parents:
diff changeset
295 strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
296 this->pPlayers[0].uPrevFace = 17;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
297 this->pPlayers[0].uCurrentFace = 17;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
298 this->pPlayers[0].uPrevVoiceID = 17;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
299 this->pPlayers[0].uVoiceID = 17;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
300 this->pPlayers[0].uMight = 30;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
301 this->pPlayers[0].uIntelligence = 5;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
302 this->pPlayers[0].uWillpower = 5;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
303 this->pPlayers[0].uEndurance = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
304 this->pPlayers[0].uAccuracy = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
305 this->pPlayers[0].uSpeed = 14;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
306 this->pPlayers[0].uLuck = 7;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
307 this->pPlayers[0].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
308 this->pPlayers[0].pActiveSkills[PLAYER_SKILL_ARMSMASTER] = 1; // armsmaster
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
309 this->pPlayers[0].pActiveSkills[PLAYER_SKILL_BOW] = 1; // bow
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
310 this->pPlayers[0].pActiveSkills[PLAYER_SKILL_SWORD] = 1; // sword
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
311 this->pPlayers[1].uPrevFace = 3;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
312 this->pPlayers[1].uCurrentFace = 3;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
313 this->pPlayers[1].uPrevVoiceID = 3;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
314 this->pPlayers[1].uVoiceID = 3;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
315 strcpy(this->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); //Roderic
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
316 this->pPlayers[1].uMight = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
317 this->pPlayers[1].uIntelligence = 9;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
318 this->pPlayers[1].uWillpower = 9;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
319 this->pPlayers[1].uEndurance = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
320 this->pPlayers[1].uAccuracy = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
321 this->pPlayers[1].uSpeed = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
322 this->pPlayers[1].uLuck = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
323 this->pPlayers[1].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
324 this->pPlayers[1].pActiveSkills[PLAYER_SKILL_STEALING] = 1; // stealing
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
325 this->pPlayers[1].pActiveSkills[PLAYER_SKILL_DAGGER] = 1; // dagger
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
326 this->pPlayers[1].pActiveSkills[PLAYER_SKILL_TRAP_DISARM] = 1; // disarm trap
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
327 this->pPlayers[2].uPrevFace = 14;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
328 this->pPlayers[2].uCurrentFace = 14;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
329 this->pPlayers[2].uPrevVoiceID = 14;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
330 this->pPlayers[2].uVoiceID = 14;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
331 strcpy(this->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); // Serena
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
332 this->pPlayers[2].uMight = 12;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
333 this->pPlayers[2].uIntelligence = 9;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
334 this->pPlayers[2].uWillpower = 20;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
335 this->pPlayers[2].uEndurance = 22;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
336 this->pPlayers[2].uAccuracy = 7;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
337 this->pPlayers[2].uSpeed = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
338 this->pPlayers[2].uLuck = 7;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
339 this->pPlayers[2].pActiveSkills[PLAYER_SKILL_ALCHEMY] = 1; // alchemy
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
340 this->pPlayers[2].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
341 this->pPlayers[2].pActiveSkills[PLAYER_SKILL_BODY] = 1; // body
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
342 this->pPlayers[2].pActiveSkills[PLAYER_SKILL_MACE] = 1; // mace
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
343 strcpy(this->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); // Alexis
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
344 this->pPlayers[3].uPrevFace = 10;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
345 this->pPlayers[3].uCurrentFace = 10;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
346 this->pPlayers[3].uEndurance = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
347 this->pPlayers[3].uAccuracy = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
348 this->pPlayers[3].uSpeed = 13;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
349 this->pPlayers[3].uPrevVoiceID = 10;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
350 this->pPlayers[3].uVoiceID = 10;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
351 this->pPlayers[3].uMight = 5;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
352 this->pPlayers[3].uIntelligence = 30;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
353 this->pPlayers[3].uWillpower = 9;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
354 this->pPlayers[3].uLuck = 7;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
355 this->pPlayers[3].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
356 this->pPlayers[3].pActiveSkills[PLAYER_SKILL_AIR] = 1; // air
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
357 this->pPlayers[3].pActiveSkills[PLAYER_SKILL_FIRE] = 1; // fire
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
358 this->pPlayers[3].pActiveSkills[PLAYER_SKILL_STAFF] = 1; // staff
0
Ritor1
parents:
diff changeset
359 for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++)
Ritor1
parents:
diff changeset
360 {
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
361 pCharacter = &pParty->pPlayers[uNumPlayers];
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
362 if (pCharacter->classType == PLAYER_CLASS_KNIGHT)
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
363 pCharacter->sResMagicBase = 10; //player[i].pResMagicBase
321
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
364 pCharacter->lastOpenedSpellbookPage = 0;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
365 for (int i = 0; i < 9; i++)//for Magic Book
0
Ritor1
parents:
diff changeset
366 {
Ritor1
parents:
diff changeset
367 if (pPlayers[uNumPlayers].pActiveSkills[12+i])
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
368 {
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
369 pCharacter->lastOpenedSpellbookPage = i;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
370 break;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
371 }
0
Ritor1
parents:
diff changeset
372 }
Ritor1
parents:
diff changeset
373 pCharacter->uExpressionTimePassed = 0;
Ritor1
parents:
diff changeset
374 Dst.Reset();
Ritor1
parents:
diff changeset
375 if ( bGiveItems )
Ritor1
parents:
diff changeset
376 {
439
6b8118542175 recipie item
Gloval
parents: 398
diff changeset
377 pItemsTable->GenerateItem(2, 40, &Dst); //ring
0
Ritor1
parents:
diff changeset
378 pCharacter->AddItem2(-1, &Dst);
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
379 for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++)
0
Ritor1
parents:
diff changeset
380 {
Ritor1
parents:
diff changeset
381 if ( pCharacter->pActiveSkills[uSkillIdx] )
Ritor1
parents:
diff changeset
382 {
Ritor1
parents:
diff changeset
383 switch ( uSkillIdx )
Ritor1
parents:
diff changeset
384 {
Ritor1
parents:
diff changeset
385 case PLAYER_SKILL_STAFF:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
386 pCharacter->WearItem(ITEM_STAFF_1);
0
Ritor1
parents:
diff changeset
387 break;
Ritor1
parents:
diff changeset
388 case PLAYER_SKILL_SWORD:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
389 pCharacter->WearItem(ITEM_LONGSWORD_1);
0
Ritor1
parents:
diff changeset
390 break;
Ritor1
parents:
diff changeset
391 case PLAYER_SKILL_DAGGER:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
392 pCharacter->WearItem(ITEM_DAGGER_1);
0
Ritor1
parents:
diff changeset
393 break;
Ritor1
parents:
diff changeset
394 case PLAYER_SKILL_AXE:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
395 pCharacter->WearItem(ITEM_AXE_1);
0
Ritor1
parents:
diff changeset
396 break;
Ritor1
parents:
diff changeset
397 case PLAYER_SKILL_SPEAR:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
398 pCharacter->WearItem(ITEM_SPEAR_1);
0
Ritor1
parents:
diff changeset
399 break;
Ritor1
parents:
diff changeset
400 case PLAYER_SKILL_BOW:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
401 pCharacter->WearItem(ITEM_CROSSBOW_1);
0
Ritor1
parents:
diff changeset
402 break;
Ritor1
parents:
diff changeset
403 case PLAYER_SKILL_MACE:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
404 pCharacter->WearItem(ITEM_MACE_1);
0
Ritor1
parents:
diff changeset
405 break;
Ritor1
parents:
diff changeset
406 case PLAYER_SKILL_SHIELD:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
407 pCharacter->WearItem(ITEM_BUCKLER_1);
0
Ritor1
parents:
diff changeset
408 break;
Ritor1
parents:
diff changeset
409 case PLAYER_SKILL_LEATHER:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
410 pCharacter->WearItem(ITEM_LEATHER_1);
0
Ritor1
parents:
diff changeset
411 break;
Ritor1
parents:
diff changeset
412 case PLAYER_SKILL_CHAIN:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
413 pCharacter->WearItem(ITEM_CHAINMAIL_1);
0
Ritor1
parents:
diff changeset
414 break;
Ritor1
parents:
diff changeset
415 case PLAYER_SKILL_PLATE:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
416 pCharacter->WearItem(ITEM_PLATE_1);
0
Ritor1
parents:
diff changeset
417 break;
Ritor1
parents:
diff changeset
418 case PLAYER_SKILL_FIRE:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
419 pCharacter->AddItem(-1, ITEM_SPELLBOOK_FIRE_STRIKE);
0
Ritor1
parents:
diff changeset
420 break;
Ritor1
parents:
diff changeset
421 case PLAYER_SKILL_AIR:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
422 pCharacter->AddItem(-1, ITEM_SPELLBOOK_AIR_FEATHER_FALL);
0
Ritor1
parents:
diff changeset
423 break;
Ritor1
parents:
diff changeset
424 case PLAYER_SKILL_WATER:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
425 pCharacter->AddItem(-1, ITEM_SPELLBOOK_WATER_POISON_SPRAY);
0
Ritor1
parents:
diff changeset
426 break;
Ritor1
parents:
diff changeset
427 case PLAYER_SKILL_EARTH:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
428 pCharacter->AddItem(-1, ITEM_SPELLBOOK_EARTH_SLOW);
0
Ritor1
parents:
diff changeset
429 break;
Ritor1
parents:
diff changeset
430 case PLAYER_SKILL_SPIRIT:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
431 pCharacter->AddItem(-1, ITEM_SPELLBOOK_SPIRIT_BLESS);
0
Ritor1
parents:
diff changeset
432 break;
Ritor1
parents:
diff changeset
433 case PLAYER_SKILL_MIND:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
434 pCharacter->AddItem(-1, ITEM_SPELLBOOK_MIND_MIND_BLAST);
0
Ritor1
parents:
diff changeset
435 break;
Ritor1
parents:
diff changeset
436 case PLAYER_SKILL_BODY:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
437 pCharacter->AddItem(-1, ITEM_SPELLBOOK_BODY_FIRST_AID);
0
Ritor1
parents:
diff changeset
438 break;
Ritor1
parents:
diff changeset
439 case PLAYER_SKILL_ITEM_ID:
Ritor1
parents:
diff changeset
440 case PLAYER_SKILL_REPAIR:
Ritor1
parents:
diff changeset
441 case PLAYER_SKILL_MEDITATION:
Ritor1
parents:
diff changeset
442 case PLAYER_SKILL_PERCEPTION:
Ritor1
parents:
diff changeset
443 case PLAYER_SKILL_DIPLOMACY:
Ritor1
parents:
diff changeset
444 case PLAYER_SKILL_TRAP_DISARM:
Ritor1
parents:
diff changeset
445 case PLAYER_SKILL_LEARNING:
Ritor1
parents:
diff changeset
446 pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
Ritor1
parents:
diff changeset
447 v16 = 5 * (rand() % 3 + 40); // simple reagent
Ritor1
parents:
diff changeset
448 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
449 break;
Ritor1
parents:
diff changeset
450 case PLAYER_SKILL_DODGE:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
451 pCharacter->AddItem(-1, ITEM_BOOTS_1);
0
Ritor1
parents:
diff changeset
452 break;
Ritor1
parents:
diff changeset
453 case PLAYER_SKILL_UNARMED:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
454 pCharacter->AddItem(-1, ITEM_GAUNTLETS_1);
0
Ritor1
parents:
diff changeset
455 break;
Ritor1
parents:
diff changeset
456 default:
Ritor1
parents:
diff changeset
457 break;
Ritor1
parents:
diff changeset
458 }
Ritor1
parents:
diff changeset
459 }
Ritor1
parents:
diff changeset
460 }
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
461 for (int i = 0; i < 138; i++)
0
Ritor1
parents:
diff changeset
462 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
463 if ( pCharacter->pInventoryItemList[i].uItemID != 0)
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
464 pCharacter->pInventoryItemList[i].SetIdentified();
0
Ritor1
parents:
diff changeset
465 }
Ritor1
parents:
diff changeset
466 }
Ritor1
parents:
diff changeset
467 pCharacter->sHealth = pCharacter->GetMaxHealth();
Ritor1
parents:
diff changeset
468 pCharacter->sMana = pCharacter->GetMaxMana();
Ritor1
parents:
diff changeset
469 }
Ritor1
parents:
diff changeset
470 }
Ritor1
parents:
diff changeset
471
Ritor1
parents:
diff changeset
472 //----- (004917CE) --------------------------------------------------------
Ritor1
parents:
diff changeset
473 int Party::Reset()
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
474 {
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
475 Zero();
0
Ritor1
parents:
diff changeset
476
Ritor1
parents:
diff changeset
477 field_708 = 15;
Ritor1
parents:
diff changeset
478 sEyelevel = 160;
Ritor1
parents:
diff changeset
479 uNumGold = 200;
Ritor1
parents:
diff changeset
480 uNumFoodRations = 7;
Ritor1
parents:
diff changeset
481
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
482
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 351
diff changeset
483 alignment = PartyAlignment_Neutral;
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 351
diff changeset
484 SetUserInterface(alignment, true);
0
Ritor1
parents:
diff changeset
485
Ritor1
parents:
diff changeset
486 uTimePlayed = 0x21C00u;
Ritor1
parents:
diff changeset
487 uLastRegenerationTime = 0x21C00;
Ritor1
parents:
diff changeset
488
Ritor1
parents:
diff changeset
489 bTurnBasedModeOn = false;
Ritor1
parents:
diff changeset
490
Ritor1
parents:
diff changeset
491 uActiveCharacter = 1;
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1840
diff changeset
492 ::pPlayers.ZerothIndex() = &pPlayers[0];
0
Ritor1
parents:
diff changeset
493 for (uint i = 0; i < 4; ++i)
Ritor1
parents:
diff changeset
494 ::pPlayers[i + 1] = &pPlayers[i];
Ritor1
parents:
diff changeset
495
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
496 pPlayers[0].Reset(PLAYER_CLASS_KNIGHT);
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
497 pPlayers[1].Reset(PLAYER_CLASS_THEIF);
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
498 pPlayers[2].Reset(PLAYER_CLASS_CLERIC);
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
499 pPlayers[3].Reset(PLAYER_CLASS_SORCERER);
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
500 pPlayers[0].uCurrentFace = 17;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
501 pPlayers[0].uPrevVoiceID = 17;
0
Ritor1
parents:
diff changeset
502 pPlayers[0].uVoiceID = 17;
Ritor1
parents:
diff changeset
503 pPlayers[0].SetInitialStats();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
504
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
505 pPlayers[0].uSex = pPlayers[0].GetSexByVoice();
0
Ritor1
parents:
diff changeset
506 pPlayers[0].RandomizeName();
Ritor1
parents:
diff changeset
507 strcpy(pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]);
Ritor1
parents:
diff changeset
508
Ritor1
parents:
diff changeset
509
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
510 pPlayers[1].uCurrentFace = 3;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
511 pPlayers[1].uPrevVoiceID = 3;
0
Ritor1
parents:
diff changeset
512 pPlayers[1].uVoiceID = 3;
Ritor1
parents:
diff changeset
513 pPlayers[1].SetInitialStats();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
514 pPlayers[1].uSex = pPlayers[1].GetSexByVoice();
0
Ritor1
parents:
diff changeset
515 pPlayers[1].RandomizeName();
Ritor1
parents:
diff changeset
516 strcpy(pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]);
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
517 pPlayers[2].uCurrentFace = 14;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
518 pPlayers[2].uPrevVoiceID = 14;
0
Ritor1
parents:
diff changeset
519 pPlayers[2].uVoiceID = 14;
Ritor1
parents:
diff changeset
520 pPlayers[2].SetInitialStats();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
521 pPlayers[2].uSex = pPlayers[3].GetSexByVoice();
0
Ritor1
parents:
diff changeset
522 pPlayers[2].RandomizeName();
Ritor1
parents:
diff changeset
523 strcpy(pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]);
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
524 pPlayers[3].uCurrentFace = 10;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
525 pPlayers[3].uPrevVoiceID = 10;
0
Ritor1
parents:
diff changeset
526 pPlayers[3].uVoiceID = 10;
Ritor1
parents:
diff changeset
527 pPlayers[3].SetInitialStats();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
528 pPlayers[3].uSex = pPlayers[3].GetSexByVoice();
0
Ritor1
parents:
diff changeset
529 pPlayers[3].RandomizeName();
Ritor1
parents:
diff changeset
530 strcpy(pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]);
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
531
0
Ritor1
parents:
diff changeset
532 for (uint i = 0; i < 4; ++i)
Ritor1
parents:
diff changeset
533 {
Ritor1
parents:
diff changeset
534 pPlayers[i].uTimeToRecovery = 0;
Ritor1
parents:
diff changeset
535 for (uint j = 0; j < 20; ++j)
Ritor1
parents:
diff changeset
536 pPlayers[i].pConditions[j] = 0;
Ritor1
parents:
diff changeset
537
Ritor1
parents:
diff changeset
538 for (uint j = 0; j < 24; ++j)
Ritor1
parents:
diff changeset
539 pPlayers[i].pPlayerBuffs[j].Reset();
Ritor1
parents:
diff changeset
540
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
541 pPlayers[i].expression = CHARACTER_EXPRESSION_1;
0
Ritor1
parents:
diff changeset
542 pPlayers[i].uExpressionTimePassed = 0;
Ritor1
parents:
diff changeset
543 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128;
Ritor1
parents:
diff changeset
544 }
Ritor1
parents:
diff changeset
545
Ritor1
parents:
diff changeset
546 for (uint i = 1; i < 20; ++i)
Ritor1
parents:
diff changeset
547 pPartyBuffs[i].Reset();
Ritor1
parents:
diff changeset
548
Ritor1
parents:
diff changeset
549
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
550 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; // default character ui - stats
0
Ritor1
parents:
diff changeset
551 uFlags = 0;
1868
351b4ff10ac1 changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents: 1861
diff changeset
552 memset(_autonote_bits, 0, sizeof(_autonote_bits));
2196
628a0ad87136 Some more PVS error fixing
Grumpy7
parents: 2189
diff changeset
553 memset(_quest_bits, 0, sizeof(_quest_bits));
1868
351b4ff10ac1 changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents: 1861
diff changeset
554 pIsArtifactFound.fill(0);
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
555 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
556 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
557 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
558 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_PLATE_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
559 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
560 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1);
0
Ritor1
parents:
diff changeset
561
1868
351b4ff10ac1 changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents: 1861
diff changeset
562 PartyTimes._shop_ban_times.fill(0);
0
Ritor1
parents:
diff changeset
563
Ritor1
parents:
diff changeset
564 memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu);
Ritor1
parents:
diff changeset
565 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
655
6a2d29c21d09 Margaret disappear fixed
zipi
parents: 599
diff changeset
566 pNPCStats->pNewNPCData[3].uFlags |= 128;//|= 0x80u; Lady Margaret
0
Ritor1
parents:
diff changeset
567 _494035_timed_effects__water_walking_damage__etc();
Ritor1
parents:
diff changeset
568 pEventTimer->Pause();
Ritor1
parents:
diff changeset
569 return 0;
Ritor1
parents:
diff changeset
570 }
Ritor1
parents:
diff changeset
571
Ritor1
parents:
diff changeset
572
Ritor1
parents:
diff changeset
573 //----- (0043AD34) --------------------------------------------------------
Ritor1
parents:
diff changeset
574 void Party::Yell()
Ritor1
parents:
diff changeset
575 {
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
576 Actor *v0; // esi@5
0
Ritor1
parents:
diff changeset
577 int v1; // edi@9
Ritor1
parents:
diff changeset
578 int v2; // ebx@9
Ritor1
parents:
diff changeset
579 int v3; // eax@9
Ritor1
parents:
diff changeset
580
1167
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
581 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0 )
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
582 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
0
Ritor1
parents:
diff changeset
583 if ( pParty->bTurnBasedModeOn != 1 )
Ritor1
parents:
diff changeset
584 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
585 for (unsigned int i = 0; i < uNumActors; i++)
0
Ritor1
parents:
diff changeset
586 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
587 v0 = &pActors[i];
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
588 if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long && v0->pMonsterInfo.uMovementType != 5 )
0
Ritor1
parents:
diff changeset
589 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
590 v1 = abs(v0->vPosition.x - pParty->vPosition.x);
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
591 v2 = abs(v0->vPosition.y - pParty->vPosition.y);
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
592 v3 = abs(v0->vPosition.z - pParty->vPosition.z);
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
593 if (int_get_vector_length(v1, v2, v3) < 512)
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
594 Actor::AI_Flee(i, 4, 0, 0);
0
Ritor1
parents:
diff changeset
595 }
Ritor1
parents:
diff changeset
596 }
Ritor1
parents:
diff changeset
597 }
Ritor1
parents:
diff changeset
598 }
Ritor1
parents:
diff changeset
599
Ritor1
parents:
diff changeset
600 //----- (00491BF9) --------------------------------------------------------
Ritor1
parents:
diff changeset
601 void Party::ResetPosMiscAndSpellBuffs()
Ritor1
parents:
diff changeset
602 {
Ritor1
parents:
diff changeset
603 this->vPosition.y = 0;
Ritor1
parents:
diff changeset
604 this->vPosition.z = 0;
Ritor1
parents:
diff changeset
605 this->vPosition.x = 0;
Ritor1
parents:
diff changeset
606 this->uFallStartY = 0;
Ritor1
parents:
diff changeset
607 this->sRotationY = 0;
Ritor1
parents:
diff changeset
608 this->sRotationX = 0;
Ritor1
parents:
diff changeset
609 this->uFallSpeed = 0;
Ritor1
parents:
diff changeset
610 this->field_28 = 0;
Ritor1
parents:
diff changeset
611 this->uDefaultPartyHeight = 120;
1546
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1545
diff changeset
612 this->field_14_radius = 37;
120
fe0e317c0de0 Camera rotation fixed. Sorta
Nomad
parents: 109
diff changeset
613 this->y_rotation_granularity = 25;
0
Ritor1
parents:
diff changeset
614 this->uWalkSpeed = 384;
122
48bea61a12a5 Camera rotation fixed (even more!)
Nomad
parents: 120
diff changeset
615 this->y_rotation_speed = 90;
0
Ritor1
parents:
diff changeset
616 this->field_24 = 5;
Ritor1
parents:
diff changeset
617 this->field_6FC = 0;
Ritor1
parents:
diff changeset
618 this->field_708 = 15;
Ritor1
parents:
diff changeset
619 this->field_0 = 25;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
620
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1898
diff changeset
621 for (int playerId = 0; playerId < 4; playerId++)
0
Ritor1
parents:
diff changeset
622 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1898
diff changeset
623 for (int buffId = 0; buffId < 24; buffId++)
0
Ritor1
parents:
diff changeset
624 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
625 this->pPlayers[playerId].pPlayerBuffs[buffId].Reset();
0
Ritor1
parents:
diff changeset
626 }
Ritor1
parents:
diff changeset
627 }
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1898
diff changeset
628 for (int buffId = 0; buffId < 20; buffId++)
0
Ritor1
parents:
diff changeset
629 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
630 this->pPartyBuffs[buffId].Reset();
0
Ritor1
parents:
diff changeset
631 }
Ritor1
parents:
diff changeset
632 }
Ritor1
parents:
diff changeset
633
Ritor1
parents:
diff changeset
634 //----- (004909F4) --------------------------------------------------------
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
635 void Party::UpdatePlayersAndHirelingsEmotions()
0
Ritor1
parents:
diff changeset
636 {
Ritor1
parents:
diff changeset
637 int v4; // edx@27
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
638
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
639 for (int i = 0; i < 4; ++i)
0
Ritor1
parents:
diff changeset
640 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
641 Player* player = &pPlayers[i];
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
642 player->uExpressionTimePassed += (unsigned short)pMiscTimer->uTimeElapsed;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
643
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1898
diff changeset
644 uint condition = player->GetMajorConditionIdx();
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
645 if (condition == Condition_Good || condition == Condition_Zombie)
0
Ritor1
parents:
diff changeset
646 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
647 if (player->uExpressionTimePassed < player->uExpressionTimeLength)
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
648 continue;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
649
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
650 player->uExpressionTimePassed = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
651 if (player->expression != 1 || rand() % 5)
0
Ritor1
parents:
diff changeset
652 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
653 player->expression = CHARACTER_EXPRESSION_1;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
654 player->uExpressionTimeLength = rand() % 256 + 32;
0
Ritor1
parents:
diff changeset
655 }
Ritor1
parents:
diff changeset
656 else
Ritor1
parents:
diff changeset
657 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
658 v4 = rand() % 100;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
659 if (v4 < 25) player->expression = CHARACTER_EXPRESSION_13;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
660 else if (v4 < 31) player->expression = CHARACTER_EXPRESSION_14;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
661 else if (v4 < 37) player->expression = CHARACTER_EXPRESSION_15;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
662 else if (v4 < 43) player->expression = CHARACTER_EXPRESSION_16;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
663 else if (v4 < 46) player->expression = CHARACTER_EXPRESSION_17;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
664 else if (v4 < 52) player->expression = CHARACTER_EXPRESSION_18;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
665 else if (v4 < 58) player->expression = CHARACTER_EXPRESSION_19;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
666 else if (v4 < 64) player->expression = CHARACTER_EXPRESSION_20;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
667 else if (v4 < 70) player->expression = CHARACTER_EXPRESSION_54;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
668 else if (v4 < 76) player->expression = CHARACTER_EXPRESSION_55;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
669 else if (v4 < 82) player->expression = CHARACTER_EXPRESSION_56;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
670 else if (v4 < 88) player->expression = CHARACTER_EXPRESSION_57;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
671 else if (v4 < 94) player->expression = CHARACTER_EXPRESSION_29;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
672 else player->expression = CHARACTER_EXPRESSION_30;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
673 }
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
674
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
675 for (unsigned int j = 0; j < pPlayerFrameTable->uNumFrames; ++j)
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
676 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
677 PlayerFrame* frame = &pPlayerFrameTable->pFrames[j];
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
678 if (frame->expression == player->expression)
0
Ritor1
parents:
diff changeset
679 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
680 player->uExpressionTimeLength = 8 * frame->uAnimLength;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
681 break;
0
Ritor1
parents:
diff changeset
682 }
Ritor1
parents:
diff changeset
683 }
Ritor1
parents:
diff changeset
684 }
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
685 else if (player->expression != CHARACTER_EXPRESSION_DMGRECVD_MINOR &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
686 player->expression != CHARACTER_EXPRESSION_DMGRECVD_MODERATE &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
687 player->expression != CHARACTER_EXPRESSION_DMGRECVD_MAJOR ||
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
688 player->uExpressionTimePassed >= player->uExpressionTimeLength)
0
Ritor1
parents:
diff changeset
689 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
690 player->uExpressionTimeLength = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
691 player->uExpressionTimePassed = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
692
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
693 switch (condition)
0
Ritor1
parents:
diff changeset
694 {
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
695 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
696 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
697 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
698 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
699 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
700 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
701 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
702 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
703 case Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break;
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
704 case Condition_Poison_Weak:
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
705 case Condition_Poison_Medium:
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
706 case Condition_Poison_Severe: player->expression = CHARACTER_EXPRESSION_POISONED; break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
707 case Condition_Disease_Weak:
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
708 case Condition_Disease_Medium:
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
709 case Condition_Disease_Severe: player->expression = CHARACTER_EXPRESSION_DISEASED; break;
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
710 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
711 case Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
712 default:
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1522
diff changeset
713 Error("Invalid condition: %u", condition);
0
Ritor1
parents:
diff changeset
714 }
Ritor1
parents:
diff changeset
715 }
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
716 }
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
717
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
718 for (int i = 0; i < 2; ++i)
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
719 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
720 NPCData* hireling = &pParty->pHirelings[i];
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
721 if (!hireling->evt_C)
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
722 continue;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
723
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
724 hireling->evt_B += pMiscTimer->uTimeElapsed;
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
725 if (hireling->evt_B >= hireling->evt_C)
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
726 {
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
727 hireling->evt_A = 0;
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
728 hireling->evt_B = 0;
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
729 hireling->evt_C = 0;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
730
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1522
diff changeset
731 Assert(sizeof(NPCData) == 0x4C);
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
732 memset(hireling, 0, sizeof(*hireling));
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
733
1793
4dee76d79c78 dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents: 1747
diff changeset
734 pParty->hirelingScrollPosition = 0;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
735 pParty->CountHirelings();
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
736 viewparams->bRedrawGameUI = true;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
737 }
0
Ritor1
parents:
diff changeset
738 }
Ritor1
parents:
diff changeset
739 }
Ritor1
parents:
diff changeset
740
Ritor1
parents:
diff changeset
741 //----- (00490D02) --------------------------------------------------------
Ritor1
parents:
diff changeset
742 void Party::RestAndHeal()
Ritor1
parents:
diff changeset
743 {
910
Ritor1
parents: 860
diff changeset
744 Player *pPlayer; // esi@4
Ritor1
parents: 860
diff changeset
745 bool have_vessels_soul; // [sp+10h] [bp-8h]@10
0
Ritor1
parents:
diff changeset
746
910
Ritor1
parents: 860
diff changeset
747 for ( uint i = 0; i < 20; ++i )
Ritor1
parents: 860
diff changeset
748 pParty->pPartyBuffs[i].Reset();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
749
910
Ritor1
parents: 860
diff changeset
750 for ( int pPlayerID = 0; pPlayerID < 4; ++pPlayerID )
Ritor1
parents: 860
diff changeset
751 {
Ritor1
parents: 860
diff changeset
752 pPlayer = &pParty->pPlayers[pPlayerID];
Ritor1
parents: 860
diff changeset
753 for ( uint i = 0; i < 20; ++i )
Ritor1
parents: 860
diff changeset
754 pPlayer->pPlayerBuffs[i].Reset();
Ritor1
parents: 860
diff changeset
755
Ritor1
parents: 860
diff changeset
756 pPlayer->Zero();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
757 if ( pPlayer->pConditions[Condition_Dead] || pPlayer->pConditions[Condition_Pertified] || pPlayer->pConditions[Condition_Eradicated] )//Dead/Petrified/Eradicated
910
Ritor1
parents: 860
diff changeset
758 continue;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
759 pPlayer->pConditions[Condition_Unconcious] = 0;//Unconcious
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
760 pPlayer->pConditions[Condition_Drunk] = 0;//Drunk
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
761 pPlayer->pConditions[Condition_Fear] = 0;//Fear
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
762 pPlayer->pConditions[Condition_Sleep] = 0;//Sleep
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
763 pPlayer->pConditions[Condition_Weak] = 0;//Weak
910
Ritor1
parents: 860
diff changeset
764 pPlayer->uTimeToRecovery = 0;
Ritor1
parents: 860
diff changeset
765 pPlayer->sHealth = pPlayer->GetMaxHealth();
Ritor1
parents: 860
diff changeset
766 pPlayer->sMana = pPlayer->GetMaxMana();
Ritor1
parents: 860
diff changeset
767 if ( pPlayer->classType == PLAYER_CLASS_LICH )
0
Ritor1
parents:
diff changeset
768 {
910
Ritor1
parents: 860
diff changeset
769 have_vessels_soul = false;
2189
0e2bee275f60 CastSpell continue
Ritor1
parents: 2187
diff changeset
770 for ( uint i = 0; i < 126; i++ )
0
Ritor1
parents:
diff changeset
771 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
772 if ( pPlayer->pInventoryItemList[i].uItemID == ITEM_LICH_JAR_FULL && pPlayer->pInventoryItemList[i].uHolderPlayer == pPlayerID + 1 )
910
Ritor1
parents: 860
diff changeset
773 have_vessels_soul = true;
0
Ritor1
parents:
diff changeset
774 }
910
Ritor1
parents: 860
diff changeset
775 if ( !have_vessels_soul )
0
Ritor1
parents:
diff changeset
776 {
910
Ritor1
parents: 860
diff changeset
777 pPlayer->sHealth = pPlayer->GetMaxHealth() / 2;
Ritor1
parents: 860
diff changeset
778 pPlayer->sMana = pPlayer->GetMaxMana() / 2;
0
Ritor1
parents:
diff changeset
779 }
Ritor1
parents:
diff changeset
780 }
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
781
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
782 if (pPlayer->pConditions[Condition_Zombie])
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
783 {
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
784 pPlayer->sMana = 0;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
785 pPlayer->sHealth /= 2;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
786 }
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
787 else if ( pPlayer->pConditions[Condition_Poison_Severe] || pPlayer->pConditions[Condition_Disease_Severe] )
0
Ritor1
parents:
diff changeset
788 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
789 pPlayer->sHealth /= 4;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
790 pPlayer->sMana /= 4;
0
Ritor1
parents:
diff changeset
791 }
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
792 else if ( pPlayer->pConditions[Condition_Poison_Medium] || pPlayer->pConditions[Condition_Disease_Medium] )
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
793 {
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
794 pPlayer->sHealth /= 3;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
795 pPlayer->sMana /= 3;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
796 }
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2159
diff changeset
797 else if ( pPlayer->pConditions[Condition_Poison_Weak] || pPlayer->pConditions[Condition_Disease_Weak] )
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
798 {
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
799 pPlayer->sHealth /= 2;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
800 pPlayer->sMana /= 2;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
801 }
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
802 if ( pPlayer->pConditions[Condition_Insane] )
910
Ritor1
parents: 860
diff changeset
803 pPlayer->sMana = 0;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
804 UpdatePlayersAndHirelingsEmotions();
0
Ritor1
parents:
diff changeset
805 }
766
a464d28566a6 days_played_without_rest
Nomad
parents: 659
diff changeset
806 pParty->days_played_without_rest = 0;
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
807 }
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
808
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
809 //----- (004938D1) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
810 void __fastcall Rest(unsigned int uHoursToSleep)
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
811 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
812 signed __int64 v2; // st7@3
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
813
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
814 if ( uHoursToSleep > 240 )
2338
1e865e8690ba Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents: 2336
diff changeset
815 Actor::InitializeActors();
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
816 v2 = (signed __int64)((7680 * uHoursToSleep) * 0.033333335);
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
817 pParty->uTimePlayed += v2;
2063
7890930801a8 small fix
Ritor1
parents: 2062
diff changeset
818 for (int i = 1; i <= 4; i++)
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
819 {
2063
7890930801a8 small fix
Ritor1
parents: 2062
diff changeset
820 pPlayers[i]->Recover((int)v2);
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
821 }
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
822 _494035_timed_effects__water_walking_damage__etc();
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
823 }
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
824 //----- (004B1BDB) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
825 void RestAndHeal(__int64 uNumMinutes)
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
826 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
827 signed __int64 v1; // ST2C_8@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
828 signed __int64 v2; // qax@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
829 unsigned __int64 v4; // qax@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
830 unsigned int v5; // ebx@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
831
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
832 pParty->pHirelings[0].bHasUsedTheAbility = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
833 pParty->pHirelings[1].bHasUsedTheAbility = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
834 pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335);
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
835 v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
836 v2 = v1 / 60 / 60;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
837 v4 = (unsigned int)v2 / 0x18;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
838 v5 = (unsigned int)(v4 / 7) >> 2;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
839 pParty->uCurrentTimeSecond = v1 % 60;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
840 pParty->uCurrentMinute = v1 / 60 % 60;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
841 pParty->uCurrentHour = v2 % 24;
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
842 pParty->uCurrentMonthWeek = v4 / 7 & 3;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
843 pParty->uDaysPlayed = (unsigned int)v4 % 0x1C;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
844 pParty->uCurrentMonth = v5 % 0xC;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
845 pParty->uCurrentYear = v5 / 0xC + game_starting_year;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
846 pParty->RestAndHeal();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
847
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
848 for (int i = 0; i < 4; i++)
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
849 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
850 pParty->pPlayers[i].uTimeToRecovery = 0;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
851 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
852 pParty->pPlayers[i].uNumArmageddonCasts = 0;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
853 pParty->pPlayers[i].uNumFireSpikeCasts = 0;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
854 pParty->pPlayers[i].field_1B3B = 0;
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
855 }
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
856 pParty->UpdatePlayersAndHirelingsEmotions();
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
857 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
858 //----- (0041F5BE) --------------------------------------------------------
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2338
diff changeset
859 void Party::Sleep6Hours()
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
860 {
1396
e6908823897f Research on #62
Nomad
parents: 1384
diff changeset
861 if ( _506F18_num_minutes_to_sleep < 6 )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
862 {
1396
e6908823897f Research on #62
Nomad
parents: 1384
diff changeset
863 if ( _506F18_num_minutes_to_sleep )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
864 {
1396
e6908823897f Research on #62
Nomad
parents: 1384
diff changeset
865 Rest(_506F18_num_minutes_to_sleep);
e6908823897f Research on #62
Nomad
parents: 1384
diff changeset
866 _506F18_num_minutes_to_sleep = 0;
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2338
diff changeset
867 OutdoorLocation::LoadActualSkyFrame();
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
868 }
1522
f3802824f576 Style :-)
yoctozepto
parents: 1521
diff changeset
869 if ( dword_506F14 == 2 )
f3802824f576 Style :-)
yoctozepto
parents: 1521
diff changeset
870 {
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2355
diff changeset
871 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
1521
5c7316d3e038 Oopsie :-)
yoctozepto
parents: 1520
diff changeset
872 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
873 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
874 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
875 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
876 Rest(6u);
1396
e6908823897f Research on #62
Nomad
parents: 1384
diff changeset
877 _506F18_num_minutes_to_sleep -= 6;
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2338
diff changeset
878 OutdoorLocation::LoadActualSkyFrame();
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
879 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
880 viewparams->bRedrawGameUI = 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
881 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
882
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2256
diff changeset
883 bool TestPartyQuestBit( PARTY_QUEST_BITS bit )
d6887ee81068 header file include cleanup
Grumpy7
parents: 2256
diff changeset
884 {
d6887ee81068 header file include cleanup
Grumpy7
parents: 2256
diff changeset
885 return _449B57_test_bit(pParty->_quest_bits, bit);
d6887ee81068 header file include cleanup
Grumpy7
parents: 2256
diff changeset
886 }
d6887ee81068 header file include cleanup
Grumpy7
parents: 2256
diff changeset
887
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
888 //----- (0047752B) --------------------------------------------------------
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
889 int Party::GetPartyReputation()
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
890 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
891 DDM_DLV_Header *v0; // ebx@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
892 signed int v1; // esi@3
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
893
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
894 v0 = &pOutdoor->ddm;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
895 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
896 v0 = &pIndoor->dlv;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
897 v1 = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
898 if ( CheckHiredNPCSpeciality(Pirate) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
899 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
900 if ( CheckHiredNPCSpeciality(Burglar) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
901 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
902 if ( CheckHiredNPCSpeciality(Gypsy) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
903 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
904 if ( CheckHiredNPCSpeciality(Duper) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
905 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
906 if ( CheckHiredNPCSpeciality(FallenWizard) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
907 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
908 return v1 + v0->uReputation;
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
909 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
910 //----- (004269A2) --------------------------------------------------------
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
911 void Party::GivePartyExp(unsigned int pEXPNum)
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
912 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
913 signed int pActivePlayerCount; // ecx@1
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
914 int pLearningPercent; // eax@13
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
915
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
916 if ( pEXPNum > 0)
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
917 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
918 pActivePlayerCount = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
919 for ( uint i = 0; i < 4; ++i )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
920 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
921 if ( !pParty->pPlayers[i].pConditions[Condition_Unconcious] &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
922 !pParty->pPlayers[i].pConditions[Condition_Dead] &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
923 !pParty->pPlayers[i].pConditions[Condition_Pertified] &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
924 !pParty->pPlayers[i].pConditions[Condition_Eradicated] )
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
925 pActivePlayerCount ++;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
926 }
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
927 if ( pActivePlayerCount )
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
928 {
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
929 pEXPNum = pEXPNum / pActivePlayerCount;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
930 for ( uint i = 0; i < 4; ++i )
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
931 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
932 if ( !pParty->pPlayers[i].pConditions[Condition_Unconcious] &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
933 !pParty->pPlayers[i].pConditions[Condition_Dead] &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
934 !pParty->pPlayers[i].pConditions[Condition_Pertified] &&
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
935 !pParty->pPlayers[i].pConditions[Condition_Eradicated] )
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
936 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
937 pLearningPercent = pParty->pPlayers[i].GetLearningPercent();
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
938 pEXPNum = pEXPNum + pEXPNum * pLearningPercent / 100;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
939 pParty->pPlayers[i].uExperience += pEXPNum;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
940 if ( pParty->pPlayers[i].uExperience > 4000000000i64 )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
941 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
942 pParty->pPlayers[i].uExperience = 0;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
943 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
944 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
945 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
946 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
947 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
948 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
949 //----- (00420C05) --------------------------------------------------------
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
950 void Party::PartyFindsGold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
951 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
952 int hirelingSalaries; // ebp@1
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
953 unsigned int goldToGain; // esi@1
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
954 NPCData *v12; // ecx@21
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
955 unsigned int v13; // ecx@23
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
956 signed int hirelingCount; // [sp+Ch] [bp-4h]@6
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
957
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
958 hirelingSalaries = 0;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
959 goldToGain = uNumGold;
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
960
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
961 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 )
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
962 pTmpBuf2[0] = 0;
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
963 else if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
964 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
965 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold!
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
966 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
967 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
968 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
969 hirelingCount = 0;
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
970 for (int i = 0; i < 2; i++)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
971 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
972 if (this->pHirelings[i].pName)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
973 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
974 hirelingCount++;
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
975 pTmpBuf[hirelingCount] = i;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
976 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
977 }
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
978 for (uint i = 0; i < pNPCStats->uNumNewNPCs; i++)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
979 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
980 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
981 && (!this->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, this->pHirelings[0].pName))
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
982 && (!this->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, this->pHirelings[1].pName)) )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
983 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
984 hirelingCount++;
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
985 pTmpBuf[hirelingCount] = i + 2;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
986 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
987 }
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
988 for (int i = 0; i < hirelingCount; i++)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
989 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
990 uchar thisBufId = (uchar)pTmpBuf[i];
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
991 if (thisBufId < 2)
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
992 v12 = &this->pHirelings[thisBufId];
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
993 else
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
994 v12 = &pNPCStats->pNPCData[thisBufId + 499];
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
995 v13 = v12->uProfession;
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
996 if ( v13 )
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
997 hirelingSalaries += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
998 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
999 if ( CheckHiredNPCSpeciality(Factor) )
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1000 goldToGain += (signed int)(10 * goldToGain) / 100;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1001 if ( CheckHiredNPCSpeciality(Banker) )
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1002 goldToGain += (signed int)(20 * goldToGain) / 100;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1003 if ( CheckHiredNPCSpeciality(Pirate) )
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1004 goldToGain += (signed int)(10 * goldToGain) / 100;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1005 if ( hirelingSalaries )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1006 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1007 hirelingSalaries = (signed int)(goldToGain * hirelingSalaries / 100) / 100;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1008 if ( hirelingSalaries < 1 )
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1009 hirelingSalaries = 1;
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1010 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[466], goldToGain, hirelingSalaries);// You found %lu gold (followers take %lu)!
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1011 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1012 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1013 {
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1014 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], goldToGain);// You found %lu gold!
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1015 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1016 }
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
1017 this->uNumGold += goldToGain - hirelingSalaries;
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
1018 pUIAnim_Gold->uAnimTime = 0;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1019 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1020 if ( pTmpBuf2[0] )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1021 ShowStatusBarString(pTmpBuf2.data(), 2u);
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
1022 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1023 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1024 //----- (00421B2C) --------------------------------------------------------
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1025 void Party::sub_421B2C_PlaceInInventory_or_DropPickedItem()
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1026 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1027 unsigned int v0; // eax@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1028 Texture *v1; // ebx@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1029 int v2; // eax@3
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1030 int v4; // eax@6
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1031 unsigned __int16 v5; // dx@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1032 signed int v6; // eax@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1033 __int16 v8; // ax@16
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1034 SpriteObject a1; // [sp+4h] [bp-78h]@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1035 int v11; // [sp+74h] [bp-8h]@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1036 int v12; // [sp+78h] [bp-4h]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1037
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1038 if ( !pParty->pPickedItem.uItemID )
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1039 return;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1040 v0 = pIcons_LOD->LoadTexture(
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1657
diff changeset
1041 pParty->pPickedItem.GetIconName(),
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1042 TEXTURE_16BIT_PALETTE);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1043 v1 = pIcons_LOD->GetTexture(v0);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1044 v11 = areWeLoadingTexture;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1045 if ( uActiveCharacter
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1046 && (v2 = ::pPlayers[uActiveCharacter]->AddItem(-1, pParty->pPickedItem.uItemID)) != 0 )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1047 {
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1048 memcpy(&::pPlayers[uActiveCharacter]->pInventoryItemList[v2-1], &pParty->pPickedItem, 0x24u);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1049 pMouse->RemoveHoldingItem();
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1050 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1051 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1052 {
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1053 for (v12 = 0; v12 < 4; v12++)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1054 {
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1055 v4 = pParty->pPlayers[v12].AddItem(-1, pParty->pPickedItem.uItemID);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1056 if ( v4 )
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1057 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1058 memcpy(&pParty->pPlayers[v12].pInventoryItemList[v4 - 1], &pParty->pPickedItem, sizeof(ItemGen));
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1059 pMouse->RemoveHoldingItem();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1060 break;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1061 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1062 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1063 if ( v12 == 4 )
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1064 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1065 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1066 v6 = 0;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1067 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1068 for ( uint i = 0; i < pObjectList->uNumObjects; i++ )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1069 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1070 if ( v5 == pObjectList->pObjects[i].uObjectID )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1071 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1072 v6 = i;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1073 break;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1074 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1075 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1076 a1.spell_caster_pid = OBJECT_Player;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1077 a1.uObjectDescID = v6;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1078 a1.vPosition.y = pParty->vPosition.y;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1079 a1.vPosition.x = pParty->vPosition.x;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1080 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1081 a1.uSoundID = 0;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1082 a1.uFacing = 0;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1083 a1.uAttributes = 8;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1084 v8 = pIndoor->GetSector(
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1085 pParty->vPosition.x,
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1086 pParty->vPosition.y,
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1087 pParty->sEyelevel + pParty->vPosition.z);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1088 a1.uSpriteFrameID = 0;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1089 a1.uSectorID = v8;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1090 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24));
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1091 a1.Create(pParty->sRotationY, 184, 200, 0);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1092 pMouse->RemoveHoldingItem();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1093 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1094 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1095 if ( !v11 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1096 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1097 v1->Release();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1098 pIcons_LOD->SyncLoadedFilesCount();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1099 }
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1100 return;
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
1101 }
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
1102
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
1103
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1104 //----- (0048C6F6) --------------------------------------------------------
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1105 bool Party::AddItemToParty(ItemGen *pItem)
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1106 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1107 unsigned int v2; // eax@1
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1108 char *v5; // eax@8
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1109 Texture *v7; // ebx@10
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1110 signed int v8; // esi@10
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1111 Player *v9; // edi@11
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1112 int v10; // eax@11
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1113 int v21; // [sp+24h] [bp-4h]@10
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1114
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1115 v2 = pItem->uItemID;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1116 if ( !pItemsTable->pItems[v2].uItemID_Rep_St )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1117 pItem->SetIdentified();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1118
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1119 v5 = pItemsTable->pItems[v2].pIconName;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1120 if ( v5 )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1121 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1122 v7 = pIcons_LOD->LoadTexturePtr(v5, TEXTURE_16BIT_PALETTE);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1123 v21 = areWeLoadingTexture;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1124 v8 = 0;
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1990
diff changeset
1125 uint current_player = uActiveCharacter;
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1126 for (int i = 0; i < 4; i++)
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1127 {
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1990
diff changeset
1128 current_player = current_player + i;
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1990
diff changeset
1129 if ( current_player > 4 )
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1990
diff changeset
1130 current_player = current_player - 4;
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1990
diff changeset
1131 v9 = ::pPlayers[current_player];
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1132 v10 = v9->AddItem(-1, pItem->uItemID);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1133 if ( v10 )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1134 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1135 memcpy(&v9->pInventoryItemList[v10-1], pItem, 0x24u);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1136 pItem->Reset();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1137 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1138 v9->PlaySound(SPEECH_60, 0);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1139 if ( !v21 )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1140 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1141 v7->Release();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1142 pIcons_LOD->SyncLoadedFilesCount();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1143 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1144 return true;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1145 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1146 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1147 if ( !v21 )
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1148 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1149 v7->Release();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1150 pIcons_LOD->SyncLoadedFilesCount();
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1151 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1152 return false;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1153 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1154 else
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1155 {
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1156 MessageBoxW(nullptr, L"Invalid picture_name detected ::addItem()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Party.cpp:795", 0);
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1157 return false;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1158 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1159 }
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1160 // 506128: using guessed type int areWeLoadingTexture;
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1161
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
1162 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
1163 {
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
1164 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
1165 }
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
1166
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
1167 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
1168 {
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
1169 return _449B57_test_bit(_quest_bits, 99);
2256
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1170 }
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1171
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1172
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1173
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1174 //----- (0046A89E) --------------------------------------------------------
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1175 int Party::_46A89E_immolation_effect(int* affected, int affectedArrSize, int effectRange)
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1176 {
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1177 int v5; // ebx@3
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1178 int v17; // [sp+Ch] [bp-10h]@3
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1179 int v18; // [sp+10h] [bp-Ch]@3
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1180 int affectedCount; // [sp+18h] [bp-4h]@1
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1181
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1182 affectedCount = 0;
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1183 for ( size_t i = 0; i < uNumActors; ++i )
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1184 {
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1185 v5 = abs(pActors[i].vPosition.x - this->vPosition.x);
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1186 v17 = abs(pActors[i].vPosition.y - this->vPosition.y);
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1187 v18 = abs(pActors[i].vPosition.z - this->vPosition.z);
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1188 if ( int_get_vector_length(v5, v17, v18) <= effectRange )
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1189 {
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1190 if ( pActors[i].uAIState != Dead && pActors[i].uAIState != Dying && pActors[i].uAIState != Removed
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1191 && pActors[i].uAIState != Disabled && pActors[i].uAIState != Summoned )
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1192 {
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1193 affected[affectedCount] = i;
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1194 affectedCount++;
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1195 if ( affectedCount >= affectedArrSize )
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1196 break;
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1197 }
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1198 }
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1199 }
27f2a2c2fd8f _46A89E_immolation_effect moved into Party
Grumpy7
parents: 2253
diff changeset
1200 return affectedCount;
2355
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1201 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1202
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1203 //----- (00444D80) --------------------------------------------------------
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1204 int GetTravelTime()
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1205 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1206 signed int new_travel_time; // esi@1
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1207
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1208 new_travel_time = uDefaultTravelTime_ByFoot;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1209 if ( CheckHiredNPCSpeciality(Guide) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1210 --new_travel_time;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1211 if ( CheckHiredNPCSpeciality(Tracker) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1212 new_travel_time -= 2;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1213 if ( CheckHiredNPCSpeciality(Pathfinder) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1214 new_travel_time -= 3;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1215 if ( CheckHiredNPCSpeciality(Explorer) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1216 --new_travel_time;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1217 if ( new_travel_time < 1 )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1218 new_travel_time = 1;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1219 return new_travel_time;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2340
diff changeset
1220 }
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1221 // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1222
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1223 //----- (00449B57) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1224 bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1225 {
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1226 return (a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8)) != 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1227 }
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1228
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1229 //----- (00449B7E) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1230 void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1231 {
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1232 signed int v3; // esi@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1233 unsigned char set_bit; // edx@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1234
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1235 v3 = a2 - 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1236 set_bit = 0x80 >> v3 % 8;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1237 if (bToggle)
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1238 pArray[v3 / 8] |= set_bit;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1239 else
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1240 pArray[v3 / 8] &= ~set_bit;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1241 }
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1242
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1243 //----- (004760D5) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1244 PartyAction ActionQueue::Next()
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1245 {
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1246 if (!uNumActions)
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1247 return PARTY_INVALID;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1248
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1249 PartyAction result = pActions[0];
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1250 for (unsigned int i = 0; i < uNumActions - 1; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1251 pActions[i] = pActions[i + 1];
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1252 --uNumActions;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1253
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1254 return result;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
1255 }