本文整理汇总了C++中CMultiDamage::GetPlayerPenetrationCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CMultiDamage::GetPlayerPenetrationCount方法的具体用法?C++ CMultiDamage::GetPlayerPenetrationCount怎么用?C++ CMultiDamage::GetPlayerPenetrationCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了CMultiDamage::GetPlayerPenetrationCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMultiDamage
//-----------------------------------------------------------------------------
// Purpose: Add damage to the existing multidamage, and apply if it won't fit
//-----------------------------------------------------------------------------
void AddMultiDamage( const CTakeDamageInfo &info, CBaseEntity *pEntity )
{
if ( !pEntity )
return;
if ( pEntity != g_MultiDamage.GetTarget() )
{
ApplyMultiDamage();
g_MultiDamage.Init( pEntity, info.GetInflictor(), info.GetAttacker(), info.GetWeapon(), vec3_origin, vec3_origin, vec3_origin, 0.0, info.GetDamageType(), info.GetDamageCustom() );
}
g_MultiDamage.AddDamageType( info.GetDamageType() );
g_MultiDamage.SetDamage( g_MultiDamage.GetDamage() + info.GetDamage() );
g_MultiDamage.SetDamageForce( g_MultiDamage.GetDamageForce() + info.GetDamageForce() );
g_MultiDamage.SetDamagePosition( info.GetDamagePosition() );
g_MultiDamage.SetReportedPosition( info.GetReportedPosition() );
g_MultiDamage.SetMaxDamage( MAX( g_MultiDamage.GetMaxDamage(), info.GetDamage() ) );
g_MultiDamage.SetAmmoType( info.GetAmmoType() );
if ( g_MultiDamage.GetPlayerPenetrationCount() == 0 )
{
g_MultiDamage.SetPlayerPenetrationCount( info.GetPlayerPenetrationCount() );
}
bool bHasPhysicsForceDamage = !g_pGameRules->Damage_NoPhysicsForce( info.GetDamageType() );
if ( bHasPhysicsForceDamage && g_MultiDamage.GetDamageType() != DMG_GENERIC )
{
// If you hit this assert, you've called TakeDamage with a damage type that requires a physics damage
// force & position without specifying one or both of them. Decide whether your damage that's causing
// this is something you believe should impart physics force on the receiver. If it is, you need to
// setup the damage force & position inside the CTakeDamageInfo (Utility functions for this are in
// takedamageinfo.cpp. If you think the damage shouldn't cause force (unlikely!) then you can set the
// damage type to DMG_GENERIC, or | DMG_CRUSH if you need to preserve the damage type for purposes of HUD display.
if ( g_MultiDamage.GetDamageForce() == vec3_origin || g_MultiDamage.GetDamagePosition() == vec3_origin )
{
static int warningCount = 0;
if ( ++warningCount < 10 )
{
if ( g_MultiDamage.GetDamageForce() == vec3_origin )
{
Warning( "AddMultiDamage: g_MultiDamage.GetDamageForce() == vec3_origin\n" );
}
if ( g_MultiDamage.GetDamagePosition() == vec3_origin)
{
Warning( "AddMultiDamage: g_MultiDamage.GetDamagePosition() == vec3_origin\n" );
}
}
}
}
}