]> git.jsancho.org Git - lugaru.git/commitdiff
Simplify sleep animations
authorAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 00:38:30 +0000 (03:38 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 00:38:30 +0000 (03:38 +0300)
Source/Animation.def
Source/Person.cpp
Source/Person.h

index 160e1585decc1aafe7ebbdf2a38225369cfe739a..1beec103f324142f46216b5aecde25c48dab95f1 100644 (file)
@@ -45,7 +45,7 @@ DECLARE_ANIM(hanganim, "Hangon", lowheight, neutral, 0)
 DECLARE_ANIM(spinkickanim, "SpinKick", middleheight, normalattack, 0)
 DECLARE_ANIM(getupfromfrontanim, "GetUpFromFront", lowheight, neutral, 0)
 DECLARE_ANIM(getupfrombackanim, "GetUpFromBack", lowheight, neutral, 0)
-DECLARE_ANIM(crouchanim, "Crouch", 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)
@@ -115,7 +115,7 @@ DECLARE_ANIM(swordfightidlebothanim, "swordfightidleboth", middleheight, neutral
 DECLARE_ANIM(swordslashparryanim, "sworduprightparry", middleheight, normalattack, 0)
 DECLARE_ANIM(swordslashparriedanim, "swordslashparried", middleheight, normalattack, 0)
 DECLARE_ANIM(wolfidle, "Wolfidle", middleheight, neutral, ab_idle)
-DECLARE_ANIM(wolfcrouchanim, "Wolfcrouch", lowheight, neutral, 0)
+DECLARE_ANIM(wolfcrouchanim, "Wolfcrouch", lowheight, neutral, ab_crouch)
 DECLARE_ANIM(wolflandanim, "Wolflanding", lowheight, neutral, 0)
 DECLARE_ANIM(wolflandhardanim, "Wolflandhard", lowheight, neutral, 0)
 DECLARE_ANIM(wolfrunanim, "Wolfrun", middleheight, neutral, 0)
@@ -135,13 +135,13 @@ DECLARE_ANIM(staffhitreversalanim, "StaffHitCatch", middleheight, reversal, 0)
 DECLARE_ANIM(staffspinhitreversedanim, "SpinWhackCaught", middleheight, reversed, 0)
 DECLARE_ANIM(staffspinhitreversalanim, "SpinWhackCatch", middleheight, reversal, 0)
 DECLARE_ANIM(sitanim, "Sit", lowheight, neutral, ab_idle | ab_sit)
-DECLARE_ANIM(sleepanim, "Sleep", lowheight, neutral, ab_idle)
+DECLARE_ANIM(sleepanim, "Sleep", lowheight, neutral, ab_idle | ab_sleep)
 DECLARE_ANIM(talkidleanim, "TalkIdle", middleheight, neutral, ab_idle)
 DECLARE_ANIM(sitwallanim, "Dying", lowheight, neutral, ab_sit)
-DECLARE_ANIM(dead1anim, "Dead1", lowheight, neutral, 0)
-DECLARE_ANIM(dead2anim, "Dead2", lowheight, neutral, 0)
-DECLARE_ANIM(dead3anim, "Dead3", lowheight, neutral, 0)
-DECLARE_ANIM(dead4anim, "Dead4", lowheight, neutral, 0)
+DECLARE_ANIM(dead1anim, "Dead1", lowheight, neutral, ab_sleep)
+DECLARE_ANIM(dead2anim, "Dead2", lowheight, neutral, ab_sleep)
+DECLARE_ANIM(dead3anim, "Dead3", lowheight, neutral, ab_sleep)
+DECLARE_ANIM(dead4anim, "Dead4", lowheight, neutral, ab_sleep)
 
 DECLARE_ANIM(loadable_anim_end, "", 0, 0, 0)
 
index 59aff14683b26d6ab2d05a07094d2ce1cfa1468b..3f643607323b49c4f8a419b3bf85d678d384b04e 100644 (file)
@@ -174,15 +174,6 @@ void Person::CatchFire(){
        onfire=1;
 }
 
-bool Person::isSleeping(){
-       if(targetanimation==sleepanim)return 1;
-       if(targetanimation==dead1anim)return 1;
-       if(targetanimation==dead2anim)return 1;
-       if(targetanimation==dead3anim)return 1;
-       if(targetanimation==dead4anim)return 1;
-       else return 0;
-}
-
 int Person::getIdle(){
        if(indialogue!=-1&&howactive==typeactive&&creature==rabbittype)return talkidleanim;
        if(hasvictim&&victim!=this/*||(id==0&&attackkeydown)*/)if(/*(id==0&&attackkeydown)||*/(!victim->dead&&victim->aitype!=passivetype&&victim->aitype!=searchtype&&aitype!=passivetype&&aitype!=searchtype&&victim->id<numplayers)){
index e036f884925199ebb57583b0470c7fdced4a620a..1749a565791c561d4936c3940edb3d178feb62d8 100644 (file)
@@ -337,8 +337,11 @@ class Person
                {
                  return animation_bits[targetanimation] & ab_sit;
                }
-               bool isSleeping();
-               
+
+               bool isSleeping()
+               {
+                 return animation_bits[targetanimation] & ab_sleep;
+               }
                
                bool wasCrouch();
                bool isCrouch();