public void NPCInteraction(string CharName) { if (!RelationshipDictionary[CharName].QuestGiven) { if (RelationshipDictionary[CharName].Level == 0) { GeneralDialogueReply(CharName); RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = RelationshipDictionary[CharName].Level + 1, QuestGiven = false, CurrentQuestCompleted = false }; RelationshipDictionary[CharName] = ThrowMeIn; } else { QuestManager.Instance.QuestReplyForEachLevel(CharName); } } else if (RelationshipDictionary[CharName].QuestGiven && !RelationshipDictionary[CharName].CurrentQuestCompleted) { GeneralDialogueReply(CharName); } else if (RelationshipDictionary[CharName].QuestGiven && RelationshipDictionary[CharName].CurrentQuestCompleted) { NPCQuestCompletionReply(CharName); } }
public void NPCQuestCompleted(string CharName) { RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = RelationshipDictionary[CharName].Level, QuestGiven = true, CurrentQuestCompleted = true }; RelationshipDictionary[CharName] = ThrowMeIn; }
public void NPCQuestReset(string CharName) //whenevr a quest has been completed and needs to be reset { RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = RelationshipDictionary[CharName].Level, QuestGiven = false, CurrentQuestCompleted = true }; RelationshipDictionary[CharName] = ThrowMeIn; }
public void NPCQuestCompleted(string CharName) //whenevr a quest has been given and completed { RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = RelationshipDictionary[CharName].Level, QuestGiven = true, CurrentQuestCompleted = true }; RelationshipDictionary[CharName] = ThrowMeIn; }
public void NewItemforDictionary(string CharName) //whenevr a quest has been given out { RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = RelationshipDictionary[CharName].Level, QuestGiven = true, CurrentQuestCompleted = false }; RelationshipDictionary[CharName] = ThrowMeIn; }
private void Start() { npcDialogue = JsonUtility.FromJson <Dialogues>(jsonFile.text); //Convert Json Data into Dialogues Array ReplyBox.SetActive(false); //disable the canvas from displaying foreach (NPCDialogue npc in npcDialogue.dialogues) //Foreach object within' Json File, add an npc into a dictionary { RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = 0, QuestGiven = false, CurrentQuestCompleted = false }; RelationshipDictionary.Add(npc.Name, ThrowMeIn); } }
public void NPCQuestCompletionReply(string CharName) { foreach (NPCQuest quest in QuestManager.Instance.npcQuestInfo.questInfo) { if (CharName == quest.Name) { if (RelationshipDictionary[CharName].Level == 1) { NPCReplyText = (quest.Name + ": " + quest.AquaintanceComplete); } else if (RelationshipDictionary[CharName].Level == 2) { NPCReplyText = (quest.Name + ": " + quest.FriendComplete); } else if (RelationshipDictionary[CharName].Level == 3) { NPCReplyText = (quest.Name + ": " + quest.BestFriendComplete); } else { NPCReplyText = "Invalid text"; } QuestManager.Instance.RemoveFromList(CharName, RelationshipDictionary[CharName].Level); if (!StringIncludesLetters(QuestManager.Instance.ActiveQuests.text)) { QuestManager.Instance.ActiveQuests.text = QuestManager.Instance.ActiveQuests.text.Replace("\n", string.Empty); } } if (QuestManager.Instance.ActiveQuests.text == string.Empty) { QuestManager.Instance.QuestBox.SetActive(false); } } if (RelationshipDictionary[CharName].Level < 3) { RelationshipDetails ThrowMeIn = new RelationshipDetails { Level = RelationshipDictionary[CharName].Level + 1, QuestGiven = false, CurrentQuestCompleted = false }; RelationshipDictionary[CharName] = ThrowMeIn; } StartCoroutine(AnimateText()); }