当前位置: 首页>>代码示例>>C++>>正文


C++ CCSPlayer::GetDefaultFOV方法代码示例

本文整理汇总了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;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:29,代码来源:weapon_csbasegun.cpp

示例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 );
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:32,代码来源:weapon_scout.cpp

示例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
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:44,代码来源:weapon_scout.cpp

示例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.
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:14,代码来源:weapon_scout.cpp


注:本文中的CCSPlayer::GetDefaultFOV方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。