Beispiel #1
0
        public static void Stats()
        {
            int          len   = 71;
            ConsoleColor color = ConsoleColor.Cyan;

            PrintUtils.GetHash(len, color);
            PrintUtils.CenterPadHash("STATS", len, color);
            PrintUtils.LeftPadHash($"You are {MainGame.player.name} the {MainGame.player.job.name}. ", len, color);
            PrintUtils.LeftPadHash($"You have {MainGame.player.hp} hp.", len, color);
            PrintUtils.LeftPadHash($"You have {MainGame.player.xp} xp and you are at level {Convert.ToInt32(MainGame.player.xp / 1000)}.", len, color);
            PrintUtils.LeftPadHash($"You have {MainGame.player.ap} strength.", len, color);
            PrintUtils.LeftPadHash($"You have ₴ {MainGame.player.money}", len, color);
            PrintUtils.LeftPadHash($"Your current weapon, the {MainGame.player.weapon.name} does {MainGame.player.weapon.ap} of damage.", len, color);
            String inventory = "Your Inventory contains: ";

            if (MainGame.player.inventory != null)
            {
                foreach (var item in MainGame.player.inventory)
                {
                    inventory += item.name;
                }
            }
            PrintUtils.LeftPadHash(inventory, len, color);
            String armour = "You are wearing these pieces of armour: ";

            if (MainGame.player.armour != null)
            {
                foreach (var item in MainGame.player.armour)
                {
                    armour += item.name;
                }
            }
            PrintUtils.LeftPadHash(armour, len, color);
            PrintUtils.GetHash(len, color);
        }
Beispiel #2
0
 public static void EndGame()
 {
     PrintUtils.GetHash(15);
     PrintUtils.CenterPadHash("GOODBYE!!", 15);
     PrintUtils.GetHash(15);
     Thread.Sleep(500);
     Environment.Exit(0);
 }
Beispiel #3
0
        public static void TitleScreen()
        {
            int width = 28;

            PrintUtils.GetHash(width);
            PrintUtils.CenterPadHash("Welcome to Bordertale!", width);
            PrintUtils.CenterPadHash("- Play -", width);
            PrintUtils.CenterPadHash("- Resume -", width);
            PrintUtils.CenterPadHash("- Help -", width);
            PrintUtils.CenterPadHash("- Acknoledgements -", width);
            PrintUtils.CenterPadHash("- Quit -", width);
            PrintUtils.CenterPadHash("Copyright 2021 tejmen09", width);
            PrintUtils.GetHash(width);
            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);
                    PrintUtils.CenterPadHash("GOODBYE!!", 15);
                    PrintUtils.GetHash(15);
                    Thread.Sleep(500);
                    Environment.Exit(0);
                    break;

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

                case "resume":
                    inLoop = false;
                    MainGame.MainGameLoop();
                    break;

                default:
                    Console.WriteLine("Please enter a valid command.");
                    break;
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// Combination of GetHash and CenterPadHash to create a box
 /// </summary>
 /// <param name="text">String to center-align</param>
 /// <param name="length">Final width of box</param>
 /// <param name="color">Foreground color to print</param>
 public static void CenterBoxHash(string text, int length, ConsoleColor color = ConsoleColor.Gray)
 {
     if (color != ConsoleColor.Gray && Console.ForegroundColor == ConsoleColor.Gray)
     {
         Console.ForegroundColor = color;
     }
     PrintUtils.GetHash(length, color);
     PrintUtils.CenterPadHash(text, length, color);
     PrintUtils.GetHash(length, color);
     Console.ResetColor();
 }
Beispiel #5
0
        public static void StartGame()
        {
            PrintUtils.SlowPrint("What is your name young traveller?");
            player.name = PrintUtils.Input();
            if (player.name == "dev")
            {
                player.name = "Developer";
                player.job  = new Job("Fighter", 120, 40);
                player.SetJob();
                Map.PopulateLocation();
                MainGameLoop();
            }
            PrintUtils.SlowPrint($"What is will your role be {player.name}?");
            Console.WriteLine("(You can be a Fighter, Wizard or healer)");
            bool inLoop = true;

            while (inLoop)
            {
                string playerJob = PrintUtils.Input().ToLower();
                switch (playerJob)
                {
                case "fighter":
                    inLoop     = false;
                    player.job = new Job("Fighter", 120, 40);
                    break;

                case "wizard":
                    inLoop     = false;
                    player.job = new Job("Healer", 200, 20, 40);
                    break;

                case "healer":
                    inLoop     = false;
                    player.job = new Job("Wizard", 300, 20, 20);
                    break;

                default:
                    Console.WriteLine("Please enter a valid role.");
                    break;
                }
            }
            player.SetJob();
            Map.PopulateLocation();
            PrintUtils.SlowPrint($"Welcome {player.name} the {player.job.name}.");
            PrintUtils.SlowPrint("Welcome to this fanatasy world!", 30);
            PrintUtils.SlowPrint("Just dont get lost...", 100);
            PrintUtils.SlowPrint("(Cough, Cough)", 20);
            PrintUtils.GetHash(28);
            PrintUtils.CenterPadHash("Let's Jump In!", 28);
            PrintUtils.GetHash(28);
            MainGameLoop();
        }
