本文整理汇总了C++中CTFPlayer::GetFOV方法的典型用法代码示例。如果您正苦于以下问题:C++ CTFPlayer::GetFOV方法的具体用法?C++ CTFPlayer::GetFOV怎么用?C++ CTFPlayer::GetFOV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTFPlayer
的用法示例。
在下文中一共展示了CTFPlayer::GetFOV方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanHolster
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFHunterRifle::CanHolster( void ) const
{
CTFPlayer *pPlayer = GetTFPlayerOwner();
if ( pPlayer )
{
// don't allow us to holster this weapon if we're in the process of zooming and
// we've just fired the weapon (next primary attack is only 1.5 seconds after firing)
if ( ( pPlayer->GetFOV() < pPlayer->GetDefaultFOV() ) && ( m_flNextPrimaryAttack > gpGlobals->curtime ) )
{
return false;
}
}
return BaseClass::CanHolster();
}
示例2: Zoom
//-----------------------------------------------------------------------------
// Purpose: Secondary attack.
//-----------------------------------------------------------------------------
void CTFSniperRifle::Zoom( void )
{
// Don't allow the player to zoom in while jumping
CTFPlayer *pPlayer = GetTFPlayerOwner();
if ( pPlayer && pPlayer->m_Shared.IsJumping() )
{
if ( pPlayer->GetFOV() >= 75 )
return;
}
ToggleZoom();
// at least 0.1 seconds from now, but don't stomp a previous value
m_flNextPrimaryAttack = max( m_flNextPrimaryAttack, gpGlobals->curtime + 0.1 );
m_flNextSecondaryAttack = gpGlobals->curtime + TF_WEAPON_SNIPERRIFLE_ZOOM_TIME;
}
示例3: CanFireCriticalShot
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFHunterRifle::CanFireCriticalShot( bool bIsHeadshot )
{
// can only fire a crit shot if this is a headshot
if ( !bIsHeadshot )
return false;
CTFPlayer *pPlayer = GetTFPlayerOwner();
if ( pPlayer )
{
// no crits if they're not zoomed
if ( pPlayer->GetFOV() >= pPlayer->GetDefaultFOV() )
{
return false;
}
// no crits for 0.2 seconds after starting to zoom
if ( ( gpGlobals->curtime - pPlayer->GetFOVTime() ) < TF_WEAPON_HUNTERRIFLE_NO_CRIT_AFTER_ZOOM_TIME )
{
return false;
}
}
return true;
}