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