示例#1
0
        // The adviceconvo method gives the player a chance to obtain useful advice.
        // It is called by the explore method when certain conditions are met.
        public void adviceconvo(Player theplayer3, AdventureGameItem theadvice)
        {
            NpcLines("Aaron", "Greetings.");
            PlayerLines("Hello", theplayer3);
            NpcLines("Aaron", "Would you like some advice?");
            PlayerLines("Sure, why not. What oddly specific thing would you like in return for this advice?", theplayer3);
            NpcLines("Aaron", "The advice is free friend. All you must do is choose to accept it.");
            string adviceprompt = "What is your choice?";

            string[] decisions      = { "Accept the advice", "Deny the advice" };
            Menu     advicemenu     = new Menu(decisions, adviceprompt);
            int      advicedecision = advicemenu.Run();

            if (advicedecision == 0)
            {
                Clear();
                theplayer3.fourthitem = false;
                theplayer3.hasadvice  = true;
                theplayer3.ReceiveItem(theadvice);
                NpcLines("Aaron", "Cool. Here's the advice: the lemonade in this kingdom is not very good.");
                NpcLines("*Advice has been added into your inventory.*", false, true);
                PlayerLines("Thank you. That is very useful information.", theplayer3);
                NpcLines("Aaron", "Yup. No problem. Bye bye now. Have a nice day.");
                PlayerLines("Thank you", theplayer3);
                Kingdom secondkingdom = new Kingdom("A Kingdom", 1, theplayer3);
            }
            else if (advicedecision == 1)
            {
                Clear();
                theplayer3.fourthitem = false;
                NpcLines("Aaron", "Ok bye.");
                Kingdom secondkingdom = new Kingdom("A Kingdom", 1, theplayer3);
            }
        }
示例#2
0
 // This method initiates the drawing of the kindom explorable area.
 public void TheKingdom(Player theplayer2)
 {
     newKingdom = new Kingdom("A Kingdom", 1, theplayer2);
 }
