]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Secondary fire animation for overkill weapons.
authorLyberta <lyberta@lyberta.net>
Thu, 6 Apr 2017 23:14:55 +0000 (02:14 +0300)
committerLyberta <lyberta@lyberta.net>
Thu, 6 Apr 2017 23:14:55 +0000 (02:14 +0300)
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qc
qcsrc/common/mutators/mutator/overkill/okvortex.qc

index 38eea00254295f451a4bf68eb7138d086f842c2f..4327fa83b4f2bfffb413afd83161da2078c40537 100644 (file)
@@ -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)))
        {
index 6cfd6fbb36cb4bd641caf8909c17ca98528a56cd..788c9ce4de8a198ecef98ce29b09baa7a98cd614 100644 (file)
@@ -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))
        {
index 8101f56616f38111a2f3209f2251d83c3edd53c0..0341cc953117c9c1f4c395d91f83e6541b638f42 100644 (file)
@@ -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))