本文整理汇总了C++中CBaseAnimating::IsOnFire方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseAnimating::IsOnFire方法的具体用法?C++ CBaseAnimating::IsOnFire怎么用?C++ CBaseAnimating::IsOnFire使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseAnimating
的用法示例。
在下文中一共展示了CBaseAnimating::IsOnFire方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlameHit
void CASW_Flamer_Projectile::FlameHit( CBaseEntity *pOther, const Vector &vecHitPos, bool bOnlyHurtUnignited )
{
if (!pOther)
return;
bool bHurt = true;
if ( pOther->m_takedamage != DAMAGE_NO)
{
if ( pOther == m_pLastHitEnt )
return;
if ( bOnlyHurtUnignited)
{
CBaseAnimating* pAnim = dynamic_cast<CBaseAnimating*>(pOther);
if ( pAnim && pAnim->IsOnFire() )
{
bHurt = false;
}
}
if ( bHurt )
{
Vector vecNormalizedVel = GetAbsVelocity();
ClearMultiDamage();
VectorNormalize( vecNormalizedVel );
if( GetOwnerEntity() && GetOwnerEntity()->IsPlayer() && pOther->IsNPC() )
{
CTakeDamageInfo dmgInfo( this, m_pGetsCreditedForDamage, m_flDamage, DMG_BURN );
dmgInfo.AdjustPlayerDamageInflictedForSkillLevel();
CalculateMeleeDamageForce( &dmgInfo, vecNormalizedVel, vecHitPos, asw_flamer_force.GetFloat() );
dmgInfo.SetDamagePosition( vecHitPos );
dmgInfo.SetWeapon( m_hCreatorWeapon.Get() );
pOther->TakeDamage(dmgInfo);
}
else
{
CTakeDamageInfo dmgInfo( this, m_pGetsCreditedForDamage, m_flDamage, DMG_BURN );
CalculateMeleeDamageForce( &dmgInfo, vecNormalizedVel, vecHitPos, asw_flamer_force.GetFloat() );
dmgInfo.SetDamagePosition( vecHitPos );
dmgInfo.SetWeapon( m_hCreatorWeapon.Get() );
pOther->TakeDamage(dmgInfo);
}
ApplyMultiDamage();
// keep going through normal entities?
m_pLastHitEnt = pOther;
}
if ( pOther->Classify() == CLASS_ASW_SHIELDBUG ) // We also want to bounce off shield bugs
{
Vector vel = GetAbsVelocity();
Vector dir = vel;
VectorNormalize( dir );
// reflect velocity around normal
vel = -2.0f * dir + vel;
vel *= 0.4f;
// absorb 80% in impact
SetAbsVelocity( vel );
}
return;
}
if ( pOther->GetCollisionGroup() == ASW_COLLISION_GROUP_PASSABLE )
return;
trace_t tr;
tr = BaseClass::GetTouchTrace();
// See if we struck the world
if ( pOther->GetMoveType() == MOVETYPE_NONE && !( tr.surface.flags & SURF_SKY ) )
{
Vector vel = GetAbsVelocity();
if ( tr.startsolid )
{
if ( !m_inSolid )
{
// UNDONE: Do a better contact solution that uses relative velocity?
vel *= -1.0f; // bounce backwards
SetAbsVelocity(vel);
}
m_inSolid = true;
return;
}
m_inSolid = false;
if ( tr.DidHit() )
{
Vector dir = vel;
VectorNormalize(dir);
// reflect velocity around normal
vel = -2.0f * tr.plane.normal * DotProduct(vel,tr.plane.normal) + vel;
//.........这里部分代码省略.........