]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_rifle.qc
animation blending makes headshots pointless; so let's remove them
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_rifle.qc
index d89d44571d113daff23598475bc780c6e9f0d47c..f707bbd6525aacfdf2dc239ae7445b27ab257136 100644 (file)
@@ -1,17 +1,17 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(RIFLE, w_rifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "rifle", _("Rifle"))
+REGISTER_WEAPON(RIFLE, w_rifle, IT_NAILS, 7, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "rifle", _("Rifle"))
 #else
 #ifdef SVQC
 
 .float rifle_accumulator;
 
-void W_Rifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant, float pTracer, float pShots, string pSound)
+void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant, float pTracer, float pShots, string pSound)
 {
        float i;
 
        W_DecreaseAmmo(ammo_nails, pAmmo, autocvar_g_balance_rifle_reload_ammo);
 
-       W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, (pDamage + pHeadshotAddedDamage) * pShots);
+       W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, pDamage * pShots);
 
        pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
 
@@ -22,7 +22,7 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage
        }
 
        for(i = 0; i < pShots; ++i)
-               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
        endFireBallisticBullet();
 
        if (autocvar_g_casings >= 2)
@@ -31,12 +31,12 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage
 
 void W_Rifle_Attack()
 {
-       W_Rifle_FireBullet(autocvar_g_balance_rifle_primary_spread, autocvar_g_balance_rifle_primary_damage, autocvar_g_balance_rifle_primary_headshotaddeddamage, autocvar_g_balance_rifle_primary_force, autocvar_g_balance_rifle_primary_speed, autocvar_g_balance_rifle_primary_lifetime, autocvar_g_balance_rifle_primary_ammo, WEP_RIFLE, autocvar_g_balance_rifle_primary_bulletconstant, autocvar_g_balance_rifle_primary_tracer, autocvar_g_balance_rifle_primary_shots, "weapons/campingrifle_fire.wav");
+       W_Rifle_FireBullet(autocvar_g_balance_rifle_primary_spread, autocvar_g_balance_rifle_primary_damage, autocvar_g_balance_rifle_primary_force, autocvar_g_balance_rifle_primary_speed, autocvar_g_balance_rifle_primary_lifetime, autocvar_g_balance_rifle_primary_ammo, WEP_RIFLE, autocvar_g_balance_rifle_primary_bulletconstant, autocvar_g_balance_rifle_primary_tracer, autocvar_g_balance_rifle_primary_shots, "weapons/campingrifle_fire.wav");
 }
 
 void W_Rifle_Attack2()
 {
-       W_Rifle_FireBullet(autocvar_g_balance_rifle_secondary_spread, autocvar_g_balance_rifle_secondary_damage, autocvar_g_balance_rifle_secondary_headshotaddeddamage, autocvar_g_balance_rifle_secondary_force, autocvar_g_balance_rifle_secondary_speed, autocvar_g_balance_rifle_secondary_lifetime, autocvar_g_balance_rifle_secondary_ammo, WEP_RIFLE | HITTYPE_SECONDARY, autocvar_g_balance_rifle_secondary_bulletconstant, autocvar_g_balance_rifle_secondary_tracer, autocvar_g_balance_rifle_secondary_shots, "weapons/campingrifle_fire2.wav");
+       W_Rifle_FireBullet(autocvar_g_balance_rifle_secondary_spread, autocvar_g_balance_rifle_secondary_damage, autocvar_g_balance_rifle_secondary_force, autocvar_g_balance_rifle_secondary_speed, autocvar_g_balance_rifle_secondary_lifetime, autocvar_g_balance_rifle_secondary_ammo, WEP_RIFLE | HITTYPE_SECONDARY, autocvar_g_balance_rifle_secondary_bulletconstant, autocvar_g_balance_rifle_secondary_tracer, autocvar_g_balance_rifle_secondary_shots, "weapons/campingrifle_fire2.wav");
 }
 
 void spawnfunc_weapon_rifle (void)
@@ -116,7 +116,7 @@ float w_rifle(float req)
                        self.bot_secondary_riflemooth = 0;
                if(self.bot_secondary_riflemooth == 0)
                {
-                       if(bot_aim(autocvar_g_balance_rifle_primary_speed, 0, autocvar_g_balance_rifle_primary_lifetime, TRUE))
+                       if(bot_aim(autocvar_g_balance_rifle_primary_speed, 0, autocvar_g_balance_rifle_primary_lifetime, FALSE))
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.01) self.bot_secondary_riflemooth = 1;
@@ -124,7 +124,7 @@ float w_rifle(float req)
                }
                else
                {
-                       if(bot_aim(autocvar_g_balance_rifle_secondary_speed, 0, autocvar_g_balance_rifle_secondary_lifetime, TRUE))
+                       if(bot_aim(autocvar_g_balance_rifle_secondary_speed, 0, autocvar_g_balance_rifle_secondary_lifetime, FALSE))
                        {
                                self.BUTTON_ATCK2 = TRUE;
                                if(random() < 0.03) self.bot_secondary_riflemooth = 0;
@@ -147,7 +147,7 @@ float w_rifle(float req)
                                self.rifle_accumulator += autocvar_g_balance_rifle_primary_burstcost;
                        }
                        if (self.BUTTON_ATCK2)
-                       {       
+                       {
                                if (autocvar_g_balance_rifle_secondary)
                                {
                     if(autocvar_g_balance_rifle_secondary_reload)
@@ -183,13 +183,13 @@ float w_rifle(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_nails >= autocvar_g_balance_rifle_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_RIFLE] >= autocvar_g_balance_rifle_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_RIFLE]) >= autocvar_g_balance_rifle_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_nails >= autocvar_g_balance_rifle_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_RIFLE] >= autocvar_g_balance_rifle_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_RIFLE]) >= autocvar_g_balance_rifle_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RESETPLAYER)
@@ -201,7 +201,7 @@ float w_rifle(float req)
                W_Reload(min(autocvar_g_balance_rifle_primary_ammo, autocvar_g_balance_rifle_secondary_ammo), autocvar_g_balance_rifle_reload_ammo, autocvar_g_balance_rifle_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_rifle(float req)
@@ -229,34 +229,23 @@ float w_rifle(float req)
        }
        else if (req == WR_SUICIDEMESSAGE)
        {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s shot themself automatically");
-               else
-                       w_deathtypestring = _("%s sniped themself somehow");
+               w_deathtypestring = _("%s is now thinking with portals");
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
                {
                        if(w_deathtype & HITTYPE_BOUNCE)
-                               w_deathtypestring = _("%s failed to hide from %s's bullet hail");
+                               w_deathtypestring = _("%s failed to hide from %s's rifle bullet hail");
                        else
-                               w_deathtypestring = _("%s died in %s's bullet hail");
+                               w_deathtypestring = _("%s died in %s's rifle bullet hail");
                }
                else
                {
                        if(w_deathtype & HITTYPE_BOUNCE)
-                       {
-                               // TODO special headshot message here too?
                                w_deathtypestring = _("%s failed to hide from %s's rifle");
-                       }
                        else
-                       {
-                               if(w_deathtype & HITTYPE_HEADSHOT)
-                                       w_deathtypestring = _("%s got hit in the head by %s");
-                               else
-                                       w_deathtypestring = _("%s was sniped by %s");
-                       }
+                               w_deathtypestring = _("%s was sniped with a rifle by %s");
                }
        }
        return TRUE;