- if(velocity[i].x||velocity[i].y||velocity[i].z)
- for(j=0;j<numplayers;j++){
- footvel=0;
- footpoint=DoRotation((player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].position+player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].position)/2,0,player[j].rotation,0)*player[j].scale+player[j].coords;
- if(owner[i]==-1&&findDistancefastflat(&position[i],&player[j].coords)<1.5&&findDistancefast(&position[i],&player[j].coords)<4&&player[j].weaponstuck==-1&&!player[j].skeleton.free&&j!=oldowner[i]){
- if((player[j].aitype!=attacktypecutoff||abs(Random()%6)==0||(player[j].targetanimation!=backhandspringanim&&player[j].targetanimation!=rollanim&&player[j].targetanimation!=flipanim&&Random()%2==0))&&!missed[i]){
- bool caught=0;
- if((player[j].creature==wolftype&&Random()%3!=0&&player[j].weaponactive==-1&&(player[j].isIdle()||player[j].isRun()||player[j].targetanimation==walkanim))||(player[j].creature==rabbittype&&Random()%2==0&&player[j].aitype==attacktypecutoff&&player[j].weaponactive==-1)){
- float gLoc[3];
- float vel[3];
- gLoc[0]=player[j].coords.x;
- gLoc[1]=player[j].coords.y;
- gLoc[2]=player[j].coords.z;
- vel[0]=player[j].velocity.x;
- vel[1]=player[j].velocity.y;
- vel[2]=player[j].velocity.z;
- PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true);
- OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel);
- OPENAL_SetVolume(channels[knifedrawsound], 128);
- OPENAL_SetPaused(channels[knifedrawsound], false);
-
- player[j].weaponactive=0;
- player[j].targetanimation=removeknifeanim;
- player[j].targetframe=1;
- player[j].target=1;
- owner[i]=player[j].id;
- if(player[j].num_weapons>0){
- player[j].weaponids[player[j].num_weapons]=player[j].weaponids[0];
- }
- player[j].num_weapons++;
- player[j].weaponids[0]=i;
-
- player[j].aitype=attacktypecutoff;
- }
- else {
- if(j!=0)numthrowkill++;
- player[j].num_weapons++;
- player[j].weaponstuck=player[j].num_weapons-1;
- if(normaldotproduct(player[j].facing,velocity[i])>0)player[j].weaponstuckwhere=1;
- else player[j].weaponstuckwhere=0;
-
- player[j].weaponids[player[j].num_weapons-1]=i;
-
- player[j].RagDoll(0);
- player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].velocity+=velocity[i]*2;
- player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].velocity+=velocity[i]*2;
- player[j].skeleton.joints[player[j].skeleton.jointlabels[rightshoulder]].velocity+=velocity[i]*2;
- player[j].skeleton.joints[player[j].skeleton.jointlabels[leftshoulder]].velocity+=velocity[i]*2;
- //player[j].Puff(abdomen);
- if(bloodtoggle&&tutoriallevel!=1)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
- if(tutoriallevel==1)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .8, .3);
- footvel=tippoint[i]-position[i];
- Normalise(&footvel);
- if(bloodtoggle&&tutoriallevel!=1)Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*-1, 1,0,0, .6, 1);
-
- if(tutoriallevel!=1){
- if(player[j].weaponstuckwhere==0)player[j].DoBloodBig(2,205);
- if(player[j].weaponstuckwhere==1)player[j].DoBloodBig(2,200);
- player[j].damage+=200/player[j].armorhigh;
- player[j].deathbleeding=1;
- player[j].bloodloss+=(200+abs((float)(Random()%40))-20)/player[j].armorhigh;
- owner[i]=j;
- bloody[i]=2;
- blooddrip[i]=5;
- }
-
- float gLoc[3];
- float vel[3];
- gLoc[0]=position[i].x;
- gLoc[1]=position[i].y;
- gLoc[2]=position[i].z;
- vel[0]=0;
- vel[1]=0;
- vel[2]=0;
- PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true);
- OPENAL_3D_SetAttributes(channels[fleshstabsound], gLoc, vel);
- OPENAL_SetVolume(channels[fleshstabsound], 128);
- OPENAL_SetPaused(channels[fleshstabsound], false);
-
- if(animation[player[0].targetanimation].height==highheight){
- bonus=ninja;
- bonustime=0;
- bonusvalue=60;
- }
- else{
- bonus=Bullseyebonus;
- bonustime=0;
- bonusvalue=30;
- }
- }
+ }
+ }
+
+ if(velocity.x||velocity.y||velocity.z) {
+ for(int j=0;j<numplayers;j++) {
+ footvel=0;
+ footpoint=DoRotation((player[j].skeleton.joints[player[j].skeleton.jointlabels[abdomen]].position+player[j].skeleton.joints[player[j].skeleton.jointlabels[neck]].position)/2,0,player[j].rotation,0)*player[j].scale+player[j].coords;
+ if(owner==-1 && findDistancefastflat(&position,&player[j].coords)<1.5 &&
+ findDistancefast(&position,&player[j].coords)<4 && player[j].weaponstuck==-1 &&
+ !player[j].skeleton.free && j!=oldowner) {
+ if((player[j].aitype!=attacktypecutoff||abs(Random()%6)==0||(player[j].targetanimation!=backhandspringanim&&player[j].targetanimation!=rollanim&&player[j].targetanimation!=flipanim&&Random()%2==0))&&!missed) {
+ if( (player[j].creature==wolftype && Random()%3!=0 && player[j].weaponactive==-1 && (player[j].isIdle()||player[j].isRun()||player[j].targetanimation==walkanim))||
+ (player[j].creature==rabbittype && Random()%2==0 && player[j].aitype==attacktypecutoff && player[j].weaponactive==-1)) {
+ emit_sound_at(knifedrawsound, player[j].coords, 128.);
+
+ player[j].weaponactive=0;
+ player[j].targetanimation=removeknifeanim;
+ player[j].targetframe=1;
+ player[j].target=1;
+ owner=player[j].id;
+ if(player[j].num_weapons>0){
+ player[j].weaponids[player[j].num_weapons]=player[j].weaponids[0];