move projectile explosions including precaching into w_*.qc; client/damage.qc now...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_uzi.qc
index ddec0e8..5879b00 100644 (file)
@@ -1,6 +1,7 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
 #else
+#ifdef SVQC
 // leilei's fancy muzzleflash stuff
 void W_Uzi_Flash_Go() {
        if (self.frame > 10){
@@ -116,7 +117,7 @@ float w_uzi(float req)
                precache_model ("models/uziflash.md3");
                precache_model ("models/weapons/g_uzi.md3");
                precache_model ("models/weapons/v_uzi.md3");
-               precache_model ("models/weapons/h_uzi.dpm");
+               precache_model ("models/weapons/h_uzi.iqm");
                precache_sound ("weapons/uzi_fire.wav");
        }
        else if (req == WR_SETUP)
@@ -137,3 +138,29 @@ float w_uzi(float req)
        return TRUE;
 };
 #endif
+#ifdef CSQC
+float w_uzi(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.05)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                       else if(w_random < 0.1)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                       else if(w_random < 0.2)
+                               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");
+       }
+       return TRUE;
+}
+#endif
+#endif