public void pressOne() { dict.learnWord(wordOne, "?", none, 100); //wordInfoOne.unlocked = 100; wordOne = null; wordInfoOne = null; wordTwo = null; wordInfoTwo = null; wordThree = null; wordInfoThree = null; buttonOne.active = false; buttonTwo.active = false; buttonThree.active = false; textBox.enabled = false; dialogue.text = ""; dayCount++; wordsLeft = dictInitialize.wordsLeftToUnlock; }
public string makeConversation(bool isNPC) { string conversation; int rand; if (oneperday == dayNight.dayCount)//you get 1 areaspecific convo per day { oneperday += 1; switch (NPCLocation) { case Location.Park: rand = Random.Range(0, parkconvos.Count); dictInitialize.learnWord("park", "market", parkconvos[rand], 50); conversation = dictInitialize.scramble(parkconvos[rand]); return(conversation); case Location.Bank: rand = Random.Range(0, bankconvos.Count); dictInitialize.learnWord("money", "bank", bankconvos[rand], 50); conversation = dictInitialize.scramble(bankconvos[rand]); return(conversation); case Location.PostOffice: rand = Random.Range(0, postconvos.Count); dictInitialize.learnWord("mail", "deliver", postconvos[rand], 50); conversation = dictInitialize.scramble(postconvos[rand]); return(conversation); case Location.Apartment: rand = Random.Range(0, aptconvos.Count); dictInitialize.learnWord("food", "I", aptconvos[rand], 50); conversation = dictInitialize.scramble(aptconvos[rand]); return(conversation); case Location.Restaraunt: rand = Random.Range(0, restarauntconvos.Count); dictInitialize.learnWord(" ", "I", restarauntconvos[rand], 50); conversation = dictInitialize.scramble(restarauntconvos[rand]); return(conversation); case Location.TownHall: rand = Random.Range(0, townhallconvos.Count); dictInitialize.learnWord(" ", "I", townhallconvos[rand], 50); conversation = dictInitialize.scramble(townhallconvos[rand]); return(conversation); default: return("You should not see this."); } } else { rand = Random.Range(0, fillerConversations.Count); if (isNPC) { dictInitialize.learnWord(" ", "I", fillerConversations[rand], interact.wordLearnCap); if (interact.wordLearnCap > 0) { interact.wordLearnCap -= 2; } } else if (!isNPC) { if (mainvars.currentTask) { conversation = dictInitialize.scramble(YouShouldntNeedMeRightNow[0]); return(conversation); } else { dictInitialize.learnWord(" ", "I", fillerConversations[rand], interactWith.wordLearnCap); if (interactWith.wordLearnCap > 0) { interactWith.wordLearnCap -= 2; } } } conversation = dictInitialize.scramble(fillerConversations[rand]); return(conversation); } }
public string getNoTask() //Function, runs if you have a task already { if (mainCharacterVars.taskItem == interact.taskItemReq && mainCharacterVars.taskItem != "") { //If mainCharacter's task is complete taskwiththisNPC = false; taskinprog.SetActive(false); almostdonestar.SetActive(false); mainCharacterVars.almostdone = false; interactWithBank.taskmode = false; interactWithMailman.taskmode = false; interactWithMarket.taskmode = false; interactWithPizza.taskmode = false; interactWithMayor.taskmode = false; interactWithShady.taskmode = false; completed = true; if (timer.targetTime > 0.0f || dayNight.dayCount == 1) { //If you did the task fast enough, you learn new words taskDialogue = dictRef.scramble(new List <string> { "thank", " ", "you" }); //or what the npc will say after the task is complete/notcomplete dictRef.learnWord(taskPrompt.taskID, taskPrompt.itemRequired, taskPrompt.prompt, 100); if (mainCharacterVars.currentTaskIsHard) //You get money if it was a hard task { mainCharacterVars.money += Random.Range(friendship.FriendLevel, friendship.FriendLevel + 6); dictRef.learnWord(taskPrompt.taskID, taskPrompt.itemRequired, taskPrompt.prompt, 100); } } else { taskDialogue = dictRef.scramble(new List <string> { "you", " ", "took", " ", "too", " ", "long", "." }); //or what the npc will say after the task is complete/notcomplete } dayCount++; mainCharacterVars.taskXP++; //taskXP is how many tasks you have done mainCharacterVars.currentTask = false; //Clear task-related variables mainCharacterVars.currentTaskIsHard = false; mainCharacterVars.taskItem = ""; interact.taskItemReq = ""; taskPrompt = default(task); } else if (interact.taskItemReq != "" && mainCharacterVars.taskItem == "" && !interact.seenTaskPrompt) //If mainCharacter needs to see the task prompt again { taskDialogue = interact.currentTaskPrompt; interact.dialogue.color = Color.red; interact.seenTaskPrompt = true; } else if (dayCount >= dayNight.dayCount && interact.seenNoTasks == false) { //If mainCharacter has reached the task limit taskDialogue = dictRef.scramble(noTaskDialogue); dictRef.learnWord("I", " ", noTaskDialogue, 10); interact.seenNoTasks = true; } else if (interact.taskItemReq == "" || mainCharacterVars.taskItem == "") //If mainCharacter's task is not complete, or it is with another NPC, or mainCharacter has alread heard that the NPC is out of tasks { taskDialogue = npcConversation.makeConversation(true); } else if (mainCharacterVars.taskItem != "" && mainCharacterVars.taskItem != interact.taskItemReq) { //If mainCharacter's task is complete but they got the wrong thing taskDialogue = dictRef.scramble(new List <string> { "that", " ", "is", " ", "not", " ", "what", " ", "I", " ", "want", "." }); taskwiththisNPC = false; almostdonestar.SetActive(false); mainCharacterVars.almostdone = false; taskinprog.SetActive(false); timer.wrongitem = true; completed = true; dayCount++; mainCharacterVars.taskItem = ""; interact.taskItemReq = ""; mainCharacterVars.currentTask = false; taskPrompt = default(task); } else //This branch should never occur { taskDialogue = "you should not see this"; } return(taskDialogue); }