Beispiel #6
0
 private static void AcknowledgementsScreen()
 {
     PrintUtils.GetHash(31);
     PrintUtils.CenterPadHash("Acknowledgements", 31);
     PrintUtils.CenterPadHash("Beta Tested by:", 31);
     PrintUtils.LeftPadHash("• appcreatorguy ", 31);
     PrintUtils.LeftPadHash("• tejmen09 ", 31);
     PrintUtils.LeftPadHash("Helped By:", 31);
     PrintUtils.LeftPadHash("• appcreatorguy", 31);
     PrintUtils.LeftPadHash("• tejmen09", 31);
     PrintUtils.CenterPadHash(" Copyright 2019 Tejas Mengle ", 31);
     PrintUtils.GetHash(31);
     TitleScreen();
 }
Beispiel #7
0
        public static void Stats()
        {
            int len = 66;

            PrintUtils.GetHash(len);
            PrintUtils.CenterPadHash("STATS", len);
            PrintUtils.LeftPadHash($"You are {MainGame.player.name} the {MainGame.player.job.name}. ", len);
            PrintUtils.LeftPadHash($"You have {MainGame.player.hp} hp.", len);
            PrintUtils.LeftPadHash($"You have {MainGame.player.xp} xp and you are at level {Convert.ToInt32(MainGame.player.xp/1000)}.", len);
            PrintUtils.LeftPadHash($"You have {MainGame.player.ap} strength.", len);
            PrintUtils.LeftPadHash($"You have ₴ {MainGame.player.money}", len);
            // @todo add rest of stats screen
            //  PrintUtils.LeftPadHash($"Your current weapon, the {} does {} of damage.", len);
            //  PrintUtils.LeftPadHash($"Your Inventory contains: , end=", len);
            //  PrintUtils.LeftPadHash($"You are wearing these pieces of armour: ', end=''", len);
            PrintUtils.GetHash(len);
        }
Beispiel #8
0
        public static void HelpScreen(string command)
        {
            switch (command)
            {
            case "move":
                int len = 52;
                PrintUtils.GetHash(len, ConsoleColor.Magenta);
                PrintUtils.CenterPadHash("Movement Help", len, ConsoleColor.Magenta);
                PrintUtils.LeftPadHash("• Type 'move' and what direction you want to go", len, ConsoleColor.Magenta);
                PrintUtils.GetHash(len, ConsoleColor.Magenta);
                break;

            case "":
            default:
                Console.WriteLine($"'{command}' is not a valid command.");
                break;
            }
        }
Beispiel #9
0
        public static void HelpScreen(bool inGame)
        {
            if (!inGame)
            {
                Console.Clear();
            }
            int width = 31;

            PrintUtils.GetHash(width, ConsoleColor.DarkBlue);
            PrintUtils.CenterPadHash("Help", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Type 'move' command to", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" move", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Type your commands to do", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" them", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Type 'look' to inspect", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" something", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Type 'act' to do what you", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" can on your place", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• If you find a Dungeon,", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" please help to excavate it", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Find more weapons hidden", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" in chests to kill monsters", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Go to the store to buy", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" armour", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash("• Equip your armour for", width, ConsoleColor.DarkBlue);
            PrintUtils.LeftPadHash(" extra protection.", width, ConsoleColor.DarkBlue);
            PrintUtils.CenterPadHash("Copyright 2019 tejmen09", width, ConsoleColor.DarkBlue);
            PrintUtils.GetHash(width, ConsoleColor.DarkBlue);
            switch (inGame)
            {
            case true:
                MainGame.MainGameLoop();
                break;

            default:
                TitleScreen();
                break;
            }
        }
Beispiel #10
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;
                }
            }
        }
Beispiel #11
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;
                }
            }
        }