]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/rottweiler.qc
Possibly unstable, but worth it (move monster animation handling to setanim, rather...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / rottweiler.qc
index c38cb06100706ceb130647aee7509d1632da74e5..4149357de0a34b73a2bd89b559c33244c0c4c3b9 100644 (file)
@@ -19,6 +19,7 @@ float autocvar_g_monster_rottweiler_speed_stop;
 float autocvar_g_monster_rottweiler_speed_run;
 float autocvar_g_monster_rottweiler_speed_walk;
 
+/*
 const float rottweiler_anim_attack1            = 0;
 const float rottweiler_anim_death1             = 1;
 const float rottweiler_anim_death2             = 2;
@@ -28,6 +29,7 @@ const float rottweiler_anim_run                       = 5;
 const float rottweiler_anim_leap               = 6;
 const float rottweiler_anim_idle               = 7;
 const float rottweiler_anim_walk               = 8;
+*/
 
 float M_Rottweiler_Attack(float attack_type)
 {
@@ -35,7 +37,7 @@ float M_Rottweiler_Attack(float attack_type)
        {
                case MONSTER_ATTACK_MELEE:
                {
-                       return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_rottweiler_attack_melee_damage), ((random() >= 0.5) ? rottweiler_anim_attack1 : rottweiler_anim_attack2), self.attack_range, (autocvar_g_monster_rottweiler_attack_melee_delay), DEATH_MONSTER_ROTTWEILER, true);
+                       return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_rottweiler_attack_melee_damage), ((random() >= 0.5) ? self.anim_melee1 : self.anim_melee2), self.attack_range, (autocvar_g_monster_rottweiler_attack_melee_delay), DEATH_MONSTER_ROTTWEILER, true);
                }
                case MONSTER_ATTACK_RANGED:
                {
@@ -62,13 +64,28 @@ float M_Rottweiler(float req)
                        if(random() <= 0.3)
                        {
                                self.pain_finished = time + 1.5;
-                               self.frame = rottweiler_anim_pain;
+                               setanim(self, self.anim_pain1, true, true, false);
                        }
                        return true;
                }
                case MR_DEATH:
                {
-                       self.frame = (random() >= 0.5) ? rottweiler_anim_death1 : rottweiler_anim_death2;
+                       setanim(self, ((random() > 0.5) ? self.anim_die1 : self.anim_die2), false, true, true);
+                       return true;
+               }
+               case MR_ANIM:
+               {
+                       vector none = '0 0 0';
+                       self.anim_die1 = animfixfps(self, '5 1 0.5', none); // 2 seconds
+                       self.anim_die2 = animfixfps(self, '1 1 0.5', none); // 2 seconds
+                       self.anim_walk = animfixfps(self, '2 1 1', none);
+                       self.anim_idle = animfixfps(self, '7 1 1', none);
+                       self.anim_pain1 = animfixfps(self, '4 1 2', none); // 0.5 seconds
+                       self.anim_melee1 = animfixfps(self, '0 1 5', none); // analyze models and set framerate
+                       self.anim_melee2 = animfixfps(self, '3 1 5', none); // analyze models and set framerate
+                       self.anim_shoot = animfixfps(self, '6 1 5', none); // analyze models and set framerate
+                       self.anim_run = animfixfps(self, '5 1 1', none);
+
                        return true;
                }
                case MR_SETUP:
@@ -79,12 +96,7 @@ float M_Rottweiler(float req)
                        if(!self.stopspeed) { self.stopspeed = (autocvar_g_monster_rottweiler_speed_stop); }
                        if(!self.damageforcescale) { self.damageforcescale = (autocvar_g_monster_rottweiler_damageforcescale); }
 
-                       self.m_anim_walk = rottweiler_anim_walk;
-                       self.m_anim_run = rottweiler_anim_run;
-                       self.m_anim_idle = rottweiler_anim_idle;
-
                        self.monster_loot = spawnfunc_item_health_small;
-                       self.frame = rottweiler_anim_idle;
 
                        return true;
                }