本文整理汇总了C++中CTFPlayer::GetDefaultFOV方法的典型用法代码示例。如果您正苦于以下问题:C++ CTFPlayer::GetDefaultFOV方法的具体用法?C++ CTFPlayer::GetDefaultFOV怎么用?C++ CTFPlayer::GetDefaultFOV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTFPlayer
的用法示例。
在下文中一共展示了CTFPlayer::GetDefaultFOV方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}