2 const vector KNIGHT_MIN = '-16 -16 -24';
3 const vector KNIGHT_MAX = '16 16 32';
6 string KNIGHT_MODEL = "models/monsters/knight.mdl";
10 float autocvar_g_monster_knight;
11 float autocvar_g_monster_knight_health;
12 float autocvar_g_monster_knight_melee_damage;
13 float autocvar_g_monster_knight_speed_walk;
14 float autocvar_g_monster_knight_speed_run;
17 const float knight_anim_stand = 0;
18 const float knight_anim_run = 1;
19 const float knight_anim_runattack = 2;
20 const float knight_anim_pain1 = 3;
21 const float knight_anim_pain2 = 4;
22 const float knight_anim_attack = 5;
23 const float knight_anim_walk = 6;
24 const float knight_anim_kneel = 7;
25 const float knight_anim_standing = 8;
26 const float knight_anim_death1 = 9;
27 const float knight_anim_death2 = 10;
31 self.think = knight_think;
32 self.nextthink = time + self.ticrate;
34 monster_move(autocvar_g_monster_knight_speed_run, autocvar_g_monster_knight_speed_walk, 50, knight_anim_run, knight_anim_walk, knight_anim_stand);
39 float len = vlen(self.velocity);
41 monsters_setframe((len < 50) ? knight_anim_attack : knight_anim_runattack);
43 self.attack_finished_single = time + 1.25;
45 monster_melee(self.enemy, autocvar_g_monster_knight_melee_damage, 0.3, DEATH_MONSTER_KNIGHT, FALSE);
50 Monster_CheckDropCvars ("knight");
52 self.think = monster_dead_think;
53 self.nextthink = time + self.ticrate;
54 self.ltime = time + 5;
55 monsters_setframe((random() > 0.5) ? knight_anim_death1 : knight_anim_death2);
57 monster_hook_death(); // for post-death mods
63 self.health = autocvar_g_monster_knight_health * self.scale;
65 self.damageforcescale = 0.003;
66 self.classname = "monster_knight";
67 self.checkattack = GenericCheckAttack;
68 self.attack_melee = knight_attack;
69 self.nextthink = time + random() * 0.5 + 0.1;
70 self.think = knight_think;
72 monsters_setframe(knight_anim_stand);
74 monster_setupsounds("knight");
76 monster_hook_spawn(); // for post-spawn mods
79 void spawnfunc_monster_knight ()
81 if not(autocvar_g_monster_knight) { remove(self); return; }
83 self.monster_spawnfunc = spawnfunc_monster_knight;
85 if(Monster_CheckAppearFlags(self))
90 if not (monster_initialize(
91 "Knight", MONSTER_KNIGHT,
92 KNIGHT_MIN, KNIGHT_MAX,
94 knight_die, knight_spawn))