private void OnItemRemoved(Item item) { if (item.ItemName == ItemName && !Quest.Completed) { CurrentAmount = InventoryController.instance.CountItemsHavingName(ItemName); Evaluate(); Phase.CheckGoals(); QuestEventHandler.GoalUpdated(this); } }
public void OnShowDoneQuestsClicked() { if (showingToDoQuests) { QuestEventHandler.UnselectQuest(); } showingToDoQuests = false; Header.text = "Your journal: Done Quests"; ShowDoneQuests(); }
public void OnShowToDoQuestsClicked() { if (!showingToDoQuests) { QuestEventHandler.UnselectQuest(); } showingToDoQuests = true; Header.text = "Your journal: To-Do Quests"; ShowTodoQuests(); }
void ItemPickedUp(Item item) { if (!Phase.Active) { return; } if (item.ItemName == ItemName && !Quest.Completed) { CurrentAmount = InventoryController.instance.CountItemsHavingName(ItemName); Evaluate(); Phase.CheckGoals(); QuestEventHandler.GoalUpdated(this); } }
private void FollowQuest(Quest quest, Button followButton) { string text = followButton.transform.GetChild(0).GetComponent <Text>().text; if (text == "Follow") { QuestEventHandler.FollowQuest(quest); } else { QuestEventHandler.UnFollowQuest(); } followButton.transform.GetChild(0).GetComponent <Text>().text = text == "Follow" ? "Unfollow" : "Follow"; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } eventHandler = new QuestEventHandler(); questOverflowAlert.SetActive(false); outstandingQuests = new List <Quest>(); }
private void OnTalkedToNPC(string NPCName) { if (!Phase.Active) { return; } if (this.NPCName == NPCName && !Completed) { CurrentAmount++; Evaluate(); Phase.CheckGoals(); Navigation2D(); QuestEventHandler.GoalUpdated(this); } }
void EnemyDied(IEnemy enemy) { if (!Phase.Active) { return; } if (enemy.ID == EnemyID && !Completed) { CurrentAmount++; Evaluate(); Phase.CheckGoals(); Navigation2D(); QuestEventHandler.GoalUpdated(this); } }
public void RefreshPhasesStates() { Phases.ForEach(x => x.Active = false); Phases.ForEach(x => x.UnInit()); Phase activePhase = null; for (int i = 0; i < Phases.Count; i++) { if (!Phases[i].Completed && activePhase == null) { activePhase = Phases[i]; activePhase.Active = true; currentPhase = i; } } Phases[currentPhase].Init(); QuestEventHandler.QuestStateChanged(this); }
public QuestEventHandler() { activeQuests = new List <Quest>(); instance = this; }
public void FinishQuestFrom(Quest quest, QuestGiver questGiver) { quest.GiveReward(); quest.Finish(questGiver); QuestEventHandler.FinishedQuest(quest); }
public void AddQuest(Quest quest) { QuestList.Add(quest); QuestEventHandler.AddedQuest(quest); }
private void DisplayQuestDetails(Quest quest) { QuestEventHandler.DisplayQuestDetails(quest); }