]> git.jsancho.org Git - lugaru.git/blob - Source/Person.h
b6b65b492a399c0ceead85330a804420220bf6cc
[lugaru.git] / Source / Person.h
1 #ifndef _PERSON_H_
2 #define _PERSON_H_
3
4 /**> HEADER FILES <**/
5
6 #include "gamegl.h"
7 #include "Quaternions.h"
8 #include "fmod.h"
9 #include "Skeleton.h"
10 #include "Models.h"
11 #include "Constants.h"
12 #include "Terrain.h"
13 #include "Sprites.h"
14 #include <cmath>
15 #include "Weapons.h"
16
17 #define passivetype 0
18 #define guardtype 1
19 #define searchtype 2
20 #define attacktype 3
21 #define attacktypecutoff 4
22 #define playercontrolled 5
23 #define gethelptype 6
24 #define getweapontype 7
25 #define pathfindtype 8
26
27 #define rabbittype 0
28 #define wolftype 1
29
30 class HitStruct
31 {
32         public:
33                 Joint *joint1;
34                 Joint *joint2;
35                 XYZ hitlocation;
36                 bool collision;
37 };
38
39 class Person
40 {
41         public:
42                 Person();
43                 ~Person();
44
45                 int whichpatchx;
46                 int whichpatchz;
47                 
48                 int currentframe;
49                 int targetframe;
50                 int currentanimation;
51                 int targetanimation;
52                 int oldcurrentframe;
53                 int oldtargetframe;
54                 int oldcurrentanimation;
55                 int oldtargetanimation;
56                 
57                 int howactive;
58                 
59                 float parriedrecently;
60                 
61                 bool superruntoggle;
62                 
63                 int lastattack,lastattack2,lastattack3;
64                 
65                 XYZ currentoffset,targetoffset,offset;
66                 float target;
67                 float transspeed;
68                 
69                 XYZ realoldcoords;
70                 XYZ oldcoords;
71                 XYZ coords;
72                 XYZ originalcoords;
73                 XYZ velocity;
74                 
75                 XYZ proportionhead;
76                 XYZ proportionlegs;
77                 XYZ proportionarms;
78                 XYZ proportionbody;
79                 
80                 float heightleft;
81                 float heightright;
82                 
83                 float unconscioustime;
84                 
85                 bool immobile;
86                 
87                 float velspeed;
88                 float targetrotation;
89                 float targetrot;
90                 float rot;
91                 float oldrot;
92                 float lookrotation;
93                 float lookrotation2;
94                 float rotation;
95                 float rotation2;
96                 float lowrotation;
97                 float tilt;
98                 float targettilt;
99                 float tilt2;
100                 float targettilt2;
101                 bool rabbitkickenabled;
102                 
103                 float bloodloss;
104                 float bleeddelay;
105                 float skiddelay;
106                 float skiddingdelay;
107                 float deathbleeding;
108                 float tempdeltav;
109                 
110                 float damagetolerance;
111                 float damage;
112                 float permanentdamage;
113                 float superpermanentdamage;             float lastcollide;
114                 int dead;
115                 
116                 float jumppower;
117                 bool onground;
118                 int madskills;
119                 
120                 int wentforweapon;
121                 
122                 bool calcrot;
123                 
124                 bool backwardsanim;
125                 
126                 XYZ facing;
127                 
128                 float bleeding;
129                 float bleedx,bleedy;
130                 int direction;
131                 float texupdatedelay;
132                 
133                 float headrotation,headrotation2;
134                 float targetheadrotation,targetheadrotation2;
135                 
136                 bool onterrain;
137                 bool pause;
138                 
139                 float grabdelay;
140                 
141                 Person *victim;
142                 bool hasvictim;
143                 
144                 float updatedelay;
145                 float normalsupdatedelay;
146                 
147                 bool jumpstart;
148                 
149                 bool forwardkeydown;
150                 bool forwardstogglekeydown;
151                 bool rightkeydown;
152                 bool leftkeydown;
153                 bool backkeydown;
154                 bool jumpkeydown;
155                 bool jumptogglekeydown;
156                 bool crouchkeydown;
157                 bool crouchtogglekeydown;
158                 bool drawkeydown;
159                 bool drawtogglekeydown;
160                 bool throwkeydown;
161                 bool throwtogglekeydown;
162                 bool attackkeydown;
163                 bool feint;
164                 bool lastfeint;
165                 bool headless;
166                 
167                 float crouchkeydowntime;
168                 float jumpkeydowntime;
169                 bool freefall;
170                 
171                 
172                 float turnspeed;
173                 
174                 int aitype;
175                 int aitarget;
176                 float aiupdatedelay;
177                 float losupdatedelay;
178                 int ally;
179                 XYZ movetarget;
180                 float collide;
181                 float collided;
182                 float avoidcollided;
183                 bool loaded;
184                 bool whichdirection;
185                 float whichdirectiondelay;
186                 bool avoidsomething;            XYZ avoidwhere;         
187                 float blooddimamount;
188                 
189                 float staggerdelay;
190                 float blinkdelay;
191                 float twitchdelay;
192                 float twitchdelay2;
193                 float twitchdelay3;
194                 float lefthandmorphness;
195                 float righthandmorphness;
196                 float headmorphness;
197                 float chestmorphness;
198                 float tailmorphness;
199                 float targetlefthandmorphness;
200                 float targetrighthandmorphness;
201                 float targetheadmorphness;
202                 float targetchestmorphness;
203                 float targettailmorphness;
204                 int lefthandmorphstart,lefthandmorphend;
205                 int righthandmorphstart,righthandmorphend;
206                 int headmorphstart,headmorphend;
207                 int chestmorphstart,chestmorphend;
208                 int tailmorphstart,tailmorphend;
209                 
210                 float weaponmissdelay;
211                 float highreversaldelay;
212                 float lowreversaldelay;
213                 float nocollidedelay;
214                 
215                 int creature;
216                 
217                 int id;
218                 
219                 Skeleton skeleton;
220                 
221                 float speed;
222                 float scale;
223                 float power;
224                 float speedmult;
225                 
226                 float protectionhead;
227                 float protectionhigh;
228                 float protectionlow;
229                 float armorhead;
230                 float armorhigh;
231                 float armorlow;
232                 bool metalhead;
233                 bool metalhigh;
234                 bool metallow;
235                 
236                 int numclothes;
237                 char clothes[10][256];
238                 float clothestintr[10];
239                 float clothestintg[10];
240                 float clothestintb[10];
241                 
242                 bool landhard;
243                 bool bled;
244                 bool spurt;
245                 bool onfire;
246                 float onfiredelay;              float burnt;
247                 float fireduration;
248                 
249                 float flamedelay;
250                 float updatestuffdelay;
251                 
252                 int playerdetail;
253                 
254                 int num_weapons;
255                 int weaponids[4];
256                 int weaponactive;
257                 int weaponstuck;
258                 int weaponstuckwhere;
259                 int weaponwhere;
260                 
261                 int numwaypoints;
262                 XYZ waypoints[90];
263                 int waypointtype[90];
264                 float pausetime;
265                 bool hastempwaypoint;
266                 XYZ tempwaypoint;
267                 
268                 XYZ headtarget;
269                 float interestdelay;
270                 
271                 XYZ finalfinaltarget;
272                 XYZ finaltarget;
273                 int finalpathfindpoint;
274                 int targetpathfindpoint;
275                 int lastpathfindpoint;
276                 int lastpathfindpoint2;
277                 int lastpathfindpoint3;
278                 int lastpathfindpoint4;
279                 bool onpath;
280                 
281                 int waypoint;
282                 bool jumppath;
283                 
284                 XYZ lastseen;
285                 float lastseentime;
286                 float lastchecktime;
287                 float stunned;
288                 float surprised;
289                 float runninghowlong;           int lastoccluded;
290                 int laststanding;
291                 int escapednum;
292                 
293                 float speechdelay;
294                 float neckspurtdelay;
295                 float neckspurtparticledelay;
296                 float neckspurtamount;
297                 
298                 int whichskin;
299                 bool rabbitkickragdoll;
300                 
301                 XYZ averageloc;
302                 XYZ oldaverageloc;
303                 
304                 Animation tempanimation;
305                 
306                 float occluded;
307                 
308                 void CheckKick();
309                 void CatchFire();
310                 void DoBlood(float howmuch, int which);
311                 void DoBloodBig(float howmuch, int which);
312                 bool DoBloodBigWhere(float howmuch, int which, XYZ where);
313                 
314                 bool wasIdle();
315                 bool isIdle();
316                 int getIdle();
317                 
318                 bool isSitting();
319                 bool isSleeping();
320                 
321                 
322                 bool wasCrouch();
323                 bool isCrouch();
324                 int getCrouch();
325                 
326                 bool wasStop();
327                 bool isStop();
328                 int getStop();
329                 
330                 bool wasSneak();
331                 bool isSneak();
332                 int getSneak();
333                 
334                 bool wasRun();
335                 bool isRun();
336                 int getRun();
337                 
338                 bool wasLanding();
339                 bool isLanding();
340                 int getLanding();
341                 
342                 bool wasLandhard();
343                 bool isLandhard();
344                 int getLandhard();
345                 
346                 bool isFlip();
347                 bool wasFlip();
348                 
349                 bool jumpclimb;
350                 
351                 bool isWallJump();
352                 void Reverse();
353                 void DoDamage(float howmuch);
354                 void DoHead();
355                 void DoMipmaps(int howmanylevels, float startx, float endx, float starty, float endy);
356                 int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
357                 int DrawSkeleton();
358                 void Puff(int whichlabel);
359                 void FootLand(int which, float opacity);
360                 void DoStuff();
361                 void DoAnimations();
362                 void RagDoll(bool checkcollision);
363                 HitStruct BulletCollideWithPlayer(XYZ start, XYZ end);
364 };
365
366 #endif