Mercurial > mm7
annotate Actor.h @ 2493:bd4ada7615ce
Слияние
author | Ritor1 |
---|---|
date | Mon, 15 Sep 2014 17:30:29 +0600 |
parents | 85a12b497698 |
children | de8c5c223e9c |
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 _427546(int a2); |
271 | 17 int FindClosestActor(int a2, int a3, int a4); |
0 | 18 |
19 char field_0; | |
20 }; | |
21 #pragma pack(pop) | |
22 | |
23 | |
24 extern stru319 stru_50C198; // idb | |
25 | |
26 | |
1972
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
27 enum ABILITY_INDEX |
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
28 { |
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
29 ABILITY_ATTACK1 = 0, |
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
30 ABILITY_ATTACK2 = 1, |
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
31 ABILITY_SPELL1 = 2, |
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
32 ABILITY_SPELL2 = 3, |
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
33 }; |
0 | 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 }; | |
2492 | 122 #pragma pack(pop) |
0 | 123 |
2492 | 124 #define ACTOR_UNKNOW 0x80 |
125 #define ACTOR_UNKNOW1 0x400 | |
126 #define ACTOR_UNKNOW2 0x4000 | |
127 #define ACTOR_UNKNOW3 0x8000 | |
128 #define ACTOR_UNKNOW4 0x20000 | |
129 #define ACTOR_UNKNOW5 0x40000 | |
130 #define ACTOR_UNKNOW6 0x80000 | |
131 #define ACTOR_UNKNOW7 0x100000 | |
132 #define ACTOR_UNKNOW8 0x200000 | |
133 #define ACTOR_UNKNOW9 0x400000 | |
134 #define ACTOR_UNKNOW10 0x800000 | |
135 #define ACTOR_HOSTILE 0x1000000 | |
136 | |
137 #pragma pack(push, 1) | |
0 | 138 |
139 | |
140 | |
141 | |
142 /* 247 */ | |
143 #pragma pack(push, 1) | |
144 struct AIDirection | |
145 { | |
146 Vec3_int_ vDirection; | |
147 unsigned int uDistance; | |
148 unsigned int uDistanceXZ; | |
149 unsigned int uYawAngle; | |
150 unsigned int uPitchAngle; | |
151 }; | |
152 #pragma pack(pop) | |
153 | |
154 | |
155 | |
156 | |
157 | |
158 /* 71 */ | |
159 #pragma pack(push, 1) | |
160 struct ActorJob | |
161 { | |
162 struct Vec3_short_ vPos; | |
163 unsigned __int16 uAttributes; | |
164 unsigned __int8 uAction; | |
165 unsigned __int8 uHour; | |
166 unsigned __int8 uDay; | |
167 unsigned __int8 uMonth; | |
168 }; | |
169 #pragma pack(pop) | |
170 | |
171 | |
172 /* 66 */ | |
173 #pragma pack(push, 1) | |
174 struct Actor | |
175 { | |
2276 | 176 //----- (0041F4C1) -------------------------------------------------------- |
0 | 177 inline Actor() |
178 { | |
2276 | 179 signed int i; // edx@1 |
0 | 180 |
2276 | 181 for ( i = 0; i < 22; i++ ) |
182 { | |
183 this->pActorBuffs[i].uSkill = 0; | |
184 this->pActorBuffs[i].uPower = 0; | |
185 this->pActorBuffs[i].uExpireTime = 0; | |
186 this->pActorBuffs[i].uCaster = 0; | |
187 this->pActorBuffs[i].uFlags = 0; | |
188 } | |
189 for ( i = 0; i < 4; i++ ) | |
190 this->ActorHasItems[i].Reset(); | |
191 Reset(); | |
0 | 192 } |
193 | |
1895 | 194 void SummonMinion(int summonerId); |
0 | 195 void Reset(); |
196 void Remove(); | |
197 void PrepareSprites(char load_sounds_if_bit1_set); | |
322 | 198 void UpdateAnimation(); |
0 | 199 signed int GetActorsRelation(Actor *a2); |
200 void SetRandomGoldIfTheresNoItem(); | |
201 bool CanAct(); | |
303 | 202 bool IsNotAlive(); |
322 | 203 bool IsPeasant(); |
0 | 204 |
205 | |
417 | 206 static void _SelectTarget(unsigned int uActorID, int *a2, bool can_target_party); |
1060 | 207 static void AI_Pursue3(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *a4); |
208 static void AI_Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *pDir, int a5); | |
209 static void AI_Flee(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4); | |
210 static void AI_Pursue1(unsigned int uActorID, unsigned int a2, signed int arg0, signed int uActionLength, struct AIDirection *pDir); | |
322 | 211 static void PlaySound(unsigned int uActorID, unsigned int uSoundID); |
319 | 212 static void Die(unsigned int uActorID); |
322 | 213 static void Resurrect(unsigned int uActorID); |
414 | 214 static void AI_Bored(unsigned int uActorID, unsigned int uObjID, struct AIDirection *a4); |
1060 | 215 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
|
216 static char __fastcall _4031C1_update_job_never_gets_called(unsigned int uActorID, signed int a2, int a3); |
1456 | 217 static void AI_RandomMove(unsigned int uActor_id, unsigned int uTarget_id, int radius, int uActionLength); |
1060 | 218 static void AI_MissileAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); |
219 static void AI_MissileAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); | |
220 static void AI_SpellAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); | |
221 static void AI_SpellAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir); | |
222 static void AI_MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0); | |
0 | 223 static void __fastcall StandAwhile(unsigned int uActorID); |
413 | 224 static void AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, struct AIDirection *a4); |
414 | 225 static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4); |
1060 | 226 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
|
227 static void GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4); |
1863 | 228 static void Explode(unsigned int uActorID); |
1862 | 229 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
|
230 static void AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel); |
2310 | 231 static void ActorDamageFromMonster(signed int attacker_id, unsigned int actor_id, struct Vec3_int_ *pVelocity, signed int a4); |
1859 | 232 |
233 static unsigned short GetObjDescId( int spellId ); | |
234 | |
322 | 235 static void AggroSurroundingPeasants(unsigned int uActorID, int a2); |
236 static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2); | |
1877
bed4532cfe59
Actor::StealFrom changed signature to void, minor cleanup
Grumpy7
parents:
1876
diff
changeset
|
237 static void StealFrom(unsigned int uActorID); |
526 | 238 static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive); |
0 | 239 static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle); |
322 | 240 static void ApplyFineForKillingPeasant(unsigned int uActorID); |
1763 | 241 static void DrawHealthBar(Actor *actor, struct GUIWindow *window); |
1876 | 242 int _43B3E0_CalcDamage(signed int dmgSource); |
322 | 243 static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3); |
0 | 244 |
1897
436553b0603c
_46DF1A_collide_against_actor cleaned up, moved to Actor.h
Grumpy7
parents:
1895
diff
changeset
|
245 static bool _46DF1A_collide_against_actor(int a1, int a2); |
2169 | 246 static void Arena_summon_actor(int monster_id, __int16 x, int y, int z); |
2338
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
247 static void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
248 static void MakeActorAIList_ODM(); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
249 static int MakeActorAIList_BLV(); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
250 static void UpdateActorAI(); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
251 static void InitializeActors(); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
252 static unsigned int SearchAliveActors(unsigned int *pTotalActors); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
253 static unsigned int SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
254 static unsigned int SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup); |
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2310
diff
changeset
|
255 static unsigned int SearchActorByID(unsigned int *pTotalActors, unsigned int a2); |
0 | 256 |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1940
diff
changeset
|
257 |
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1940
diff
changeset
|
258 void LootActor(); |
1971 | 259 bool _427102_IsOkToCastSpell(signed int a2); |
1972
3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
Grumpy7
parents:
1971
diff
changeset
|
260 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
|
261 bool _4273BB_DoesHitOtherActor(Actor *defender, int a3, int a4); |
2291
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
262 bool ActorHitOrMiss(Player *pPlayer); |
2293
b0f10ef66e00
stru319::CalcMagicalDamageToActor moved to Actor class
Grumpy7
parents:
2292
diff
changeset
|
263 int CalcMagicalDamageToActor(DAMAGE_TYPE dmgType, signed int incomingDmg); |
2301 | 264 bool DoesDmgTypeDoDamage(DAMAGE_TYPE uType); |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1940
diff
changeset
|
265 |
0 | 266 char pActorName[32]; |
602 | 267 signed __int16 sNPC_ID; |
0 | 268 __int16 field_22; |
269 unsigned int uAttributes; | |
270 __int16 sCurrentHP; | |
271 char field_2A[2]; | |
272 struct MonsterInfo pMonsterInfo; | |
273 __int16 word_000084_range_attack; | |
274 __int16 word_000086_some_monster_id; | |
275 unsigned __int16 uActorRadius; | |
276 unsigned __int16 uActorHeight; | |
277 unsigned __int16 uMovementSpeed; | |
278 struct Vec3_short_ vPosition; | |
279 struct Vec3_short_ vVelocity; | |
280 unsigned __int16 uYawAngle; | |
281 unsigned __int16 uPitchAngle; | |
282 __int16 uSectorID; | |
283 unsigned __int16 uCurrentActionLength; | |
284 struct Vec3_short_ vInitialPosition; | |
285 struct Vec3_short_ vGuardingPosition; | |
286 unsigned __int16 uTetherDistance; | |
287 AIState uAIState; | |
288 unsigned __int16 uCurrentActionAnimation; | |
289 unsigned __int16 uCarriedItemID; | |
290 char field_B6; | |
291 char field_B7; | |
292 unsigned int uCurrentActionTime; | |
293 unsigned __int16 pSpriteIDs[8]; | |
417 | 294 unsigned __int16 pSoundSampleIDs[4]; // 1 die 3 bored |
0 | 295 struct SpellBuff pActorBuffs[22]; |
2276 | 296 struct ItemGen ActorHasItems[4]; |
0 | 297 unsigned int uGroup; |
298 unsigned int uAlly; | |
299 struct ActorJob pScheduledJobs[8]; | |
300 unsigned int uSummonerID; | |
301 unsigned int uLastCharacterIDToHit; | |
302 int dword_000334_unique_name; | |
303 char field_338[12]; | |
304 }; | |
305 #pragma pack(pop) | |
306 | |
307 | |
308 | |
309 | |
310 | |
311 | |
312 //extern Actor pMonsterInfoUI_Doll; | |
313 | |
1202 | 314 extern std::array<Actor, 500> pActors; |
1503 | 315 extern size_t uNumActors; |
1936 | 316 |
2344 | 317 bool CheckActors_proximity(); |
318 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive); // idb | |
319 void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3); | |
2348 | 320 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle); |
321 bool __fastcall sub_4070EF_prolly_detect_player(unsigned int uObjID, unsigned int uObj2ID); | |
2362 | 322 bool __fastcall SpawnActor(unsigned int uMonsterID); |
323 int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3); | |
324 void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5); | |
2464 | 325 void area_of_effect__damage_evaluate(); |
326 double __fastcall sub_43AE12(signed int a1); | |
327 void ItemDamageFromActor(unsigned int uObjID, unsigned int uActorID, struct Vec3_int_ *pVelocity); |