示例#1
0
        public static void TitleScreen()
        {
            int width = 28;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(" _______  _______  ______    ______   _______  ______    _______  _______  ___      _______ ");
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("|  _    ||       ||    _ |  |      | |       ||    _ |  |       ||   _   ||   |    |       |");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("| |_|   ||   _   ||   | ||  |  _    ||    ___||   | ||  |_     _||  |_|  ||   |    |    ___|");
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.WriteLine("|       ||  | |  ||   |_||_ | | |   ||   |___ |   |_||_   |   |  |       ||   |    |   |___ ");
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("|  _   | |  |_|  ||    __  || |_|   ||    ___||    __  |  |   |  |       ||   |___ |    ___|");
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Console.WriteLine("| |_|   ||       ||   |  | ||       ||   |___ |   |  | |  |   |  |   _   ||       ||   |___ ");
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("|_______||_______||___|  |_||______| |_______||___|  |_|  |___|  |__| |__||_______||_______|\n");
            Console.ResetColor();
            PrintUtils.GetHash(width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("Welcome to Bordertale!", width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("- Play -", width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("- Resume -", width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("- Help -", width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("- Acknowledgements -", width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("- Quit -", width, ConsoleColor.Yellow);
            PrintUtils.CenterPadHash("Copyright 2021 tejmen09", width, ConsoleColor.Yellow);
            PrintUtils.GetHash(width, ConsoleColor.Yellow);

            bool inLoop = true;

            while (inLoop)
            {
                string option = PrintUtils.Input().ToLower();
                switch (option)
                {
                case "play":
                    inLoop = false;
                    MainGame.StartGame();
                    break;

                case "help":
                    inLoop = false;
                    HelpScreen(false);
                    break;

                case "quit":
                    inLoop = false;
                    PrintUtils.GetHash(15, ConsoleColor.DarkYellow);
                    PrintUtils.CenterPadHash("GOODBYE!!", 15, ConsoleColor.DarkYellow);
                    PrintUtils.GetHash(15, ConsoleColor.DarkYellow);
                    Thread.Sleep(500);
                    Environment.Exit(0);
                    break;

                case "acknowledgements":
                    inLoop = false;
                    AcknowledgementsScreen();
                    break;

                case "resume":
                    inLoop = false;
                    // TODO Add ResumeGame() Functionality, ideally from a json object stored through a file.
                    break;

                default:
                    Console.WriteLine("Please enter a valid command.");
                    break;
                }
            }
        }
示例#2
0
 // Population of Locations
 public static void PopulateLocation()
 {
     a1.Populate(
         "Town Market",
         "This is your Local Marketplace",
         "There is a vague smell of meat, herbs and fresh produce.",
         null,
         b1,
         null,
         a2,
         "A Seller in the Market says: \"I used to go fishing at the beach, but now theres monsters nearby!\"",
         () =>
     {
         if (MainGame.player.money == 0)
         {
             PrintUtils.SlowPrint("\"Go get money so you can buy stuff!\" shouts one of the merchants.");
         }
         else
         {
             Screens.ShopScreen();
         }
     });
     a2.Populate(
         "Town Entrance",
         "This is an entrance to your Town.",
         "The angel on the top symbolizes that your village is peaceful.",
         null,
         b2,
         a1,
         a3,
         "A old villager by the entrance says: \"Hello my dear child, where have you come from ?\"",
         () =>
     {
         Console.WriteLine("The mayoral election are going on. Everyone is talking about it.");
     });
     a3.Populate(
         "Town Square",
         "This is your Town Square.",
         "There is a wishing well in the middle.",
         null,
         b3,
         a2,
         a4,
         "A villager by the Well in the middle says: \"You should throw a gold coin in the well for good luck\"",
         () =>
     {
         Console.WriteLine("I wish I could get good luck, but I don't have any money.");
     });
     a4.Populate(
         "Town Hall",
         "This is where the mayor lives",
         "Mum said \"This Building has a prison for baddies!\"",
         null,
         b4,
         a3,
         null,
         "The Mayor comes out of the town hall. He says: \"Beware all, for there are monsters south of here!\"",
         () =>
     {
         Console.WriteLine("There is a weird smell of rotten eggs inside. I'm not going inside!");
     });
     b1.Populate(
         "Chest",
         "This is an unlocked chest!",
         "The key is already in the Chest lock.",
         a1,
         c1,
         null,
         b2,
         action: () =>
     {
         Console.WriteLine("You pick up the knife.");
         MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("knife"));
     });
     b2.Populate(
         "Home",
         "This is your home!",
         "Your home is the same - nothing has changed",
         a2,
         c2,
         b1,
         b3,
         "\"Good luck on your journey.\", said your Mom.",
         () =>
     {
         PrintUtils.SlowPrint("You take a nap.", 100);
         MainGame.player.HpReset();
     });
     b3.Populate(
         "Forest",
         "This is an oak forest.",
         "This forest has a crossway so you can go any way you want",
         a3,
         c3,
         b2,
         b4,
         "\"I will give you a reward if you save the town from the monsters\", said an old man",
         () =>
     {
         if (MainGame.player.xp == 0)
         {
             PrintUtils.SlowPrint("\"I will give you some money if you defeat the monsters south of here\" said an old man.", 100);
             // @todo add 'Defeat Monsters' Mission
         }
         else
         {
             PrintUtils.SlowPrint("I have given you some money.", 100);
             PrintUtils.SlowPrint("Now go away!", 75);
             // @todo Move Mission Completed Actions when Missions are created
             MainGame.player.Pay(40);
             MainGame.player.location.solved = true;
         }
     });
     b4.Populate(
         "???",
         "This is an old Building.",
         "There is a button and a glowing circle on the floor.",
         a4,
         c4,
         b3,
         null,
         action: () =>
     {
         MainGame.player.location.zoneName = "Teleporter";
         MainGame.player.SetLocation(c1);
         MainGame.player.location.zoneName = "Teleporter";
     });
     c1.Populate(
         "???",
         "This is an old Building.",
         "There is a button and a glowing circle on the floor.",
         b1,
         d1,
         null,
         c2,
         action: () =>
     {
         //Might make random?
         MainGame.player.location.zoneName = "Teleporter";
         MainGame.player.SetLocation(b4);
         MainGame.player.location.zoneName = "Teleporter";
     });
     c2.Populate(
         "Forest",
         "This is an ash forest.",
         "This forest has a crossway so you can go any way you want.",
         b2,
         d2,
         c1,
         c3,
         action: () =>
     {
         if (Map.c1.zoneName == "Teleporter")
         {
             // Move this too
             Console.WriteLine("\"Thank you for finding out what that place was! I'll give you a reward for doing that\", said a mysterious man, giving you some money.");
             MainGame.player.Pay(30);
             MainGame.player.location.solved = true;
         }
         else
         {
             Console.WriteLine("\"Can you please find out what is in the place to the left of us. I really want to go there, but I'm too scared!\", said a mysterious man.");
             // Add mission here
         }
     });
     c3.Populate(
         "Forest",
         "This is an birch forest.",
         "This forest has a crossway so you can go any way you want.",
         b3,
         d3,
         c2,
         c4,
         action: () =>
     {
         PrintUtils.SlowPrint("You take a nap", 100);
         MainGame.player.HpReset();
         Thread.Sleep(1000);
     });
     c4.Populate(
         "Dungeon",
         "This is a dangerous Dungeon.",
         "This Dungeon has dangers. Mum said to stay away from dangerous places.",
         b4,
         d4,
         c3,
         null,
         action: () =>
     {
         CombatHandler.Combat(MobFactory.CreateMob("random"), MainGame.player);
     });
     d1.Populate(
         "Beach",
         "This is a rocky beach",
         "This beach has lots of seaweed.",
         c1,
         null,
         null,
         d2,
         action: () =>
     {
         Console.WriteLine("The beach is too rocky to do anything.");
     });
     d2.Populate(
         "Beach",
         "This is a white, sandy Beach, with lots of children playing in the sand.", "This beach has lots of children playing on it.",
         c2,
         null,
         d1,
         d3,
         "\"my moomy sed dat da plase right of us is wery danegrus\" said one of the children",
         () =>
     {
         PrintUtils.SlowPrint("This beach is so sandy that...", 100);
         PrintUtils.SlowPrint("you take a nap. ", 100);
         MainGame.player.HpReset();
     });
     d3.Populate(
         "Dungeon",
         "This is a dangerous Dungeon.",
         "This Dungeon has dangers. Mum said to stay away from dangerous places.",
         c3,
         null,
         d2,
         d4,
         action: () =>
     {
         CombatHandler.Combat(MobFactory.CreateMob("random"), MainGame.player);
     });
     d4.Populate(
         "End Portal",
         "This is where you go if you want to leave this world.",
         "This is a way to go to a whole new world.",
         c4,
         null,
         d3,
         null,
         action: () =>
     {
         // @todo Add Second Map
         PrintUtils.SlowPrint("Thanks for Playing!");
         MainGame.EndGame();
     });
 }
示例#3
0
        public static void ShopScreen()
        {
            PrintUtils.GetHash(103, ConsoleColor.Cyan);
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Write(PrintUtils.CenterPadHashReturn("SHOP", 103));
            Console.WriteLine($@"
#                            #        ████████████████       #       ██████████████████████████       #
#      ██████    ██████      #      ██              ▒▒██     #     ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██     #
#    ██  ▒▒██    ██  ▒▒██    #      ██              ▒▒██     #     ██▒▒                      ▒▒██     #
#    ██  ▒▒██    ██  ▒▒██    #      ██    ▒▒▒▒▒▒▒▒  ▒▒██     #     ██▒▒                      ▒▒██     #
#    ██  ▒▒██    ██  ▒▒██    #      ██  ▒▒▒▒████▒▒  ▒▒██     #     ██▒▒                      ▒▒██     #
#  ██    ▒▒██    ██      ██  #      ██  ▒▒██    ██  ▒▒██     #     ██▒▒                      ▒▒██     #
#██    ▒▒▒▒██    ██▒▒    ▒▒██#      ██  ▒▒██    ██  ▒▒██     #     ██▒▒                      ▒▒██     #
#██▒▒▒▒▒▒██        ██▒▒▒▒▒▒██#      ██  ▒▒██    ██  ▒▒██     #     ██▒▒                      ▒▒██     #
#████████            ████████#      ██▒▒▒▒██    ██▒▒▒▒██     #     ██▒▒                      ▒▒██     #
#                            #      ████████    ████████     #     ██▒▒          ██          ▒▒██     #
#   [1]Boots        ₴ 10     #  [2]Leggings     ₴ 20         #     ██▒▒        ██████        ▒▒██     #
##############################################################     ██▒▒          ██          ▒▒██     #
#                            #       ████        ████        #     ██▒▒                      ▒▒██     #
#                            #   ████  ▒▒██    ██    ████    #     ██▒▒                      ▒▒██     #
#       ████████████         # ██      ▒▒██    ██      ▒▒██  #     ██▒▒                      ▒▒██     #
#     ██          ▒▒██       # ██          ████        ▒▒██  #     ██▒▒                      ▒▒██     #
#   ██            ▒▒▒▒██     # ██▒▒                  ▒▒▒▒██  #     ██▒▒                      ▒▒██     #
#   ██          ▒▒▒▒▒▒██     #   ██                ▒▒▒▒██    #       ██▒▒                  ▒▒██       #
#   ██    ████████▒▒▒▒██     #   ██▒▒              ▒▒▒▒██    #         ██▒▒              ▒▒██         #
#   ██  ████████████▒▒██     #     ██              ▒▒██      #           ██▒▒          ▒▒██           #
#   ██  ████████████▒▒██     #     ██            ▒▒▒▒██      #             ██▒▒▒▒▒▒▒▒▒▒██             #
#     ████        ████       #     ██▒▒        ▒▒▒▒▒▒██      #               ██▒▒▒▒▒▒██               #
#                            #     ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██      #                 ██▒▒██                 #
#                            #       ██▒▒▒▒▒▒▒▒▒▒▒▒██        #                   ██                   #
#                            #         ████████████          #                                        #
#                            #                               #                                        #
#    [3]Helmet      ₴ 30     #      [4]Chestplate ₴ 40       #     [5]Shield     ₴ 35                 #");
            PrintUtils.GetHash(103);
            PrintUtils.CenterPadHash("Type the number of the you want to buy to purchase. Type back to go back.", 103);
            PrintUtils.CenterPadHash($"You have ₴{MainGame.player.money.ToString()}.", 103);
            PrintUtils.GetHash(103);
            bool inLoop = true;

            while (inLoop)
            {
                string cart = PrintUtils.Input().ToLower();
                switch (cart)
                {
                case "1":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("boots"));
                    break;

                case "2":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("leggings"));
                    break;

                case "3":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("helmet"));
                    break;

                case "4":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("chestplate"));
                    break;

                case "5":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("shield"));
                    break;

                case "back":
                    inLoop = false;
                    MainGame.Prompt();
                    break;

                default:
                    Console.WriteLine("Please enter a valid number.");
                    break;
                }
            }
        }