From 79ba7811d886dd85d84f5ac6aab004d3014cfff8 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Fri, 7 Apr 2017 02:14:55 +0300 Subject: [PATCH] Secondary fire animation for overkill weapons. --- .../mutators/mutator/overkill/okmachinegun.qc | 16 ++++++++++++++++ .../mutators/mutator/overkill/okshotgun.qc | 16 ++++++++++++++++ .../common/mutators/mutator/overkill/okvortex.qc | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc index 38eea0025..4327fa83b 100644 --- a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc @@ -154,6 +154,22 @@ METHOD(OverkillMachineGun, wr_think, void(entity thiswep, entity actor, .entity WEP_CVAR_SEC(okmachinegun, lifetime) ); actor.(weaponentity).m_weapon = oldwep; + if ((actor.(weaponentity).wframe == WFRAME_IDLE) || + (actor.(weaponentity).wframe == WFRAME_FIRE2)) + { + // Set secondary fire animation. + vector a = '0 0 0'; + actor.(weaponentity).wframe = WFRAME_FIRE2; + a = actor.(weaponentity).anim_fire2; + a.z *= g_weaponratefactor; + FOREACH_CLIENT(true, LAMBDA( + if (it == actor || (IS_SPEC(it) && it.enemy == actor)) + { + wframe_send(it, actor.(weaponentity), a, true); + } + )); + animdecide_setaction(actor, ANIMACTION_SHOOT, true); + } } if (WEP_CVAR(okmachinegun, reload_ammo) && actor.(weaponentity).clip_load < min(max(WEP_CVAR(okmachinegun, sustained_ammo), WEP_CVAR(okmachinegun, first_ammo)), WEP_CVAR(okmachinegun, burst_ammo))) { diff --git a/qcsrc/common/mutators/mutator/overkill/okshotgun.qc b/qcsrc/common/mutators/mutator/overkill/okshotgun.qc index 6cfd6fbb3..788c9ce4d 100644 --- a/qcsrc/common/mutators/mutator/overkill/okshotgun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okshotgun.qc @@ -40,6 +40,22 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea WEP_CVAR_SEC(okshotgun, lifetime) ); actor.(weaponentity).m_weapon = oldwep; + if ((actor.(weaponentity).wframe == WFRAME_IDLE) || + (actor.(weaponentity).wframe == WFRAME_FIRE2)) + { + // Set secondary fire animation. + vector a = '0 0 0'; + actor.(weaponentity).wframe = WFRAME_FIRE2; + a = actor.(weaponentity).anim_fire2; + a.z *= g_weaponratefactor; + FOREACH_CLIENT(true, LAMBDA( + if (it == actor || (IS_SPEC(it) && it.enemy == actor)) + { + wframe_send(it, actor.(weaponentity), a, true); + } + )); + animdecide_setaction(actor, ANIMACTION_SHOOT, true); + } } if (WEP_CVAR(okshotgun, reload_ammo) && actor.(weaponentity).clip_load < WEP_CVAR_PRI(okshotgun, ammo)) { diff --git a/qcsrc/common/mutators/mutator/overkill/okvortex.qc b/qcsrc/common/mutators/mutator/overkill/okvortex.qc index 8101f5661..0341cc953 100644 --- a/qcsrc/common/mutators/mutator/overkill/okvortex.qc +++ b/qcsrc/common/mutators/mutator/overkill/okvortex.qc @@ -169,6 +169,22 @@ METHOD(OverkillVortex, wr_think, void(entity thiswep, entity actor, .entity weap WEP_CVAR_SEC(okvortex, lifetime) ); actor.(weaponentity).m_weapon = oldwep; + if ((actor.(weaponentity).wframe == WFRAME_IDLE) || + (actor.(weaponentity).wframe == WFRAME_FIRE2)) + { + // Set secondary fire animation. + vector a = '0 0 0'; + actor.(weaponentity).wframe = WFRAME_FIRE2; + a = actor.(weaponentity).anim_fire2; + a.z *= g_weaponratefactor; + FOREACH_CLIENT(true, LAMBDA( + if (it == actor || (IS_SPEC(it) && it.enemy == actor)) + { + wframe_send(it, actor.(weaponentity), a, true); + } + )); + animdecide_setaction(actor, ANIMACTION_SHOOT, true); + } } if (autocvar_g_balance_okvortex_reload_ammo && actor.(weaponentity).clip_load < WEP_CVAR_PRI(okvortex, ammo)) -- 2.39.2