Mercurial > mm7
annotate Actor.h @ 1875:1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
author | Grumpy7 |
---|---|
date | Thu, 17 Oct 2013 08:55:28 +0200 |
parents | b6258f64e313 |
children | 2070d01ccfae |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "Monsters.h" | |
3 #include "Spells.h" | |
1016 | 4 #include "Items.h" |
0 | 5 |
6 | |
7 | |
8 | |
9 | |
10 | |
11 /* 357 */ | |
12 #pragma pack(push, 1) | |
13 struct stru319 | |
14 { | |
15 void LootActor(struct Actor *pActor); | |
16 int which_player_would_attack(struct Actor *pActor); | |
1450 | 17 int special_ability_use_check(struct Actor *pActor, int a2); |
0 | 18 int _427102(struct Actor *pActor, signed int a2); |
19 int PlayerHitOrMiss(struct Player *pPlayer, struct Actor *pActor, int a3, int a4); | |
20 bool _4273BB(struct Actor *pActor, struct Actor *a2, int a3, int a4); | |
21 bool ActorHitOrMiss(struct Actor *pActor, struct Player *pPlayer); | |
22 int _427546(int a2); | |
23 int CalcMagicalDamageToActor(struct Actor *pActor, int a2, signed int a3); | |
24 bool GetMagicalResistance(struct Actor *pActor, unsigned int uType); | |
271 | 25 int FindClosestActor(int a2, int a3, int a4); |
0 | 26 |
27 char field_0; | |
28 }; | |
29 #pragma pack(pop) | |
30 | |
31 | |
32 extern stru319 stru_50C198; // idb | |
33 | |
34 | |
35 | |
36 | |
37 | |
38 | |
39 /* 361 */ | |
40 enum ACTOR_BUFF_INDEX | |
41 { | |
1705 | 42 ACTOR_BUFF_CHARM = 1, |
43 ACTOR_BUFF_SUMMONED = 2, | |
44 ACTOR_BUFF_SHRINK = 3, | |
45 ACTOR_BUFF_AFRAID = 4, | |
142 | 46 ACTOR_BUFF_STONED = 5, |
1705 | 47 ACTOR_BUFF_PARALYZED = 6, |
1875
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
48 ACTOR_BUFF_SLOWED = 7, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
49 ACTOR_BUFF_SOMETHING_THAT_HALVES_AC = 8, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
50 ACTOR_BUFF_BERSERK = 9, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
51 ACTOR_BUFF_MASS_DISTORTION = 10, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
52 ACTOR_BUFF_FATE = 11, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
53 ACTOR_BUFF_ENSLAVED = 12, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
54 ACTOR_BUFF_DAY_OF_PROTECTION = 13, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
55 ACTOR_BUFF_HOUR_OF_POWER = 14, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
56 ACTOR_BUFF_SHIELD = 15, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
57 ACTOR_BUFF_STONESKIN = 16, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
58 ACTOR_BUFF_BLESS = 17, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
59 ACTOR_BUFF_HEROISM = 18, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
60 ACTOR_BUFF_HASTE = 19, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
61 ACTOR_BUFF_PAIN_REFLECTION = 20, |
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1864
diff
changeset
|
62 ACTOR_BUFF_PAIN_HAMMERHANDS = 21, |
0 | 63 }; |
64 | |
65 | |
66 | |
67 | |
68 | |
69 /* 295 */ | |
70 enum ObjectType | |
71 { | |
194 | 72 OBJECT_Any = 0x0, |
141 | 73 OBJECT_BLVDoor = 0x1, |
0 | 74 OBJECT_Item = 0x2, |
75 OBJECT_Actor = 0x3, | |
76 OBJECT_Player = 0x4, | |
77 OBJECT_Decoration = 0x5, | |
78 OBJECT_BModel = 0x6, | |
79 }; | |
80 | |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | |
87 /* 264 */ | |
88 enum AIState : unsigned __int16 | |
89 { | |
90 Standing = 0x0, | |
91 Tethered = 0x1, | |
92 AttackingMelee = 0x2, | |
93 AttackingRanged1 = 0x3, | |
94 Dying = 0x4, | |
95 Dead = 0x5, | |
96 Pursuing = 0x6, | |
97 Fleeing = 0x7, | |
98 Stunned = 0x8, | |
99 Fidgeting = 0x9, | |
142 | 100 Interacting = 10, |
101 Removed = 11, | |
0 | 102 AttackingRanged2 = 0xC, |
103 AttackingRanged3 = 0xD, | |
104 Stoned = 0xE, | |
105 Paralyzed = 0xF, | |
142 | 106 Resurrected = 16, |
141 | 107 Summoned = 17, |
142 | 108 AttackingRanged4 = 18, |
109 Disabled = 19, | |
0 | 110 }; |
111 | |
112 /* 265 */ | |
113 enum ActorAnimation : __int32 | |
114 { | |
115 ANIM_Standing = 0x0, | |
116 ANIM_Walking = 0x1, | |
117 ANIM_AtkMelee = 0x2, | |
118 ANIM_AtkRanged = 0x3, | |
119 ANIM_GotHit = 0x4, | |
120 ANIM_Dying = 0x5, | |
121 ANIM_Dead = 0x6, | |
122 ANIM_Bored = 0x7, | |
123 }; | |
124 | |
125 | |
126 | |
127 | |
128 | |
129 /* 247 */ | |
130 #pragma pack(push, 1) | |
131 struct AIDirection | |
132 { | |
133 Vec3_int_ vDirection; | |
134 unsigned int uDistance; | |
135 unsigned int uDistanceXZ; | |
136 unsigned int uYawAngle; | |
137 unsigned int uPitchAngle; | |
138 }; | |
139 #pragma pack(pop) | |
140 | |
141 | |
142 | |
143 | |
144 | |
145 /* 71 */ | |
146 #pragma pack(push, 1) | |
147 struct ActorJob | |
148 { | |
149 struct Vec3_short_ vPos; | |
150 unsigned __int16 uAttributes; | |
151 unsigned __int8 uAction; | |
152 unsigned __int8 uHour; | |
153 unsigned __int8 uDay; | |
154 unsigned __int8 uMonth; | |
155 }; | |
156 #pragma pack(pop) | |
157 | |
158 | |
159 /* 66 */ | |
160 #pragma pack(push, 1) | |
161 struct Actor | |
162 { | |
163 //----- (0041F4C1) -------------------------------------------------------- | |
164 inline Actor() | |
165 { | |
166 Actor *v1; // esi@1 | |
167 SpellBuff *v2; // eax@1 | |
168 signed int v3; // edx@1 | |
169 ItemGen *v4; // edi@3 | |
170 signed int v5; // ebx@3 | |
171 | |
172 v1 = this; | |
173 v2 = this->pActorBuffs; | |
174 v3 = 22; | |
175 do | |
176 { | |
177 v2->uSkill = 0; | |
178 v2->uPower = 0; | |
179 v2->uExpireTime = 0; | |
180 v2->uCaster = 0; | |
181 v2->uFlags = 0; | |
182 ++v2; | |
183 --v3; | |
184 } | |
185 while ( v3 ); | |
186 v4 = this->array_000234; | |
187 v5 = 4; | |
188 do | |
189 { | |
190 v4->Reset(); | |
191 ++v4; | |
192 --v5; | |
193 } | |
194 while ( v5 ); | |
195 Reset(); | |
196 } | |
197 | |
198 int _44FD29(int a2); | |
199 void Reset(); | |
200 void Remove(); | |
201 void PrepareSprites(char load_sounds_if_bit1_set); | |
322 | 202 void UpdateAnimation(); |
0 | 203 signed int GetActorsRelation(Actor *a2); |
204 void SetRandomGoldIfTheresNoItem(); | |
205 bool CanAct(); | |
303 | 206 bool IsNotAlive(); |
322 | 207 bool IsPeasant(); |
0 | 208 |
209 | |
417 | 210 static void _SelectTarget(unsigned int uActorID, int *a2, bool can_target_party); |
1060 | 211 static void AI_Pursue3(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *a4); |
212 static void AI_Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *pDir, int a5); | |
213 static void AI_Flee(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4); | |
214 static void AI_Pursue1(unsigned int uActorID, unsigned int a2, signed int arg0, signed int uActionLength, struct AIDirection *pDir); | |
322 | 215 static void PlaySound(unsigned int uActorID, unsigned int uSoundID); |
319 | 216 static void Die(unsigned int uActorID); |
322 | 217 static void Resurrect(unsigned int uActorID); |
414 | 218 static void AI_Bored(unsigned int uActorID, unsigned int uObjID, struct AIDirection *a4); |
1060 | 219 static void AI_Stun(unsigned int uActorID, signed int edx0, int arg0); |
0 | 220 static char __fastcall _4031C1_update_job(unsigned int uActorID, signed int a2, int a3); |
1456 | 221 static void AI_RandomMove(unsigned int uActor_id, unsigned int uTarget_id, int radius, int uActionLength); |
1060 | 222 static void AI_MissileAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); |
223 static void AI_MissileAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); | |
224 static void AI_SpellAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); | |
225 static void AI_SpellAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); | |
226 static void AI_MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0); | |
0 | 227 static void __fastcall StandAwhile(unsigned int uActorID); |
413 | 228 static void AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, struct AIDirection *a4); |
414 | 229 static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4); |
1060 | 230 static void AI_FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, struct AIDirection *a4); |
1864 | 231 static struct AIDirection * GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4); |
1863 | 232 static void Explode(unsigned int uActorID); |
1862 | 233 static void AI_RangedAttack(unsigned int uActorID, struct AIDirection *a2, int type, char a4); |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1859
diff
changeset
|
234 static void AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel); |
1859 | 235 |
236 static unsigned short GetObjDescId( int spellId ); | |
237 | |
322 | 238 static void AggroSurroundingPeasants(unsigned int uActorID, int a2); |
239 static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2); | |
0 | 240 static bool StealFrom(unsigned int uActorID); |
526 | 241 static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive); |
0 | 242 static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle); |
322 | 243 static void ApplyFineForKillingPeasant(unsigned int uActorID); |
1763 | 244 static void DrawHealthBar(Actor *actor, struct GUIWindow *window); |
0 | 245 static int _43B3E0_CalcDamage(Actor *a1, signed int a2); |
322 | 246 static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3); |
0 | 247 |
248 | |
249 char pActorName[32]; | |
602 | 250 signed __int16 sNPC_ID; |
0 | 251 __int16 field_22; |
252 unsigned int uAttributes; | |
253 __int16 sCurrentHP; | |
254 char field_2A[2]; | |
255 struct MonsterInfo pMonsterInfo; | |
256 __int16 word_000084_range_attack; | |
257 __int16 word_000086_some_monster_id; | |
258 unsigned __int16 uActorRadius; | |
259 unsigned __int16 uActorHeight; | |
260 unsigned __int16 uMovementSpeed; | |
261 struct Vec3_short_ vPosition; | |
262 struct Vec3_short_ vVelocity; | |
263 unsigned __int16 uYawAngle; | |
264 unsigned __int16 uPitchAngle; | |
265 __int16 uSectorID; | |
266 unsigned __int16 uCurrentActionLength; | |
267 struct Vec3_short_ vInitialPosition; | |
268 struct Vec3_short_ vGuardingPosition; | |
269 unsigned __int16 uTetherDistance; | |
270 AIState uAIState; | |
271 unsigned __int16 uCurrentActionAnimation; | |
272 unsigned __int16 uCarriedItemID; | |
273 char field_B6; | |
274 char field_B7; | |
275 unsigned int uCurrentActionTime; | |
276 unsigned __int16 pSpriteIDs[8]; | |
417 | 277 unsigned __int16 pSoundSampleIDs[4]; // 1 die 3 bored |
0 | 278 struct SpellBuff pActorBuffs[22]; |
279 struct ItemGen array_000234[4]; | |
280 unsigned int uGroup; | |
281 unsigned int uAlly; | |
282 struct ActorJob pScheduledJobs[8]; | |
283 unsigned int uSummonerID; | |
284 unsigned int uLastCharacterIDToHit; | |
285 int dword_000334_unique_name; | |
286 char field_338[12]; | |
287 }; | |
288 #pragma pack(pop) | |
289 | |
290 | |
291 | |
292 | |
293 | |
294 | |
295 //extern Actor pMonsterInfoUI_Doll; | |
296 | |
1202 | 297 extern std::array<Actor, 500> pActors; |
1503 | 298 extern size_t uNumActors; |