本文整理汇总了C++中CCharacter::GetCharacterClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::GetCharacterClass方法的具体用法?C++ CCharacter::GetCharacterClass怎么用?C++ CCharacter::GetCharacterClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::GetCharacterClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveBadAI
void CinematicTrigger::RemoveBadAI()
{
HOBJECT hObj = g_pLTServer->GetNextObject(LTNULL);
HCLASS hClass = g_pLTServer->GetClass("CAI");
// Remove all the ai objects...
LTBOOL bRemove = LTFALSE;
HOBJECT hRemoveObj = LTNULL;
while (hObj)
{
if (g_pLTServer->IsKindOf(g_pLTServer->GetObjectClass(hObj), hClass))
{
hRemoveObj = hObj;
}
hObj = g_pLTServer->GetNextObject(hObj);
if (hRemoveObj)
{
CCharacter* pChar = (CCharacter*) g_pLTServer->HandleToObject(hRemoveObj);
if (pChar && pChar->GetCharacterClass() == BAD)
{
SendTriggerMsgToObject(this, pChar->m_hObject, LTFALSE, "REMOVE");
}
hRemoveObj = LTNULL;
}
}
hObj = g_pLTServer->GetNextInactiveObject(LTNULL);
hRemoveObj = LTNULL;
while (hObj)
{
if (g_pLTServer->IsKindOf(g_pLTServer->GetObjectClass(hObj), hClass))
{
hRemoveObj = hObj;
}
hObj = g_pLTServer->GetNextInactiveObject(hObj);
if (hRemoveObj)
{
CCharacter* pChar = (CCharacter*) g_pLTServer->HandleToObject(hRemoveObj);
if (pChar && pChar->GetCharacterClass() == BAD)
{
SendTriggerMsgToObject(this, pChar->m_hObject, LTFALSE, "REMOVE");
}
hRemoveObj = LTNULL;
}
}
}
示例2: 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;
}