Esempio n. 1
0
void CActionCoopAnimation::Exit()
{
	SendStateEventCoopAnim();

	TPlayerAction::Exit();

	IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
	IAnimatedCharacter* pAnimCharTarget = m_targetEntityID ? m_target.GetAnimatedCharacter() : NULL;

	if( pAnimChar )
	{
		pAnimChar->SetMovementControlMethods(eMCM_Entity, eMCM_Entity);
		pAnimChar->ForceRefreshPhysicalColliderMode();
		pAnimChar->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CActionStealthKill::Exit()");
	}
	if (pAnimCharTarget)
	{
		pAnimCharTarget->SetMovementControlMethods(eMCM_Entity, eMCM_Entity);
		pAnimCharTarget->ForceRefreshPhysicalColliderMode();
		pAnimCharTarget->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CActionStealthKill::Exit()");
	}

	RemoveTargetFromSlaveContext();

	m_player.PartialAnimationControlled( false, PlayerCameraAnimationSettings());
	m_player.GetActorStats()->animationControlledID = 0;
	m_player.HolsterItem(false);

	// Update visibility to change render mode of 1st person character
	m_player.RefreshVisibilityState();
}
void CAnimActionAIStance::SetMovementParameters()
{
	IAnimatedCharacter* pAnimatedCharacter = m_pPlayer->GetAnimatedCharacter();
	if ( pAnimatedCharacter )
	{
		CAIAnimationComponent* pAnimationComponent = m_pPlayer->GetAIAnimationComponent();
		CRY_ASSERT( pAnimationComponent );
		if (pAnimationComponent->GetUseLegacyCoverLocator())
		{
			const bool toCoverStance = ( m_targetStance == STANCE_HIGH_COVER || m_targetStance == STANCE_LOW_COVER );
			if ( toCoverStance )
			{
				pAnimatedCharacter->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );
				pAnimatedCharacter->UseAnimationMovementForEntity( true, true, false );
			}
			else
			{
				pAnimatedCharacter->SetMovementControlMethods( eMCM_AnimationHCollision, eMCM_Entity );
			}
		}
		else
		{
			pAnimatedCharacter->SetMovementControlMethods( eMCM_AnimationHCollision, eMCM_Entity );
		}
	}
}
Esempio n. 3
0
    virtual void Exit()
    {
        TPlayerAction::Exit();

        IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();

        if( pAnimChar )
            {
                pAnimChar->SetMovementControlMethods(eMCM_Entity, eMCM_Entity);
                pAnimChar->ForceRefreshPhysicalColliderMode();
                pAnimChar->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CActionLedgeGrab::Enter()");
            }

        if (!m_haveUnHolsteredWeapon)
            {
                m_haveUnHolsteredWeapon=true;
                m_player.HolsterItem_NoNetwork(false, true, 0.5f);
            }

        m_player.PartialAnimationControlled( false, PlayerCameraAnimationSettings() );

        SPlayerStats *pPlayerStats = m_player.GetActorStats();
        pPlayerStats->forceSTAP = SPlayerStats::eFS_None;
        pPlayerStats->bDisableTranslationPinning=false;

        m_player.StateMachineHandleEventMovement( PLAYER_EVENT_LEDGE_ANIM_FINISHED );
    }
Esempio n. 4
0
    virtual void Enter()
    {
        TPlayerAction::Enter();

        IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();

        if( pAnimChar )
            {
                pAnimChar->SetMovementControlMethods(eMCM_Animation, eMCM_Animation);
                pAnimChar->RequestPhysicalColliderMode(eColliderMode_Disabled, eColliderModeLayer_Game, "CActionLedgeGrab::Enter()");
            }
        switch (m_transitionType)
            {
            case SLedgeTransitionData::eOLT_VaultOverIntoFall:
            case SLedgeTransitionData::eOLT_VaultOnto:
            case SLedgeTransitionData::eOLT_VaultOver:
            case SLedgeTransitionData::eOLT_HighVaultOverIntoFall:
            case SLedgeTransitionData::eOLT_HighVaultOnto:
            case SLedgeTransitionData::eOLT_HighVaultOver:
                break;
            default:
            {
                PlayerCameraAnimationSettings cameraAnimationSettings;
                cameraAnimationSettings.positionFactor = 1.0f;
                cameraAnimationSettings.rotationFactor = g_pGameCVars->pl_ledgeClamber.cameraBlendWeight;
                m_player.PartialAnimationControlled( true, cameraAnimationSettings );
            }
            break;
            }
    }
