예제 #1
0
 public void Refresh()
 {
     this.Erase();
     Content = new string[] { $" {Program.Player.Name}", $"{Program.Player.Class} {Program.Player.Race} de nivel {Program.Player.Lvl}", $" edad {Program.Player.Age}", $" hp {Program.Player.Hp[0]}/{Program.Player.Hp[1]}", $" mana {Program.Player.Mana[0]}/{Program.Player.Mana[1]}", $" siguiente nivel {Program.Player.Xp[0]}/{Program.Player.Xp[1]}" };
     x       = Construct.Longest(Content) + 2;
     this.Print();
 }
예제 #2
0
        public MobStatus(int cx, int cy) : base(12, 12)
        {
            Content = new string[] { $" {Program.Mob.Name.Print(false, 0)}", " ", $" hp {Program.Mob.Hp[0]}/{Program.Mob.Hp[1]}" };
            y       = Content.Length;
            int longest = Construct.Longest(Content);

            x       = longest + 2;
            CursorX = Console.BufferWidth - Construct.Longest(Content) - cx - 2;
            CursorY = cy;
        }
예제 #3
0
        public PlayerStatus(int cx, int cy) : base(12, 12)
        {
            Content = new string[] { $" {Program.Player.Name}", $"{Program.Player.Class} {Program.Player.Race} de nivel {Program.Player.Lvl}", $" edad {Program.Player.Age}", $" hp {Program.Player.Hp[0]}/{Program.Player.Hp[1]}", $" mana {Program.Player.Mana[0]}/{Program.Player.Mana[1]}", $" siguiente nivel {Program.Player.Xp[0]}/{Program.Player.Xp[1]}", $"GEA: {Program.Gea.corruption}" };
            y       = Content.Length;
            int longest = Construct.Longest(Content);

            x       = longest + 2;
            CursorX = cx;
            CursorY = cy;
        }
예제 #4
0
        public Boxy(int x, string[] elements)
        {
            this.Y = elements.Length;
            int longest = Construct.Longest(elements);

            this.X       = longest + 2;
            this.CursorX = x;
            this.CursorY = 3;
            this.Print();
            foreach (string element in elements)
            {
                this.WriteLine(element);
            }
        }
예제 #5
0
        public static void Title(int y)
        {
            List <string> lines = new List <string>();

            lines.Add(new string("   ▄████████ ███    █▄     ▄███████▄    ▄████████    ▄████████     ▄████████    ▄███████▄    ▄██████▄    ▄█     █▄   ▄██████▄     ▄████████  ▄█       ████████▄"));
            lines.Add(new string("   ███    ███ ███    ███   ███    ███   ███    ███   ███    ███    ███    ███   ███    ███   ███    ███  ███     ███ ███    ███   ███    ███ ███       ███   ▀███"));
            lines.Add(new string("  ███    █▀  ███    ███   ███    ███   ███    █▀    ███    ███    ███    ███   ███    ███   ███    █▀   ███     ███ ███    ███   ███    ███ ███       ███    ███ "));
            lines.Add(new string("  ███        ███    ███   ███    ███  ▄███▄▄▄      ▄███▄▄▄▄██▀   ▄███▄▄▄▄██▀   ███    ███  ▄███         ███     ███ ███    ███  ▄███▄▄▄▄██▀ ███       ███    ███"));
            lines.Add(new string("▀███████████ ███    ███ ▀█████████▀  ▀▀███▀▀▀     ▀▀███▀▀▀▀▀    ▀▀███▀▀▀▀▀   ▀█████████▀  ▀▀███ ████▄   ███     ███ ███    ███ ▀▀███▀▀▀▀▀   ███       ███    ███"));
            lines.Add(new string("         ███ ███    ███   ███          ███    █▄  ▀███████████  ▀███████████   ███          ███    ███  ███     ███ ███    ███ ▀███████████ ███       ███    ███"));
            lines.Add(new string("   ▄█    ███ ███    ███   ███          ███    ███   ███    ███    ███    ███   ███          ███    ███  ███ ▄█▄ ███ ███    ███   ███    ███ ███▌    ▄ ███   ▄███"));
            lines.Add(new string(" ▄████████▀  ████████▀   ▄████▀        ██████████   ███    ███    ███    ███  ▄████▀        ████████▀    ▀███▀███▀   ▀██████▀    ███    ███ █████▄▄██ ████████▀"));
            lines.Add(new string("                                                   ███    ███    ███    ███                                                     ███    ███ ▀                    "));

            int x = Construct.Longest(lines);

            foreach (string line in lines)
            {
                Console.SetCursorPosition((Console.BufferWidth - x) / 2, y);
                Console.WriteLine(line);
                y++;
            }
        }
