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