From: TimePath Date: Wed, 23 Sep 2015 07:06:49 +0000 (+1000) Subject: Use the sound list X-Git-Tag: xonotic-v0.8.2~1914^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9a3b01ba5da2726001a5ed74645a15ce764a3675;p=xonotic%2Fxonotic-data.pk3dir.git Use the sound list --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 400ca7387..0c25e6006 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -590,7 +590,7 @@ void CSQCModel_Effects_Apply(void) { if(!self.snd_looping) { - sound(self, CH_TRIGGER_SINGLE, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation); + sound(self, CH_TRIGGER_SINGLE, SND_JETPACK_FLY, VOL_BASE, autocvar_g_jetpack_attenuation); self.snd_looping = CH_TRIGGER_SINGLE; } } @@ -598,7 +598,7 @@ void CSQCModel_Effects_Apply(void) { if(self.snd_looping) { - sound(self, self.snd_looping, "misc/null.wav", VOL_BASE, autocvar_g_jetpack_attenuation); + sound(self, self.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation); self.snd_looping = 0; } } diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index ec6da9842..4f25aef13 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -228,35 +228,33 @@ void Ent_DamageInfo(float isNew) // spiderbot case DEATH_VH_SPID_MINIGUN: - string _snd; - _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2)))); - sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_ROCKET: - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_SPIDERBOT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_DEATH: - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_GUN: - sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_RACER_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_ROCKET: - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_RACER_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_DEATH: - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_CANNON: - sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_RAPTOR_CANNON_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_FRAGMENT: @@ -268,19 +266,19 @@ void Ent_DamageInfo(float isNew) ang = vectoangles(vel); RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i)); } - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_SPREAD), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_BOMB: - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_DEATH: - sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_BUMB_GUN: - sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_BIGPLASMA_IMPACT), self.origin, w_backoff * 1000, 1); break; } @@ -289,7 +287,6 @@ void Ent_DamageInfo(float isNew) if(DEATH_ISTURRET(w_deathtype)) { - string _snd; traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); if(trace_plane_normal != '0 0 0') w_backoff = trace_plane_normal; @@ -301,38 +298,36 @@ void Ent_DamageInfo(float isNew) switch(w_deathtype) { case DEATH_TURRET_EWHEEL: - sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_FLAC: pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), w_org, '0 0 0', 1); - _snd = W_Sound(strcat("hagexp", ftos(1 + rint(random() * 2)))); - sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_HAGEXP_RANDOM(), VOL_BASE, ATTEN_NORM); break; case DEATH_TURRET_MLRS: case DEATH_TURRET_HK: case DEATH_TURRET_WALK_ROCKET: case DEATH_TURRET_HELLION: - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_MACHINEGUN: case DEATH_TURRET_WALK_GUN: - _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2)))); - sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_PLASMA: - sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_WALK_MELEE: - sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum(EFFECT_TE_SPARK), self.origin, w_backoff * 1000, 1); break; diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc index f43b5ed02..148a8f521 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/client/generator.qc @@ -54,7 +54,7 @@ void generator_draw() if(random() < 0.01) { pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1); - sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_ELECTRICITY_EXPLODE, VOL_BASE, ATTEN_NORM); } else pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_DAMAGED), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1); @@ -73,7 +73,7 @@ void generator_draw() // White shockwave if(self.count==40||self.count==20) { - sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_SHOCKWAVE, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), self.origin, '0 0 0', 6); } @@ -94,7 +94,7 @@ void generator_draw() if(random() < 0.25) { te_explosion(self.origin); - sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); } // Particles @@ -107,7 +107,7 @@ void generator_draw() org = self.origin; te_explosion(org); pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE2), org, '0 0 0', 1); - sound(self, CH_TRIGGER, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); } self.move_time = time + 0.05; diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index 63d818054..5c4c338f1 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -85,7 +85,7 @@ void Gib_Touch() } if(!self.silent) - sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTEN_NORM); + sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM); pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10); Gib_Delete(); @@ -218,7 +218,7 @@ void Ent_GibSplash(bool isNew) { case 0x01: if(!issilent) - sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_PAIN, SND_GIB, VOL_BASE, ATTEN_NORM); if(prandom() < amount) TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent); diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 22ec447d5..dd70c760c 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -44,7 +44,7 @@ void Draw_GrapplingHook() if(self.teleport_time) if(time > self.teleport_time) { - sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); // safeguard + sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); // safeguard self.teleport_time = 0; } @@ -168,7 +168,7 @@ void Draw_GrapplingHook() void Remove_GrapplingHook() {SELFPARAM(); - sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); } void Ent_ReadHook(float bIsNew, float type) @@ -228,7 +228,7 @@ void Ent_ReadHook(float bIsNew, float type) self.drawmask = MASK_NORMAL; break; case ENT_CLIENT_ARC_BEAM: - sound (self, CH_SHOTS_SINGLE, W_Sound("lgbeam_fly"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS_SINGLE, SND_LGBEAM_FLY, VOL_BASE, ATTEN_NORM); break; } } diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 0f4cd950d..2d01f777e 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -771,7 +771,7 @@ void Ent_ReadSpawnEvent(float is_new) } if(autocvar_cl_spawn_event_sound) { - sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_SPAWN, VOL_BASE, ATTEN_NORM); } } } @@ -928,7 +928,7 @@ void Ent_Remove() if(self.snd_looping > 0) { - sound(self, self.snd_looping, "misc/null.wav", VOL_BASE, autocvar_g_jetpack_attenuation); + sound(self, self.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation); self.snd_looping = 0; } diff --git a/qcsrc/client/tuba.qc b/qcsrc/client/tuba.qc index 1acfbd7eb..91ccbba5c 100644 --- a/qcsrc/client/tuba.qc +++ b/qcsrc/client/tuba.qc @@ -65,7 +65,7 @@ void tubasound(entity e, bool restart) if (restart) { snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note); } - sound(e, CH_TUBA_SINGLE, snd1, e.tuba_volume, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation); + _sound(e, CH_TUBA_SINGLE, snd1, e.tuba_volume, e.tuba_attenuate * autocvar_g_balance_tuba_attenuation); } } @@ -79,9 +79,9 @@ void Ent_TubaNote_Think() } self.nextthink = time; if (self.tuba_volume <= 0) { - sound(self, CH_TUBA_SINGLE, "misc/null.wav", 0, 0); + sound(self, CH_TUBA_SINGLE, SND_Null, 0, 0); if (self.enemy) { - sound(self.enemy, CH_TUBA_SINGLE, "misc/null.wav", 0, 0); + sound(self.enemy, CH_TUBA_SINGLE, SND_Null, 0, 0); remove(self.enemy); } remove(self); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 146d322fc..26089f915 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -517,7 +517,7 @@ void UpdateHitsound() // todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary // todo: normalize sound pressure levels? seems unnecessary - sound7(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTN_NONE, pitch_shift * 100, 0); + sound7(world, CH_INFO, SND(HIT), VOL_BASE, ATTN_NONE, pitch_shift * 100, 0); } unaccounted_damage = 0; hitsound_time_prev = time; @@ -527,7 +527,7 @@ void UpdateHitsound() float typehit_time = getstatf(STAT_TYPEHIT_TIME); if (COMPARE_INCREASING(typehit_time, typehit_time_prev) > autocvar_cl_hitsound_antispam_time) { - sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE); + sound(world, CH_INFO, SND_TYPEHIT, VOL_BASE, ATTN_NONE); typehit_time_prev = typehit_time; } } diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 5398870cb..a943f75b3 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -170,7 +170,7 @@ void loopsound(entity e, int ch, string samp, float vol, float attn) if(self.silent) return; - sound(e, ch, samp, vol, attn); + _sound(e, ch, samp, vol, attn); e.snd_looping = ch; } @@ -347,7 +347,7 @@ void Ent_Projectile() { case PROJECTILE_ELECTRO: // only new engines support sound moving with object - loopsound(self, CH_SHOTS_SINGLE, W_Sound("electro_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM); self.mins = '0 0 -4'; self.maxs = '0 0 -4'; self.move_movetype = MOVETYPE_BOUNCE; @@ -357,7 +357,7 @@ void Ent_Projectile() break; case PROJECTILE_RPC: case PROJECTILE_ROCKET: - loopsound(self, CH_SHOTS_SINGLE, W_Sound("rocket_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(ROCKET_FLY), VOL_BASE, ATTEN_NORM); self.mins = '-3 -3 -3'; self.maxs = '3 3 3'; break; @@ -405,12 +405,12 @@ void Ent_Projectile() break; case PROJECTILE_NAPALM_FOUNTAIN: case PROJECTILE_FIREBALL: - loopsound(self, CH_SHOTS_SINGLE, W_Sound("fireball_fly2"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(FIREBALL_FLY2), VOL_BASE, ATTEN_NORM); self.mins = '-16 -16 -16'; self.maxs = '16 16 16'; break; case PROJECTILE_FIREMINE: - loopsound(self, CH_SHOTS_SINGLE, W_Sound("fireball_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(FIREBALL_FLY), VOL_BASE, ATTEN_NORM); self.move_movetype = MOVETYPE_BOUNCE; self.move_touch = func_null; self.mins = '-4 -4 -4'; @@ -425,7 +425,7 @@ void Ent_Projectile() self.maxs = '2 2 2'; break; case PROJECTILE_SEEKER: - loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM); self.mins = '-4 -4 -4'; self.maxs = '4 4 4'; break; @@ -438,17 +438,17 @@ void Ent_Projectile() case PROJECTILE_RAPTORCANNON: break; case PROJECTILE_SPIDERROCKET: - loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM); break; case PROJECTILE_WAKIROCKET: - loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM); break; /* case PROJECTILE_WAKICANNON: break; case PROJECTILE_BUMBLE_GUN: // only new engines support sound moving with object - loopsound(self, CH_SHOTS_SINGLE, W_Sound("electro_fly"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM); self.mins = '0 0 -4'; self.maxs = '0 0 -4'; self.move_movetype = MOVETYPE_BOUNCE; diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 0c99a34f0..534005db9 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -91,7 +91,7 @@ void M_Mage_Attack_Spike_Explode() {SELFPARAM(); self.event_damage = func_null; - sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); self.realowner.mage_spike = world; @@ -258,7 +258,7 @@ void M_Mage_Defend_Heal() void M_Mage_Attack_Push() {SELFPARAM(); - sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_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(EFFECT_TE_EXPLOSION, self.origin, '0 0 0', 1); diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index ea7fbbf7c..55e0f46e9 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -50,7 +50,7 @@ void M_Shambler_Attack_Smash() {SELFPARAM(); makevectors(self.angles); Send_Effect(EFFECT_EXPLOSION_MEDIUM, (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1); - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); // RadiusDamage does NOT support custom starting location, which means we must use this hack... @@ -75,7 +75,7 @@ void M_Shambler_Attack_Lightning_Explode() {SELFPARAM(); entity head; - sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_ELECTRO_IMPACT, '0 0 0', '0 0 0', 1); self.event_damage = func_null; diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index fc4a694fc..f6c3089ce 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -63,7 +63,7 @@ void M_Spider_Attack_Web() {SELFPARAM(); monster_makevectors(self.enemy); - sound(self, CH_SHOTS, W_Sound("electro_fire2"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ELECTRO_FIRE2, VOL_BASE, ATTEN_NORM); entity proj = spawn (); proj.classname = "plasma"; diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 8eab200a6..73e6d9060 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -1085,7 +1085,7 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty self.dmg_time = time; if(sound_allowed(MSG_BROADCAST, attacker) && deathtype != DEATH_DROWN) - spamsound (self, CH_PAIN, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER + spamsound (self, CH_PAIN, SND(BODYIMPACT1), VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER self.velocity += force * self.damageforcescale; diff --git a/qcsrc/common/mutators/mutator/casings.qc b/qcsrc/common/mutators/mutator/casings.qc index 771575c69..7a05c85ea 100644 --- a/qcsrc/common/mutators/mutator/casings.qc +++ b/qcsrc/common/mutators/mutator/casings.qc @@ -63,6 +63,19 @@ void Casing_Draw() } } +SOUND(BRASS1, W_Sound("brass1")); +SOUND(BRASS2, W_Sound("brass2")); +SOUND(BRASS3, W_Sound("brass3")); +Sound SND_BRASS_RANDOM() { + return SOUNDS[SND_BRASS1.m_id + floor(prandom() * 3)]; +} +SOUND(CASINGS1, W_Sound("casings1")); +SOUND(CASINGS2, W_Sound("casings2")); +SOUND(CASINGS3, W_Sound("casings3")); +Sound SND_CASINGS_RANDOM() { + return SOUNDS[SND_CASINGS1.m_id + floor(prandom() * 3)]; +} + void Casing_Touch() {SELFPARAM(); if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) @@ -78,16 +91,14 @@ void Casing_Touch() { if (time >= self.nextthink) { - string s; - int f = floor(prandom() * 3) + 1; - + Sound s; switch (self.state) { case 1: - s = W_Sound(strcat("casings", itos(f))); + s = SND_CASINGS_RANDOM(); break; default: - s = W_Sound(strcat("brass", itos(f))); + s = SND_BRASS_RANDOM(); break; } @@ -163,11 +174,4 @@ MUTATOR_HOOKFUNCTION(casings, CSQC_Parse_TempEntity) RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete); } -SOUND(BRASS1, W_Sound("brass1")); -SOUND(BRASS2, W_Sound("brass2")); -SOUND(BRASS3, W_Sound("brass3")); -SOUND(CASINGS1, W_Sound("casings1")); -SOUND(CASINGS2, W_Sound("casings2")); -SOUND(CASINGS3, W_Sound("casings3")); - #endif diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 626c42c7d..f21956981 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -1286,7 +1286,7 @@ void Local_Notification_sound( )); #endif - sound( + _sound( world, soundchannel, sprintf( diff --git a/qcsrc/common/sounds/sounds.inc b/qcsrc/common/sounds/sounds.inc index 707c66136..0e17504c2 100644 --- a/qcsrc/common/sounds/sounds.inc +++ b/qcsrc/common/sounds/sounds.inc @@ -1,4 +1,5 @@ // Global list of sounds +// TODO: remove uses of _sound string W_Sound(string w_snd); @@ -33,6 +34,9 @@ SOUND(GRENADE_BOUNCE3, W_Sound("grenade_bounce3")); SOUND(GRENADE_BOUNCE4, W_Sound("grenade_bounce4")); SOUND(GRENADE_BOUNCE5, W_Sound("grenade_bounce5")); SOUND(GRENADE_BOUNCE6, W_Sound("grenade_bounce6")); +Sound SND_GRENADE_BOUNCE_RANDOM() { + return SOUNDS[SND_GRENADE_BOUNCE1.m_id + rint(random() * 5)]; +} SOUND(GRENADE_FIRE, W_Sound("grenade_fire")); SOUND(GRENADE_IMPACT, W_Sound("grenade_impact")); SOUND(GRENADE_STICK, W_Sound("grenade_stick")); @@ -42,6 +46,10 @@ SOUND(HAGAR_LOAD, W_Sound("hagar_load")); SOUND(HAGEXP1, W_Sound("hagexp1")); SOUND(HAGEXP2, W_Sound("hagexp2")); SOUND(HAGEXP3, W_Sound("hagexp3")); +Sound SND_HAGEXP_RANDOM() { + return SOUNDS[SND_HAGEXP1.m_id + rint(random() * 2)]; +} + SOUND(HOOKBOMB_FIRE, W_Sound("hookbomb_fire")); SOUND(HOOKBOMB_IMPACT, W_Sound("hookbomb_impact")); SOUND(HOOK_FIRE, W_Sound("hook_fire")); @@ -61,10 +69,18 @@ SOUND(NEXIMPACT, W_Sound("neximpact")); SOUND(NEXWHOOSH1, W_Sound("nexwhoosh1")); SOUND(NEXWHOOSH2, W_Sound("nexwhoosh2")); SOUND(NEXWHOOSH3, W_Sound("nexwhoosh3")); +Sound SND_NEXWHOOSH_RANDOM() { + return SOUNDS[SND_NEXWHOOSH1.m_id + rint(random() * 2)]; +} SOUND(RELOAD, W_Sound("reload")); // until weapons have individual reload sounds, precache the reload sound here + SOUND(RIC1, W_Sound("ric1")); SOUND(RIC2, W_Sound("ric2")); SOUND(RIC3, W_Sound("ric3")); +Sound SND_RIC_RANDOM() { + return SOUNDS[SND_RIC1.m_id + rint(random() * 2)]; +} + SOUND(ROCKET_DET, W_Sound("rocket_det")); SOUND(ROCKET_FIRE, W_Sound("rocket_fire")); SOUND(ROCKET_FLY, W_Sound("rocket_fly")); @@ -89,10 +105,70 @@ SOUND(WEAPONPICKUP, W_Sound("weaponpickup")); SOUND(WEAPONPICKUP_NEW_TOYS, W_Sound("weaponpickup_new_toys")); SOUND(WEAPON_SWITCH, W_Sound("weapon_switch")); +SOUND(CTF_CAPTURE_NEUTRAL, "ctf/capture.ogg"); SOUND(CTF_CAPTURE_RED, "ctf/red_capture.wav"); SOUND(CTF_CAPTURE_BLUE, "ctf/blue_capture.wav"); SOUND(CTF_CAPTURE_YELLOW, "ctf/yellow_capture.ogg"); SOUND(CTF_CAPTURE_PINK, "ctf/pink_capture.ogg"); +Sound SND_CTF_CAPTURE(string teamname) { + switch (teamname) { + case "red": return SND_CTF_CAPTURE_RED; + case "blue": return SND_CTF_CAPTURE_BLUE; + case "yellow": return SND_CTF_CAPTURE_YELLOW; + case "pink": return SND_CTF_CAPTURE_PINK; + } + return SND_CTF_CAPTURE_NEUTRAL; +} + +SOUND(CTF_DROPPED_NEUTRAL, "ctf/neutral_dropped.wav"); +SOUND(CTF_DROPPED_RED, "ctf/red_dropped.wav"); +SOUND(CTF_DROPPED_BLUE, "ctf/blue_dropped.wav"); +SOUND(CTF_DROPPED_YELLOW, "ctf/yellow_dropped.wav"); +SOUND(CTF_DROPPED_PINK, "ctf/pink_dropped.wav"); +Sound SND_CTF_DROPPED(string teamname) { + switch (teamname) { + case "red": return SND_CTF_DROPPED_RED; + case "blue": return SND_CTF_DROPPED_BLUE; + case "yellow": return SND_CTF_DROPPED_YELLOW; + case "pink": return SND_CTF_DROPPED_PINK; + default: return SND_CTF_DROPPED_NEUTRAL; + } +} + +SOUND(CTF_PASS, "ctf/pass.wav"); +SOUND(CTF_RESPAWN, "ctf/flag_respawn.wav"); + +SOUND(CTF_RETURNED_NEUTRAL, "ctf/return.wav"); +SOUND(CTF_RETURNED_RED, "ctf/red_returned.wav"); +SOUND(CTF_RETURNED_BLUE, "ctf/blue_returned.wav"); +SOUND(CTF_RETURNED_YELLOW, "ctf/yellow_returned.wav"); +SOUND(CTF_RETURNED_PINK, "ctf/pink_returned.wav"); +Sound SND_CTF_RETURNED(string teamname) { + switch (teamname) { + case "red": return SND_CTF_RETURNED_RED; + case "blue": return SND_CTF_RETURNED_BLUE; + case "yellow": return SND_CTF_RETURNED_YELLOW; + case "pink": return SND_CTF_RETURNED_PINK; + default: return SND_CTF_RETURNED_NEUTRAL; + } +} + +SOUND(CTF_TAKEN_NEUTRAL, "ctf/neutral_taken.wav"); +SOUND(CTF_TAKEN_RED, "ctf/red_taken.wav"); +SOUND(CTF_TAKEN_BLUE, "ctf/blue_taken.wav"); +SOUND(CTF_TAKEN_YELLOW, "ctf/yellow_taken.wav"); +SOUND(CTF_TAKEN_PINK, "ctf/pink_taken.wav"); +Sound SND_CTF_TAKEN(string teamname) { + switch (teamname) { + case "red": return SND_CTF_TAKEN_RED; + case "blue": return SND_CTF_TAKEN_BLUE; + case "yellow": return SND_CTF_TAKEN_YELLOW; + case "pink": return SND_CTF_TAKEN_PINK; + default: return SND_CTF_TAKEN_NEUTRAL; + } +} + +SOUND(CTF_TOUCH, "ctf/touch.wav"); SOUND(DOM_CLAIM, "domination/claim.wav"); @@ -101,8 +177,17 @@ SOUND(KA_PICKEDUP, "keepaway/pickedup.wav"); SOUND(KA_RESPAWN, "keepaway/respawn.wav"); SOUND(KA_TOUCH, "keepaway/touch.wav"); +SOUND(KH_ALARM, "kh/alarm.wav"); +SOUND(KH_CAPTURE, "kh/capture.wav"); +SOUND(KH_COLLECT, "kh/collect.wav"); +SOUND(KH_DESTROY, "kh/destroy.wav"); +SOUND(KH_DROP, "kh/drop.wav"); + +SOUND(NB_BOUNCE, "nexball/bounce.ogg"); +SOUND(NB_DROP, "nexball/drop.ogg"); SOUND(NB_SHOOT1, "nexball/shoot1.ogg"); SOUND(NB_SHOOT2, "nexball/shoot2.ogg"); +SOUND(NB_STEAL, "nexball/steal.ogg"); SOUND(ONS_CONTROLPOINT_BUILD, "onslaught/controlpoint_build.ogg"); SOUND(ONS_CONTROLPOINT_BUILT, "onslaught/controlpoint_built.ogg"); @@ -130,6 +215,8 @@ SOUND(VEH_ALARM, "vehicles/alarm.wav"); SOUND(VEH_ALARM_SHIELD, "vehicles/alarm_shield.wav"); SOUND(VEH_MISSILE_ALARM, "vehicles/missile_alarm.wav"); +SOUND(VEH_BUMBLEBEE_FIRE, W_Sound("flacexp3")); + SOUND(VEH_RACER_BOOST, "vehicles/racer_boost.wav"); SOUND(VEH_RACER_IDLE, "vehicles/racer_idle.wav"); SOUND(VEH_RACER_MOVE, "vehicles/racer_move.wav"); @@ -171,6 +258,9 @@ SOUND(GIB_SPLAT01, "misc/gib_splat01.wav"); SOUND(GIB_SPLAT02, "misc/gib_splat02.wav"); SOUND(GIB_SPLAT03, "misc/gib_splat03.wav"); SOUND(GIB_SPLAT04, "misc/gib_splat04.wav"); +Sound SND_GIB_SPLAT_RANDOM() { + return SOUNDS[SND_GIB_SPLAT01.m_id + floor(prandom() * 4)]; +} SOUND(HIT, "misc/hit.wav"); SOUND(TYPEHIT, "misc/typehit.wav"); diff --git a/qcsrc/common/sounds/sounds.qh b/qcsrc/common/sounds/sounds.qh index 6b6a8a1ad..e01a1300d 100644 --- a/qcsrc/common/sounds/sounds.qh +++ b/qcsrc/common/sounds/sounds.qh @@ -1,6 +1,19 @@ #ifndef SOUNDS_H #define SOUNDS_H +// Play all sounds via sound7, for access to the extra channels. +// Otherwise, channels 8 to 15 would be blocked for a weird QW feature. +#ifdef SVQC + #define _sound(e, c, s, v, a) do { \ + entity __e = e; \ + if (!sound_allowed(MSG_BROADCAST, __e)) break; \ + sound7(__e, c, s, v, a, 0, 0); \ + } while (0) +#else + #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0) +#endif +#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a) +// Used in places where a string is required #define SND(id) (SND_##id.sound_str()) void RegisterSounds(); diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 0430db2d4..b2a4894a5 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -162,7 +162,7 @@ void func_breakable_behave_restore() self.nextthink = 0; // cancel auto respawn func_breakable_colormod(); if (self.noise1) - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); } void func_breakable_init_for_player(entity player) @@ -207,7 +207,7 @@ void func_breakable_destroy() func_breakable_destroyed(); if(self.noise) - sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); if(self.dmg) RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, world, self.dmg_force, DEATH_HURTTRIGGER, world); diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index 228b3f810..a55f02ef2 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -44,7 +44,7 @@ void button_fire() return; if (self.noise != "") - sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); self.state = STATE_UP; SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, button_wait); diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 8d19a740c..422295fa8 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -87,7 +87,7 @@ void door_blocked() void door_hit_top() {SELFPARAM(); if (self.noise1 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); self.state = STATE_TOP; if (self.spawnflags & DOOR_TOGGLE) return; // don't come down automatically @@ -104,14 +104,14 @@ void door_hit_top() void door_hit_bottom() {SELFPARAM(); if (self.noise1 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); self.state = STATE_BOTTOM; } void door_go_down() {SELFPARAM(); if (self.noise2 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); if (self.max_health) { self.takedamage = DAMAGE_YES; @@ -134,7 +134,7 @@ void door_go_up() } if (self.noise2 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); self.state = STATE_UP; SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, door_hit_top); @@ -180,7 +180,7 @@ float door_check_keys(void) if (other.key_door_messagetime <= time) { - play2(other, "misc/talk.wav"); + play2(other, SND(TALK)); Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_ALSONEED, item_keys_keylist(door.itemkeys)); other.key_door_messagetime = time + 2; } @@ -190,7 +190,7 @@ float door_check_keys(void) // no keys were used if (other.key_door_messagetime <= time) { - play2(other, "misc/talk.wav"); + play2(other, SND(TALK)); Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_NEED, item_keys_keylist(door.itemkeys)); other.key_door_messagetime = time + 2; @@ -202,7 +202,7 @@ float door_check_keys(void) { #ifdef SVQC // door is now unlocked - play2(other, "misc/talk.wav"); + play2(other, SND(TALK)); Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_UNLOCKED); #endif return true; @@ -321,7 +321,7 @@ void door_touch() { if (IS_CLIENT(other)) centerprint(other, self.owner.message); - play2(other, "misc/talk.wav"); + play2(other, SND(TALK)); } #endif } @@ -367,7 +367,7 @@ void door_generic_plat_blocked() void door_rotating_hit_top() {SELFPARAM(); if (self.noise1 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); self.state = STATE_TOP; if (self.spawnflags & DOOR_TOGGLE) return; // don't come down automatically @@ -378,7 +378,7 @@ void door_rotating_hit_top() void door_rotating_hit_bottom() {SELFPARAM(); if (self.noise1 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); if (self.lip==666) // self.lip is used to remember reverse opening direction for door_rotating { self.pos2 = '0 0 0' - self.pos2; @@ -390,7 +390,7 @@ void door_rotating_hit_bottom() void door_rotating_go_down() {SELFPARAM(); if (self.noise2 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); if (self.max_health) { self.takedamage = DAMAGE_YES; @@ -412,7 +412,7 @@ void door_rotating_go_up() return; } if (self.noise2 != "") - sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); self.state = STATE_UP; SUB_CalcAngleMove (self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top); diff --git a/qcsrc/common/triggers/func/door_secret.qc b/qcsrc/common/triggers/func/door_secret.qc index b79322878..5b2cfc5ba 100644 --- a/qcsrc/common/triggers/func/door_secret.qc +++ b/qcsrc/common/triggers/func/door_secret.qc @@ -35,7 +35,7 @@ void fd_secret_use() // Make a sound, wait a little... if (self.noise1 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); self.SUB_NEXTTHINK = self.SUB_LTIME + 0.1; temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 @@ -60,7 +60,7 @@ void fd_secret_use() self.dest2 = self.dest1 + v_forward * self.t_length; SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move1); if (self.noise2 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); } void fd_secret_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) @@ -74,14 +74,14 @@ void fd_secret_move1() self.SUB_NEXTTHINK = self.SUB_LTIME + 1.0; self.think = fd_secret_move2; if (self.noise3 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); } // Start moving sideways w/sound... void fd_secret_move2() {SELFPARAM(); if (self.noise2 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); SUB_CalcMove(self.dest2, TSPEED_LINEAR, self.speed, fd_secret_move3); } @@ -89,7 +89,7 @@ void fd_secret_move2() void fd_secret_move3() {SELFPARAM(); if (self.noise3 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); if (!(self.spawnflags & SECRET_OPEN_ONCE)) { self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait; @@ -101,7 +101,7 @@ void fd_secret_move3() void fd_secret_move4() {SELFPARAM(); if (self.noise2 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move5); } @@ -111,13 +111,13 @@ void fd_secret_move5() self.SUB_NEXTTHINK = self.SUB_LTIME + 1.0; self.think = fd_secret_move6; if (self.noise3 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); } void fd_secret_move6() {SELFPARAM(); if (self.noise2 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM); SUB_CalcMove(self.oldorigin, TSPEED_LINEAR, self.speed, fd_secret_done); } @@ -130,7 +130,7 @@ void fd_secret_done() //self.th_pain = fd_secret_use; } if (self.noise3 != "") - sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM); } void secret_blocked() @@ -161,7 +161,7 @@ void secret_touch() { if (IS_CLIENT(other)) centerprint(other, self.message); - play2(other, "misc/talk.wav"); + play2(other, SND(TALK)); } } diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index 3c11b2a5b..058f1199f 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -230,7 +230,7 @@ void Draw_PointParticles() if(self.noise != "") { setorigin(self, p); - sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten); + _sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten); } self.just_toggled = 0; } diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 4149b538d..187fd3f1b 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -98,7 +98,7 @@ void train_next() } if(self.noise != "") - sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE); + _sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE); } #ifdef SVQC diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index b4f387470..dc568cae0 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -65,7 +65,7 @@ void plat_spawn_inside_trigger() void plat_hit_top() {SELFPARAM(); - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); self.state = 1; self.SUB_THINK = plat_go_down; @@ -74,20 +74,20 @@ void plat_hit_top() void plat_hit_bottom() {SELFPARAM(); - sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM); self.state = 2; } void plat_go_down() {SELFPARAM(); - sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM); self.state = 3; SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom); } void plat_go_up() {SELFPARAM(); - sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM); + _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM); self.state = 4; SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top); } diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 33261eabd..879c30423 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -182,9 +182,9 @@ void TargetMusic_Advance() if(vol != vol0) { if(vol0 < 0) - sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart + _sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart else - sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE); + _sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE); e.lastvol = vol; } } @@ -223,7 +223,7 @@ void Net_TargetMusic() strunzone(e.noise); e.noise = strzone(noi); precache_sound(e.noise); - sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE); + _sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE); if(getsoundtime(e, CH_BGM_SINGLE) < 0) { LOG_TRACEF("Cannot initialize sound %s\n", e.noise); @@ -310,7 +310,7 @@ void Ent_ReadTriggerMusic() if(self.noise != s) { precache_sound(self.noise); - sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE); + _sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE); if(getsoundtime(self, CH_BGM_SINGLE) < 0) { LOG_TRACEF("Cannot initialize sound %s\n", self.noise); diff --git a/qcsrc/common/triggers/target/speaker.qc b/qcsrc/common/triggers/target/speaker.qc index e0701dc14..75f733c09 100644 --- a/qcsrc/common/triggers/target/speaker.qc +++ b/qcsrc/common/triggers/target/speaker.qc @@ -10,9 +10,9 @@ void target_speaker_use_activator() { var .string sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); if(GetPlayerSoundSampleField_notFound) - snd = "misc/null.wav"; + snd = SND(Null); else if(activator.(sample) == "") - snd = "misc/null.wav"; + snd = SND(Null); else { tokenize_console(activator.(sample)); @@ -36,9 +36,9 @@ void target_speaker_use_on() { var .string sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); if(GetPlayerSoundSampleField_notFound) - snd = "misc/null.wav"; + snd = SND(Null); else if(activator.(sample) == "") - snd = "misc/null.wav"; + snd = SND(Null); else { tokenize_console(activator.(sample)); @@ -52,13 +52,13 @@ void target_speaker_use_on() } else snd = self.noise; - sound(self, CH_TRIGGER_SINGLE, snd, VOL_BASE * self.volume, self.atten); + _sound(self, CH_TRIGGER_SINGLE, snd, VOL_BASE * self.volume, self.atten); if(self.spawnflags & 3) self.use = target_speaker_use_off; } void target_speaker_use_off() {SELFPARAM(); - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASE * self.volume, self.atten); + sound(self, CH_TRIGGER_SINGLE, SND_Null, VOL_BASE * self.volume, self.atten); self.use = target_speaker_use_on; } void target_speaker_reset() diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index bc4398601..94f2bd26b 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -79,7 +79,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps { if(tflags & TELEPORT_FLAG_SOUND) - sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM); + sound (player, CH_TRIGGER, SND_TELEPORT, VOL_BASE, ATTEN_NORM); if(tflags & TELEPORT_FLAG_PARTICLES) { Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1); diff --git a/qcsrc/common/triggers/trigger/gravity.qc b/qcsrc/common/triggers/trigger/gravity.qc index 659a33690..f329c71b0 100644 --- a/qcsrc/common/triggers/trigger/gravity.qc +++ b/qcsrc/common/triggers/trigger/gravity.qc @@ -80,7 +80,7 @@ void trigger_gravity_touch() { other.gravity = g; if(self.noise != "") - sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); UpdateCSQCProjectile(self.owner); } } diff --git a/qcsrc/common/triggers/trigger/heal.qc b/qcsrc/common/triggers/trigger/heal.qc index 323a4a160..49042427e 100644 --- a/qcsrc/common/triggers/trigger/heal.qc +++ b/qcsrc/common/triggers/trigger/heal.qc @@ -19,7 +19,7 @@ void trigger_heal_touch() { other.health = min(other.health + self.health, self.max_health); other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot); - sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); } } } diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 5eb252218..cdc181ceb 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -182,7 +182,7 @@ void trigger_push_touch() { // flash when activated Send_Effect(EFFECT_JUMPPAD, other.origin, other.velocity, 1); - sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); self.pushltime = time + 0.2; } if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other)) diff --git a/qcsrc/common/triggers/trigger/keylock.qc b/qcsrc/common/triggers/trigger/keylock.qc index 17313f0aa..f792185bc 100644 --- a/qcsrc/common/triggers/trigger/keylock.qc +++ b/qcsrc/common/triggers/trigger/keylock.qc @@ -146,7 +146,7 @@ void spawnfunc_trigger_keylock(void) if(self.sounds == 1) self.noise = "misc/secret.wav"; else if(self.sounds == 2) - self.noise = "misc/talk.wav"; + self.noise = SND(TALK); else //if (self.sounds == 3) { self.noise = "misc/trigger1.wav"; } @@ -157,7 +157,7 @@ void spawnfunc_trigger_keylock(void) // set closed sourd if(self.noise2 == "") - self.noise2 = "misc/talk.wav"; + self.noise2 = SND(TALK); // delay between triggering message2 and trigger2 if(!self.wait) { self.wait = 5; } diff --git a/qcsrc/common/triggers/trigger/multi.qc b/qcsrc/common/triggers/trigger/multi.qc index 007e6da2f..2aa8f5c1d 100644 --- a/qcsrc/common/triggers/trigger/multi.qc +++ b/qcsrc/common/triggers/trigger/multi.qc @@ -32,7 +32,7 @@ void multi_trigger() } if (self.noise) - sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); // don't trigger again until reset self.takedamage = DAMAGE_NO; @@ -149,8 +149,7 @@ void spawnfunc_trigger_multiple() } else if (self.sounds == 2) { - precache_sound ("misc/talk.wav"); - self.noise = "misc/talk.wav"; + self.noise = SND(TALK); } else if (self.sounds == 3) { diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index a44c688ed..73c5c4965 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -173,7 +173,7 @@ void SUB_UseTargets() { centerprint(activator, self.message); if (self.noise == "") - play2(activator, "misc/talk.wav"); + play2(activator, SND(TALK)); } // diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 232f546c1..e25b0b41a 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -272,7 +272,7 @@ void turret_gibboom() {SELFPARAM(); float i; - sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1); for (i = 1; i < 5; i = i + 1) @@ -318,7 +318,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo void turret_die() {SELFPARAM(); - sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1); if (!autocvar_cl_nogibs) { diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 9c02d7ad9..337b2789a 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -457,7 +457,7 @@ entity turret_projectile(string _snd, float _size, float _health, float _death, {SELFPARAM(); entity proj; - sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTEN_NORM); + _sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTEN_NORM); proj = spawn (); setorigin(proj, self.tur_shotorg); setsize(proj, '-0.5 -0.5 -0.5' * _size, '0.5 0.5 0.5' * _size); diff --git a/qcsrc/common/turrets/unit/ewheel.qc b/qcsrc/common/turrets/unit/ewheel.qc index e61897cdd..23942ce24 100644 --- a/qcsrc/common/turrets/unit/ewheel.qc +++ b/qcsrc/common/turrets/unit/ewheel.qc @@ -136,7 +136,7 @@ float t_ewheel(float req) { turret_do_updates(self); - _mis = turret_projectile(W_Sound("lasergun_fire"), 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE); + _mis = turret_projectile(SND(LASERGUN_FIRE), 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE); _mis.missile_flags = MIF_SPLASH; Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); diff --git a/qcsrc/common/turrets/unit/flac.qc b/qcsrc/common/turrets/unit/flac.qc index 228049f41..975f9045e 100644 --- a/qcsrc/common/turrets/unit/flac.qc +++ b/qcsrc/common/turrets/unit/flac.qc @@ -40,7 +40,7 @@ float t_flac(float req) turret_tag_fire_update(); - proj = turret_projectile(W_Sound("hagar_fire"), 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE); + proj = turret_projectile(SND(HAGAR_FIRE), 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE); Send_Effect(EFFECT_BLASTER_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); diff --git a/qcsrc/common/turrets/unit/hellion.qc b/qcsrc/common/turrets/unit/hellion.qc index f785f4e95..596b95fa0 100644 --- a/qcsrc/common/turrets/unit/hellion.qc +++ b/qcsrc/common/turrets/unit/hellion.qc @@ -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(W_Sound("rocket_fire"), 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE); + missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE); te_explosion (missile.origin); missile.think = turret_hellion_missile_think; missile.nextthink = time; diff --git a/qcsrc/common/turrets/unit/hk.qc b/qcsrc/common/turrets/unit/hk.qc index f01275187..dc3a89b23 100644 --- a/qcsrc/common/turrets/unit/hk.qc +++ b/qcsrc/common/turrets/unit/hk.qc @@ -283,7 +283,7 @@ float t_hk(float req) { entity missile; - missile = turret_projectile(W_Sound("rocket_fire"), 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE); + missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE); te_explosion (missile.origin); missile.think = turret_hk_missile_think; diff --git a/qcsrc/common/turrets/unit/mlrs.qc b/qcsrc/common/turrets/unit/mlrs.qc index 1a3c9220b..37fde41c8 100644 --- a/qcsrc/common/turrets/unit/mlrs.qc +++ b/qcsrc/common/turrets/unit/mlrs.qc @@ -22,7 +22,7 @@ float t_mlrs(float req) entity missile; turret_tag_fire_update(); - missile = turret_projectile(W_Sound("rocket_fire"), 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE); + missile = turret_projectile(SND(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); diff --git a/qcsrc/common/turrets/unit/phaser.qc b/qcsrc/common/turrets/unit/phaser.qc index 67d82dbf5..a1f766f01 100644 --- a/qcsrc/common/turrets/unit/phaser.qc +++ b/qcsrc/common/turrets/unit/phaser.qc @@ -26,7 +26,7 @@ void beam_think() self.owner.attack_finished_single = time + self.owner.shot_refire; self.owner.fireflag = 2; self.owner.tur_head.frame = 10; - sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); remove(self); return; } @@ -36,7 +36,7 @@ void beam_think() if (time - self.shot_spread > 0) { self.shot_spread = time + 2; - sound (self, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM); } @@ -83,7 +83,7 @@ float t_phaser(float req) beam.enemy = self.enemy; beam.bot_dodge = true; beam.bot_dodgerating = beam.shot_dmg; - sound (beam, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM); + sound (beam, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM); self.fireflag = 1; beam.attack_finished_single = self.attack_finished_single; @@ -91,7 +91,7 @@ float t_phaser(float req) setattachment(beam,self.tur_head,"tag_fire"); - soundat (self, trace_endpos, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTEN_NORM); + soundat (self, trace_endpos, CH_SHOTS, SND(NEXIMPACT), VOL_BASE, ATTEN_NORM); if (self.tur_head.frame == 0) self.tur_head.frame = 1; diff --git a/qcsrc/common/turrets/unit/plasma.qc b/qcsrc/common/turrets/unit/plasma.qc index df986d79e..38a7eeacb 100644 --- a/qcsrc/common/turrets/unit/plasma.qc +++ b/qcsrc/common/turrets/unit/plasma.qc @@ -42,7 +42,7 @@ float t_plasma(float req) } else { - entity missile = turret_projectile(W_Sound("hagar_fire"), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); + entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); missile.missile_flags = MIF_SPLASH; Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); diff --git a/qcsrc/common/turrets/unit/plasma_dual.qc b/qcsrc/common/turrets/unit/plasma_dual.qc index f3bd32448..3bf87db22 100644 --- a/qcsrc/common/turrets/unit/plasma_dual.qc +++ b/qcsrc/common/turrets/unit/plasma_dual.qc @@ -42,7 +42,7 @@ float t_plasma_dual(float req) } else { - entity missile = turret_projectile(W_Sound("hagar_fire"), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); + entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); missile.missile_flags = MIF_SPLASH; Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); self.tur_head.frame += 1; diff --git a/qcsrc/common/turrets/unit/walker.qc b/qcsrc/common/turrets/unit/walker.qc index 7f33fb5f2..ae904bcd0 100644 --- a/qcsrc/common/turrets/unit/walker.qc +++ b/qcsrc/common/turrets/unit/walker.qc @@ -221,7 +221,7 @@ void walker_fire_rocket(vector org) rocket = spawn (); setorigin(rocket, org); - sound (self, CH_WEAPON_A, W_Sound("hagar_fire"), VOL_BASE, ATTEN_NORM); + sound (self, CH_WEAPON_A, SND_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, W_Sound("uzi_fire"), VOL_BASE, ATTEN_NORM); + sound (self, CH_WEAPON_A, SND_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(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index e3fab47b7..d43136c67 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -230,10 +230,6 @@ const float XENCODE_LEN = 5; string xencode(float f); float xdecode(string s); -// Play all sounds via sound7, for access to the extra channels. -// Otherwise, channels 8 to 15 would be blocked for a weird QW feature. -#define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0) - int lowestbit(float f); #ifdef CSQC diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index b6c8844ab..a91e3e212 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -23,7 +23,7 @@ void vehicle_alarm(entity e, int ch, string s0und) if(!autocvar_cl_vehicles_alarm) return; - sound(e, ch, s0und, VOL_BASEVOICE, ATTEN_NONE); + _sound(e, ch, s0und, VOL_BASEVOICE, ATTEN_NONE); } void AuxiliaryXhair_Draw2D() @@ -79,8 +79,8 @@ void Net_VehicleSetup() // hud_id == 0 means we exited a vehicle, so stop alarm sound/s if(hud_id == 0) { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + sound(self, CH_TRIGGER_SINGLE, SND_Null, VOL_BASEVOICE, ATTEN_NONE); + sound(self, CH_PAIN_SINGLE, SND_Null, VOL_BASEVOICE, ATTEN_NONE); return; } @@ -235,7 +235,7 @@ void Vehicles_drawHUD( if(alarm1time < time) { alarm1time = time + 2; - vehicle_alarm(self, CH_PAIN_SINGLE, "vehicles/alarm.wav"); + vehicle_alarm(self, CH_PAIN_SINGLE, SND(VEH_ALARM)); } drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL); } @@ -243,7 +243,7 @@ void Vehicles_drawHUD( { if(alarm1time) { - vehicle_alarm(self, CH_PAIN_SINGLE, "misc/null.wav"); + vehicle_alarm(self, CH_PAIN_SINGLE, SND(Null)); alarm1time = 0; } drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); @@ -257,7 +257,7 @@ void Vehicles_drawHUD( if(alarm2time < time) { alarm2time = time + 1; - vehicle_alarm(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav"); + vehicle_alarm(self, CH_TRIGGER_SINGLE, SND(VEH_ALARM_SHIELD)); } drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL); } @@ -265,7 +265,7 @@ void Vehicles_drawHUD( { if(alarm2time) { - vehicle_alarm(self, CH_TRIGGER_SINGLE, "misc/null.wav"); + vehicle_alarm(self, CH_TRIGGER_SINGLE, SND(Null)); alarm2time = 0; } drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 73ff86b4b..8f2f7581a 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -289,7 +289,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound, proj.flags = FL_PROJECTILE | FL_NOTARGET; if(_mzlsound) - sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM); + _sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM); if(_mzlfx) Send_Effect_(_mzlfx, proj.origin, proj.velocity, 1); @@ -303,7 +303,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound, void vehicles_gib_explode() {SELFPARAM(); - sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); Send_Effect(EFFECT_EXPLOSION_SMALL, self.wp00.origin + '0 0 64', '0 0 0', 1); remove(self); @@ -907,7 +907,7 @@ void vehicles_exit(bool eject) _vehicle.team = _vehicle.tur_head.team; - sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM); + sound (_vehicle, CH_TRIGGER_SINGLE, SND_Null, 1, ATTEN_NORM); _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle; _vehicle.phase = time + 1; diff --git a/qcsrc/common/vehicles/unit/bumblebee.qc b/qcsrc/common/vehicles/unit/bumblebee.qc index 96fef6c05..6f8a2bf8f 100644 --- a/qcsrc/common/vehicles/unit/bumblebee.qc +++ b/qcsrc/common/vehicles/unit/bumblebee.qc @@ -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(EFFECT_BIGPLASMA_MUZZLEFLASH.eent_eff_name, W_Sound("flacexp3"), + vehicles_projectile(EFFECT_BIGPLASMA_MUZZLEFLASH.eent_eff_name, SND(VEH_BUMBLEBEE_FIRE), 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, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(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, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } diff --git a/qcsrc/common/vehicles/unit/racer.qc b/qcsrc/common/vehicles/unit/racer.qc index e3dd5334b..a1dc7ced6 100644 --- a/qcsrc/common/vehicles/unit/racer.qc +++ b/qcsrc/common/vehicles/unit/racer.qc @@ -174,7 +174,7 @@ void racer_fire_cannon(string tagname) entity bolt; v = gettaginfo(self, gettagindex(self, tagname)); - bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH.eent_eff_name, W_Sound("lasergun_fire"), + bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH.eent_eff_name, SND(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) {SELFPARAM(); vector v = gettaginfo(self, gettagindex(self, tagname)); - entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), + entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, SND(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); @@ -385,7 +385,7 @@ float racer_frame() { self.sounds = 1; self.sound_nexttime = time + 10.922667; //soundlength("vehicles/racer_move.wav"); - sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_move.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_RACER_MOVE, VOL_VEHICLEENGINE, ATTEN_NORM); } #endif } @@ -396,7 +396,7 @@ float racer_frame() { self.sounds = 0; self.sound_nexttime = time + 11.888604; //soundlength("vehicles/racer_idle.wav"); - sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_RACER_IDLE, VOL_VEHICLEENGINE, ATTEN_NORM); } } #endif @@ -435,14 +435,14 @@ float racer_frame() if(racer.strength_finished < time) { racer.strength_finished = time + 10.922667; //soundlength("vehicles/racer_boost.wav"); - sound (racer.tur_head, CH_TRIGGER_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (racer.tur_head, CH_TRIGGER_SINGLE, SND_VEH_RACER_BOOST, VOL_VEHICLEENGINE, ATTEN_NORM); } #endif } else { racer.strength_finished = 0; - sound (racer.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (racer.tur_head, CH_TRIGGER_SINGLE, SND_Null, VOL_VEHICLEENGINE, ATTEN_NORM); } if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME) @@ -589,7 +589,7 @@ void racer_exit(float eject) self.think = racer_think; self.nextthink = time; self.movetype = MOVETYPE_BOUNCE; - sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self.tur_head, CH_TRIGGER_SINGLE, SND_Null, VOL_VEHICLEENGINE, ATTEN_NORM); if(!self.owner) return; diff --git a/qcsrc/common/vehicles/unit/raptor.qc b/qcsrc/common/vehicles/unit/raptor.qc index a01623468..742ef7b9b 100644 --- a/qcsrc/common/vehicles/unit/raptor.qc +++ b/qcsrc/common/vehicles/unit/raptor.qc @@ -195,7 +195,7 @@ void raptor_bombdrop() void raptor_fire_cannon(entity gun, string tagname) {SELFPARAM(); - vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, W_Sound("lasergun_fire"), + vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, SND(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); @@ -334,15 +334,15 @@ float raptor_frame() if(self.sound_nexttime < time) { self.sound_nexttime = time + 7.955812; - //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp, ATTEN_NORM ); - sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM); + //sound (self.tur_head, CH_TRIGGER_SINGLE, SND_VEH_RAPTOR_FLY, 1 - ftmp, ATTEN_NORM ); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_RAPTOR_SPEED, 1, ATTEN_NORM); self.wait = ftmp; } /* else if(fabs(ftmp - self.wait) > 0.2) { - sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp, ATTEN_NORM ); - sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM); + sound (self.tur_head, CH_TRIGGER_SINGLE, SND_Null, 1 - ftmp, ATTEN_NORM ); + sound (self, CH_TRIGGER_SINGLE, SND_Null, ftmp, ATTEN_NORM); self.wait = ftmp; } */ @@ -629,7 +629,7 @@ float raptor_frame() } if(_incomming) - sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTEN_NONE); + sound(self, CH_PAIN_SINGLE, SND_VEH_MISSILE_ALARM, VOL_BASE, ATTEN_NONE); self.bomb1.cnt = time + 1; } @@ -661,7 +661,7 @@ float raptor_takeoff() if(self.sound_nexttime < time) { self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav"); - sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_RAPTOR_SPEED, VOL_VEHICLEENGINE, ATTEN_NORM); } // Takeoff sequense @@ -727,7 +727,7 @@ void raptor_diethink() if(random() < 0.05) { - sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } self.nextthink = time; diff --git a/qcsrc/common/vehicles/unit/spiderbot.qc b/qcsrc/common/vehicles/unit/spiderbot.qc index c641ec602..f8efe528d 100644 --- a/qcsrc/common/vehicles/unit/spiderbot.qc +++ b/qcsrc/common/vehicles/unit/spiderbot.qc @@ -269,7 +269,7 @@ void spiderbot_rocket_do() switch(self.vehicle_weapon2mode) { case SBRM_VOLLY: - rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(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(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(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(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(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); @@ -407,7 +407,7 @@ float spiderbot_frame() if(spider.flags & FL_ONGROUND) if(spider.frame == 4 && self.tur_head.wait != 0) { - sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_LAND, VOL_VEHICLEENGINE, ATTEN_NORM); spider.frame = 5; } @@ -416,7 +416,7 @@ float spiderbot_frame() if((spider.flags & FL_ONGROUND) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time) { - sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_JUMP, VOL_VEHICLEENGINE, ATTEN_NORM); //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n"); self.delay = 0; @@ -452,7 +452,7 @@ float spiderbot_frame() self.delay = 3; self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav"); //dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n"); - sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_IDLE, VOL_VEHICLEENGINE, ATTEN_NORM); } movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop); spider.frame = 5; @@ -496,7 +496,7 @@ float spiderbot_frame() { self.delay = 1; self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav"); - sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_WALK, VOL_VEHICLEENGINE, ATTEN_NORM); //dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n"); } } @@ -526,7 +526,7 @@ float spiderbot_frame() { self.delay = 2; self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav"); - sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_STRAFE, VOL_VEHICLEENGINE, ATTEN_NORM); //dprint("spiderbot_strafe:", ftos(soundlength("vehicles/spiderbot_strafe.wav")), "\n"); } } @@ -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, W_Sound("uzi_fire"), VOL_BASE, ATTEN_NORM); + sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM); //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos); pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH), v, v_forward * 2500, 1); @@ -678,7 +678,7 @@ void spiderbot_headfade() { if(self.alpha > 0.1) { - sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(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, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } self.nextthink = time + 0.1; diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 611af7796..b972cfdec 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -339,7 +339,7 @@ string W_Sound(string w_snd) #undef tryext #undef extensions output = strcat("weapons/", w_snd); - } while(0); + } while (0); #ifdef SVQC MUTATOR_CALLHOOK(WeaponSound, w_snd, output); diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index c748e1837..400c950c8 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -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, W_Sound("arc_stop"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM); } } @@ -579,7 +579,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, W_Sound("arc_fire"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_ARC_FIRE, VOL_BASE, ATTN_NORM); entity beam = self.arc_beam = spawn(); beam.classname = "W_Arc_Beam"; @@ -611,7 +611,7 @@ void Arc_Smoke() if ( !self.arc_smoke_sound ) { self.arc_smoke_sound = 1; - sound(self, CH_SHOTS_SINGLE, W_Sound("arc_loop_overheat"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS_SINGLE, SND_ARC_LOOP_OVERHEAT, VOL_BASE, ATTN_NORM); } } } @@ -627,7 +627,7 @@ void Arc_Smoke() !( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) ) || self.switchweapon != WEP_ARC.m_id ) { self.arc_smoke_sound = 0; - sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); } } @@ -695,7 +695,7 @@ bool W_Arc(int req) if(self.arc_BUTTON_ATCK_prev != 0) { - sound(self, CH_WEAPON_A, W_Sound("arc_stop"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_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(); } @@ -1154,7 +1154,7 @@ void Draw_ArcBeam(void) void Remove_ArcBeam(void) {SELFPARAM(); remove(self.beam_muzzleentity); - sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); } void Ent_ReadArcBeam(float isnew) @@ -1176,7 +1176,7 @@ void Ent_ReadArcBeam(float isnew) self.draw = Draw_ArcBeam; self.entremove = Remove_ArcBeam; self.move_time = time; - loopsound(self, CH_SHOTS_SINGLE, W_Sound("arc_loop"), VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, SND(ARC_LOOP), VOL_BASE, ATTEN_NORM); flash = spawn(); flash.owner = self; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index ba28f8277..6b6d207bf 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -95,7 +95,7 @@ void W_Blaster_Attack( {SELFPARAM(); vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD); - W_SetupShot_Dir(self, s_forward, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_B, atk_damage); + W_SetupShot_Dir(self, s_forward, false, 3, SND(LASERGUN_FIRE), CH_WEAPON_B, atk_damage); Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); entity missile = spawn(); @@ -268,7 +268,7 @@ bool W_Blaster(int request) vector org2; org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); - if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } return true; } diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 78c7dc8b2..43771079e 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -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, W_Sound("crylink_fire"), CH_WEAPON_A, maxdmg); + W_SetupShot(self, false, 2, SND(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, W_Sound("crylink_fire2"), CH_WEAPON_A, maxdmg); + W_SetupShot(self, false, 2, SND(CRYLINK_FIRE2), CH_WEAPON_A, maxdmg); forward = v_forward; right = v_right; up = v_up; @@ -668,7 +668,7 @@ bool W_Crylink(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), W_Sound("reload")); + W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -696,13 +696,13 @@ bool W_Crylink(int req) { pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT2), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("crylink_impact2"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_CRYLINK_IMPACT2, VOL_BASE, ATTN_NORM); } else { pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("crylink_impact"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM); } return true; diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 86a1ba10e..a01184631 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -295,7 +295,7 @@ void W_Devastator_Think(void) { Send_Effect(EFFECT_ROCKET_GUIDE, self.origin, self.velocity, 1); // TODO add a better sound here - sound(self.realowner, CH_WEAPON_B, W_Sound("rocket_mode"), VOL_BASE, ATTN_NORM); + sound(self.realowner, CH_WEAPON_B, SND_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, W_Sound("rocket_fire"), CH_WEAPON_A, WEP_CVAR(devastator, damage)); + W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, SND(ROCKET_FIRE), CH_WEAPON_A, WEP_CVAR(devastator, damage)); Send_Effect(EFFECT_ROCKET_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, W_Sound("rocket_det"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM); } } @@ -627,7 +627,7 @@ bool W_Devastator(int req) } case WR_RELOAD: { - W_Reload(WEP_CVAR(devastator, ammo), W_Sound("reload")); + W_Reload(WEP_CVAR(devastator, ammo), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -656,7 +656,7 @@ bool W_Devastator(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 08febe047..fbc073388 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -255,7 +255,7 @@ void W_Electro_Attack_Bolt(void) '0 0 -3', false, 2, - W_Sound("electro_fire"), + SND(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, W_Sound("electro_bounce"), VOL_BASE, ATTEN_NORM); + spamsound(self, CH_SHOTS, SND(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, - W_Sound("electro_fire2"), + SND(ELECTRO_FIRE2), CH_WEAPON_A, WEP_CVAR_SEC(electro, damage) ); @@ -533,7 +533,7 @@ bool W_Electro(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), W_Sound("reload")); + W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -574,7 +574,7 @@ bool W_Electro(int req) { pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM); } else { @@ -583,13 +583,13 @@ bool W_Electro(int req) // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("electro_impact_combo"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM); } else { pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM); } } diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index e8da0a199..2bf2a6267 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -182,7 +182,7 @@ void W_Fireball_Attack1(void) {SELFPARAM(); entity proj; - 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)); + W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, SND(FIREBALL_FIRE2), CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage)); Send_Effect(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) {SELFPARAM(); W_Fireball_AttackEffect(0, '-1.25 -3.75 0'); - sound(self, CH_WEAPON_SINGLE, W_Sound("fireball_prefire2"), VOL_BASE, ATTEN_NORM); + sound(self, CH_WEAPON_SINGLE, SND_FIREBALL_PREFIRE2, VOL_BASE, ATTEN_NORM); weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1); } @@ -316,7 +316,7 @@ 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, W_Sound("fireball_fire"), CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage)); + W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, SND(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; @@ -457,7 +457,7 @@ bool W_Fireball(int req) org2 = w_org + w_backoff * 16; pointparticles(particleeffectnum(EFFECT_FIREBALL_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM * 0.25); // long range boom + sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom } return true; diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 882781a2b..8001ce15e 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -127,7 +127,7 @@ void W_Hagar_Attack(void) W_DecreaseAmmo(WEP_CVAR_PRI(hagar, ammo)); - W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage)); + W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage)); Send_Effect(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, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage)); + W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage)); Send_Effect(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, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage)); + W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage)); Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); forward = v_forward; @@ -319,7 +319,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, W_Sound("hagar_beep"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_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(); @@ -338,7 +338,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, W_Sound("hagar_load"), VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most + sound(self, CH_WEAPON_B, SND_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)) stopped = true; @@ -349,7 +349,7 @@ void W_Hagar_Attack2_Load(void) if(stopped && !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, W_Sound("hagar_beep"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM); self.hagar_loadbeep = true; self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor(); } @@ -369,7 +369,7 @@ void W_Hagar_Attack2_Load(void) if(!self.hagar_warning) // 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, W_Sound("hagar_beep"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM); self.hagar_warning = true; } } @@ -499,7 +499,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)), W_Sound("reload")); + W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND(RELOAD)); return true; } @@ -531,11 +531,11 @@ bool W_Hagar(int req) if(!w_issilent) { if(w_random<0.15) - sound(self, CH_SHOTS, W_Sound("hagexp1"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_HAGEXP1, VOL_BASE, ATTN_NORM); else if(w_random<0.7) - sound(self, CH_SHOTS, W_Sound("hagexp2"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_HAGEXP2, VOL_BASE, ATTN_NORM); else - sound(self, CH_SHOTS, W_Sound("hagexp3"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM); } return true; diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index dffd5e4df..a0408d6b9 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -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, W_Sound("lasergun_fire"), CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage)); + W_SetupShot(self, false, 3, SND(LASERGUN_FIRE), CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage)); Send_Effect(EFFECT_BLASTER_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, W_Sound("lasergun_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage)); + W_SetupShot(self, false, 3, SND(LASERGUN_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage)); Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); missile = spawn(); @@ -263,7 +263,7 @@ bool W_HLAC(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), W_Sound("reload")); + W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -289,7 +289,7 @@ bool W_HLAC(int req) org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/hmg.qc b/qcsrc/common/weapons/weapon/hmg.qc index 8afb8ab80..03196daf6 100644 --- a/qcsrc/common/weapons/weapon/hmg.qc +++ b/qcsrc/common/weapons/weapon/hmg.qc @@ -61,7 +61,7 @@ void W_HeavyMachineGun_Attack_Auto() W_DecreaseAmmo(WEP_CVAR(hmg, ammo)); - W_SetupShot (self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(hmg, damage)); + W_SetupShot (self, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(hmg, damage)); if(!autocvar_g_norecoil) { @@ -146,7 +146,7 @@ bool W_HeavyMachineGun(int req) } case WR_RELOAD: { - W_Reload(WEP_CVAR(hmg, ammo), W_Sound("reload")); + W_Reload(WEP_CVAR(hmg, ammo), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -176,11 +176,11 @@ bool W_HeavyMachineGun(int req) pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) - sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM); else if(w_random < 0.1) - sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM); else if(w_random < 0.2) - sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index fff06f15f..af52ec15b 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -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, W_Sound("hookbomb_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hook, damage)); + W_SetupShot(self, false, 4, SND(HOOKBOMB_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hook, damage)); gren = spawn(); gren.owner = gren.realowner = self; @@ -341,7 +341,7 @@ bool W_Hook(int req) org2 = w_org + w_backoff * 2; pointparticles(particleeffectnum(EFFECT_HOOK_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("hookbomb_impact"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index dcad706f9..6db6d1633 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -104,7 +104,7 @@ void W_MachineGun_MuzzleFlash(void) void W_MachineGun_Attack(int deathtype) {SELFPARAM(); - 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))); + W_SetupShot(self, true, 0, SND(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, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); + W_SetupShot(self, true, 0, SND(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) {SELFPARAM(); - W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); + W_SetupShot(self, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); if(!autocvar_g_norecoil) { self.punchangle_x = random() - 0.5; @@ -346,7 +346,7 @@ bool W_MachineGun(int req) } case WR_RELOAD: { - W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), W_Sound("reload")); + W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -376,11 +376,11 @@ bool W_MachineGun(int req) pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) - sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTN_NORM); else if(w_random < 0.1) - sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTN_NORM); else if(w_random < 0.2) - sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 0e7216175..05dde9852 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -61,7 +61,7 @@ void spawnfunc_weapon_minelayer(void) { weapon_defaultspawnfunc(WEP_MINE_LAYER.m void W_MineLayer_Stick(entity to) {SELFPARAM(); - spamsound(self, CH_SHOTS, W_Sound("mine_stick"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(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 @@ -221,7 +221,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, W_Sound("mine_trigger"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(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. } @@ -244,7 +244,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, W_Sound("mine_trigger"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM); self.mine_time = time + WEP_CVAR(minelayer, time); } head = head.chain; @@ -316,14 +316,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, W_Sound("unavailable")); + play2(self, SND(UNAVAILABLE)); return; } } W_DecreaseAmmo(WEP_CVAR(minelayer, ammo)); - W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, W_Sound("mine_fire"), CH_WEAPON_A, WEP_CVAR(minelayer, damage)); + W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, SND(MINE_FIRE), CH_WEAPON_A, WEP_CVAR(minelayer, damage)); Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); mine = WarpZone_RefSys_SpawnSameRefSys(self); @@ -523,7 +523,7 @@ bool W_MineLayer(int req) if(self.BUTTON_ATCK2) { if(W_MineLayer_PlacedMines(true)) - sound(self, CH_WEAPON_B, W_Sound("mine_det"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM); } return true; @@ -563,7 +563,7 @@ bool W_MineLayer(int req) } case WR_RELOAD: { - W_Reload(WEP_CVAR(minelayer, ammo), W_Sound("reload")); + W_Reload(WEP_CVAR(minelayer, ammo), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -589,7 +589,7 @@ bool W_MineLayer(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("mine_exp"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 99d444695..665367fd7 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -137,27 +137,14 @@ void W_Mortar_Grenade_Touch1(void) } else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce { - float r; - r = random() * 6; - if(r < 1) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce1"), VOL_BASE, ATTN_NORM); - else if(r < 2) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce2"), VOL_BASE, ATTN_NORM); - else if(r < 3) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce3"), VOL_BASE, ATTN_NORM); - else if(r < 4) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce4"), VOL_BASE, ATTN_NORM); - else if(r < 5) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM); - else - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM); Send_Effect(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, W_Sound("grenade_stick"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM); // let it stick whereever it is self.oldvelocity = self.velocity; @@ -182,20 +169,7 @@ void W_Mortar_Grenade_Touch2(void) } else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce { - float r; - r = random() * 6; - if(r < 1) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce1"), VOL_BASE, ATTN_NORM); - else if(r < 2) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce2"), VOL_BASE, ATTN_NORM); - else if(r < 3) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce3"), VOL_BASE, ATTN_NORM); - else if(r < 4) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce4"), VOL_BASE, ATTN_NORM); - else if(r < 5) - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM); - else - spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM); Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1); self.projectiledeathtype |= HITTYPE_BOUNCE; self.gl_bouncecnt += 1; @@ -206,7 +180,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, W_Sound("grenade_stick"), VOL_BASE, ATTN_NORM); + spamsound(self, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM); // let it stick whereever it is self.oldvelocity = self.velocity; @@ -228,7 +202,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, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage)); + W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND(GRENADE_FIRE), CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage)); w_shotdir = v_forward; // no TrueAim for grenades please Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -277,7 +251,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, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage)); + W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND(GRENADE_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage)); w_shotdir = v_forward; // no TrueAim for grenades please Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -392,7 +366,7 @@ bool W_Mortar(int req) } } if(nadefound) - sound(self, CH_WEAPON_B, W_Sound("rocket_det"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM); } else if(weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire))) { @@ -427,7 +401,7 @@ bool W_Mortar(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), W_Sound("reload")); // WEAPONTODO + W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND(RELOAD)); // WEAPONTODO return true; } case WR_SUICIDEMESSAGE: @@ -459,7 +433,7 @@ bool W_Mortar(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 0f87f82a6..d764286b7 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -132,19 +132,19 @@ void W_Porto_Touch(void) if(self.realowner.playerid != self.playerid) { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); remove(self); } else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP) { - spamsound(self, CH_SHOTS, "porto/bounce.wav", VOL_BASE, ATTEN_NORM); + spamsound(self, CH_SHOTS, SND(PORTO_BOUNCE), VOL_BASE, ATTEN_NORM); // just reflect self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * trace_plane_normal); self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * trace_plane_normal)); } else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); W_Porto_Fail(0); if(self.cnt < 0) Portal_ClearAll_PortalsOnly(self.realowner); @@ -154,14 +154,14 @@ void W_Porto_Touch(void) // in-portal only if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id)) { - sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN); W_Porto_Success(); } else { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; W_Porto_Fail(0); } @@ -171,14 +171,14 @@ void W_Porto_Touch(void) // out-portal only if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id)) { - sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT); W_Porto_Success(); } else { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; W_Porto_Fail(0); } @@ -188,7 +188,7 @@ void W_Porto_Touch(void) self.effects += EF_BLUE - EF_RED; if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id)) { - sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN); self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * norm); @@ -197,7 +197,7 @@ void W_Porto_Touch(void) } else { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; Portal_ClearAll_PortalsOnly(self.realowner); W_Porto_Fail(0); @@ -209,21 +209,21 @@ void W_Porto_Touch(void) { if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id)) { - sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM); trace_plane_normal = norm; Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT); W_Porto_Success(); } else { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); Portal_ClearAll_PortalsOnly(self.realowner); W_Porto_Fail(0); } } else { - sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); Portal_ClearAll_PortalsOnly(self.realowner); W_Porto_Fail(0); } @@ -234,7 +234,7 @@ void W_Porto_Attack(float type) {SELFPARAM(); entity gren; - W_SetupShot(self, false, 4, "porto/fire.wav", CH_WEAPON_A, 0); + W_SetupShot(self, false, 4, SND(PORTO_FIRE), CH_WEAPON_A, 0); // always shoot from the eye w_shotdir = v_forward; w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward; diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index fd2c1a0e8..6d4a58f27 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -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), W_Sound("campingrifle_fire")); + 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), SND(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), W_Sound("campingrifle_fire2")); + 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), SND(CAMPINGRIFLE_FIRE2)); } .void(void) rifle_bullethail_attackfunc; @@ -231,7 +231,7 @@ bool W_Rifle(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), W_Sound("reload")); + W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -272,11 +272,11 @@ bool W_Rifle(int req) if(!w_issilent) { if(w_random < 0.2) - sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTN_NORM); else if(w_random < 0.4) - sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTN_NORM); else if(w_random < 0.5) - sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM); } return true; diff --git a/qcsrc/common/weapons/weapon/rpc.qc b/qcsrc/common/weapons/weapon/rpc.qc index f6abe5c1e..5fe7552cc 100644 --- a/qcsrc/common/weapons/weapon/rpc.qc +++ b/qcsrc/common/weapons/weapon/rpc.qc @@ -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, W_Sound("rocket_fire"), CH_WEAPON_A, WEP_CVAR(rpc, damage)); + W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, SND(ROCKET_FIRE), CH_WEAPON_A, WEP_CVAR(rpc, damage)); Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); PROJECTILE_MAKETRIGGER(missile); @@ -202,7 +202,7 @@ bool W_RocketPropelledChainsaw(int req) } case WR_RELOAD: { - W_Reload(WEP_CVAR(rpc, ammo), W_Sound("reload")); + W_Reload(WEP_CVAR(rpc, ammo), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -238,7 +238,7 @@ bool W_RocketPropelledChainsaw(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); return true; } diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 54c4bb464..b79bb081e 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -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, W_Sound("seeker_fire"), CH_WEAPON_A, 0); + W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND(SEEKER_FIRE), CH_WEAPON_A, 0); w_shotorg += f_diff; Send_Effect(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, W_Sound("flac_fire"), CH_WEAPON_A, WEP_CVAR(seeker, flac_damage)); + W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND(FLAC_FIRE), CH_WEAPON_A, WEP_CVAR(seeker, flac_damage)); w_shotorg += f_diff; Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -559,7 +559,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, W_Sound("tag_fire"), 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, SND(TAG_FIRE), CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count)); missile = spawn(); missile.owner = missile.realowner = self; @@ -700,7 +700,7 @@ bool W_Seeker(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), W_Sound("reload")); + W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -732,7 +732,7 @@ bool W_Seeker(int req) if(w_deathtype & HITTYPE_SECONDARY) { if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("tag_impact"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_TAG_IMPACT, 1, ATTEN_NORM); } else { @@ -740,11 +740,11 @@ bool W_Seeker(int req) if(!w_issilent) { if(w_random<0.15) - sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM); else if(w_random<0.7) - sound(self, CH_SHOTS, W_Sound("tagexp2"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_TAGEXP2, 1, ATTEN_NORM); else - sound(self, CH_SHOTS, W_Sound("tagexp3"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_TAGEXP3, 1, ATTEN_NORM); } } } @@ -754,11 +754,11 @@ bool W_Seeker(int req) if(!w_issilent) { if(w_random<0.15) - sound(self, CH_SHOTS, W_Sound("seekerexp1"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_SEEKEREXP1, 1, ATTEN_NORM); else if(w_random<0.7) - sound(self, CH_SHOTS, W_Sound("seekerexp2"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_SEEKEREXP2, 1, ATTEN_NORM); else - sound(self, CH_SHOTS, W_Sound("seekerexp3"), 1, ATTEN_NORM); + sound(self, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM); } } return true; diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index a0451d87e..0ef52fbd9 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -229,7 +229,7 @@ void W_Shockwave_Melee_Think(void) void W_Shockwave_Melee(void) {SELFPARAM(); - sound(self, CH_WEAPON_A, W_Sound("shotgun_melee"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_A, SND_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, W_Sound("lasergun_fire"), CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage)); + W_SetupShot(self, false, 3, SND(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; diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index ad4d8cc43..9a8d9d0db 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -61,7 +61,7 @@ void W_Shotgun_Attack(float isprimary) W_DecreaseAmmo(WEP_CVAR_PRI(shotgun, ammo)); - 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)); + W_SetupShot(self, true, 5, SND(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) {SELFPARAM(); - sound(self, CH_WEAPON_A, W_Sound("shotgun_melee"), VOL_BASE, ATTEN_NORM); + sound(self, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTEN_NORM); weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready); entity meleetemp; @@ -203,7 +203,7 @@ void W_Shotgun_Attack3_Frame2() return; } - sound(self, CH_WEAPON_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // kill previous sound + sound(self, CH_WEAPON_SINGLE, SND_Null, VOL_BASE, ATTN_NORM); // kill previous sound W_Shotgun_Attack(true); // actually is secondary, but we trick the last shot into playing full reload sound weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready); } @@ -324,7 +324,7 @@ float W_Shotgun(float req) } case WR_RELOAD: { - W_Reload(WEP_CVAR_PRI(shotgun, ammo), W_Sound("reload")); // WEAPONTODO + W_Reload(WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO return true; } case WR_SUICIDEMESSAGE: @@ -356,11 +356,11 @@ float W_Shotgun(float req) if(!w_issilent && time - self.prevric > 0.25) { if(w_random < 0.0165) - sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM); else if(w_random < 0.033) - sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM); else if(w_random < 0.05) - sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM); self.prevric = time; } diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 601773fdc..2abddeace 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -77,7 +77,7 @@ void W_Vaporizer_Attack(void) W_SetupShot(self, true, 0, "", CH_WEAPON_A, vaporizer_damage); // 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, W_Sound("minstanexfire"), VOL_BASE * 0.8, ATTEN_NORM); + sound (self, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM); yoda = 0; damage_goodhits = 0; @@ -174,7 +174,7 @@ void W_RocketMinsta_Attack2(void) float w = self.weapon; self.weapon = WEP_ELECTRO.m_id; - W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, W_Sound("crylink_fire"), CH_WEAPON_A, autocvar_g_rm_laser_damage); + W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND(CRYLINK_FIRE), CH_WEAPON_A, autocvar_g_rm_laser_damage); self.weapon = w; Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -227,7 +227,7 @@ void W_RocketMinsta_Attack3 (void) int w = self.weapon; self.weapon = WEP_ELECTRO.m_id; - W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, W_Sound("electro_fire2"), CH_WEAPON_A, autocvar_g_rm_laser_damage); + W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND(ELECTRO_FIRE2), CH_WEAPON_A, autocvar_g_rm_laser_damage); self.weapon = w; Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -404,7 +404,7 @@ float W_Vaporizer(float req) else used_ammo = vaporizer_ammo; - W_Reload(used_ammo, W_Sound("reload")); + W_Reload(used_ammo, SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -430,12 +430,12 @@ float W_Vaporizer(float req) if(w_deathtype & HITTYPE_SECONDARY) { pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); - if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } } else { pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); - if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); } } return true; } diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 0ba4a2642..8584b8ab9 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -103,10 +103,10 @@ void W_Vortex_Attack(float issecondary) mydmg *= charge; myforce *= charge; - W_SetupShot(self, true, 5, W_Sound("nexfire"), CH_WEAPON_A, mydmg); + W_SetupShot(self, true, 5, SND(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, W_Sound("nexcharge"), 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, SND_NEXCHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM); } yoda = 0; @@ -293,7 +293,7 @@ bool W_Vortex(int req) } case WR_RELOAD: { - W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), W_Sound("reload")); + W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND(RELOAD)); return true; } case WR_SUICIDEMESSAGE: @@ -320,7 +320,7 @@ bool W_Vortex(int req) org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); return true; } diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 46193160d..72951cd66 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -1050,7 +1050,7 @@ float bot_cmd_sound() atten = stof(argv(2)); precache_sound(f); - sound(self, chan, sample, vol, atten); + _sound(self, chan, sample, vol, atten); return CMD_STATUS_FINISHED; } diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 26af000d2..361afadee 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -283,7 +283,7 @@ float CheatImpulse(float i) e = self; Send_Effect(EFFECT_ROCKET_EXPLODE, e.origin, '0 0 0', 1); - sound(e, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(e, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); e2 = spawn(); setorigin(e2, e.origin); diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index bd9c46a9b..c46da27f7 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1447,7 +1447,7 @@ void play_countdown(float finished, string samp) if(IS_REAL_CLIENT(self)) if(floor(finished - time - frametime) != floor(finished - time)) if(finished - time < 6) - sound (self, CH_INFO, samp, VOL_BASE, ATTEN_NORM); + _sound (self, CH_INFO, samp, VOL_BASE, ATTEN_NORM); } void player_powerups (void) @@ -1472,7 +1472,7 @@ void player_powerups (void) { if (self.items & ITEM_Strength.m_itemid) { - play_countdown(self.strength_finished, "misc/poweroff.wav"); + play_countdown(self.strength_finished, SND(POWEROFF)); self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT); if (time > self.strength_finished) { @@ -1492,7 +1492,7 @@ void player_powerups (void) } if (self.items & ITEM_Shield.m_itemid) { - play_countdown(self.invincible_finished, "misc/poweroff.wav"); + play_countdown(self.invincible_finished, SND(POWEROFF)); self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT); if (time > self.invincible_finished) { @@ -1525,7 +1525,7 @@ void player_powerups (void) } else { - play_countdown(self.superweapons_finished, "misc/poweroff.wav"); + play_countdown(self.superweapons_finished, SND(POWEROFF)); if (time > self.superweapons_finished) { self.items = self.items - (self.items & IT_SUPERWEAPON); diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 1b3554eec..310454d9b 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -182,11 +182,11 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, int de if(sound_allowed(MSG_BROADCAST, attacker)) { if (save > 10) - sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ARMORIMPACT, VOL_BASE, ATTEN_NORM); else if (take > 30) - sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_BODYIMPACT2, VOL_BASE, ATTEN_NORM); else if (take > 10) - sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_BODYIMPACT1, VOL_BASE, ATTEN_NORM); } if (take > 50) @@ -395,11 +395,11 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp if(sound_allowed(MSG_BROADCAST, attacker)) { if (save > 10) - sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_ARMORIMPACT, VOL_BASE, ATTEN_NORM); else if (take > 30) - sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_BODYIMPACT2, VOL_BASE, ATTEN_NORM); else if (take > 10) - sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); // FIXME possibly remove them? + sound (self, CH_SHOTS, SND_BODYIMPACT1, VOL_BASE, ATTEN_NORM); // FIXME possibly remove them? } if (take > 50) @@ -1226,7 +1226,7 @@ void GlobalSound(string sample, float chan, float voicetype) } break; case VOICETYPE_PLAYERSOUND: - sound(self, chan, sample, VOL_BASE, ATTEN_NORM); + _sound(self, chan, sample, VOL_BASE, ATTEN_NORM); break; default: backtrace("Invalid voice type!"); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 5072e4900..02e80845b 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -147,7 +147,9 @@ const float MAX_DAMAGEEXTRARADIUS = 16; .float pauserothealth_finished; .float pauserotarmor_finished; .float pauserotfuel_finished; +// string overrides entity .string item_pickupsound; +.entity item_pickupsound_ent; // definitions for weaponsystem // more WEAPONTODO: move these to their proper files diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 6a95a61fe..779ec90c9 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -91,7 +91,7 @@ void GrapplingHookThink(); void GrapplingHook_Stop() {SELFPARAM(); Send_Effect(EFFECT_HOOK_IMPACT, self.origin, '0 0 0', 1); - sound (self, CH_SHOTS, W_Sound("hook_impact"), VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, SND_HOOK_IMPACT, VOL_BASE, ATTEN_NORM); self.state = 1; self.think = GrapplingHookThink; @@ -357,7 +357,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, W_Sound("hook_fire"), VOL_BASE, ATTEN_NORM); + sound (self, CH_WEAPON_B, SND_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); diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index 6a1527745..780607871 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -234,7 +234,7 @@ void spawnfunc_item_key() self.message = strzone(strcat("You've picked up the ", self.netname, "!")); if (self.noise == "") - self.noise = "misc/itempickup.wav"; + self.noise = SND(ITEMPICKUP); // save the name for later item_keys_names[lowestbit(self.itemkeys)] = self.netname; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index e401b53cf..b4ed2d4d6 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -762,14 +762,6 @@ float sound_allowed(float destin, entity e) return true; } -#undef sound -void sound(entity e, float chan, string samp, float vol, float attenu) -{ - if (!sound_allowed(MSG_BROADCAST, e)) - return; - sound7(e, chan, samp, vol, attenu, 0, 0); -} - void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float attenu) { float entno, idx; @@ -845,7 +837,7 @@ void stopsoundto(float _dest, entity e, float chan) if (entno >= 8192 || chan < 0 || chan > 7) { float idx, sflags; - idx = precache_sound_index("misc/null.wav"); + idx = precache_sound_index(SND(Null)); sflags = SND_LARGEENTITY; if (idx >= 256) sflags |= SND_LARGESOUND; @@ -893,7 +885,7 @@ float spamsound(entity e, float chan, string samp, float vol, float _atten) if (time > e.spamtime) { e.spamtime = time; - sound(e, chan, samp, vol, _atten); + _sound(e, chan, samp, vol, _atten); return true; } return false; @@ -918,7 +910,7 @@ void play2all(string samp) if (autocvar_bot_sound_monopoly) return; - sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE); + _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE); } void PrecachePlayerSounds(string f); diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 060752c11..988534e2b 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -239,7 +239,7 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype) // messages and sounds Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT_4(flag, INFO_CTF_LOST_) : INFO_CTF_LOST_NEUTRAL), player.netname); - sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE); + _sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE); ctf_EventLog("dropped", player.team, player); // scoring @@ -296,7 +296,7 @@ void ctf_Handle_Retrieve(entity flag, entity player) flag.ctf_status = FLAG_CARRY; // messages and sounds - sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM); + _sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM); ctf_EventLog("receive", flag.team, player); FOR_EACH_REALPLAYER(tmp_player) @@ -363,7 +363,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype) flag.ctf_status = FLAG_PASSING; // other - sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM); + _sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM); WarpZone_TrailParticles(world, _particleeffectnum(flag.passeffect), player.origin, targ_origin); ctf_EventLog("pass", flag.team, player); break; @@ -436,7 +436,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype) // messages and sounds Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((enemy_flag.team) ? APP_TEAM_ENT_4(enemy_flag, CENTER_CTF_CAPTURE_) : CENTER_CTF_CAPTURE_NEUTRAL)); ctf_CaptureRecord(enemy_flag, player); - sound(player, CH_TRIGGER, ((ctf_oneflag) ? player_team_flag.snd_flag_capture : ((DIFF_TEAM(player, flag)) ? enemy_flag.snd_flag_capture : flag.snd_flag_capture)), VOL_BASE, ATTEN_NONE); + _sound(player, CH_TRIGGER, ((ctf_oneflag) ? player_team_flag.snd_flag_capture : ((DIFF_TEAM(player, flag)) ? enemy_flag.snd_flag_capture : flag.snd_flag_capture)), VOL_BASE, ATTEN_NONE); switch(capturetype) { @@ -485,7 +485,7 @@ void ctf_Handle_Return(entity flag, entity player) Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_4(flag, CENTER_CTF_RETURN_)); Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(flag, INFO_CTF_RETURN_), player.netname); } - sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE); + _sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE); ctf_EventLog("return", flag.team, player); // scoring @@ -573,7 +573,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) else Send_Notification(NOTIF_ONE, tmp_entity, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), player.netname); - sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE); + _sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE); // scoring PlayerScore_Add(player, SP_CTF_PICKUPS, 1); @@ -641,7 +641,7 @@ void ctf_CheckFlagReturn(entity flag, int returntype) case RETURN_TIMEOUT: { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT_4(flag, INFO_CTF_FLAGRETURN_TIMEOUT_) : INFO_CTF_FLAGRETURN_TIMEOUT_NEUTRAL)); break; } } - sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE); + _sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE); ctf_EventLog("returned", flag.team, world); ctf_RespawnFlag(flag); } @@ -941,7 +941,7 @@ void ctf_FlagTouch() if(time > self.wait) // if we haven't in a while, play a sound/effect { Send_Effect_(self.toucheffect, self.origin, '0 0 0', 1); - sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM); self.wait = time + FLAG_TOUCHRATE; } return; @@ -1133,22 +1133,18 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e set_flag_string(flag, capeffect, "%s_cap", teamname); // sounds - set_flag_string(flag, snd_flag_taken, "ctf/%s_taken.wav", teamname); - set_flag_string(flag, snd_flag_returned, "ctf/%s_returned.wav", teamname); - set_flag_string(flag, snd_flag_capture, "ctf/%s_capture.wav", teamname); - set_flag_string(flag, snd_flag_dropped, "ctf/%s_dropped.wav", teamname); - if(flag.snd_flag_respawn == "") { flag.snd_flag_respawn = "ctf/flag_respawn.wav"; } // if there is ever a team-based sound for this, update the code to match. - if(flag.snd_flag_touch == "") { flag.snd_flag_touch = "ctf/touch.wav"; } // again has no team-based sound - if(flag.snd_flag_pass == "") { flag.snd_flag_pass = "ctf/pass.wav"; } // same story here - - // precache - precache_sound(flag.snd_flag_taken); - precache_sound(flag.snd_flag_returned); - precache_sound(flag.snd_flag_capture); + flag.snd_flag_taken = SND(CTF_TAKEN(teamname)); + flag.snd_flag_returned = SND(CTF_RETURNED(teamname)); + flag.snd_flag_capture = SND(CTF_CAPTURE(teamname)); + flag.snd_flag_dropped = SND(CTF_DROPPED(teamname)); + if (flag.snd_flag_respawn == "") flag.snd_flag_respawn = SND(CTF_RESPAWN); // if there is ever a team-based sound for this, update the code to match. precache_sound(flag.snd_flag_respawn); - precache_sound(flag.snd_flag_dropped); + if (flag.snd_flag_touch == "") flag.snd_flag_touch = SND(CTF_TOUCH); // again has no team-based sound precache_sound(flag.snd_flag_touch); + if (flag.snd_flag_pass == "") flag.snd_flag_pass = SND(CTF_PASS); // same story here precache_sound(flag.snd_flag_pass); + + // precache precache_model(flag.model); // appearence diff --git a/qcsrc/server/mutators/gamemode_domination.qc b/qcsrc/server/mutators/gamemode_domination.qc index dbf8e1ef8..66f4c8da3 100644 --- a/qcsrc/server/mutators/gamemode_domination.qc +++ b/qcsrc/server/mutators/gamemode_domination.qc @@ -61,9 +61,9 @@ void dompoint_captured () if (head.noise != "") if(self.enemy) - sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); + _sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); else - sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM); if (head.noise1 != "") play2all(head.noise1); @@ -581,12 +581,12 @@ void dom_spawnpoint(vector org) // spawn some default teams if the map is not set up for domination void dom_spawnteams(float teams) { - dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point"); - dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point"); + dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND(DOM_CLAIM), "", "Red team has captured a control point"); + dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, SND(DOM_CLAIM), "", "Blue team has captured a control point"); if(teams >= 3) - dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point"); + dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, SND(DOM_CLAIM), "", "Yellow team has captured a control point"); if(teams >= 4) - dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point"); + dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, SND(DOM_CLAIM), "", "Pink team has captured a control point"); dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", ""); } diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index e0d4fd954..b265e41d3 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -53,7 +53,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated WaypointSprite_Spawn(WP_KaBall, 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); - sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + sound(self, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) } void ka_TimeScoring() @@ -82,7 +82,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth if (!IS_PLAYER(other)) { // The ball just touched an object, most likely the world Send_Effect(EFFECT_BALL_SPARKS, self.origin, '0 0 0', 1); - sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM); return; } else if(self.wait > time) { return; } @@ -112,7 +112,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname); Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname); Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF); - sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + sound(self.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) // scoring PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1); @@ -154,7 +154,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los ka_EventLog("dropped", plyr); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname); Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname); - sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + sound(other, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) // scoring // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless. diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index 56e55d86d..c02b42513 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -63,12 +63,6 @@ float kh_interferemsg_time, kh_interferemsg_team; .float kh_previous_owner_playerid; .float kh_cp_duration; -string kh_sound_capture = "kh/capture.wav"; -string kh_sound_destroy = "kh/destroy.wav"; -string kh_sound_drop = "kh/drop.wav"; -string kh_sound_collect = "kh/collect.wav"; -string kh_sound_alarm = "kh/alarm.wav"; // the new siren/alarm - float kh_key_dropped, kh_key_carried; const float ST_KH_CAPS = 1; @@ -430,7 +424,7 @@ void kh_Key_Damage(entity inflictor, entity attacker, float damage, int deathtyp void kh_Key_Collect(entity key, entity player) //a player picks up a dropped key { - sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTEN_NORM); + sound(player, CH_TRIGGER, SND_KH_COLLECT, VOL_BASE, ATTEN_NORM); if(key.kh_dropperteam != player.team) { @@ -575,7 +569,7 @@ void kh_WinnerTeam(float teem) // runs when a team wins // Samual: Teem?.... TE midpoint = midpoint * (1 / kh_teams); te_customflash(midpoint, 1000, 1, Team_ColorRGB(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component - play2all(kh_sound_capture); + play2all(SND(KH_CAPTURE)); kh_FinishRound(); } @@ -664,7 +658,7 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(lostkey, INFO_KEYHUNT_LOST_), lostkey.kh_previous_owner.netname); - play2all(kh_sound_destroy); + play2all(SND(KH_DESTROY)); te_tarexplosion(lostkey.origin); kh_FinishRound(); @@ -696,7 +690,7 @@ void kh_Key_Think() // runs all the time { if(self.siren_time < time) { - sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTEN_NORM); // play a simple alarm + sound(self.owner, CH_TRIGGER, SND_KH_ALARM, VOL_BASE, ATTEN_NORM); // play a simple alarm self.siren_time = time + 2.5; // repeat every 2.5 seconds } @@ -832,7 +826,7 @@ void kh_Key_DropOne(entity key) key.pushltime = time + autocvar_g_balance_keyhunt_protecttime; key.kh_dropperteam = key.team; - sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTEN_NORM); + sound(player, CH_TRIGGER, SND_KH_DROP, VOL_BASE, ATTEN_NORM); } void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies @@ -858,7 +852,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies if(suicide) key.kh_dropperteam = player.team; } - sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTEN_NORM); + sound(player, CH_TRIGGER, SND_KH_DROP, VOL_BASE, ATTEN_NORM); } } @@ -1003,12 +997,6 @@ float kh_HandleFrags(entity attacker, entity targ, float f) // adds to the play void kh_Initialize() // sets up th KH environment { - precache_sound(kh_sound_capture); - precache_sound(kh_sound_destroy); - precache_sound(kh_sound_drop); - precache_sound(kh_sound_collect); - precache_sound(kh_sound_alarm); // the new siren - // setup variables kh_teams = autocvar_g_keyhunt_teams_override; if(kh_teams < 2) diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 1d159cea7..a318748fd 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -207,7 +207,7 @@ void InitBall(void) self.teamtime = 0; self.pusher = world; self.team = false; - sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM); WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); LogNB("init", world); } @@ -254,7 +254,7 @@ void football_touch(void) { if(time > self.lastground + 0.1) { - sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); self.lastground = time; } if(vlen(self.velocity) && !self.cnt) @@ -310,7 +310,7 @@ void basketball_touch(void) } else if(other.solid == SOLID_BSP) { - sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); + _sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); if(vlen(self.velocity) && !self.cnt) self.nextthink = min(time + autocvar_g_nexball_delay_idle, self.teamtime); } @@ -376,7 +376,7 @@ void GoalTouch(void) pscore = 1; } - sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NONE); + _sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NONE); if(ball.team && pscore) { @@ -515,13 +515,13 @@ void SpawnBall(void) if(!autocvar_g_nexball_sound_bounce) self.noise = ""; else if(self.noise == "") - self.noise = "sound/nexball/bounce.wav"; + self.noise = SND(NB_BOUNCE); //bounce sound placeholder (FIXME) if(self.noise1 == "") - self.noise1 = "sound/nexball/drop.wav"; + self.noise1 = SND(NB_DROP); //ball drop sound placeholder (FIXME) if(self.noise2 == "") - self.noise2 = "sound/nexball/steal.wav"; + self.noise2 = SND(NB_STEAL); //stealing sound placeholder (FIXME) if(self.noise) precache_sound(self.noise); precache_sound(self.noise1); @@ -623,7 +623,7 @@ void spawnfunc_nexball_fault(void) {SELFPARAM(); self.team = GOAL_FAULT; if(self.noise == "") - self.noise = "misc/typehit.wav"; + self.noise = SND(TYPEHIT); SpawnGoal(); } @@ -631,7 +631,7 @@ void spawnfunc_nexball_out(void) {SELFPARAM(); self.team = GOAL_OUT; if(self.noise == "") - self.noise = "misc/typehit.wav"; + self.noise = SND(TYPEHIT); SpawnGoal(); } @@ -705,7 +705,7 @@ void W_Nexball_Touch(void) if(!attacker.ballcarried) { LogNB("stole", attacker); - sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM); + _sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM); if(SAME_TEAM(attacker, other) && time > attacker.teamkill_complain) { @@ -727,7 +727,7 @@ void W_Nexball_Attack(float t) if(!(ball = self.ballcarried)) return; - W_SetupShot(self, false, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0); + W_SetupShot(self, false, 4, SND(NB_SHOOT1), CH_WEAPON_A, 0); tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, world); if(trace_startsolid) { @@ -761,7 +761,7 @@ void W_Nexball_Attack2(void) if(self.ballcarried.enemy) { entity _ball = self.ballcarried; - W_SetupShot(self, false, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0); + W_SetupShot(self, false, 4, SND(NB_SHOOT1), CH_WEAPON_A, 0); DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32)); _ball.think = W_Nexball_Think; _ball.nextthink = time; @@ -774,7 +774,7 @@ void W_Nexball_Attack2(void) entity missile; if(!(balls & BALL_BASKET)) return; - W_SetupShot(self, false, 2, "nexball/shoot2.wav", CH_WEAPON_A, 0); + W_SetupShot(self, false, 2, SND(NB_SHOOT2), CH_WEAPON_A, 0); missile = spawn(); missile.owner = self; diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index bcdb833b0..3fccbe34c 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -31,7 +31,7 @@ void ons_CaptureShield_Touch() if(IS_REAL_CLIENT(other)) { - play2(other, "onslaught/damageblockedbyshield.wav"); + play2(other, SND(ONS_DAMAGEBLOCKEDBYSHIELD)); if(self.enemy.classname == "onslaught_generator") Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_GENERATOR_SHIELDED); @@ -353,7 +353,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag if (time > self.pain_finished) if (IS_PLAYER(attacker)) { - play2(attacker, "onslaught/damageblockedbyshield.wav"); + play2(attacker, SND(ONS_DAMAGEBLOCKEDBYSHIELD)); self.pain_finished = time + 1; attacker.typehitsound += 1; // play both sounds (shield is way too quiet) } @@ -364,7 +364,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag if(IS_PLAYER(attacker)) if(time - ons_notification_time[self.team] > 10) { - play2team(self.team, "onslaught/controlpoint_underattack.wav"); + play2team(self.team, SND(ONS_CONTROLPOINT_UNDERATTACK)); ons_notification_time[self.team] = time; } @@ -378,13 +378,13 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag pointparticles(particleeffectnum(EFFECT_SPARKS), hitloc, force*-1, 1); //sound on every hit if (random() < 0.5) - sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_HIT1, VOL_BASE+0.3, ATTEN_NORM); else - sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_HIT2, VOL_BASE+0.3, ATTEN_NORM); if (self.health < 0) { - sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(EFFECT_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); @@ -490,9 +490,9 @@ void ons_ControlPoint_Icon_Think() Send_Effect(EFFECT_ELECTRIC_SPARKS, self.origin + randompos('-10 -10 -20', '10 10 20'), '0 0 0', 1); if(random() > 0.8) - sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_PAIN, SND_ONS_SPARK1, VOL_BASE, ATTEN_NORM); else if (random() > 0.5) - sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_PAIN, SND_ONS_SPARK2, VOL_BASE, ATTEN_NORM); } } @@ -516,7 +516,7 @@ void ons_ControlPoint_Icon_BuildThink() self.health = self.max_health; self.count = autocvar_g_onslaught_cp_regen * ONS_CP_THINKRATE; // slow repair rate from now on self.think = ons_ControlPoint_Icon_Think; - sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_CONTROLPOINT_BUILT, VOL_BASE, ATTEN_NORM); self.owner.iscaptured = true; self.solid = SOLID_BBOX; @@ -572,7 +572,7 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player) e.colormap = 1024 + (e.team - 1) * 17; e.count = (e.max_health - e.health) * ONS_CP_THINKRATE / autocvar_g_onslaught_cp_buildtime; // how long it takes to build - sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM); + sound(e, CH_TRIGGER, SND_ONS_CONTROLPOINT_BUILD, VOL_BASE, ATTEN_NORM); cp.goalentity = e; cp.team = e.team; @@ -829,7 +829,7 @@ void ons_GeneratorDamage(entity inflictor, entity attacker, float damage, int de if (time > self.pain_finished) if (IS_PLAYER(attacker)) { - play2(attacker, "onslaught/damageblockedbyshield.wav"); + play2(attacker, SND(ONS_DAMAGEBLOCKEDBYSHIELD)); attacker.typehitsound += 1; self.pain_finished = time + 1; } @@ -840,7 +840,7 @@ void ons_GeneratorDamage(entity inflictor, entity attacker, float damage, int de self.pain_finished = time + 10; entity head; FOR_EACH_REALPLAYER(head) if(SAME_TEAM(head, self)) { Send_Notification(NOTIF_ONE, head, MSG_CENTER, CENTER_GENERATOR_UNDERATTACK); } - play2team(self.team, "onslaught/generator_underattack.wav"); + play2team(self.team, SND(ONS_GENERATOR_UNDERATTACK)); } } self.health = self.health - damage; @@ -881,7 +881,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, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); } else { @@ -890,9 +890,9 @@ void ons_GeneratorDamage(entity inflictor, entity attacker, float damage, int de //sound on every hit if (random() < 0.5) - sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_HIT1, VOL_BASE, ATTEN_NORM); else - sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_ONS_HIT2, VOL_BASE, ATTEN_NORM); } self.SendFlags |= GSF_STATUS; @@ -912,7 +912,7 @@ void ons_GeneratorThink() if(SAME_TEAM(e, self)) { Send_Notification(NOTIF_ONE, e, MSG_CENTER, CENTER_ONS_NOTSHIELDED_TEAM); - soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTEN_NONE); // FIXME: unique sound? + soundto(MSG_ONE, e, CHAN_AUTO, SND(KH_ALARM), VOL_BASE, ATTEN_NONE); // FIXME: unique sound? } else Send_Notification(NOTIF_ONE, e, MSG_CENTER, APP_TEAM_NUM_4(self.team, CENTER_ONS_NOTSHIELDED_)); @@ -1076,7 +1076,7 @@ bool Onslaught_CheckWinner() if (!wpforenemy_announced) { Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_CONTROLPOINT); - sound(world, CH_INFO, "onslaught/generator_decay.wav", VOL_BASE, ATTEN_NONE); + sound(world, CH_INFO, SND_ONS_GENERATOR_DECAY, VOL_BASE, ATTEN_NONE); wpforenemy_announced = true; } @@ -1130,7 +1130,7 @@ bool Onslaught_CheckWinner() ons_stalemate = false; - play2all(sprintf("ctf/%s_capture.wav", Static_Team_ColorName_Lower(winner_team))); + play2all(SND(CTF_CAPTURE(Static_Team_ColorName_Lower(winner_team)))); round_handler_Init(7, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit); @@ -1639,7 +1639,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe if ( tele_effects ) { Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1); - sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM); + sound (player, CH_TRIGGER, SND_TELEPORT, VOL_BASE, ATTEN_NORM); } setorigin(player, loc); player.angles = '0 1 0' * ( theta * RAD2DEG + 180 ); diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index 38181fd53..fb0c2b7b6 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -140,7 +140,7 @@ void buff_Respawn(entity ent) WaypointSprite_Ping(ent.buff_waypoint); - sound(ent, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + sound(ent, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) } void buff_Touch() @@ -178,7 +178,7 @@ void buff_Touch() Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ITEM_BUFF_LOST, other.netname, buffid); other.buffs = 0; - //sound(other, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM); + //sound(other, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM); } else { return; } // do nothing } @@ -191,7 +191,7 @@ void buff_Touch() Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid); Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); - sound(other, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); + sound(other, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM); other.buffs |= (self.buffs); } @@ -271,7 +271,7 @@ void buff_Think() if(!self.buff_activetime) { self.buff_active = true; - sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTN_NORM); Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1); } } @@ -596,7 +596,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerUseKey) Send_Notification(NOTIF_ALL_EXCEPT, self, MSG_INFO, INFO_ITEM_BUFF_LOST, self.netname, buffid); self.buffs = 0; - sound(self, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM); return true; } return false; @@ -661,8 +661,8 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey) Send_Effect(EFFECT_ELECTRO_COMBO, their_org, '0 0 0', 1); Send_Effect(EFFECT_ELECTRO_COMBO, my_org, '0 0 0', 1); - sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM); - sound(closest, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NORM); + sound(closest, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NORM); // TODO: add a counter to handle how many times one can teleport, and a delay to prevent spam self.buffs = 0; @@ -771,7 +771,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink) if(buff_lost >= 2) { Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_BUFF_DROP, buffid); // TODO: special timeout message? - sound(self, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM); } self.buffs = 0; } diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 7488fd295..67be08290 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -187,7 +187,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups) if (self.items & ITEM_Invisibility.m_itemid) { - play_countdown(self.strength_finished, "misc/poweroff.wav"); + play_countdown(self.strength_finished, SND(POWEROFF)); if (time > self.strength_finished) { self.alpha = default_player_alpha; @@ -210,7 +210,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups) if (self.items & ITEM_Speed.m_itemid) { - play_countdown(self.invincible_finished, "misc/poweroff.wav"); + play_countdown(self.invincible_finished, SND(POWEROFF)); if (time > self.invincible_finished) { self.items &= ~ITEM_Speed.m_itemid; diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index a1f55c297..99941a100 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -121,7 +121,7 @@ void nade_napalm_ball() entity proj; vector kick; - spamsound(self, CH_SHOTS, W_Sound("fireball_fire"), VOL_BASE, ATTEN_NORM); + spamsound(self, CH_SHOTS, SND(FIREBALL_FIRE), VOL_BASE, ATTEN_NORM); proj = spawn (); proj.owner = self.owner; @@ -260,7 +260,7 @@ void nade_ice_think() default: expef = EFFECT_NADE_NEUTRAL_EXPLODE; break; } Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1); - sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_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); @@ -530,8 +530,8 @@ void nade_boom() if(expef) 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, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); self.event_damage = func_null; // prevent somehow calling damage in the next call @@ -584,7 +584,7 @@ void nade_touch() //UpdateCSQCProjectile(self); if(self.health == self.max_health) { - spamsound(self, CH_SHOTS, W_Sound(strcat("grenade_bounce", ftos(1 + rint(random() * 5)))), VOL_BASE, ATTEN_NORM); + spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTEN_NORM); return; } @@ -594,7 +594,7 @@ void nade_touch() void nade_beep() {SELFPARAM(); - sound(self, CH_SHOTS_SINGLE, "overkill/grenadebip.ogg", VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX)); + sound(self, CH_SHOTS_SINGLE, SND_NADE_BEEP, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX)); self.think = nade_boom; self.nextthink = max(self.wait, time); } @@ -649,7 +649,7 @@ void nade_damage(entity inflictor, entity attacker, float damage, int deathtype, if(self.health == self.max_health) { - sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX)); + sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX)); self.nextthink = max(time + autocvar_g_nades_nade_lifetime, time); self.think = nade_beep; } @@ -759,7 +759,7 @@ void nades_GiveBonus(entity player, float score) if ( player.bonus_nade_score >= 1 ) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_NADE_BONUS); - play2(player,"kh/alarm.wav"); + play2(player, SND(KH_ALARM)); player.bonus_nades++; player.bonus_nade_score -= 1; } diff --git a/qcsrc/server/mutators/mutator_new_toys.qc b/qcsrc/server/mutators/mutator_new_toys.qc index b8891b283..9b51d9abb 100644 --- a/qcsrc/server/mutators/mutator_new_toys.qc +++ b/qcsrc/server/mutators/mutator_new_toys.qc @@ -190,8 +190,10 @@ MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace) MUTATOR_HOOKFUNCTION(nt_FilterItem) {SELFPARAM(); - if(nt_IsNewToy(self.weapon) && autocvar_g_new_toys_use_pickupsound) - self.item_pickupsound = W_Sound("weaponpickup_new_toys"); + if(nt_IsNewToy(self.weapon) && autocvar_g_new_toys_use_pickupsound) { + self.item_pickupsound = string_null; + self.item_pickupsound_ent = SND_WEAPONPICKUP_NEW_TOYS; + } return 0; } diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index 0aef8e9a0..3bc1e7958 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -174,7 +174,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink) { //Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_OVERKILL_CHARGE); self.ok_notice_time = time + 2; - play2(self, W_Sound("dryfire")); + play2(self, SND(DRYFIRE)); } if(self.weaponentity.state != WS_CLEAR) w_ready(); diff --git a/qcsrc/server/mutators/mutator_touchexplode.qc b/qcsrc/server/mutators/mutator_touchexplode.qc index 4f49d550d..faa74bb1d 100644 --- a/qcsrc/server/mutators/mutator_touchexplode.qc +++ b/qcsrc/server/mutators/mutator_touchexplode.qc @@ -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, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_EXPLOSION_SMALL, org, '0 0 0', 1); entity e; diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 509e92051..ed3ffc5e7 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -30,7 +30,7 @@ void sandbox_ObjectFunction_Touch() intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1); - sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM); + _sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM); Send_Effect_(strcat("impact_", self.material), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10 } diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 7501b6360..30fa07384 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -414,14 +414,14 @@ void Portal_Remove(entity portal, float killed) if(killed) { fixedmakevectors(portal.mangle); - sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTEN_NORM); + sound(portal, CH_SHOTS, SND_PORTO_EXPLODE, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_ROCKET_EXPLODE, portal.origin + v_forward * 16, v_forward * 1024, 4); remove(portal); } else { Portal_MakeBrokenPortal(portal); - sound(portal, CH_SHOTS, "porto/expire.wav", VOL_BASE, ATTEN_NORM); + sound(portal, CH_SHOTS, SND_PORTO_EXPIRE, VOL_BASE, ATTEN_NORM); SUB_SetFade(portal, time, 0.5); } } diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 948e2d374..138051827 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -90,7 +90,7 @@ void CreatureFrame (void) if (self.watersound_finished < time) { self.watersound_finished = time + 0.5; - sound (self, CH_PLAYER_SINGLE, "player/lava.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_PLAYER_SINGLE, SND_LAVA, VOL_BASE, ATTEN_NORM); } Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0'); } @@ -99,7 +99,7 @@ void CreatureFrame (void) if (self.watersound_finished < time) { self.watersound_finished = time + 0.5; - sound (self, CH_PLAYER_SINGLE, "player/slime.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_PLAYER_SINGLE, SND_SLIME, VOL_BASE, ATTEN_NORM); } Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0'); } diff --git a/qcsrc/server/sys-pre.qh b/qcsrc/server/sys-pre.qh index bfdcdb860..067e01409 100644 --- a/qcsrc/server/sys-pre.qh +++ b/qcsrc/server/sys-pre.qh @@ -3,7 +3,6 @@ #define objerror builtin_objerror #define droptofloor builtin_droptofloor -#define sound builtin_sound #define remove builtin_remove #define cvar_set builtin_cvar_set #define cvar_string builtin_cvar_string diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 8b5978d96..33232029e 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -436,11 +436,11 @@ void Item_Respawn (void) Item_Show(self, 1); // this is ugly... if(self.items == ITEM_Strength.m_itemid) - sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + sound (self, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTEN_NORM); // play respawn sound else if(self.items == ITEM_Shield.m_itemid) - sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + sound (self, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTEN_NORM); // play respawn sound else - sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + sound (self, CH_TRIGGER, SND_ITEMRESPAWN, VOL_BASE, ATTEN_NORM); // play respawn sound setorigin (self, self.origin); if (Item_ItemsTime_Allow(self.itemdef, self.weapons)) @@ -498,7 +498,7 @@ void Item_RespawnCountdown (void) if(self.waypointsprite_visible_for_player(e)) { msg_entity = e; - soundto(MSG_ONE, this, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + soundto(MSG_ONE, this, CH_TRIGGER, SND(ITEMRESPAWNCOUNTDOWN), VOL_BASE, ATTEN_NORM); // play respawn sound } setself(this); @@ -506,7 +506,7 @@ void Item_RespawnCountdown (void) //WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count); } else - sound(self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound + sound(self, CH_TRIGGER, SND_ITEMRESPAWNCOUNTDOWN, VOL_BASE, ATTEN_NORM); // play respawn sound } } @@ -750,7 +750,7 @@ void Item_Touch (void) other.last_pickup = time; Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); - sound (other, CH_TRIGGER, self.item_pickupsound, VOL_BASE, ATTEN_NORM); + _sound (other, CH_TRIGGER, (self.item_pickupsound ? self.item_pickupsound : self.item_pickupsound_ent.sound_str()), VOL_BASE, ATTEN_NORM); if (self.classname == "droppedweapon") remove (self); @@ -1644,12 +1644,12 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn if(v1 <= v0 - t) { if(snd_decr != "") - sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTEN_NORM); + _sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTEN_NORM); } else if(v0 >= v0 + t) { if(snd_incr != "") - sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTEN_NORM); + _sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTEN_NORM); } } @@ -1815,31 +1815,31 @@ float GiveItems(entity e, float beginarg, float endarg) op = OP_SET; } - POSTGIVE_BIT(e, items, ITEM_JetpackRegen.m_itemid, "misc/itempickup.wav", string_null); - POSTGIVE_BIT(e, items, IT_UNLIMITED_SUPERWEAPONS, "misc/powerup.wav", "misc/poweroff.wav"); - POSTGIVE_BIT(e, items, IT_UNLIMITED_WEAPON_AMMO, "misc/powerup.wav", "misc/poweroff.wav"); - POSTGIVE_BIT(e, items, ITEM_Jetpack.m_itemid, "misc/itempickup.wav", string_null); + POSTGIVE_BIT(e, items, ITEM_JetpackRegen.m_itemid, SND(ITEMPICKUP), string_null); + POSTGIVE_BIT(e, items, IT_UNLIMITED_SUPERWEAPONS, SND(POWERUP), SND(POWEROFF)); + POSTGIVE_BIT(e, items, IT_UNLIMITED_WEAPON_AMMO, SND(POWERUP), SND(POWEROFF)); + POSTGIVE_BIT(e, items, ITEM_Jetpack.m_itemid, SND(ITEMPICKUP), string_null); for(j = WEP_FIRST; j <= WEP_LAST; ++j) { wi = get_weaponinfo(j); if(wi.weapon) { - POSTGIVE_WEAPON(e, j, W_Sound("weaponpickup"), string_null); + POSTGIVE_WEAPON(e, j, SND(WEAPONPICKUP), string_null); if (!(save_weapons & WepSet_FromWeapon(j))) if(e.weapons & WepSet_FromWeapon(j)) WEP_ACTION(wi.weapon, WR_INIT); } } - POSTGIVE_VALUE(e, strength_finished, 1, "misc/powerup.wav", "misc/poweroff.wav"); - POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", "misc/poweroff.wav"); - POSTGIVE_VALUE(e, ammo_nails, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_plasma, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null); - POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null); - POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null); + POSTGIVE_VALUE(e, strength_finished, 1, SND(POWERUP), SND(POWEROFF)); + POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", SND(POWEROFF)); + POSTGIVE_VALUE(e, ammo_nails, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_cells, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_plasma, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_shells, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE(e, ammo_rockets, 0, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, SND(ITEMPICKUP), string_null); + POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND(ARMOR25), string_null); + POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND(MEGAHEALTH), string_null); if(e.superweapons_finished <= 0) if(self.weapons & WEPSET_SUPERWEAPONS) diff --git a/qcsrc/server/weapons/common.qc b/qcsrc/server/weapons/common.qc index db712933d..f1720757f 100644 --- a/qcsrc/server/weapons/common.qc +++ b/qcsrc/server/weapons/common.qc @@ -30,7 +30,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, W_Sound("strength_fire"), VOL_BASE, ATTEN_NORM); + sound(player, CH_TRIGGER, SND_STRENGTH_FIRE, VOL_BASE, ATTEN_NORM); player.prevstrengthsound = time; } player.prevstrengthsoundattempt = time; diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index de240ce2e..ce464c18e 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -63,7 +63,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) if (complain) if(IS_REAL_CLIENT(cl)) { - play2(cl, W_Sound("unavailable")); + play2(cl, SND(UNAVAILABLE)); Send_WeaponComplain (cl, wpn, 0); } return false; @@ -107,7 +107,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) Send_WeaponComplain (cl, wpn, 2); } - play2(cl, W_Sound("unavailable")); + play2(cl, SND(UNAVAILABLE)); } return false; } diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 202b29fda..81261383f 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -177,7 +177,8 @@ 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, string_null, self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue); + self.item_pickupsound_ent = SND_WEAPONPICKUP; #if 0 // WEAPONTODO if (self.modelindex) // don't precache if self was removed WEP_ACTION(e.weapon, WR_INIT); diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 7c033fa88..69821aaaf 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -131,7 +131,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m if (snd != "") { - sound (ent, chan, snd, VOL_BASE, ATTN_NORM); + _sound (ent, chan, snd, VOL_BASE, ATTN_NORM); W_PlayStrengthSound(ent); } @@ -287,7 +287,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f if(f <= 0) continue; - snd = W_Sound(strcat("nexwhoosh", ftos(floor(random() * 3) + 1))); + snd = SND(NEXWHOOSH_RANDOM()); if(!pseudoprojectile) pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 076a172c8..ba33c515f 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -474,7 +474,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, W_Sound("dryfire"), VOL_BASE, ATTEN_NORM); + sound (self, CH_WEAPON_A, SND_DRYFIRE, VOL_BASE, ATTEN_NORM); self.prevdryfire = time; } @@ -732,7 +732,7 @@ void W_WeaponFrame() if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5) { #endif - sound(self, CH_WEAPON_SINGLE, W_Sound("weapon_switch"), VOL_BASE, ATTN_NORM); + sound(self, CH_WEAPON_SINGLE, SND_WEAPON_SWITCH, VOL_BASE, ATTN_NORM); self.weaponentity.state = WS_DROP; weapon_thinkf(WFRAME_DONTCHANGE, oldwep.switchdelay_drop, w_clear); #ifndef INDEPENDENT_ATTACK_FINISHED @@ -927,7 +927,7 @@ void W_Reload(float sent_ammo_min, string sent_sound) { if(IS_REAL_CLIENT(self) && self.reload_complain < time) { - play2(self, W_Sound("unavailable")); + play2(self, SND(UNAVAILABLE)); sprint(self, strcat("You don't have enough ammo to reload the ^2", WEP_NAME(self.weapon), "\n")); self.reload_complain = time + 1; } @@ -951,7 +951,7 @@ void W_Reload(float sent_ammo_min, string sent_sound) // now begin the reloading process - sound(self, CH_WEAPON_SINGLE, self.reload_sound, VOL_BASE, ATTEN_NORM); + _sound(self, CH_WEAPON_SINGLE, self.reload_sound, VOL_BASE, ATTEN_NORM); // do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon, // then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,