예제 #6
0
        public static void Death(int y)
        {
            List <string> lines = new List <string>();

            lines.Add(new string(" ██░ ██  ▄▄▄        ██████     ███▄ ▄███▓ █    ██ ▓█████  ██▀███  ▄▄▄█████▓ ▒█████"));
            lines.Add(new string("░██░ ██▒▒████▄    ▒██    ▒    ▓██▒▀█▀ ██▒ ██  ▓██▒▓█   ▀ ▓██ ▒ ██▒▓  ██▒ ▓▒▒██▒  ██▒"));
            lines.Add(new string("▒██▀▀██░▒██  ▀█▄  ░ ▓██▄      ▓██    ▓██░▓██  ▒██░▒███   ▓██ ░▄█ ▒▒ ▓██░ ▒░▒██░  ██▒"));
            lines.Add(new string("░▓█ ░██ ░██▄▄▄▄██   ▒   ██▒   ▒██    ▒██ ▓▓█  ░██░▒▓█  ▄ ▒██▀▀█▄  ░ ▓██▓ ░ ▒██   ██░"));
            lines.Add(new string("░▓█▒░██▓ ▓█   ▓██▒▒██████▒▒   ▒██▒   ░██▒▒▒█████▓ ░▒████▒░██▓ ▒██▒  ▒██▒ ░ ░ ████▓▒░"));
            lines.Add(new string(" ▒ ░░▒░▒ ▒▒   ▓▒█░▒ ▒▓▒ ▒ ░   ░ ▒░   ░  ░░▒▓▒ ▒ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░  ▒ ░░   ░ ▒░▒░▒░ "));
            lines.Add(new string(" ▒ ░▒░ ░  ▒   ▒▒ ░░ ░▒  ░ ░   ░  ░      ░░░▒░ ░ ░  ░ ░  ░  ░▒ ░ ▒░    ░      ░ ▒ ▒░ "));
            lines.Add(new string(" ░  ░░ ░  ░   ▒   ░  ░  ░     ░      ░    ░░░ ░ ░    ░     ░░   ░   ░      ░ ░ ░ ▒  "));
            lines.Add(new string(" ░  ░  ░      ░  ░      ░            ░      ░        ░  ░   ░                  ░ ░  "));

            int x = Construct.Longest(lines);

            foreach (string line in lines)
            {
                Console.SetCursorPosition((Console.BufferWidth - x) / 2, y);
                Console.WriteLine(line);
                y++;
            }
        }
예제 #7
0
 public void Refresh()
 {
     Content = new string[] { $" {Program.Mob.Name.Print(false, 0)}", " ", $" hp {Program.Mob.Hp[0]}/{Program.Mob.Hp[1]}" };
     x       = Construct.Longest(Content) + 2;
 }
