本文整理汇总了C++中CCSPlayer::GetDefaultFOV方法的典型用法代码示例。如果您正苦于以下问题:C++ CCSPlayer::GetDefaultFOV方法的具体用法?C++ CCSPlayer::GetDefaultFOV怎么用?C++ CCSPlayer::GetDefaultFOV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCSPlayer
的用法示例。
在下文中一共展示了CCSPlayer::GetDefaultFOV方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reload
bool CWeaponCSBaseGun::Reload()
{
CCSPlayer *pPlayer = GetPlayerOwner();
if ( !pPlayer )
return false;
if (pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0)
return false;
int iResult = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD );
if ( !iResult )
return false;
pPlayer->SetAnimation( PLAYER_RELOAD );
#ifndef CLIENT_DLL
if ((iResult) && (pPlayer->GetFOV() != pPlayer->GetDefaultFOV()))
{
pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV() );
}
#endif
m_flAccuracy = 0.2;
pPlayer->m_iShotsFired = 0;
m_bDelayFire = false;
pPlayer->SetShieldDrawnState( false );
return true;
}
示例2: SCOUTFire
void CWeaponScout::SCOUTFire( float flSpread )
{
CCSPlayer *pPlayer = GetPlayerOwner();
if (pPlayer == NULL)
{
Assert(pPlayer != NULL);
return;
}
// If we are not zoomed in, or we have very recently zoomed and are still transitioning, the bullet diverts more.
if (pPlayer->GetFOV() == pPlayer->GetDefaultFOV() || (gpGlobals->curtime < m_zoomFullyActiveTime))
{
flSpread += 0.025;
}
if (pPlayer->GetFOV() != pPlayer->GetDefaultFOV())
{
pPlayer->m_bResumeZoom = true;
pPlayer->m_iLastZoom = pPlayer->GetFOV();
#ifndef CLIENT_DLL
pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV(), 0.05f );
#endif
}
if ( !CSBaseGunFire( flSpread, GetCSWpnData().m_flCycleTime, true ) )
return;
QAngle angle = pPlayer->GetPunchAngle();
angle.x -= 2;
pPlayer->SetPunchAngle( angle );
}
示例3: SecondaryAttack
void CWeaponScout::SecondaryAttack()
{
#ifndef CLIENT_DLL
CCSPlayer *pPlayer = GetPlayerOwner();
if (pPlayer == NULL)
{
Assert(pPlayer != NULL);
return;
}
if (pPlayer->GetFOV() == pPlayer->GetDefaultFOV())
{
pPlayer->SetFOV( pPlayer, 40, 0.15f );
}
else if (pPlayer->GetFOV() == 40)
{
pPlayer->SetFOV( pPlayer, 15, 0.05 );
}
else if (pPlayer->GetFOV() == 15)
{
pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV(), 0.05f );
}
pPlayer->ResetMaxSpeed();
#endif
m_flNextSecondaryAttack = gpGlobals->curtime + 0.3;
m_zoomFullyActiveTime = gpGlobals->curtime + 0.15; // The worst zoom time from above.
#ifndef CLIENT_DLL
// If this isn't guarded, the sound will be emitted twice, once by the server and once by the client.
// Let the server play it since if only the client plays it, it's liable to get played twice cause of
// a prediction error. joy.
EmitSound( "Default.Zoom" ); // zoom sound
// let the bots hear the rifle zoom
IGameEvent * event = gameeventmanager->CreateEvent( "weapon_zoom" );
if( event )
{
event->SetInt( "userid", pPlayer->GetUserID() );
gameeventmanager->FireEvent( event );
}
#endif
}
示例4: GetMaxSpeed
float CWeaponScout::GetMaxSpeed() const
{
CCSPlayer *pPlayer = GetPlayerOwner();
if (pPlayer == NULL)
{
Assert(pPlayer != NULL);
return BaseClass::GetMaxSpeed();
}
if ( pPlayer->GetFOV() == pPlayer->GetDefaultFOV() )
return BaseClass::GetMaxSpeed();
else
return 220; // zoomed in.
}