1 #ifdef REGISTER_MONSTER
3 /* MON_##id */ STINGRAY,
4 /* function */ m_stingray,
5 /* spawnflags */ MONSTER_TYPE_SWIM | MONSTER_SIZE_BROKEN,
6 /* mins,maxs */ '-20 -20 -31', '20 20 20',
7 /* model */ "fish.mdl",
8 /* netname */ "stingray",
9 /* fullname */ _("Stingray")
14 float autocvar_g_monster_stingray;
15 float autocvar_g_monster_stingray_health;
16 float autocvar_g_monster_stingray_damage;
17 float autocvar_g_monster_stingray_speed_walk;
18 float autocvar_g_monster_stingray_speed_run;
20 const float stingray_anim_attack = 0;
21 const float stingray_anim_death = 1;
22 const float stingray_anim_swim = 2;
23 const float stingray_anim_pain = 3;
25 float stingray_attack(float attack_type)
29 case MONSTER_ATTACK_MELEE:
31 monsters_setframe(stingray_anim_attack);
32 self.attack_finished_single = time + 0.5;
33 monster_melee(self.enemy, autocvar_g_monster_stingray_damage, 0.1, DEATH_MONSTER_STINGRAY, FALSE);
37 case MONSTER_ATTACK_RANGED:
43 void spawnfunc_monster_stingray()
45 if not(autocvar_g_monster_stingray) { remove(self); return; }
47 self.classname = "monster_stingray";
49 self.monster_spawnfunc = spawnfunc_monster_stingray;
51 if(Monster_CheckAppearFlags(self))
54 if not(monster_initialize(MON_STINGRAY, TRUE)) { remove(self); return; }
57 float m_stingray(float req)
63 monster_move(autocvar_g_monster_stingray_speed_run, autocvar_g_monster_stingray_speed_walk, 10, stingray_anim_swim, stingray_anim_swim, stingray_anim_swim);
68 monsters_setframe(stingray_anim_swim);
73 if not(self.health) self.health = autocvar_g_monster_stingray_health;
75 self.monster_attackfunc = stingray_attack;
76 monsters_setframe(stingray_anim_death);
92 float m_stingray(float req)
103 precache_model ("models/monsters/fish.mdl");
112 #endif // REGISTER_MONSTER