3 const vector KNIGHT_MIN = '-16 -16 -24';
4 const vector KNIGHT_MAX = '16 16 32';
7 string KNIGHT_MODEL = "models/monsters/knight.mdl";
13 float autocvar_g_monster_knight;
14 float autocvar_g_monster_knight_health;
15 float autocvar_g_monster_knight_melee_damage;
16 float autocvar_g_monster_knight_speed_walk;
17 float autocvar_g_monster_knight_speed_run;
20 const float knight_anim_stand = 0;
21 const float knight_anim_run = 1;
22 const float knight_anim_runattack = 2;
23 const float knight_anim_pain1 = 3;
24 const float knight_anim_pain2 = 4;
25 const float knight_anim_attack = 5;
26 const float knight_anim_walk = 6;
27 const float knight_anim_kneel = 7;
28 const float knight_anim_standing = 8;
29 const float knight_anim_death1 = 9;
30 const float knight_anim_death2 = 10;
34 self.think = knight_think;
35 self.nextthink = time + self.ticrate;
37 monster_move(autocvar_g_monster_knight_speed_run, autocvar_g_monster_knight_speed_walk, 50, knight_anim_run, knight_anim_walk, knight_anim_stand);
42 float len = vlen(self.velocity);
44 monsters_setframe((len < 50) ? knight_anim_attack : knight_anim_runattack);
46 self.attack_finished_single = time + 1.25;
48 monster_melee(self.enemy, autocvar_g_monster_knight_melee_damage, 0.3, DEATH_MONSTER_KNIGHT, FALSE);
53 Monster_CheckDropCvars ("knight");
55 self.think = monster_dead_think;
56 self.nextthink = time + self.ticrate;
57 self.ltime = time + 5;
58 monsters_setframe((random() > 0.5) ? knight_anim_death1 : knight_anim_death2);
60 monster_hook_death(); // for post-death mods
66 self.health = autocvar_g_monster_knight_health * self.scale;
68 self.damageforcescale = 0.003;
69 self.classname = "monster_knight";
70 self.checkattack = GenericCheckAttack;
71 self.attack_melee = knight_attack;
72 self.nextthink = time + random() * 0.5 + 0.1;
73 self.think = knight_think;
75 monsters_setframe(knight_anim_stand);
77 monster_setupsounds("knight");
79 monster_hook_spawn(); // for post-spawn mods
82 void spawnfunc_monster_knight ()
84 if not(autocvar_g_monster_knight) { remove(self); return; }
86 self.monster_spawnfunc = spawnfunc_monster_knight;
88 if(Monster_CheckAppearFlags(self))
93 if not (monster_initialize(
94 "Knight", MONSTER_KNIGHT,
95 KNIGHT_MIN, KNIGHT_MAX,
97 knight_die, knight_spawn))