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


C++ C_TFPlayer::IsAlive方法代码示例

本文整理汇总了C++中C_TFPlayer::IsAlive方法的典型用法代码示例。如果您正苦于以下问题:C++ C_TFPlayer::IsAlive方法的具体用法?C++ C_TFPlayer::IsAlive怎么用?C++ C_TFPlayer::IsAlive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在C_TFPlayer的用法示例。


在下文中一共展示了C_TFPlayer::IsAlive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShouldDraw

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
bool CHudDemomanChargeMeter::ShouldDraw( void )
{
	C_TFPlayer *pPlayer = C_TFPlayer::GetLocalTFPlayer();

	if ( !pPlayer || !pPlayer->IsPlayerClass( TF_CLASS_DEMOMAN ) || !pPlayer->IsAlive() )
	{
		return false;
	}

	CTFWeaponBase *pWpn = pPlayer->GetActiveTFWeapon();

	if ( !pWpn )
	{
		return false;
	}

	int iWeaponID = pWpn->GetWeaponID();

	if ( iWeaponID != TF_WEAPON_PIPEBOMBLAUNCHER )
	{
		return false;
	}

	return CHudElement::ShouldDraw();
}
开发者ID:TenmaPL,项目名称:TF2Classic,代码行数:28,代码来源:tf_hud_demomancharge.cpp

示例2: DrawModel

//-----------------------------------------------------------------------------
// Purpose: Don't render the weapon if its supposed to be lowered and we have
// finished the lowering animation
//-----------------------------------------------------------------------------
int CTFViewModel::DrawModel( int flags )
{
    // Check for lowering the weapon
    C_TFPlayer *pPlayer = C_TFPlayer::GetLocalTFPlayer();

    Assert( pPlayer );

    bool bLowered = pPlayer->IsWeaponLowered();

    if ( bLowered && fabs( m_vLoweredWeaponOffset.x - cl_gunlowerangle.GetFloat() ) < 0.1 )
    {
        // fully lowered, stop drawing
        return 1;
    }

    C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
    if ( pLocalPlayer && pLocalPlayer->GetObserverMode() == OBS_MODE_IN_EYE &&
            pLocalPlayer->GetObserverTarget() && pLocalPlayer->GetObserverTarget()->IsPlayer() )
    {
        pPlayer = ToTFPlayer( pLocalPlayer->GetObserverTarget() );

        if ( pPlayer != GetOwner() )
            return 0;
    }

    if ( pPlayer->IsAlive() == false )
    {
        return 0;
    }

    return BaseClass::DrawModel( flags );
}
开发者ID:MrBoomer568,项目名称:TF2Classic,代码行数:36,代码来源:tf_viewmodel.cpp

示例3: ShouldDraw

bool CHudSmokeBomb::ShouldDraw()
{
	C_TFPlayer *pPlayer = C_TFPlayer::GetLocalTFPlayer();

	// if we are spectating another player first person, check this player
	if ( pPlayer && ( pPlayer->GetObserverMode() == OBS_MODE_IN_EYE ) )
	{
		pPlayer = ToTFPlayer( pPlayer->GetObserverTarget() );
	}

	return ( pPlayer && pPlayer->IsAlive() && pPlayer->m_Shared.InCond( TF_COND_SMOKE_BOMB ) );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:12,代码来源:tf_hud_smoke_bomb.cpp

示例4: ShouldDraw

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
bool CHudMedicChargeMeter::ShouldDraw( void )
{
	C_TFPlayer *pPlayer = C_TFPlayer::GetLocalTFPlayer();

	if ( !pPlayer || !pPlayer->IsPlayerClass( TF_CLASS_MEDIC ) || !pPlayer->IsAlive() )
	{
		return false;
	}

	CTFWeaponBase *pWpn = pPlayer->GetActiveTFWeapon();

	if ( !pWpn )
	{
		return false;
	}

	if ( pWpn->GetWeaponID() != TF_WEAPON_MEDIGUN )
	{
		return false;
	}

	return CHudElement::ShouldDraw();
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:26,代码来源:tf_hud_mediccharge.cpp


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