本文整理汇总了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;
}
示例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;
}
示例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);
}