]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/stingray.qc
Begin working on a new mage attack
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / stingray.qc
index 41e866ca52016eefbda922cc12195104f53d1a1b..e6b47aa441f3592a2d87bfd8d414e4eef51bbb28 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_MONSTER(
 /* MON_##id   */ STINGRAY,
 /* function   */ m_stingray,
-/* spawnflags */ MONSTER_TYPE_SWIM | MONSTER_SIZE_BROKEN,
+/* spawnflags */ MONSTER_TYPE_SWIM | MONSTER_SIZE_BROKEN | MON_FLAG_MELEE | MON_FLAG_MUTATORBLOCKED,
 /* mins,maxs  */ '-20 -20 -31', '20 20 20',
 /* model      */ "fish.mdl",
 /* netname    */ "stingray",
@@ -33,13 +33,13 @@ float stingray_attack(float attack_type)
        {
                case MONSTER_ATTACK_MELEE:
                {
-                       monsters_setframe(stingray_anim_attack);
-                       self.attack_finished_single = time + MON_CVAR(stingray, attack_bite_delay);
-                       monster_melee(self.enemy, MON_CVAR(stingray, attack_bite_damage), self.attack_range, DEATH_MONSTER_STINGRAY, FALSE);
-                       
-                       return TRUE;
+                       return monster_melee(self.enemy, MON_CVAR(stingray, attack_bite_damage), stingray_anim_attack, self.attack_range, MON_CVAR(stingray, attack_bite_delay), DEATH_MONSTER_STINGRAY, FALSE);
                }
                case MONSTER_ATTACK_RANGED:
+               {
+                       // no ranged attack for stingray (yet?)
+                       return FALSE;
+               }
        }
        
        return FALSE;
@@ -68,7 +68,7 @@ float m_stingray(float req)
                }
                case MR_DEATH:
                {
-                       monsters_setframe(stingray_anim_death);
+                       self.frame = stingray_anim_death;
                        return TRUE;
                }
                case MR_SETUP:
@@ -77,13 +77,13 @@ float m_stingray(float req)
                        
                        self.monster_loot = spawnfunc_item_health_small;
                        self.monster_attackfunc = stingray_attack;
-                       monsters_setframe(stingray_anim_swim);
+                       self.frame = stingray_anim_swim;
                        
                        return TRUE;
                }
-               case MR_INIT:
+               case MR_PRECACHE:
                {
-                       // nothing
+                       precache_model ("models/monsters/fish.mdl");
                        return TRUE;
                }
                case MR_CONFIG:
@@ -102,12 +102,7 @@ float m_stingray(float req)
 {
        switch(req)
        {
-               case MR_DEATH:
-               {
-                       // nothing
-                       return TRUE;
-               }
-               case MR_INIT:
+               case MR_PRECACHE:
                {
                        precache_model ("models/monsters/fish.mdl");
                        return TRUE;