public override void PlayerInteracts(Player player) { base.PlayerInteracts(player); if (currentlyRelevantActionIDs.Count > selectedInteractionIndex) { switch (currentlyRelevantActionIDs [selectedInteractionIndex]) { case actionID.TALK_TO: UI.instance.ShowDialogue(Dialogues.RetrieveDialogue(TimeLogic.day, characterId, DialogueID.GREETING) [0], portrait, characterId, Dialogues.RetrieveReward(TimeLogic.day, characterId, DialogueID.GREETING)); if (characterId == Character.GRANDMA) { Quests.instance.FulfilledQuestCondition(QuestTask.TALK_TO_GRANDMA); } break; case actionID.SELL: Equippable item = player.currentlyEquippedItem; PlayerEconomy.ReceiveMoney(Prices.GetPriceByID(player.currentlyEquippedItem.id)); player.UnequipEquippedItem(false, true); Destroy(item.gameObject); break; } } }
private YieldInstruction PlayStartSound() { return(Dialogues.Dialogue(Localization.Random( Db.LocalizationDataId.Assessment_Start_1, Db.LocalizationDataId.Assessment_Start_2, Db.LocalizationDataId.Assessment_Start_3), true)); }
//대화 한글자씩 보여주는 코루틴 IEnumerator CharOneByOne(Dialogues NameNDialogue, float dialogueSpeed) { isDialoguing = true; dialog_name.text = NameNDialogue.name; string dialog = ""; for (int i = 0; i < NameNDialogue.dialogue.Length; i++) { //if(Input.GetMouseButtonDown(0) || Input.touchCount > 0) //{ // isDialoguing = false; // for(; i < NameNDialogue.dialogue.Length; i++) // { // dialog += NameNDialogue.dialogue[i]; // } // dialog_content.text = dialog; // break; //} yield return(new WaitForSeconds(dialogueSpeed)); dialog += NameNDialogue.dialogue[i]; dialog_content.text = dialog; } isDialoguing = false; dialogue_index += 1; }
public void StartDialogues(Dialogues dialogues) { //dialogues.printDialogues (); //Debug.Log ("Start Conversation with: " + dialogues.GetDialogue(0).name + dialogues.GetDialogue(0).dialogues[0]); StartDialogue(dialogues.GetDialogue(0)); DisplayNextDialogue(dialogues); }
private void addDialog(int DlgIndex, int DlgEndIndex, string[] Script) { string Dialogue = ""; for (int ind = DlgIndex + 2; ind < DlgEndIndex; ind += 2) { Dialogue += Script[ind] + Script[ind + 1] + "-"; } string breakline = Tools.UnicodeHexToUnicodeString("0A 00"); Dialogue = Tools.UnicodeHexToUnicodeString(Dialogue.Replace("-", "")).Replace(breakline, @"\n").Replace("\r", ""); Dialog[] temp = new Dialog[Dialogues.Length + 1]; Dialogues.CopyTo(temp, 0); Dialog dialog = new Dialog(); dialog.Content = Dialogue; dialog.StartPos = DlgIndex; dialog.EndPos = DlgEndIndex; if (dialog.Content.EndsWith(@"\n")) { dialog.AppendLineBreak = true; dialog.Content = dialog.Content.Substring(0, dialog.Content.Length - 2); } if (dialog.Content.EndsWith(@"\n<CLT>")) { dialog.AppendCLTLineBreak = true; dialog.Content = dialog.Content.Substring(0, dialog.Content.Length - 7) + "<CLT>"; } temp[Dialogues.Length] = dialog; Dialogues = temp; }
void Update() { if (Input.GetMouseButtonDown(0)) { if (currentIntroIndex >= introSteps) { SceneManager.LoadScene("main"); } else { if (currentIntroIndex % 2 == 0) { UI.instance.ShowDialogue(Dialogues.RetrieveDialogue(0, Character.GRANDMA, DialogueID.INTRO)[dialogueIndex], grandmaPortrait, Character.GRANDMA); //GameObject.Find ("DebugText").GetComponent<Text> ().text = "ui instance: " + UI.instance.name + ". dialogueText is active: " + UI.instance.dialogueText.gameObject.activeSelf + ". this pos: " + GameObject.Find ("DebugText").transform.position + ". dialogue box pos: " + UI.instance.dialogueText.transform.position; } else { UI.instance.ShowDialogue(Dialogues.RetrieveDialogue(0, Character.PLAYER, DialogueID.INTRO)[dialogueIndex], playerPortrait, Character.PLAYER); //GameObject.Find ("DebugText").GetComponent<Text> ().text = Dialogues.RetrieveDialogue (0, Character.PLAYER, DialogueID.INTRO) [dialogueIndex]; } ++currentIntroIndex; dialogueIndex = currentIntroIndex / 2; } } }
void AddDialogue(string dialg) { Dialogues d = new Dialogues(); d.dialogue = dialg; allDialoguesInCurrentSequence.Add(d); }
private void ChooseDialogue() { currentDialogue = allDialogues[lastShown]; titleText.text = currentDialogue.title; avaImage.sprite = currentDialogue.ava; DisplayNextDialogue(); }
private YieldInstruction PlayAnturaGoneSound() { return(Dialogues.Dialogue(Localization.Random( Db.LocalizationDataId.Assessment_Dog_Gone_1, Db.LocalizationDataId.Assessment_Dog_Gone_2, Db.LocalizationDataId.Assessment_Dog_Gone_3), true)); }
private YieldInstruction PlayAssessmentCompleteSound() { return(Dialogues.Dialogue(Localization.Random( Db.LocalizationDataId.Assessment_Complete_1, Db.LocalizationDataId.Assessment_Complete_2, Db.LocalizationDataId.Assessment_Complete_3), true)); }
public void InitializeDialogues() { Texture2D bunny = Content.Load <Texture2D>("RightBunny"); Texture2D panda = Content.Load <Texture2D>("LeftPanda"); Texture2D lich = Content.Load <Texture2D>("EvilQueen"); // 0 Dialogue d0 = new Dialogue(panda, bunny, font); d0.AddText("Player, we've finally tracked the Evil Queen.", 2000f, true); d0.AddText("She's not getting away this time!", 2000f, false); Dialogues.Add(d0); // 1 Dialogue d1 = new Dialogue(lich, null, font); d1.AddText("HAHAHAHAHAHA!", 2000f, true); d1.AddText("You absolute baffoons!", 2000f, true); d1.AddText("Now that the Princess is away from the Kingdom.", 2400f, true); d1.AddText("I am free to invade that area whenever I want!", 2400f, true); Dialogues.Add(d1); // 2 Dialogue d2 = new Dialogue(panda, bunny, font); d2.AddText("Not if Player can help it!", 1500, false); d2.AddText("Yeah, you won't get away this!", 1700f, true); Dialogues.Add(d2); // 3 Dialogue d3 = new Dialogue(lich, null, font); d3.AddText("If you think I'll be as easy to defeat as my henchmen...", 3000f, true); d3.AddText("T H I N K A G A I N !", 1700f, true); Dialogues.Add(d3); }
private YieldInstruction PlayPushAnturaSound() { return(Dialogues.Dialogue(Localization.Random( Db.LocalizationDataId.Assessment_Push_Dog_1, Db.LocalizationDataId.Assessment_Push_Dog_2, Db.LocalizationDataId.Assessment_Push_Dog_3), true)); }
public void ReadDialogue() { int optionNumber = int.Parse(XmlFile.GetAttribute("entries")); dialogueAux = new Dialogue(); dialogueAux.ID = int.Parse(XmlFile.GetAttribute("id")); dialogueAux.Resource = XmlFile.GetAttribute("resource"); dialogueAux.ResourceComponent = int.Parse(XmlFile.GetAttribute("resourceComponent")); dialogueAux.Flag = XmlFile.GetAttribute("flag"); dialogueAux.Scene = XmlFile.GetAttribute("scene"); dialogueAux.SpeechBallon = XmlFile.GetAttribute("speechBallon"); XmlFile.Read(); if (XmlFile.IsStartElement("text")) { dialogueAux.Text = XmlFile.ReadString(); } dialogueAux.Options = new List <Option>(); this.ReadOptions(optionNumber); Dialogues.Add(dialogueAux); }
public void WriteToROM() { if (NewGame != null && NewGame.Visible) { NewGame.WriteToROM(); } if (Animations != null && Animations.Visible) { Animations.WriteToROM(); } if (Attacks != null && Attacks.Visible) { Attacks.WriteToROM(); } if (Battlefields != null && Battlefields.Visible) { Battlefields.WriteToROM(); } if (Dialogues != null && Dialogues.Visible) { Dialogues.WriteToROM(); } if (EventScripts != null && EventScripts.Visible) { EventScripts.WriteToROM(); } if (Fonts != null && Fonts.Visible) { Fonts.WriteToROM(); } if (Formations != null && Formations.Visible) { Formations.WriteToROM(); } if (Items != null && Items.Visible) { Items.WriteToROM(); } if (Areas != null && Areas.Visible) { Areas.WriteToROM(); } if (Monsters != null && Monsters.Visible) { Monsters.WriteToROM(); } if (Sprites != null && Sprites.Visible) { Sprites.WriteToROM(); } if (Intro != null && Intro.Visible) { Intro.WriteToROM(); } if (WorldMaps != null && WorldMaps.Visible) { WorldMaps.WriteToROM(); } }
public List <Interaction> GetDialogue(int niveau, int pnj, int personnalite) { string idDico = niveau.ToString() + "." + pnj.ToString() + "." + personnalite.ToString(); Conv conv = Dialogues.GetConv(idDico); List <Interaction> qList = conv.interactionListe; return(qList); }
private void SendMessageToDecisionFields(bool isUpperAGoodInteraction) { for (int i = 0; i < upperFields.Length; i++) { upperFields[i].OnReceiveDecision(Dialogues.GetDialogue(isUpperAGoodInteraction), isUpperAGoodInteraction); lowerFields[i].OnReceiveDecision(Dialogues.GetDialogue(!isUpperAGoodInteraction), !isUpperAGoodInteraction); } }
private IEnumerator DescriptionAudio() { yield return(Dialogues.PlayGameDescription()); if (executingRound0 && AssessmentOptions.Instance.PlayQuestionAlsoAfterTutorial) { yield return(QuestionPlacer.PlayQuestionSound()); } }
/// <summary> /// Adds options to dialogue also. This function needs changing if this is being extended /// </summary> void AddDialogue(string dialg, bool question, string[] options, int ans) { Dialogues d = new Dialogues(); d.dialogue = dialg; d.isQuestion = question; d.answerOptions = options; d.currentAnswerVal = ans; allDialoguesInCurrentSequence.Add(d); }
public void SetDialogue(Dialogues dialogue, int index, out int nextIndex) { InputManager.Instance.ChangeInput(InputType.Dialogue); this.dialogue = dialogue; this.dialogue.SetTree(index, out nextIndex); rootPanel.SetActive(true); Display(); }
public void SaveDocuments(IEnumerable <WorldDocument> documents) { Dialogues dialogueHolder = new Dialogues(); foreach (WorldDocument doc in documents) { Dialogue dialogue = (Dialogue)doc; dialogueHolder.AllDialogues.Add(dialogue); using var fileStream = File.Open(_path, FileMode.Create); _xmlSerializer.Serialize(dialogueHolder, fileStream); } }
public IEnumerable <WorldDocument> LoadDocuments() { if (!File.Exists(_path)) { return(new Dialogue[] { }); } using var fileStream = File.Open(_path, FileMode.Open); Dialogues dialogues = (Dialogues)_xmlSerializer.Deserialize(typeof(Dialogues), fileStream); return(dialogues.AllDialogues.ToArray()); }
public FifthQuest() { Title = "The Hero!"; Objective = "You've slained the polar bear as instructed.\n" + "Return to the blacksmith and tell about your victory."; MapObjective = new Blacksmith(0, 0); RewardXP = 250; Dialogues.Add("You did it!"); Dialogues.Add("You avenged our fallen."); Dialogues.Add("We will forever be grateful for your help!"); }
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 ThirdQuest() { Title = "Wood Working!"; Objective = "You have collected the lumber.\n" + "Now return it to the blacksmith.\n" + "He's displayed with a 'B' on the map."; MapObjective = new Blacksmith(0, 0); RewardXP = 50; Dialogues.Add("Quest: " + Title + "\n"); Dialogues.Add("I've finally chopped down the damn tree."); Dialogues.Add("I should return to the blacksmith with the lumber I've collected."); }
public void DialogueStart(Dialogues sentences) { box.SetActive(true); nameText.text = GameObject.Find("HomelessMan").GetComponent <Dialogues>().name; this.sentences.Clear(); foreach (string sentence in sentences.sentences) { this.sentences.Enqueue(sentence); } DisplayNextSentence(); }
bool CheckDialogue() { if (Selection.activeObject is Dialogues) { dialogue = (Dialogues)Selection.activeObject; //.GetComponent<Dialogues>(); return(true); } else { dialogue = null; GUILayout.Label("No object is currently selected"); return(false); } }
public override string[] Interact(string prompt) { Dialogue dialogue; if (Dialogues.TryGetValue(prompt, out dialogue)) { // "Say" response CanvasSettings.PlayerHudController.ActivateCaptionView(dialogue.response); // Return options return(dialogue.options); } return(null); }
bool CheckDialogue() { if (Selection.activeTransform) { CurrentDialogue = Selection.activeTransform.GetComponent <Dialogues>(); return(true); } else { CurrentDialogue = null; GUILayout.Label("No object is currently selected"); return(false); } }
public void StartDialogue(Dialogues dialogues) { _dialogueBox.SetActive(true); speech.Clear(); _npcName.text = dialogues._name; foreach (string item in dialogues._dialogue) { speech.Enqueue(item); } DisplayNextDialogue(); }
// text stuff /// <summary> /// level of happiness of NPC /// your level of happiness /// how many days are left /// </summary> // Use this for initialization void Awake() { displayText = false; inConversation = false; callOnce = 5; fadeTimer = 60; fadeOut = false; dialogue = GetComponent <Dialogues>(); GetComponent <Dialogues>().SetupEverything(); player = GameObject.FindGameObjectWithTag("Player"); SetNonPlayers(); dialogue.SetupEverything(); cameraChild = camera.transform.GetChild(0).GetComponent <SpriteRenderer>(); textBox.SetActive(false); }
public void Awake() { Instance = this; transissionPlayed = -1; sceneplayed = -1; }