Esempio n. 5
0
void CActionCoopAnimation::Enter()
{
	TPlayerAction::Enter();

	QuatT targetPos(m_rootScope->GetEntity().GetPos(), m_rootScope->GetEntity().GetRotation());

	SetParam("TargetPos", targetPos);
	CRecordingSystem* pRecordingSystem = g_pGame->GetRecordingSystem();
	if (pRecordingSystem)
	{
		pRecordingSystem->OnMannequinSetParam(m_rootScope->GetEntityId(), "TargetPos", targetPos);
	}

	IAnimatedCharacter* pAnimChar				= m_player.GetAnimatedCharacter();
	IAnimatedCharacter* pAnimCharTarget = m_target.GetAnimatedCharacter();

	if( pAnimChar )
	{
		pAnimChar->SetMovementControlMethods(eMCM_Animation, eMCM_Animation);
		pAnimChar->RequestPhysicalColliderMode(eColliderMode_Disabled, eColliderModeLayer_Game, "CActionStealthKill::Enter()");
	}
	if (pAnimCharTarget)
	{
		pAnimCharTarget->SetMovementControlMethods(eMCM_Animation, eMCM_Animation);
		pAnimCharTarget->RequestPhysicalColliderMode(eColliderMode_Disabled, eColliderModeLayer_Game, "CActionStealthKill::Enter()");
	}

	PlayerCameraAnimationSettings cameraAnimationSettings;
	cameraAnimationSettings.positionFactor = 1.0f;
	cameraAnimationSettings.rotationFactor = 1.0f;
	cameraAnimationSettings.stableBlendOff = true;
	m_player.PartialAnimationControlled( true, cameraAnimationSettings );
	m_player.GetActorStats()->animationControlledID = m_target.GetEntityId();
	m_player.HolsterItem(true);

	// Update visibility to change render mode of 1st person character
	m_player.RefreshVisibilityState();

	// Mannequin can't set the tag's correctly on the exit, so we have to do it immediately after we started instead :)
	// the tags are set, but Exit() is called too late for our purposes, it is needed during the resolve of the next action
	m_rootScope->GetActionController().GetContext().state.Set(m_targetTagID, false);
}
Esempio n. 6
0
int CScriptBind_Actor::SetMovementControlledByAnimation(IFunctionHandler *pH, bool enable)
{
		CActor *pActor = GetActor(pH);
		if (!pActor)
				return pH->EndFunction();

		IAnimatedCharacter* pAnimChar = pActor->GetAnimatedCharacter();
		if (!pAnimChar)
				return pH->EndFunction();

		if(enable)
		{
				pAnimChar->SetMovementControlMethods(eMCM_AnimationHCollision, eMCM_Animation);
				pAnimChar->UseAnimationMovementForEntity( true, true, true );
		}
		else
		{
				pAnimChar->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );
				pAnimChar->UseAnimationMovementForEntity( false, false, false );
		}
		
		return pH->EndFunction();
}
void CAnimActionAIStance::RestoreMovementParameters()
{
	// We are currently not storing the parameters from SetMovementParameters, but going back to hopefully reasonable defaults instead.
	IAnimatedCharacter* pAnimatedCharacter = m_pPlayer->GetAnimatedCharacter();
	if ( pAnimatedCharacter )
	{
		pAnimatedCharacter->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );

		CAIAnimationComponent* pAnimationComponent = m_pPlayer->GetAIAnimationComponent();
		CRY_ASSERT( pAnimationComponent );
		if (pAnimationComponent->GetUseLegacyCoverLocator())
		{
			pAnimatedCharacter->UseAnimationMovementForEntity( false, false, false );
		}
	}
}
Esempio n. 8
0
	virtual void Enter()
	{
		LadderLog ("Entering %s instance for %s", GetName(), m_player.GetEntity()->GetEntityTextDescription());
		LadderLogIndent();

		TPlayerAction::Enter();

		IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();

		if (pAnimChar)
		{
			EMovementControlMethod method = m_interruptable ? eMCM_Entity : eMCM_Animation;
			pAnimChar->SetMovementControlMethods(method, method);
		}

		m_player.BlendPartialCameraAnim(m_cameraAnimFactorAtStart, 0.1f);
		m_player.SetCanTurnBody(false);

		m_ladderState->InformLadderAnimEnter(m_player, this);
	}
Esempio n. 9
0
void CNetPlayerInput::Update()
{
	if (gEnv->bServer && (g_pGameCVars->sv_input_timeout>0) && ((gEnv->pTimer->GetFrameStartTime()-m_lastUpdate).GetMilliSeconds()>=g_pGameCVars->sv_input_timeout))
	{
		m_curInput.deltaMovement.zero();
		// PLAYERPREDICTION
		m_curInput.sprint=false;
		m_curInput.stance=(uint8)STANCE_NULL;

		CHANGED_NETWORK_STATE(m_pPlayer,  IPlayerInput::INPUT_ASPECT );
		// ~PLAYERPREDICTION
	}

	// Disallow animation movement control for remotely controlled
	// characters.  We'll rely on the interpolation to server-controlled
	// location & rotation.
	if( m_pPlayer && m_pPlayer->GetAnimatedCharacter() )
	{
		IAnimatedCharacter* pAnimChar = m_pPlayer->GetAnimatedCharacter();
		pAnimChar->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );
		pAnimChar->UseAnimationMovementForEntity( false, false, false );
	}
}