]> git.jsancho.org Git - lugaru.git/commitdiff
Simplify landhard and flip animations
authorAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 01:16:27 +0000 (04:16 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 01:16:27 +0000 (04:16 +0300)
Source/Animation.def
Source/Person.cpp
Source/Person.h

index 878c8325bc27dbc7dea8dcca631aefebafad5279..6cae283d12c0ff5b703f92f192881a15aaccd602 100644 (file)
@@ -39,7 +39,7 @@ DECLARE_ANIM(stopanim, "Stop", middleheight, neutral, ab_stop)
 DECLARE_ANIM(jumpupanim, "JumpUp", highheight, neutral, 0)
 DECLARE_ANIM(jumpdownanim, "JumpDown", highheight, neutral, 0)
 DECLARE_ANIM(landanim, "Landing", lowheight, neutral, ab_land)
-DECLARE_ANIM(landhardanim, "Landhard", lowheight, neutral, 0)
+DECLARE_ANIM(landhardanim, "Landhard", lowheight, neutral, ab_landhard)
 DECLARE_ANIM(climbanim, "Climb", lowheight, neutral, 0)
 DECLARE_ANIM(hanganim, "Hangon", lowheight, neutral, 0)
 DECLARE_ANIM(spinkickanim, "SpinKick", middleheight, normalattack, 0)
@@ -48,8 +48,8 @@ DECLARE_ANIM(getupfrombackanim, "GetUpFromBack", lowheight, neutral, 0)
 DECLARE_ANIM(crouchanim, "Crouch", lowheight, neutral, ab_crouch)
 DECLARE_ANIM(sneakanim, "Sneak", lowheight, neutral, 0)
 DECLARE_ANIM(rollanim, "Roll", lowheight, neutral, 0)
-DECLARE_ANIM(flipanim, "Flip", highheight, neutral, 0)
-DECLARE_ANIM(frontflipanim, "Flip", highheight, neutral, 0)
+DECLARE_ANIM(flipanim, "Flip", highheight, neutral, ab_flip)
+DECLARE_ANIM(frontflipanim, "Flip", highheight, neutral, ab_flip)
 DECLARE_ANIM(spinkickreversedanim, "SpinKickCaught", middleheight, reversed, 0)
 DECLARE_ANIM(spinkickreversalanim, "SpinKickCatch", middleheight, reversal, 0)
 DECLARE_ANIM(lowkickanim, "lowkick", middleheight, normalattack, 0)
@@ -88,15 +88,15 @@ DECLARE_ANIM(winduppunchanim, "Winduppunch", middleheight, normalattack, 0)
 DECLARE_ANIM(winduppunchblockedanim, "Winduppunchblocked", middleheight, normalattack, 0)
 DECLARE_ANIM(blockhighleftanim, "Blockhighleft", middleheight, normalattack, 0)
 DECLARE_ANIM(blockhighleftstrikeanim, "Blockhighleftstrike", middleheight, normalattack, 0)
-DECLARE_ANIM(backflipanim, "Backflip", highheight, neutral, 0)
+DECLARE_ANIM(backflipanim, "Backflip", highheight, neutral, ab_flip)
 DECLARE_ANIM(walljumpbackanim, "Walljumpback", highheight, neutral, 0)
 DECLARE_ANIM(walljumpfrontanim, "Walljumpfront", highheight, neutral, 0)
-DECLARE_ANIM(rightflipanim, "Rightflip", highheight, neutral, 0)
+DECLARE_ANIM(rightflipanim, "Rightflip", highheight, neutral, ab_flip)
 DECLARE_ANIM(walljumprightanim, "Walljumpright", highheight, neutral, 0)
-DECLARE_ANIM(leftflipanim, "Leftflip", highheight, neutral, 0)
+DECLARE_ANIM(leftflipanim, "Leftflip", highheight, neutral, ab_flip)
 DECLARE_ANIM(walljumpleftanim, "Walljumpleft", highheight, neutral, 0)
-DECLARE_ANIM(walljumprightkickanim, "Walljumprightkick", highheight, neutral, 0)
-DECLARE_ANIM(walljumpleftkickanim, "Walljumpleftkick", highheight, neutral, 0)
+DECLARE_ANIM(walljumprightkickanim, "Walljumprightkick", highheight, neutral, ab_flip)
+DECLARE_ANIM(walljumpleftkickanim, "Walljumpleftkick", highheight, neutral, ab_flip)
 DECLARE_ANIM(knifefightidleanim, "Knifefightidle", middleheight, neutral, ab_idle)
 DECLARE_ANIM(knifesneakattackanim, "Knifesneakattack", middleheight, reversal, 0)
 DECLARE_ANIM(knifesneakattackedanim, "Knifesneakattacked", middleheight, reversed, 0)
@@ -117,7 +117,7 @@ DECLARE_ANIM(swordslashparriedanim, "swordslashparried", middleheight, normalatt
 DECLARE_ANIM(wolfidle, "Wolfidle", middleheight, neutral, ab_idle)
 DECLARE_ANIM(wolfcrouchanim, "Wolfcrouch", lowheight, neutral, ab_crouch)
 DECLARE_ANIM(wolflandanim, "Wolflanding", lowheight, neutral, ab_land)
-DECLARE_ANIM(wolflandhardanim, "Wolflandhard", lowheight, neutral, 0)
+DECLARE_ANIM(wolflandhardanim, "Wolflandhard", lowheight, neutral, ab_landhard)
 DECLARE_ANIM(wolfrunanim, "Wolfrun", middleheight, neutral, ab_run)
 DECLARE_ANIM(wolfrunninganim, "Wolfrunning", middleheight, neutral, ab_run)
 DECLARE_ANIM(rabbitrunninganim, "Rabbitrunning", middleheight, neutral, ab_run)
index 996faea77c9ae0db7336c3e7c2f16e1a1db05453..107edb4f436f80b8882a6943aa9bbc40017c105a 100644 (file)
@@ -229,17 +229,6 @@ int Person::getLanding(){
        return 0;
 }
 
-
-bool Person::isLandhard(){
-       if(targetanimation==landhardanim||targetanimation==wolflandhardanim)return 1;
-       else return 0;
-}
-
-
-bool Person::wasLandhard(){
-       if(currentanimation==landhardanim||currentanimation==wolflandhardanim)return 1;
-       else return 0;
-}
 int Person::getLandhard(){
        if(creature==rabbittype)return landhardanim;
        if(creature==wolftype)return wolflandhardanim;
@@ -247,16 +236,6 @@ int Person::getLandhard(){
 }
 
 
-bool Person::isFlip(){
-       if(targetanimation==flipanim||targetanimation==frontflipanim||targetanimation==backflipanim||targetanimation==rightflipanim||targetanimation==leftflipanim||targetanimation==walljumprightkickanim||targetanimation==walljumpleftkickanim)return 1;
-       else return 0;
-}
-
-bool Person::wasFlip(){
-       if(currentanimation==flipanim||currentanimation==frontflipanim||currentanimation==backflipanim||currentanimation==rightflipanim||currentanimation==leftflipanim||currentanimation==walljumprightkickanim||currentanimation==walljumpleftkickanim)return 1;
-       else return 0;
-}
-
 bool Person::isWallJump(){
        if(targetanimation==walljumpfrontanim||targetanimation==walljumpbackanim||targetanimation==walljumpleftanim||targetanimation==walljumprightanim)return 1;
        else return 0;
index 56d4f5490b87fe0562558594702b723037d25f97..a4eeae9bc457c6119ad6c47e645cc12bbd2c5217 100644 (file)
@@ -386,14 +386,26 @@ class Person
                  return animation_bits[targetanimation] & ab_land;
                }
                int getLanding();
-               
-               bool wasLandhard();
-               bool isLandhard();
+
+               bool wasLandhard()
+               {
+                 return animation_bits[currentanimation] & ab_landhard;
+               }
+               bool isLandhard()
+               {
+                 return animation_bits[targetanimation] & ab_landhard;
+               }
                int getLandhard();
-               
-               bool isFlip();
-               bool wasFlip();
-               
+
+               bool wasFlip()
+               {
+                 return animation_bits[currentanimation] & ab_flip;
+               }
+               bool isFlip()
+               {
+                 return animation_bits[targetanimation] & ab_flip;;
+               }
+
                bool jumpclimb;
                
                bool isWallJump();