Пример #1
0
    public static void ProcessPauseMenuInput()
    {
        Inputs input = DeterminePausedInputs();

#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.M))
        {
            QuestManager.AdvanceQuest(Str.Main);
        }
        if (Input.GetKeyDown(KeyCode.N))
        {
            QuestManager.AdvanceQuest(Str.Warbler);
        }
        if (Input.GetKeyDown(KeyCode.F))
        {
            QuestManager.AdvanceQuest(Str.Frog);
        }
        if (Input.GetKeyDown(KeyCode.T))
        {
            QuestManager.AdvanceQuest(Str.Turtle);
        }
        if (Input.GetKeyDown(KeyCode.H))
        {
            Services.PlayerMovement.ForceTransform(new Vector3(487, 35, 480), Quaternion.identity);
        }
#endif
        if (input.Pause)
        {
            Services.GameManager.Unpause();
        }
    }
Пример #2
0
 private void OnTriggerExit(Collider other)
 {
     if (!_enter && !_triggered && other.CompareTag(Str.PlayerTag))
     {
         QuestManager.AdvanceQuest(_questToTrigger.QuestTag);
         _triggered = true;
     }
 }
Пример #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag(Str.PlayerTag))
     {
         QuestManager.SetBoolMemoryVar("PlayerBeatTurtle");
         QuestManager.AdvanceQuest(Str.Turtle);
     }
 }
Пример #4
0
    public IEnumerator LoadDataCO()
    {
        loadingSave = true;
        //DeserializeJson(saveName);
        Data data = DeserializeData(Str.SaveName);

        Yarn.Unity.InMemoryVariableStorage questMemory = Services.DialogueController.InMemoryVariableStorage;
        questMemory.SetValue(Str.Child1String, data.warblerChildrenStatus.foundChild1);
        questMemory.SetValue(Str.Child2String, data.warblerChildrenStatus.foundChild2);
        questMemory.SetValue(Str.Child3String, data.warblerChildrenStatus.foundChild3);

        questMemory.SetValue(Str.SeedString, data.itemStatus.foundSeed);
        questMemory.SetValue(Str.SoilString, data.itemStatus.foundSoil);
        questMemory.SetValue(Str.RainString, data.itemStatus.foundRain);

        seedItem.transform.position = ToVec3(data.itemStatus.seedPos);
        soilItem.transform.position = ToVec3(data.itemStatus.soilPos);
        rainItem.transform.position = ToVec3(data.itemStatus.rainPos);

        if (data.playerHolding.itemHolding != QuestItem.QuestItemEnum.None)
        {
            QuestItem holding = null;
            switch (data.playerHolding.itemHolding)
            {
            case QuestItem.QuestItemEnum.Seed:
                holding = seedItem;
                break;

            case QuestItem.QuestItemEnum.Soil:
                holding = soilItem;
                break;

            case QuestItem.QuestItemEnum.Rain:
                holding = rainItem;
                break;

            case QuestItem.QuestItemEnum.None:
                Logger.Warning("Thought to be holding quest item, holding None quest item");
                break;
            }
            Services.PlayerItemHolder.AttachToTransform(holding);
        }

        Services.PlayerMovement.ForceTransform(ToVec3(data.playerData.position), ToQuat(data.playerData.rotation));

        foreach (QuestStageData questStageData in data.questStageData)
        {
            for (int i = 0; i < questStageData.stage; i++)
            {
                QuestManager.AdvanceQuest(questStageData.quest);
                yield return(null);
            }
        }
        yield return(null);

        loadingSave = false;
    }
Пример #5
0
        public override void OnEnter()
        {
            base.OnEnter();
            QuestManager.AdvanceQuest(Str.Warbler);
            QuestManager.AdvanceQuest(Str.Frog);
            QuestManager.AdvanceQuest(Str.Turtle);

            FModMusicManager.PlayTrack("Layer 1");
            if (!Services.SaveManager.loadingSave)
            {
                Services.SaveManager.SaveData();
            }
        }
    public void InputItem(QuestItem item)
    {
        if (Services.SaveManager.loadingSave)
        {
            return;
        }
        switch (item.itemEnum)
        {
        case QuestItem.QuestItemEnum.Seed:
            if (_collectedSeed)
            {
                return;
            }
            _collectedSeed = true;
            QuestManager.AdvanceQuest(Str.Warbler);
            QuestManager.SetBoolMemoryVar(Str.Seed);
            QuestManager.SetBoolMemoryVar("SeedLastRetrieved");
            break;

        case QuestItem.QuestItemEnum.Soil:
            if (_collectedSoil)
            {
                return;
            }
            _collectedSoil = true;
            QuestManager.AdvanceQuest(Str.Frog);
            QuestManager.SetBoolMemoryVar(Str.Soil);
            QuestManager.SetBoolMemoryVar("SoilLastRetrieved");
            break;

        case QuestItem.QuestItemEnum.Rain:
            if (_collectedRain)
            {
                return;
            }
            _collectedRain = true;
            QuestManager.AdvanceQuest(Str.Turtle);
            QuestManager.SetBoolMemoryVar(Str.Rain);
            QuestManager.SetBoolMemoryVar("RainLastRetrieved");
            break;
        }
        QuestManager.AdvanceQuest(Str.Main);

        currentQuestItem = item;
    }
Пример #7
0
        // Defines tasks for turtle movement.
        private Task DefineTasks()
        {
            NPCCollider npcCollider = _turtleTrans.GetComponentInChildren <NPCCollider>();
            Vector3     initScale   = npcCollider.transform.localScale;

            npcCollider.transform.localScale = Vector3.zero;
            Task wait = new WaitTask(1f);

            Task start = new ActionTask(() =>
            {
                _turtleAnim.SetBool(Str.Running, true);
                // sound?
            });

            Task prev = start;

            for (int i = 0; i < ((TurtleQuest)Context)._turtleRoute.Length; i++)
            {
                Task next = TurtleMove(((TurtleQuest)Context)._turtleRoute[i]);
                prev = prev.Then(next);
            }

            Task finish = new ActionTask
                          (
                () => {
                _turtleAnim.SetBool(Str.Running, false);
                npcCollider.transform.localScale = initScale; // causes problems
                npcCollider.Appear();                         // causes problems
                if (Context.QuestStage < 4)
                {
                    QuestManager.AdvanceQuest(Context.QuestTag);
                }
            }
                          );


            wait.Then(start);

            prev.Then(finish);

            return(wait);
        }