3 const vector OGRE_MIN = '-36 -36 -20';
4 const vector OGRE_MAX = '36 36 50';
7 string OGRE_MODEL = "models/monsters/ogre.dpm";
13 float autocvar_g_monster_ogre;
14 float autocvar_g_monster_ogre_health;
15 float autocvar_g_monster_ogre_chainsaw_damage;
16 float autocvar_g_monster_ogre_speed_walk;
17 float autocvar_g_monster_ogre_speed_run;
18 float autocvar_g_monster_ogre_attack_uzi_bullets;
19 float autocvar_g_monster_ogre_attack_uzi_damage;
20 float autocvar_g_monster_ogre_attack_uzi_force;
21 float autocvar_g_monster_ogre_attack_uzi_chance;
24 const float ogre_anim_idle = 0;
25 const float ogre_anim_walk = 1;
26 const float ogre_anim_run = 2;
27 const float ogre_anim_pain = 3;
28 const float ogre_anim_swing = 4;
29 const float ogre_anim_die = 5;
31 void chainsaw (float side)
36 if (vlen(self.enemy.origin - self.origin) > 100 * self.scale)
39 Damage(self.enemy, self, self, autocvar_g_monster_ogre_chainsaw_damage * monster_skill, DEATH_MONSTER_OGRE_CHAINSAW, self.enemy.origin, normalize(self.enemy.origin - self.origin));
44 self.think = ogre_think;
45 self.nextthink = time + self.ticrate;
48 self.nextthink = self.delay;
50 monster_move(autocvar_g_monster_ogre_speed_run, autocvar_g_monster_ogre_speed_walk, 300, ogre_anim_run, ogre_anim_walk, ogre_anim_idle);
56 self.ogre_cycles += 1;
57 monsters_setframe(ogre_anim_swing);
58 if(self.ogre_cycles == 1)
59 self.attack_finished_single = time + 1.3;
60 self.angles_y = self.angles_y + random()* 25;
61 self.nextthink = time + 0.2;
62 self.think = ogre_swing;
64 if(self.ogre_cycles <= 2)
66 else if(self.ogre_cycles <= 4)
71 if(self.ogre_cycles >= 4)
72 self.think = ogre_think;
77 self.ogre_cycles += 1;
79 if(self.ogre_cycles > autocvar_g_monster_ogre_attack_uzi_bullets)
81 self.monster_delayedattack = func_null;
86 W_SetupShot (self, autocvar_g_antilag_bullets && 18000 >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_monster_ogre_attack_uzi_damage);
87 fireBallisticBullet(w_shotorg, w_shotdir, 0.02, 18000, 5, autocvar_g_monster_ogre_attack_uzi_damage, autocvar_g_monster_ogre_attack_uzi_force, DEATH_MONSTER_OGRE_UZI, 0, 1, 115);
88 endFireBallisticBullet();
90 self.delay = time + 0.1;
91 self.monster_delayedattack = ogre_uzi_fire;
96 monsters_setframe(ogre_anim_pain);
97 self.attack_finished_single = time + 0.8;
98 self.delay = time + 0.1;
99 self.monster_delayedattack = ogre_uzi_fire;
105 monsters_setframe(ogre_anim_pain);
106 self.attack_finished_single = time + 0.8;
109 float ogre_missile ()
111 self.ogre_cycles = 0;
112 if (random() <= autocvar_g_monster_ogre_attack_uzi_chance)
126 self.ogre_cycles = 0;
132 Monster_CheckDropCvars ("ogre");
134 self.think = Monster_Fade;
135 self.nextthink = time + 5;
136 monsters_setframe(ogre_anim_die);
138 monster_hook_death(); // for post-death mods
144 self.health = autocvar_g_monster_ogre_health * self.scale;
146 self.damageforcescale = 0.003;
147 self.classname = "monster_ogre";
148 self.checkattack = GenericCheckAttack;
149 self.attack_melee = ogre_melee;
150 self.attack_ranged = ogre_missile;
151 self.nextthink = time + 0.1;
152 self.think = ogre_think;
153 self.sprite_height = 65;
154 self.weapon = WEP_GRENADE_LAUNCHER;
156 monsters_setframe(ogre_anim_idle);
158 monster_setupsounds("ogre");
160 monster_hook_spawn(); // for post-spawn mods
163 void spawnfunc_monster_ogre ()
165 if not(autocvar_g_monster_ogre) { remove(self); return; }
167 self.monster_spawnfunc = spawnfunc_monster_ogre;
169 if(Monster_CheckAppearFlags(self))
172 if not (monster_initialize(
173 "Ogre", MONSTER_OGRE,
176 ogre_die, ogre_spawn))
182 weapon_action(WEP_GRENADE_LAUNCHER, WR_PRECACHE);