generated from admin/template
stage3
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
namespace stage3
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace stage3
|
||||||
{
|
{
|
||||||
class stage3
|
class stage3
|
||||||
{
|
{
|
||||||
@@ -14,37 +16,41 @@
|
|||||||
Console.WriteLine("Введите вид покемона: ");
|
Console.WriteLine("Введите вид покемона: ");
|
||||||
string category = Console.ReadLine();
|
string category = Console.ReadLine();
|
||||||
Console.WriteLine("Введите название 1-й атаки: ");
|
Console.WriteLine("Введите название 1-й атаки: ");
|
||||||
string attack1Name = Console.ReadLine();
|
string attack1Name = Console.ReadLine();
|
||||||
Console.WriteLine("Введите эффект 1-й атаки: ");
|
Console.WriteLine("Введите эффект 1-й атаки: ");
|
||||||
string attack1Desc = Console.ReadLine();
|
string attack1Desc = Console.ReadLine();
|
||||||
Console.WriteLine("Введите базовый урон 1-й атаки:");
|
Console.WriteLine("Введите базовый урон 1-й атаки:");
|
||||||
int attack1BaseDamage = int.Parse(Console.ReadLine());
|
int attack1BaseDamage = int.Parse(Console.ReadLine());
|
||||||
Console.WriteLine("Введите название 2-й атаки: ");
|
Console.WriteLine("Введите название 2-й атаки: ");
|
||||||
string attack2Name = Console.ReadLine();
|
string attack2Name = Console.ReadLine();
|
||||||
Console.WriteLine("Введите эффект 2-й атаки: ");
|
Console.WriteLine("Введите эффект 2-й атаки: ");
|
||||||
string attack2Desc = Console.ReadLine();
|
string attack2Desc = Console.ReadLine();
|
||||||
Console.WriteLine("Введите базовый урон 2-й атаки: ");
|
Console.WriteLine("Введите базовый урон 2-й атаки: ");
|
||||||
int attack2BaseDamage = int.Parse(Console.ReadLine());
|
int attack2BaseDamage = int.Parse(Console.ReadLine());
|
||||||
Console.WriteLine("Введите уязвимость: ");
|
Console.WriteLine("Введите уязвимость: ");
|
||||||
string weakness = Console.ReadLine();
|
string weakness = Console.ReadLine();
|
||||||
Console.WriteLine("Введите устойчивость: ");
|
Console.WriteLine("Введите устойчивость: ");
|
||||||
string resistance = Console.ReadLine();
|
string resistance = Console.ReadLine();
|
||||||
Console.WriteLine("Введите текущее HP: ");
|
Console.WriteLine("Введите текущее HP: ");
|
||||||
int hp = int.Parse(Console.ReadLine());
|
int hp = int.Parse(Console.ReadLine());
|
||||||
|
|
||||||
string enemyName = "Булбазавр";
|
string enemyName = "Булбазавр";
|
||||||
int enemyHp = 70 ;
|
int enemyHp = 70;
|
||||||
int enemyBaseDamage = 15 ;
|
int enemyBaseDamage = 15;
|
||||||
int roundNumber = 20 ;
|
int roundNumber = 1;
|
||||||
int actionChoice = 1 ;
|
int actionChoice;
|
||||||
bool isEnemyDebuffed = true;
|
int attackChoice;
|
||||||
|
bool isEnemyDebuffed = false;
|
||||||
|
Console.Clear();
|
||||||
Console.WriteLine(" ");
|
Console.WriteLine(" ");
|
||||||
Console.WriteLine(" ");
|
Console.WriteLine(" ");
|
||||||
Console.WriteLine("======================================================================");
|
Console.WriteLine("======================================================================");
|
||||||
Console.WriteLine($"[{stage}] Чармандер ОЖ: {enemyHp}");
|
Console.WriteLine($"[{stage}] Чармандер ОЖ: {hp}");
|
||||||
Console.WriteLine("----------------------------------------------------------------------");
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
Console.WriteLine($"Вид: {category}");
|
Console.WriteLine($"Вид: {category}");
|
||||||
Console.WriteLine($"[Атака 1] {attack1Name} Урон: {attack1BaseDamage}");
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine(
|
||||||
|
$"[Атака 1] {attack1Name} Урон: {attack1BaseDamage}");
|
||||||
Console.WriteLine($"Эффект: {attack1Desc}");
|
Console.WriteLine($"Эффект: {attack1Desc}");
|
||||||
Console.WriteLine(" ");
|
Console.WriteLine(" ");
|
||||||
Console.WriteLine($"[Атака 2] {attack2Name} Урон: {attack2BaseDamage}+");
|
Console.WriteLine($"[Атака 2] {attack2Name} Урон: {attack2BaseDamage}+");
|
||||||
@@ -53,63 +59,127 @@
|
|||||||
Console.WriteLine($"Слабость: {weakness} | Устойчивость: {resistance}");
|
Console.WriteLine($"Слабость: {weakness} | Устойчивость: {resistance}");
|
||||||
Console.WriteLine("======================================================================");
|
Console.WriteLine("======================================================================");
|
||||||
Console.WriteLine(" ");
|
Console.WriteLine(" ");
|
||||||
|
|
||||||
Console.WriteLine("Приготовьтесь к дуэли!");
|
Console.WriteLine("Приготовьтесь к дуэли!");
|
||||||
for (int i = 3; i > 0 ; i--)
|
for (int i = 3; i > 0; i--)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{i}...");
|
Console.WriteLine($"{i}...");
|
||||||
}
|
}
|
||||||
Console.WriteLine($"=== СТАРТ ДУЭЛИ: {name} (HP: {hp}) VS {enemyName } (HP: {enemyHp}) ===\n");
|
|
||||||
|
Console.WriteLine($"=== СТАРТ ДУЭЛИ: {name} (HP: {hp}) VS {enemyName} (HP: {enemyHp}) ===\n");
|
||||||
|
|
||||||
while (hp > 0 && enemyHp > 0)
|
while (hp > 0 && enemyHp > 0)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"--- Раунд {roundNumber} ---");
|
Console.WriteLine($"--- Раунд {roundNumber} ---");
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write("Выберите действие (1 - Угольки, 2 - Огненный Клык): ");
|
||||||
|
attackChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (attackChoice != 1 && attackChoice != 2);
|
||||||
|
|
||||||
int choice;
|
roundNumber++;
|
||||||
|
|
||||||
do
|
if (attackChoice == 1)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Выберите атаку: 1 — {attack1Name}, 2 — {attack2Name}");
|
enemyHp -= attack1BaseDamage;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write($"[{attack1Name}] Проверка условия спецэффекта (1 - Сработал, 0 - Нет): ");
|
||||||
|
actionChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (actionChoice != 0 && actionChoice != 1);
|
||||||
|
|
||||||
if (choice == 1 || choice == 2)
|
if (actionChoice == 0)
|
||||||
{
|
Console.WriteLine("Результат: Спецэффект не сработал.");
|
||||||
break;
|
else
|
||||||
}
|
{
|
||||||
else
|
isEnemyDebuffed = true;
|
||||||
{
|
Console.WriteLine(
|
||||||
Console.WriteLine("Неверный ввод. Введите 1 или 2.");
|
$"Результат: Спецэффект сработал! {enemyName} потерял возможность атаковать!");
|
||||||
}
|
}
|
||||||
} while (true);
|
}
|
||||||
|
else
|
||||||
Console.WriteLine("Вы выбрали: " + choice);
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write(
|
||||||
|
$"[{attack2Name}] Проверка условия спецэффекта (1 - Критический урон, 0 - Обычный): ");
|
||||||
|
actionChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (actionChoice != 0 && actionChoice != 1);
|
||||||
|
|
||||||
|
if (actionChoice == 0)
|
||||||
|
{
|
||||||
|
enemyHp -= attack2BaseDamage;
|
||||||
|
Console.WriteLine("Результат: Базовый урон: " + attack2BaseDamage);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enemyHp -= (attack2BaseDamage + 10);
|
||||||
|
Console.WriteLine("Результат: Условие выполнено! Нанесен усиленный урон: " +
|
||||||
|
(attack2BaseDamage + 10));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enemyHp <= 0)
|
||||||
|
{
|
||||||
|
enemyHp = 0;
|
||||||
|
Console.WriteLine($"{enemyName} нокаутирован!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (isEnemyDebuffed == true)
|
if (isEnemyDebuffed == true)
|
||||||
{
|
{
|
||||||
Console.WriteLine($" {enemyName} пропускает ход из-за эффекта атаки!");
|
Console.WriteLine($"\n{enemyName} пропускает ход из-за эффекта атаки!");
|
||||||
|
isEnemyDebuffed = false;
|
||||||
}
|
}
|
||||||
else Console.WriteLine();
|
else
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write(
|
||||||
|
$"Выберите тип атаки противника (1 - Уязвимость, 2 - Устойчивость, 3 - Обычный): ");
|
||||||
|
actionChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (actionChoice != 1 && actionChoice != 2 && actionChoice != 3);
|
||||||
|
|
||||||
|
switch (actionChoice)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
hp -= (enemyBaseDamage * 2);
|
||||||
|
Console.WriteLine($"Расчёт: Уязвимость ({weakness})! Урон удваивается (x2).");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (enemyBaseDamage < 20)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Расчёт: Устойчивость ({resistance})! Урон уменьшается на 0.");
|
||||||
|
}
|
||||||
|
else hp -= (enemyBaseDamage - 20);
|
||||||
|
|
||||||
|
Console.WriteLine($"Расчёт: Устойчивость ({resistance})! Урон уменьшается на 20.");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
hp -= enemyBaseDamage;
|
||||||
|
Console.WriteLine("Расчёт: Обычный тип! Урон наносится без изменений.");
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
roundNumber++;
|
|
||||||
|
|
||||||
|
|
||||||
Console.WriteLine("----------------------------------------------------------------------");
|
|
||||||
Console.WriteLine("----------------------------------------------------------------------");
|
|
||||||
Console.WriteLine("======================================================================");
|
|
||||||
Console.WriteLine("=== ДУЭЛЬ ОКОНЧЕНА ===");
|
Console.WriteLine("=== ДУЭЛЬ ОКОНЧЕНА ===");
|
||||||
if (hp > enemyHp)
|
if (hp > enemyHp)
|
||||||
{
|
{
|
||||||
Console.WriteLine("$\"Победитель: {name}!\"");
|
Console.WriteLine("$Победитель: {name}!");
|
||||||
|
}
|
||||||
|
else Console.WriteLine($"Победитель: {enemyName}!");
|
||||||
|
|
||||||
|
Console.WriteLine($"Победитель: ");
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else Console.WriteLine($"Победитель: {enemyName}!");
|
|
||||||
|
|
||||||
Console.WriteLine($"Победитель: ");
|
|
||||||
Console.WriteLine("======================================================================");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user