X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FWeapons.cpp;h=7fc99048d13270ec43cf001d94e81d1287fe403c;hb=4e3b68a29afbbd5d0b02dc29810cc89dd2b0d092;hp=a7d587fca88a1d2958683a620563d373cd89f4ff;hpb=35b5d8a643d2ff04614a8b9f57026b57d4a82667;p=lugaru.git diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index a7d587f..7fc9904 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -215,17 +215,17 @@ void Weapon::DoStuff(int i) { for(int j=0;j0){ @@ -276,7 +276,7 @@ void Weapon::DoStuff(int i) { emit_sound_at(fleshstabsound, position, 128.); - if(animation[player[0].targetanimation].height==highheight) + if(animation[player[0].animTarget].height==highheight) award_bonus(0, ninja); else award_bonus(0, Bullseyebonus); @@ -331,15 +331,15 @@ void Weapon::DoStuff(int i) { XYZ terrainlight; terrainlight=terrain.getLighting(position.x,position.z); if(environment==snowyenvironment){ - if(findDistancefast(&position,&viewer)80) { + if(Random()%50==0&&distsq(&position,&viewer)>80) { XYZ shinepoint; shinepoint=position+(tippoint-position)*(((float)abs(Random()%100))/100); Sprite::MakeSprite(weaponshinesprite, shinepoint,normalrot, 1,1,1, (.1+(float)abs(Random()%100)/200-.25)*1/3*fast_sqrt(findDistance(&shinepoint,&viewer)), 1); @@ -898,7 +898,7 @@ void Weapon::Draw() { static GLfloat M[16]; if((frustum.SphereInFrustum(position.x,position.y,position.z,1)&& - findDistancefast(&viewer,&position)1)|| - (player[owner].currentanimation==staffhitreversedanim && player[owner].currentframe>1)|| - (player[owner].currentanimation==staffspinhitanim && player[owner].currentframe>1)|| - (player[owner].currentanimation==staffspinhitreversedanim && player[owner].currentframe>1)|| - (player[owner].currentanimation==staffgroundsmashanim && player[owner].currentframe>1)|| - (player[owner].targetanimation==swordslashanim && player[owner].targetframe<7)|| - player[owner].targetanimation==crouchstabanim|| - player[owner].targetanimation==swordslashreversalanim|| - player[owner].targetanimation==swordslashreversedanim|| - player[owner].targetanimation==knifefollowanim|| - player[owner].targetanimation==swordgroundstabanim|| - player[owner].targetanimation==knifethrowanim)&& - player[owner].targetanimation==lastdrawnanim&& + (player[owner].animTarget==knifeslashstartanim|| + player[owner].animTarget==swordsneakattackanim|| + (player[owner].animCurrent==staffhitanim && player[owner].frameCurrent>1)|| + (player[owner].animCurrent==staffhitreversedanim && player[owner].frameCurrent>1)|| + (player[owner].animCurrent==staffspinhitanim && player[owner].frameCurrent>1)|| + (player[owner].animCurrent==staffspinhitreversedanim && player[owner].frameCurrent>1)|| + (player[owner].animCurrent==staffgroundsmashanim && player[owner].frameCurrent>1)|| + (player[owner].animTarget==swordslashanim && player[owner].frameTarget<7)|| + player[owner].animTarget==crouchstabanim|| + player[owner].animTarget==swordslashreversalanim|| + player[owner].animTarget==swordslashreversedanim|| + player[owner].animTarget==knifefollowanim|| + player[owner].animTarget==swordgroundstabanim|| + player[owner].animTarget==knifethrowanim)&& + player[owner].animTarget==lastdrawnanim&& !player[owner].skeleton.free ) { @@ -935,7 +935,7 @@ void Weapon::Draw() { } else { drawhowmany=1; } - if(player[owner].targetanimation==swordgroundstabanim) + if(player[owner].animTarget==swordgroundstabanim) { lastdrawnrotation1=rotation1; lastdrawnrotation2=rotation2; @@ -974,11 +974,11 @@ void Weapon::Draw() { if(owner!=-1) { - if(player[owner].targetanimation==staffhitanim||player[owner].currentanimation==staffhitanim||player[owner].targetanimation==staffhitreversedanim||player[owner].currentanimation==staffhitreversedanim) + if(player[owner].animTarget==staffhitanim||player[owner].animCurrent==staffhitanim||player[owner].animTarget==staffhitreversedanim||player[owner].animCurrent==staffhitreversedanim) { glTranslatef(0,0,-.3); } - if(player[owner].targetanimation==staffgroundsmashanim||player[owner].currentanimation==staffgroundsmashanim||player[owner].targetanimation==staffspinhitreversedanim||player[owner].currentanimation==staffspinhitreversedanim||player[owner].targetanimation==staffspinhitanim||player[owner].currentanimation==staffspinhitanim) + if(player[owner].animTarget==staffgroundsmashanim||player[owner].animCurrent==staffgroundsmashanim||player[owner].animTarget==staffspinhitreversedanim||player[owner].animCurrent==staffspinhitreversedanim||player[owner].animTarget==staffspinhitanim||player[owner].animCurrent==staffspinhitanim) { glTranslatef(0,0,-.1); } @@ -1026,7 +1026,7 @@ void Weapon::Draw() { lastdrawnbigtilt2=bigtilt2; lastdrawnsmallrotation=smallrotation; lastdrawnsmallrotation2=smallrotation2; - if(owner!=-1)lastdrawnanim=player[owner].currentanimation; + if(owner!=-1)lastdrawnanim=player[owner].animCurrent; } if(owner!=-1) {