Mercurial > mm7
annotate Party.h @ 2233:a9fa57fda3ae
sub_4B1523_showSpellbookInfo moved to UIShops
author | Grumpy7 |
---|---|
date | Sat, 22 Feb 2014 19:55:54 +0100 |
parents | d44b7775fc06 |
children | 27f2a2c2fd8f |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "Player.h" | |
3 #include "NPC.h" | |
1494 | 4 #include "mm7_data.h" |
2152 | 5 #include "mm7_unsorted_subs.h" |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
6 #include <array> |
0 | 7 |
8 | |
9 | |
1053 | 10 #define PARTY_AUTONOTES_BIT__EMERALD_FIRE_FOUNTAIN 2 |
0 | 11 |
1494 | 12 enum PARTY_QUEST_BITS: uint16 |
710 | 13 { |
1035 | 14 PARTY_QUEST_EMERALD_RED_POTION_ACTIVE = 1, |
15 PARTY_QUEST_EMERALD_SEASHELL_ACTIVE = 2, | |
16 PARTY_QUEST_EMERALD_LONGBOW_ACTIVE = 3, | |
17 PARTY_QUEST_EMERALD_PLATE_ACTIVE = 4, | |
18 PARTY_QUEST_EMERALD_LUTE_ACTIVE = 5, | |
19 PARTY_QUEST_EMERALD_HAT_ACTIVE = 6, | |
20 | |
1052 | 21 PARTY_QUEST_EMERALD_MARGARETH_OFF = 17, |
22 | |
778 | 23 PARTY_QUEST_EVENMORN_MAP_FOUND = 64, |
981 | 24 PARTY_QUEST_FINISHED_EMERALD_ISLE = 136, |
1494 | 25 |
26 PARTY_QUEST_OBELISK_HARMONDALE = 164, | |
27 PARTY_QUEST_OBELISK_ERATHIA = 165, | |
28 PARTY_QUEST_OBELISK_TULAREAN_FOREST = 166, | |
29 PARTY_QUEST_OBELISK_DEYJA = 167, | |
30 PARTY_QUEST_OBELISK_BRACADA_DESERT = 168, | |
31 PARTY_QUEST_OBELISK_CELESTE = 169, | |
32 PARTY_QUEST_OBELISK_THE_PIT = 170, | |
33 PARTY_QUEST_OBELISK_EVENMORN_ISLAND = 171, | |
34 PARTY_QUEST_OBELISK_MOUNT_NIGHON = 172, | |
35 PARTY_QUEST_OBELISK_BARROW_DOWNS = 173, | |
36 PARTY_QUEST_OBELISK_LAND_OF_THE_GIANTS = 174, | |
37 PARTY_QUEST_OBELISK_TATALIA = 175, | |
38 PARTY_QUEST_OBELISK_AVLEE = 176, | |
39 PARTY_QUEST_OBELISK_STONE_CITY = 177, | |
40 | |
41 PARTY_QUEST_OBELISK_TREASURE_FOUND = 178, | |
42 | |
710 | 43 PARTY_QUEST_FOUNTAIN_HARMONDALE = 206, |
44 PARTY_QUEST_FOUNTAIN_NIGHON = 207, | |
45 PARTY_QUEST_FOUNTAIN_PIERPONT = 208, | |
46 PARTY_QUEST_FOUNTAIN_CELESTIA = 209, | |
47 PARTY_QUEST_FOUNTAIN_THE_PIT = 210, | |
48 PARTY_QUEST_FOUNTAIN_EVENMORN_ISLE = 211 | |
49 }; | |
0 | 50 |
51 /* 355 */ | |
141 | 52 enum PARTY_FLAGS_1: __int32 |
53 { | |
2069 | 54 PARTY_FLAGS_1_0002 = 0x0002, |
1424 | 55 PARTY_FLAGS_1_WATER_DAMAGE = 0x0004, |
569 | 56 PARTY_FLAGS_1_FALLING = 0x0008, |
390 | 57 PARTY_FLAGS_1_ALERT_RED = 0x0010, |
58 PARTY_FLAGS_1_ALERT_YELLOW = 0x0020, | |
569 | 59 PARTY_FLAGS_1_STANDING_ON_WATER = 0x0080, |
390 | 60 PARTY_FLAGS_1_LANDING = 0x0100, |
816 | 61 PARTY_FLAGS_1_BURNING = 0x200 |
141 | 62 }; |
63 enum PARTY_FLAGS_2: __int32 | |
0 | 64 { |
65 PARTY_FLAGS_2_RUNNING = 0x2, | |
66 }; | |
67 | |
68 /* 347 */ | |
69 enum PARTY_BUFF_INDEX | |
70 { | |
488 | 71 PARTY_BUFF_RESIST_AIR = 0, |
72 PARTY_BUFF_RESIST_BODY = 1, | |
73 PARTY_BUFF_DAY_OF_GODS = 2, | |
74 PARTY_BUFF_DETECT_LIFE = 3, | |
75 PARTY_BUFF_RESIST_EARTH = 4, | |
76 PARTY_BUFF_FEATHER_FALL = 5, | |
77 PARTY_BUFF_RESIST_FIRE = 6, | |
78 PARTY_BUFF_FLY = 7, | |
79 PARTY_BUFF_HASTE = 8, | |
80 PARTY_BUFF_HEROISM = 9, | |
81 PARTY_BUFF_IMMOLATION = 10, | |
271 | 82 PARTY_BUFF_INVISIBILITY = 11, |
488 | 83 PARTY_BUFF_RESIST_MIND = 12, |
84 PARTY_BUFF_PROTECTION_FROM_MAGIC = 13, | |
85 PARTY_BUFF_SHIELD = 14, | |
86 PARTY_BUFF_STONE_SKIN = 15, | |
87 PARTY_BUFF_TORCHLIGHT = 16, | |
88 PARTY_BUFF_RESIST_WATER = 17, | |
89 PARTY_BUFF_WATER_WALK = 18, | |
90 PARTY_BUFF_WIZARD_EYE = 19, | |
0 | 91 }; |
92 | |
93 | |
94 | |
95 /* 300 */ | |
96 enum PartyAction: unsigned __int32 | |
97 { | |
98 PARTY_INVALID = 0, | |
99 PARTY_TurnLeft = 0x1, | |
100 PARTY_TurnRight = 0x2, | |
101 PARTY_StrafeLeft = 0x3, | |
102 PARTY_StrafeRight = 0x4, | |
103 PARTY_WalkForward = 0x5, | |
104 PARTY_WalkBackward = 0x6, | |
105 PARTY_LookUp = 0x7, | |
106 PARTY_LookDown = 0x8, | |
107 PARTY_CenterView = 0x9, | |
108 PARTY_unkA = 0xA, | |
109 PARTY_unkB = 0xB, | |
110 PARTY_Jump = 0xC, | |
111 PARTY_FlyUp = 0xD, | |
112 PARTY_FlyDown = 0xE, | |
113 PARTY_Land = 0xF, | |
114 PARTY_RunForward = 0x10, | |
115 PARTY_RunBackward = 0x11, | |
116 PARTY_FastTurnLeft = 0x12, | |
117 PARTY_FastTurnRight = 0x13, | |
118 | |
119 PARTY_dword = 0xFFFFFFFF | |
120 }; | |
121 | |
122 | |
123 | |
124 /* 135 */ | |
125 #pragma pack(push, 1) | |
126 struct ActionQueue | |
127 { | |
2151 | 128 inline ActionQueue(): |
129 uNumActions(0) | |
130 {} | |
131 | |
0 | 132 void Add(PartyAction action); |
783 | 133 void Reset(); |
0 | 134 PartyAction Next(); |
135 | |
136 unsigned int uNumActions; | |
137 PartyAction pActions[30]; | |
138 }; | |
139 #pragma pack(pop) | |
140 | |
141 | |
142 | |
143 | |
144 | |
373 | 145 enum PartyAlignment: unsigned __int32 |
146 { | |
147 PartyAlignment_Good = 0, | |
148 PartyAlignment_Neutral = 1, | |
149 PartyAlignment_Evil = 2 | |
150 }; | |
0 | 151 |
152 | |
153 | |
154 | |
155 | |
156 /* 208 */ | |
157 #pragma pack(push, 1) | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1736
diff
changeset
|
158 struct PartyTimeStruct |
0 | 159 { |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
160 std::array<__int64, 10> bountyHunting_next_generation_time; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
161 std::array<__int64, 85> Shops_next_generation_time;//field_50 |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
162 std::array<__int64, 53> _shop_ban_times; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
163 std::array<unsigned __int64, 10> CounterEventValues; // (0xACD314h in Silvo's binary) |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
164 std::array<__int64, 29> HistoryEventTimes; // (0xACD364h in Silvo's binary) |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
165 std::array<unsigned __int64, 20> _s_times; //5d8 440h+8*51 //(0xACD44Ch in Silvo's binary) |
0 | 166 }; |
167 #pragma pack(pop) | |
168 | |
169 /* 207 */ | |
170 #pragma pack(push, 1) | |
171 struct Party | |
172 { | |
173 Party(): | |
174 uTimePlayed(0) | |
175 { | |
783 | 176 Zero(); |
0 | 177 } |
178 | |
783 | 179 void Zero(); |
130 | 180 void UpdatePlayersAndHirelingsEmotions(); |
0 | 181 void RestAndHeal(); |
182 unsigned int GetPartyFame(); | |
183 void CreateDefaultParty(char bGiveItems); | |
184 int Reset(); | |
185 void ResetPosMiscAndSpellBuffs(); | |
186 bool HasItem(unsigned int uItemID); | |
187 void SetHoldingItem(ItemGen *pItem); | |
188 int GetNextActiveCharacter(); | |
189 bool _497FC5_check_party_perception_against_level(); | |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1546
diff
changeset
|
190 bool AddItemToParty(ItemGen *pItem); |
0 | 191 void Yell(); |
1035 | 192 void CountHirelings(); |
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:
1793
diff
changeset
|
193 |
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:
1793
diff
changeset
|
194 void GivePartyExp(unsigned int pEXPNum); |
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:
1793
diff
changeset
|
195 int GetPartyReputation(); |
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:
1793
diff
changeset
|
196 |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
197 |
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
198 void PartyFindsGold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal); |
1829
e4e27261d84e
sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents:
1828
diff
changeset
|
199 void sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
200 |
0 | 201 static void SetGold(unsigned int uNumGold); |
202 static void TakeGold(unsigned int uNumGold); | |
593 | 203 static void SetFood(unsigned int uNumFood); |
0 | 204 static void TakeFood(unsigned int uNumFood); |
592 | 205 static void GiveFood(unsigned int _this); |
0 | 206 |
207 inline bool WizardEyeActive() {return pPartyBuffs[PARTY_BUFF_WIZARD_EYE].uExpireTime > 0;} | |
208 inline int WizardEyeSkillLevel() {return pPartyBuffs[PARTY_BUFF_WIZARD_EYE].uSkill;} | |
209 inline bool TorchlightActive() {return pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0;} | |
210 inline bool FlyActive() {return pPartyBuffs[PARTY_BUFF_FLY].uExpireTime > 0;} | |
211 inline bool WaterWalkActive() {return pPartyBuffs[PARTY_BUFF_WATER_WALK].uExpireTime > 0;} | |
212 inline bool ImmolationActive() {return pPartyBuffs[PARTY_BUFF_IMMOLATION].uExpireTime > 0;} | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
213 inline int ImmolationSkillLevel() {return pPartyBuffs[PARTY_BUFF_IMMOLATION].uSkill;} |
0 | 214 inline bool FeatherFallActive() {return pPartyBuffs[PARTY_BUFF_FEATHER_FALL].uExpireTime > 0;} |
141 | 215 inline bool Invisible() {return pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0;} |
0 | 216 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
217 inline bool GetRedAlert() {return (uFlags & PARTY_FLAGS_1_ALERT_RED) != 0;} |
390 | 218 inline void SetRedAlert() {uFlags |= PARTY_FLAGS_1_ALERT_RED;} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
219 inline bool GetYellowAlert() {return (uFlags & PARTY_FLAGS_1_ALERT_YELLOW) != 0;} |
390 | 220 inline void SetYellowAlert() {uFlags |= PARTY_FLAGS_1_ALERT_YELLOW;} |
221 | |
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:
1310
diff
changeset
|
222 bool 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:
1310
diff
changeset
|
223 bool IsPartyGood(); |
0 | 224 |
225 int field_0; | |
226 unsigned int uPartyHeight; | |
227 unsigned int uDefaultPartyHeight; | |
228 int sEyelevel; | |
229 unsigned int uDefaultEyelevel; | |
1546 | 230 int field_14_radius; |
120 | 231 int y_rotation_granularity; |
0 | 232 unsigned int uWalkSpeed; |
122 | 233 int y_rotation_speed; // deg/s |
0 | 234 int field_24; |
235 int field_28; | |
236 unsigned __int64 uTimePlayed; | |
237 __int64 uLastRegenerationTime; | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1736
diff
changeset
|
238 PartyTimeStruct PartyTimes; |
0 | 239 Vec3_int_ vPosition; |
240 int sRotationY; | |
241 int sRotationX; | |
242 Vec3_int_ vPrevPosition; | |
243 int sPrevRotationY; | |
244 int sPrevRotationX; | |
245 int sPrevEyelevel; | |
246 int field_6E0; | |
247 int field_6E4; | |
248 int uFallSpeed; | |
249 int field_6EC; | |
250 int field_6F0; | |
831 | 251 int floor_face_pid; // face we are standing at |
252 int walk_sound_timer; | |
0 | 253 int field_6FC; |
254 int uFallStartY; | |
255 unsigned int bFlying; | |
256 char field_708; | |
1793
4dee76d79c78
dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents:
1747
diff
changeset
|
257 unsigned __int8 hirelingScrollPosition; |
0 | 258 char field_70A; |
259 char field_70B; | |
260 unsigned int uCurrentYear; | |
261 unsigned int uCurrentMonth; | |
262 unsigned int uCurrentMonthWeek; | |
263 unsigned int uDaysPlayed; | |
264 unsigned int uCurrentHour; | |
265 unsigned int uCurrentMinute; | |
266 unsigned int uCurrentTimeSecond; | |
267 unsigned int uNumFoodRations; | |
268 int field_72C; | |
269 int field_730; | |
270 unsigned int uNumGold; | |
271 unsigned int uNumGoldInBank; | |
272 unsigned int uNumDeaths; | |
273 int field_740; | |
274 int uNumPrisonTerms; | |
275 unsigned int uNumBountiesCollected; | |
276 int field_74C; | |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
277 std::array<__int16, 5> monster_id_for_hunting; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
278 std::array<__int16, 5> monster_for_hunting_killed; |
766 | 279 unsigned char days_played_without_rest; |
484 | 280 unsigned __int8 _quest_bits[64]; |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
281 std::array<unsigned __int8, 16> pArcomageWins; |
0 | 282 char field_7B5_in_arena_quest; |
283 char uNumArenaPageWins; | |
284 char uNumArenaSquireWins; | |
285 char uNumArenaKnightWins; | |
286 char uNumArenaLordWins; | |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
287 std::array<char, 29> pIsArtifactFound; //7ba |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
288 std::array<char, 39> field_7d7; |
1310 | 289 unsigned char _autonote_bits[26]; |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
290 std::array<char, 60> field_818; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
291 std::array<char, 32> field_854; |
949 | 292 int uNumArcomageWins; |
293 int uNumArcomageLoses; | |
0 | 294 unsigned int bTurnBasedModeOn; |
295 int field_880; | |
296 int uFlags2; | |
373 | 297 PartyAlignment alignment; |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
298 std::array<SpellBuff, 20> pPartyBuffs; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
299 std::array<Player, 4> pPlayers; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
300 std::array<NPCData, 2> pHirelings; |
0 | 301 ItemGen pPickedItem; |
302 unsigned int uFlags; | |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
303 std::array<std::array<ItemGen, 12>, 53> StandartItemsInShops; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
304 std::array<std::array<ItemGen, 12>, 53> SpecialItemsInShops; //D0EC |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
305 std::array<std::array<ItemGen, 12>, 32> SpellBooksInGuilds; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
306 std::array<char, 24> field_1605C; |
0 | 307 char pHireling1Name[100]; |
308 char pHireling2Name[100]; | |
349 | 309 int armageddon_timer; |
1906 | 310 int armageddonDamage; |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
311 std::array<int, 4> pTurnBasedPlayerRecoveryTimes; |
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1829
diff
changeset
|
312 std::array<int, 53> InTheShopFlags; |
0 | 313 int uFine; |
314 float flt_TorchlightColorR; | |
315 float flt_TorchlightColorG; | |
316 float flt_TorchlightColorB; | |
317 }; | |
318 #pragma pack(pop) | |
319 | |
320 | |
321 | |
322 extern Party *pParty; // idb | |
323 | |
324 | |
66 | 325 extern struct ActionQueue *pPartyActionQueue; |
326 | |
1494 | 327 inline bool TestPartyQuestBit(PARTY_QUEST_BITS bit) |
328 { | |
329 return _449B57_test_bit(pParty->_quest_bits, bit); | |
330 } |