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
56 // animCurrent and animTarget are used to interpolate between different animations
57 // (and for a bunch of other things).
58 // animations interpolate with one another at various speeds.
59 // animTarget seems to determine the combat state?
63 // frameCurrent and frameTarget are used to interpolate between the frames of an animation
64 // (e.g. the crouched animation has only two frames, lerped back and forth slowly).
65 // animations advance at various speeds.
76 float parriedrecently;
80 int lastattack,lastattack2,lastattack3;
82 XYZ currentoffset,targetoffset,offset;
97 float unconscioustime;
115 bool rabbitkickenabled;
124 float damagetolerance;
126 float permanentdamage;
127 float superpermanentdamage;
146 float texupdatedelay;
148 float headyaw,headpitch;
149 float targetheadyaw,targetheadpitch;
160 float normalsupdatedelay;
165 bool forwardstogglekeydown;
170 bool jumptogglekeydown;
172 bool crouchtogglekeydown;
174 bool drawtogglekeydown;
176 bool throwtogglekeydown;
182 float crouchkeydowntime;
183 float jumpkeydowntime;
191 float losupdatedelay;
199 float whichdirectiondelay;
202 float blooddimamount;
209 float lefthandmorphness;
210 float righthandmorphness;
212 float chestmorphness;
214 float targetlefthandmorphness;
215 float targetrighthandmorphness;
216 float targetheadmorphness;
217 float targetchestmorphness;
218 float targettailmorphness;
219 int lefthandmorphstart,lefthandmorphend;
220 int righthandmorphstart,righthandmorphend;
221 int headmorphstart,headmorphend;
222 int chestmorphstart,chestmorphend;
223 int tailmorphstart,tailmorphend;
225 float weaponmissdelay;
226 float highreversaldelay;
227 float lowreversaldelay;
228 float nocollidedelay;
241 float protectionhead;
242 float protectionhigh;
252 char clothes[10][256];
253 float clothestintr[10];
254 float clothestintg[10];
255 float clothestintb[10];
266 float updatestuffdelay;
274 int weaponstuckwhere;
279 int waypointtype[90];
281 bool hastempwaypoint;
287 XYZ finalfinaltarget;
289 int finalpathfindpoint;
290 int targetpathfindpoint;
291 int lastpathfindpoint;
292 int lastpathfindpoint2;
293 int lastpathfindpoint3;
294 int lastpathfindpoint4;
305 float runninghowlong;
311 float neckspurtdelay;
312 float neckspurtparticledelay;
313 float neckspurtamount;
316 bool rabbitkickragdoll;
321 Animation tempanimation;
336 void DoBlood(float howmuch, int which);
337 void DoBloodBig(float howmuch, int which);
338 bool DoBloodBigWhere(float howmuch, int which, XYZ where);
340 bool wasIdle() { return animation_bits[animCurrent] & ab_idle; }
341 bool isIdle() { return animation_bits[animTarget] & ab_idle; }
344 bool isSitting() { return animation_bits[animTarget] & ab_sit; }
346 bool isSleeping() { return animation_bits[animTarget] & ab_sleep; }
348 bool wasCrouch() { return animation_bits[animCurrent] & ab_crouch; }
349 bool isCrouch() { return animation_bits[animTarget] & ab_crouch; }
352 bool wasStop() { return animation_bits[animCurrent] & ab_stop; }
353 bool isStop() { return animation_bits[animTarget] & ab_stop; }
360 bool wasRun() { return animation_bits[animCurrent] & ab_run; }
361 bool isRun() { return animation_bits[animTarget] & ab_run; }
364 bool wasLanding() { return animation_bits[animCurrent] & ab_land; }
365 bool isLanding() { return animation_bits[animTarget] & ab_land; }
368 bool wasLandhard() { return animation_bits[animCurrent] & ab_landhard; }
369 bool isLandhard() { return animation_bits[animTarget] & ab_landhard; }
372 bool wasFlip() { return animation_bits[animCurrent] & ab_flip; }
373 bool isFlip() { return animation_bits[animTarget] & ab_flip; }
375 bool isWallJump() { return animation_bits[animTarget] & ab_walljump; }
377 void DoDamage(float howmuch);
381 skeleton.drawmodel.textureptr.bind();
382 glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
383 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, skeleton.skinsize, skeleton.skinsize, 0, GL_RGB, GL_UNSIGNED_BYTE, &skeleton.skinText[0]);
386 int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
388 void Puff(int whichlabel);
389 void FootLand(int which, float opacity);
391 void setAnimation(int);
393 void RagDoll(bool checkcollision);
396 const int maxplayers = 10;
397 extern Person player[maxplayers];