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); } }
public void ClearQuest(my_QuestLog theQuest) { notificationText = "CLEARED: " + theQuest.questname; notificationTimer = 0; theQuest.ClearQuest(); questLogs.Remove(theQuest); FetchNewQuest(); }
// 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"); } } }
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(); }
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); }
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); } } }
public my_QuestLog(my_QuestLog another) { this.id = another.id; this.questname = another.questname; this.statues = another.statues; }