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