]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_campingrifle.qc
nicer lightningun. Need beam to work in third person too, however :(
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_campingrifle.qc
index 2ee72701ff4838b18b9ff0d01555f02ec9bf1b23..8fc8d839da6ca97b686bc86079c7c52cccbdf2f7 100644 (file)
@@ -250,6 +250,43 @@ float w_campingrifle(float req)
                return self.ammo_nails >= cvar("g_balance_campingrifle_primary_ammo");
        else if (req == WR_CHECKAMMO2)
                return self.ammo_nails >= cvar("g_balance_campingrifle_secondary_ammo");
+       else if (req == WR_RELOAD)
+       {
+               W_CampingRifle_Reload();
+       }
+       else if (req == WR_RESETPLAYER)
+       {
+               self.campingrifle_accumulator = time - cvar("g_balance_campingrifle_bursttime");
+               self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
+               W_CampingRifle_CheckMaxBullets(FALSE);
+       }
+       return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_campingrifle(float req)
+{
+       if(req == WR_IMPACTEFFECT)
+       {
+               vector org2;
+               org2 = w_org + w_backoff * 2;
+               pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+               if(!w_issilent)
+               {
+                       if(w_random < 0.2)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                       else if(w_random < 0.4)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                       else if(w_random < 0.5)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+               }
+       }
+       else if(req == WR_PRECACHE)
+       {
+               precache_sound("weapons/ric1.wav");
+               precache_sound("weapons/ric2.wav");
+               precache_sound("weapons/ric3.wav");
+       }
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
@@ -282,19 +319,7 @@ float w_campingrifle(float req)
                        }
                }
        }
-       else if (req == WR_RELOAD)
-       {
-               W_CampingRifle_Reload();
-       }
-       else if (req == WR_RESETPLAYER)
-       {
-               self.campingrifle_accumulator = time - cvar("g_balance_campingrifle_bursttime");
-               self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
-               W_CampingRifle_CheckMaxBullets(FALSE);
-       }
        return TRUE;
-};
-#endif
-#ifdef CSQC
+}
 #endif
 #endif