2 Copyright (C) 2003, 2010 - Wolfire Games
4 This file is part of Lugaru.
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.
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.
15 See the GNU General Public License for more details.
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.
25 /**> HEADER FILES <**/
28 #include "Quaternions.h"
31 #include "Constants.h"
36 #include "Animation.h"
42 #define attacktypecutoff 4
43 #define playercontrolled 5
45 #define getweapontype 7
46 #define pathfindtype 8
62 int oldcurrentanimation;
63 int oldtargetanimation;
67 float parriedrecently;
71 int lastattack,lastattack2,lastattack3;
73 XYZ currentoffset,targetoffset,offset;
91 float unconscioustime;
109 bool rabbitkickenabled;
118 float damagetolerance;
120 float permanentdamage;
121 float superpermanentdamage; float lastcollide;
139 float texupdatedelay;
141 float headrotation,headrotation2;
142 float targetheadrotation,targetheadrotation2;
153 float normalsupdatedelay;
158 bool forwardstogglekeydown;
163 bool jumptogglekeydown;
165 bool crouchtogglekeydown;
167 bool drawtogglekeydown;
169 bool throwtogglekeydown;
175 float crouchkeydowntime;
176 float jumpkeydowntime;
185 float losupdatedelay;
193 float whichdirectiondelay;
194 bool avoidsomething; XYZ avoidwhere;
195 float blooddimamount;
202 float lefthandmorphness;
203 float righthandmorphness;
205 float chestmorphness;
207 float targetlefthandmorphness;
208 float targetrighthandmorphness;
209 float targetheadmorphness;
210 float targetchestmorphness;
211 float targettailmorphness;
212 int lefthandmorphstart,lefthandmorphend;
213 int righthandmorphstart,righthandmorphend;
214 int headmorphstart,headmorphend;
215 int chestmorphstart,chestmorphend;
216 int tailmorphstart,tailmorphend;
218 float weaponmissdelay;
219 float highreversaldelay;
220 float lowreversaldelay;
221 float nocollidedelay;
234 float protectionhead;
235 float protectionhigh;
245 char clothes[10][256];
246 float clothestintr[10];
247 float clothestintg[10];
248 float clothestintb[10];
254 float onfiredelay; float burnt;
258 float updatestuffdelay;
266 int weaponstuckwhere;
271 int waypointtype[90];
273 bool hastempwaypoint;
279 XYZ finalfinaltarget;
281 int finalpathfindpoint;
282 int targetpathfindpoint;
283 int lastpathfindpoint;
284 int lastpathfindpoint2;
285 int lastpathfindpoint3;
286 int lastpathfindpoint4;
297 float runninghowlong; int lastoccluded;
302 float neckspurtdelay;
303 float neckspurtparticledelay;
304 float neckspurtamount;
307 bool rabbitkickragdoll;
312 Animation tempanimation;
318 void DoBlood(float howmuch, int which);
319 void DoBloodBig(float howmuch, int which);
320 bool DoBloodBigWhere(float howmuch, int which, XYZ where);
324 return animation_bits[currentanimation] & ab_idle;
328 return animation_bits[targetanimation] & ab_idle;
334 return animation_bits[targetanimation] & ab_sit;
339 return animation_bits[targetanimation] & ab_sleep;
344 return animation_bits[currentanimation] & ab_crouch;
348 return animation_bits[targetanimation] & ab_crouch;
354 return animation_bits[currentanimation] & ab_stop;
358 return animation_bits[targetanimation] & ab_stop;
368 return animation_bits[currentanimation] & ab_run;
372 return animation_bits[targetanimation] & ab_run;
378 return animation_bits[currentanimation] & ab_land;
382 return animation_bits[targetanimation] & ab_land;
388 return animation_bits[currentanimation] & ab_landhard;
392 return animation_bits[targetanimation] & ab_landhard;
398 return animation_bits[currentanimation] & ab_flip;
402 return animation_bits[targetanimation] & ab_flip;
409 return animation_bits[targetanimation] & ab_walljump;
412 void DoDamage(float howmuch);
416 glBindTexture(GL_TEXTURE_2D, skeleton.drawmodel.textureptr);
417 gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB,
420 GL_RGB, GL_UNSIGNED_BYTE,
421 &skeleton.skinText[0]);
424 int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
426 void Puff(int whichlabel);
427 void FootLand(int which, float opacity);
430 void RagDoll(bool checkcollision);
433 extern Person player[maxplayers];