generated from admin/template
lab-02
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
namespace Lesson2
|
||||
{
|
||||
class Lesson2Tasks
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
/*
|
||||
Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ");
|
||||
Console.WriteLine("=== Прокачка покемона ===");
|
||||
Console.WriteLine($"Введите базовое значение атаки: ");
|
||||
int baseAttack = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine($"Базовое значение атаки:{baseAttack} ");
|
||||
Console.WriteLine($"Введите количество полученных уровней:");
|
||||
int levelGained = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine($"Количество полученных уровней:{levelGained}");
|
||||
int finalDamage = baseAttack + (levelGained * 5);
|
||||
Console.WriteLine($"Итоговое значение аттаки: {finalDamage}");
|
||||
|
||||
Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ");
|
||||
int coachBalance = 1500;
|
||||
Console.WriteLine($"Текущий баланс тренера: {coachBalance} ");
|
||||
int potionPrice = 200;
|
||||
Console.WriteLine($"Стоимость одного зелья: {potionPrice}");
|
||||
int potionCount = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine($"Количество приобретаемых зелий: {potionCount}");
|
||||
int priceTotal = potionCount * potionPrice;
|
||||
int remainBalance = coachBalance - priceTotal;
|
||||
Console.WriteLine ($"Успешная покупка! Остаток средств: {remainBalance}");
|
||||
*/
|
||||
|
||||
Console.WriteLine("2 БЛОК 1 ЗАДАНИЕ");
|
||||
Console.WriteLine("Введите текущее количество HP");
|
||||
int HP = int.Parse(Console.ReadLine());
|
||||
if (HP <= 0)
|
||||
{
|
||||
Console.WriteLine("Покемон потерял сознание! Верните его в покебол.");
|
||||
}
|
||||
else if (HP > 0 & HP < 21)
|
||||
{
|
||||
Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
|
||||
}
|
||||
else if (HP >= 21 & HP <= 50)
|
||||
{
|
||||
Console.WriteLine("Покемон ранен, будьте осторожны.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Покемон полон сил и готов к бою!");
|
||||
}
|
||||
|
||||
Console.WriteLine("2 БЛОК 2 ЗАДАНИЕ");
|
||||
Console.WriteLine("Выберите действие тренера:");
|
||||
Console.WriteLine("1 — Атака");
|
||||
Console.WriteLine("2 — Инвентарь");
|
||||
Console.WriteLine("3 — Сменить покемона");
|
||||
Console.WriteLine("4 — Побег");
|
||||
int action = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Вы выбрали: {action}");
|
||||
switch (action)
|
||||
{
|
||||
case 1:
|
||||
Console.WriteLine("Покемон наносит быстрый удар!");
|
||||
break;
|
||||
case 2:
|
||||
Console.WriteLine("Вы открыли сумку и применили Зелье Лечения.");
|
||||
break;
|
||||
case 3:
|
||||
Console.WriteLine("Вы отозвали покемона и выпустили нового!");
|
||||
break;
|
||||
case 4:
|
||||
Console.WriteLine("Вы успешно сбежали из боя!");
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user