示例#3
0
        // Th explore method serves as the operating mechanism behind the all of the game's explorable areas.
        // It calls all of the necessary methods and triggers all of the reactions that happen as a result of the player's actions.

        public void explore(Maze themaze3, MoveablePlayer themoveableplayer3, Player exploreplayer, AdventureGameItem item1, AdventureGameItem item2, AdventureGameItem item3)
        {
            while (true)
            {
                createarea(themaze3, themoveableplayer3);
                playermovements(themaze3, themoveableplayer3);
                string playerposition = themaze3.gatherposition(themoveableplayer3.x, themoveableplayer3.y);
                if (playerposition == "[-]")
                {
                    Clear();
                    break;
                }
                else if (playerposition == "~")
                {
                    Clear();
                    // WriteLine("Test");
                    //ReadKey();
                    if (exploreplayer.firstitem)
                    {
                        exploreplayer.ReceiveItem(item2);
                        NpcLines($"*{item2.name} has been added into your inventory. Level: {item2.modifier}*", false, true);
                        exploreplayer.firstitem = false;
                    }
                    else
                    {
                        NpcLines("*This item has already been added into your inventory.*", false, true);
                    }


                    Cave secondcave = new Cave("A Cave", 1, exploreplayer);
                }
                else if (playerposition == "$")
                {
                    Clear();
                    if (exploreplayer.seconditem)
                    {
                        exploreplayer.ReceiveItem(item1);
                        NpcLines($"*{item1.name} has been added into your inventory. Level: {item1.modifier}*", false, true);
                        exploreplayer.seconditem = false;
                    }
                    else
                    {
                        NpcLines("*This item has already been added into your inventory.*", false, true);
                    }
                    Cave secondcave = new Cave("A Cave", 1, exploreplayer);
                }
                else if (playerposition == "o")
                {
                    Clear();
                    if (exploreplayer.thirditem)
                    {
                        caveconversation(exploreplayer, item3);
                    }
                    else
                    {
                        NpcLines("You have already completed this conversation.", false, true);
                        Cave secondcave = new Cave("A Cave", 1, exploreplayer);
                    }
                }
                else if (playerposition == "=")
                {
                    Clear();
                    SecondMenu(exploreplayer);
                }
                else if (playerposition == "{")
                {
                    Clear();
                    if (exploreplayer.hasitem2 == false)
                    {
                        exploreplayer.ReceiveItem(item1);
                        exploreplayer.hasitem2 = true;
                        NpcLines($"*{item1.name} has been added into your inventory. Level: {item1.modifier}*", false, true);
                    }
                    else
                    {
                        NpcLines("*This item has already been added into your inventory.*", false, true);
                    }
                    Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                }
                else if (playerposition == "O")
                {
                    Clear();
                    if (exploreplayer.fourthitem)
                    {
                        adviceconvo(exploreplayer, item2);
                    }
                    else
                    {
                        NpcLines("You have already completed this conversation.", false, true);
                        Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                    }
                }
                else if (playerposition == "0")
                {
                    Clear();
                    if (exploreplayer.hasitem1 == true && exploreplayer.hasitem2 == true && exploreplayer.hasadvice == true)
                    {
                        if (exploreplayer.hasrarecoin)
                        {
                            exploreplayer.gameover = true;

                            NpcLines("Greetings once again traveler.", true);
                            PlayerLines("Talthorius?? What are you doing here?", exploreplayer);
                            NpcLines("You have passed the test traveler! You succeeded in not losing sight of what was given to you!", true);
                            PlayerLines("Are you talking about that coin that you gave me?", exploreplayer);
                            NpcLines("Yup. In order to celebrate your accomplishment, we've decided to share something with you.", true);
                            PlayerLines("Who is we?", exploreplayer);
                            NpcLines("Worry not traveler. All will be revealed soon.", true);
                            PlayerLines("Ok.", exploreplayer);
                            NpcLines("Now, for the news that we have for you..Actually, you know what. Would you like some lemonade first?", true);
                            string   drinkchoice    = "What is your decision?";
                            string[] lastdecision   = { "No", "Yes" };
                            Menu     thirdmenu      = new Menu(lastdecision, drinkchoice);
                            int      drinkselection = thirdmenu.Run();
                            if (drinkselection == 0)
                            {
                                NpcLines("Excellent! You have passed the final test!", true);
                                PlayerLines("Sweet.", exploreplayer);
                                if (exploreplayer.hascompass)
                                {
                                    NpcLines("At the beginning of the game, you chose the compass.", true);
                                    NpcLines("That compass was given to you by your mother. She enchanted it with love and magical energy. If you follow it you will never be lost.", true);
                                    PlayerLines("You're right! I remember now!....Wait why can't I remember anything about the other items?", exploreplayer);
                                    NpcLines("As I have said, all will be revealed in due time traveler. There is always more to learn.", true);
                                    PlayerLines("Ok I think I finally understand. What am I supposed to do now?", exploreplayer);
                                    NpcLines("You must do the only thing that there is to do traveler: move forward... Specifically, towards the door that's behind me.", true);
                                    PlayerLines("What's behind the door?", exploreplayer);
                                    NpcLines("I don't know traveler, I guess you'll just have to find out.", true);
                                    PlayerLines("Ok I think I'm ready.", exploreplayer);
                                    NpcLines("I think you're ready too traveler. Goodbye for now.", true);
                                    exploreplayer.hasitem2 = false;
                                    Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                                }
                                else if (exploreplayer.hashelmet)
                                {
                                    NpcLines("At the beginning of the game, you chose the helmet.", true);
                                    NpcLines("That helmet was previosuly owned by a very good friend of yours. He crafted it with the finest metals known to man. It will completely protect you from any kind of enemy. ", true);
                                    PlayerLines("You're right! I remember now!....Wait why can't I remember anything about the other items?", exploreplayer);
                                    NpcLines("As I have said, all will be revealed in due time traveler. There is always more to learn.", true);
                                    PlayerLines("Ok I think I finally understand. What am I supposed to do now?", exploreplayer);
                                    NpcLines("You must do the only thing that there is to do traveler: move forward... Specifically, towards the door that's behind me.", true);
                                    PlayerLines("What's behind the door?", exploreplayer);
                                    NpcLines("I don't know traveler, I guess you'll just have to find out.", true);
                                    PlayerLines("Ok I think I'm ready.", exploreplayer);
                                    NpcLines("I think you're ready too traveler. Goodbye for now.", true);
                                    exploreplayer.hasitem2 = false;
                                    Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                                }
                                else if (exploreplayer.hasshield)
                                {
                                    NpcLines("At the beginning of the game, you chose the shield.", true);
                                    NpcLines("That shield was given to you by your. The front of it bares the symbol of the resistance. Upon being raised to the sky, it will send a signal to every resistance member, alive or dead.", true);
                                    PlayerLines("You're right! I remember now!....Wait why can't I remember anything about the other items? ", exploreplayer);
                                    NpcLines("As I have said, all will be revealed in due time traveler. There is always more to learn.", true);
                                    PlayerLines("Ok I think I finally understand. What am I supposed to do now?", exploreplayer);
                                    NpcLines("You must do the only thing that there is to do traveler: move forward... Specifically, towards the door that's behind me.", true);
                                    PlayerLines("What's behind the door?", exploreplayer);
                                    NpcLines("I don't know traveler, I guess you'll just have to find out.", true);
                                    PlayerLines("Ok I think I'm ready.", exploreplayer);
                                    NpcLines("I think you're ready too traveler. Goodbye for now.", true);
                                    exploreplayer.hasitem2 = false;
                                    Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                                }
                            }
                            else if (drinkselection == 1)
                            {
                                NpcLines("Unfortunately, you have failed the final test. Goodbye.", false, true);
                                Environment.Exit(0);
                            }
                        }
                        else
                        {
                            NpcLines("Greetings once again traveler.", true);
                            PlayerLines("Talthorius?? What are you doing here?", exploreplayer);
                            NpcLines("Why'd you have to do it traveler? Why?", true);
                            PlayerLines("What are you talking about?", exploreplayer);
                            NpcLines("You lost sight of what was given to you.", true);
                            PlayerLines("Wait are you talking about that coin?", exploreplayer);
                            NpcLines("I tried to talk them out of it but the rules are the rules.", true);
                            PlayerLines("What are you talking about?", exploreplayer);
                            NpcLines("Until next time traveler...", true);
                            PlayerLines("Noooooooooo", exploreplayer);
                            Environment.Exit(0);
                        }
                    }
                    else
                    {
                        NpcLines("You don't have all of the items that you need in order to interract with this npc.", false, true);
                        NpcLines("If you have not already visited the Cave. You need to restart the game and try again.", false, true);
                        NpcLines("On the other hand, you may have finished the game. Try to exit through the green door in this level and see if the game allows you to leave.", false, true);

                        Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                    }
                }
                else if (playerposition == "%")
                {
                    if (exploreplayer.gameover)
                    {
                        Clear();
                        string   theend      = "Congratulations! You have completed the game!";
                        string[] lastchoices = { "Credits", "End the game" };
                        Menu     lastmenu    = new Menu(lastchoices, theend);
                        int      lastchoice  = lastmenu.Run();
                        if (lastchoice == 0)
                        {
                            Clear();
                            WriteLine("Credits:\r\n");
                            WriteLine(@"The Compass: https://ascii.co.uk/art/compass");
                            WriteLine(@"The Helmet: https://ascii.co.uk/art/helmet");
                            WriteLine(@"The Shield: https://www.asciiart.eu/weapons/shields");
                            ReadKey();
                            Environment.Exit(0);
                        }
                        else if (lastchoice == 1)
                        {
                            Clear();
                            WriteLine("Goodbye.");
                            Environment.Exit(0);
                        }
                    }
                    else
                    {
                        NpcLines("You have not met all of the requirements that are needed in order to end the game.", false, true);
                        NpcLines("If you have not already visited the Cave. You need to restart the game and try again.", false, true);
                        Kingdom secondKingdom = new Kingdom("A Kingdom", 1, exploreplayer);
                    }
                }

                //switch (playerposition)
                // /{
                //case "[-]":
                // break;
                //    break;
                // }
                System.Threading.Thread.Sleep(20);
            }
        }