if(player.(weaponentity).m_weapon == WEP_Null && slot != 0)
continue;
- BLASTER_SECONDARY_ATTACK_HACK(vaporizer, player, weaponentity);
- W_Blaster_Attack(
- player,
- weaponentity,
- WEP_BLASTER.m_id | HITTYPE_SECONDARY,
- WEP_CVAR_SEC(vaporizer, shotangle),
- WEP_CVAR_SEC(vaporizer, damage),
- WEP_CVAR_SEC(vaporizer, edgedamage),
- WEP_CVAR_SEC(vaporizer, radius),
- WEP_CVAR_SEC(vaporizer, force),
- WEP_CVAR_SEC(vaporizer, speed),
- WEP_CVAR_SEC(vaporizer, spread),
- WEP_CVAR_SEC(vaporizer, delay),
- WEP_CVAR_SEC(vaporizer, lifetime)
- );
++ BLASTER_SECONDARY_ATTACK(vaporizer, player, weaponentity);
}
}
return WEAPON_BLASTER_MURDER;
}
- BLASTER_SECONDARY_ATTACK_HACK(blaster, actor, weaponentity);
+METHOD(OffhandBlaster, offhand_think, void(OffhandBlaster this, entity actor, bool key_pressed))
+{
+ if (!key_pressed || (time < actor.jump_interval))
+ {
+ return;
+ }
+ actor.jump_interval = time + WEP_CVAR_SEC(blaster, refire) * W_WeaponRateFactor(actor);
+ .entity weaponentity = weaponentities[1];
++ BLASTER_SECONDARY_ATTACK(blaster, actor, weaponentity);
+}
+
#endif
#ifdef CSQC
.float blaster_force;
.float blaster_lifetime;
- #define BLASTER_SECONDARY_ATTACK_HACK(weapon_name, actor, weaponentity) \
++// Will be demacroed after WEP_CVAR macros are also demacroed.
++#define BLASTER_SECONDARY_ATTACK(weapon_name, actor, weaponentity) \
+ makevectors(actor.v_angle); \
- Weapon oldwep = actor.(weaponentity).m_weapon; \
- actor.(weaponentity).m_weapon = WEP_BLASTER; \
+ W_Blaster_Attack( \
+ actor, \
+ weaponentity, \
+ WEP_BLASTER.m_id | HITTYPE_SECONDARY, \
+ WEP_CVAR_SEC(weapon_name, shotangle), \
+ WEP_CVAR_SEC(weapon_name, damage), \
+ WEP_CVAR_SEC(weapon_name, edgedamage), \
+ WEP_CVAR_SEC(weapon_name, radius), \
+ WEP_CVAR_SEC(weapon_name, force), \
+ WEP_CVAR_SEC(weapon_name, speed), \
+ WEP_CVAR_SEC(weapon_name, spread), \
+ WEP_CVAR_SEC(weapon_name, delay), \
+ WEP_CVAR_SEC(weapon_name, lifetime) \
- ); \
- actor.(weaponentity).m_weapon = oldwep;
++ );
+
#endif
if(WEP_CVAR_SEC(vaporizer, ammo))
W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(vaporizer, ammo), weaponentity);
- BLASTER_SECONDARY_ATTACK_HACK(vaporizer, actor, weaponentity);
- // ugly instagib hack to reuse the fire mode of the laser
- makevectors(actor.v_angle);
- W_Blaster_Attack(
- actor,
- weaponentity,
- WEP_BLASTER.m_id | HITTYPE_SECONDARY,
- WEP_CVAR_SEC(vaporizer, shotangle),
- WEP_CVAR_SEC(vaporizer, damage),
- WEP_CVAR_SEC(vaporizer, edgedamage),
- WEP_CVAR_SEC(vaporizer, radius),
- WEP_CVAR_SEC(vaporizer, force),
- WEP_CVAR_SEC(vaporizer, speed),
- WEP_CVAR_SEC(vaporizer, spread),
- WEP_CVAR_SEC(vaporizer, delay),
- WEP_CVAR_SEC(vaporizer, lifetime)
- );
++ BLASTER_SECONDARY_ATTACK(vaporizer, actor, weaponentity);
// now do normal refire
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);