本文整理汇总了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();
}
示例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 );
}
示例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 ) );
}
示例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();
}