swwmgz_m/zscript/weapons/swwm_baseweapon_precisechair.zsc

34 lines
809 B
Text

// precise crosshair
extend Class SWWMWeapon
{
meta int NumCrosshairs; // how many crosshairs this weapon has (for multi-barrel weapons, or dual-wielding)
Property NumCrosshairs : NumCrosshairs;
Default
{
SWWMWeapon.NumCrosshairs 1;
}
override void DoEffect()
{
Super.DoEffect();
// force custom crosshair
if ( swwm_precisecrosshair && (players[consoleplayer].Camera == players[consoleplayer].mo) && !(players[consoleplayer].cheats&CF_CHASECAM) )
crosshair = 99;
else crosshair = ShouldDrawCrosshair()?0:99;
}
// where the trace is coming from relative to eyes
virtual clearscope Vector3 GetTraceOffset( int index ) const
{
return (0.,0.,0.);
}
// should we draw the crosshair? (for scoped weapons)
virtual clearscope bool ShouldDrawCrosshair() const
{
return true;
}
}