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