done stage

This commit is contained in:
2026-09-20 23:05:43 +03:00
parent 52465c5b3e
commit b9c82229ac
+123 -23
View File
@@ -4,48 +4,66 @@ public class Programm
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Console.Write("Введите стадию развития покемона: "); Console.WriteLine("======================================================================");
Console.WriteLine("ИНИЦИАЛИЗА КАРТОЧКИ ПОКЕМОНА");
Console.WriteLine("----------------------------------------------------------------------");
Console.Write("Введите стадию развития: ");
string stage = Console.ReadLine(); string stage = Console.ReadLine();
Console.Write("Введите имя покемона: "); Console.Write("Введите имя покемона: ");
string name = Console.ReadLine(); string name = Console.ReadLine();
Console.Write("Введите вид покемона: "); Console.Write("Введите вид покемона: ");
string category = Console.ReadLine(); string category = Console.ReadLine();
Console.Write("Введите название первой атаки: "); Console.Write("Введите название 1-й атаки: ");
string attack1Name = Console.ReadLine(); string attack1Name = Console.ReadLine();
Console.Write("Введите описание первой атаки: "); Console.Write("Введите эффект 1-й атаки: ");
string attack1Desc = Console.ReadLine(); string attack1Desc = Console.ReadLine();
Console.Write("Введите базовый урон первой атаки: "); Console.Write("Введите базовый урон 1-й атаки: ");
int attack1BaseDamage = int.Parse(Console.ReadLine()); int attack1BaseDamage = int.Parse(Console.ReadLine());
Console.Write("Введите название второй атаки: "); Console.Write("Введите название 2-й атаки: ");
string attack2Name = Console.ReadLine(); string attack2Name = Console.ReadLine();
Console.Write("Введите описание второй атаки: "); Console.Write("Введите эффект 2-й атаки: ");
string attack2Desc = Console.ReadLine(); string attack2Desc = Console.ReadLine();
Console.Write("Введите базовый урон второй атаки: "); Console.Write("Введите базовый урон 2-й атаки: ");
int attack2BaseDamage = int.Parse(Console.ReadLine()); int attack2BaseDamage = int.Parse(Console.ReadLine());
Console.Write("Введите слабость покемона (Weakness): "); Console.Write("Введите уязвимость: ");
string weakness = Console.ReadLine(); string weakness = Console.ReadLine();
Console.Write("Введите сопротивление покемона (Resistance): "); Console.Write("Введите устойчивость: ");
string resistance = Console.ReadLine(); string resistance = Console.ReadLine();
Console.Write("Введите тякущее HP: "); Console.Write("Введите текущее HP: ");
int hp = int.Parse(Console.ReadLine()); int hp = int.Parse(Console.ReadLine());
string enemyName = "Бубазавар"; Console.Clear();
int enemyHP = 70; Console.WriteLine("======================================================================");
Console.WriteLine($"[{stage}] {name,-42} ОЖ: {hp}");
Console.WriteLine("----------------------------------------------------------------------");
Console.WriteLine($"Вид: {category}");
Console.WriteLine("----------------------------------------------------------------------");
Console.WriteLine($"[Атака 1] {attack1Name,-40} Урон: {attack1BaseDamage}");
Console.WriteLine($"Эффект: {attack1Desc}\n");
Console.WriteLine($"[Атака 2] {attack2Name,-40} Урон: {attack2BaseDamage}+");
Console.WriteLine($"Эффект: {attack2Desc}");
Console.WriteLine("----------------------------------------------------------------------");
Console.WriteLine($"Слабость: {weakness} | Устойчивость: {resistance}");
Console.WriteLine("======================================================================\n");
string enemyName = "Булбазавр";
int enemyHp = 70;
int enemyBaseDamage = 15; int enemyBaseDamage = 15;
int roundNumber = 1; int roundNumber = 1;
int actionChoice;
bool isEnemyDebuffed = false; bool isEnemyDebuffed = false;
Console.WriteLine("Приготовьтесь к дуэли!"); Console.WriteLine("Приготовьтесь к дуэли!");
for (int i = 3; i >= 1; i--) for (int i = 3; i >= 1; i--)
{ {
Console.WriteLine($"{i}..."); Console.WriteLine($"{i}...");
} }
Console.WriteLine($"\n=== СТАРТ ДУЭЛИ: {name} (HP: {hp}) VS {enemyName} (HP: {enemyHp}) ===\n");
while (hp > 0 && enemyHP > 0) while (hp > 0 && enemyHp > 0)
{ {
Console.WriteLine($"--- Раунд {roundNumber} ---"); Console.WriteLine($"--- Раунд {roundNumber} ---");
int actionChoice;
do do
{ {
@@ -53,20 +71,102 @@ public class Programm
actionChoice = int.Parse(Console.ReadLine()); actionChoice = int.Parse(Console.ReadLine());
} while (actionChoice != 1 && actionChoice != 2); } while (actionChoice != 1 && actionChoice != 2);
int playerDamage = 0;
if (actionChoice == 1)
{
Console.Write($"[{attack1Name}] Проверка условия спецэффекта (1 - Сработал, 0 - Нет): ");
int effectChoice = int.Parse(Console.ReadLine());
playerDamage = attack1BaseDamage;
if (effectChoice == 1)
{
isEnemyDebuffed = true;
Console.WriteLine($"Результат: Спецэффект сработал! {enemyName} потерял возможность атаковать!");
}
else
{
Console.WriteLine("Результат: Спецэффект не сработал.");
}
}
else if (actionChoice == 2)
{
Console.Write($"[{attack2Name}] Проверка условия спецэффекта (1 - Критический урон, 0 - Обычный): ");
int bonusChoice = int.Parse(Console.ReadLine());
if (bonusChoice == 1)
{
playerDamage = attack2BaseDamage + 10;
Console.WriteLine($"Результат: Условие выполнено! Нанесен усиленный урон: {playerDamage}");
}
else
{
playerDamage = attack2BaseDamage;
Console.WriteLine($"Результат: Базовый урон: {playerDamage}");
}
} }
enemyHp -= playerDamage;
if (enemyHp <= 0)
{
enemyHp = 0;
Console.WriteLine($"{enemyName} нокаутирован!");
break;
} }
if (isEnemyDebuffed)
{
Console.WriteLine($"{enemyName} пропускает ход из-за эффекта атаки!");
isEnemyDebuffed = false;
}
else
{
Console.Write("Выберите тип атаки противника (1 - Уязвимость, 2 - Устойчивость, 3 - Обычный): ");
int enemyAttackType = int.Parse(Console.ReadLine());
int finalIncomingDamage = 0;
switch (enemyAttackType)
{
case 1:
finalIncomingDamage = enemyBaseDamage * 2;
Console.WriteLine($"Расчёт: Уязвимость ({weakness})! Урон удваивается (x2).");
break;
case 2:
finalIncomingDamage = enemyBaseDamage - 20;
if (finalIncomingDamage < 0)
{
finalIncomingDamage = 0;
}
Console.WriteLine($"Расчёт: Устойчивость ({resistance})! Урон уменьшается на 20.");
break;
case 3:
finalIncomingDamage = enemyBaseDamage;
Console.WriteLine("Расчёт: Обычный тип! Урон наносится без изменений.");
break;
}
hp -= finalIncomingDamage;
}
if (hp <= 0)
{
hp = 0;
Console.WriteLine($"{name} нокаутирован!");
break;
}
Console.WriteLine($"Итог раунда: {name} HP: {hp} | {enemyName} HP: {enemyHp}\n");
roundNumber++;
}
Console.WriteLine("\n======================================================================");
Console.WriteLine("=== ДУЭЛЬ ОКОНЧЕНА ===");
if (hp > 0)
{
Console.WriteLine($"Победитель: {name}!");
}
else
{
Console.WriteLine($"Победитель: {enemyName}!");
}
Console.WriteLine("======================================================================");
}
} }