/// <summary> /// Update this instance. /// </summary> void Update() { CheckPressed(); dialogueBox.SetActive(isActive); if (StaticObjects.OBJECTIVE_VEGAN_BEATED && GameObject.Find("objectiveVegan") && !yes.getPressed()) { dialogueBox.SetActive(false); DestroyObject(GameObject.Find("objectiveVegan")); } if (StaticObjects.QUEST_FAKEDOCTOR > 1 && GameObject.Find("FakeDoctorObjectiveNPC") && !yes.getPressed()) { dialogueBox.SetActive(false); DestroyObject(GameObject.Find("FakeDoctorObjectiveNPC")); } if (isActive && interact.getPressed() && !locked) { isActive = false; locked = true; } if (!isActive && !locked) { isLocked = false; } if (isActive && ok.getPressed() && !okPressed) { okPressed = true; } //BUY if (isActive && currentNpc.Equals(DialogueMap.BOB_BURGER) && StaticObjects.OBJECTIVE_VEGAN_BEATED && !StaticObjects.FREE_CHEESEBURGER_GAINED) { gameController.player.AddBulk(300); dialogueText.text = "Oh you got him to leave? Here is one cheeseburger as promised. \n\nWould you like to buy more?"; StaticObjects.FREE_CHEESEBURGER_GAINED = true; } if (isActive && buy.getPressed() && !pressed) //!!! DON'T CHANGE THIS { pressed = true; //NEW SYSTEM switch (currentNpc) { case DialogueMap.BRGCLUB: BuyProduct(DialogueMap.BRGCLUB); break; case DialogueMap.Le_AFFAME: BuyProduct(DialogueMap.Le_AFFAME); break; case DialogueMap.SHISH: BuyProduct(DialogueMap.SHISH); break; case DialogueMap.THE_BOGO: BuyProduct(DialogueMap.THE_BOGO); break; case DialogueMap.TOUGH: BuyProduct(DialogueMap.TOUGH); break; } //OLD SYSTEM if (currentNpc.Equals("Bob Burger")) { if (gameController.player.wallet.GetSaldo() >= 10) { gameController.player.AddBulk(300); gameController.player.wallet.UseMoney(10); Debug.Log("Bought CheeseBurger!"); dialogueText.text = "There you go son, one CheeseBurger."; if (!StaticObjects.OBJECTIVE_VEGAN_BEATED) { dialogueText.text += "\n\nIf you can drive off that annoying vegan outside, I'll give you a free burger."; StaticObjects.FREE_CHEESEBURGER = true; } } else { dialogueText.text = "Son, you poor as f**k!"; if (!StaticObjects.OBJECTIVE_VEGAN_BEATED) { dialogueText.text += "\n\nIf you can drive off that annoying vegan lady outside I'll give you free burger."; StaticObjects.FREE_CHEESEBURGER = true; } else { dialogueText.text += "\nGo get some money first."; } } } } //WHEN YES PRESSED IN DIALOGUE if (isActive) { if (yes.getPressed() && !pressed) //!!! DON'T CHANGE THIS && !pressed { pressed = true; //NEW SYSTEM switch (currentNpc) { case DialogueMap.VEGANVILLE_MAFIA: if (StaticObjects.QUEST_FAKEDOCTOR == 0) { dialogueText.text = dialogueMap.GetDialogue(DialogueMap.VEGANVILLE_MAFIA + DialogueMap.STEP_1); //questNPC.ChangeStatus (DialogueMap.STEP_2, false); StaticObjects.MAFIA_STATUS = DialogueMap.STEP_2; StaticObjects.MAFIA_HASQUESTION = true; StaticObjects.QUEST_FAKEDOCTOR += 1; poison = new GameItem("poison", "poison"); gameController.player.inventory.AddItem(poison); gameController.player.inventory.ListInventory(); StaticObjects.OBJECTIVE_FAKE_DOCTOR_HASQUESTION = true; StaticObjects.OBJECTIVE_FAKE_DOCTOR_STATUS = DialogueMap.STEP_1; //GameObject.Find ("FakeDoctorObjectiveNPC").GetComponent<QuestNPC> ().hasQuestion = true; // del this later. //GameObject.Find ("FakeDoctorObjectiveNPC").GetComponent<QuestNPC> ().questStatus = DialogueMap.STEP_1; // del this later, } else if (StaticObjects.QUEST_FAKEDOCTOR == 2) { gameController.player.wallet.AddMoney(1000); dialogueText.text = dialogueMap.GetDialogue(DialogueMap.VEGANVILLE_MAFIA + DialogueMap.STEP_3); StaticObjects.MAFIA_STATUS = DialogueMap.STEP_4; } else { dialogueText.text = "Liar. Go do your job if wish to claim the reward."; } break; case DialogueMap.DOCTOR_DICK: dialogueText.text = dialogueMap.GetDialogue(DialogueMap.DOCTOR_DICK + DialogueMap.STEP_1); questNPC.ChangeStatus(DialogueMap.STEP_1, false); StaticObjects.DOCTOR_DICK_STATUS = DialogueMap.STEP_1; StaticObjects.DOCTOR_DICK_HASQUESTION = false; StaticObjects.GOT_MEDS = true; if (StaticObjects.TALKED_TO_NANCY) { GameObject.Find("nurse1").GetComponent <QuestNPC> ().ChangeStatus(DialogueMap.DEFAULT, true); StaticObjects.NURSE_NANCY_HASQUESTION = true; } break; case DialogueMap.NURSE_NANCY: if (ObjectiveStatus == 0 && StaticObjects.GOT_MEDS) { medicine = new GameItem("medicine", "meds"); gameController.player.inventory.AddItem(medicine); gameController.player.inventory.ListInventory(); ObjectiveStatus += 1; dialogueText.text = dialogueMap.GetDialogue(DialogueMap.NURSE_NANCY + DialogueMap.STEP_2); questNPC.ChangeStatus(DialogueMap.STEP_3, false); StaticObjects.NURSE_NANCY_STATUS = DialogueMap.STEP_3; StaticObjects.NURSE_NANCY_HASQUESTION = false; } else if (!StaticObjects.GOT_MEDS && !StaticObjects.TALKED_TO_NANCY) { dialogueText.text = dialogueMap.GetDialogue(DialogueMap.NURSE_NANCY + DialogueMap.STEP_1); questNPC.ChangeStatus(DialogueMap.STEP_1, false); StaticObjects.NURSE_NANCY_STATUS = DialogueMap.STEP_1; StaticObjects.NURSE_NANCY_HASQUESTION = false; StaticObjects.TALKED_TO_NANCY = true; } break; case DialogueMap.BAD_LUCK_BRIAN: if (StaticObjects.QUEST_FAKEDOCTOR == 1) { StaticObjects.QUEST_FAKEDOCTOR += 1; gameController.player.inventory.RemoveItem(poison); gameController.player.inventory.ListInventory(); //StaticObjects.MAFIA_STATUS = DialogueMap.STEP_3; } break; } //OLD SYSTEM //Drug Buyer's Dialogue if (ObjectiveStatus == 2 && currentNpc.Equals("Drug Buyer")) { gameController.player.inventory.RemoveItem(medicine); gameController.player.inventory.ListInventory(); dialogueText.text = "Cool! You'll get 20$ for this junk\n\nIf you find more.. stuff.. to sell come see me."; gameController.player.wallet.AddMoney(20); ObjectiveStatus += 1; gameController.ChangeObjective("Gain your daily 15000kcal"); } else if (ObjectiveStatus != 2 && currentNpc.Equals("Drug Buyer")) { dialogueText.text = "Liar!"; } if (currentNpc.Equals("Man")) { StaticObjects.OBJECTIVE_VEGAN_BEATED = true; gameController.player.wallet.AddMoney(50); /*GameItem key = new GameItem ("key", "key"); * gameController.player.inventory.AddItem (key); * gameController.player.inventory.ListInventory ();*/ } } //WHEN NO IS PRESSED IN DIALOGUE if (no.getPressed() && !pressed) { pressed = true; //Doctor Dick Dialogue if (currentNpc.Equals(DialogueMap.DOCTOR_DICK) && !StaticObjects.GOT_MEDS) { dialogueText.text = "Sir. I Think You should reconsider."; } //Nurse Nancy Dialogue if (currentNpc.Equals(DialogueMap.NURSE_NANCY)) { dialogueText.text = "Ah..."; } //Drug Buyer's Dialogue if (currentNpc.Equals("Drug Buyer")) { dialogueText.text = "F**k you too Bobby.."; } if (currentNpc.Equals("Man")) { dialogueText.text = "Filthy meat lover..."; } if (currentNpc.Equals(DialogueMap.VEGANVILLE_MAFIA)) { dialogueText.text = "Spineless beta male.."; } } } }