]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/rotfish.qc
Possibly unstable, but worth it (move monster animation handling to setanim, rather...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / rotfish.qc
index 91351e589917cfda4843edb7679e80ab54574ddd..fc8d3022c85bdf735c9176935f4774e502e40fcd 100644 (file)
@@ -20,10 +20,12 @@ float autocvar_g_monster_rotfish_speed_stop;
 float autocvar_g_monster_rotfish_speed_run;
 float autocvar_g_monster_rotfish_speed_walk;
 
+/*
 const float rotfish_anim_attack = 0;
 const float rotfish_anim_death  = 1;
 const float rotfish_anim_swim   = 2;
 const float rotfish_anim_pain   = 3;
+*/
 
 
 float M_Rotfish_Attack(float attack_type)
@@ -32,7 +34,7 @@ float M_Rotfish_Attack(float attack_type)
        {
                case MONSTER_ATTACK_MELEE:
                {
-                       return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_rotfish_attack_melee_damage), rotfish_anim_attack, self.attack_range, (autocvar_g_monster_rotfish_attack_melee_delay), DEATH_MONSTER_ROTFISH_MELEE, true);
+                       return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_rotfish_attack_melee_damage), self.anim_melee, self.attack_range, (autocvar_g_monster_rotfish_attack_melee_delay), DEATH_MONSTER_ROTFISH_MELEE, true);
                }
                case MONSTER_ATTACK_RANGED:
                {
@@ -58,12 +60,24 @@ float M_Rotfish(float req)
                case MR_PAIN:
                {
                        self.pain_finished = 0.8;
-                       self.frame = rotfish_anim_pain;
+                       setanim(self, self.anim_pain1, true, true, false);
                        return true;
                }
                case MR_DEATH:
                {
-                       self.frame = rotfish_anim_death;
+                       setanim(self, self.anim_die1, false, true, true);
+                       return true;
+               }
+               case MR_ANIM:
+               {
+                       vector none = '0 0 0';
+                       self.anim_die1 = animfixfps(self, '1 1 0.5', none); // 2 seconds
+                       self.anim_walk = animfixfps(self, '2 1 1', none);
+                       self.anim_idle = animfixfps(self, '2 1 1', none);
+                       self.anim_pain1 = animfixfps(self, '3 1 2', none); // 0.5 seconds
+                       self.anim_melee = animfixfps(self, '0 1 5', none); // analyze models and set framerate
+                       self.anim_run = animfixfps(self, '2 1 1', none);
+
                        return true;
                }
                case MR_SETUP:
@@ -75,12 +89,7 @@ float M_Rotfish(float req)
                        if(!self.attack_range) { self.attack_range = autocvar_g_monster_rotfish_attack_range; }
                        if(!self.damageforcescale) { self.damageforcescale = (autocvar_g_monster_rotfish_damageforcescale); }
 
-                       self.m_anim_walk = rotfish_anim_swim;
-                       self.m_anim_run = rotfish_anim_swim;
-                       self.m_anim_idle = rotfish_anim_swim;
-
                        self.monster_loot = spawnfunc_item_armor_small;
-                       self.frame = rotfish_anim_swim;
 
                        return true;
                }