/**> HEADER FILES <**/
#include "Person.h"
#include "openal_wrapper.h"
+#include "Animation.h"
+#include "Sounds.h"
+#include "Awards.h"
+#include "Game.h"
extern float multiplier;
-extern Animation animation[animation_count];
-extern OPENAL_SAMPLE *samp[100];
extern int channels[100];
extern Terrain terrain;
extern float gravity;
extern int environment;
-extern Sprites sprites;
extern int detail;
extern FRUSTUM frustum;
extern XYZ viewer;
extern float viewdistance;
extern float blackout;
extern int difficulty;
-extern Weapons weapons;
extern bool decals;
extern float fadestart;
-extern Person player[maxplayers];
-extern int numplayers;
extern bool freeze;
extern bool winfreeze;
extern float flashamount,flashr,flashg,flashb;
extern float envsoundvol[30];
extern float envsoundlife[30];
extern int numenvsounds;
-extern int bonus;
-extern float bonusvalue;
-extern float bonustotal;
-extern float bonustime;
extern int tutoriallevel;
extern float smoketex;
extern int tutorialstage;
extern bool canattack;
extern bool cananger;
extern float damagedealt;
-extern float damagetaken;
extern int hostile;
extern float hostiletime;
-extern int mainmenu;
-
-extern int numfalls;
-extern int numflipfail;
-extern int numseen;
-extern int numswordattack;
-extern int numknifeattack;
-extern int numunarmedattack;
-extern int numescaped;
-extern int numflipped;
-extern int numwallflipped;
-extern int numthrowkill;
-extern int numafterkill;
-extern int numreversals;
-extern int numattacks;
-extern int maxalarmed;
extern int indialogue;
extern bool gamestarted;
-extern OPENAL_STREAM * strm[20];
extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused);
extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused);
skeleton.free=0;
if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
- //if(victim->damage>victim->damagetolerance){
- if(id==0){
- bonus=cannon;
- bonustime=0;
- bonusvalue=100;
- }
- //}
+ award_bonus(id, cannon);
}
else if (victim->isCrouch()){
targetanimation=rabbitkickreversedanim;
if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity;
if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
- sprites.MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, 2, 1);
+ Sprite::MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, 2, 1);
}
onfiredelay=0.5;
vel[1]=velocity.y;
vel[2]=velocity.z;
//PlaySoundEx( firesound, samp[firesound], NULL, true);
- PlayStreamEx( stream_firesound, strm[stream_firesound], NULL, true);
+ PlayStreamEx( stream_firesound, samp[stream_firesound], NULL, true);
OPENAL_3D_SetAttributes(channels[stream_firesound], gLoc, vel);
OPENAL_SetVolume(channels[stream_firesound], 256);
OPENAL_SetPaused(channels[stream_firesound], false);
else return 0;
}
-void SolidHitBonus();
void SolidHitBonus(){
if(bonustime<1.5&&(bonus==fourxcombo||bonus==megacombo)){
- bonus=megacombo;
- bonustime=0;
- bonusvalue=160;
+ award_bonus(0, megacombo);
}
else if(bonustime<1.5&&bonus==threexcombo){
- bonus=fourxcombo;
- bonustime=0;
- bonusvalue=80;
+ award_bonus(0, fourxcombo);
}
else if(bonustime<1.5&&bonus==twoxcombo){
- bonus=threexcombo;
- bonustime=0;
- bonusvalue=40;
+ award_bonus(0, threexcombo);
}
else if(bonustime<1.5&&bonus==solidhit){
- bonus=twoxcombo;
- bonustime=0;
- bonusvalue=20;
+ award_bonus(0, twoxcombo);
}
else {
- bonus=solidhit;
- bonustime=0;
- bonusvalue=10;
+ award_bonus(0, solidhit);
}
}
if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
if(skeleton.free){
- sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
}
if(!skeleton.free){
- sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
}
}
if(Random()%2==0)
for(int i=0;i<3;i++){
if(Random()%2!=0){
bloodvel=0;
- if(!skeleton.free){
+ if(skeleton.free) {
+ bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0);
+ bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
+ } else {
bloodvel.z=10;
bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
+ bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
}
- if(skeleton.free){
- bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0);
- }
- if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
- if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
bloodvel*=.2;
if(skeleton.free){
- sprites.MakeSprite(splintersprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.special[sprites.numsprites-1]=3;
- }
- if(!skeleton.free){
- sprites.MakeSprite(splintersprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.special[sprites.numsprites-1]=3;
+ Sprite::MakeSprite(splintersprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+ } else {
+ Sprite::MakeSprite(splintersprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
}
+ Sprite::setLastSpriteSpecial(3);
}
}
}
bleedxint=abs(Random()%512);
bleedyint=abs(Random()%512);
}
- if(creature==wolftype)
- while(wolfbloodText[bleedxint*512*3+bleedyint*3+0]>which+4||wolfbloodText[bleedxint*512*3+bleedyint*3+0]<which-4||bleedxint<10||bleedyint<10||bleedxint>500||bleedyint>500){
- bleedxint=abs(Random()%512);
- bleedyint=abs(Random()%512);
- }
- bleedy=bleedxint;
- bleedx=bleedyint;
- bleedy/=realtexdetail;
- bleedx/=realtexdetail;
- direction=abs(Random()%2)*2-1;
+ if(creature==wolftype)
+ while(wolfbloodText[bleedxint*512*3+bleedyint*3+0]>which+4||wolfbloodText[bleedxint*512*3+bleedyint*3+0]<which-4||bleedxint<10||bleedyint<10||bleedxint>500||bleedyint>500){
+ bleedxint=abs(Random()%512);
+ bleedyint=abs(Random()%512);
+ }
+ bleedy=bleedxint;
+ bleedx=bleedyint;
+ bleedy/=realtexdetail;
+ bleedx/=realtexdetail;
+ direction=abs(Random()%2)*2-1;
}
}
if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
if(skeleton.free){
- sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
}
if(!skeleton.free){
- sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
}
}
}
if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
if(skeleton.free){
- sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
}
if(!skeleton.free){
- sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
- sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
}
}
}
flatvelocity2.x+=(float)(abs(Random()%100)-50)/10;
flatvelocity2.y+=(float)(abs(Random()%100)-50)/10;
flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
- sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
- sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .4, 1);
- sprites.MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
+ Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
+ Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .4, 1);
+ Sprite::MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
}
float gLoc[3];
slomodelay=.2;
}*/
if(!dead&&creature==wolftype){
- bonus=Wolfbonus;
- bonustime=0;
- bonusvalue=300;
+ award_bonus(0, Wolfbonus);
}
dead=2;
coords=20;
static XYZ facing;
static float lookspeed=500;
- if(!freeze&&!winfreeze&&(!mainmenu||!gamestarted)){
+ if(!freeze&&!winfreeze){
//head facing
targetheadrotation=(float)((int)((0-rotation-targetheadrotation+180)*100)%36000)/100;
if(which==0)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)*scale+coords;
if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
//footpoint.y=coords.y;
- if(findDistancefast(&footpoint,&viewer))sprites.MakeSprite(cloudsprite, footpoint,footvel, 1,1,1, .5, .2*opacity);
+ if(findDistancefast(&footpoint,&viewer))Sprite::MakeSprite(cloudsprite, footpoint,footvel, 1,1,1, .5, .2*opacity);
}
else if(environment==snowyenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){
footvel=velocity/5;
if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
footpoint.y=terrain.getHeight(footpoint.x,footpoint.z);
terrainlight=terrain.getLighting(footpoint.x,footpoint.z);
- if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x,terrainlight.y,terrainlight.z, .5, .7*opacity);
+ if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x,terrainlight.y,terrainlight.z, .5, .7*opacity);
if(opacity>=1||detail==2)if(detail==2)if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)terrain.MakeDecal(footprintdecal,footpoint,.2,1*opacity,rotation);
}
else if(environment==grassyenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){
if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
footpoint.y=terrain.getHeight(footpoint.x,footpoint.z);
terrainlight=terrain.getLighting(footpoint.x,footpoint.z);
- if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5*opacity);
+ if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5*opacity);
}
else if(environment==desertenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){
footvel=velocity/5;
if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
footpoint.y=terrain.getHeight(footpoint.x,footpoint.z);
terrainlight=terrain.getLighting(footpoint.x,footpoint.z);
- if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7*opacity);
+ if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7*opacity);
if(opacity>=1||detail==2)if(detail==2)if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)terrain.MakeDecal(footprintdecal,footpoint,.2,.25*opacity,rotation);
}
else if(isLanding()||targetanimation==jumpupanim||isLandhard())
if(which==0)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)*scale+coords;
if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
//footpoint.y=coords.y;
- if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, 1,1,1, .5, .2*opacity);
+ if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, 1,1,1, .5, .2*opacity);
}
}
footvel=0;
footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[whichlabel]].position,0,rotation,0)*scale+coords;
- sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .9, .3);
+ Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .9, .3);
}
-/*
-HitStruct Person::BulletCollideWithPlayer(XYZ start, XYZ end){
-float damage=20;
-XYZ tempbulletloc[2];
-XYZ collisionpoint;
-XYZ sparkpos;
-GLfloat M[16];
-int collide;
-float howfar;
-XYZ average;
-XYZ facing;
-int howmany;
-float distancemax;
-HitStruct hitstruct;
-hitstruct.collision=0;
-//Make bounding sphere
-average=0;
-howmany=0;
-for(int j=0;j<skeleton.num_joints;j++){
-average.x=average.x+skeleton.joints[j].position.x;
-average.y=average.y+skeleton.joints[j].position.y;
-average.z=average.z+skeleton.joints[j].position.z;
-howmany++;
-}
-average=average/howmany;
-distancemax=0;
-for(int j=0;j<skeleton.num_joints;j++){
-if(findDistancefast(average,skeleton.joints[j].position)>distancemax){
-distancemax=findDistancefast(average,skeleton.joints[j].position);
-}
-}
-distancemax=fast_sqrt(distancemax);
-//Collide with player
-if(skeleton.free<1){
-start=start-coords;
-end=end-coords;
-if(rotation)start=DoRotation(start,0,-rotation,0);
-if(rotation)end=DoRotation(end,0,-rotation,0);
-}
-tempbulletloc[0]=start;
-tempbulletloc[1]=end;
-if(sphere_line_intersection(tempbulletloc[0].x,tempbulletloc[0].y,tempbulletloc[0].z,
-tempbulletloc[1].x,tempbulletloc[1].y,tempbulletloc[1].z,
-average.x, average.y, average.z, distancemax)){
-for(int j=0;j<skeleton.num_joints;j++){
-if(skeleton.joints[j].hasparent&&skeleton.joints[j].visible){
-tempbulletloc[0]=start;
-tempbulletloc[1]=end;
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.joints[j].length,1);
-glRotatef(skeleton.joints[j].rotate2-90,0,0,1);
-glRotatef(skeleton.joints[j].rotate1-90,0,1,0);
-glTranslatef( (-(skeleton.joints[j].position.x+skeleton.joints[j].parent->position.x)/2),
-(-(skeleton.joints[j].position.y+skeleton.joints[j].parent->position.y)/2),
-(-(skeleton.joints[j].position.z+skeleton.joints[j].parent->position.z)/2));
-glTranslatef(tempbulletloc[0].x,tempbulletloc[0].y,tempbulletloc[0].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[0].x=M[12];
-tempbulletloc[0].y=M[13];
-tempbulletloc[0].z=M[14];
-glPopMatrix();
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.joints[j].length,1);
-glRotatef(skeleton.joints[j].rotate2-90,0,0,1);
-glRotatef(skeleton.joints[j].rotate1-90,0,1,0);
-glTranslatef( (-(skeleton.joints[j].position.x+skeleton.joints[j].parent->position.x)/2),
-(-(skeleton.joints[j].position.y+skeleton.joints[j].parent->position.y)/2),
-(-(skeleton.joints[j].position.z+skeleton.joints[j].parent->position.z)/2));
-glTranslatef(tempbulletloc[1].x,tempbulletloc[1].y,tempbulletloc[1].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[1].x=M[12];
-tempbulletloc[1].y=M[13];
-tempbulletloc[1].z=M[14];
-glPopMatrix();
-collide=skeletonmodels[skeleton.joints[j].modelnum].LineCheck(tempbulletloc[0],tempbulletloc[1],&collisionpoint);
-if(collide!=-1)
-{
-glPushMatrix();
-glLoadIdentity();
-glTranslatef( (skeleton.joints[j].position.x+skeleton.joints[j].parent->position.x)/2,
-(skeleton.joints[j].position.y+skeleton.joints[j].parent->position.y)/2,
-(skeleton.joints[j].position.z+skeleton.joints[j].parent->position.z)/2);
-glRotatef(-skeleton.joints[j].rotate1+90,0,1,0);
-glRotatef(-skeleton.joints[j].rotate2+90,0,0,1);
-glScalef(1,skeleton.joints[j].length,1);
-glTranslatef(collisionpoint.x,collisionpoint.y,collisionpoint.z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-collisionpoint.x=M[12];
-collisionpoint.y=M[13];
-collisionpoint.z=M[14];
-glPopMatrix();
-hitstruct.collision=1;
-hitstruct.hitlocation=collisionpoint;
-hitstruct.joint1=&skeleton.joints[j];
-hitstruct.joint2=skeleton.joints[j].parent;
-}
-}
-}
-for(int j=0;j<skeleton.num_muscles;j++){
-if(skeleton.muscles[j].visible){
-tempbulletloc[0]=start;
-tempbulletloc[1]=end;
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.muscles[j].length,1);
-glRotatef(skeleton.muscles[j].rotate3,0,1,0);
-glRotatef(skeleton.muscles[j].rotate2-90,0,0,1);
-glRotatef(skeleton.muscles[j].rotate1-90,0,1,0);
-glTranslatef( (-(skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2),
-(-(skeleton.muscles[j].parent1->position.y+skeleton.muscles[j].parent2->position.y)/2),
-(-(skeleton.muscles[j].parent1->position.z+skeleton.muscles[j].parent2->position.z)/2));
-
-glTranslatef(tempbulletloc[0].x,tempbulletloc[0].y,tempbulletloc[0].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[0].x=M[12];
-tempbulletloc[0].y=M[13];
-tempbulletloc[0].z=M[14];
-glPopMatrix();
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.muscles[j].length,1);
-glRotatef(skeleton.muscles[j].rotate3,0,1,0);
-glRotatef(skeleton.muscles[j].rotate2-90,0,0,1);
-glRotatef(skeleton.muscles[j].rotate1-90,0,1,0);
-
-glTranslatef( (-(skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2),
-(-(skeleton.muscles[j].parent1->position.y+skeleton.muscles[j].parent2->position.y)/2),
-(-(skeleton.muscles[j].parent1->position.z+skeleton.muscles[j].parent2->position.z)/2));
-glTranslatef(tempbulletloc[1].x,tempbulletloc[1].y,tempbulletloc[1].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[1].x=M[12];
-tempbulletloc[1].y=M[13];
-tempbulletloc[1].z=M[14];
-glPopMatrix();
-collide=skeletonmodels[skeleton.muscles[j].parent1->modelnum].LineCheck(tempbulletloc[0],tempbulletloc[1],&collisionpoint);
-if(collide!=-1)
-{
-glPushMatrix();
-glLoadIdentity();
-glTranslatef( (skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2,
-(skeleton.muscles[j].parent1->position.y+skeleton.muscles[j].parent2->position.y)/2,
-(skeleton.muscles[j].parent1->position.z+skeleton.muscles[j].parent2->position.z)/2);
-glRotatef(-skeleton.muscles[j].rotate1+90,0,1,0);
-glRotatef(-skeleton.muscles[j].rotate2+90,0,0,1);
-glRotatef(-skeleton.muscles[j].rotate3,0,1,0);
-glScalef(1,findDistance(skeleton.muscles[j].parent1->position,skeleton.muscles[j].parent2->position),1);
-glTranslatef(collisionpoint.x,collisionpoint.y,collisionpoint.z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-collisionpoint.x=M[12];
-collisionpoint.y=M[13];
-collisionpoint.z=M[14];
-glPopMatrix();
-hitstruct.collision=1;
-hitstruct.hitlocation=collisionpoint;
-hitstruct.joint1=skeleton.muscles[j].parent1;
-hitstruct.joint2=skeleton.muscles[j].parent2;
-}
-}
-}
-}
-if(skeleton.free<1){
-if(rotation)hitstruct.hitlocation=DoRotation(hitstruct.hitlocation,0,rotation,0);
-hitstruct.hitlocation=hitstruct.hitlocation+coords;
-}
-return hitstruct;
-}
-*/
void Person::DoAnimations(){
if(!skeleton.free){
int i = 0;
victim->spurt=1;
victim->DoBloodBig(1/victim->armorhead,210);
}
+ award_bonus(id, TackleBonus);
if(id==0){
- bonus=TackleBonus;
- bonustime=0;
- bonusvalue=5;
if(victim->aitype==gethelptype)bonusvalue=50;
}
}
footpoint=weapons.position[i];
if(victim->weaponstuck!=-1){
if(victim->weaponids[victim->weaponstuck]==i){
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
weapons.bloody[i]=2;
weapons.blooddrip[i]=5;
victim->weaponstuck=-1;
victim->DoDamage(damagemult*150/victim->protectionhead);
if(victim->damage>victim->damagetolerance){
- if(id==0){
- bonus=style;
- bonustime=0;
- bonusvalue=150;
- }
+ award_bonus(id, style);
}
else if(id==0){
SolidHitBonus();
victim->DoDamage(damagemult*150/victim->protectionhead);
if(victim->damage>victim->damagetolerance){
- if(id==0){
- bonus=style;
- bonustime=0;
- bonusvalue=150;
- }
+ award_bonus(id, style);
}
else if(id==0){
SolidHitBonus();
if(whichtri!=-1){
if(victim->dead!=2){
victim->DoDamage(abs((victim->damagetolerance-victim->permanentdamage)*2));
- if(id==0&&!victim->dead){
- bonus=FinishedBonus;
- bonustime=0;
- bonusvalue=200;
- }
+ if (!victim->dead)
+ award_bonus(id, FinishedBonus);
}
if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2;
relative.y=10;
Normalise(&relative);
//victim->Puff(abdomen);
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
if(victim->bloodloss<victim->damagetolerance){
victim->bloodloss+=1000;
if(tutoriallevel!=1)victim->DoBloodBig(1.5/victim->armorhigh,225);
//}
- if(id==0){
- bonus=Slicebonus;
- bonustime=0;
- bonusvalue=10;
- }
+ award_bonus(id, Slicebonus);
if(tutoriallevel!=1){
float gLoc[3];
float vel[3];
footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords;
}
if(tutoriallevel!=1){
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3);
footvel=DoRotation(facing,0,90,0)*.8;
//footvel.y-=.3;
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
}
if(tutoriallevel==1){
- sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .6, .3);
+ Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .6, .3);
}
victim->DoDamage(damagemult*0);
}
if(targetanimation==swordslashanim&&animation[targetanimation].label[currentframe]==5&&victim->targetanimation!=rollanim){
if(findDistancefast(&coords,&victim->coords)<(scale*5)*(scale*5)*6.5&&victim->targetanimation!=dodgebackanim){
if(victim->weaponactive==-1||normaldotproduct(victim->facing,victim->coords-coords)>0||(Random()%2==0)){
- if(id==0){
- bonus=Slashbonus;
- bonustime=0;
- bonusvalue=40;
- }
+ award_bonus(id, Slashbonus);
escapednum=0;
if(tutoriallevel!=1){
if(normaldotproduct(victim->facing,victim->coords-coords)<0)victim->DoBloodBig(2/victim->armorhigh,190);
if(!skeleton.free){
footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords;
}
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=DoRotation(facing,0,90,0)*.8;
footvel.y-=.3;
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
}
}
else {
if(tutoriallevel!=1){
victim->DoDamage(damagemult*120/victim->protectionhigh);
- if(id==0){
- bonus=solidhit;
- bonustime=0;
- bonusvalue=30;
- }
+ award_bonus(id, solidhit, 30);
}
}
}
victim->Puff(head);
if(tutoriallevel!=1){victim->DoDamage(damagemult*350/victim->protectionhead);
- if(id==0){
- bonus=solidhit;
- bonustime=0;
- bonusvalue=60;
- }
+ award_bonus(id, solidhit, 60);
}
}
}
if(tutoriallevel!=1){victim->DoDamage(damagemult*100/victim->protectionhigh);
if(!victim->dead){
- if(id==0){
- bonus=solidhit;
- bonustime=0;
- bonusvalue=40;
- }
+ award_bonus(id, solidhit, 40);
}
}
}
victim->Puff(abdomen);
victim->DoDamage(damagemult*150/victim->protectionhigh);
- if(id==0){
- bonus=Reversal;
- bonustime=0;
- bonusvalue=60;
- }
+ award_bonus(id, Reversal);
}
if((targetanimation==swordslashreversalanim||targetanimation==knifeslashreversalanim||targetanimation==staffhitreversalanim||targetanimation==staffspinhitreversalanim)&&animation[targetanimation].label[currentframe]==5){
vel[1]=velocity.y;
vel[2]=velocity.z;
- if(id==0){
- bonus=staffreversebonus;
- bonustime=0;
- bonusvalue=100;
- }
+ award_bonus(id, staffreversebonus);
if(tutoriallevel!=1){
PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true);
OPENAL_SetPaused(channels[heavyimpactsound], false);
}
victim->RagDoll(0);
- if(id==0){
- bonus=staffreversebonus;
- bonustime=0;
- bonusvalue=100;
- }
+ award_bonus(id, staffreversebonus); // Huh, again?
XYZ relative;
relative=victim->coords-oldcoords;
victim->Puff(abdomen);
victim->DoDamage(damagemult*90/victim->protectionhigh);
- if(id==0){
- bonus=Reversal;
- bonustime=0;
- bonusvalue=60;
- }
+ award_bonus(id, Reversal);
bool doslice;
doslice=0;
victim->skeleton.joints[victim->skeleton.jointlabels[rightelbow]].velocity*=.5-1;
victim->skeleton.joints[victim->skeleton.jointlabels[rightshoulder]].velocity*=.7-1;
- if(id==0){
- bonus=swordreversebonus;
- bonustime=0;
- bonusvalue=100;
- }
- //victim->DoDamage(90);
-
- /*if(weaponactive!=-1){
- float gLoc[3];
- float vel[3];
- gLoc[0]=victim->coords.x;
- gLoc[1]=victim->coords.y;
- gLoc[2]=victim->coords.z;
- vel[0]=velocity.x;
- vel[1]=velocity.y;
- vel[2]=velocity.z;
- victim->DoBloodBig(2,225);
- PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true);
- OPENAL_3D_SetAttributes(channels[knifeslicesound], gLoc, vel);
- OPENAL_SetVolume(channels[knifeslicesound], 512);
- OPENAL_SetPaused(channels[knifeslicesound], false);
- if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1;
- weapons.blooddrip[weaponids[weaponactive]]+=3;
- }*/
+ award_bonus(id, swordreversebonus);
}
if(hasvictim&&targetanimation==knifeslashreversalanim&&animation[targetanimation].label[currentframe]==7){
victim->Puff(abdomen);
victim->DoDamage(damagemult*30/victim->protectionhigh);
- if(id==0){
- bonus=Reversal;
- bonustime=0;
- bonusvalue=60;
- }
+ award_bonus(id, Reversal);
}
if(hasvictim&&targetanimation==sneakattackanim&&animation[targetanimation].label[currentframe]==7){
victim->DoBloodBig(2,175);
}
}
- if(id==0){
- bonus=spinecrusher;
- bonustime=0;
- bonusvalue=100;
- }
+ award_bonus(id, spinecrusher);
}
if(hasvictim&&(targetanimation==knifefollowanim||targetanimation==knifesneakattackanim)&&animation[targetanimation].label[currentframe]==5){
bloodvel.z=20;
bloodvel.y=5;
bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
- sprites.MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+ Sprite::MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
*/
XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]]);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
victim->DoBloodBig(200,195);
- if(id==0){
- bonus=tracheotomy;
- bonustime=0;
- bonusvalue=100;
- }
-
- //victim->neckspurtamount=5;
+ award_bonus(id, tracheotomy);
}
if(targetanimation==knifefollowanim){
- if(id==0){
- bonus=Stabbonus;
- bonustime=0;
- bonusvalue=40;
- }
+ award_bonus(id, Stabbonus);
XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]])*-1;
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
}
victim->bloodloss+=10000;
XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]])*-1;
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
}
}
if(hasvictim&&(targetanimation==swordsneakattackanim)&&animation[targetanimation].label[currentframe]==5){
if(weaponactive!=-1&&victim->bloodloss<victim->damagetolerance){
- if(id==0){
- bonus=backstab;
- bonustime=0;
- bonusvalue=100;
- }
+ award_bonus(id, backstab);
escapednum=0;
XYZ footvel,footpoint;
footvel=0;
footpoint=(weapons.tippoint[weaponids[0]]+weapons.position[weaponids[0]])/2;
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]]);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*5,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*5,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
victim->DoBloodBig(200,180);
victim->DoBloodBig(200,215);
victim->bloodloss+=10000;
XYZ footvel,footpoint;
footvel=0;
footpoint=weapons.tippoint[weaponids[0]];
- if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+ if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]])*-1;
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
- sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+ Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
}
}
}
}
- if(id==0){
- bonus=Reversal;
- bonustime=0;
- bonusvalue=60;
- }
+ award_bonus(id, Reversal);
victim->Puff(neck);
if(hasvictim&&(targetanimation==spinkickreversalanim||targetanimation==sweepreversalanim||targetanimation==rabbitkickreversalanim||targetanimation==upunchreversalanim||targetanimation==jumpreversalanim||targetanimation==swordslashreversalanim||targetanimation==knifeslashreversalanim||targetanimation==rabbittacklereversal||targetanimation==wolftacklereversal||targetanimation==staffhitreversalanim||targetanimation==staffspinhitreversalanim))
if(victim->damage>victim->damagetolerance&&bonus!=reverseko){
- if(id==0){
- bonus=reverseko;
- bonustime=0;
- bonusvalue=100;
- }
+ award_bonus(id, reverseko);
}
}
targetanimation=getRun();
targetframe=0;
}
- /*static float toggledelay;
- toggledelay-=multiplier;
- if(toggledelay<0){
- toggledelay=1;
- if(Random()%3==0)superruntoggle=1-superruntoggle;
- }*/
}
if(weaponactive==-1&&num_weapons>0){
if(weapons.type[weaponids[0]]==staff){
if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2;
if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
- sprites.MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
+ Sprite::MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
}
while(flamedelay<0&&!onfire&&tutoriallevel==1&&id!=0){
if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2;
if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
- sprites.MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3);
+ Sprite::MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3);
}
if(bleeding>0){
}
if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/40,rotation+((float)(Random()%100))/40,0)*scale;
if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/40,((float)(Random()%100))/40,0)*scale;
- if(skeleton.free)sprites.MakeSprite(bloodsprite, (skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5)*scale+coords,bloodvel, 1,1,1, .05, .9);
- if(!skeleton.free)sprites.MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, .9);
+ if(skeleton.free)Sprite::MakeSprite(bloodsprite, (skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5)*scale+coords,bloodvel, 1,1,1, .05, .9);
+ if(!skeleton.free)Sprite::MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, .9);
neckspurtparticledelay=.05;
}
if(neckspurtdelay<0){
bloodvel=0;
if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[abdomen]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
- if(skeleton.free)sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
- if(!skeleton.free)sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+ if(skeleton.free)Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+ if(!skeleton.free)Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
}
}
- /*if(id==0){
- bloodloss+=deathbleeding*40;
- deathbleeding=0;
- }*/
bloodloss+=deathbleeding*multiplier*80;
deathbleeding-=multiplier*1.6;
//if(id==0)deathbleeding-=multiplier*.2;
}
if(!dead&&creature==wolftype){
- bonus=Wolfbonus;
- bonustime=0;
- bonusvalue=300;
+ award_bonus(0, Wolfbonus);
}
dead=2;
if(targetanimation==knifefollowedanim&&!skeleton.free){
if(endy>skeleton.skinsize-1){endy=skeleton.skinsize-1;bleeding=0;}
if(endx<startx)endx=startx;
if(endy<starty)endy=starty;
- /*int startx=0;
- int starty=0;
- int endx=256;
- int endy=256;*/
for(i=startx;i<endx;i++){
for(j=starty;j<endy;j++){
if(!skeleton.free)footpoint=DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords;
if(skeleton.free)footpoint=((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2)*scale+coords;
if(targetanimation==sleepanim)footvel=DoRotation(footvel,0,90,0);
- sprites.MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3);
+ Sprite::MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3);
}
}
unconscioustime=0;
if(creature==wolftype){
- bonus=Wolfbonus;
- bonustime=0;
- bonusvalue=300;
+ award_bonus(0, Wolfbonus);
}
RagDoll(0);
}
damage+=20;
-
- /*
- if(bloodloss<damagetolerance)
- for(i=0;i<skeleton.num_joints;i++){
- skeleton.joints[i].velocity*=1.5;
- }*/
}
//if(dead)damage-=multiplier/4;
bled=0;
if(!dead&&creature==wolftype){
- bonus=Wolfbonus;
- bonustime=0;
- bonusvalue=300;
+ award_bonus(0, Wolfbonus);
}
- if(id!=0&&unconscioustime<.1&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=FinishedBonus||bonustime>1)&&bloodloss<damagetolerance){
- bonus=touchofdeath;
- bonustime=0;
- bonusvalue=150;
- }
+ if(unconscioustime<.1&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=FinishedBonus||bonustime>1)&&bloodloss<damagetolerance)
+ award_bonus(id, touchofdeath);
if(id!=0&&unconscioustime>.1){
numafterkill++;
}
skeleton.DoGravity(&scale);
float damageamount;
damageamount=skeleton.DoConstraints(&coords,&scale)*5;
- if(id!=0&&damage>damagetolerance-damageamount&&!dead&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=style||bonustime>1)&&(bonus!=cannon||bonustime>1)){
- bonus=deepimpact;
- bonustime=0;
- bonusvalue=50;
- }
+ if(damage>damagetolerance-damageamount&&!dead&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=style||bonustime>1)&&(bonus!=cannon||bonustime>1))
+ award_bonus(id, deepimpact);
DoDamage(damageamount/((protectionhigh+protectionhead+protectionlow)/3));
average=0;
pos.x+=float(abs(Random()%100)-50)/200;
pos.y+=float(abs(Random()%100)-50)/200;
pos.z+=float(abs(Random()%100)-50)/200;
- sprites.MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
- sprites.special[sprites.numsprites-1]=1;
+ Sprite::MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
+ Sprite::setLastSpriteSpecial(1);
}
howmany=findLength(&velocity)*4;
if(detail==2)
pos.x+=float(abs(Random()%100)-50)/200;
pos.y+=float(abs(Random()%100)-50)/200;
pos.z+=float(abs(Random()%100)-50)/200;
- sprites.MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
- sprites.special[sprites.numsprites-1]=2;
+ Sprite::MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
+ Sprite::setLastSpriteSpecial(2);
}
}
objects.rotx[i]+=velocity.x*multiplier*6;
pos.x+=float(abs(Random()%100)-50)/150;
pos.y+=float(abs(Random()%100)-50)/150;
pos.z+=float(abs(Random()%100)-50)/150;
- sprites.MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
- sprites.special[sprites.numsprites-1]=1;
+ Sprite::MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
+ Sprite::setLastSpriteSpecial(1);
}
howmany=findLength(&velocity)*4;
if(detail==2)
pos.x+=float(abs(Random()%100)-50)/150;
pos.y+=float(abs(Random()%100)-50)/150;
pos.z+=float(abs(Random()%100)-50)/150;
- sprites.MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
- sprites.special[sprites.numsprites-1]=2;
+ Sprite::MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
+ Sprite::setLastSpriteSpecial(2);
}
}
objects.messedwith[i]=.5;
velocity=flatfacing*velspeed;
}
- /*if(creature==wolftype)
- if(isRun()){
- velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
- if(velspeed>speed*55*scale){
- velocity/=velspeed;
- velspeed=speed*55*scale;
- velocity*=velspeed;
- }
- velocity.y+=gravity*multiplier*20;
- ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
- velocity=flatfacing*velspeed;
- }*/
-
if(targetanimation==rollanim&&animation[targetanimation].label[targetframe]!=6){
velocity+=facing*multiplier*speed*700*scale;
velspeed=findLength(&velocity);
if(findDistancefast(&viewer,&coords)<viewdistance*viewdistance/256&&(detail!=1&&detail!=2)){
playerdetail=1;
}
- if(id==0)playerdetail=1;
- if(playerdetail!=oldplayerdetail)updatedelay=0;
- if(playerdetail!=oldplayerdetail)normalsupdatedelay=0;
+ if(id==0)
+ playerdetail=1;
+ if(playerdetail!=oldplayerdetail) {
+ updatedelay=0;
+ normalsupdatedelay=0;
+ }
static float updatedelaychange;
static float morphness;
static float framemult;
}
}
}
- if(!skeleton.free&&(!animation[targetanimation].attack&&targetanimation!=getupfrombackanim&&targetanimation!=getupfrombackanim&&((targetanimation!=rollanim&&!isFlip())||animation[targetanimation].label[targetframe]==6)&&targetanimation!=getupfromfrontanim&&targetanimation!=wolfrunninganim&&targetanimation!=rabbitrunninganim&&targetanimation!=backhandspringanim&&targetanimation!=walljumpfrontanim&&targetanimation!=hurtidleanim&&!isLandhard()&&!isSleeping()))DoHead();
+ if(!skeleton.free&&(!animation[targetanimation].attack&&targetanimation!=getupfrombackanim&&((targetanimation!=rollanim&&!isFlip())||animation[targetanimation].label[targetframe]==6)&&targetanimation!=getupfromfrontanim&&targetanimation!=wolfrunninganim&&targetanimation!=rabbitrunninganim&&targetanimation!=backhandspringanim&&targetanimation!=walljumpfrontanim&&targetanimation!=hurtidleanim&&!isLandhard()&&!isSleeping()))
+ DoHead();
else {
targetheadrotation=-targetrotation;
targetheadrotation2=0;
}
if(playerdetail){
if(!showpoints){
- if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(sprites.cloudimpacttexture);
+ if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture);
else skeleton.drawmodel.draw();
}
}
if(!playerdetail){
- if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(sprites.cloudimpacttexture);
+ if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture);
else skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr);
}
glTranslatef(smoketex*.6,0,0);
if(playerdetail){
if(!showpoints){
- if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(sprites.cloudimpacttexture);
+ if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture);
else skeleton.drawmodel.draw();
}
}
if(!playerdetail){
- if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(sprites.cloudimpacttexture);
+ if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture);
else skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr);
}
}