]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix ogre using weapons code for uzi attack
authorMario <mario.mario@y7mail.com>
Sun, 14 Apr 2013 01:18:06 +0000 (11:18 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 14 Apr 2013 01:18:06 +0000 (11:18 +1000)
monsters.cfg
qcsrc/server/monsters/lib/monsters.qc
qcsrc/server/monsters/monster/ogre.qc

index 1e97c0aae7e3a209e89b726c7a834e1d90e0644e..793f3e1197f0a28f565892383a1fe3611650dd16 100644 (file)
@@ -45,6 +45,9 @@ set g_monster_ogre_drop_size bullets "Size of the item Ogres drop. Possible valu
 set g_monster_ogre_speed_walk 100 "Ogre walk speed"
 set g_monster_ogre_speed_run 150 "Ogre run speed"
 set g_monster_ogre_attack_uzi_bullets 3 "Number of machine gun bullets Ogre fires"
+set g_monster_ogre_attack_uzi_chance 0.3 "Chance for Ogre to fire machine gun"
+set g_monster_ogre_attack_uzi_damage 10 "Ogre machine gun damage per bullet"
+set g_monster_ogre_attack_uzi_force 5 "Ogre machine gun damage push"
 
 // Fiend
 set g_monster_demon 1 "Enable Fiends"
index 50cb7fc15bb3df405eb122582e1fb73e91a399bf..9c2bd3af3b8c4c48a4ef77cc4c8f7c5aa6398668 100644 (file)
@@ -1008,7 +1008,7 @@ float monster_initialize(string  net_name, float mon_id,
        self.pos2                               = self.angles;
        self.reset                              = monsters_reset;
        self.candrop                    = TRUE;
-       self.view_ofs                   = '0 0 1' * self.maxs_z;
+       self.view_ofs                   = '0 0 1' * (self.maxs_z * 0.5);
        
        if not(self.ticrate)
                self.ticrate = autocvar_g_monsters_think_delay;
index 4d8b701437396c59b52f7725ed0b123c433e7210..fb67de9b927084662c1d0be4dd66a56c4e444db6 100644 (file)
@@ -16,6 +16,9 @@ float autocvar_g_monster_ogre_chainsaw_damage;
 float autocvar_g_monster_ogre_speed_walk;
 float autocvar_g_monster_ogre_speed_run;
 float autocvar_g_monster_ogre_attack_uzi_bullets;
+float autocvar_g_monster_ogre_attack_uzi_damage;
+float autocvar_g_monster_ogre_attack_uzi_force;
+float autocvar_g_monster_ogre_attack_uzi_chance;
 
 // animations
 const float ogre_anim_idle             = 0;
@@ -79,7 +82,11 @@ void ogre_uzi_fire ()
                self.delay = -1;
                return;
        }
-       W_UZI_Attack(DEATH_MONSTER_OGRE_UZI);
+       
+       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);
+       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);
+       endFireBallisticBullet();
+       
        self.delay = time + 0.1;
        self.monster_delayedattack = ogre_uzi_fire;
 }
@@ -102,7 +109,7 @@ void ogre_gl ()
 float ogre_missile ()
 {
        self.ogre_cycles = 0;
-       if (random() <= 0.20)
+       if (random() <= autocvar_g_monster_ogre_attack_uzi_chance)
        {
                ogre_uzi();
                return TRUE;