当前位置: 首页>>代码示例>>C++>>正文


C++ IAIObject::GetFactionID方法代码示例

本文整理汇总了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();
}
开发者ID:kitnet,项目名称:crynegine,代码行数:37,代码来源:ScriptBind_Actor.cpp

示例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);
			}
		}
	}
}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:42,代码来源:Projectile.cpp

示例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;
}
开发者ID:Xydrel,项目名称:Infected,代码行数:21,代码来源:AutoAimManager.cpp

示例4: GetTargetFaction

uint8 CAutoAimManager::GetTargetFaction( IEntity& targetEntity ) const
{
	IAIObject* pAIObject = targetEntity.GetAI();
	return pAIObject ? pAIObject->GetFactionID() : IFactionMap::InvalidFactionID;
}
开发者ID:Xydrel,项目名称:Infected,代码行数:5,代码来源:AutoAimManager.cpp


注:本文中的IAIObject::GetFactionID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。