]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_shotgun.qc
Merge remote branch 'origin/master' into samual/hagar_secondary_autorelease
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_shotgun.qc
index a7da4eb5ad794c4cd9de5880e1c03480ce95fc37..2088073f9970e62a1836b96725ab231f85898638 100644 (file)
@@ -25,7 +25,7 @@ void W_Shotgun_Attack (void)
 
        W_DecreaseAmmo(ammo_shells, ammoamount, autocvar_g_balance_shotgun_reload_ammo);
 
-       W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
+       W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
        for (sc = 0;sc < bullets;sc = sc + 1)
                fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
        endFireBallisticBullet();
@@ -91,14 +91,14 @@ void shotgun_meleethink (void)
 
 void W_Shotgun_Attack2 (void)
 {
-       sound (self, CHAN_PROJECTILE, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_SHOTS, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
        weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
 
        entity meleetemp;
        meleetemp = spawn();
        meleetemp.owner = meleetemp.realowner = self;
        meleetemp.think = shotgun_meleethink;
-       meleetemp.nextthink = time + autocvar_g_balance_shotgun_secondary_melee_delay;
+       meleetemp.nextthink = time + autocvar_g_balance_shotgun_secondary_melee_delay * W_WeaponRateFactor();
        W_SetupShot_Range(self, TRUE, 0, "", 0, autocvar_g_balance_shotgun_secondary_damage, autocvar_g_balance_shotgun_secondary_melee_range);
 }
 
@@ -113,7 +113,13 @@ float w_shotgun(float req)
                if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range)
                        self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
                else
-                       self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
+               {
+                       if(autocvar_g_antilag_bullets)
+                               self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
+                       else
+                               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_shotgun_primary_speed, 0, 0.001, FALSE);
+               }
+
        else if (req == WR_THINK)
        {
                if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load < autocvar_g_balance_shotgun_primary_ammo) // forced reload
@@ -131,7 +137,7 @@ float w_shotgun(float req)
                                        if(weapon_prepareattack(0, autocvar_g_balance_shotgun_primary_animtime))
                                        {
                                                W_Shotgun_Attack();
-                                               self.shotgun_primarytime = time + autocvar_g_balance_shotgun_primary_refire;
+                                               self.shotgun_primarytime = time + autocvar_g_balance_shotgun_primary_refire * W_WeaponRateFactor();
                                                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_shotgun_primary_animtime, w_ready);
                                        }
                                }
@@ -191,11 +197,11 @@ float w_shotgun(float req)
                if(!w_issilent && time - self.prevric > 0.25)
                {
                        if(w_random < 0.0165)
-                               sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
                        else if(w_random < 0.033)
-                               sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
                        else if(w_random < 0.05)
-                               sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
                        self.prevric = time;
                }
        }