From 5bd24517c387f8ba963cb635eaf8e8d9d92fd154 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Wed, 18 Jan 2023 00:05:19 -0800 Subject: [PATCH] Added basic sounds to WEAPON_DBS and WEAPON_SBS --- src/shared/w_dbs.qc | 17 ++++++++++------- src/shared/w_sbs.qc | 8 +++++--- zpak001.pk3dir/sound/weapons_tfc.sndshd | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/shared/w_dbs.qc b/src/shared/w_dbs.qc index 9399a6b..544070d 100644 --- a/src/shared/w_dbs.qc +++ b/src/shared/w_dbs.qc @@ -34,10 +34,11 @@ w_dbs_precache(void) precache_model("models/v_tfc_shotgun.mdl"); precache_model("models/w_shot2.mdl"); precache_model("models/p_shot2.mdl"); - precache_sound("weapons/sbarrel1.wav"); - precache_sound("weapons/dbarrel1.wav"); - precache_sound("weapons/reload3.wav"); - precache_sound("weapons/scock1.wav"); +#ifdef SERVER + Sound_Precache("weapon_dbs.cock"); + Sound_Precache("weapon_dbs.fire"); + Sound_Precache("weapon_dbs.reload"); +#endif } void @@ -104,17 +105,17 @@ w_dbs_primary(player pl) pl.mag_dbs--; Weapons_ViewAnimation(pl, DBS_FIRE1); Weapons_ViewPunchAngle(pl, [-2,0,0]); - //Weapons_Sound(pl, CHAN_WEAPON, "weapon_mossberg.fire"); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire"); pl.w_attack_next = 0.7f; break; case AUTO_LAST: Weapons_ViewAnimation(pl, DBS_FIRE1); Weapons_ViewPunchAngle(pl, [-2,0,0]); - //Weapons_Sound(pl, CHAN_WEAPON, "weapon_mossberg.fire"); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire"); pl.w_attack_next = 0.7f; break; case AUTO_EMPTY: - //Weapons_Sound(pl, CHAN_WEAPON, "weapon_mossberg.fire_empty"); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire_empty"); pl.w_attack_next = 0.2f; break; } @@ -152,9 +153,11 @@ w_dbs_release(player pl) break; case SHOTGUN_RELOAD: Weapons_ViewAnimation(pl, DBS_ADDSHELL); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.reload"); break; case SHOTGUN_END_RELOAD: Weapons_ViewAnimation(pl, DBS_PUMP); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.cock"); break; } } diff --git a/src/shared/w_sbs.qc b/src/shared/w_sbs.qc index b30fbb5..87d7711 100644 --- a/src/shared/w_sbs.qc +++ b/src/shared/w_sbs.qc @@ -93,17 +93,17 @@ w_sbs_primary(player pl) case AUTO_FIRED: Weapons_ViewAnimation(pl, SBS_FIRE1); Weapons_ViewPunchAngle(pl, [-2,0,0]); - //Weapons_Sound(pl, CHAN_WEAPON, "weapon_mossberg.fire"); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire"); pl.w_attack_next = 0.5f; break; case AUTO_LAST: Weapons_ViewAnimation(pl, SBS_FIRE1); Weapons_ViewPunchAngle(pl, [-2,0,0]); - //Weapons_Sound(pl, CHAN_WEAPON, "weapon_mossberg.fire"); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire"); pl.w_attack_next = 0.5f; break; case AUTO_EMPTY: - //Weapons_Sound(pl, CHAN_WEAPON, "weapon_mossberg.fire_empty"); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire_empty"); pl.w_attack_next = 0.2f; break; } @@ -141,9 +141,11 @@ w_sbs_release(player pl) break; case SHOTGUN_RELOAD: Weapons_ViewAnimation(pl, SBS_ADDSHELL); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.reload"); break; case SHOTGUN_END_RELOAD: Weapons_ViewAnimation(pl, SBS_PUMP); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.cock"); break; } } diff --git a/zpak001.pk3dir/sound/weapons_tfc.sndshd b/zpak001.pk3dir/sound/weapons_tfc.sndshd index 65f9f3d..e8cd106 100644 --- a/zpak001.pk3dir/sound/weapons_tfc.sndshd +++ b/zpak001.pk3dir/sound/weapons_tfc.sndshd @@ -1,8 +1,26 @@ + + weapon_dbs.fire { sample weapons/shotgn2.wav } +weapon_dbs.fire +{ + sample weapons/shotgn2.wav +} + +weapon_dbs.cock +{ + sample weapons/scock1.wav +} + +weapon_dbs.reload +{ + sample weapons/reload3.wav +} + + weapon_sbs.cock { sample weapons/scock1.wav