2 const vector STINGRAY_MIN = '-20 -20 -31';
3 const vector STINGRAY_MAX = '20 20 20';
6 string STINGRAY_MODEL = "models/monsters/fish.mdl";
10 float autocvar_g_monster_stingray;
11 float autocvar_g_monster_stingray_health;
12 float autocvar_g_monster_stingray_damage;
13 float autocvar_g_monster_stingray_speed_walk;
14 float autocvar_g_monster_stingray_speed_run;
17 const float stingray_anim_attack = 0;
18 const float stingray_anim_death = 1;
19 const float stingray_anim_swim = 2;
20 const float stingray_anim_pain = 3;
22 void stingray_think ()
24 self.think = stingray_think;
25 self.nextthink = time + self.ticrate;
27 monster_move(autocvar_g_monster_stingray_speed_run, autocvar_g_monster_stingray_speed_walk, 10, stingray_anim_swim, stingray_anim_swim, stingray_anim_swim);
30 float stingray_attack(float attack_type)
34 case MONSTER_ATTACK_MELEE:
36 monsters_setframe(stingray_anim_attack);
37 self.attack_finished_single = time + 0.5;
38 monster_melee(self.enemy, autocvar_g_monster_stingray_damage, 0.1, DEATH_MONSTER_STINGRAY, FALSE);
42 case MONSTER_ATTACK_RANGED:
50 Monster_CheckDropCvars ("stingray");
52 self.think = monster_dead_think;
53 self.nextthink = time + self.ticrate;
54 self.ltime = time + 5;
55 monsters_setframe(stingray_anim_death);
57 monster_hook_death(); // for post-death mods
60 void stingray_spawn ()
63 self.health = autocvar_g_monster_stingray_health;
65 self.damageforcescale = 0.5;
66 self.classname = "monster_stingray";
67 self.monster_attackfunc = stingray_attack;
68 self.flags |= FL_SWIM;
69 self.nextthink = time + random() * 0.5 + 0.1;
70 self.think = stingray_think;
72 monster_setupsounds("stingray");
74 monster_hook_spawn(); // for post-spawn mods
77 void spawnfunc_monster_stingray ()
79 if not(autocvar_g_monster_stingray) { remove(self); return; }
81 self.monster_spawnfunc = spawnfunc_monster_stingray;
83 if(Monster_CheckAppearFlags(self))
88 if not (monster_initialize(
89 "Stingray", MONSTER_STINGRAY,
90 STINGRAY_MIN, STINGRAY_MAX,
92 stingray_die, stingray_spawn))