]> 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 6335536c67bb49faf0e02f4aeccf6fd67e8c7bd7..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,10 +33,7 @@ float stingray_attack(float attack_type)
        {
                case MONSTER_ATTACK_MELEE:
                {
-                       if(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))
-                               return TRUE;
-                               
-                       return FALSE;
+                       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:
                {
@@ -71,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:
@@ -80,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:
@@ -105,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;