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;
100 float unconscioustime;
118 bool rabbitkickenabled;
127 float damagetolerance;
129 float permanentdamage;
130 float superpermanentdamage;
149 float texupdatedelay;
151 float headyaw,headpitch;
152 float targetheadyaw,targetheadpitch;
163 float normalsupdatedelay;
168 bool forwardstogglekeydown;
173 bool jumptogglekeydown;
175 bool crouchtogglekeydown;
177 bool drawtogglekeydown;
179 bool throwtogglekeydown;
185 float crouchkeydowntime;
186 float jumpkeydowntime;
194 float losupdatedelay;
202 float whichdirectiondelay;
205 float blooddimamount;
212 float lefthandmorphness;
213 float righthandmorphness;
215 float chestmorphness;
217 float targetlefthandmorphness;
218 float targetrighthandmorphness;
219 float targetheadmorphness;
220 float targetchestmorphness;
221 float targettailmorphness;
222 int lefthandmorphstart,lefthandmorphend;
223 int righthandmorphstart,righthandmorphend;
224 int headmorphstart,headmorphend;
225 int chestmorphstart,chestmorphend;
226 int tailmorphstart,tailmorphend;
228 float weaponmissdelay;
229 float highreversaldelay;
230 float lowreversaldelay;
231 float nocollidedelay;
244 float protectionhead;
245 float protectionhigh;
255 char clothes[10][256];
256 float clothestintr[10];
257 float clothestintg[10];
258 float clothestintb[10];
269 float updatestuffdelay;
277 int weaponstuckwhere;
282 int waypointtype[90];
284 bool hastempwaypoint;
290 XYZ finalfinaltarget;
292 int finalpathfindpoint;
293 int targetpathfindpoint;
294 int lastpathfindpoint;
295 int lastpathfindpoint2;
296 int lastpathfindpoint3;
297 int lastpathfindpoint4;
308 float runninghowlong;
314 float neckspurtdelay;
315 float neckspurtparticledelay;
316 float neckspurtamount;
319 bool rabbitkickragdoll;
324 Animation tempanimation;
339 void DoBlood(float howmuch, int which);
340 void DoBloodBig(float howmuch, int which);
341 bool DoBloodBigWhere(float howmuch, int which, XYZ where);
343 bool wasIdle() { return animation_bits[animCurrent] & ab_idle; }
344 bool isIdle() { return animation_bits[animTarget] & ab_idle; }
347 bool isSitting() { return animation_bits[animTarget] & ab_sit; }
349 bool isSleeping() { return animation_bits[animTarget] & ab_sleep; }
351 bool wasCrouch() { return animation_bits[animCurrent] & ab_crouch; }
352 bool isCrouch() { return animation_bits[animTarget] & ab_crouch; }
355 bool wasStop() { return animation_bits[animCurrent] & ab_stop; }
356 bool isStop() { return animation_bits[animTarget] & ab_stop; }
363 bool wasRun() { return animation_bits[animCurrent] & ab_run; }
364 bool isRun() { return animation_bits[animTarget] & ab_run; }
367 bool wasLanding() { return animation_bits[animCurrent] & ab_land; }
368 bool isLanding() { return animation_bits[animTarget] & ab_land; }
371 bool wasLandhard() { return animation_bits[animCurrent] & ab_landhard; }
372 bool isLandhard() { return animation_bits[animTarget] & ab_landhard; }
375 bool wasFlip() { return animation_bits[animCurrent] & ab_flip; }
376 bool isFlip() { return animation_bits[animTarget] & ab_flip; }
378 bool isWallJump() { return animation_bits[animTarget] & ab_walljump; }
380 void DoDamage(float howmuch);
384 skeleton.drawmodel.textureptr.bind();
385 glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
386 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, skeleton.skinsize, skeleton.skinsize, 0, GL_RGB, GL_UNSIGNED_BYTE, &skeleton.skinText[0]);
389 int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
391 void Puff(int whichlabel);
392 void FootLand(int which, float opacity);
394 void setAnimation(int);
396 void RagDoll(bool checkcollision);
399 const int maxplayers = 10;
400 extern Person player[maxplayers];