generated from admin/template
105 lines
4.7 KiB
C#
105 lines
4.7 KiB
C#
using System;
|
|
|
|
namespace LaboratoryWork2
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
|
|
Console.WriteLine("=== Прокачка покемона ===");
|
|
|
|
Console.Write("Введите базовую атаку покемона: ");
|
|
int baseAttack = int.Parse(Console.ReadLine());
|
|
|
|
Console.Write("Введите количество полученных уровней: ");
|
|
int levelsGained = int.Parse(Console.ReadLine());
|
|
|
|
int totalAttack = baseAttack + (levelsGained * 5);
|
|
Console.WriteLine($"Итоговая атака покемона: {totalAttack}");
|
|
|
|
Console.WriteLine();
|
|
|
|
Console.WriteLine("=== Магазин предметного инвентаря ===");
|
|
int initialBalance = 1500;
|
|
int potionCost = 200;
|
|
|
|
Console.WriteLine($"Текущий баланс тренера: {initialBalance} монет");
|
|
Console.WriteLine($"Стоимость одного Зелья Лечения (Potion): {potionCost} монет");
|
|
|
|
Console.Write("Введите количество приобретаемых зелий: ");
|
|
int potionsToBuy = int.Parse(Console.ReadLine());
|
|
|
|
int totalCost = potionsToBuy * potionCost;
|
|
int remainingBalance = initialBalance - totalCost;
|
|
|
|
if (remainingBalance >= 0)
|
|
{
|
|
Console.WriteLine($"Покупка успешна! Вы приобрели зелий: {potionsToBuy} шт.");
|
|
Console.WriteLine($"Общая стоимость: {totalCost} монет. Остаток на балансе: {remainingBalance} монет.");
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine($"Недостаточно средств! Стоимость покупки ({totalCost} монет) превышает ваш баланс.");
|
|
}
|
|
|
|
Console.WriteLine(); // Пустая строка для разделения
|
|
|
|
Console.WriteLine("=== Анализ состояния покемона ===");
|
|
Console.Write("Введите текущее количество HP покемона: ");
|
|
int currentHp = int.Parse(Console.ReadLine());
|
|
|
|
if (currentHp <= 0)
|
|
{
|
|
Console.WriteLine("Покемон потерял сознание! Верните его в покебол.");
|
|
}
|
|
else if (currentHp >= 1 && currentHp <= 20)
|
|
{
|
|
Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
|
|
}
|
|
else if (currentHp >= 21 && currentHp <= 50)
|
|
{
|
|
Console.WriteLine("Покемон ранен, будьте осторожны.");
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Покемон полон сил и готов к бою!");
|
|
}
|
|
|
|
Console.WriteLine();
|
|
|
|
Console.WriteLine("=== Ход в бою ===");
|
|
Console.WriteLine("Выберите действие:");
|
|
Console.WriteLine("1 — Атака");
|
|
Console.WriteLine("2 — Инвентарь");
|
|
Console.WriteLine("3 — Сменить покемона");
|
|
Console.WriteLine("4 — Побег");
|
|
|
|
Console.Write("Введите номер действия: ");
|
|
int actionChoice = int.Parse(Console.ReadLine());
|
|
|
|
switch (actionChoice)
|
|
{
|
|
case 1:
|
|
Console.WriteLine("Покемон наносит быстрый удар!");
|
|
break;
|
|
case 2:
|
|
Console.WriteLine("Вы открыли сумку и применили Зелье Лечения.");
|
|
break;
|
|
case 3:
|
|
Console.WriteLine("Вы отозвали покемона и выпустили нового!");
|
|
break;
|
|
case 4:
|
|
Console.WriteLine("Вы успешно сбежали из боя!");
|
|
break;
|
|
default:
|
|
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
|
|
break;
|
|
}
|
|
|
|
Console.WriteLine();
|
|
Console.WriteLine("Нажмите любую клавишу для завершения...");
|
|
Console.ReadKey();
|
|
}
|
|
}
|
|
} |