Esempio n. 1
0
    void Start()
    {
        playerInventory = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
        vendordatabase  = VendorDatabase.Instance;
        questManager    = QuestManager.Instance;
        particles       = gameObject.GetComponentInChildren <ParticleSystem>();

        switch (this.name)
        {
        case "BoxofPaperclips":
            questReference = questManager.questLogListDatabase.GetQuestLog("Collect Paper Clip to Fix Grapple");
            break;

        case "Yarn":
            questReference = questManager.questLogListDatabase.GetQuestLog("Get Some Strings");
            break;

        case "TearableBook":
            questReference = questManager.questLogListDatabase.GetQuestLog("Tear Book Page for Paper Pieces");
            break;

        case "CakeBox":
            questReference = questManager.questLogListDatabase.GetQuestLog("Grab the... Cake?");
            break;

        default:
            break;
        }

        if (questReference != questManager.GetCurrentQuest())
        {
            SetLighting(false);
        }
    }
Esempio n. 2
0
 public void ClearQuest(my_QuestLog theQuest)
 {
     notificationText  = "CLEARED: " + theQuest.questname;
     notificationTimer = 0;
     theQuest.ClearQuest();
     questLogs.Remove(theQuest);
     FetchNewQuest();
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        levelManager = LevelManager.Instance;

        particles = gameObject.GetComponentInChildren <ParticleSystem>();

        if (particles != null)
        {
            SetLighting(false);
            // Level 1
            if (levelManager.CurrentLevelName == "Level1")
            {
                questReference = QuestManager.Instance.questLogListDatabase.GetQuestLog("Reach the Door");
            }
        }
    }
Esempio n. 4
0
    public void ClearQuest(string questName)
    {
        my_QuestLog theQuest = GetQuestLog(questName);

        if (theQuest != null)
        {
            notificationText  = theQuest.questname + "IS CLEARED";
            notificationTimer = 0;
            theQuest.ClearQuest();
            questLogs.Remove(theQuest);
        }
        else
        {
            Debug.Log("ERROR: ClearQuest is using null theQuest reference");
        }
        FetchNewQuest();
    }
Esempio n. 5
0
    public bool DuplicateQuestLogCheck(my_QuestLog a_questlog)
    {
        if (a_questlog.id < 0)
        {
            Debug.Log("ERROR: DuplicateQuestLogCheck with quest log id is negative value: " + a_questlog.id);
            return(false);
        }
        if (a_questlog.id < questLogs.Count)
        {
            if (questLogs[a_questlog.id].id == a_questlog.id)
            {
                return(true);
            }
            for (int i = 0; i < a_questlog.id; ++i)
            {
                if (questLogs[i].id == a_questlog.id)
                {
                    return(true);
                }
            }
            for (int i = a_questlog.id + 1; i < questLogs.Count; ++i)
            {
                if (questLogs[i].id == a_questlog.id)
                {
                    return(true);
                }
            }
        }
        else
        {
            Debug.Log("WARNING: DuplicateQuestLogCheck with quest log id is over list value: " + a_questlog.id);
            for (int i = 0; i < questLogs.Count; ++i)
            {
                if (questLogs[i].id == a_questlog.id)
                {
                    return(true);
                }
            }
        }

        return(false);
    }
Esempio n. 6
0
 public bool AddQuestLog(my_QuestLog a_questlog)
 {
     if (questLogs.Count >= maxQuestLog)
     {
         print("ERROR: max quest log reached, cannot add anymore log");
         return(false);
     }
     else
     {
         if (DuplicateQuestLogCheck(a_questlog) == false)
         {
             questLogs.Add(a_questlog);
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 7
0
 public my_QuestLog(my_QuestLog another)
 {
     this.id        = another.id;
     this.questname = another.questname;
     this.statues   = another.statues;
 }