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"
35 #include "Animation.h"
41 #define attacktypecutoff 4
42 #define playercontrolled 5
44 #define getweapontype 7
45 #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;
140 float texupdatedelay;
142 float headyaw,headpitch;
143 float targetheadyaw,targetheadpitch;
154 float normalsupdatedelay;
159 bool forwardstogglekeydown;
164 bool jumptogglekeydown;
166 bool crouchtogglekeydown;
168 bool drawtogglekeydown;
170 bool throwtogglekeydown;
176 float crouchkeydowntime;
177 float jumpkeydowntime;
185 float losupdatedelay;
193 float whichdirectiondelay;
196 float blooddimamount;
203 float lefthandmorphness;
204 float righthandmorphness;
206 float chestmorphness;
208 float targetlefthandmorphness;
209 float targetrighthandmorphness;
210 float targetheadmorphness;
211 float targetchestmorphness;
212 float targettailmorphness;
213 int lefthandmorphstart,lefthandmorphend;
214 int righthandmorphstart,righthandmorphend;
215 int headmorphstart,headmorphend;
216 int chestmorphstart,chestmorphend;
217 int tailmorphstart,tailmorphend;
219 float weaponmissdelay;
220 float highreversaldelay;
221 float lowreversaldelay;
222 float nocollidedelay;
235 float protectionhead;
236 float protectionhigh;
246 char clothes[10][256];
247 float clothestintr[10];
248 float clothestintg[10];
249 float clothestintb[10];
260 float updatestuffdelay;
268 int weaponstuckwhere;
273 int waypointtype[90];
275 bool hastempwaypoint;
281 XYZ finalfinaltarget;
283 int finalpathfindpoint;
284 int targetpathfindpoint;
285 int lastpathfindpoint;
286 int lastpathfindpoint2;
287 int lastpathfindpoint3;
288 int lastpathfindpoint4;
299 float runninghowlong;
305 float neckspurtdelay;
306 float neckspurtparticledelay;
307 float neckspurtamount;
310 bool rabbitkickragdoll;
315 Animation tempanimation;
325 void DoBlood(float howmuch, int which);
326 void DoBloodBig(float howmuch, int which);
327 bool DoBloodBigWhere(float howmuch, int which, XYZ where);
329 bool wasIdle() { return animation_bits[currentanimation] & ab_idle; }
330 bool isIdle() { return animation_bits[targetanimation] & ab_idle; }
333 bool isSitting() { return animation_bits[targetanimation] & ab_sit; }
335 bool isSleeping() { return animation_bits[targetanimation] & ab_sleep; }
337 bool wasCrouch() { return animation_bits[currentanimation] & ab_crouch; }
338 bool isCrouch() { return animation_bits[targetanimation] & ab_crouch; }
341 bool wasStop() { return animation_bits[currentanimation] & ab_stop; }
342 bool isStop() { return animation_bits[targetanimation] & ab_stop; }
349 bool wasRun() { return animation_bits[currentanimation] & ab_run; }
350 bool isRun() { return animation_bits[targetanimation] & ab_run; }
353 bool wasLanding() { return animation_bits[currentanimation] & ab_land; }
354 bool isLanding() { return animation_bits[targetanimation] & ab_land; }
357 bool wasLandhard() { return animation_bits[currentanimation] & ab_landhard; }
358 bool isLandhard() { return animation_bits[targetanimation] & ab_landhard; }
361 bool wasFlip() { return animation_bits[currentanimation] & ab_flip; }
362 bool isFlip() { return animation_bits[targetanimation] & ab_flip; }
364 bool isWallJump() { return animation_bits[targetanimation] & ab_walljump; }
366 void DoDamage(float howmuch);
370 skeleton.drawmodel.textureptr.bind();
371 glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
372 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, skeleton.skinsize, skeleton.skinsize, 0, GL_RGB, GL_UNSIGNED_BYTE, &skeleton.skinText[0]);
375 int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
377 void Puff(int whichlabel);
378 void FootLand(int which, float opacity);
380 Joint& getJointFor(int);
381 void setAnimation(int);
383 void RagDoll(bool checkcollision);
386 const int maxplayers = 10;
387 extern Person player[maxplayers];