From: Alexander Monakov Date: Fri, 31 Dec 2010 01:16:27 +0000 (+0300) Subject: Simplify landhard and flip animations X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=6f3fa5a970fa12cf6529c56a1f859b2668a8a232;p=lugaru.git Simplify landhard and flip animations --- diff --git a/Source/Animation.def b/Source/Animation.def index 878c832..6cae283 100644 --- a/Source/Animation.def +++ b/Source/Animation.def @@ -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) diff --git a/Source/Person.cpp b/Source/Person.cpp index 996faea..107edb4 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -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; diff --git a/Source/Person.h b/Source/Person.h index 56d4f54..a4eeae9 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -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();