From 629a9c55aafbb3e9a3b0b00d8fd42e3f7520ae33 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sat, 10 Apr 2021 23:14:28 +0200 Subject: [PATCH] Weapons: Add player model animations for the hammer, shotgun and change the aim animation for the chainsaw to be that of the Egon --- src/shared/w_cannon.qc | 10 ++++++++++ src/shared/w_chainsaw.qc | 2 +- src/shared/w_hammer.qc | 32 +++++++++++++++++++++----------- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/shared/w_cannon.qc b/src/shared/w_cannon.qc index 76ac726..3a94114 100644 --- a/src/shared/w_cannon.qc +++ b/src/shared/w_cannon.qc @@ -144,6 +144,11 @@ w_cannon_primary(void) Weapons_ViewAnimation(CANNON_FIREBOTH); pl.w_attack_next = 1.5f; pl.w_idle_next = 2.5f; + + if (self.flags & FL_CROUCHING) + Animation_PlayerTop(pl, ANIM_CR_SHOOTSHOTGUN, 0.41f); + else + Animation_PlayerTop(pl, ANIM_SHOOTSHOTGUN, 0.5f); } void @@ -178,6 +183,11 @@ w_cannon_secondary(void) pl.w_attack_next = 1.5f; pl.w_idle_next = 2.5f; + + if (self.flags & FL_CROUCHING) + Animation_PlayerTop(pl, ANIM_CR_SHOOTSHOTGUN, 0.41f); + else + Animation_PlayerTop(pl, ANIM_SHOOTSHOTGUN, 0.5f); } void w_cannon_release(void) diff --git a/src/shared/w_chainsaw.qc b/src/shared/w_chainsaw.qc index 52f7b30..1a2bcc8 100644 --- a/src/shared/w_chainsaw.qc +++ b/src/shared/w_chainsaw.qc @@ -160,7 +160,7 @@ void w_chainsaw_release(void) float w_chainsaw_aimanim(void) { - return self.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK; + return self.flags & FL_CROUCHING ? ANIM_CR_AIMEGON : ANIM_AIMEGON; } void w_chainsaw_hudpic(int s, vector pos, float a) diff --git a/src/shared/w_hammer.qc b/src/shared/w_hammer.qc index fe902ca..30c172e 100644 --- a/src/shared/w_hammer.qc +++ b/src/shared/w_hammer.qc @@ -145,23 +145,33 @@ void w_hammer_release(void) #endif Weapons_ViewAnimation(HAMMER_ATTACK1); pl.w_attack_next = 1.0f; + + if (self.flags & FL_CROUCHING) + Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f); + else + Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f); } else if (pl.ammo_hammer_state == 2) { #ifdef SERVER - if (trace_ent.takedamage) { - if (trace_ent.iBleeds) { - FX_Blood(trace_endpos, [1,0,0]); + if (trace_ent.takedamage) { + if (trace_ent.iBleeds) { + FX_Blood(trace_endpos, [1,0,0]); + } + hitsound = floor(random(1, 2)); + hdmg = Skill_GetValue("plr_hammeralt", 200); + Damage_Apply(trace_ent, self, hdmg, WEAPON_HAMMER, DMG_BLUNT); + } else { + if (trace_fraction < 1.0) { + hitsound = 2; + } } - hitsound = floor(random(1, 2)); - hdmg = Skill_GetValue("plr_hammeralt", 200); - Damage_Apply(trace_ent, self, hdmg, WEAPON_HAMMER, DMG_BLUNT); - } else { - if (trace_fraction < 1.0) { - hitsound = 2; - } - } #endif Weapons_ViewAnimation(HAMMER_ATTACK2); pl.w_attack_next = 0.75f; + + if (self.flags & FL_CROUCHING) + Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f); + else + Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f); } #ifdef SERVER