From: Lyberta Date: Thu, 6 Apr 2017 23:14:55 +0000 (+0300) Subject: Secondary fire animation for overkill weapons. X-Git-Tag: xonotic-v0.8.5~2119^2~73 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79ba7811d886dd85d84f5ac6aab004d3014cfff8;p=xonotic%2Fxonotic-data.pk3dir.git Secondary fire animation for overkill weapons. --- 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))