generated from admin/template
Выполнена Стадия 3
This commit is contained in:
@@ -10,3 +10,4 @@
|
|||||||
|
|
||||||
* [Стадия №1](./works/stage-01)
|
* [Стадия №1](./works/stage-01)
|
||||||
* [Стадия №2](./works/stage-02)
|
* [Стадия №2](./works/stage-02)
|
||||||
|
* [Стадия №3](./works/stage-03)
|
||||||
@@ -17,7 +17,7 @@ for (int i = 0; i < 3; i++)
|
|||||||
activeTeam[i] = Console.ReadLine();
|
activeTeam[i] = Console.ReadLine();
|
||||||
}
|
}
|
||||||
Console.WriteLine("\n--- Ваша команда на этот бой ---");
|
Console.WriteLine("\n--- Ваша команда на этот бой ---");
|
||||||
Console.WriteLine($"1. {activeTeam[0]}\n2. {activeTeam[1]}\n3. {activeTeam[0]}\n");
|
Console.WriteLine($"1. {activeTeam[0]}\n2. {activeTeam[1]}\n3. {activeTeam[2]}\n");
|
||||||
|
|
||||||
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||||
List<string> backpack = new List<string>();
|
List<string> backpack = new List<string>();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ for (int i = 0; i < 3; i++)
|
|||||||
activeTeam[i] = Console.ReadLine();
|
activeTeam[i] = Console.ReadLine();
|
||||||
}
|
}
|
||||||
Console.WriteLine("\n--- Ваша команда на этот бой ---");
|
Console.WriteLine("\n--- Ваша команда на этот бой ---");
|
||||||
Console.WriteLine($"1. {activeTeam[0]}\n2. {activeTeam[1]}\n3. {activeTeam[0]}\n");
|
Console.WriteLine($"1. {activeTeam[0]}\n2. {activeTeam[1]}\n3. {activeTeam[2]}\n");
|
||||||
|
|
||||||
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||||
List<string> backpack = new List<string>();
|
List<string> backpack = new List<string>();
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
+144
-9
@@ -1,24 +1,159 @@
|
|||||||
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("Введите текущие очки здоровья:");
|
|
||||||
int hp = int.Parse(Console.ReadLine());
|
|
||||||
Console.Write("Введите название 1-й атаки: ");
|
Console.Write("Введите название 1-й атаки: ");
|
||||||
string attack1Name = Console.ReadLine();
|
string attack1Name = Console.ReadLine();
|
||||||
Console.Write("Введите описание 1-й атаки и ее условия:");
|
Console.Write("Введите эффект 1-й атаки: ");
|
||||||
string attack1Desc = Console.ReadLine();
|
string attack1Desc = Console.ReadLine();
|
||||||
Console.Write("Введите базовый урон 1-й атаки: ");
|
Console.Write("Введите базовый урон 1-й атаки: ");
|
||||||
int attack1BaseDamage = int.Parse(Console.ReadLine());
|
int attack1BaseDamage = int.Parse(Console.ReadLine());
|
||||||
Console.Write("Введите название 2-й атаки: ");
|
Console.Write("Введите название 2-й атаки: ");
|
||||||
string attack2Name = Console.ReadLine();
|
string attack2Name = Console.ReadLine();
|
||||||
Console.Write("Введите описание 2-й атаки и ее условия:");
|
Console.Write("Введите эффект 2-й атаки: ");
|
||||||
string attack2Desc = Console.ReadLine();
|
string attack2Desc = Console.ReadLine();
|
||||||
Console.Write("Введите базовый урон 2-й атаки: ");
|
Console.Write("Введите базовый урон 2-й атаки: ");
|
||||||
int attack2BaseDamage = int.Parse(Console.ReadLine());
|
int attack2BaseDamage = int.Parse(Console.ReadLine());
|
||||||
Console.Write("Введите тип уязвимости:");
|
Console.Write("Введите уязвимость: ");
|
||||||
string weakness = Console.ReadLine();
|
string weakness = Console.ReadLine();
|
||||||
Console.Write("Введите тип устойчивости:");
|
Console.Write("Введите устойчивость: ");
|
||||||
string resistance = Console.ReadLine();
|
string resistance = Console.ReadLine();
|
||||||
|
Console.Write("Введите текущее HP: ");
|
||||||
|
int hp = int.Parse(Console.ReadLine());
|
||||||
|
|
||||||
|
string enemyName = ("Булбазавр");
|
||||||
|
int enemyHp = 70;
|
||||||
|
int enemyBaseDamage = 20;
|
||||||
|
int roundNumber = 1;
|
||||||
|
int actionChoice, attackChoice;
|
||||||
|
bool isEnemyDebuffed = false;
|
||||||
|
|
||||||
|
Console.Clear();
|
||||||
|
|
||||||
|
Console.WriteLine("\n======================================================================");
|
||||||
|
Console.WriteLine($"[{stage}] {name} ОЖ: {hp}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"Вид: {category}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"[Атака 1] {attack1Name} Урон: {attack1BaseDamage}");
|
||||||
|
Console.WriteLine($"Эффект: {attack1Desc}");
|
||||||
|
Console.WriteLine($"\n[Атака 2] {attack2Name} Урон: {attack2BaseDamage}+");
|
||||||
|
Console.WriteLine($"Эффект: {attack2Desc}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"Слабость: {weakness} | Устойчивость: {resistance}");
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
|
||||||
|
Console.WriteLine("\nПриготовьтесь к дуэли!");
|
||||||
|
for (int i = 3; i > 0; i--)
|
||||||
|
{
|
||||||
|
Console.WriteLine(i + "...");
|
||||||
|
}
|
||||||
|
Console.WriteLine($"\n=== СТАРТ ДУЭЛИ: {name} (HP: {hp}) VS {enemyName} (HP: {enemyHp}) ===");
|
||||||
|
|
||||||
|
while (hp > 0 && enemyHp > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"\n--- Раунд {roundNumber} ---");
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write("Выберите действие (1 - Угольки, 2 - Огненный Клык): ");
|
||||||
|
attackChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (attackChoice != 1 && attackChoice != 2);
|
||||||
|
|
||||||
|
if (attackChoice == 1)
|
||||||
|
{
|
||||||
|
enemyHp -= attack1BaseDamage;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write($"[{attack1Name}] Проверка условия спецэффекта (1 - Сработал, 0 - Нет): ");
|
||||||
|
actionChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (actionChoice != 0 && actionChoice != 1);
|
||||||
|
|
||||||
|
if (actionChoice == 0)
|
||||||
|
Console.WriteLine("Результат: Спецэффект не сработал.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isEnemyDebuffed = true;
|
||||||
|
Console.WriteLine($"Результат: Спецэффект сработал! {enemyName} потерял возможность атаковать!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"\n{enemyName} пропускает ход из-за эффекта атаки!");
|
||||||
|
isEnemyDebuffed = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write($"\nВыберите тип атаки противника (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:
|
||||||
|
hp -= (enemyBaseDamage - 20);
|
||||||
|
Console.WriteLine($"Расчёт: Устойчивость ({resistance})! Урон уменьшается на 20.");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
hp -= enemyBaseDamage;
|
||||||
|
Console.WriteLine("Расчёт: Обычный тип! Урон наносится без изменений.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hp <= 0)
|
||||||
|
{
|
||||||
|
hp = 0;
|
||||||
|
Console.WriteLine($"{name} нокаутирован!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Итог раунда: {name} HP: {hp} | {enemyName} HP: {enemyHp}");
|
||||||
|
roundNumber++;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("\n======================================================================");
|
||||||
|
Console.WriteLine("=== ДУЭЛЬ ОКОНЧЕНА ===");
|
||||||
|
if (hp == 0)
|
||||||
|
Console.WriteLine($"Победитель: {enemyName}!");
|
||||||
|
else
|
||||||
|
Console.WriteLine($"Победитель: {name}!");
|
||||||
|
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
# Stage №3
|
||||||
|
|
||||||
|
* **Студент:** Прибыткова Елизавета Дмитриевна
|
||||||
|
* **Техническое задание:** Универсальный игровой цикл дуэли Pokémon TCG (Абстрактная модель)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ключевой код
|
||||||
|
```csharp
|
||||||
|
// Самая важная часть реализации (методы, структуры, логика)
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
Console.WriteLine("ИНИЦИАЛИЗАЦИЯ КАРТОЧКИ ПОКЕМОНА");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.Write("Введите стадию развития: ");
|
||||||
|
string stage = Console.ReadLine();
|
||||||
|
Console.Write("Введите имя покемона: ");
|
||||||
|
string name = Console.ReadLine();
|
||||||
|
Console.Write("Введите вид покемона: ");
|
||||||
|
string category = Console.ReadLine();
|
||||||
|
Console.Write("Введите название 1-й атаки: ");
|
||||||
|
string attack1Name = Console.ReadLine();
|
||||||
|
Console.Write("Введите эффект 1-й атаки: ");
|
||||||
|
string attack1Desc = Console.ReadLine();
|
||||||
|
Console.Write("Введите базовый урон 1-й атаки: ");
|
||||||
|
int attack1BaseDamage = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("Введите название 2-й атаки: ");
|
||||||
|
string attack2Name = Console.ReadLine();
|
||||||
|
Console.Write("Введите эффект 2-й атаки: ");
|
||||||
|
string attack2Desc = Console.ReadLine();
|
||||||
|
Console.Write("Введите базовый урон 2-й атаки: ");
|
||||||
|
int attack2BaseDamage = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("Введите уязвимость: ");
|
||||||
|
string weakness = Console.ReadLine();
|
||||||
|
Console.Write("Введите устойчивость: ");
|
||||||
|
string resistance = Console.ReadLine();
|
||||||
|
Console.Write("Введите текущее HP: ");
|
||||||
|
int hp = int.Parse(Console.ReadLine());
|
||||||
|
|
||||||
|
string enemyName = ("Булбазавр");
|
||||||
|
int enemyHp = 70;
|
||||||
|
int enemyBaseDamage = 20;
|
||||||
|
int roundNumber = 1;
|
||||||
|
int actionChoice, attackChoice;
|
||||||
|
bool isEnemyDebuffed = false;
|
||||||
|
|
||||||
|
Console.Clear();
|
||||||
|
|
||||||
|
Console.WriteLine("\n======================================================================");
|
||||||
|
Console.WriteLine($"[{stage}] {name} ОЖ: {hp}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"Вид: {category}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"[Атака 1] {attack1Name} Урон: {attack1BaseDamage}");
|
||||||
|
Console.WriteLine($"Эффект: {attack1Desc}");
|
||||||
|
Console.WriteLine($"\n[Атака 2] {attack2Name} Урон: {attack2BaseDamage}+");
|
||||||
|
Console.WriteLine($"Эффект: {attack2Desc}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"Слабость: {weakness} | Устойчивость: {resistance}");
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
|
||||||
|
Console.WriteLine("\nПриготовьтесь к дуэли!");
|
||||||
|
for (int i = 3; i > 0; i--)
|
||||||
|
{
|
||||||
|
Console.WriteLine(i + "...");
|
||||||
|
}
|
||||||
|
Console.WriteLine($"\n=== СТАРТ ДУЭЛИ: {name} (HP: {hp}) VS {enemyName} (HP: {enemyHp}) ===");
|
||||||
|
|
||||||
|
while (hp > 0 && enemyHp > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"\n--- Раунд {roundNumber} ---");
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write("Выберите действие (1 - Угольки, 2 - Огненный Клык): ");
|
||||||
|
attackChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (attackChoice != 1 && attackChoice != 2);
|
||||||
|
|
||||||
|
if (attackChoice == 1)
|
||||||
|
{
|
||||||
|
enemyHp -= attack1BaseDamage;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write($"[{attack1Name}] Проверка условия спецэффекта (1 - Сработал, 0 - Нет): ");
|
||||||
|
actionChoice = int.Parse(Console.ReadLine());
|
||||||
|
} while (actionChoice != 0 && actionChoice != 1);
|
||||||
|
|
||||||
|
if (actionChoice == 0)
|
||||||
|
Console.WriteLine("Результат: Спецэффект не сработал.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isEnemyDebuffed = true;
|
||||||
|
Console.WriteLine($"Результат: Спецэффект сработал! {enemyName} потерял возможность атаковать!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"\n{enemyName} пропускает ход из-за эффекта атаки!");
|
||||||
|
isEnemyDebuffed = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write($"\nВыберите тип атаки противника (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:
|
||||||
|
hp -= (enemyBaseDamage - 20);
|
||||||
|
Console.WriteLine($"Расчёт: Устойчивость ({resistance})! Урон уменьшается на 20.");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
hp -= enemyBaseDamage;
|
||||||
|
Console.WriteLine("Расчёт: Обычный тип! Урон наносится без изменений.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hp <= 0)
|
||||||
|
{
|
||||||
|
hp = 0;
|
||||||
|
Console.WriteLine($"{name} нокаутирован!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Итог раунда: {name} HP: {hp} | {enemyName} HP: {enemyHp}");
|
||||||
|
roundNumber++;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("\n======================================================================");
|
||||||
|
Console.WriteLine("=== ДУЭЛЬ ОКОНЧЕНА ===");
|
||||||
|
if (hp == 0)
|
||||||
|
Console.WriteLine($"Победитель: {enemyName}!");
|
||||||
|
else
|
||||||
|
Console.WriteLine($"Победитель: {name}!");
|
||||||
|
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -8,4 +8,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="screenshots\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user