+ if ((WEP_CVAR_SEC(rpc, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval))
+ {
+ // Secondary uses it's own refire timer if refire_type is 1.
+ actor.jump_interval = time + WEP_CVAR_SEC(rpc, refire) * W_WeaponRateFactor(actor);
+ // Ugly hack to reuse the fire mode of the blaster.
+ makevectors(actor.v_angle);
+ Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack
+ actor.(weaponentity).m_weapon = WEP_BLASTER;
+ W_Blaster_Attack(
+ actor,
+ weaponentity,
+ WEP_BLASTER.m_id | HITTYPE_SECONDARY,
+ WEP_CVAR_SEC(rpc, shotangle),
+ WEP_CVAR_SEC(rpc, damage),
+ WEP_CVAR_SEC(rpc, edgedamage),
+ WEP_CVAR_SEC(rpc, radius),
+ WEP_CVAR_SEC(rpc, force),
+ WEP_CVAR_SEC(rpc, speed),
+ WEP_CVAR_SEC(rpc, spread),
+ WEP_CVAR_SEC(rpc, delay),
+ WEP_CVAR_SEC(rpc, 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(rpc, reload_ammo) && actor.(weaponentity).clip_load < WEP_CVAR_PRI(rpc, ammo))
+ {
+ // Forced reload
+ thiswep.wr_reload(thiswep, actor, weaponentity);
+ return;
+ }
+ if (fire & 1) // Primary attack
+ {
+ if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(rpc, refire)))
+ {
+ return;
+ }
+ W_RocketPropelledChainsaw_Attack(thiswep, actor, weaponentity);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(rpc, animtime), w_ready);
+ return;
+ }
+ if ((fire & 2) && (WEP_CVAR_SEC(rpc, refire_type) == 0)) // Secondary attack
+ {
+ if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(rpc, refire)))
+ {
+ return;
+ }
+ // ugly instagib hack to reuse the fire mode of the laser
+ makevectors(actor.v_angle);
+ Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack
+ actor.(weaponentity).m_weapon = WEP_BLASTER;
+ W_Blaster_Attack(
+ actor,
+ weaponentity,
+ WEP_BLASTER.m_id | HITTYPE_SECONDARY,
+ WEP_CVAR_SEC(rpc, shotangle),
+ WEP_CVAR_SEC(rpc, damage),
+ WEP_CVAR_SEC(rpc, edgedamage),
+ WEP_CVAR_SEC(rpc, radius),
+ WEP_CVAR_SEC(rpc, force),
+ WEP_CVAR_SEC(rpc, speed),
+ WEP_CVAR_SEC(rpc, spread),
+ WEP_CVAR_SEC(rpc, delay),
+ WEP_CVAR_SEC(rpc, lifetime)
+ );
+ actor.(weaponentity).m_weapon = oldwep;
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(rpc, animtime), w_ready);
+ }