本文整理汇总了C++中CASW_Marine::AddEffects方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine::AddEffects方法的具体用法?C++ CASW_Marine::AddEffects怎么用?C++ CASW_Marine::AddEffects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine
的用法示例。
在下文中一共展示了CASW_Marine::AddEffects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asw_ragdoll_marine_f
void asw_ragdoll_marine_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
static CRagdollProp * s_pRagdoll = NULL;
if (pPlayer && pPlayer->GetMarine())
{
CASW_Marine* pMarine = pPlayer->GetMarine();
pMarine->SetKnockedOut(!pMarine->m_bKnockedOut);
return;
if (pMarine->IsEffectActive(EF_NODRAW) && s_pRagdoll)
{
//Calcs the diff between ragdoll worldspace center and victim worldspace center, moves the victim by this diff.
//Sets the victim's angles to 0, ragdoll yaw, 0
QAngle newAngles( 0, s_pRagdoll->GetAbsAngles()[YAW], 0 );
Vector centerDelta = s_pRagdoll->WorldSpaceCenter() - pMarine->WorldSpaceCenter();
centerDelta.z = 0; // don't put us in the floor
Vector newOrigin = pMarine->GetAbsOrigin() + centerDelta;
pMarine->SetAbsOrigin( newOrigin );
pMarine->SetAbsAngles( newAngles );
//DetachAttachedRagdoll( s_pRagdoll ); // unnecessary since we remove it next?
UTIL_Remove( s_pRagdoll );
pMarine->RemoveEffects( EF_NODRAW );
pMarine->RemoveSolidFlags( FSOLID_NOT_SOLID );
}
else
{
pMarine->InvalidateBoneCache();
pMarine->AddSolidFlags( FSOLID_NOT_SOLID );
CTakeDamageInfo info;
info.SetDamageType( DMG_GENERIC );
info.SetDamageForce( vec3_origin );
info.SetDamagePosition( pMarine->WorldSpaceCenter() );
s_pRagdoll = (CRagdollProp*) CreateServerRagdoll( pMarine, 0, info, COLLISION_GROUP_NONE );
if ( s_pRagdoll )
{
s_pRagdoll->DisableAutoFade();
s_pRagdoll->SetThink( NULL );
s_pRagdoll->SetUnragdoll( pMarine );
}
pMarine->AddEffects( EF_NODRAW );
//pMarine->SetupBones( m_pRagdollBones, BONE_USED_BY_ANYTHING );
}
}
}