Exemplo n.º 1
0
        static public void GoToCity()
        {
            UpdateEconomy();
            RPG.Fancies();
            Console.Clear();

            //RPG.Dialogue("     /o[+]o|     _[T]_" +
            //       "\n     |T=n=T|     |=n=|", ConsoleColor.White, true);

            if (!wasInCity)
            {
                wasInCity = true;
                RPG.Dialogue("В городе можно вылечиться или посетить таверну.");
            }

            Console.WriteLine("\nИгрок:" +
                              "\nHP: " + HP + "/" + MaxHP + " [" + RPG.HPLine + "] " +
                              "\nДеньги: " + Money);

            Console.WriteLine("\nЧто будешь делать? Вылечиться - 1, Таверна - 2, Вернуться в лес - 0");

            switch (Console.ReadLine())
            {
            case "1":
                GoHeal();
                break;

            case "2":
                GoToTavern();
                break;

            case "0":
                Console.Clear();
                break;

            default:
                GoToCity();
                break;
            }
        }
Exemplo n.º 2
0
        static void PlayerTurn()
        {
            Console.Clear();
            RPG.Fancies();                                              // Обновление элементов интерфейса
            Console.WriteLine($"Ход {count}. Характеристики:");
            for (int i = 0; i < amount; i++)
            {
                Console.WriteLine($"\n    {monsters[i].Name} {i + 1} (УР: {monsters[i].LVL}, {monsters[i].GetAState()}):"
                                  + $"\n HP {monsters[i].HP}"
                                  + $"\nATK {monsters[i].Damage}"
                                  + $"\nЦепь: {monsters[i].GetActionChain()}");   // Вывести "интерфейс"
            }

            Console.WriteLine($"\nЗдоровье игрока: [{RPG.HPLine}] {HP}/{MaxHP} ({Inventory[1].Defence} ЗАЩ). Статус: {GetStatusName()}");
            // Вывод списка возможных действий
            Console.Write($"\nТекущая цепь: -");

            for (int i = 0; i < ActionChain.Length; i++)
            {
                if (i == index)
                {
                    Console.Write($"[{ActionChain[i].name}]-");
                }
                else
                {
                    Console.Write($"{ActionChain[i].name}-");
                }
            }

            Console.WriteLine($"\nОчки действий: {ChainCost}/{ActionPoints}"
                              + $"\nАтаковать ({Attack.cost}): A"
                              + $"\nИсп. предмет ({Spellcast.cost}): S"
                              + $"\nЗащититься ({Defend.cost}): D"
                              + $"\nИспользовать текущую цепь: 1"
                              + $"\nСменить звено: 2, 3"
                              + $"\nОчистить цепь: 4");

            // Приём ввода
            switch (Console.ReadKey().Key)
            {
            case ConsoleKey.NumPad1:
            case ConsoleKey.D1:
                ChainClash();
                goto default;

            case ConsoleKey.NumPad2:
            case ConsoleKey.D2:
                if (index > 0)
                {
                    index--;
                }
                goto default;

            case ConsoleKey.NumPad3:
            case ConsoleKey.D3:
                if (index < ActionChain.Length - 1)
                {
                    index++;
                }
                goto default;

            case ConsoleKey.NumPad4:
            case ConsoleKey.D4:
                index       = 0;
                ChainCost   = 0;
                ActionChain = new RPG.ChainAction[5] {
                    Wait, Wait, Wait, Wait, Wait
                };
                goto default;

            case ConsoleKey.W:
                ChainCost         -= ActionChain[index].cost;
                ActionChain[index] = Wait;
                ChainCost         += ActionChain[index].cost;
                if (index < ActionChain.Length - 1)
                {
                    index++;
                }
                goto default;

            case ConsoleKey.A:
                if (ChainCost - ActionChain[index].cost + Attack.cost <= ActionPoints)
                {
                    ChainCost         -= ActionChain[index].cost;
                    ActionChain[index] = Attack;
                    ChainCost         += ActionChain[index].cost;
                    if (index < ActionChain.Length - 1)
                    {
                        index++;
                    }
                }
                goto default;

            case ConsoleKey.S:
                if (ChainCost - ActionChain[index].cost + Spellcast.cost <= ActionPoints)
                {
                    ChainCost         -= ActionChain[index].cost;
                    ActionChain[index] = Spellcast;
                    ChainCost         += ActionChain[index].cost;
                    if (index < ActionChain.Length - 1)
                    {
                        index++;
                    }
                }
                goto default;

            case ConsoleKey.D:
                if (ChainCost - ActionChain[index].cost + Defend.cost <= ActionPoints)
                {
                    ChainCost         -= ActionChain[index].cost;
                    ActionChain[index] = Defend;
                    ChainCost         += ActionChain[index].cost;
                    if (index < ActionChain.Length - 1)
                    {
                        index++;
                    }
                }
                goto default;

            default:
                PlayerTurn();
                break;
            }
        }