1 const vector STINGRAY_MIN = '-20 -20 -31';
2 const vector STINGRAY_MAX = '20 20 20';
4 string STINGRAY_MODEL = "models/monsters/fish.mdl";
7 float autocvar_g_monster_stingray;
8 float autocvar_g_monster_stingray_health;
9 float autocvar_g_monster_stingray_damage;
10 float autocvar_g_monster_stingray_speed_walk;
11 float autocvar_g_monster_stingray_speed_run;
13 const float stingray_anim_attack = 0;
14 const float stingray_anim_death = 1;
15 const float stingray_anim_swim = 2;
16 const float stingray_anim_pain = 3;
20 self.think = stingray_think;
21 self.nextthink = time + self.ticrate;
23 monster_move(autocvar_g_monster_stingray_speed_run, autocvar_g_monster_stingray_speed_walk, 10, stingray_anim_swim, stingray_anim_swim, stingray_anim_swim);
26 float stingray_attack(float attack_type)
30 case MONSTER_ATTACK_MELEE:
32 monsters_setframe(stingray_anim_attack);
33 self.attack_finished_single = time + 0.5;
34 monster_melee(self.enemy, autocvar_g_monster_stingray_damage, 0.1, DEATH_MONSTER_STINGRAY, FALSE);
38 case MONSTER_ATTACK_RANGED:
46 Monster_CheckDropCvars ("stingray");
48 self.think = monster_dead_think;
49 self.nextthink = time + self.ticrate;
50 self.ltime = time + 5;
51 monsters_setframe(stingray_anim_death);
53 monster_hook_death(); // for post-death mods
59 self.health = autocvar_g_monster_stingray_health;
61 self.damageforcescale = 0.5;
62 self.classname = "monster_stingray";
63 self.monster_attackfunc = stingray_attack;
64 self.flags |= FL_SWIM;
65 self.nextthink = time + random() * 0.5 + 0.1;
66 self.think = stingray_think;
68 monster_setupsounds("stingray");
70 monster_hook_spawn(); // for post-spawn mods
73 void spawnfunc_monster_stingray()
75 if not(autocvar_g_monster_stingray) { remove(self); return; }
77 self.monster_spawnfunc = spawnfunc_monster_stingray;
79 if(Monster_CheckAppearFlags(self))
84 if not (monster_initialize(
85 "Stingray", MONSTER_STINGRAY,
86 STINGRAY_MIN, STINGRAY_MAX,
88 stingray_die, stingray_spawn))