From: TimePath Date: Tue, 22 Mar 2016 06:36:31 +0000 (+1100) Subject: Propagate sound references X-Git-Tag: xonotic-v0.8.2~1056 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=02f618451f5c061d2b1e407fac81fed18a636726;p=xonotic%2Fxonotic-data.pk3dir.git Propagate sound references --- diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index bea1b7b6f..cb856ff13 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -755,7 +755,7 @@ void W_Nexball_Attack(float t) if(!(ball = self.ballcarried)) return; - W_SetupShot(self, false, 4, SND(NB_SHOOT1), 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) { @@ -791,7 +791,7 @@ void W_Nexball_Attack2() if(self.ballcarried.enemy) { entity _ball = self.ballcarried; - W_SetupShot(self, false, 4, SND(NB_SHOOT1), 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; @@ -801,7 +801,7 @@ void W_Nexball_Attack2() if(!autocvar_g_nexball_tackling) return; - W_SetupShot(self, false, 2, SND(NB_SHOOT2), CH_WEAPON_A, 0); + W_SetupShot(self, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0); entity missile = new(ballstealer); missile.owner = self; diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index fcac1e409..c67729ee1 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -49,7 +49,7 @@ METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weapon if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) { if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range; actor.enemy = Monster_FindTarget(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(MageSpike_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_MageSpike_FIRE, CH_WEAPON_B, 0); if (!IS_PLAYER(actor)) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin); M_Mage_Attack_Spike(actor, w_shotdir); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index d85b85535..defa719df 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -101,7 +101,7 @@ METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity actor.anim_finished = time + 1; } if (isPlayer) actor.enemy = Monster_FindTarget(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(SpiderAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_SpiderAttack_FIRE, CH_WEAPON_B, 0); if (!isPlayer) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin); M_Spider_Attack_Web(actor); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready); diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index f6e9c1306..1adf8f84c 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -54,7 +54,7 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity TC(WyvernAttack, thiswep); if (fire & 1) if (time > actor.attack_finished_single[0] || weapon_prepareattack(thiswep, actor, weaponentity, false, 1.2)) { - if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, SND(WyvernAttack_FIRE), CH_WEAPON_B, 0); + if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, SND_WyvernAttack_FIRE, CH_WEAPON_B, 0); if (IS_MONSTER(actor)) { actor.attack_finished_single[0] = time + 1.2; actor.anim_finished = time + 1.2; diff --git a/qcsrc/common/mutators/mutator/instagib/instagib.qc b/qcsrc/common/mutators/mutator/instagib/instagib.qc index 33773131a..69bc4b7b9 100644 --- a/qcsrc/common/mutators/mutator/instagib/instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/instagib.qc @@ -198,7 +198,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups) if (self.items & ITEM_Invisibility.m_itemid) { - play_countdown(self.strength_finished, SND(POWEROFF)); + play_countdown(self.strength_finished, SND_POWEROFF); if (time > self.strength_finished) { self.alpha = default_player_alpha; @@ -221,7 +221,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups) if (self.items & ITEM_Speed.m_itemid) { - play_countdown(self.invincible_finished, SND(POWEROFF)); + play_countdown(self.invincible_finished, SND_POWEROFF); if (time > self.invincible_finished) { self.items &= ~ITEM_Speed.m_itemid; diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 16a435dd1..1a82c28a6 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -820,7 +820,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) makevectors(e.v_angle); - W_SetupShot(e, false, false, "", CH_WEAPON_A, 0); + W_SetupShot(e, false, false, SND_Null, CH_WEAPON_A, 0); Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES); diff --git a/qcsrc/common/mutators/mutator/overkill/hmg.qc b/qcsrc/common/mutators/mutator/overkill/hmg.qc index 30473e09b..46f79ccc4 100644 --- a/qcsrc/common/mutators/mutator/overkill/hmg.qc +++ b/qcsrc/common/mutators/mutator/overkill/hmg.qc @@ -72,7 +72,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone W_DecreaseAmmo(WEP_HMG, self, WEP_CVAR(hmg, ammo)); - W_SetupShot (actor, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(hmg, damage)); + W_SetupShot (actor, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR(hmg, damage)); if(!autocvar_g_norecoil) { @@ -143,7 +143,7 @@ METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep)) METHOD(HeavyMachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, WEP_CVAR(hmg, ammo), SND(RELOAD)); + W_Reload(self, WEP_CVAR(hmg, ammo), SND_RELOAD); } METHOD(HeavyMachineGun, wr_suicidemessage, Notification(entity thiswep)) diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index 50362a1de..90af86d58 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -111,7 +111,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) entity flash = spawn (); W_DecreaseAmmo(thiswep, self, WEP_CVAR(rpc, ammo)); - W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, SND(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); @@ -191,7 +191,7 @@ METHOD(RocketPropelledChainsaw, wr_checkammo2, bool(entity thiswep)) METHOD(RocketPropelledChainsaw, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, WEP_CVAR(rpc, ammo), SND(RELOAD)); + W_Reload(self, WEP_CVAR(rpc, ammo), SND_RELOAD); } METHOD(RocketPropelledChainsaw, wr_suicidemessage, Notification(entity thiswep)) diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index fec1e885f..853c3cb92 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -458,11 +458,12 @@ void turret_projectile_damage(entity this, entity inflictor, entity attacker, fl WITH(entity, self, this, W_PrepareExplosionByDamage(this.owner, turret_projectile_explode)); } -entity turret_projectile(string _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim) +entity turret_projectile(Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim) {SELFPARAM(); + TC(Sound, _snd); 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/sv_turrets.qh b/qcsrc/common/turrets/sv_turrets.qh index 2d5a5f5f9..622f2360f 100644 --- a/qcsrc/common/turrets/sv_turrets.qh +++ b/qcsrc/common/turrets/sv_turrets.qh @@ -1,7 +1,7 @@ #ifndef SV_TURRETS_H #define SV_TURRETS_H -entity turret_projectile(string _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim); +entity turret_projectile(Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim); void turret_projectile_explode(); float turret_validate_target(entity e_turret, entity e_target, float validate_flags); float turret_firecheck(); diff --git a/qcsrc/common/turrets/turret/ewheel_weapon.qc b/qcsrc/common/turrets/turret/ewheel_weapon.qc index e7ce70500..8f25a7c08 100644 --- a/qcsrc/common/turrets/turret/ewheel_weapon.qc +++ b/qcsrc/common/turrets/turret/ewheel_weapon.qc @@ -23,7 +23,7 @@ METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, .entity weapon if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(EWheelAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_EWheelAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; @@ -32,7 +32,7 @@ METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, .entity weapon turret_do_updates(actor); - entity missile = turret_projectile(SND(LASERGUN_FIRE), 1, 0, DEATH_TURRET_EWHEEL.m_id, PROJECTILE_BLASTER, true, true); + entity missile = turret_projectile(SND_LASERGUN_FIRE, 1, 0, DEATH_TURRET_EWHEEL.m_id, PROJECTILE_BLASTER, true, true); missile.missile_flags = MIF_SPLASH; Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1); diff --git a/qcsrc/common/turrets/turret/flac_weapon.qc b/qcsrc/common/turrets/turret/flac_weapon.qc index f4bc70ccc..85eccb6e1 100644 --- a/qcsrc/common/turrets/turret/flac_weapon.qc +++ b/qcsrc/common/turrets/turret/flac_weapon.qc @@ -23,7 +23,7 @@ METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponen if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(FlacAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_FlacAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; @@ -33,7 +33,7 @@ METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponen turret_tag_fire_update(); - entity proj = turret_projectile(SND(HAGAR_FIRE), 5, 0, DEATH_TURRET_FLAC.m_id, PROJECTILE_HAGAR, true, true); + entity proj = turret_projectile(SND_HAGAR_FIRE, 5, 0, DEATH_TURRET_FLAC.m_id, PROJECTILE_HAGAR, true, true); proj.missile_flags = MIF_SPLASH | MIF_PROXY; proj.think = turret_flac_projectile_think_explode; proj.nextthink = time + actor.tur_impacttime + (random() * 0.01 - random() * 0.01); diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qc b/qcsrc/common/turrets/turret/hellion_weapon.qc index 0b118be13..99029cd1e 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qc +++ b/qcsrc/common/turrets/turret/hellion_weapon.qc @@ -26,7 +26,7 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(HellionAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_HellionAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; @@ -40,7 +40,7 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo actor.tur_shotorg = gettaginfo(actor.tur_head, gettagindex(actor.tur_head, "tag_fire2")); } - entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HELLION.m_id, PROJECTILE_ROCKET, false, false); + entity missile = turret_projectile(SND_ROCKET_FIRE, 6, 10, DEATH_TURRET_HELLION.m_id, PROJECTILE_ROCKET, false, false); te_explosion (missile.origin); missile.think = turret_hellion_missile_think; missile.nextthink = time; diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index 5060e5772..91d138ee0 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -31,13 +31,13 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(HunterKillerAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_HunterKillerAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready); } - entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HK.m_id, PROJECTILE_ROCKET, false, false); + entity missile = turret_projectile(SND_ROCKET_FIRE, 6, 10, DEATH_TURRET_HK.m_id, PROJECTILE_ROCKET, false, false); te_explosion (missile.origin); missile.think = turret_hk_missile_think; diff --git a/qcsrc/common/turrets/turret/machinegun_weapon.qc b/qcsrc/common/turrets/turret/machinegun_weapon.qc index 7bd8b4086..29c1c1ae9 100644 --- a/qcsrc/common/turrets/turret/machinegun_weapon.qc +++ b/qcsrc/common/turrets/turret/machinegun_weapon.qc @@ -24,7 +24,7 @@ METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, .ent if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(machinegun, sustained_refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(MachineGunTurretAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_MachineGunTurretAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; diff --git a/qcsrc/common/turrets/turret/mlrs_weapon.qc b/qcsrc/common/turrets/turret/mlrs_weapon.qc index 864c37cda..592657d85 100644 --- a/qcsrc/common/turrets/turret/mlrs_weapon.qc +++ b/qcsrc/common/turrets/turret/mlrs_weapon.qc @@ -22,7 +22,7 @@ METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity we if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(machinegun, sustained_refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(MLRSTurretAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_MLRSTurretAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; @@ -30,7 +30,7 @@ METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity we weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready); } turret_tag_fire_update(); - entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_MLRS.m_id, PROJECTILE_ROCKET, true, true); + entity missile = turret_projectile(SND_ROCKET_FIRE, 6, 10, DEATH_TURRET_MLRS.m_id, PROJECTILE_ROCKET, true, true); missile.nextthink = time + max(actor.tur_impacttime,(actor.shot_radius * 2) / actor.shot_speed); missile.missile_flags = MIF_SPLASH; te_explosion (missile.origin); diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qc b/qcsrc/common/turrets/turret/phaser_weapon.qc index 8c1134eaf..a82f949ad 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qc +++ b/qcsrc/common/turrets/turret/phaser_weapon.qc @@ -25,7 +25,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(PhaserTurretAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_PhaserTurretAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; diff --git a/qcsrc/common/turrets/turret/plasma_weapon.qc b/qcsrc/common/turrets/turret/plasma_weapon.qc index 65e182be3..eef648448 100644 --- a/qcsrc/common/turrets/turret/plasma_weapon.qc +++ b/qcsrc/common/turrets/turret/plasma_weapon.qc @@ -21,13 +21,13 @@ METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weapon if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(PlasmaAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_PlasmaAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready); } - entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA.m_id, PROJECTILE_ELECTRO_BEAM, true, true); + entity missile = turret_projectile(SND_HAGAR_FIRE, 1, 0, DEATH_TURRET_PLASMA.m_id, PROJECTILE_ELECTRO_BEAM, true, true); missile.missile_flags = MIF_SPLASH; Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1); } diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qc b/qcsrc/common/turrets/turret/tesla_weapon.qc index 7e9108cb4..1c0ed5272 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qc +++ b/qcsrc/common/turrets/turret/tesla_weapon.qc @@ -23,7 +23,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(TeslaCoilTurretAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_TeslaCoilTurretAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; diff --git a/qcsrc/common/turrets/turret/walker_weapon.qc b/qcsrc/common/turrets/turret/walker_weapon.qc index a3150d820..c1214758d 100644 --- a/qcsrc/common/turrets/turret/walker_weapon.qc +++ b/qcsrc/common/turrets/turret/walker_weapon.qc @@ -22,7 +22,7 @@ METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, .entity if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND(WalkerTurretAttack_FIRE), CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, v_forward, false, 0, SND_WalkerTurretAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index a3c07a03d..72334b100 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -18,12 +18,13 @@ entity AuxiliaryXhair[MAX_AXH]; float alarm1time; float alarm2time; -void vehicle_alarm(entity e, int ch, string s0und) +void vehicle_alarm(entity e, int ch, Sound s0und) { + TC(Sound, 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(entity this) @@ -231,7 +232,7 @@ void Vehicles_drawHUD( if(alarm1time < time) { alarm1time = time + 2; - vehicle_alarm(self, CH_PAIN_SINGLE, SND(VEH_ALARM)); + vehicle_alarm(self, CH_PAIN_SINGLE, SND_VEH_ALARM); } drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL); } @@ -239,7 +240,7 @@ void Vehicles_drawHUD( { if(alarm1time) { - vehicle_alarm(self, CH_PAIN_SINGLE, SND(Null)); + vehicle_alarm(self, CH_PAIN_SINGLE, SND_Null); alarm1time = 0; } drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); @@ -253,7 +254,7 @@ void Vehicles_drawHUD( if(alarm2time < time) { alarm2time = time + 1; - vehicle_alarm(self, CH_TRIGGER_SINGLE, SND(VEH_ALARM_SHIELD)); + vehicle_alarm(self, CH_TRIGGER_SINGLE, SND_VEH_ALARM_SHIELD); } drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL); } @@ -261,7 +262,7 @@ void Vehicles_drawHUD( { if(alarm2time) { - vehicle_alarm(self, CH_TRIGGER_SINGLE, SND(Null)); + 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 699c13f27..bbc128531 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -232,12 +232,13 @@ void vehicles_projectile_explode() remove (self); } -entity vehicles_projectile(string _mzlfx, string _mzlsound, +entity vehicles_projectile(string _mzlfx, Sound _mzlsound, vector _org, vector _vel, float _dmg, float _radi, float _force, float _size, int _deahtype, float _projtype, float _health, bool _cull, bool _clianim, entity _owner) {SELFPARAM(); + TC(Sound, _mzlsound); entity proj; proj = spawn(); @@ -271,8 +272,8 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound, else proj.flags = FL_PROJECTILE | FL_NOTARGET; - if(_mzlsound) - _sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM); + if(_mzlsound != SND_Null) + sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM); if(_mzlfx) Send_Effect_(_mzlfx, proj.origin, proj.velocity, 1); diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc index db456825b..14f4fbf6a 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc @@ -24,7 +24,7 @@ bool bumble_raygun_send(entity this, 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, SND(VEH_BUMBLEBEE_FIRE), + 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.m_id, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner); diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qc b/qcsrc/common/vehicles/vehicle/racer_weapon.qc index b8fbc11d1..6b9fd722b 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qc +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qc @@ -53,10 +53,10 @@ METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, .entity weapone veh.vehicle_energy -= autocvar_g_vehicle_racer_cannon_cost; veh.wait = time; } - if (isPlayer) W_SetupShot_Dir(player, v_forward, false, 0, SND(Null), CH_WEAPON_B, 0); + if (isPlayer) W_SetupShot_Dir(player, v_forward, false, 0, SND_Null, CH_WEAPON_B, 0); vector org = w_shotorg; vector dir = w_shotdir; - entity bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH.eent_eff_name, SND(LASERGUN_FIRE), + entity bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH.eent_eff_name, SND_LASERGUN_FIRE, org, 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.m_id, PROJECTILE_WAKICANNON, 0, true, true, player); @@ -65,7 +65,7 @@ METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, .entity weapone } if (fire & 2) if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) { - if (isPlayer) W_SetupShot_Dir(actor, v_forward, false, 0, SND(Null), CH_WEAPON_B, 0); + if (isPlayer) W_SetupShot_Dir(actor, v_forward, false, 0, SND_Null, CH_WEAPON_B, 0); racer_fire_rocket(player, w_shotorg, w_shotdir, NULL); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, 0, w_ready); } @@ -85,7 +85,7 @@ void racer_rocket_groundhugger(); void racer_fire_rocket(entity player, vector org, vector dir, entity trg) {SELFPARAM(); - entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, SND(ROCKET_FIRE), + entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE, org, dir * 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.m_id, PROJECTILE_WAKIROCKET, 20, false, false, player); diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index 819d8ba0f..0f8b5afd2 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -59,7 +59,7 @@ METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weapon float t = autocvar_g_vehicle_raptor_cannon_refire * (1 + veh.misc_bulletcounter == 4); if (fire & 1) if (weapon_prepareattack(thiswep, player, weaponentity, false, t)) { - if (isPlayer) W_SetupShot_Dir(player, v_forward, false, 0, SND(Null), CH_WEAPON_B, 0); + if (isPlayer) W_SetupShot_Dir(player, v_forward, false, 0, SND_Null, CH_WEAPON_B, 0); vector org = w_shotorg; vector dir = w_shotdir; if (veh) { @@ -70,7 +70,7 @@ METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weapon veh.vehicle_energy -= autocvar_g_vehicle_raptor_cannon_cost; actor.cnt = time; } - vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, SND(LASERGUN_FIRE), + vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, SND_LASERGUN_FIRE, org, normalize(dir + 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.m_id, PROJECTILE_RAPTORCANNON, 0, true, true, player); diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index 7266fc32e..2f08ef776 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -218,7 +218,7 @@ void spiderbot_rocket_do() switch(self.vehicle_weapon2mode) { case SBRM_VOLLY: - rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(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.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner); @@ -232,7 +232,7 @@ void spiderbot_rocket_do() self.wait = -10; break; case SBRM_GUIDE: - rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(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.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner); @@ -244,7 +244,7 @@ void spiderbot_rocket_do() break; case SBRM_ARTILLERY: - rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(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.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner); diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 6ac3e9274..b8605c93b 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -266,7 +266,7 @@ void W_Arc_Attack_Bolt(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR(arc, bolt_ammo)); - W_SetupShot(self, false, 2, SND(LASERGUN_FIRE), CH_WEAPON_A, WEP_CVAR(arc, bolt_damage)); + W_SetupShot(self, false, 2, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR(arc, bolt_damage)); Send_Effect(EFFECT_ARC_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -405,7 +405,7 @@ void W_Arc_Beam_Think() self.owner, true, 0, - "", + SND_Null, 0, WEP_CVAR(arc, beam_damage) * coefficient, WEP_CVAR(arc, beam_range) @@ -693,7 +693,7 @@ void W_Arc_Beam(float burst) void Arc_Smoke() {SELFPARAM(); makevectors(self.v_angle); - W_SetupShot_Range(self,true,0,"",0,0,0); + W_SetupShot_Range(self,true,0,SND_Null,0,0,0); vector smoke_origin = w_shotorg + self.velocity*frametime; if ( self.arc_overheat > time ) diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 362666d27..fae9e9f1a 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -101,7 +101,7 @@ void W_Blaster_Attack( {SELFPARAM(); vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD); - W_SetupShot_Dir(actor, s_forward, false, 3, SND(LASERGUN_FIRE), CH_WEAPON_B, atk_damage); + W_SetupShot_Dir(actor, 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 = new(blasterbolt); diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 6ad5f957a..242980ede 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -359,7 +359,7 @@ void W_Crylink_Attack(Weapon thiswep) if(WEP_CVAR_PRI(crylink, joinexplode)) maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage); - W_SetupShot(self, false, 2, SND(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; @@ -467,7 +467,7 @@ void W_Crylink_Attack2(Weapon thiswep) if(WEP_CVAR_SEC(crylink, joinexplode)) maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage); - W_SetupShot(self, false, 2, SND(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; @@ -655,7 +655,7 @@ METHOD(Crylink, wr_checkammo2, bool(entity thiswep)) } METHOD(Crylink, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND_RELOAD); } METHOD(Crylink, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 53d4b8e94..8a8c4073e 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -354,7 +354,7 @@ void W_Devastator_Attack(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR(devastator, ammo)); - W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, SND(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); @@ -606,7 +606,7 @@ METHOD(Devastator, wr_resetplayer, void(entity thiswep)) } METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, WEP_CVAR(devastator, ammo), SND(RELOAD)); + W_Reload(self, WEP_CVAR(devastator, ammo), SND_RELOAD); } METHOD(Devastator, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index f539b1492..4bae090de 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -261,7 +261,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep) '0 0 -3', false, 2, - SND(ELECTRO_FIRE), + SND_ELECTRO_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(electro, damage) ); @@ -358,7 +358,7 @@ void W_Electro_Attack_Orb(Weapon thiswep) '0 0 -4', false, 2, - SND(ELECTRO_FIRE2), + SND_ELECTRO_FIRE2, CH_WEAPON_A, WEP_CVAR_SEC(electro, damage) ); @@ -517,7 +517,7 @@ METHOD(Electro, wr_resetplayer, void(entity thiswep)) } METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND_RELOAD); } METHOD(Electro, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 8c0d928db..7d87a5a86 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -187,7 +187,7 @@ void W_Fireball_Attack1() {SELFPARAM(); entity proj; - 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)); + 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); @@ -223,7 +223,7 @@ void W_Fireball_Attack1() void W_Fireball_AttackEffect(float i, vector f_diff) {SELFPARAM(); - W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 0, "", 0, 0); + W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 0, SND_Null, 0, 0); w_shotorg += f_diff.x * v_up + f_diff.y * v_right; Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); } @@ -320,7 +320,7 @@ void W_Fireball_Attack2() f_diff = '+1.25 +3.75 0'; break; } - W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, SND(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; diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index c66e4a438..609b59ec8 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -130,7 +130,7 @@ void W_Hagar_Attack(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(hagar, ammo)); - W_SetupShot(self, false, 2, SND(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); @@ -172,7 +172,7 @@ void W_Hagar_Attack2(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hagar, ammo)); - W_SetupShot(self, false, 2, SND(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); @@ -224,7 +224,7 @@ void W_Hagar_Attack2_Load_Release(.entity weaponentity) weapon_prepareattack_do(self, weaponentity, true, WEP_CVAR_SEC(hagar, refire)); - W_SetupShot(self, false, 2, SND(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; @@ -476,7 +476,7 @@ METHOD(Hagar, wr_playerdeath, void(entity thiswep)) METHOD(Hagar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { if(!self.hagar_load) // require releasing loaded rockets first - W_Reload(self, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND_RELOAD); } METHOD(Hagar, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 901634506..03bec9ba9 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -81,7 +81,7 @@ void W_HLAC_Attack(Weapon thiswep) if(self.crouch) spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod); - W_SetupShot(self, false, 3, SND(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) { @@ -128,7 +128,7 @@ void W_HLAC_Attack2() if(self.crouch) spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod); - W_SetupShot(self, false, 3, SND(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 = new(hlacbolt); @@ -248,7 +248,7 @@ METHOD(HLAC, wr_checkammo2, bool(entity thiswep)) } METHOD(HLAC, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND_RELOAD); } METHOD(HLAC, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 5af5a9ad1..7090acc8f 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -141,7 +141,7 @@ void W_Hook_Touch2() void W_Hook_Attack2(Weapon thiswep, entity actor) { //W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb) - W_SetupShot(actor, false, 4, SND(HOOKBOMB_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hook, damage)); + W_SetupShot(actor, false, 4, SND_HOOKBOMB_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hook, damage)); entity gren = new(hookbomb); gren.owner = gren.realowner = actor; diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 1b1af4df4..96703b713 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -108,7 +108,7 @@ void W_MachineGun_MuzzleFlash() void W_MachineGun_Attack(Weapon thiswep, int deathtype, .entity weaponentity) {SELFPARAM(); - 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))); + 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; @@ -184,7 +184,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity W_DecreaseAmmo(WEP_MACHINEGUN, actor, WEP_CVAR(machinegun, sustained_ammo)); - W_SetupShot(actor, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); + W_SetupShot(actor, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); if(!autocvar_g_norecoil) { actor.punchangle_x = random() - 0.5; @@ -211,7 +211,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentity, int fire) { - W_SetupShot(actor, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); + W_SetupShot(actor, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage)); if(!autocvar_g_norecoil) { actor.punchangle_x = random() - 0.5; @@ -336,7 +336,7 @@ METHOD(MachineGun, wr_checkammo2, bool(entity thiswep)) } METHOD(MachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND(RELOAD)); + W_Reload(self, min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND_RELOAD); } METHOD(MachineGun, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 78aabc451..a0b7cc3e1 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -330,7 +330,7 @@ void W_MineLayer_Attack(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR(minelayer, ammo)); - W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, SND(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); @@ -551,7 +551,7 @@ METHOD(MineLayer, wr_resetplayers, void(entity thiswep)) } METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, WEP_CVAR(minelayer, ammo), SND(RELOAD)); + W_Reload(self, WEP_CVAR(minelayer, ammo), SND_RELOAD); } METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 639de3f4c..f3a43d840 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -207,7 +207,7 @@ void W_Mortar_Attack(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(mortar, ammo)); - W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND(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); @@ -255,7 +255,7 @@ void W_Mortar_Attack2(Weapon thiswep) W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(mortar, ammo)); - W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND(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); @@ -385,7 +385,7 @@ METHOD(Mortar, wr_checkammo2, bool(entity thiswep)) } METHOD(Mortar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND(RELOAD)); // WEAPONTODO + W_Reload(self, min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND_RELOAD); // WEAPONTODO } METHOD(Mortar, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 0e667419d..d9f919cc4 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -244,7 +244,7 @@ void W_Porto_Attack(float type) {SELFPARAM(); entity gren; - W_SetupShot(self, false, 4, SND(PORTO_FIRE), 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 c0734d77d..b008f8a1b 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -56,7 +56,7 @@ spawnfunc(weapon_rifle) { weapon_defaultspawnfunc(this, WEP_RIFLE); } spawnfunc(weapon_campingrifle) { spawnfunc_weapon_rifle(this); } spawnfunc(weapon_sniperrifle) { spawnfunc_weapon_rifle(this); } -void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, string pSound) +void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, Sound pSound) {SELFPARAM(); float i; @@ -81,12 +81,12 @@ void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pFor void W_Rifle_Attack() { - W_Rifle_FireBullet(WEP_RIFLE, 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)); + W_Rifle_FireBullet(WEP_RIFLE, 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() { - W_Rifle_FireBullet(WEP_RIFLE, 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)); + W_Rifle_FireBullet(WEP_RIFLE, 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() rifle_bullethail_attackfunc; @@ -214,7 +214,7 @@ METHOD(Rifle, wr_resetplayer, void(entity thiswep)) } METHOD(Rifle, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND_RELOAD); } METHOD(Rifle, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index a20190256..8213da020 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -255,7 +255,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, vector f_diff, entity m_target) W_DecreaseAmmo(thiswep, self, WEP_CVAR(seeker, missile_ammo)); makevectors(self.v_angle); - W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND(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); @@ -345,7 +345,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep) f_diff = '+1.25 +3.75 0'; break; } - W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND(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); @@ -562,7 +562,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep) entity missile; W_DecreaseAmmo(thiswep, self, WEP_CVAR(seeker, tag_ammo)); - 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)); + 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 = new(seeker_tag); missile.owner = missile.realowner = self; @@ -684,7 +684,7 @@ METHOD(Seeker, wr_checkammo2, bool(entity thiswep)) } METHOD(Seeker, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND_RELOAD); } METHOD(Seeker, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 6c6e8e736..fa1b822dd 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -243,7 +243,7 @@ void W_Shockwave_Melee(Weapon thiswep, entity actor, .entity weaponentity, int f meleetemp.owner = meleetemp.realowner = actor; meleetemp.think = W_Shockwave_Melee_Think; meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor(); - W_SetupShot_Range(actor, true, 0, "", 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range)); + W_SetupShot_Range(actor, true, 0, SND_Null, 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range)); } // SHOCKWAVE ATTACK MODE @@ -365,7 +365,7 @@ void W_Shockwave_Attack() float i, queue = 0; // set up the shot direction - W_SetupShot(self, false, 3, SND(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 234aaadaf..6c1042828 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -65,7 +65,7 @@ void W_Shotgun_Attack(Weapon thiswep, float isprimary) W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(shotgun, ammo)); - 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)); + 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); @@ -192,7 +192,7 @@ void W_Shotgun_Attack2(Weapon thiswep, entity actor, .entity weaponentity, int f meleetemp.realowner = actor; meleetemp.think = W_Shotgun_Melee_Think; meleetemp.nextthink = time + WEP_CVAR_SEC(shotgun, melee_delay) * W_WeaponRateFactor(); - W_SetupShot_Range(actor, true, 0, "", 0, WEP_CVAR_SEC(shotgun, damage), WEP_CVAR_SEC(shotgun, melee_range)); + W_SetupShot_Range(actor, true, 0, SND_Null, 0, WEP_CVAR_SEC(shotgun, damage), WEP_CVAR_SEC(shotgun, melee_range)); } // alternate secondary weapon frames @@ -308,7 +308,7 @@ METHOD(Shotgun, wr_checkammo2, bool(entity thiswep)) } METHOD(Shotgun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO + W_Reload(self, WEP_CVAR_PRI(shotgun, ammo), SND_RELOAD); // WEAPONTODO } METHOD(Shotgun, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 0760f79e3..cdb233296 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -314,7 +314,7 @@ void W_Tuba_NoteOn(float hittype) vector o; float n; - W_SetupShot(self, false, 2, "", 0, WEP_CVAR(tuba, damage)); + W_SetupShot(self, false, 2, SND_Null, 0, WEP_CVAR(tuba, damage)); n = W_Tuba_GetNote(self, hittype); @@ -450,7 +450,7 @@ METHOD(Tuba, wr_reload, void(Tuba this, entity actor, .entity weaponentity)) break; } tuba_instrument_send(actor, actor.tuba_instrument); - W_SetupShot(actor, false, 0, "", 0, 0); + W_SetupShot(actor, false, 0, SND_Null, 0, 0); Send_Effect(EFFECT_TELEPORT, w_shotorg, '0 0 0', 1); actor.(weaponentity).state = WS_INUSE; weapon_thinkf(actor, weaponentity, WFRAME_RELOAD, 0.5, w_ready); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 92c795421..13a929949 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -183,7 +183,7 @@ void W_Vaporizer_Attack(Weapon thiswep) bool flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last float vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000); - W_SetupShot(self, true, 0, "", CH_WEAPON_A, vaporizer_damage); + W_SetupShot(self, true, 0, SND_Null, 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, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM); @@ -247,7 +247,7 @@ void W_RocketMinsta_Attack2() Weapon w = PS(self).m_weapon; PS(self).m_weapon = WEP_ELECTRO; - W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND(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); PS(self).m_weapon = w; Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -299,7 +299,7 @@ void W_RocketMinsta_Attack3 () Weapon w = PS(self).m_weapon; PS(self).m_weapon = WEP_ELECTRO; - W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND(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); PS(self).m_weapon = w; Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); @@ -453,7 +453,7 @@ METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponen else used_ammo = vaporizer_ammo; - W_Reload(self, used_ammo, SND(RELOAD)); + W_Reload(self, used_ammo, SND_RELOAD); } METHOD(Vaporizer, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index d14457b2e..cdf75b1df 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -182,7 +182,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) mydmg *= charge; myforce *= charge; - W_SetupShot(self, true, 5, SND(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, SND_NEXCHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM); @@ -356,7 +356,7 @@ METHOD(Vortex, wr_resetplayer, void(entity thiswep)) } METHOD(Vortex, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - W_Reload(self, min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND(RELOAD)); + W_Reload(self, min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND_RELOAD); } METHOD(Vortex, wr_suicidemessage, Notification(entity thiswep)) { diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index b82b19a4a..7dab5ade0 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -324,7 +324,7 @@ float CheatCommand(float argc) // arguments: // effectname effectnum = _particleeffectnum(argv(1)); - W_SetupShot(self, false, false, "", CH_WEAPON_A, 0); + W_SetupShot(self, false, false, SND_Null, CH_WEAPON_A, 0); traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self); __trailparticles(self, effectnum, w_shotorg, trace_endpos); DID_CHEAT(); @@ -339,7 +339,7 @@ float CheatCommand(float argc) // arguments: // modelname mode f = stof(argv(2)); - W_SetupShot(self, false, false, "", CH_WEAPON_A, 0); + W_SetupShot(self, false, false, SND_Null, CH_WEAPON_A, 0); traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self); if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1) { diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 532868884..f37e806ec 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1273,12 +1273,13 @@ void respawn() PutClientInServer(); } -void play_countdown(float finished, string samp) +void play_countdown(float finished, Sound samp) {SELFPARAM(); + TC(Sound, 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 () @@ -1303,7 +1304,7 @@ void player_powerups () { if (self.items & ITEM_Strength.m_itemid) { - play_countdown(self.strength_finished, SND(POWEROFF)); + play_countdown(self.strength_finished, SND_POWEROFF); self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT); if (time > self.strength_finished) { @@ -1323,7 +1324,7 @@ void player_powerups () } if (self.items & ITEM_Shield.m_itemid) { - play_countdown(self.invincible_finished, SND(POWEROFF)); + play_countdown(self.invincible_finished, SND_POWEROFF); self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT); if (time > self.invincible_finished) { @@ -1356,7 +1357,7 @@ void player_powerups () } else { - play_countdown(self.superweapons_finished, SND(POWEROFF)); + 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_client.qh b/qcsrc/server/cl_client.qh index a31004316..651e0cc60 100644 --- a/qcsrc/server/cl_client.qh +++ b/qcsrc/server/cl_client.qh @@ -2,7 +2,7 @@ float c1, c2, c3, c4; -void play_countdown(float finished, string samp); +void play_countdown(float finished, Sound samp); float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit); diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index 56111a34d..108216dcc 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -630,15 +630,16 @@ void ScoreRules_dom(float teams) } // code from here on is just to support maps that don't have control point and team entities -void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, string capsound, string capnarration, string capmessage) +void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, Sound capsound, string capnarration, string capmessage) {SELFPARAM(); + TC(Sound, capsound); setself(spawn()); self.classname = "dom_team"; self.netname = strzone(teamname); self.cnt = teamcolor; self.model = pointmodel; self.skin = pointskin; - self.noise = strzone(capsound); + self.noise = strzone(Sound_fixpath(capsound)); self.noise1 = strzone(capnarration); self.message = strzone(capmessage); @@ -668,15 +669,16 @@ void dom_spawnpoint(vector org) } // spawn some default teams if the map is not set up for domination -void dom_spawnteams(float teams) +void dom_spawnteams(int teams) { - dom_spawnteam(Team_ColoredFullName(NUM_TEAM_1), NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND(DOM_CLAIM), "", "Red team has captured a control point"); - dom_spawnteam(Team_ColoredFullName(NUM_TEAM_2), NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, SND(DOM_CLAIM), "", "Blue team has captured a control point"); + TC(int, teams); + dom_spawnteam(Team_ColoredFullName(NUM_TEAM_1), NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND_DOM_CLAIM, "", "Red team has captured a control point"); + dom_spawnteam(Team_ColoredFullName(NUM_TEAM_2), 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(Team_ColoredFullName(NUM_TEAM_3), NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, SND(DOM_CLAIM), "", "Yellow team has captured a control point"); + dom_spawnteam(Team_ColoredFullName(NUM_TEAM_3), 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(Team_ColoredFullName(NUM_TEAM_4), 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, "", "", ""); + dom_spawnteam(Team_ColoredFullName(NUM_TEAM_4), 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, SND_Null, "", ""); } void dom_DelayedInit() // Do this check with a delay so we can wait for teams to be set up. diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index ac4752b3d..9c8bd6cb5 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -20,8 +20,9 @@ // this function calculates w_shotorg and w_shotdir based on the weapon model // offset, trueaim and antilag, and won't put w_shotorg inside a wall. // make sure you call makevectors first (FIXME?) -void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float chan, float maxdamage, float range) +void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, Sound snd, float chan, float maxdamage, float range) { + TC(Sound, snd); float nudge = 1; // added to traceline target and subtracted from result TOOD(divVerent): do we still need this? Doesn't the engine do this now for us? float oldsolid; vector vecs, dv; @@ -133,9 +134,8 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m if (!autocvar_g_norecoil) ent.punchangle_x = recoil * -1; - if (snd != "") - { - _sound (ent, chan, snd, VOL_BASE, ATTN_NORM); + if (snd != SND_Null) { + sound (ent, chan, snd, VOL_BASE, ATTN_NORM); W_PlayStrengthSound(ent); } diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index bb486d8ce..08b7094c2 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -7,7 +7,7 @@ vector w_shotend; // this function calculates w_shotorg and w_shotdir based on the weapon model // offset, trueaim and antilag, and won't put w_shotorg inside a wall. // make sure you call makevectors first (FIXME?) -void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float chan, float maxdamage, float range); +void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, Sound snd, float chan, float maxdamage, float range); #define W_SetupShot_Dir_ProjectileSize(ent,s_forward,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize_Range(ent, s_forward, mi, ma, antilag, recoil, snd, chan, maxdamage, MAX_SHOT_DISTANCE) #define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, chan, maxdamage) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 7cf26a459..ad3189918 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -683,8 +683,9 @@ void W_ReloadedAndReady(Weapon thiswep, entity actor, .entity weaponentity, int w_ready(wpn, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1)); } -void W_Reload(entity actor, float sent_ammo_min, string sent_sound) +void W_Reload(entity actor, float sent_ammo_min, Sound sent_sound) { + TC(Sound, sent_sound); .entity weaponentity = weaponentities[0]; // set global values to work with Weapon e = PS(actor).m_weapon; @@ -694,7 +695,8 @@ void W_Reload(entity actor, float sent_ammo_min, string sent_sound) actor.reload_ammo_min = sent_ammo_min; actor.reload_ammo_amount = e.reloading_ammo; actor.reload_time = e.reloading_time; - actor.reload_sound = sent_sound; + if (actor.reload_sound) strunzone(actor.reload_sound); + actor.reload_sound = strzone(Sound_fixpath(sent_sound)); // don't reload weapons that don't have the RELOADABLE flag if (!(e.spawnflags & WEP_FLAG_RELOADABLE)) diff --git a/qcsrc/server/weapons/weaponsystem.qh b/qcsrc/server/weapons/weaponsystem.qh index 03cb7c13c..e65ffd67b 100644 --- a/qcsrc/server/weapons/weaponsystem.qh +++ b/qcsrc/server/weapons/weaponsystem.qh @@ -16,7 +16,7 @@ void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use); void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item); -void W_Reload(entity actor, float sent_ammo_min, string sent_sound); +void W_Reload(entity actor, float sent_ammo_min, Sound sent_sound); void W_WeaponFrame(entity actor);