diff --git a/Source/shared/scihunt/w_cannon.c b/Source/shared/scihunt/w_cannon.c index 89713528..7e8dee03 100644 --- a/Source/shared/scihunt/w_cannon.c +++ b/Source/shared/scihunt/w_cannon.c @@ -83,11 +83,12 @@ void w_cannon_pickup(void) void w_cannon_draw(void) { + Weapons_SetModel("models/v_cannon.mdl"); + Weapons_ViewAnimation(CANNON_DEPLOY); #ifdef SSQC player pl = (player)self; Weapons_UpdateAmmo(pl, pl.cannon_mag, pl.ammo_buckshot, __NULL__); #endif - Weapons_ViewAnimation(CANNON_DEPLOY); } void w_cannon_holster(void) diff --git a/Source/shared/scihunt/w_chainsaw.c b/Source/shared/scihunt/w_chainsaw.c index b60f8f74..ff043b05 100644 --- a/Source/shared/scihunt/w_chainsaw.c +++ b/Source/shared/scihunt/w_chainsaw.c @@ -46,11 +46,12 @@ string w_chainsaw_deathmsg(void) void w_chainsaw_draw(void) { + Weapons_SetModel("models/v_chainsaw.mdl"); + Weapons_ViewAnimation(CHAINSAW_DEPLOY); #ifdef SSQC player pl = (player)self; Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__); #endif - Weapons_ViewAnimation(CHAINSAW_DEPLOY); } void w_chainsaw_holster(void) diff --git a/Source/shared/scihunt/w_hammer.c b/Source/shared/scihunt/w_hammer.c index 1a2cbfb2..0b7b2383 100644 --- a/Source/shared/scihunt/w_hammer.c +++ b/Source/shared/scihunt/w_hammer.c @@ -47,6 +47,7 @@ string w_hammer_deathmsg(void) void w_hammer_draw(void) { + Weapons_SetModel("models/v_hammer.mdl"); Weapons_ViewAnimation(HAMMER_DRAW); #ifdef SSQC player pl = (player)self; @@ -98,14 +99,75 @@ void w_hammer_release(void) return; } +#ifdef SSQC + 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 + if (trace_ent.takedamage) { + 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 == "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; + } + } +#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); + } +#endif + + /* Reset the hack */ + pl.a_ammo1 = 0; + + /* Pure cosmetics start here */ if (pl.w_idle_next) { return; @@ -124,69 +186,6 @@ void w_hammer_release(void) break; } pl.w_idle_next = 10.0f; - -#ifdef SSQC - int hitsound = 0; - vector src = pl.origin + pl.view_ofs; - makevectors(pl.v_angle); - traceline(src, src + v_forward * 64, FALSE, self); - - /* Standard attack */ - if (pl.a_ammo1 == 1) { - if (trace_ent.takedamage) { - 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 == "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; - } - } - pl.w_attack_next = 1.0f; - } else if (pl.a_ammo1 == 2) { - 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; - } - } - pl.w_attack_next = 0.75f; - } else { - return; - } - - 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); - } - - /* Reset the hack */ -#endif - pl.a_ammo1 = 0; } float w_hammer_aimanim(void)