本文整理汇总了C++中IAIObject::GetFactionID方法的典型用法代码示例。如果您正苦于以下问题:C++ IAIObject::GetFactionID方法的具体用法?C++ IAIObject::GetFactionID怎么用?C++ IAIObject::GetFactionID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAIObject
的用法示例。
在下文中一共展示了IAIObject::GetFactionID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Fall
//------------------------------------------------------------------------
int CScriptBind_Actor::Fall(IFunctionHandler *pH, Vec3 hitPos)
{
CActor *pActor = GetActor(pH);
if (!pActor)
return pH->EndFunction();
// [Mikko] 11.10.2007 - Moved the check here, since it was causing too much trouble in CActor.Fall().
// The point of this filtering is to mostly mask out self-induced collision damage on friendly NPCs
// which are playing special animations.
if(!g_pGameCVars->g_enableFriendlyFallAndPlay)
{
if (IAnimatedCharacter* pAC = pActor->GetAnimatedCharacter())
{
if ((pAC->GetPhysicalColliderMode() == eColliderMode_NonPushable) ||
(pAC->GetPhysicalColliderMode() == eColliderMode_PushesPlayersOnly))
{
// Only mask for player friendly NPCs.
if (pActor->GetEntity() && pActor->GetEntity()->GetAI())
{
IAIObject* pAI = pActor->GetEntity()->GetAI();
IAIObject* playerAI = 0;
if (IActor* pPlayerActor = m_pGameFW->GetClientActor())
playerAI = pPlayerActor->GetEntity()->GetAI();
if (playerAI
&& gEnv->pAISystem->GetFactionMap().GetReaction(playerAI->GetFactionID(), pAI->GetFactionID()) > IFactionMap::eRT_Hostile)
return pH->EndFunction();
}
}
}
}
pActor->Fall(hitPos);
return pH->EndFunction();
}
示例2: SetParams
//------------------------------------------------------------------------
void CProjectile::SetParams(EntityId ownerId, EntityId hostId, EntityId weaponId, int damage, int hitTypeId, float damageDrop /*= 0.0f*/, float damageDropMinR /*=0.0f*/)
{
m_ownerId = ownerId;
m_weaponId = weaponId;
m_hostId = hostId;
m_damage = damage;
m_hitTypeId = hitTypeId;
m_damageDropPerMeter = damageDrop;
m_damageDropMinDisSqr = damageDropMinR*damageDropMinR;
if(m_hostId || m_ownerId)
{
IEntity *pSelfEntity = GetEntity();
if(pSelfEntity)
pSelfEntity->AddEntityLink("Shooter", m_ownerId);
IEntity *pEntity = gEnv->pEntitySystem->GetEntity(m_hostId?m_hostId:m_ownerId);
if(pEntity)
{
if(pSelfEntity)
{
//need to set AI species to the shooter - not to be scared of it's own rockets
IAIObject *projectileAI = pSelfEntity->GetAI();
IAIObject *shooterAI = pEntity->GetAI();
if(projectileAI && shooterAI)
projectileAI->SetFactionID(shooterAI->GetFactionID());
}
if(m_pPhysicalEntity && m_pPhysicalEntity->GetType()==PE_PARTICLE)
{
pe_params_particle pparams;
pparams.pColliderToIgnore = pEntity->GetPhysics();
m_pPhysicalEntity->SetParams(&pparams);
}
}
}
}
示例3: GetLocalPlayerFaction
uint8 CAutoAimManager::GetLocalPlayerFaction() const
{
if (m_localPlayerFaction != IFactionMap::InvalidFactionID)
{
return m_localPlayerFaction;
}
else
{
IEntity* pLocalPlayerEntity = gEnv->pEntitySystem->GetEntity(g_pGame->GetIGameFramework()->GetClientActorId());
if (pLocalPlayerEntity)
{
IAIObject* pAIObject = pLocalPlayerEntity->GetAI();
if (pAIObject)
{
m_localPlayerFaction = pAIObject->GetFactionID();
}
}
}
return m_localPlayerFaction;
}
示例4: GetTargetFaction
uint8 CAutoAimManager::GetTargetFaction( IEntity& targetEntity ) const
{
IAIObject* pAIObject = targetEntity.GetAI();
return pAIObject ? pAIObject->GetFactionID() : IFactionMap::InvalidFactionID;
}