コード例 #1
0
        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);
        }
コード例 #2
0
    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);
    }
コード例 #3
0
        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!");
        }
コード例 #4
0
        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.");
        }
コード例 #5
0
        public SecondQuest()
        {
            Title     = "Meet and Greet!";
            Objective = "Collect lumber in the forest. Once collected, return to the blacksmith.\n" +
                        "Forest is displayed with a 'F' on the map.";
            CollectObjective = new Lumber();
            RewardXP         = 75;

            Dialogues.Add("Quest: " + Title + "\n");
            Dialogues.Add("Greetings.");
            Dialogues.Add("You are " + Environment.player.Name + ", huh?");
            Dialogues.Add("Im sure you have no idea what is going on.");
            Dialogues.Add("Here you have an axe - you will need it to chop down some trees in the Forest.");
            Dialogues.Add("I will create a pair of spike-shoes for you with the lumber you gather.");
            Dialogues.Add("Now get going!");
        }
コード例 #6
0
ファイル: FirstQuest.cs プロジェクト: Zitaa/Lab1
        public FirstQuest()
        {
            Title     = "Get Started!";
            Objective = "Go talk to the Blacksmith.\n" +
                        "He's displayed with a 'B' on the map.";
            Type         = QuestTypes.GoTo;
            MapObjective = new Blacksmith(0, 0);
            RewardXP     = 100;

            Dialogues.Add("Quest: " + Title + "\n");
            Dialogues.Add("Welcome, " + Environment.player.Name + ".");
            Dialogues.Add("We could use a helping hand.");
            Dialogues.Add("Follow my instructions and you'll do fine.");
            Dialogues.Add("First, talk to the Blacksmith (B on the map).");
            Dialogues.Add("He'll have the right tools to get you started.");
            Dialogues.Add("Go ahead, get going!");
        }
コード例 #7
0
        public FourthQuest()
        {
            Title     = "Avenge the Fallen!";
            Objective = "Slay a polar bear.\n" +
                        "Polar bears exists in the Ice-region.";
            KillObjective = new PolarBear();
            RewardXP      = 250;

            Dialogues.Add("Quest: " + Title + "\n");
            Dialogues.Add(Environment.player.Name + ", it is time.");
            Dialogues.Add("Before we can help you - you need to help us.");
            Dialogues.Add("The rangers found a corpse on their last scouting mission.");
            Dialogues.Add("The wounds imply that this is the work of a creature larger than a human.");
            Dialogues.Add("Our council has evidence enough for us to believe that this corpse is the work of a Polar Bear.");
            Dialogues.Add("Head over to Ice and avenge our fallen one.");
            Dialogues.Add("Go ahead, get going!");
        }
コード例 #8
0
        private void cmbLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string lang = e.AddedItems[0].ToString();

            if (!Dialogues.ContainsKey(lang))
            {
                Dialogues.Add(lang, new List <Dialogue>());
            }
            if (!DialogueID.ContainsKey(lang))
            {
                DialogueID.Add(lang, new HashSet <int>());
            }
            if (!Choices.ContainsKey(lang))
            {
                Choices.Add(lang, new List <Choice>());
            }

            lstDialogues.ItemsSource = Dialogues[lang];
            lstDialogues.Items.Refresh();

            lstChoices.ItemsSource = Choices[lang];
            lstChoices.Items.Refresh();
        }
