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