const float ogre_anim_swing = 4;
const float ogre_anim_die = 5;
-void chainsaw()
-{
- if (!self.enemy)
- return;
-
- if (vlen(self.enemy.origin - self.origin) > 100 * self.scale)
- return;
-
- 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));
-}
-
void ogre_think()
{
self.think = ogre_think;
self.delay = time + 0.2;
self.monster_delayedattack = ogre_swing;
- if(self.ogre_cycles <= 2)
- chainsaw();
- else if(self.ogre_cycles <= 4)
- chainsaw();
- else
- chainsaw();
+ monster_melee(self.enemy, autocvar_g_monster_ogre_chainsaw_damage, 0.3, DEATH_MONSTER_OGRE_CHAINSAW, TRUE);
if(self.ogre_cycles >= 4)
{
const float SPIDER_TYPE_FIRE = 1;
void spider_attack_standing()
-{
- float dot = 0, bigdmg = autocvar_g_monster_spider_attack_stand_damage * self.scale;
-
- self.velocity_x = 0;
- self.velocity_y = 0;
-
- makevectors (self.angles);
- dot = normalize (self.enemy.origin - self.origin) * v_forward;
- if(dot > 0.3)
- Damage(self.enemy, self, self, bigdmg * monster_skill, DEATH_MONSTER_SPIDER, self.origin, '0 0 0');
+{
+ monster_melee(self.enemy, autocvar_g_monster_spider_attack_stand_damage, 0.3, DEATH_MONSTER_SPIDER, TRUE);
monsters_setframe((random() > 0.5) ? spider_anim_attack : spider_anim_attack2);