コード例 #9
0
        public DialogueWindow(Event ev)
        {
            InitializeComponent();
            SetupDictionaries();
            lstDialogues.ItemsSource  = Dialogues["english"];
            cmbLanguage.SelectedValue = "english";
            Event_ = ev;

            if (Event_.args.Count == 0)
            {
                return;
            }

            // Json stuffs goin on - parse
            try
            {
                bool found = false;
                foreach (string language in cmbLanguage.Items)
                {
                    if (Event_.args.First().Key == language)
                    {
                        found = true;

                        // Make sure the lists exist
                        if (!Dialogues.ContainsKey(language))
                        {
                            Dialogues.Add(language, new List <Dialogue>());
                            DialogueID.Add(language, new HashSet <int>());
                            Choices.Add(language, new List <Choice>());
                        }
                        break;
                    }
                }
                // the languages are defined
                if (Event_.args.Count > 0)
                {
                    if (found)
                    {
                        // Load the languages
                        foreach (var o in Event_.args)
                        {
                            JObject jObject = o.Value as JObject;
                            Dictionary <string, object> dict = jObject.ToObject <Dictionary <string, object> >();
                            // handle language load
                            foreach (var s in dict)
                            {
                                if (s.Key.Contains("dialogue"))
                                {
                                    jObject = s.Value as JObject;
                                    Dialogue d = jObject.ToObject <Dialogue>();
                                    Dialogues[o.Key].Add(d);
                                    DialogueID[o.Key].Add(d.id);
                                }
                                else if (s.Key.Contains("choice"))
                                {
                                    jObject = s.Value as JObject;
                                    Choices[o.Key].Add(jObject.ToObject <Choice>());
                                }
                            }
                        }
                    }
                    else
                    {
                        // handle non-language load
                        foreach (var o in Event_.args)
                        {
                            if (o.Key.Contains("dialogue"))
                            {
                                JObject  jObject = o.Value as JObject;
                                Dialogue d       = jObject.ToObject <Dialogue>();
                                Dialogues["english"].Add(d);
                                DialogueID["english"].Add(d.id);
                            }
                            else if (o.Key.Contains("choice"))
                            {
                                JObject jObject = o.Value as JObject;
                                Choices["english"].Add(jObject.ToObject <Choice>());
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            lstDialogues.Items.Refresh();
        }
コード例 #10
0
        /// <summary>
        /// Initializes the pre-scripted dialogues for the game.
        /// </summary>
        public void InitializeDialogues()
        {
            // dialogue 0
            Texture2D bunny = Content.Load <Texture2D>("RightBunny");
            Texture2D panda = Content.Load <Texture2D>("LeftPanda");

            Dialogue d0 = new Dialogue(panda, bunny, font);

            d0.AddText("Hello there!", 1000f, true);
            d0.AddText("Use the left stick to move your character around!", 3000f, false);
            d0.AddText("and press the right trigger to shoot!", 2500f, true);
            d0.AddText("Dodge the bullets and shoot the enemies!", 3000f, false);
            d0.AddText("Good luck!", 2500f, true);
            Dialogues.Add(d0);

            // dialogue 1
            Dialogue d1 = new Dialogue(panda, bunny, font);

            d1.AddText("We must rescue the Princess!", 3500f, true);
            d1.AddText("The Evil Queen went this way, hurry!", 2200f, false);
            Dialogues.Add(d1);

            // dialogue 2
            Dialogue d2 = new Dialogue(panda, bunny, font);

            d2.AddText("We've managed to push back the enemies, but\nreinforcements are on their way.", 3500f, true);
            d2.AddText("Seems we need some more defense...", 2200f, false);
            d2.AddText("Player! Press the A button to use your shields.", 2500f, false);
            d2.AddText("Be careful, your shields need to recharge after use.", 2200f, false);
            Dialogues.Add(d2);

            // dialogue 3
            Dialogue d3 = new Dialogue(panda, bunny, font);

            d3.AddText("More enemy reinforcements!", 2300f, true);
            d3.AddText("We need a more aggressive stance against them...", 2200f, false);
            d3.AddText("Player! Press hold the left trigger down to fire your rockets!", 2200f, false);
            d3.AddText("They fire less frequently, but do more damage and affect an area.", 4200f, false);
            Dialogues.Add(d3);

            // dialogue 4
            Dialogue d4 = new Dialogue(panda, bunny, font);

            d4.AddText("They've stopped coming... I have a bad feeling about this.", 3000f, true);
            d4.AddText("I agree...", 1000f, false);
            d4.AddText("Player, keep watch for anything suspicious!", 2000f, false);
            Dialogues.Add(d4);

            // dialogue 5
            Dialogue d5 = new Dialogue(panda, bunny, font);

            d5.AddText("Oh no! The Corrupted Sun is here, we're in trouble!", 3500f, true);
            d5.AddText("Take it down quick!", 2000f, false);
            Dialogues.Add(d5);

            // dialogue 6
            Dialogue d6 = new Dialogue(panda, null, font);

            d6.AddText("Player, he's almost destroyed, keep it up!", 2000f, true);
            Dialogues.Add(d6);

            // dialogue 7
            Dialogue d7 = new Dialogue(panda, bunny, font);

            d7.AddText("Somehow we did it...", 2000f, true);
            d7.AddText("Good work player, we've tracked the Evil Queen down.", 3000f, false);
            d7.AddText("Head to these coordinates...", 2500f, false);
            Dialogues.Add(d7);
        }
コード例 #11
0
ファイル: InteractiveEntity.cs プロジェクト: eloqui/tagengine
 /// <summary>
 /// Add a line of dialogue
 /// </summary>
 /// <param name="d"></param>
 public void AddDialogue(Dialogue d)
 {
     Dialogues.Add(d);
 }