예제 #1
0
        public void DrawStatusbar()
        {
            Console.SetCursorPosition(0, Program.consoleHeight - 2);

            if (Hitpoints > 2 * GetMaxHitpoints() / 3)
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;
            }
            if (Hitpoints > GetMaxHitpoints() / 3 && Hitpoints <= 2 * GetMaxHitpoints() / 3)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
            }
            if (Hitpoints <= GetMaxHitpoints() / 3)
            {
                Console.ForegroundColor = ConsoleColor.Red;
            }

            Console.Write("HP: " + Hitpoints.ToString() + "/" + GetMaxHitpoints().ToString() + ";");
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write(" Time: " + Timing.GetCurrentTurn() / 10 + "." + Timing.GetCurrentTurn() % 10 + ";"); ///THIS might be not cool...
            Console.Write(" Wielding: " + Inv.Wielded.DisplayName + ";");
            int cx = Console.CursorLeft;
            int cy = Console.CursorTop;

            for (int i = 0; i < Program.consoleWidth; i++)
            {
                Console.Write(" ");
            }
            Console.SetCursorPosition(cx, cy);
            if (Inv.isCarryingABody())
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.Write(" Carrying a " + Inv.BodyCarrying.DisplayName);
                //_DEBUG.AddDebugMessage("Watafuq? Body is " + Inv.BodyCarrying.DisplayName);
            }
            else
            {
                Console.Write("                                 ");
            }

            //Text statuses (like, "poisoned", "frightened" etc)
            Console.SetCursorPosition(0, Program.consoleHeight - 1);
            int burden = Inv.getEncumbrance();

            if (burden == 1)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.Write("Burdened ");
            }
            if (burden == 2)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.Write("Very burdened ");
            }
            if (burden == 3)
            {
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.Red;
                Console.Write("Overburdened ");
                Console.BackgroundColor = ConsoleColor.Black;
            }
        }
예제 #2
0
 public string ToString()
 {
     return($"Name: {Name}\nHP: {Hitpoints.ToString()}");
 }