]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a function to control weapon sound paths with hooks
authorMario <zacjardine@y7mail.com>
Mon, 24 Aug 2015 04:45:06 +0000 (14:45 +1000)
committerMario <zacjardine@y7mail.com>
Mon, 24 Aug 2015 04:45:06 +0000 (14:45 +1000)
59 files changed:
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/turrets/turrets.qc
qcsrc/common/turrets/unit/ewheel.qc
qcsrc/common/turrets/unit/flac.qc
qcsrc/common/turrets/unit/hellion.qc
qcsrc/common/turrets/unit/hk.qc
qcsrc/common/turrets/unit/machinegun.qc
qcsrc/common/turrets/unit/mlrs.qc
qcsrc/common/turrets/unit/phaser.qc
qcsrc/common/turrets/unit/plasma.qc
qcsrc/common/turrets/unit/plasma_dual.qc
qcsrc/common/turrets/unit/walker.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/unit/bumblebee.qc
qcsrc/common/vehicles/unit/racer.qc
qcsrc/common/vehicles/unit/raptor.qc
qcsrc/common/vehicles/unit/spiderbot.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hmg.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_machinegun.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_rpc.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/common/weapons/w_shockwave.qc
qcsrc/common/weapons/w_shotgun.qc
qcsrc/common/weapons/w_tuba.qc
qcsrc/common/weapons/w_vaporizer.qc
qcsrc/common/weapons/w_vortex.qc
qcsrc/server/cheats.qc
qcsrc/server/g_hook.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/mutators/mutator_touchexplode.qc
qcsrc/server/t_items.qc
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponsystem.qc

index 2418bfc0c248479213799c0de61e7c15a9043d38..f6dcb022e763d949e51e0f6d3b3a1bd57baea5e4 100644 (file)
@@ -86,7 +86,7 @@ void mage_spike_explode()
 {
        self.event_damage = func_null;
 
-       sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM);
 
        self.realowner.mage_spike = world;
 
@@ -252,7 +252,7 @@ void mage_heal()
 
 void mage_push()
 {
-       sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM);
        RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
        Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1);
 
@@ -399,7 +399,7 @@ float m_mage(float req)
                case MR_PRECACHE:
                {
                        precache_model("models/monsters/mage.dpm");
-                       precache_sound ("weapons/grenade_impact.wav");
+                       precache_sound (W_Sound("grenade_impact"));
                        precache_sound ("weapons/tagexp1.wav");
                        return true;
                }
index f4f29d9fbc1d62427f00a89a8cf6dcb2fb5d4fee..47e371a978980daf59d020caaca3813a1152ef49 100644 (file)
@@ -44,7 +44,7 @@ void shambler_smash()
 {
        makevectors(self.angles);
        Send_Effect("explosion_medium", (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1);
-       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
 
        tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * 500, MOVE_NORMAL, self);
 
@@ -67,7 +67,7 @@ void shambler_lightning_explode()
 {
        entity head;
 
-       sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM);
        Send_Effect("electro_impact", '0 0 0', '0 0 0', 1);
 
        self.event_damage = func_null;
index 65ba8dad5364e4bd96df9a9832136dcd653a4ef3..de5f2c4593d7aa1b241c2949e3df62d596def3b3 100644 (file)
@@ -59,7 +59,7 @@ void spider_shootweb()
 {
        monster_makevectors(self.enemy);
 
-       sound(self, CH_SHOTS, "weapons/electro_fire2.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("electro_fire2"), VOL_BASE, ATTEN_NORM);
 
        entity proj = spawn ();
        proj.classname = "plasma";
@@ -154,7 +154,7 @@ float m_spider(float req)
                case MR_PRECACHE:
                {
                        precache_model("models/monsters/spider.dpm");
-                       precache_sound ("weapons/electro_fire2.wav");
+                       precache_sound (W_Sound("electro_fire2"));
                        return true;
                }
        }
index a47b975690ef4799825e3f32227eb539b47ee89a..e37de95e672e919f598a39f8be124ce5a9fdbba9 100644 (file)
@@ -21,6 +21,10 @@ void turrets_common_precache()
        precache_model ("models/turrets/c512.md3");
        precache_model ("models/marker.md3");
 
+#ifdef SVQC
+       precache_sound(W_Sound("rocket_impact"));
+#endif
+
 #ifdef TURRET_DEBUG
        precache_model ("models/turrets/c512.md3");
        precache_model ("models/pathlib/goodsquare.md3");
index 495e60ff39086ae19fed62647496bff2a9bd14b1..f0c02cb3f7b034a08951b81db522c30e93bf0247 100644 (file)
@@ -136,7 +136,7 @@ float t_ewheel(float req)
             {
                 turret_do_updates(self);
 
-                _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE);
+                _mis = turret_projectile(W_Sound("lasergun_fire"), 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE);
                 _mis.missile_flags = MIF_SPLASH;
 
                 Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
index 614df1d2f072aa133c8b7a15a0b7f75e97d8162d..65d00be38b523c086cc5d7b70be758d49186015f 100644 (file)
@@ -40,7 +40,7 @@ float t_flac(float req)
 
             turret_tag_fire_update();
 
-            proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE);
+            proj = turret_projectile(W_Sound("hagar_fire"), 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE);
             Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
             proj.think   = turret_flac_projectile_think_explode;
             proj.nextthink  = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01);
index f64534f8627f0486d4e903a24d5af11a9a8031ba..882f852bc283c3c5fe4397e60e00c841129c6086 100644 (file)
@@ -91,7 +91,7 @@ float t_hellion(float req)
             else
                 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
 
-            missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
+            missile = turret_projectile(W_Sound("rocket_fire"), 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
             te_explosion (missile.origin);
             missile.think              = turret_hellion_missile_think;
             missile.nextthink  = time;
index 64d9a8c6a7d60d5498a4107e3f22b3ede0517246..fec2a69366caf8d9e6099c56f66be89bda823589 100644 (file)
@@ -283,7 +283,7 @@ float t_hk(float req)
         {
             entity missile;
 
-            missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE);
+            missile = turret_projectile(W_Sound("rocket_fire"), 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE);
             te_explosion (missile.origin);
 
             missile.think                      = turret_hk_missile_think;
index f952d4b158ac6d5d110f42be7891a8c146920c32..5d5d62c8326e4fbad695a0b8c0925eb6028362ce 100644 (file)
@@ -50,7 +50,7 @@ float t_machinegun(float req)
         {
             precache_model ("models/turrets/base.md3");
             precache_model ("models/turrets/machinegun.md3");
-            precache_sound ("weapons/uzi_fire.wav");
+            precache_sound (W_Sound("uzi_fire"));
             return true;
         }
     }
index 0142202157145a3bad5738b83553dfa29158d138..a71ba4c3bf3e734739e0c5443bca8067fad440f5 100644 (file)
@@ -22,7 +22,7 @@ float t_mlrs(float req)
             entity missile;
 
             turret_tag_fire_update();
