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


C++ CActor::GetActorStrength方法代码示例

本文整理汇总了C++中CActor::GetActorStrength方法的典型用法代码示例。如果您正苦于以下问题:C++ CActor::GetActorStrength方法的具体用法?C++ CActor::GetActorStrength怎么用?C++ CActor::GetActorStrength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CActor的用法示例。


在下文中一共展示了CActor::GetActorStrength方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NetShootEx

//------------------------------------------------------------------------
void CMelee::NetShootEx(const Vec3 &pos, const Vec3 &dir, const Vec3 &vel, const Vec3 &hit, float extra, int ph)
{
	CActor *pActor = m_pWeapon->GetOwnerActor();
	if(!pActor)
		return;

	IMovementController * pMC = pActor->GetMovementController();
	if (!pMC)
		return;

	float strength = 1.0f;//pActor->GetActorStrength();
	if (pActor->GetActorClass() == CPlayer::GetActorClassType())
	{
		CPlayer *pPlayer = (CPlayer *)pActor;
		if (CNanoSuit *pSuit = pPlayer->GetNanoSuit())
		{
			ENanoMode curMode = pSuit->GetMode();
			if (curMode == NANOMODE_STRENGTH)
			{
				strength = pActor->GetActorStrength();
				strength = strength * (1.0f + 2.0f * pSuit->GetSlotValue(NANOSLOT_STRENGTH)*STRENGTH_MULT);
			}
		}
	}

	if (!PerformRayTest(pos, dir, strength, true))
		if(!PerformCylinderTest(pos, dir, strength, true))
			ApplyCameraShake(false);

	m_ignoredEntity = 0;
	m_meleeScale = 1.0f;
}
开发者ID:RenEvo,项目名称:dead6,代码行数:33,代码来源:Melee.cpp

示例2: GetOwnerStrength

float CMelee::GetOwnerStrength() const
{
	CActor *pActor = m_pWeapon->GetOwnerActor();
	if(!pActor)
		return 1.0f;

	IMovementController * pMC = pActor->GetMovementController();
	if (!pMC)
		return 1.0f;

	float strength = 1.0f;//pActor->GetActorStrength();
	if (pActor->GetActorClass() == CPlayer::GetActorClassType())
	{
		CPlayer *pPlayer = (CPlayer *)pActor;
		if (CNanoSuit *pSuit = pPlayer->GetNanoSuit())
		{
			ENanoMode curMode = pSuit->GetMode();
			if (curMode == NANOMODE_STRENGTH)
			{
				strength = pActor->GetActorStrength();
				strength = strength * (1.0f + 2.0f * pSuit->GetSlotValue(NANOSLOT_STRENGTH)*STRENGTH_MULT);
			}
		}
	}

	return strength;
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:27,代码来源:Melee.cpp

示例3: Update

//------------------------------------------------------------------------
void CMelee::Update(float frameTime, uint frameId)
{
	FUNCTION_PROFILER( GetISystem(), PROFILE_GAME );

	bool requireUpdate = false;
	
	if (m_attacking)
	{
		requireUpdate = true;
		if (m_delayTimer>0.0f)
		{
			m_delayTimer-=frameTime;
			if (m_delayTimer<=0.0f)
				m_delayTimer=0.0f;
		}
		else
		{
			if (!m_attacked)
			{
				m_attacked = true;

				CActor *pActor = m_pWeapon->GetOwnerActor();
				if(!pActor)
					return;

				Vec3 pos(ZERO);
				Vec3 dir(ZERO);
				IMovementController * pMC = pActor->GetMovementController();
				if (!pMC)
					return;

				float strength = 1.0f;//pActor->GetActorStrength();
				if (pActor->GetActorClass() == CPlayer::GetActorClassType())
				{
					CPlayer *pPlayer = (CPlayer *)pActor;
					if (CNanoSuit *pSuit = pPlayer->GetNanoSuit())
					{
						ENanoMode curMode = pSuit->GetMode();
						if (curMode == NANOMODE_STRENGTH)
						{
							strength = pActor->GetActorStrength();
							strength = strength * (1.0f + 2.0f * pSuit->GetSlotValue(NANOSLOT_STRENGTH)* STRENGTH_MULT);
							if(!pPlayer->IsPlayer() && g_pGameCVars->g_difficultyLevel < 4)
								strength *= g_pGameCVars->g_AiSuitStrengthMeleeMult;
						}
					}
				}

				SMovementState info;
				pMC->GetMovementState(info);
				pos = info.eyePosition;
				dir = info.eyeDirection;
				if (!PerformRayTest(pos, dir, strength, false))
					if(!PerformCylinderTest(pos, dir, strength, false))
						ApplyCameraShake(false);

				m_ignoredEntity = 0;
				m_meleeScale = 1.0f;
				
				m_pWeapon->RequestMeleeAttack(m_pWeapon->GetMeleeFireMode()==this, pos, dir);
			}
		}
	}

	if (requireUpdate)
		m_pWeapon->RequireUpdate(eIUS_FireMode);
}
开发者ID:RenEvo,项目名称:dead6,代码行数:68,代码来源:Melee.cpp


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