本文整理汇总了C++中CCharacter::ComputeDamageModifier方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::ComputeDamageModifier方法的具体用法?C++ CCharacter::ComputeDamageModifier怎么用?C++ CCharacter::ComputeDamageModifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::ComputeDamageModifier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestInsideObject
LTBOOL CProjectile::TestInsideObject(HOBJECT hTestObj, AmmoType eAmmoType)
{
if (!hTestObj) return LTFALSE;
// TO DO???
// NOTE: This code may need to be updated to use test the dims
// of the CharacterHitBox instead of the dims of the object...
// TO DO???
// See if we are inside the test object...
LTVector vTestPos, vTestDims;
g_pLTServer->GetObjectPos(hTestObj, &vTestPos);
g_pLTServer->GetObjectDims(hTestObj, &vTestDims);
if (m_vFirePos.x < vTestPos.x - vTestDims.x ||
m_vFirePos.x > vTestPos.x + vTestDims.x ||
m_vFirePos.y < vTestPos.y - vTestDims.y ||
m_vFirePos.y > vTestPos.y + vTestDims.y ||
m_vFirePos.z < vTestPos.z - vTestDims.z ||
m_vFirePos.z > vTestPos.z + vTestDims.z)
{
return LTFALSE;
}
// We're inside the object, so we automatically hit the object...
if (eAmmoType == PROJECTILE)
{
Detonate(hTestObj);
}
else
{
if (eAmmoType == VECTOR)
{
if (IsCharacter(hTestObj))
{
CCharacter *pChar = (CCharacter*) g_pLTServer->HandleToObject(hTestObj);
if (!pChar) return LTFALSE;
ModelNode eModelNode = g_pModelButeMgr->GetSkeletonDefaultHitNode(pChar->GetModelSkeleton());
pChar->SetModelNodeLastHit(eModelNode);
m_fInstDamage *= pChar->ComputeDamageModifier(eModelNode);
}
ImpactDamageObject(m_hFiredFrom, hTestObj);
}
LTVector vNormal(0, 1, 0);
AddImpact(hTestObj, m_vFlashPos, vTestPos, vNormal, GetSurfaceType(hTestObj));
}
RemoveObject();
return LTTRUE;
}