Exemplo n.º 1
0
    public void Init(string questDeckID)
    {
        // FIX: holy shit. Init tutoData should be done before this init
        //if (TutoManager.s_instance != null && TutoManager.s_instance.enableTuto && GameManager.Instance.PersistenceLoader.Pd.dicPersistenceSequences["seqfirstmove"] == false)
        //{
        //    CurrentQuestDeck = GameManager.Instance.QuestDeckDataBase.GetDeckByID("deck_01");
        //    CurrentQuestDeck.SideQuests.Clear();
        //}
        if (isDebugQuestManager || GameManager.Instance.IsDebugGameManager)
        {
            Debug.Log(questDeckToLoadDebug);
            CurrentQuestDeck = GameManager.Instance.QuestDeckDataBase.GetDeckByID(questDeckToLoadDebug);
            if (questDeckToLoadDebug == "deck_03" || questDeckToLoadDebug == "deck_01")
            {
                CurrentQuestDeck.SideQuests.Clear();
            }
        }
        else
        {
            CurrentQuestDeck = GameManager.Instance.QuestDeckDataBase.GetDeckByID(questDeckID);
            if (questDeckID == "deck_03" || questDeckID == "deck_01")
            {
                CurrentQuestDeck.SideQuests.Clear();
            }
        }

        ActiveQuests    = new List <Quest>();
        CompletedQuests = new List <Quest>();
        Quests          = new List <Quest>();

        if (CurrentQuestDeck != null)
        {
            //Should only be the case if we launch from the scene
            if (!GameManager.Instance.QuestsContainer.isInitialized)
            {
                GameManager.Instance.QuestsContainer.Init();
            }

            MainQuest = new Quest(GameManager.Instance.QuestsContainer.FindQuestByID(CurrentQuestDeck.MainQuest));

            foreach (string questID in CurrentQuestDeck.SideQuests)
            {
                Quests.Add(new Quest(GameManager.Instance.QuestsContainer.FindQuestByID(questID)));
            }
        }
        else
        {
            Debug.Log("QuestDeck Id is null");
        }
    }
Exemplo n.º 2
0
 public void SetQuestCards()
 {
     QuestDeck.Order(x => x.Sequence);
     SetActiveQuest(QuestDeck.Cards.First());
     SetActiveEncounterDeck(EncounterDecks.First());
 }