本文整理汇总了C++中CActor::GetActorClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CActor::GetActorClass方法的具体用法?C++ CActor::GetActorClass怎么用?C++ CActor::GetActorClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActor
的用法示例。
在下文中一共展示了CActor::GetActorClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: ProcessDeath
//------------------------------------------------------------------------
void CGameRulesMPDamageHandling::ProcessDeath( const HitInfo &hitInfo, CActor& rTarget )
{
if(rTarget.GetActorClass() == CPlayer::GetActorClassType())
{
m_pGameRules->KillPlayer(&rTarget, (hitInfo.type != CGameRules::EHitType::PunishFall), true, hitInfo);
}
}
示例3: 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;
}
示例4: GetAIPlayerAgainstColliderEnergyScale
//------------------------------------------------------------------------
float CGameRulesCommonDamageHandling::GetAIPlayerAgainstColliderEnergyScale(const IEntity& collider) const
{
const float energyScaleAgainstNonActor = 10.0f;
const float energyScaleAgainstRagdoll = 50.0f;
CActor* pColliderActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(collider.GetId()));
if (pColliderActor)
{
uint8 physicsAspectProfile = pColliderActor->GetGameObject()->GetAspectProfile(eEA_Physics) ;
if ((physicsAspectProfile == eAP_Ragdoll) || (physicsAspectProfile == eAP_Sleep))
{
return energyScaleAgainstRagdoll;
}
if (pColliderActor->GetActorClass() == CPlayer::GetActorClassType())
{
SPlayerStats* pColliderStats = static_cast<SPlayerStats*>(pColliderActor->GetActorStats());
if (pColliderStats != NULL && pColliderStats->followCharacterHead)
{
return 0.0f;
}
}
}
return energyScaleAgainstNonActor;
}
示例5: ProcessEvent
void CFlowNode_SimulateInput::ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
{
if(event == eFE_Activate)
{
bool isPressPort = IsPortActive(pActInfo, eInputPorts_Press);
bool isReleasePort = IsPortActive(pActInfo, eInputPorts_Release);
bool isHoldPort = IsPortActive(pActInfo, eInputPorts_Hold);
bool triggerResponse = false;
int playerInputEvent;
int nodeOutput;
if(isPressPort)
{
triggerResponse = true;
playerInputEvent = eAAM_OnPress;
nodeOutput = eOutputPort_Pressed;
}
else if(isHoldPort)
{
triggerResponse = true;
playerInputEvent = eAAM_OnHold;
nodeOutput = eOutputPort_Held;
}
else if(isReleasePort)
{
triggerResponse = true;
playerInputEvent = eAAM_OnRelease;
nodeOutput = eOutputPort_Released;
}
if(triggerResponse)
{
CActor *pClientActor = static_cast<CActor *>(g_pGame->GetIGameFramework()->GetClientActor());
if(pClientActor)
{
if(pClientActor->GetActorClass() == CPlayer::GetActorClassType())
{
CPlayer *pClientPlayer = static_cast<CPlayer *>(pClientActor);
const char *action = GetPortString(pActInfo, eInputPorts_Action).c_str();
const float inputValue = GetPortFloat(pActInfo, eInputPorts_Value);
IPlayerInput *pPlayerInput = pClientPlayer->GetPlayerInput();
if(pPlayerInput)
{
CODECHECKPOINT(SimulateInput_ProcessEvent_SendAction);
pPlayerInput->OnAction(action, playerInputEvent, isPressPort ? clamp(inputValue, 0.0f, 1.0f) : 0.0f);
}
}
}
ActivateOutput(pActInfo, nodeOutput, true);
}
}
}
示例6: UpdateAdditiveCameraInput
void CCinematicInput::UpdateAdditiveCameraInput( IScriptSystem* pScriptSystem, float frameTime )
{
CCinematicInput::SUpdateContext updateCtx;
pScriptSystem->GetGlobalValue("Cinematic_CameraLookUp", updateCtx.m_lookUpLimit);
pScriptSystem->GetGlobalValue("Cinematic_CameraLookDown", updateCtx.m_lookDownLimit);
pScriptSystem->GetGlobalValue("Cinematic_CameraLookLeft", updateCtx.m_lookLeftLimit);
pScriptSystem->GetGlobalValue("Cinematic_CameraLookRight", updateCtx.m_lookRightLimit);
float recenterCamera = 0.0f;
pScriptSystem->GetGlobalValue("Cinematic_CameraDoNotCenter", recenterCamera);
updateCtx.m_lookUpLimit = DEG2RAD(updateCtx.m_lookUpLimit);
updateCtx.m_lookDownLimit = DEG2RAD(updateCtx.m_lookDownLimit);
updateCtx.m_lookLeftLimit = DEG2RAD(updateCtx.m_lookLeftLimit);
updateCtx.m_lookRightLimit = DEG2RAD(updateCtx.m_lookRightLimit);
updateCtx.m_recenter = (recenterCamera < 0.01f);
updateCtx.m_frameTime = frameTime;
CActor* pClientActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor());
if (pClientActor)
{
CRY_ASSERT(pClientActor->GetActorClass() == CPlayer::GetActorClassType());
CPlayer* pClientPlayer = static_cast<CPlayer*>(pClientActor);
IPlayerInput* pIPlayerInput = pClientPlayer->GetPlayerInput();
if(pIPlayerInput && pIPlayerInput->GetType() == IPlayerInput::PLAYER_INPUT)
{
CPlayerInput * pPlayerInput = static_cast<CPlayerInput*>(pIPlayerInput);
Ang3 frameAccumulatedAngles(0.0f, 0.0f, 0.0f);
#if CINEMATIC_INPUT_PC_MOUSE
const bool isAimingWithMouse = pPlayerInput->IsAimingWithMouse();
RefreshInputMethod(isAimingWithMouse);
if (isAimingWithMouse)
{
frameAccumulatedAngles = UpdateAdditiveCameraInputWithMouse(updateCtx, pPlayerInput->GetRawMouseInput());
}
else
{
frameAccumulatedAngles = UpdateAdditiveCameraInputWithController(updateCtx, pPlayerInput->GetRawControllerInput());
}
#else
frameAccumulatedAngles = UpdateAdditiveCameraInputWithController(updateCtx, pPlayerInput->GetRawControllerInput());
#endif
IView* pActiveView = g_pGame->GetIGameFramework()->GetIViewSystem()->GetActiveView();
if (pActiveView)
{
pActiveView->SetFrameAdditiveCameraAngles(frameAccumulatedAngles);
}
}
}
}
示例7: SetSearchBeam
//------------------------------------------------------------------------
int CScriptBind_Actor::SetSearchBeam(IFunctionHandler *pH, Vec3 dir)
{
CActor *pActor = GetActor(pH);
if (!pActor || pActor->GetActorClass() != CAlien::GetActorClassType())
return pH->EndFunction();
((CAlien*)pActor)->SetSearchBeamGoal(dir);
return pH->EndFunction();
}
示例8: SetNanoSuitEnergy
//------------------------------------------------------------------------
int CScriptBind_Actor::SetNanoSuitEnergy(IFunctionHandler *pH, int energy)
{
CActor *pActor = GetActor(pH);
if (!pActor || pActor->GetActorClass() != CPlayer::GetActorClassType())
return pH ->EndFunction();
if(CNanoSuit *pSuit = ((CPlayer*)pActor)->GetNanoSuit())
pSuit->SetSuitEnergy(energy);
return pH->EndFunction();
}
示例9: GetNanoSuitMode
//------------------------------------------------------------------------
int CScriptBind_Actor::GetNanoSuitMode(IFunctionHandler *pH)
{
CActor *pActor = GetActor(pH);
if (!pActor || pActor->GetActorClass() != CPlayer::GetActorClassType())
return pH->EndFunction(0);
if(CNanoSuit *pSuit = ((CPlayer*)pActor)->GetNanoSuit())
return pH->EndFunction((int)(pSuit->GetMode()));
return pH->EndFunction(0);
}
示例10: TogglePlayerThirdPerson
void CCinematicInput::TogglePlayerThirdPerson(bool bEnable)
{
CActor* pClientActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor());
if (pClientActor)
{
CRY_ASSERT(pClientActor->GetActorClass() == CPlayer::GetActorClassType());
CPlayer* pClientPlayer = static_cast<CPlayer*>(pClientActor);
pClientPlayer->SetThirdPerson((bEnable && !pClientPlayer->IsThirdPerson()));
}
}
示例11: UpdateAdditiveCameraInput
void CCinematicInput::UpdateAdditiveCameraInput(IScriptSystem *pScriptSystem, float frameTime)
{
float lookUpLimit = 0.0f, lookDownLimit = 0.0f;
float lookLeftLimit = 0.0f, lookRightLimit = 0.0f;
pScriptSystem->GetGlobalValue("Cinematic_CameraLookUp", lookUpLimit);
pScriptSystem->GetGlobalValue("Cinematic_CameraLookDown", lookDownLimit);
pScriptSystem->GetGlobalValue("Cinematic_CameraLookLeft", lookLeftLimit);
pScriptSystem->GetGlobalValue("Cinematic_CameraLookRight", lookRightLimit);
lookUpLimit = DEG2RAD(lookUpLimit);
lookDownLimit = DEG2RAD(lookDownLimit);
lookLeftLimit = DEG2RAD(lookLeftLimit);
lookRightLimit = DEG2RAD(lookRightLimit);
CActor *pClientActor = static_cast<CActor *>(g_pGame->GetIGameFramework()->GetClientActor());
if(pClientActor)
{
CRY_ASSERT(pClientActor->GetActorClass() == CPlayer::GetActorClassType());
CPlayer *pClientPlayer = static_cast<CPlayer *>(pClientActor);
IPlayerInput *pIPlayerInput = pClientPlayer->GetPlayerInput();
if(pIPlayerInput && pIPlayerInput->GetType() == IPlayerInput::PLAYER_INPUT)
{
CPlayerInput *pPlayerInput = static_cast<CPlayerInput *>(pIPlayerInput);
Ang3 rawMouseInput = pPlayerInput->GetRawMouseInput() * 0.25f;
rawMouseInput.z = - rawMouseInput.z;
rawMouseInput.x *= (g_pGameCVars->cl_invertMouse == 0) ? 1.0f : -1.0f;
Ang3 rawControllerInput = pPlayerInput->GetRawControllerInput() + rawMouseInput;
//Yaw angle (Z axis)
rawControllerInput.z = -clamp((float)__fsel(rawControllerInput.z, rawControllerInput.z * lookRightLimit, rawControllerInput.z * lookLeftLimit), -lookLeftLimit, lookRightLimit);
//Pitch angle (X axis)
rawControllerInput.x *= (g_pGameCVars->cl_invertController == 0) ? 1.0f : -1.0f;
rawControllerInput.x = clamp((float)__fsel(rawControllerInput.x, rawControllerInput.x * lookUpLimit, rawControllerInput.x * lookDownLimit), -lookDownLimit, lookUpLimit);
//No roll allowed
rawControllerInput.y = 0.0f;
Interpolate(m_currentRawInputAngles, rawControllerInput, 2.5f, frameTime);
IView *pActiveView = g_pGame->GetIGameFramework()->GetIViewSystem()->GetActiveView();
if(pActiveView)
{
pActiveView->SetFrameAdditiveCameraAngles(m_currentRawInputAngles);
}
}
}
}
示例12: ActivateNanoSuit
//------------------------------------------------------------------------
int CScriptBind_Actor::ActivateNanoSuit(IFunctionHandler *pH, int on)
{
CActor *pActor = GetActor(pH);
if (!pActor)
return pH->EndFunction();
if(pActor->GetActorClass() != CPlayer::GetActorClassType())
return pH->EndFunction();
((CPlayer*)pActor)->ActivateNanosuit((on)?true:false);
return pH->EndFunction();
}
示例13: DisablePlayerForCutscenes
void CCinematicInput::DisablePlayerForCutscenes()
{
CActor* pClientActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor());
if (pClientActor)
{
CRY_ASSERT(pClientActor->GetActorClass() == CPlayer::GetActorClassType());
CPlayer* pClientPlayer = static_cast<CPlayer*>(pClientActor);
pClientPlayer->OnBeginCutScene();
}
g_pGameActions->FilterCutsceneNoPlayer()->Enable(true);
}
示例14: NanoSuitHit
//------------------------------------------------------------------------
int CScriptBind_Actor::NanoSuitHit(IFunctionHandler *pH, int damage)
{
CActor *pActor = GetActor(pH);
if (!pActor)
return pH->EndFunction();
if(pActor->GetActorClass() != CPlayer::GetActorClassType())
return pH->EndFunction();
if(CNanoSuit *pSuit = ((CPlayer*)pActor)->GetNanoSuit())
pSuit->Hit(damage);
return pH->EndFunction();
}
示例15: NetAttack
//------------------------------------------------------------------------
void CMelee::NetAttack()
{
MeleeDebugLog ("CMelee<%p> NetAttack", this);
const ItemString &meleeAction = SelectMeleeAction();
m_pWeapon->OnMelee(m_pWeapon->GetOwnerId());
CActor* pOwner = m_pWeapon->GetOwnerActor();
if (!DoSlideMeleeAttack(pOwner))
{
if(!gEnv->bMultiplayer || !g_pGameCVars->pl_melee.mp_melee_system || !StartMultiAnimMeleeAttack(pOwner))
{
FragmentID fragmentId = m_pWeapon->GetFragmentID(meleeAction.c_str());
m_pWeapon->PlayAction(fragmentId, 0, false, CItem::eIPAF_Default);
}
}
else
{
CRY_ASSERT(pOwner && (pOwner->GetActorClass() == CPlayer::GetActorClassType()));
if( pOwner->IsPlayer() )
{
static_cast<CPlayer*> (pOwner)->StateMachineHandleEventMovement( SStateEventSlideKick(this) );
}
}
m_attacking = true;
m_slideKick = false;
m_netAttacking = true;
m_delayTimer = GetDelay();
m_pWeapon->SetBusy(true);
m_pWeapon->RequireUpdate(eIUS_FireMode);
CPlayer *pOwnerPlayer = m_pWeapon->GetOwnerPlayer();
if (pOwnerPlayer)
{
if (pOwnerPlayer->IsThirdPerson())
{
CAudioSignalPlayer::JustPlay(m_pMeleeParams->meleeparams.m_3PSignalId, pOwnerPlayer->GetEntityId());
}
else
{
CAudioSignalPlayer::JustPlay(m_pMeleeParams->meleeparams.m_FPSignalId, pOwnerPlayer->GetEntityId());
}
}
}