Exemple #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();
}
    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 );
    }
void CMountedGunController::OnLeave( )
{
    CRY_ASSERT_MESSAGE(m_pControlledPlayer, "Controlled player not initialized");

    ICharacterInstance* pCharacter = m_pControlledPlayer->IsThirdPerson() ? m_pControlledPlayer->GetEntity()->GetCharacter(0) : m_pControlledPlayer->GetShadowCharacter();
    if (pCharacter)
        {
            if(m_pMovementAction)
                {
                    m_pMovementAction->ForceFinish();
                    SAFE_RELEASE(m_pMovementAction);
                }

            CRecordingSystem* pRecordingSystem = g_pGame->GetRecordingSystem();
            if (pRecordingSystem)
                {
                    pRecordingSystem->OnMountedGunLeave(m_pControlledPlayer);
                }

            IAnimatedCharacter* pAnimatedCharacter = m_pControlledPlayer->GetAnimatedCharacter();
            CRY_ASSERT(pAnimatedCharacter);

            pAnimatedCharacter->ForceRefreshPhysicalColliderMode();
            pAnimatedCharacter->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CMountedGunController::OnLeave");
            pAnimatedCharacter->SetNoMovementOverride(false);

            if (gEnv->bMultiplayer || m_pControlledPlayer->IsPlayer())
                pAnimatedCharacter->DisableRigidCollider();

            pAnimatedCharacter->GetGroundAlignmentParams().SetFlag(eGA_AllowWithNoCollision, true);

            m_pControlledPlayer->GetActorParams().mountedWeaponCameraTarget.zero();
        }
}