本文整理汇总了C++中CAI::GetCharacterClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI::GetCharacterClass方法的具体用法?C++ CAI::GetCharacterClass怎么用?C++ CAI::GetCharacterClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI
的用法示例。
在下文中一共展示了CAI::GetCharacterClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoVectorFilterFn
LTBOOL DoVectorFilterFn(HOBJECT hObj, void *pUserData)
{
// We're not attacking our self...
if (SpecificObjectFilterFn(hObj, pUserData))
{
// CharacterHitBox objects are used for vector impacts, don't
// impact on the character/body prop object itself....
if (IsCharacter(hObj) || IsBody(hObj) || IsKindOf(hObj, "Intelligence"))
{
return LTFALSE;
}
// Check special character hit box cases...
if (IsCharacterHitBox(hObj))
{
CCharacterHitBox *pCharHitBox = (CCharacterHitBox*) g_pLTServer->HandleToObject(hObj);
if (pCharHitBox)
{
// Make sure we don't hit ourself...
HOBJECT hUs = (HOBJECT)pUserData;
HOBJECT hTestObj = pCharHitBox->GetModelObject();
if (!hTestObj) return LTFALSE;
if (hTestObj == hUs)
{
return LTFALSE;
}
// Do special AI hitting AI case...
if (IsAI(hUs) && IsAI(hTestObj))
{
CAI *pAI = (CAI*) g_pLTServer->HandleToObject(hUs);
if (!pAI) return LTFALSE;
// We can't hit guys we like, unless they're NEUTRAL
CCharacter* pB = (CCharacter*)g_pLTServer->HandleToObject(hTestObj);
if (!pB) return LTFALSE;
CharacterClass cc = pB->GetCharacterClass();
if (cc != NEUTRAL)
{
return LIKE != GetAlignement(pAI->GetCharacterClass(), cc);
}
}
// Check for friendly fire
if (g_pGameServerShell->GetGameType() == COOPERATIVE_ASSAULT && g_vtNetFriendlyFire.GetFloat() < 1.0f)
{
// We can't hit guys on our team unless friendly fire is turned on
if (IsPlayer(hUs) && IsPlayer(hTestObj))
{
CPlayerObj* pUs = (CPlayerObj*) g_pLTServer->HandleToObject(hUs);
if (!pUs) return LTFALSE;
CPlayerObj* pThem = (CPlayerObj*) g_pLTServer->HandleToObject(hTestObj);
if (!pThem) return LTFALSE;
if (pUs->GetTeamID() == pThem->GetTeamID())
return LTFALSE;
}
}
}
}
return LTTRUE;
}
return LTFALSE;
}