annotate Engine/Objects/Actor.h @ 2553:48708da03b7f

Party Creation UI logic separated from MainMenu
author a.parshin
date Wed, 13 May 2015 02:20:05 +0200
parents dc6f29bb0ec4
children
rev   line source
2497
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
1 #pragma once
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
2 #include "Monsters.h"
2499
68cdef6879a0 engine folder
Ritor1
parents: 2497
diff changeset
3 #include "../Spells/Spells.h"
2497
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
4 #include "Items.h"
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
5
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
6
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
7
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
8
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
9
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
10
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
11 /* 357 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
12 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
13 struct stru319
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
14 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
15 int which_player_to_attack(struct Actor *pActor);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
16 int _427546(int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
17 int FindClosestActor(int a2, int a3, int a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
18
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
19 char field_0;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
20 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
21 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
22
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
23
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
24 extern stru319 stru_50C198; // idb
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
25
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
26
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
27 enum ABILITY_INDEX
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
28 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
29 ABILITY_ATTACK1 = 0,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
30 ABILITY_ATTACK2 = 1,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
31 ABILITY_SPELL1 = 2,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
32 ABILITY_SPELL2 = 3,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
33 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
34
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
35
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
36
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
37 /* 361 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
38 enum ACTOR_BUFF_INDEX
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
39 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
40 ACTOR_BUFF_CHARM = 1,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
41 ACTOR_BUFF_SUMMONED = 2,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
42 ACTOR_BUFF_SHRINK = 3,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
43 ACTOR_BUFF_AFRAID = 4,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
44 ACTOR_BUFF_STONED = 5,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
45 ACTOR_BUFF_PARALYZED = 6,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
46 ACTOR_BUFF_SLOWED = 7,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
47 ACTOR_BUFF_SOMETHING_THAT_HALVES_AC = 8,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
48 ACTOR_BUFF_BERSERK = 9,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
49 ACTOR_BUFF_MASS_DISTORTION = 10,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
50 ACTOR_BUFF_FATE = 11,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
51 ACTOR_BUFF_ENSLAVED = 12,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
52 ACTOR_BUFF_DAY_OF_PROTECTION = 13,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
53 ACTOR_BUFF_HOUR_OF_POWER = 14,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
54 ACTOR_BUFF_SHIELD = 15,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
55 ACTOR_BUFF_STONESKIN = 16,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
56 ACTOR_BUFF_BLESS = 17,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
57 ACTOR_BUFF_HEROISM = 18,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
58 ACTOR_BUFF_HASTE = 19,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
59 ACTOR_BUFF_PAIN_REFLECTION = 20,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
60 ACTOR_BUFF_PAIN_HAMMERHANDS = 21,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
61 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
62
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
63
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
64
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
65
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
66
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
67 /* 295 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
68 enum ObjectType
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
69 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
70 OBJECT_Any = 0x0,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
71 OBJECT_BLVDoor = 0x1,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
72 OBJECT_Item = 0x2,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
73 OBJECT_Actor = 0x3,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
74 OBJECT_Player = 0x4,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
75 OBJECT_Decoration = 0x5,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
76 OBJECT_BModel = 0x6,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
77 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
78
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
79
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
80
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
81
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
82
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
83
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
84
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
85 /* 264 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
86 enum AIState : unsigned __int16
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
87 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
88 Standing = 0x0,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
89 Tethered = 0x1,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
90 AttackingMelee = 0x2,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
91 AttackingRanged1 = 0x3,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
92 Dying = 0x4,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
93 Dead = 0x5,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
94 Pursuing = 0x6,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
95 Fleeing = 0x7,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
96 Stunned = 0x8,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
97 Fidgeting = 0x9,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
98 Interacting = 10,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
99 Removed = 11,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
100 AttackingRanged2 = 0xC,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
101 AttackingRanged3 = 0xD,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
102 Stoned = 0xE,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
103 Paralyzed = 0xF,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
104 Resurrected = 16,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
105 Summoned = 17,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
106 AttackingRanged4 = 18,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
107 Disabled = 19,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
108 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
109
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
110 /* 265 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
111 enum ActorAnimation : __int32
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
112 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
113 ANIM_Standing = 0x0,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
114 ANIM_Walking = 0x1,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
115 ANIM_AtkMelee = 0x2,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
116 ANIM_AtkRanged = 0x3,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
117 ANIM_GotHit = 0x4,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
118 ANIM_Dying = 0x5,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
119 ANIM_Dead = 0x6,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
120 ANIM_Bored = 0x7,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
121 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
122
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
123 #define ACTOR_UNKNOW2 0x00000008
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
124 #define ACTOR_STAND_IN_QUEUE 0x00000080
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
125 #define ACTOR_ALIVE 0x00000400
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
126 #define ACTOR_ACTIVE 0x00004000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
127 #define ACTOR_NEARBY 0x00008000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
128 #define ACTOR_UNKNOW11 0x00010000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
129 #define ACTOR_FLEEING 0x00020000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
130 #define ACTOR_UNKNOW5 0x00040000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
131 #define ACTOR_AGGRESSOR 0x00080000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
132 #define ACTOR_UNKNOW7 0x00100000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
133 #define ACTOR_ANIMATION 0x00200000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
134 #define ACTOR_UNKNOW9 0x00400000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
135 #define ACTOR_HAS_ITEM 0x00800000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
136 #define ACTOR_HOSTILE 0x01000000
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
137
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
138 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
139
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
140
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
141
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
142
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
143 /* 247 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
144 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
145 struct AIDirection
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
146 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
147 Vec3_int_ vDirection;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
148 unsigned int uDistance;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
149 unsigned int uDistanceXZ;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
150 unsigned int uYawAngle;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
151 unsigned int uPitchAngle;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
152 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
153 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
154
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
155
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
156
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
157
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
158
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
159 /* 71 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
160 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
161 struct ActorJob
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
162 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
163 struct Vec3_short_ vPos;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
164 unsigned __int16 uAttributes;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
165 unsigned __int8 uAction;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
166 unsigned __int8 uHour;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
167 unsigned __int8 uDay;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
168 unsigned __int8 uMonth;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
169 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
170 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
171
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
172
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
173 /* 66 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
174 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
175 struct Actor
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
176 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
177 //----- (0041F4C1) --------------------------------------------------------
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
178 inline Actor()
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
179 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
180 signed int i; // edx@1
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
181
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
182 for ( i = 0; i < 22; i++ )
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
183 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
184 this->pActorBuffs[i].uSkill = 0;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
185 this->pActorBuffs[i].uPower = 0;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
186 this->pActorBuffs[i].uExpireTime = 0;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
187 this->pActorBuffs[i].uCaster = 0;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
188 this->pActorBuffs[i].uFlags = 0;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
189 }
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
190 for ( i = 0; i < 4; i++ )
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
191 this->ActorHasItems[i].Reset();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
192 Reset();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
193 }
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
194
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
195 void SummonMinion(int summonerId);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
196 void Reset();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
197 void Remove();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
198 void PrepareSprites(char load_sounds_if_bit1_set);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
199 void UpdateAnimation();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
200 signed int GetActorsRelation(Actor *a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
201 void SetRandomGoldIfTheresNoItem();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
202 bool CanAct();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
203 bool IsNotAlive();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
204 bool IsPeasant();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
205
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
206 inline void ResetAnimation(){uAttributes &= 0xFFDFFFFF;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
207 inline void ResetQueue(){uAttributes &= ~ACTOR_STAND_IN_QUEUE;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
208 inline void ResetActive(){uAttributes &= 0xFFFFBFFF;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
209 inline void ResetAlive(){uAttributes &= 0xFFFFFBFF;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
210 inline void ResetHasItem(){uAttributes &= 0xFF7FFFFF;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
211 inline void ResetHostile(){uAttributes &= 0xFEFFFFFF;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
212 inline void ResetAggressor(){uAttributes &= 0xFFF7FFFF;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
213 inline bool ActorEnemy()const {return(uAttributes & ACTOR_AGGRESSOR) != 0;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
214 inline bool ActorFriend()const {return(uAttributes & ACTOR_AGGRESSOR) == 0;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
215 inline bool ActorHasItem()const {return(uAttributes & ACTOR_HAS_ITEM) != 0;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
216 inline bool ActorNearby()const {return(uAttributes & ACTOR_NEARBY) != 0;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
217
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
218 static void _SelectTarget(unsigned int uActorID, int *a2, bool can_target_party);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
219 static void AI_Pursue3(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
220 static void AI_Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *pDir, int a5);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
221 static void AI_Flee(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
222 static void AI_Pursue1(unsigned int uActorID, unsigned int a2, signed int arg0, signed int uActionLength, struct AIDirection *pDir);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
223 static void PlaySound(unsigned int uActorID, unsigned int uSoundID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
224 static void Die(unsigned int uActorID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
225 static void Resurrect(unsigned int uActorID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
226 static void AI_Bored(unsigned int uActorID, unsigned int uObjID, struct AIDirection *a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
227 static void AI_Stun(unsigned int uActorID, signed int edx0, int arg0);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
228 static char __fastcall _4031C1_update_job_never_gets_called(unsigned int uActorID, signed int a2, int a3);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
229 static void AI_RandomMove(unsigned int uActor_id, unsigned int uTarget_id, int radius, int uActionLength);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
230 static void AI_MissileAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
231 static void AI_MissileAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
232 static void AI_SpellAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
233 static void AI_SpellAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
234 static void AI_MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
235 static void __fastcall StandAwhile(unsigned int uActorID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
236 static void AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, struct AIDirection *a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
237 static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
238 static void AI_FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, struct AIDirection *a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
239 static void GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
240 static void Explode(unsigned int uActorID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
241 static void AI_RangedAttack(unsigned int uActorID, struct AIDirection *a2, int type, char a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
242 static void AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
243 static void ActorDamageFromMonster(signed int attacker_id, unsigned int actor_id, struct Vec3_int_ *pVelocity, signed int a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
244
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
245 static unsigned short GetObjDescId( int spellId );
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
246
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
247 static void AggroSurroundingPeasants(unsigned int uActorID, int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
248 static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
249 static void StealFrom(unsigned int uActorID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
250 static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
251 static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
252 static void ApplyFineForKillingPeasant(unsigned int uActorID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
253 static void DrawHealthBar(Actor *actor, struct GUIWindow *window);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
254 int _43B3E0_CalcDamage(signed int dmgSource);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
255 static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
256
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
257 static bool _46DF1A_collide_against_actor(int a1, int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
258 static void Arena_summon_actor(int monster_id, __int16 x, int y, int z);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
259 static void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
260 static void MakeActorAIList_ODM();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
261 static int MakeActorAIList_BLV();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
262 static void UpdateActorAI();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
263 static void InitializeActors();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
264 static unsigned int SearchAliveActors(unsigned int *pTotalActors);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
265 static unsigned int SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
266 static unsigned int SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
267 static unsigned int SearchActorByID(unsigned int *pTotalActors, unsigned int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
268
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
269
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
270 void LootActor();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
271 bool _427102_IsOkToCastSpell(signed int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
272 ABILITY_INDEX special_ability_use_check(int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
273 bool _4273BB_DoesHitOtherActor(Actor *defender, int a3, int a4);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
274 bool ActorHitOrMiss(Player *pPlayer);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
275 int CalcMagicalDamageToActor(DAMAGE_TYPE dmgType, signed int incomingDmg);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
276 bool DoesDmgTypeDoDamage(DAMAGE_TYPE uType);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
277
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
278 char pActorName[32];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
279 signed __int16 sNPC_ID;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
280 __int16 field_22;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
281 unsigned int uAttributes;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
282 __int16 sCurrentHP;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
283 char field_2A[2];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
284 struct MonsterInfo pMonsterInfo;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
285 __int16 word_000084_range_attack;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
286 __int16 word_000086_some_monster_id;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
287 unsigned __int16 uActorRadius;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
288 unsigned __int16 uActorHeight;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
289 unsigned __int16 uMovementSpeed;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
290 struct Vec3_short_ vPosition;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
291 struct Vec3_short_ vVelocity;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
292 unsigned __int16 uYawAngle;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
293 unsigned __int16 uPitchAngle;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
294 __int16 uSectorID;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
295 unsigned __int16 uCurrentActionLength;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
296 struct Vec3_short_ vInitialPosition;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
297 struct Vec3_short_ vGuardingPosition;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
298 unsigned __int16 uTetherDistance;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
299 AIState uAIState;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
300 unsigned __int16 uCurrentActionAnimation;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
301 unsigned __int16 uCarriedItemID;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
302 char field_B6;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
303 char field_B7;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
304 unsigned int uCurrentActionTime;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
305 unsigned __int16 pSpriteIDs[8];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
306 unsigned __int16 pSoundSampleIDs[4]; // 1 die 3 bored
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
307 struct SpellBuff pActorBuffs[22];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
308 struct ItemGen ActorHasItems[4];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
309 unsigned int uGroup;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
310 unsigned int uAlly;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
311 struct ActorJob pScheduledJobs[8];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
312 unsigned int uSummonerID;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
313 unsigned int uLastCharacterIDToHit;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
314 int dword_000334_unique_name;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
315 char field_338[12];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
316 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
317 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
318
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
319
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
320
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
321
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
322
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
323
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
324 //extern Actor pMonsterInfoUI_Doll;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
325
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
326 extern std::array<Actor, 500> pActors;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
327 extern size_t uNumActors;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
328
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
329 bool CheckActors_proximity();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
330 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive); // idb
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
331 void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
332 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
333 bool __fastcall sub_4070EF_prolly_detect_player(unsigned int uObjID, unsigned int uObj2ID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
334 bool __fastcall SpawnActor(unsigned int uMonsterID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
335 int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
336 void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
337 void area_of_effect__damage_evaluate();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
338 double __fastcall sub_43AE12(signed int a1);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
339 void ItemDamageFromActor(unsigned int uObjID, unsigned int uActorID, struct Vec3_int_ *pVelocity);