-            missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
+            missile = turret_projectile(W_Sound("rocket_fire"), 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
             missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
             missile.missile_flags = MIF_SPLASH;
             te_explosion (missile.origin);
index 449c09f859785362a1084e6ef1b0b70b033f5efe..7d377174f7be15bea68fb2a3fb74d5d0543217a6 100644 (file)
@@ -93,7 +93,7 @@ float t_phaser(float req)
 
             setattachment(beam,self.tur_head,"tag_fire");
 
-            soundat (self, trace_endpos, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
+            soundat (self, trace_endpos, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTEN_NORM);
 
             if (self.tur_head.frame == 0)
                 self.tur_head.frame = 1;
index da86d3bf77339811bc007caa3186eb854c7abcf7..dfebe1a40880a9fe0c942f4c76e0db8b9972a4d2 100644 (file)
@@ -42,7 +42,7 @@ float t_plasma(float req)
             }
             else
             {
-                entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+                entity missile = turret_projectile(W_Sound("hagar_fire"), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
                 missile.missile_flags = MIF_SPLASH;
 
                 Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
index f7cf549415943f34d96820b2e7ae84b3dba3a560..79e2ba8158557db1988533ce1a3d21f7cd77394c 100644 (file)
@@ -42,7 +42,7 @@ float t_plasma_dual(float req)
             }
             else
             {
-                entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+                entity missile = turret_projectile(W_Sound("hagar_fire"), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
                 missile.missile_flags = MIF_SPLASH;
                 Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
                 self.tur_head.frame += 1;
index 4a63f9dee7ae772c1c1f6f7992e0ac50615dccfa..169f10b2411b397196a068607bcccaee649e3c6b 100644 (file)
@@ -221,7 +221,7 @@ void walker_fire_rocket(vector org)
     rocket = spawn ();
     setorigin(rocket, org);
 
-    sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTEN_NORM);
+    sound (self, CH_WEAPON_A, W_Sound("hagar_fire"), VOL_BASE, ATTEN_NORM);
     setsize (rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
     rocket.classname             = "walker_rocket";
@@ -342,7 +342,7 @@ float t_walker(float req)
     {
         case TR_ATTACK:
         {
-            sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
+            sound (self, CH_WEAPON_A, W_Sound("uzi_fire"), VOL_BASE, ATTEN_NORM);
             fireBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0);
             Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 
@@ -637,7 +637,7 @@ float t_walker(float req)
             precache_model ("models/turrets/walker_body.md3");
             precache_model ("models/turrets/walker_head_minigun.md3");
             precache_model ("models/turrets/rocket.md3");
-            precache_sound ("weapons/rocket_impact.wav");
+            precache_sound (W_Sound("rocket_impact"));
             return true;
         }
     }
index d4b1e1acf46d964a533057a41ce34ca52be0b793..dbc7964b09769eb53370f60fe70dbe62c5527ce1 100644 (file)
@@ -303,7 +303,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound,
 
 void vehicles_gib_explode()
 {
-       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
        Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        Send_Effect("explosion_small", self.wp00.origin + '0 0 64', '0 0 0', 1);
        remove(self);
index f6cfb65fec8042e037e9da5e887343190bb07abc..65eb131685ffe2486bab7d871e0723d872454de7 100644 (file)
@@ -104,7 +104,7 @@ float bumble_raygun_send(entity to, int sf);
 void bumblebee_fire_cannon(entity _gun, string _tagname, entity _owner)
 {
        vector v = gettaginfo(_gun, gettagindex(_gun, _tagname));
-       vehicles_projectile("bigplasma_muzzleflash", "weapons/flacexp3.wav",
+       vehicles_projectile("bigplasma_muzzleflash", W_Sound("flacexp3"),
                                                v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
                                                autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force,  0,
                                                DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
@@ -716,7 +716,7 @@ void bumblebee_blowup()
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
                                 DEATH_VH_BUMB_DEATH, world);
 
-       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
        Send_Effect("explosion_big", (self.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
 
        if(self.owner.deadflag == DEAD_DYING)
@@ -732,7 +732,7 @@ void bumblebee_diethink()
 
        if(random() < 0.1)
        {
-               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+               sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
                Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        }
 
index d6fbbcc2f473c9cd6a60da8aafcc68ea08e149d6..f83df2873eb29e54020e0edeacd894c04375ae7d 100644 (file)
@@ -174,7 +174,7 @@ void racer_fire_cannon(string tagname)
        entity bolt;
 
        v = gettaginfo(self, gettagindex(self, tagname));
-       bolt = vehicles_projectile("wakizashi_gun_muzzleflash", "weapons/lasergun_fire.wav",
+       bolt = vehicles_projectile("wakizashi_gun_muzzleflash", W_Sound("lasergun_fire"),
                                                   v, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed,
                                                   autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force,  0,
                                                   DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, true, true, self.owner);
@@ -292,7 +292,7 @@ void racer_rocket_tracker()
 void racer_fire_rocket(string tagname, entity trg)
 {
        vector v = gettaginfo(self, gettagindex(self, tagname));
-       entity rocket = vehicles_projectile("wakizashi_rocket_launch", "weapons/rocket_fire.wav",
+       entity rocket = vehicles_projectile("wakizashi_rocket_launch", W_Sound("rocket_fire"),
                                                   v, v_forward * autocvar_g_vehicle_racer_rocket_speed,
                                                   autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
                                                   DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, false, false, self.owner);
@@ -857,8 +857,8 @@ bool v_racer(int req)
                case VR_PRECACHE:
                {
                #ifdef SVQC
-                       precache_sound ("weapons/lasergun_fire.wav");
-                       precache_sound ("weapons/rocket_fire.wav");
+                       precache_sound (W_Sound("lasergun_fire"));
+                       precache_sound (W_Sound("rocket_fire"));
 
                        precache_sound ("vehicles/racer_idle.wav");
                        precache_sound ("vehicles/racer_move.wav");
index 93e1605aef4cbd04b75694edc9951e936e405e3f..035c20b8b032749bdbe0c9eeb8f28a0395b84c55 100644 (file)
@@ -195,7 +195,7 @@ void raptor_bombdrop()
 
 void raptor_fire_cannon(entity gun, string tagname)
 {
-       vehicles_projectile("raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
+       vehicles_projectile("raptor_cannon_muzzleflash", W_Sound("lasergun_fire"),
                                                   gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
                                                   autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force,  0,
                                                   DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, true, true, self.owner);
@@ -727,7 +727,7 @@ void raptor_diethink()
 
        if(random() < 0.05)
        {
-               sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+               sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
                Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        }
        self.nextthink = time;
index 0ad0da41dcffbd671aa907fb66870a04fb0349a2..8c238f865babb1d982d3f1c6b30b36460e39085d 100644 (file)
@@ -269,7 +269,7 @@ void spiderbot_rocket_do()
        switch(self.vehicle_weapon2mode)
        {
                case SBRM_VOLLY:
-                       rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
+                       rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"),
                                                                   v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                                                   autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
                                                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
@@ -283,7 +283,7 @@ void spiderbot_rocket_do()
                                self.wait = -10;
                        break;
                case SBRM_GUIDE:
-                       rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
+                       rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"),
                                                                   v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                                                   autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
                                                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner);
@@ -295,7 +295,7 @@ void spiderbot_rocket_do()
 
                break;
                case SBRM_ARTILLERY:
-                       rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
+                       rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"),
                                                                   v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                                                   autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
                                                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
@@ -558,7 +558,7 @@ float spiderbot_frame()
                        fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
                                 autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0);
 
-                       sound (gun, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
+                       sound (gun, CH_WEAPON_A, W_Sound("uzi_fire"), VOL_BASE, ATTEN_NORM);
                        //trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
                        pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1);
 
@@ -678,7 +678,7 @@ void spiderbot_headfade()
        {
                if(self.alpha > 0.1)
                {
-                       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+                       sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
                        Send_Effect("explosion_big", self.origin + '0 0 100', '0 0 0', 1);
                }
                remove(self);
@@ -691,7 +691,7 @@ void spiderbot_blowup()
        {
                if(random() < 0.1)
                {
-                       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+                       sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
                        Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
                }
                self.nextthink = time + 0.1;
@@ -932,8 +932,8 @@ float v_spiderbot(float req)
                        precache_model ("models/vehicles/spiderbot_cockpit.dpm");
                        precache_model ( "models/uziflash.md3");
 
-                       precache_sound ("weapons/uzi_fire.wav" );
-                       precache_sound ("weapons/rocket_impact.wav");
+                       precache_sound (W_Sound("uzi_fire") );
+                       precache_sound (W_Sound("rocket_impact"));
 
                        precache_sound ("vehicles/spiderbot_die.wav");
                        precache_sound ("vehicles/spiderbot_idle.wav");
index 3f0d6a097820b0b9e9ab81fcdeb46b559688503a..4dcb2d6e7c2446b006a960c862c7cfaa52421c9d 100644 (file)
@@ -330,4 +330,21 @@ int GetAmmoStat(.int ammotype)
        }
 }
 #endif
+
+#ifdef SVQC
+string W_Sound(string w_snd)
+{
+       string output = strcat("weapons/", w_snd, ".wav");
+       MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
+       return output;
+}
+
+string W_Model(string w_mdl)
+{
+       string output = strcat("models/weapons/", w_mdl);
+       MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
+       return output;
+}
+#endif
+
 #endif
index 3773765aa964bdbeacdecf905ca24fced928cf45..91ca10557a2cfd5ec7e5fbf91acddad278ba500a 100644 (file)
@@ -90,6 +90,11 @@ string GetAmmoPicture(.int ammotype);
 int GetAmmoStat(.int ammotype);
 #endif
 
+#ifdef SVQC
+string W_Sound(string w_snd);
+string W_Model(string w_mdl);
+#endif
+
 // ammo types
 .int ammo_shells;
 .int ammo_nails;
index d0647c912237b318761ce1923caeb36d61a19843..63a80c45ef8490ea03a45146877487c6d5c2b28e 100644 (file)
@@ -267,7 +267,7 @@ void W_Arc_Beam_Think(void)
                        {
                                Send_Effect("arc_overheat",
                                        self.beam_start, self.beam_wantdir, 1 );
-                               sound(self, CH_WEAPON_A, "weapons/arc_stop.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, W_Sound("arc_stop"), VOL_BASE, ATTN_NORM);
                        }
                }
 
@@ -580,9 +580,7 @@ void W_Arc_Beam(float burst)
 
        // only play fire sound if 1 sec has passed since player let go the fire button
        if(time - self.beam_prev > 1)
-       {
-               sound(self, CH_WEAPON_A, "weapons/arc_fire.wav", VOL_BASE, ATTN_NORM);
-       }
+               sound(self, CH_WEAPON_A, W_Sound("arc_fire"), VOL_BASE, ATTN_NORM);
 
        entity beam = self.arc_beam = spawn();
        beam.classname = "W_Arc_Beam";
@@ -617,7 +615,7 @@ void Arc_Smoke()
                        if ( !self.arc_smoke_sound )
                        {
                                self.arc_smoke_sound = 1;
-                               sound(self, CH_SHOTS_SINGLE, "weapons/arc_loop_overheat.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS_SINGLE, W_Sound("arc_loop_overheat"), VOL_BASE, ATTN_NORM);
                        }
                }
        }
@@ -701,7 +699,7 @@ bool W_Arc(int req)
 
                        if(self.arc_BUTTON_ATCK_prev != 0)
                        {
-                               sound(self, CH_WEAPON_A, "weapons/arc_stop.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, W_Sound("arc_stop"), VOL_BASE, ATTN_NORM);
                                weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
                                ATTACK_FINISHED(self) = time + WEP_CVAR(arc, beam_refire) * W_WeaponRateFactor();
                        }
@@ -722,13 +720,13 @@ bool W_Arc(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_arc.md3");
-                       precache_model("models/weapons/v_arc.md3");
-                       precache_model("models/weapons/h_arc.iqm");
-                       precache_sound("weapons/arc_fire.wav");
-                       precache_sound("weapons/arc_loop.wav");
-                       precache_sound("weapons/arc_stop.wav");
-                       precache_sound("weapons/arc_loop_overheat.wav");
+                       precache_model(W_Model("g_arc.md3"));
+                       precache_model(W_Model("v_arc.md3"));
+                       precache_model(W_Model("h_arc.iqm"));
+                       precache_sound(W_Sound("arc_fire"));
+                       precache_sound(W_Sound("arc_loop"));
+                       precache_sound(W_Sound("arc_stop"));
+                       precache_sound(W_Sound("arc_loop_overheat"));
                        if(!arc_shotorigin[0])
                        {
                                arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 1);
index 95a4167263188f31aff848d0d9e2152779661c3b..85e78e7a8a6f930708fae455f982b7959aa1fc07 100644 (file)
@@ -95,7 +95,7 @@ void W_Blaster_Attack(
 {
        vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD);
 
-       W_SetupShot_Dir(self, s_forward, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, atk_damage);
+       W_SetupShot_Dir(self, s_forward, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_B, atk_damage);
        Send_Effect("laser_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
        entity missile = spawn();
@@ -227,10 +227,10 @@ bool W_Blaster(int request)
 
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_laser.md3");
-                       precache_model("models/weapons/v_laser.md3");
-                       precache_model("models/weapons/h_laser.iqm");
-                       precache_sound("weapons/lasergun_fire.wav");
+                       precache_model(W_Model("g_laser.md3"));
+                       precache_model(W_Model("v_laser.md3"));
+                       precache_model(W_Model("h_laser.iqm"));
+                       precache_sound(W_Sound("lasergun_fire"));
                        BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index f6484d080bf5b4b6b24e216bd49ec52b33ac4b5b..c688b8ef2b548f42957c493e47996b492d5de48b 100644 (file)
@@ -354,7 +354,7 @@ void W_Crylink_Attack(void)
        if(WEP_CVAR_PRI(crylink, joinexplode))
                maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
 
-       W_SetupShot(self, false, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
+       W_SetupShot(self, false, 2, W_Sound("crylink_fire"), CH_WEAPON_A, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
@@ -463,7 +463,7 @@ void W_Crylink_Attack2(void)
        if(WEP_CVAR_SEC(crylink, joinexplode))
                maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
 
-       W_SetupShot(self, false, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
+       W_SetupShot(self, false, 2, W_Sound("crylink_fire2"), CH_WEAPON_A, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
@@ -638,12 +638,12 @@ bool W_Crylink(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_crylink.md3");
-                       precache_model("models/weapons/v_crylink.md3");
-                       precache_model("models/weapons/h_crylink.iqm");
-                       precache_sound("weapons/crylink_fire.wav");
-                       precache_sound("weapons/crylink_fire2.wav");
-                       precache_sound("weapons/crylink_linkjoin.wav");
+                       precache_model(W_Model("g_crylink.md3"));
+                       precache_model(W_Model("v_crylink.md3"));
+                       precache_model(W_Model("h_crylink.iqm"));
+                       precache_sound(W_Sound("crylink_fire"));
+                       precache_sound(W_Sound("crylink_fire2"));
+                       precache_sound(W_Sound("crylink_linkjoin"));
                        CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -674,7 +674,7 @@ bool W_Crylink(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 9d77f715897a0e8629ce2a3c679cea8b0fddeb90..1591d2ed5694f9fdd48d57b6d91e04b4c58da335 100644 (file)
@@ -295,7 +295,7 @@ void W_Devastator_Think(void)
                        {
                                Send_Effect("rocket_guide", self.origin, self.velocity, 1);
                                // TODO add a better sound here
-                               sound(self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM);
+                               sound(self.realowner, CH_WEAPON_B, W_Sound("rocket_mode"), VOL_BASE, ATTN_NORM);
                                self.count = 1;
                        }
                }
@@ -342,7 +342,7 @@ void W_Devastator_Attack(void)
 
        W_DecreaseAmmo(WEP_CVAR(devastator, ammo));
 
-       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(devastator, damage));
+       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, W_Sound("rocket_fire"), CH_WEAPON_A, WEP_CVAR(devastator, damage));
        Send_Effect("rocketlauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
        missile = WarpZone_RefSys_SpawnSameRefSys(self);
@@ -559,7 +559,7 @@ bool W_Devastator(int req)
                                                }
                                        }
                                        if(rockfound)
-                                               sound(self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+                                               sound(self, CH_WEAPON_B, W_Sound("rocket_det"), VOL_BASE, ATTN_NORM);
                                }
                        }
 
@@ -570,12 +570,12 @@ bool W_Devastator(int req)
                        //if(autocvar_sv_precacheweapons)
                        //{
                                precache_model("models/flash.md3");
-                               precache_model("models/weapons/g_rl.md3");
-                               precache_model("models/weapons/v_rl.md3");
-                               precache_model("models/weapons/h_rl.iqm");
-                               precache_sound("weapons/rocket_det.wav");
-                               precache_sound("weapons/rocket_fire.wav");
-                               precache_sound("weapons/rocket_mode.wav");
+                               precache_model(W_Model("g_rl.md3"));
+                               precache_model(W_Model("v_rl.md3"));
+                               precache_model(W_Model("h_rl.iqm"));
+                               precache_sound(W_Sound("rocket_det"));
+                               precache_sound(W_Sound("rocket_fire"));
+                               precache_sound(W_Sound("rocket_mode"));
                        //}
                        DEVASTATOR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
@@ -637,7 +637,7 @@ bool W_Devastator(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(WEP_CVAR(devastator, ammo), "weapons/reload.wav");
+                       W_Reload(WEP_CVAR(devastator, ammo), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index d1e79c56135609d84d74ee27b30423da7f1e79f8..2c614c771c046f70a765d4f423d28eb5edafed83 100644 (file)
@@ -255,7 +255,7 @@ void W_Electro_Attack_Bolt(void)
                '0 0 -3',
                false,
                2,
-               "weapons/electro_fire.wav",
+               W_Sound("electro_fire"),
                CH_WEAPON_A,
                WEP_CVAR_PRI(electro, damage)
        );
@@ -296,7 +296,7 @@ void W_Electro_Orb_Touch(void)
        else
        {
                //UpdateCSQCProjectile(self);
-               spamsound(self, CH_SHOTS, "weapons/electro_bounce.wav", VOL_BASE, ATTEN_NORM);
+               spamsound(self, CH_SHOTS, W_Sound("electro_bounce"), VOL_BASE, ATTEN_NORM);
                self.projectiledeathtype |= HITTYPE_BOUNCE;
        }
 }
@@ -353,7 +353,7 @@ void W_Electro_Attack_Orb(void)
                '0 0 -4',
                false,
                2,
-               "weapons/electro_fire2.wav",
+               W_Sound("electro_fire2"),
                CH_WEAPON_A,
                WEP_CVAR_SEC(electro, damage)
        );
@@ -498,14 +498,14 @@ bool W_Electro(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_electro.md3");
-                       precache_model("models/weapons/v_electro.md3");
-                       precache_model("models/weapons/h_electro.iqm");
-                       precache_sound("weapons/electro_bounce.wav");
-                       precache_sound("weapons/electro_fire.wav");
-                       precache_sound("weapons/electro_fire2.wav");
-                       precache_sound("weapons/electro_impact.wav");
-                       precache_sound("weapons/electro_impact_combo.wav");
+                       precache_model(W_Model("g_electro.md3"));
+                       precache_model(W_Model("v_electro.md3"));
+                       precache_model(W_Model("h_electro.iqm"));
+                       precache_sound(W_Sound("electro_bounce"));
+                       precache_sound(W_Sound("electro_fire"));
+                       precache_sound(W_Sound("electro_fire2"));
+                       precache_sound(W_Sound("electro_impact"));
+                       precache_sound(W_Sound("electro_impact_combo"));
                        ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -541,7 +541,7 @@ bool W_Electro(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index f9a4928b745b484f7651054a41f7ba37dadb5d59..7ea22e07ff4ecef1ec378d853d851b16120cea3a 100644 (file)
@@ -182,7 +182,7 @@ void W_Fireball_Attack1(void)
 {
        entity proj;
 
-       W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, "weapons/fireball_fire2.wav", CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
+       W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, W_Sound("fireball_fire2"), CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
 
        Send_Effect("fireball_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
@@ -251,7 +251,7 @@ void W_Fireball_Attack1_Frame1(void)
 void W_Fireball_Attack1_Frame0(void)
 {
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
-       sound(self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_WEAPON_SINGLE, W_Sound("fireball_prefire2"), VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1);
 }
 
@@ -316,8 +316,8 @@ void W_Fireball_Attack2(void)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, "weapons/fireball_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
-       traceline(w_shotorg, w_shotorg + f_diff.x * v_up + f_diff.y * v_right, MOVE_NORMAL, self);
+       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, W_Sound("fireball_fire"), CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
+       traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self);
        w_shotorg = trace_endpos;
 
        Send_Effect("fireball_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
@@ -399,13 +399,13 @@ bool W_Fireball(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_fireball.md3");
-                       precache_model("models/weapons/v_fireball.md3");
-                       precache_model("models/weapons/h_fireball.iqm");
+                       precache_model(W_Model("g_fireball.md3"));
+                       precache_model(W_Model("v_fireball.md3"));
+                       precache_model(W_Model("h_fireball.iqm"));
                        precache_model("models/sphere/sphere.md3");
-                       precache_sound("weapons/fireball_fire.wav");
-                       precache_sound("weapons/fireball_fire2.wav");
-                       precache_sound("weapons/fireball_prefire2.wav");
+                       precache_sound(W_Sound("fireball_fire"));
+                       precache_sound(W_Sound("fireball_fire2"));
+                       precache_sound(W_Sound("fireball_prefire2"));
                        FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index 967fd8f5aa72c2c6d882b8ea982e4001406ed453..2b1cb08c1cb6f079ace39844aeb718d93234f867 100644 (file)
@@ -127,7 +127,7 @@ void W_Hagar_Attack(void)
 
        W_DecreaseAmmo(WEP_CVAR_PRI(hagar, ammo));
 
-       W_SetupShot(self, false, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
+       W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
 
        Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
@@ -170,7 +170,7 @@ void W_Hagar_Attack2(void)
 
        W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
 
-       W_SetupShot(self, false, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+       W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
 
        Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
@@ -223,7 +223,7 @@ void W_Hagar_Attack2_Load_Release(void)
 
        weapon_prepareattack_do(1, WEP_CVAR_SEC(hagar, refire));
 
-       W_SetupShot(self, false, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+       W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
        Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
        forward = v_forward;
@@ -317,7 +317,7 @@ void W_Hagar_Attack2_Load(void)
                                self.weaponentity.state = WS_READY;
                                W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo
                                self.hagar_load = 0;
-                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, W_Sound("hagar_beep"), VOL_BASE, ATTN_NORM);
 
                                // pause until we can load rockets again, once we re-press the alt fire button
                                self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor();
@@ -336,7 +336,7 @@ void W_Hagar_Attack2_Load(void)
                                        W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
                                        self.weaponentity.state = WS_INUSE;
                                        self.hagar_load += 1;
-                                       sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
+                                       sound(self, CH_WEAPON_B, W_Sound("hagar_load"), VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
 
                                        if(self.hagar_load >= WEP_CVAR_SEC(hagar, load_max))
                                                self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor();
@@ -347,7 +347,7 @@ void W_Hagar_Attack2_Load(void)
                        else if(!self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
                        {
                                // if this is the last rocket we can load, play a beep sound to notify the player
-                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, W_Sound("hagar_beep"), VOL_BASE, ATTN_NORM);
                                self.hagar_loadbeep = true;
                        }
                }
@@ -366,7 +366,7 @@ void W_Hagar_Attack2_Load(void)
                        if(!self.hagar_warning && self.hagar_load) // prevents the beep from playing each frame
                        {
                                // we're about to automatically release after holding time, play a beep sound to notify the player
-                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, W_Sound("hagar_beep"), VOL_BASE, ATTN_NORM);
                                self.hagar_warning = true;
                        }
                }
@@ -449,12 +449,12 @@ bool W_Hagar(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_hagar.md3");
-                       precache_model("models/weapons/v_hagar.md3");
-                       precache_model("models/weapons/h_hagar.iqm");
-                       precache_sound("weapons/hagar_fire.wav");
-                       precache_sound("weapons/hagar_load.wav");
-                       precache_sound("weapons/hagar_beep.wav");
+                       precache_model(W_Model("g_hagar.md3"));
+                       precache_model(W_Model("v_hagar.md3"));
+                       precache_model(W_Model("h_hagar.iqm"));
+                       precache_sound(W_Sound("hagar_fire"));
+                       precache_sound(W_Sound("hagar_load"));
+                       precache_sound(W_Sound("hagar_beep"));
                        HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -503,7 +503,7 @@ bool W_Hagar(int req)
                case WR_RELOAD:
                {
                        if(!self.hagar_load) // require releasing loaded rockets first
-                               W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), "weapons/reload.wav");
+                               W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), W_Sound("reload"));
 
                        return true;
                }
index fa3f48c87f554785f0828e520e9c8224e933cb68..d2428ffb4c7220e2ca4ceeeca91cd29bcb946023 100644 (file)
@@ -77,7 +77,7 @@ void W_HLAC_Attack(void)
     if(self.crouch)
         spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
 
-       W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
+       W_SetupShot(self, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
        Send_Effect("laser_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
        if(!autocvar_g_norecoil)
        {
@@ -125,7 +125,7 @@ void W_HLAC_Attack2(void)
     if(self.crouch)
         spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
 
-       W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
+       W_SetupShot(self, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
        Send_Effect("laser_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
        missile = spawn();
@@ -241,10 +241,10 @@ bool W_HLAC(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_hlac.md3");
-                       precache_model("models/weapons/v_hlac.md3");
-                       precache_model("models/weapons/h_hlac.iqm");
-                       precache_sound("weapons/lasergun_fire.wav");
+                       precache_model(W_Model("g_hlac.md3"));
+                       precache_model(W_Model("v_hlac.md3"));
+                       precache_model(W_Model("h_hlac.iqm"));
+                       precache_sound(W_Sound("lasergun_fire"));
                        HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -267,7 +267,7 @@ bool W_HLAC(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 2668aca2c41ecee0bd2eb0c0107532e603b7a2bb..2c315f1044d89f5166314c721558e062c6f91ca0 100644 (file)
@@ -61,7 +61,7 @@ void W_HeavyMachineGun_Attack_Auto()
 
        W_DecreaseAmmo(WEP_CVAR(hmg, ammo));
 
-       W_SetupShot (self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(hmg, damage));
+       W_SetupShot (self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(hmg, damage));
 
        if(!autocvar_g_norecoil)
        {
@@ -119,10 +119,10 @@ bool W_HeavyMachineGun(int req)
                case WR_INIT:
                {
                        precache_model ("models/uziflash.md3");
-                       precache_model ("models/weapons/g_ok_hmg.md3");
-                       precache_model ("models/weapons/v_ok_hmg.md3");
-                       precache_model ("models/weapons/h_ok_hmg.iqm");
-                       precache_sound ("weapons/uzi_fire.wav");
+                       precache_model(W_Model("g_ok_hmg.md3"));
+                       precache_model(W_Model("v_ok_hmg.md3"));
+                       precache_model(W_Model("h_ok_hmg.iqm"));
+                       precache_sound (W_Sound("uzi_fire"));
                        HMG_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -151,7 +151,7 @@ bool W_HeavyMachineGun(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(WEP_CVAR(hmg, ammo), "weapons/reload.wav");
+                       W_Reload(WEP_CVAR(hmg, ammo), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index a8d33e8704bb16937d34ec41b29612412002f8fe..b877254c3d53740be925b358fb02b0470b7bb273 100644 (file)
@@ -134,7 +134,7 @@ void W_Hook_Attack2(void)
        entity gren;
 
        //W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
-       W_SetupShot(self, false, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
+       W_SetupShot(self, false, 4, W_Sound("hookbomb_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
 
        gren = spawn();
        gren.owner = gren.realowner = self;
@@ -288,12 +288,12 @@ bool W_Hook(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_hookgun.md3");
-                       precache_model("models/weapons/v_hookgun.md3");
-                       precache_model("models/weapons/h_hookgun.iqm");
-                       precache_sound("weapons/hook_impact.wav"); // done by g_hook.qc
-                       precache_sound("weapons/hook_fire.wav");
-                       precache_sound("weapons/hookbomb_fire.wav");
+                       precache_model(W_Model("g_hookgun.md3"));
+                       precache_model(W_Model("v_hookgun.md3"));
+                       precache_model(W_Model("h_hookgun.iqm"));
+                       precache_sound(W_Sound("hook_impact")); // done by g_hook.qc
+                       precache_sound(W_Sound("hook_fire"));
+                       precache_sound(W_Sound("hookbomb_fire"));
                        HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index f320f711469cfb75a72daaa424bf262cafa54388..ac5bc2cb33d5b7c0506b35cafc443c1f9ea9aafd 100644 (file)
@@ -104,7 +104,7 @@ void W_MachineGun_MuzzleFlash(void)
 
 void W_MachineGun_Attack(int deathtype)
 {
-       W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
+       W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
        if(!autocvar_g_norecoil)
        {
                self.punchangle_x = random() - 0.5;
@@ -180,7 +180,7 @@ void W_MachineGun_Attack_Auto(void)
 
        W_DecreaseAmmo(WEP_CVAR(machinegun, sustained_ammo));
 
-       W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+       W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
        if(!autocvar_g_norecoil)
        {
                self.punchangle_x = random() - 0.5;
@@ -206,7 +206,7 @@ void W_MachineGun_Attack_Auto(void)
 
 void W_MachineGun_Attack_Burst(void)
 {
-       W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+       W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
        if(!autocvar_g_norecoil)
        {
                self.punchangle_x = random() - 0.5;
@@ -305,10 +305,10 @@ bool W_MachineGun(int req)
                case WR_INIT:
                {
                        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.iqm");
-                       precache_sound("weapons/uzi_fire.wav");
+                       precache_model(W_Model("g_uzi.md3"));
+                       precache_model(W_Model("v_uzi.md3"));
+                       precache_model(W_Model("h_uzi.iqm"));
+                       precache_sound(W_Sound("uzi_fire"));
                        MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index 25ac30e4bd9b1a9bc1df5123da0d2f1e68d6786e..61ae5362ab49262eb924f6cbc1e2e1192348f829 100644 (file)
@@ -61,7 +61,7 @@ void spawnfunc_weapon_minelayer(void) { weapon_defaultspawnfunc(WEP_MINE_LAYER.m
 
 void W_MineLayer_Stick(entity to)
 {
-       spamsound(self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTN_NORM);
+       spamsound(self, CH_SHOTS, W_Sound("mine_stick"), VOL_BASE, ATTN_NORM);
 
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
 
@@ -225,7 +225,7 @@ void W_MineLayer_Think(void)
        if((time > self.cnt) && (!self.mine_time) && (self.cnt > 0))
        {
                if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
-                       spamsound(self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("mine_trigger"), VOL_BASE, ATTN_NORM);
                self.mine_time = time + WEP_CVAR(minelayer, lifetime_countdown);
                self.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
        }
@@ -248,7 +248,7 @@ void W_MineLayer_Think(void)
                if(head != self.realowner && DIFF_TEAM(head, self.realowner)) // don't trigger for team mates
                if(!self.mine_time)
                {
-                       spamsound(self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("mine_trigger"), VOL_BASE, ATTN_NORM);
                        self.mine_time = time + WEP_CVAR(minelayer, time);
                }
                head = head.chain;
@@ -320,14 +320,14 @@ void W_MineLayer_Attack(void)
                {
                        // the refire delay keeps this message from being spammed
                        Send_Notification(NOTIF_ONE, self, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
-                       play2(self, "weapons/unavailable.wav");
+                       play2(self, W_Sound("unavailable"));
                        return;
                }
        }
 
        W_DecreaseAmmo(WEP_CVAR(minelayer, ammo));
 
-       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, "weapons/mine_fire.wav", CH_WEAPON_A, WEP_CVAR(minelayer, damage));
+       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, W_Sound("mine_fire"), CH_WEAPON_A, WEP_CVAR(minelayer, damage));
        Send_Effect("rocketlauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
        mine = WarpZone_RefSys_SpawnSameRefSys(self);
@@ -527,7 +527,7 @@ bool W_MineLayer(int req)
                        if(self.BUTTON_ATCK2)
                        {
                                if(W_MineLayer_PlacedMines(true))
-                                       sound(self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
+                                       sound(self, CH_WEAPON_B, W_Sound("mine_det"), VOL_BASE, ATTN_NORM);
                        }
 
                        return true;
@@ -536,13 +536,13 @@ bool W_MineLayer(int req)
                {
                        precache_model("models/flash.md3");
                        precache_model("models/mine.md3");
-                       precache_model("models/weapons/g_minelayer.md3");
-                       precache_model("models/weapons/v_minelayer.md3");
-                       precache_model("models/weapons/h_minelayer.iqm");
-                       precache_sound("weapons/mine_det.wav");
-                       precache_sound("weapons/mine_fire.wav");
-                       precache_sound("weapons/mine_stick.wav");
-                       precache_sound("weapons/mine_trigger.wav");
+                       precache_model(W_Model("g_minelayer.md3"));
+                       precache_model(W_Model("v_minelayer.md3"));
+                       precache_model(W_Model("h_minelayer.iqm"));
+                       precache_sound(W_Sound("mine_det"));
+                       precache_sound(W_Sound("mine_fire"));
+                       precache_sound(W_Sound("mine_stick"));
+                       precache_sound(W_Sound("mine_trigger"));
                        MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -576,7 +576,7 @@ bool W_MineLayer(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(WEP_CVAR(minelayer, ammo), "weapons/reload.wav");
+                       W_Reload(WEP_CVAR(minelayer, ammo), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 9e4912a84bfd0fb98d43f5950d4c1e952f8c7dd1..1bea5edf7b244470f6c7f3828b9e93afc6762c18 100644 (file)
@@ -140,24 +140,24 @@ void W_Mortar_Grenade_Touch1(void)
                float r;
                r = random() * 6;
                if(r < 1)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce1"), VOL_BASE, ATTN_NORM);
                else if(r < 2)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce2"), VOL_BASE, ATTN_NORM);
                else if(r < 3)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce3"), VOL_BASE, ATTN_NORM);
                else if(r < 4)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce4"), VOL_BASE, ATTN_NORM);
                else if(r < 5)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM);
                else
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM);
                Send_Effect("hagar_bounce", self.origin, self.velocity, 1);
                self.projectiledeathtype |= HITTYPE_BOUNCE;
                self.gl_bouncecnt += 1;
        }
        else if(WEP_CVAR_PRI(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
-               spamsound(self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+               spamsound(self, CH_SHOTS, W_Sound("grenade_stick"), VOL_BASE, ATTN_NORM);
 
                // let it stick whereever it is
                self.oldvelocity = self.velocity;
@@ -185,17 +185,17 @@ void W_Mortar_Grenade_Touch2(void)
                float r;
                r = random() * 6;
                if(r < 1)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce1"), VOL_BASE, ATTN_NORM);
                else if(r < 2)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce2"), VOL_BASE, ATTN_NORM);
                else if(r < 3)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce3"), VOL_BASE, ATTN_NORM);
                else if(r < 4)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce4"), VOL_BASE, ATTN_NORM);
                else if(r < 5)
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM);
                else
-                       spamsound(self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+                       spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM);
                Send_Effect("hagar_bounce", self.origin, self.velocity, 1);
                self.projectiledeathtype |= HITTYPE_BOUNCE;
                self.gl_bouncecnt += 1;
@@ -206,7 +206,7 @@ void W_Mortar_Grenade_Touch2(void)
        }
        else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
-               spamsound(self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+               spamsound(self, CH_SHOTS, W_Sound("grenade_stick"), VOL_BASE, ATTN_NORM);
 
                // let it stick whereever it is
                self.oldvelocity = self.velocity;
@@ -228,7 +228,7 @@ void W_Mortar_Attack(void)
 
        W_DecreaseAmmo(WEP_CVAR_PRI(mortar, ammo));
 
-       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
+       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        Send_Effect("grenadelauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
@@ -277,7 +277,7 @@ void W_Mortar_Attack2(void)
 
        W_DecreaseAmmo(WEP_CVAR_SEC(mortar, ammo));
 
-       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
+       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        Send_Effect("grenadelauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
@@ -392,7 +392,7 @@ bool W_Mortar(int req)
                                                }
                                        }
                                        if(nadefound)
-                                               sound(self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+                                               sound(self, CH_WEAPON_B, W_Sound("rocket_det"), VOL_BASE, ATTN_NORM);
                                }
                                else if(weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire)))
                                {
@@ -405,17 +405,17 @@ bool W_Mortar(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_gl.md3");
-                       precache_model("models/weapons/v_gl.md3");
-                       precache_model("models/weapons/h_gl.iqm");
-                       precache_sound("weapons/grenade_bounce1.wav");
-                       precache_sound("weapons/grenade_bounce2.wav");
-                       precache_sound("weapons/grenade_bounce3.wav");
-                       precache_sound("weapons/grenade_bounce4.wav");
-                       precache_sound("weapons/grenade_bounce5.wav");
-                       precache_sound("weapons/grenade_bounce6.wav");
-                       precache_sound("weapons/grenade_stick.wav");
-                       precache_sound("weapons/grenade_fire.wav");
+                       precache_model(W_Model("g_gl.md3"));
+                       precache_model(W_Model("v_gl.md3"));
+                       precache_model(W_Model("h_gl.iqm"));
+                       precache_sound(W_Sound("grenade_bounce1"));
+                       precache_sound(W_Sound("grenade_bounce2"));
+                       precache_sound(W_Sound("grenade_bounce3"));
+                       precache_sound(W_Sound("grenade_bounce4"));
+                       precache_sound(W_Sound("grenade_bounce5"));
+                       precache_sound(W_Sound("grenade_bounce6"));
+                       precache_sound(W_Sound("grenade_stick"));
+                       precache_sound(W_Sound("grenade_fire"));
                        MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -438,7 +438,7 @@ bool W_Mortar(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), "weapons/reload.wav"); // WEAPONTODO
+                       W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), W_Sound("reload")); // WEAPONTODO
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index e604b616446bbb6535da616725136bb77ef8e25f..6d31708b43535fd7a08b2db741a72ecbb798543b 100644 (file)
@@ -369,11 +369,17 @@ bool W_Porto(int req)
 
                        return true;
                }
+               case WR_CHECKAMMO1:
+               case WR_CHECKAMMO2:
+               {
+                       // always allow infinite ammo
+                       return true;
+               }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_porto.md3");
-                       precache_model("models/weapons/v_porto.md3");
-                       precache_model("models/weapons/h_porto.iqm");
+                       precache_model(W_Model("g_porto.md3"));
+                       precache_model(W_Model("v_porto.md3"));
+                       precache_model(W_Model("h_porto.iqm"));
                        precache_model("models/portal.md3");
                        precache_sound("porto/bounce.wav");
                        precache_sound("porto/create.wav");
index 17c7ae3c2a152a1bdcd783d06b5d5c90f1fe932e..687a20cf4894e7f6cb26e1af3b20ccc296846f28 100644 (file)
@@ -76,12 +76,12 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolid
 
 void W_Rifle_Attack(void)
 {
-       W_Rifle_FireBullet(WEP_CVAR_PRI(rifle, spread), WEP_CVAR_PRI(rifle, damage), WEP_CVAR_PRI(rifle, force), WEP_CVAR_PRI(rifle, solidpenetration), WEP_CVAR_PRI(rifle, ammo), WEP_RIFLE.m_id, WEP_CVAR_PRI(rifle, tracer), WEP_CVAR_PRI(rifle, shots), "weapons/campingrifle_fire.wav");
+       W_Rifle_FireBullet(WEP_CVAR_PRI(rifle, spread), WEP_CVAR_PRI(rifle, damage), WEP_CVAR_PRI(rifle, force), WEP_CVAR_PRI(rifle, solidpenetration), WEP_CVAR_PRI(rifle, ammo), WEP_RIFLE.m_id, WEP_CVAR_PRI(rifle, tracer), WEP_CVAR_PRI(rifle, shots), W_Sound("campingrifle_fire"));
 }
 
 void W_Rifle_Attack2(void)
 {
-       W_Rifle_FireBullet(WEP_CVAR_SEC(rifle, spread), WEP_CVAR_SEC(rifle, damage), WEP_CVAR_SEC(rifle, force), WEP_CVAR_SEC(rifle, solidpenetration), WEP_CVAR_SEC(rifle, ammo), WEP_RIFLE.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(rifle, tracer), WEP_CVAR_SEC(rifle, shots), "weapons/campingrifle_fire2.wav");
+       W_Rifle_FireBullet(WEP_CVAR_SEC(rifle, spread), WEP_CVAR_SEC(rifle, damage), WEP_CVAR_SEC(rifle, force), WEP_CVAR_SEC(rifle, solidpenetration), WEP_CVAR_SEC(rifle, ammo), WEP_RIFLE.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(rifle, tracer), WEP_CVAR_SEC(rifle, shots), W_Sound("campingrifle_fire2"));
 }
 
 .void(void) rifle_bullethail_attackfunc;
@@ -204,11 +204,11 @@ bool W_Rifle(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_campingrifle.md3");
-                       precache_model("models/weapons/v_campingrifle.md3");
-                       precache_model("models/weapons/h_campingrifle.iqm");
-                       precache_sound("weapons/campingrifle_fire.wav");
-                       precache_sound("weapons/campingrifle_fire2.wav");
+                       precache_model(W_Model("g_sniperrifle.md3"));
+                       precache_model(W_Model("v_sniperrifle.md3"));
+                       precache_model(W_Model("h_sniperrifle.iqm"));
+                       precache_sound(W_Sound("campingrifle_fire"));
+                       precache_sound(W_Sound("campingrifle_fire2"));
                        RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -236,7 +236,7 @@ bool W_Rifle(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 87ad16f5c67e90545c1b8e2cfecb35dc75fb6ed6..f879fdd64f45d4b059cb6a57a545d687457f1f93 100644 (file)
@@ -108,7 +108,7 @@ void W_RocketPropelledChainsaw_Attack (void)
        entity flash = spawn ();
 
        W_DecreaseAmmo(WEP_CVAR(rpc, ammo));
-       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(rpc, damage));
+       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, W_Sound("rocket_fire"), CH_WEAPON_A, WEP_CVAR(rpc, damage));
        Send_Effect("rocketlauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
        PROJECTILE_MAKETRIGGER(missile);
 
@@ -183,10 +183,10 @@ bool W_RocketPropelledChainsaw(int req)
                case WR_INIT:
                {
                        precache_model ("models/flash.md3");
-                       precache_model("models/weapons/h_ok_rl.iqm");
-                       precache_model("models/weapons/v_ok_rl.md3");
-                       precache_model("models/weapons/g_ok_rl.md3");
-                       precache_sound ("weapons/rocket_fire.wav");
+                       precache_model(W_Model("g_ok_rl.md3"));
+                       precache_model(W_Model("v_ok_rl.md3"));
+                       precache_model(W_Model("h_ok_rl.iqm"));
+                       precache_sound (W_Sound("rocket_fire"));
                        RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -207,7 +207,7 @@ bool W_RocketPropelledChainsaw(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(WEP_CVAR(rpc, ammo), "weapons/reload.wav");
+                       W_Reload(WEP_CVAR(rpc, ammo), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 313d5defd9f6ff9baeb05932acdd69cee66d7520..f94984daa3b265ca99703c28848e71663c3283bd 100644 (file)
@@ -250,7 +250,7 @@ void W_Seeker_Fire_Missile(vector f_diff, entity m_target)
        W_DecreaseAmmo(WEP_CVAR(seeker, missile_ammo));
 
        makevectors(self.v_angle);
-       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
+       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, W_Sound("seeker_fire.wav"), CH_WEAPON_A, 0);
        w_shotorg += f_diff;
        Send_Effect("seeker_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
 
@@ -341,7 +341,7 @@ void W_Seeker_Fire_Flac(void)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, "weapons/flac_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
+       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, W_Sound("flac_fire"), CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
        w_shotorg += f_diff;
 
        Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1);
@@ -560,7 +560,7 @@ void W_Seeker_Fire_Tag(void)
        entity missile;
        W_DecreaseAmmo(WEP_CVAR(seeker, tag_ammo));
 
-       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
+       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, W_Sound("tag_fire"), CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
 
        missile                 = spawn();
        missile.owner           = missile.realowner = self;
@@ -663,12 +663,12 @@ bool W_Seeker(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_seeker.md3");
-                       precache_model("models/weapons/v_seeker.md3");
-                       precache_model("models/weapons/h_seeker.iqm");
-                       precache_sound("weapons/tag_fire.wav");
-                       precache_sound("weapons/flac_fire.wav");
-                       precache_sound("weapons/seeker_fire.wav");
+                       precache_model(W_Model("g_seeker.md3"));
+                       precache_model(W_Model("v_seeker.md3"));
+                       precache_model(W_Model("h_seeker.iqm"));
+                       precache_sound(W_Sound("tag_fire"));
+                       precache_sound(W_Sound("flac_fire"));
+                       precache_sound(W_Sound("seeker_fire"));
                        SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -707,7 +707,7 @@ bool W_Seeker(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 91961bb18dccbd14b9631e73859c6d6937b748cf..1c5d080d3c38894761fc6b07a64fa755c19adaff 100644 (file)
@@ -229,7 +229,7 @@ void W_Shockwave_Melee_Think(void)
 
 void W_Shockwave_Melee(void)
 {
-       sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
+       sound(self, CH_WEAPON_A, W_Sound("shotgun_melee"), VOL_BASE, ATTN_NORM);
        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
 
        entity meleetemp;
@@ -360,7 +360,7 @@ void W_Shockwave_Attack(void)
        float i, queue = 0;
 
        // set up the shot direction
-       W_SetupShot(self, false, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
+       W_SetupShot(self, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
        vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
        WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, self);
        vector attack_hitpos = trace_endpos;
@@ -709,12 +709,12 @@ bool W_Shockwave(int req)
                case WR_INIT:
                {
                        precache_model("models/uziflash.md3");
-                       precache_model("models/weapons/g_shotgun.md3");
-                       precache_model("models/weapons/v_shotgun.md3");
-                       precache_model("models/weapons/h_shotgun.iqm");
+                       precache_model(W_Model("g_shotgun.md3"));
+                       precache_model(W_Model("v_shotgun.md3"));
+                       precache_model(W_Model("h_shotgun.iqm"));
                        precache_sound("misc/itempickup.wav");
-                       precache_sound("weapons/lasergun_fire.wav");
-                       precache_sound("weapons/shotgun_melee.wav");
+                       precache_sound(W_Sound("lasergun_fire"));
+                       precache_sound(W_Sound("shotgun_melee"));
                        SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index d93e9dd3f9fd1627685e370801cb10f72e6b303e..76738a98a604d701354c3108f6388045b4e86642 100644 (file)
@@ -61,7 +61,7 @@ void W_Shotgun_Attack(float isprimary)
 
        W_DecreaseAmmo(WEP_CVAR_PRI(shotgun, ammo));
 
-       W_SetupShot(self, true, 5, "weapons/shotgun_fire.wav", ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
+       W_SetupShot(self, true, 5, W_Sound("shotgun_fire"), ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
        for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
                fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
 
@@ -181,7 +181,7 @@ void W_Shotgun_Melee_Think(void)
 
 void W_Shotgun_Attack2(void)
 {
-       sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_WEAPON_A, W_Sound("shotgun_melee"), VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
 
        entity meleetemp;
@@ -287,12 +287,12 @@ float W_Shotgun(float req)
                case WR_INIT:
                {
                        precache_model("models/uziflash.md3");
-                       precache_model("models/weapons/g_shotgun.md3");
-                       precache_model("models/weapons/v_shotgun.md3");
-                       precache_model("models/weapons/h_shotgun.iqm");
+                       precache_model(W_Model("g_shotgun.md3"));
+                       precache_model(W_Model("v_shotgun.md3"));
+                       precache_model(W_Model("h_shotgun.iqm"));
                        precache_sound("misc/itempickup.wav");
-                       precache_sound("weapons/shotgun_fire.wav");
-                       precache_sound("weapons/shotgun_melee.wav");
+                       precache_sound(W_Sound("shotgun_fire"));
+                       precache_sound(W_Sound("shotgun_melee"));
                        SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -331,7 +331,7 @@ float W_Shotgun(float req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(WEP_CVAR_PRI(shotgun, ammo), "weapons/reload.wav"); // WEAPONTODO
+                       W_Reload(WEP_CVAR_PRI(shotgun, ammo), W_Sound("reload")); // WEAPONTODO
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 86fcca34681630d81b4b3da73a9a402e79674e0a..bd9dff50e743e3703b2e75f21c22ef5bf379118c 100644 (file)
@@ -417,13 +417,13 @@ bool W_Tuba(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_tuba.md3");
-                       precache_model("models/weapons/v_tuba.md3");
-                       precache_model("models/weapons/h_tuba.iqm");
-                       precache_model("models/weapons/v_akordeon.md3");
-                       precache_model("models/weapons/h_akordeon.iqm");
-                       precache_model("models/weapons/v_kleinbottle.md3");
-                       precache_model("models/weapons/h_kleinbottle.iqm");
+                       precache_model(W_Model("g_tuba.md3"));
+                       precache_model(W_Model("v_tuba.md3"));
+                       precache_model(W_Model("h_tuba.iqm"));
+                       precache_model(W_Model("v_akordeon.md3"));
+                       precache_model(W_Model("h_akordeon.iqm"));
+                       precache_model(W_Model("v_kleinbottle.md3"));
+                       precache_model(W_Model("h_kleinbottle.iqm"));
                        TUBA_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index da94149009fc835cc1e09b6ffea1a66d42aa4c46..9e4f08d405b0cc61cb6fb8d0ecd307dbca9d0c9a 100644 (file)
@@ -60,7 +60,7 @@ void W_Vaporizer_Attack(void)
        W_SetupShot(self, true, 0, "", CH_WEAPON_A, 10000);
        // handle sound separately so we can change the volume
        // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
-       sound (self, CH_WEAPON_A, "weapons/minstanexfire.wav", VOL_BASE * 0.8, ATTEN_NORM);
+       sound (self, CH_WEAPON_A, W_Sound("minstanexfire"), VOL_BASE * 0.8, ATTEN_NORM);
 
        yoda = 0;
        damage_goodhits = 0;
@@ -191,13 +191,13 @@ float W_Vaporizer(float req)
                case WR_INIT:
                {
                        precache_model("models/nexflash.md3");
-                       precache_model("models/weapons/g_minstanex.md3");
-                       precache_model("models/weapons/v_minstanex.md3");
-                       precache_model("models/weapons/h_minstanex.iqm");
-                       precache_sound("weapons/minstanexfire.wav");
-                       precache_sound("weapons/nexwhoosh1.wav");
-                       precache_sound("weapons/nexwhoosh2.wav");
-                       precache_sound("weapons/nexwhoosh3.wav");
+                       precache_model(W_Model("g_minstanex.md3"));
+                       precache_model(W_Model("v_minstanex.md3"));
+                       precache_model(W_Model("h_minstanex.iqm"));
+                       precache_sound(W_Sound("minstanexfire"));
+                       precache_sound(W_Sound("nexwhoosh1"));
+                       precache_sound(W_Sound("nexwhoosh2"));
+                       precache_sound(W_Sound("nexwhoosh3"));
                        //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
                        VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
@@ -240,7 +240,7 @@ float W_Vaporizer(float req)
                        else
                                used_ammo = vaporizer_ammo;
 
-                       W_Reload(used_ammo, "weapons/reload.wav");
+                       W_Reload(used_ammo, W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index 0b0dc301397483be22d605ee17381e4a7c9d5736..616bf89d77902da0c6ecadb0afd2c29f9aa9ce4c 100644 (file)
@@ -103,10 +103,10 @@ void W_Vortex_Attack(float issecondary)
        mydmg *= charge;
        myforce *= charge;
 
-       W_SetupShot(self, true, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
+       W_SetupShot(self, true, 5, W_Sound("nexfire"), CH_WEAPON_A, mydmg);
        if(charge > WEP_CVAR(vortex, charge_animlimit) && WEP_CVAR(vortex, charge_animlimit)) // if the Vortex is overcharged, we play an extra sound
        {
-               sound(self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM);
+               sound(self, CH_WEAPON_B, W_Sound("nexcharge"), VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM);
        }
 
        yoda = 0;
@@ -254,14 +254,14 @@ bool W_Vortex(int req)
                case WR_INIT:
                {
                        precache_model("models/nexflash.md3");
-                       precache_model("models/weapons/g_nex.md3");
-                       precache_model("models/weapons/v_nex.md3");
-                       precache_model("models/weapons/h_nex.iqm");
-                       precache_sound("weapons/nexfire.wav");
-                       precache_sound("weapons/nexcharge.wav");
-                       precache_sound("weapons/nexwhoosh1.wav");
-                       precache_sound("weapons/nexwhoosh2.wav");
-                       precache_sound("weapons/nexwhoosh3.wav");
+                       precache_model(W_Model("g_nex.md3"));
+                       precache_model(W_Model("v_nex.md3"));
+                       precache_model(W_Model("h_nex.iqm"));
+                       precache_sound(W_Sound("nexfire"));
+                       precache_sound(W_Sound("nexcharge"));
+                       precache_sound(W_Sound("nexwhoosh1"));
+                       precache_sound(W_Sound("nexwhoosh2"));
+                       precache_sound(W_Sound("nexwhoosh3"));
                        VORTEX_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -302,7 +302,7 @@ bool W_Vortex(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
index cb19c007a7375dc29f879c2068f5fe222cc89323..502340fd99e398f35946b9e8adc0194224065efa 100644 (file)
@@ -283,7 +283,7 @@ float CheatImpulse(float i)
                                e = self;
 
                        Send_Effect("rocket_explode", e.origin, '0 0 0', 1);
-                       sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+                       sound(e, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
 
                        e2 = spawn();
                        setorigin(e2, e.origin);
index 71c32df3989edf357f88fe4e69cdba0d38bc61b9..866f71f72e0e3fa6674a8e0ea9af48f5e316cde9 100644 (file)
@@ -91,7 +91,7 @@ void GrapplingHookThink();
 void GrapplingHook_Stop()
 {
        Send_Effect("grapple_impact", self.origin, '0 0 0', 1);
-       sound (self, CH_SHOTS, "weapons/hook_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound (self, CH_SHOTS, W_Sound("hook_impact"), VOL_BASE, ATTEN_NORM);
 
        self.state = 1;
        self.think = GrapplingHookThink;
@@ -327,7 +327,7 @@ void FireGrapplingHook (void)
        vs = hook_shotorigin[s];
 
        // UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds
-       sound (self, CH_WEAPON_B, "weapons/hook_fire.wav", VOL_BASE, ATTEN_NORM);
+       sound (self, CH_WEAPON_B, W_Sound("hook_fire"), VOL_BASE, ATTEN_NORM);
        org = self.origin + self.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
 
        tracebox(self.origin + self.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, self);
index 88744acc0bef389f8a4e3afecf9db9173757c791..e757e017294f1a92eee6ff8b67010808075812b8 100644 (file)
@@ -1049,15 +1049,15 @@ void precache()
     precache_model ("models/sprites/10.spr32");
 
     // common weapon precaches
-       precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound here
-    precache_sound ("weapons/weapon_switch.wav");
-    precache_sound ("weapons/weaponpickup.wav");
-    precache_sound ("weapons/unavailable.wav");
-    precache_sound ("weapons/dryfire.wav");
+       precache_sound (W_Sound("reload")); // until weapons have individual reload sounds, precache the reload sound here
+    precache_sound (W_Sound("weapon_switch"));
+    precache_sound (W_Sound("weaponpickup"));
+    precache_sound (W_Sound("unavailable"));
+    precache_sound (W_Sound("dryfire"));
     if (g_grappling_hook)
     {
-        precache_sound ("weapons/hook_fire.wav"); // hook
-        precache_sound ("weapons/hook_impact.wav"); // hook
+        precache_sound (W_Sound("hook_fire")); // hook
+        precache_sound (W_Sound("hook_impact")); // hook
     }
 
     precache_model("models/elaser.mdl");
index 01cdd168f797e454d6af7398b470627cc46adda1..0f93f2ebfaa2f94037cfec79a0128abd0f0fab06 100644 (file)
@@ -56,13 +56,33 @@ entity frag_target;
 int frag_deathtype;
 MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies);
 
-/** called when a player dies to e.g. remove stuff he was carrying. */
+/** called when a player dies to e.g. remove stuff he was carrying */
 #define EV_PlayHitsound(i, o) \
     /**/ i(entity, frag_victim) \
     /**/
 entity frag_victim;
 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
 
+/** called when a weapon sound is about to be played, allows custom paths etc. */
+#define EV_WeaponSound(i, o) \
+    /**/ i(string, weapon_sound) \
+    /**/ i(string, weapon_sound_output) \
+    /**/ o(string, weapon_sound_output) \
+    /**/
+string weapon_sound;
+string weapon_sound_output;
+MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
+
+/** called when a weapon model is about to be set, allows custom paths etc. */
+#define EV_WeaponModel(i, o) \
+    /**/ i(string, weapon_model) \
+    /**/ i(string, weapon_model_output) \
+    /**/ o(string, weapon_model_output) \
+    /**/
+string weapon_model;
+string weapon_model_output;
+MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);
+
 /** called when a player presses the jump key */
 #define EV_PlayerJump(i, o) \
     /**/ i(float, player_multijump) \
index fb6e0c10eecd7fe2557c70760f38201d31991cf7..9b356404dca9948803c46081013acd7a7540a5fa 100644 (file)
@@ -396,7 +396,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag
 
        if (self.health < 0)
        {
-               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
+               sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM);
                pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
                Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(self.team, INFO_ONSLAUGHT_CPDESTROYED_), self.owner.message, attacker.netname);
 
@@ -782,7 +782,7 @@ void ons_ControlPoint_Setup(entity cp)
        precache_model("models/onslaught/controlpoint_icon_gib4.md3");
        precache_sound("onslaught/controlpoint_build.wav");
        precache_sound("onslaught/controlpoint_built.wav");
-       precache_sound("weapons/grenade_impact.wav");
+       precache_sound(W_Sound("grenade_impact"));
        precache_sound("onslaught/damageblockedbyshield.wav");
        precache_sound("onslaught/controlpoint_underattack.wav");
        precache_sound("onslaught/ons_spark1.wav");
@@ -918,7 +918,7 @@ void ons_GeneratorDamage(entity inflictor, entity attacker, float damage, int de
        // Throw some flaming gibs on damage, more damage = more chance for gib
        if(random() < damage/220)
        {
-               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+               sound(self, CH_TRIGGER, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
        }
        else
        {
@@ -1042,8 +1042,8 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o
        precache_model("models/onslaught/gen_gib2.md3");
        precache_model("models/onslaught/gen_gib3.md3");
        precache_sound("onslaught/generator_decay.wav");
-       precache_sound("weapons/grenade_impact.wav");
-       precache_sound("weapons/rocket_impact.wav");
+       precache_sound(W_Sound("grenade_impact"));
+       precache_sound(W_Sound("rocket_impact"));
        precache_sound("onslaught/generator_underattack.wav");
        precache_sound("onslaught/shockwave.wav");
        precache_sound("onslaught/ons_hit1.wav");
index f144899c8d86a1da4d761cb34309f0c2f1f30ffd..f6a881f7b667a83994d31627b3dc013709dbccea 100644 (file)
@@ -954,7 +954,7 @@ void buffs_Initialize()
        precache_sound("misc/strength_respawn.wav");
        precache_sound("misc/shield_respawn.wav");
        precache_sound("relics/relic_effect.wav");
-       precache_sound("weapons/rocket_impact.wav");
+       precache_sound(W_Sound("rocket_impact"));
        precache_sound("keepaway/respawn.wav");
 
        addstat(STAT_BUFFS, AS_INT, buffs);
index 9f2b2d3021e38beaef9a2844314559a452511124..a3949dab6727d53f86891900f23a61147c6057f8 100644 (file)
@@ -121,7 +121,7 @@ void nade_napalm_ball()
        entity proj;
        vector kick;
 
-       spamsound(self, CH_SHOTS, "weapons/fireball_fire.wav", VOL_BASE, ATTEN_NORM);
+       spamsound(self, CH_SHOTS, W_Sound("fireball_fire"), VOL_BASE, ATTEN_NORM);
 
        proj = spawn ();
        proj.owner = self.owner;
@@ -260,7 +260,7 @@ void nade_ice_think()
                                default:                 expef = "nade_neutral_explode"; break;
                        }
                        Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
-                       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+                       sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
 
                        RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
                                autocvar_g_nades_nade_radius, self, world, autocvar_g_nades_nade_force, self.projectiledeathtype, self.enemy);
@@ -533,7 +533,7 @@ void nade_boom()
                Send_Effect(expef, findbetterlocation(self.origin, 8), '0 0 0', 1);
 
        sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
-       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
 
        self.event_damage = func_null; // prevent somehow calling damage in the next call
 
@@ -577,7 +577,7 @@ void nade_touch()
        //UpdateCSQCProjectile(self);
        if(self.health == self.max_health)
        {
-               spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTEN_NORM);
+               spamsound(self, CH_SHOTS, W_Sound(strcat("grenade_bounce", ftos(1 + rint(random() * 5)))), VOL_BASE, ATTEN_NORM);
                return;
        }
 
@@ -1193,13 +1193,13 @@ void nades_Initialize()
        precache_model("models/weapons/v_ok_grenade.md3");
        precache_model("models/ctf/shield.md3");
 
-       precache_sound("weapons/rocket_impact.wav");
-       precache_sound("weapons/grenade_bounce1.wav");
-       precache_sound("weapons/grenade_bounce2.wav");
-       precache_sound("weapons/grenade_bounce3.wav");
-       precache_sound("weapons/grenade_bounce4.wav");
-       precache_sound("weapons/grenade_bounce5.wav");
-       precache_sound("weapons/grenade_bounce6.wav");
+       precache_sound(W_Sound("rocket_impact"));
+       precache_sound(W_Sound("grenade_bounce1"));
+       precache_sound(W_Sound("grenade_bounce2"));
+       precache_sound(W_Sound("grenade_bounce3"));
+       precache_sound(W_Sound("grenade_bounce4"));
+       precache_sound(W_Sound("grenade_bounce5"));
+       precache_sound(W_Sound("grenade_bounce6"));
        precache_sound("overkill/grenadebip.ogg");
 }
 
index 78875cb70f20227bbdb1d995cfc982522e05717c..edbdc8aa826f622c62f22fca792285ce9e367154 100644 (file)
@@ -190,7 +190,7 @@ MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace)
 MUTATOR_HOOKFUNCTION(nt_FilterItem)
 {
        if(nt_IsNewToy(self.weapon))
-               self.item_pickupsound = "weapons/weaponpickup_new_toys.wav";
+               self.item_pickupsound = W_Sound("weaponpickup_new_toys");
        return 0;
 }
 
@@ -206,7 +206,7 @@ MUTATOR_DEFINITION(mutator_new_toys)
                if(time > 1) // game loads at time 1
                        error("This cannot be added at runtime\n");
 
-               precache_sound("weapons/weaponpickup_new_toys.wav");
+               precache_sound(W_Sound("weaponpickup_new_toys"));
 
                // mark the guns as ok to use by e.g. impulse 99
                float i;
index c975cda155a09ae5b75bc913d17b8ebf7a1ccbe0..22056662077375f25ad476a60238030fd10bedf5 100644 (file)
@@ -175,7 +175,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
                {
                        //Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_OVERKILL_CHARGE);
                        self.ok_notice_time = time + 2;
-                       play2(self, "weapons/dryfire.wav");
+                       play2(self, W_Sound("dryfire"));
                }
                if(self.weaponentity.state != WS_CLEAR)
                        w_ready();
@@ -329,7 +329,7 @@ void ok_Initialize()
        precache_model("models/weapons/v_ok_sniper.md3");
        precache_model("models/weapons/g_ok_sniper.md3");
 
-       precache_sound("weapons/dryfire.wav");
+       precache_sound(W_Sound("dryfire"));
 
        addstat(STAT_OK_AMMO_CHARGE, AS_FLOAT, ok_use_ammocharge);
        addstat(STAT_OK_AMMO_CHARGEPOOL, AS_FLOAT, ok_ammo_charge);
index 5d3dda20d687e999bbef5cae3214d8976dbdf40c..5ceeff34b5f4ab365744a9c8d999e7fe6036fedd 100644 (file)
@@ -10,7 +10,7 @@ void PlayerTouchExplode(entity p1, entity p2)
        org = (p1.origin + p2.origin) * 0.5;
        org.z += (p1.mins.z + p2.mins.z) * 0.5;
 
-       sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM);
        Send_Effect("explosion_small", org, '0 0 0', 1);
 
        entity e;
index 7d173d73a87d89011c920495adb1f6a4d64dcd12..18d8c19aa562f2667ae669e4ce3249c5cb9480d4 100644 (file)
@@ -1520,7 +1520,7 @@ void spawnfunc_item_health25() { spawnfunc_item_health_medium(); }
 void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
 
 void spawnfunc_item_strength (void) {
-               precache_sound("weapons/strength_fire.wav");
+               precache_sound(W_Sound("strength_fire"));
                if(!self.strength_finished)
                        self.strength_finished = autocvar_g_balance_powerup_strength_time;
                StartItemA (ITEM_Strength);
@@ -1578,7 +1578,7 @@ void spawnfunc_target_items (void)
        precache_sound("misc/armor25.wav");
        precache_sound("misc/powerup.wav");
        precache_sound("misc/poweroff.wav");
-       precache_sound("weapons/weaponpickup.wav");
+       precache_sound(W_Sound("weaponpickup"));
 
        n = tokenize_console(self.netname);
        if(argv(0) == "give")
@@ -1988,7 +1988,7 @@ float GiveItems(entity e, float beginarg, float endarg)
                wi = get_weaponinfo(j);
                if(wi.weapon)
                {
-                       POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null);
+                       POSTGIVE_WEAPON(e, j, W_Sound("weaponpickup"), string_null);
                        if (!(save_weapons & WepSet_FromWeapon(j)))
                                if(e.weapons & WepSet_FromWeapon(j))
                                        WEP_ACTION(wi.weapon, WR_INIT);
index 8e19fb53df96d98cb53e5e7268d35df714669239..8c3c883815e80816849267c47e37180769432d79 100644 (file)
@@ -32,7 +32,7 @@ void W_PlayStrengthSound(entity player) // void W_PlayStrengthSound
                && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
                || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
                {
-                       sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTEN_NORM);
+                       sound(player, CH_TRIGGER, W_Sound("strength_fire"), VOL_BASE, ATTEN_NORM);
                        player.prevstrengthsound = time;
                }
                player.prevstrengthsoundattempt = time;
index 868d6b041b0dc9207fa5fbe6920ad6286d04699e..f6882302e433a1074def91289732cd3dfb65a06e 100644 (file)
@@ -66,7 +66,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                                if (complain)
                                if(IS_REAL_CLIENT(cl))
                                {
-                                       play2(cl, "weapons/unavailable.wav");
+                                       play2(cl, W_Sound("unavailable"));
                                        Send_WeaponComplain (cl, wpn, 0);
                                }
                                return false;
@@ -109,7 +109,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                        Send_WeaponComplain (cl, wpn, 2);
                }
 
-               play2(cl, "weapons/unavailable.wav");
+               play2(cl, W_Sound("unavailable"));
        }
        return false;
 }
index 8e7810bbb117de338ed62dc6a32e6684466e8f1e..d6d158f49b44702c53bda89a849e33ea9229de08 100644 (file)
@@ -179,7 +179,7 @@ void weapon_defaultspawnfunc(float wpn)
        if(self.team)
                f |= FL_NO_WEAPON_STAY;
 
-       StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
+       StartItem(e.model, W_Sound("weaponpickup"), self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
        #if 0 // WEAPONTODO
        if (self.modelindex) // don't precache if self was removed
                WEP_ACTION(e.weapon, WR_INIT);
index 49f6fdde73a51115762ff01f882b42cea485ee40..484ac35be48ae6a459dfd59827175c29cd00437c 100644 (file)
@@ -287,7 +287,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
                        if(f <= 0)
                                continue;
 
-                       snd = strcat("weapons/nexwhoosh", ftos(floor(random() * 3) + 1), ".wav");
+                       snd = W_Sound(strcat("nexwhoosh", ftos(floor(random() * 3) + 1)));
 
                        if(!pseudoprojectile)
                                pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
index d3b11cf184e7a66fcdc2a97668d7db1fd7437d68..fede825675d69c7a78d1f273e91c58d17f6adb4c 100644 (file)
@@ -482,7 +482,7 @@ float weapon_prepareattack_checkammo(float secondary)
 
                if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
                {
-                       sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTEN_NORM);
+                       sound (self, CH_WEAPON_A, W_Sound("dryfire"), VOL_BASE, ATTEN_NORM);
                        self.prevdryfire = time;
                }
 
@@ -740,7 +740,7 @@ void W_WeaponFrame()
                        if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5)
                        {
                        #endif
-                               sound(self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_SINGLE, W_Sound("weapon_switch"), VOL_BASE, ATTN_NORM);
                                self.weaponentity.state = WS_DROP;
                                weapon_thinkf(WFRAME_DONTCHANGE, oldwep.switchdelay_drop, w_clear);
                        #ifndef INDEPENDENT_ATTACK_FINISHED
@@ -935,7 +935,7 @@ void W_Reload(float sent_ammo_min, string sent_sound)
        {
                if(IS_REAL_CLIENT(self) && self.reload_complain < time)
                {
-                       play2(self, "weapons/unavailable.wav");
+                       play2(self, W_Sound("unavailable"));
                        sprint(self, strcat("You don't have enough ammo to reload the ^2", WEP_NAME(self.weapon), "\n"));
                        self.reload_complain = time + 1;
                }