本文整理汇总了C++中CBaseTFPlayer::IsHittingShield方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseTFPlayer::IsHittingShield方法的具体用法?C++ CBaseTFPlayer::IsHittingShield怎么用?C++ CBaseTFPlayer::IsHittingShield使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseTFPlayer
的用法示例。
在下文中一共展示了CBaseTFPlayer::IsHittingShield方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MissileTouch
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CGrenadeRocket::MissileTouch( CBaseEntity *pOther )
{
Assert( pOther );
if ( !pOther->IsSolid() )
return;
Vector vecAbsOrigin = GetAbsOrigin();
CPASFilter filter( vecAbsOrigin );
te->Explosion( filter, 0.0, &vecAbsOrigin, g_sModelIndexFireball, 2.0, 15, TE_EXPLFLAG_NONE, 100, m_flDamage );
StopSound( "GrenadeRocket.FlyLoop" );
// Don't apply explosive damage if it hit a shield of any kind...
bool bHittingShield = false;
if (pOther->GetCollisionGroup() == TFCOLLISION_GROUP_SHIELD)
{
bHittingShield = true;
}
else if ( pOther->IsPlayer() )
{
CBaseTFPlayer *pPlayer = static_cast<CBaseTFPlayer*>(pOther);
trace_t tr;
float flDamage = m_flDamage;
bHittingShield = pPlayer->IsHittingShield( GetAbsVelocity(), &flDamage );
}
if (!bHittingShield)
{
RadiusDamage( CTakeDamageInfo( this, m_pRealOwner, m_flDamage, DMG_BLAST ), vecAbsOrigin, 100, CLASS_NONE );
}
UTIL_Remove( this );
}
示例2: ProjectileHitShield
//-----------------------------------------------------------------------------
// Purpose:
// Input : *pOther -
// tr -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CBasePlasmaProjectile::ProjectileHitShield( CBaseEntity *pOther, trace_t& tr )
{
if ( !pOther )
return false;
if ( !pOther->IsPlayer() )
return false;
#if !defined( CLIENT_DLL )
CBaseTFPlayer* pPlayer = static_cast<CBaseTFPlayer*>(pOther);
float flDamage = GetDamage();
if ( !pPlayer->IsHittingShield( GetAbsVelocity(), &flDamage ) )
return false;
#else
return false;
#endif
return true;
}