// you can't do questObject = new QuestObject() above because the execution order of scripts get massed up private static void CreateQuestObjectIfNull() { if (questObject == null) { questObject = new QuestObject(); } }
public static void UpdateQuestProgress(QuestObject questObject) { foreach (var quest in Quests) { quest.CheckForProgress(questObject); } }
public bool CheckQuestFulfillment(QuestObject questObject) { if (questObject.Subject.AssetGUID == this.Subject.AssetGUID & questObject.QuestEvent == this.QuestEvent & questObject.Object.AssetGUID == this.Object.AssetGUID) { this.CurrentCount++; return(this.questObjectComplete); } return(false); }
public void CheckForProgress(QuestObject questObjectGenerated) { foreach (QuestObject myQuestObject in questObjects) { if (myQuestObject.questObjectComplete) { continue; } else { bool objectiveCompleted = myQuestObject.CheckQuestFulfillment(questObjectGenerated); this.objectivesCompletedCount += (objectiveCompleted) ? 1 : 0; if (this.QuestCompleted) { this.OnQuestCompleted.Invoke(); } } } }