bleeding=howmuch+(float)abs(Random()%100)/200-.25;
bleedxint=0;
bleedyint=0;
- int texdetailint=realtexdetail;
if(creature==rabbittype)
while(bloodText[bleedxint*512*3+bleedyint*3+0]>which+4||bloodText[bleedxint*512*3+bleedyint*3+0]<which-4||bleedxint<10||bleedyint<10||bleedxint>500||bleedyint>500){
bleedxint=abs(Random()%512);
}
bool Person::DoBloodBigWhere(float howmuch,int which, XYZ where){
- static int bleedxint,bleedyint,i,j;
+ static int i,j;
static XYZ bloodvel;
static XYZ startpoint,endpoint,colpoint,movepoint;
static float rotationpoint;
}
}
- static bool willwork;
if(targetanimation==crouchremoveknifeanim&&animation[targetanimation].label[currentframe]==5){
for(i=0;i<weapons.size();i++){
- bool willwork=1;
+ bool willwork=true;
if(weapons[i].owner!=-1)
if(player[weapons[i].owner].weaponstuck!=-1)
if(player[weapons[i].owner].weaponids[player[weapons[i].owner].weaponstuck]==i)
if((weapons[i].owner==-1)||(hasvictim&&weapons[i].owner==victim->id&&victim->skeleton.free))
if(willwork&&findDistancefastflat(&coords,&weapons[i].position)<3&&weaponactive==-1){
if(findDistancefast(&coords,&weapons[i].position)<1||hasvictim){
- bool fleshstuck=0;
+ bool fleshstuck=false;
if(weapons[i].owner!=-1)
if(victim->weaponstuck!=-1){
if(victim->weaponids[victim->weaponstuck]==i){
- fleshstuck=1;
+ fleshstuck=true;
}
}
- if(!fleshstuck){
+ if(fleshstuck){
+ emit_sound_at(fleshstabremovesound, coords, 128.);
+ } else {
if(weapons[i].getType()!=staff){
emit_sound_at(knifedrawsound, coords, 128.);
}
}
- if(fleshstuck){
- emit_sound_at(fleshstabremovesound, coords, 128.);
- }
weaponactive=0;
if(weapons[i].owner!=-1){
resume_stream(whooshsound);
}
if(targetanimation==sneakattackanim){
- float ycoords=oldcoords.y;
currentanimation=getCrouch();
targetanimation=getCrouch();
targetframe=1;
lastfeint=0;
}
if(targetanimation==knifesneakattackanim||targetanimation==swordsneakattackanim){
- float ycoords=oldcoords.y;
targetanimation=getIdle();
targetframe=0;
if(onterrain)coords.y=terrain.getHeight(coords.x,coords.z);
static int howmany;
static int bloodsize;
static int startx,starty,endx,endy;
- static int texdetailint;
static GLubyte color;
static XYZ bloodvel;
startx=0;
starty=0;
- texdetailint=realtexdetail;
startx=bleedy;//abs(Random()%(skeleton.skinsize-bloodsize-1));
starty=bleedx;//abs(Random()%(skeleton.skinsize-bloodsize-1));
endx=startx+bloodsize;
velocity=0;
}
- float gLoc[3];
- float vel[3];
- gLoc[0]=coords.x;
- gLoc[1]=coords.y;
- gLoc[2]=coords.z;
- vel[0]=velocity.x;
- vel[1]=velocity.y;
- vel[2]=velocity.z;
-
if(findLength(&average)<10&&dead&&skeleton.free){
skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier;
if(skeleton.longdead>2000){
if(terrainnormal.z<0)targetrotation=180-targetrotation;
rotation=targetrotation;
- /*if(onterrain){
- terrainnormal=terrain.getNormal(coords.x,coords.z);
- targettilt2=asin(terrainnormal.y)*180/3.14*-1;
- }
- else*/
-
- /*XYZ otherterrainnormal;
- otherterrainnormal=terrain.getNormal(coords.x,coords.y);
- otherterrainnormal.y=fast_sqrt(otherterrainnormal.x*otherterrainnormal.x+otherterrainnormal.z*otherterrainnormal.z)*-1;
- if(abs(terrainnormal.y)<abs(otherterrainnormal.y))terrainnormal.y=fast_sqrt(otherterrainnormal.x*otherterrainnormal.x+otherterrainnormal.z*otherterrainnormal.z)*-1;
- targettilt2=asin(otherterrainnormal.y)*180/3.14;
- */
-
targettilt2=asin(terrainnormal.y)*180/3.14*-1;
-
if(skeleton.forward.y<0){
targetanimation=getupfrombackanim;
targetframe=0;
}
if(skeleton.freefall==0)freefall=0;
- if(!isnormal(velocity.x)&&velocity.x){
- int xy=1;
- }
}
if(aitype!=passivetype||skeleton.free==1)
static float M[16];
static int i,j,k;
static int weaponattachmuscle;
- static int weaponrotatemuscle,weaponrotatemuscle2;
+ static int weaponrotatemuscle;
static XYZ weaponpoint;
static int start,endthing;
if((dead!=2||skeleton.free!=2)&&updatedelay<=0){
static float elasticity=.4;
static XYZ bounceness;
static float frictionness;
- static float moveamount;
- int closestline;
static float closestdistance;
static float distance;
static XYZ point[3];
static XYZ closestpoint;
static XYZ closestswordpoint;
static XYZ extramove;
- static float proportion;
static float tempmult;
if(owner!=-1){
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){
- 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)){
emit_sound_at(knifedrawsound, player[j].coords, 128.);
glPopMatrix();
position-=tippoint*.15;
XYZ temppoint1,temppoint2,tempforward;
- float distance;
rotation3=0;
smallrotation=90;
if(distance<closestdistance||closestdistance==-1){
closestpoint=colpoint;
closestdistance=distance;
- closestline=0;
}
if(DistancePointLine(&closestswordpoint, &point[1], &point[2], &distance,&colpoint ))
if(distance<closestdistance||closestdistance==-1){
closestpoint=colpoint;
closestdistance=distance;
- closestline=1;
}
if(DistancePointLine(&closestswordpoint, &point[2], &point[0], &distance,&colpoint ))
if(distance<closestdistance||closestdistance==-1){
closestpoint=colpoint;
closestdistance=distance;
- closestline=2;
}
if(closestdistance!=-1&&isnormal(closestdistance)){
if(DistancePointLine(&closestpoint, &position, &tippoint, &distance,&colpoint )){
}
void Weapon::Draw() {
- static int i,j;
+ static int j;
static XYZ terrainlight;
static GLfloat M[16];
static bool draw;