Пример #1
0
void CWeaponGalil::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	if ( !pPlayer )
		return;

	// don't fire underwater
	if (pPlayer->GetWaterLevel() == 3)
	{
		PlayEmptySound( );
		m_flNextPrimaryAttack = gpGlobals->curtime + 0.15;
		return;
	}
	
	if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		GalilFire( 0.04f + 0.3f * m_flAccuracy );
	else if (pPlayer->GetAbsVelocity().Length2D() > 140)
		GalilFire( 0.04f + 0.07f * m_flAccuracy );
	else
		GalilFire( 0.0375f * m_flAccuracy );
}
Пример #2
0
void CGalil::PrimaryAttack()
{
	if (m_pPlayer->pev->waterlevel == 3)
	{
		PlayEmptySound();
		m_flNextPrimaryAttack = GetNextAttackDelay(0.15);
		return;
	}

	if (!(m_pPlayer->pev->flags & FL_ONGROUND))
	{
		GalilFire(0.04 + (0.3 * m_flAccuracy), 0.0875, FALSE);
	}
	else if (m_pPlayer->pev->velocity.Length2D() > 140)
	{
		GalilFire(0.04 + (0.07 * m_flAccuracy), 0.0875, FALSE);
	}
	else
	{
		GalilFire(0.0375 * m_flAccuracy, 0.0875, FALSE);
	}
}