コード例 #1
0
void CAK47::PrimaryAttack()
{
    CCSPlayer *pPlayer = GetPlayerOwner();
    if ( !pPlayer )
        Error( "CAK47::PrimaryAttack - !pPlayer" );

    if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
        AK47Fire( 0.04 + (0.4) * m_flAccuracy, 0.0955 );
    else if (pPlayer->GetAbsVelocity().Length2D() > 140)
        AK47Fire( 0.04 + (0.07) * m_flAccuracy, 0.0955 );
    else
        AK47Fire( (0.0275) * m_flAccuracy, 0.0955 );
}
コード例 #2
0
void CAK47::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	if ( !pPlayer )
		return;
	
	if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		AK47Fire( 0.04f + 0.4f * m_flAccuracy );
	else if (pPlayer->GetAbsVelocity().Length2D() > 140)
		AK47Fire( 0.04f + 0.07f * m_flAccuracy );
	else
		AK47Fire( 0.0275f * m_flAccuracy );
}