From bc4bd0580d95dace94eca540d077b7b7c7b7b497 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Wed, 4 Sep 2019 04:39:16 +0200 Subject: [PATCH] Scientist Hunt: Tweak the Hammer to not violate our precious ears --- src/shared/scihunt/w_hammer.c | 99 ++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/src/shared/scihunt/w_hammer.c b/src/shared/scihunt/w_hammer.c index 92d305fd..c68e5265 100644 --- a/src/shared/scihunt/w_hammer.c +++ b/src/shared/scihunt/w_hammer.c @@ -108,73 +108,74 @@ void w_hammer_release(void) } #ifdef SSQC - int hitsound = 0; - vector src = pl.origin + pl.view_ofs; - makevectors(pl.v_angle); - traceline(src, src + v_forward * 64, FALSE, self); + int hitsound = 0; + vector src = pl.origin + pl.view_ofs; + makevectors(pl.v_angle); + traceline(src, src + v_forward * 64, FALSE, self); #endif if (pl.a_ammo1 == 1) { -#ifdef SSQC + #ifdef SSQC if (trace_ent.takedamage) { - hitsound = floor(random(1, 4)); + hitsound = floor(random(1, 4)); - if (trace_ent.classname == "player") - Damage_Apply(trace_ent, self, 50, trace_endpos, FALSE); - else - Damage_Apply(trace_ent, self, 100, trace_endpos, FALSE); + if (trace_ent.classname == "player") + Damage_Apply(trace_ent, self, 50, trace_endpos, FALSE); + else + Damage_Apply(trace_ent, self, 100, trace_endpos, FALSE); - if (trace_ent.classname == "monster_scientist") { - trace_ent.movetype = MOVETYPE_TOSS; - trace_ent.velocity = v_forward * 768 + v_up * 256; - } else if (trace_ent.classname == "player") { - trace_ent.velocity = v_forward * 768 + v_up * 256; - } - } else { - if (trace_fraction < 1.0) { - hitsound = 4; - } - } -#endif + if (trace_ent.classname == "monster_scientist") { + trace_ent.movetype = MOVETYPE_TOSS; + trace_ent.velocity = v_forward * 768 + v_up * 256; + } else if (trace_ent.classname == "player") { + trace_ent.velocity = v_forward * 768 + v_up * 256; + } + } else { + if (trace_fraction < 1.0) { + hitsound = 4; + } + } + #endif Weapons_ViewAnimation(HAMMER_ATTACK1); pl.w_attack_next = 1.0f; } else if (pl.a_ammo1 == 2) { #ifdef SSQC - if (trace_ent.takedamage) { - hitsound = floor(random(1, 4)); - Damage_Apply(trace_ent, self, 200, trace_endpos, FALSE); - } else { - if (trace_fraction < 1.0) { - hitsound = 4; - } - } + if (trace_ent.takedamage) { + hitsound = floor(random(1, 4)); + Damage_Apply(trace_ent, self, 200, trace_endpos, FALSE); + } else { + if (trace_fraction < 1.0) { + hitsound = 4; + } + } #endif Weapons_ViewAnimation(HAMMER_ATTACK2); pl.w_attack_next = 0.75f; } #ifdef SSQC - switch (hitsound) { - case 1: - Weapons_PlaySound(pl, CHAN_WEAPON, "sh/ham_hitbod1.wav", 1, ATTN_NORM); - break; - case 2: - Weapons_PlaySound(pl, CHAN_WEAPON, "sh/ham_hitbod2.wav", 1, ATTN_NORM); - break; - case 3: - Weapons_PlaySound(pl, CHAN_WEAPON, "sh/ham_hitbod3.wav", 1, ATTN_NORM); - break; - case 4: - Weapons_PlaySound(pl, CHAN_WEAPON, "sh/ham_hitw.wav", 1, ATTN_NORM); - break; - default: - Weapons_PlaySound(pl, CHAN_WEAPON, "sh/ham_swing.wav", 1, ATTN_NORM); - } + if (pl.a_ammo1 > 0) { + string snd = "sh/ham_swing.wav"; + switch (hitsound) { + case 1: + snd = "sh/ham_hitbod1.wav"; + break; + case 2: + snd = "sh/ham_hitbod2.wav"; + break; + case 3: + snd = "sh/ham_hitbod3.wav"; + break; + case 4: + snd = "sh/ham_hitw.wav"; + break; + } + Weapons_PlaySound(pl, CHAN_WEAPON, snd, 1.0f, ATTN_NORM); + } #endif - /* Reset the hack */ - pl.a_ammo1 = 0; - + /* Reset the hack */ + pl.a_ammo1 = 0; /* Pure cosmetics start here */ if (pl.w_idle_next) {