예제 #8
0
        //Inventory Menu, similarly to combat Menu, returns a letter
        public string InvMenu(List <string> item, string title, int x)
        {
            //var originalpos = Console.CursorTop;
            int            i = 0;
            ConsoleKeyInfo k;

            //Looking for the longest string in the menu
            int longest = Construct.Longest(item);


            if (longest > x)
            {
                x = longest;
            }
            int extraY = title.Length / x;

            if (title.Length % x != 0)
            {
                extraY++;
            }
            int height = item.Count + extraY;

            this.X    = x;
            this.Y    = height;
            this.posX = (Console.WindowWidth - this.X - 2) / 2;

            //Printing the boxy box
            Boxy Boxy = new Boxy(this.X, this.Y, this.posX, this.posY, this.Center);

            Boxy.BiPrint();
            Boxy.WriteLine(title);

            while (1 < 2)
            {
                Boxy.GoTop();
                Boxy.Jump(extraY);
                foreach (string element in item)
                {
                    Boxy.WriteLine(element);
                }

                Boxy.GoTop();
                Boxy.Jump(extraY + i);
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;
                Boxy.WriteLine(item[i]);
                Console.ResetColor();

                Boxy.GoTo(this.posX + Boxy.X - 1, this.posY + extraY - 2);


                while (1 < 2)
                {
                    k = Console.ReadKey();

                    if (k.Key == ConsoleKey.UpArrow)
                    {
                        if (i == 0)
                        {
                            i = item.Count - 1;
                        }
                        else
                        {
                            i--;
                        }
                        break;
                    }
                    else if (k.Key == ConsoleKey.DownArrow)
                    {
                        if (i == item.Count - 1)
                        {
                            i = 0;
                        }
                        else
                        {
                            i++;
                        }
                        break;
                    }
                    else if (k.Key == ConsoleKey.Enter)
                    {
                        return(item[i].Substring(0, 1).ToLower());
                    }
                }
            }

            return("p");
        }
예제 #9
0
        //Combat menu returns the first letter of the selected option
        public string CombatMenu(string title, bool cure, bool meditate, bool fury)
        {
            //var originalpos = Console.CursorTop;
            int            i = 0;
            ConsoleKeyInfo k;

            //Options
            List <string> item = new List <string>();

            item.Add("Ataque");
            item.Add("Conjuro");
            item.Add("Discurso épico");
            if (cure)
            {
                item.Add("Sanaciión");
            }
            if (meditate)
            {
                item.Add("Meditar");
            }
            if (fury)
            {
                item.Add("Enfurecer");
            }
            item.Add("Inventario");
            item.Add("Huir");

            //Looking for the longest string in the menu
            int longest = Construct.Longest(item);

            X = 17;

            if (longest > X)
            {
                X = longest;
            }

            Boxy counter = new Boxy(X, Y, 1, 1, Center);

            int extraY = counter.CountLines(title);

            Y = item.Count + extraY;

            this.posX = (Console.WindowWidth - this.X - 2) / 2;

            //Printing the boxy box
            Boxy Boxy = new Boxy(X, Y, posX, posY, Center);

            Boxy.BiPrint();
            Boxy.WriteLine(title);

            while (1 < 2)
            {
                Boxy.GoTop();
                Boxy.Jump(extraY);
                foreach (string element in item)
                {
                    Boxy.WriteLine(element);
                }

                Boxy.GoTop();
                Boxy.Jump(extraY + i);
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Yellow;
                Boxy.WriteLine(item[i]);
                Console.ResetColor();

                Boxy.GoTo(this.posX + Boxy.X - 1, this.posY + extraY - 2);


                while (1 < 2)
                {
                    k = Console.ReadKey();

                    if (k.Key == ConsoleKey.UpArrow)
                    {
                        if (i == 0)
                        {
                            i = item.Count - 1;
                        }
                        else
                        {
                            i--;
                        }
                        break;
                    }
                    else if (k.Key == ConsoleKey.DownArrow)
                    {
                        if (i == item.Count - 1)
                        {
                            i = 0;
                        }
                        else
                        {
                            i++;
                        }
                        break;
                    }
                    else if (k.Key == ConsoleKey.Enter)
                    {
                        return(item[i].Substring(0, 1).ToLower());
                    }
                }
            }
        }