Beispiel #1
0
    public static void ProcessPlayInput()
    {
        Inputs inputs = DetermineInputs();


        // Intake pause instructions.
        if (inputs.Pause || Input.GetButtonDown(Str.Cancel))
        {
            Services.GameManager.Pause();
        }

        // Send movement inputs to player.
        Services.PlayerMovement.InputUpdate(
            inputs.Hor,
            inputs.Ver,
            inputs.Jump,
            inputs.Sprint);

        Services.CameraManager.InputUpdate(
            inputs.CameraX,
            inputs.CameraY);


        if (inputs.Interact)
        {
            if (NPCInteractionManager.CanEnterConversation)
            {
                NPCInteractionManager.InputPressed();
            }
            else
            {
                Services.PlayerItemHolder.InputPressed(); // CREATE HIERARCHY BETWEEN THESE TWO - Only one should be used at once.
            }
        }
    }
        public override void OnEnter()
        {
            Context.inPlaceForSequence = false;
            Logger.Warning("PlayerMovement entering dialogue");

            if (Context._taskManager.HasTasks())
            {
                NPCInteractionManager.FindClosestNPC();
            }

            Context._taskManager.Do(DefineSequence());
        }
Beispiel #3
0
 public override void OnExit()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
     NPCInteractionManager.ExitDialogue();
 }
    /*
     * 1. Move player to position. Move camera behind player. ~2s
     * 2. Move Camera to cutsceneCamera, have camera slowly focus on item. Make player walk to tree. ~2s
     * 3. Trigger Quest item repository to take item, trigger sounds and particle effects, smoothly animate it into position and have large particle effect. 2s
     * 4. Fade to white? black? 2s
     * 5. stay there for a sec as music fades. Place player into new position. 3s
     * 6. Fade back in and have player turned around as environment changes are triggered. 2s
     * 7. 1 sec later have player get up and return to normal controls. 1s // turns around!
     */
    private static Task DefineMidSequence()
    {
        // 1. Move player to position. Move camera behind player. ~2s
        Task enterSequence = new DelegateTask(() =>
        {
            inCutscene = true;
        }, () =>
        {
            Services.UIManager.HideItemPickupPrompt();
            return(Services.PlayerMovement.inPlaceForSequence);
        });

        Task waitForTime1 = new WaitTask(1f);

        // 2. Move Camera to cutsceneCamera, have camera slowly focus on item. Make player walk to tree. ~2s
        Task secondSequence = new DelegateTask(() =>
        {
            // Trigger particles?
            // Trigger music?
        }, () =>
        {
            Services.UIManager.HideItemPickupPrompt();
            return(Services.PlayerMovement.inPlaceForSequence);
        });

        Task dropItem = new ActionTask(() => { Services.PlayerItemHolder.DropItem(); });

        Task waitForTime2 = new WaitTask(.66f);

        // 3.Trigger Quest item repository to take item, trigger sounds and particle effects, smoothly animate it into position and have large particle effect. 2s
        ActionTask thirdSequence = new ActionTask(() =>
        {
            Services.QuestItemRepository.StartSequence();

            FModMusicManager.ReturnedItem();
            // Quest item Repository takes Item.
            // trigger other stuff.
        });

        // Add in phase here to show plants growing?????????????????????????????????????

        Task waitForTime3 = new WaitTask(1.5f);

        // 4. Fade to white? black? 2s
        ActionTask fourthSequence = new ActionTask(() =>
        {
            // Fade out?
            Services.UIManager.CutsceneFadeIn();
        });

        // 5. stay there for a sec as music fades. Place player into new position. 3s
        Task waitForTime4 = new WaitTask(4.5f);

        // 6. Fade back in and have player turned around as environment changes are triggered. 2s
        ActionTask fifthSequence = new ActionTask(() =>
        {
            Services.PostProcessingManager.AdvanceStage();
            PlayerAnimation.Sitting(true);
            // Fade in?
            Services.UIManager.CutsceneFadeOut();
            Services.UIManager.HideDialogueEnterPrompt();
        });

        Task waitForTime5 = new WaitTask(1f);

        ActionTask triggerPlantAnims = new ActionTask(() => { cutsceneObjectsManager.Transition(); });

        Task waitForTime6 = new WaitTask(10.5f);
        // 7. 1 sec later have player get up and return to normal controls. 1s
        ActionTask sixthSequence = new ActionTask(() =>
        {
            PlayerAnimation.Sitting(false);
            NPCInteractionManager.FindClosestNPC();
            Services.GameManager.EnterDialogue();
            inCutscene = false;
        });

        enterSequence.Then(waitForTime1).Then(secondSequence).Then(dropItem).Then(waitForTime2).Then(thirdSequence).Then(waitForTime3).Then(fourthSequence).Then(waitForTime4).Then(fifthSequence).Then(waitForTime5).Then(triggerPlantAnims).Then(waitForTime6).Then(sixthSequence);
        return(enterSequence);
    }
Beispiel #5
0
 public void EnterDialogue()
 {
     _fsm.TransitionTo <InDialogueState>();
     SetTargetNPC(NPCInteractionManager.ClosestNPC());
 }
Beispiel #6
0
 private void PlayerLeft()
 {
     NPCInteractionManager.PlayerLeftNPC();
     _collider.radius = _initRadius;
 }
Beispiel #7
0
 private void EncounteredPlayer()
 {
     NPCInteractionManager.PlayerEncounteredNPC(parentNPC);
     _collider.radius = _initRadius * _enteredMultiplier;
 }
 private Task DefineSequence() => Context.PlayerMoveToTransform(
     NPCInteractionManager.DialogueTrans,
     NPCInteractionManager.ClosestNPC().transform,
     NPCInteractionManager.ClosestNPC().GetPlayerCameraLookAtPosition());