generated from admin/template
First commit
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
# Студент: Березницкий Ярослав Станиславович
|
# Студент: Русаловская Диана Владимировна
|
||||||
* **Группа:** 328
|
* **Группа:** 328
|
||||||
* **Курс:** Csharp
|
* **Курс:** Разработка программных модулей
|
||||||
|
|
||||||
## Список работ
|
## Список работ
|
||||||
* [Лабораторная работа №1](./works/lab-01)
|
* [Лабораторная работа №1](./works/lab-01)
|
||||||
* [Лабораторная работа №2](./works/lab-02)
|
* [Лабораторная работа №2](./works/lab-02)
|
||||||
|
|
||||||
|
|||||||
+82
-10
@@ -1,15 +1,87 @@
|
|||||||
# Лабораторная работа №1
|
# Тема: Введение в язык C#. Переменные, базовые типы данных и консольный ввод/вывод информации
|
||||||
|
|
||||||
* **Студент:** [ФИО]
|
|
||||||
* **Вариант / Карточка:** [Например: #025 Pikachu]
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Ключевой код
|
## Ключевой код
|
||||||
```csharp
|
```csharp
|
||||||
// Самая важная часть реализации (методы, структуры, логика)
|
// Задание 1. Объявление переменных и статический вывод данных
|
||||||
public class Card
|
using System;
|
||||||
|
|
||||||
|
class Program {
|
||||||
|
static void Main() {
|
||||||
|
string pokemonName ="Charmander";
|
||||||
|
string elementType = "Fire";
|
||||||
|
int level = 1;
|
||||||
|
int hp = 95;
|
||||||
|
Console.WriteLine($"===Database== \n Pokemon: {pokemonName} \n Element: {elementType} \n Level: {level}| HP: {hp}");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Задание 2. Интерактивный ввод и динамическое формирование документов
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class Test
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public static void Main()
|
||||||
public int Hp { get; set; }
|
{
|
||||||
|
Console.Write("Введите имя тренера: ");
|
||||||
|
string trainerName = Console.ReadLine() ;
|
||||||
|
Console.Write("Введите имя покемона: ");
|
||||||
|
string pokemonName = Console.ReadLine();
|
||||||
|
Console.Write("Введите стихию: ");
|
||||||
|
string elementType = Console.ReadLine();
|
||||||
|
Console.Write("Введите регион: ");
|
||||||
|
string regionName = Console.ReadLine();
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine($"****************************************\n " +
|
||||||
|
$"ПАСПОРТ ПОКЕМОНА \n Тренер: {trainerName} (Регион: {regionName})\n " +
|
||||||
|
$"Покемон: {pokemonName} [ Стихия: {elementType}] \n" +
|
||||||
|
$"**************************************** ");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Техническое задание: Оцифровка карточки Pokémon TCG
|
||||||
|
namespace stage1;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.Write("стадия развития: ");
|
||||||
|
string stage = Console.ReadLine();
|
||||||
|
Console.Write("имя покемона: ");
|
||||||
|
string name = Console.ReadLine();
|
||||||
|
Console.Write("вид покемона: ");
|
||||||
|
string category = Console.ReadLine();
|
||||||
|
Console.Write("название первой атаки: ");
|
||||||
|
string attack1Name = Console.ReadLine();
|
||||||
|
Console.Write("эффект первой атаки: ");
|
||||||
|
string attack1Desc = Console.ReadLine();
|
||||||
|
Console.Write("название второй атаки: ");
|
||||||
|
string attack2Name = Console.ReadLine();
|
||||||
|
Console.Write("эффект второй атаки: ");
|
||||||
|
string attack2Desc = Console.ReadLine();
|
||||||
|
Console.Write("уязвимость: ");
|
||||||
|
string weakness = Console.ReadLine();
|
||||||
|
Console.Write("устойчивость: ");
|
||||||
|
string resistance = Console.ReadLine();
|
||||||
|
|
||||||
|
int hp = 60;
|
||||||
|
int number = 25;
|
||||||
|
double height = 0.4;
|
||||||
|
double weight = 6.0;
|
||||||
|
int attack2Damage = 20;
|
||||||
|
int retreatCost = 1;
|
||||||
|
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine($"====================================================================== \n [{stage}] {name,-42} ОЖ: {hp} [⚡] \n " +
|
||||||
|
$"---------------------------------------------------------------------- \n" +
|
||||||
|
$" № {number} | Вид: {category} | Рост: {height} м | Вес: {weight} кг \n" +
|
||||||
|
$"---------------------------------------------------------------------- \n " +
|
||||||
|
$"[Атака 1] {attack1Name} \n Эффект: {attack1Desc} \n \n" +
|
||||||
|
$"[Атака 2] {attack2Name,-42} Урон: {attack2Damage} \n Эффект: {attack2Desc} \n " +
|
||||||
|
$"---------------------------------------------------------------------- \n" +
|
||||||
|
$"Слабость: {weakness} \n Устойчивость: {resistance} \n Отступление: {retreatCost} \n" +
|
||||||
|
$"======================================================================");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
class Program {
|
||||||
|
static void Main() {
|
||||||
|
string pokemonName ="Charmander";
|
||||||
|
string elementType = "Fire";
|
||||||
|
int level = 1;
|
||||||
|
int hp = 95;
|
||||||
|
Console.WriteLine($"===Database== \n Pokemon: {pokemonName} \n Element: {elementType} \n Level: {level}| HP: {hp}");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class Test
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Console.Write("Введите имя тренера:\n");
|
||||||
|
string trainerName = Console.ReadLine() ;
|
||||||
|
Console.Write("Введите имя покемона:\n");
|
||||||
|
string pokemonName = Console.ReadLine();
|
||||||
|
Console.Write("Введите стихию:\n");
|
||||||
|
string elementType = Console.ReadLine();
|
||||||
|
Console.Write("Введите регион:\n");
|
||||||
|
string regionName = Console.ReadLine();
|
||||||
|
Console.WriteLine($"****************************************\n ПАСПОРТ ПОКЕМОНА \n Тренер: {trainerName} (Регион: {regionName})\n Покемон: {pokemonName} [ Стихия: {elementType}] \n**************************************** ");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<Properties>
|
||||||
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
<BreakpointStore />
|
||||||
|
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||||
|
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||||
|
<MonoDevelop.Ide.Workbench ActiveDocument="stage1/Program.cs">
|
||||||
|
<Files>
|
||||||
|
<File FileName="stage1/Program.cs" Line="1" Column="1" />
|
||||||
|
</Files>
|
||||||
|
<Pads>
|
||||||
|
<Pad Id="ProjectPad">
|
||||||
|
<State name="__root__">
|
||||||
|
<Node name="stage1" expanded="True">
|
||||||
|
<Node name="stage1" expanded="True">
|
||||||
|
<Node name="Program.cs" selected="True" />
|
||||||
|
</Node>
|
||||||
|
</Node>
|
||||||
|
</State>
|
||||||
|
</Pad>
|
||||||
|
</Pads>
|
||||||
|
</MonoDevelop.Ide.Workbench>
|
||||||
|
<MultiItemStartupConfigurations />
|
||||||
|
</Properties>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"Format":1,"ProjectReferences":[],"MetadataReferences":[],"Files":["/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/Program.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.GlobalUsings.g.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs","/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.AssemblyInfo.cs"],"BuildActions":["Compile","Compile","Compile","Compile","Compile","Compile","Compile"],"Analyzers":["/usr/local/share/dotnet/sdk/7.0.317/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll","/usr/local/share/dotnet/sdk/7.0.317/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll"],"AdditionalFiles":[],"EditorConfigFiles":["/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.GeneratedMSBuildEditorConfig.editorconfig"],"DefineConstants":["TRACE","DEBUG","NET","NET10_0","NETCOREAPP","NET5_0_OR_GREATER","NET6_0_OR_GREATER","NET7_0_OR_GREATER","NETCOREAPP1_0_OR_GREATER","NETCOREAPP1_1_OR_GREATER","NETCOREAPP2_0_OR_GREATER","NETCOREAPP2_1_OR_GREATER","NETCOREAPP2_2_OR_GREATER","NETCOREAPP3_0_OR_GREATER","NETCOREAPP3_1_OR_GREATER"],"IntermediateAssembly":"/Users/free/Desktop/labs/charp01/works/lab-01/stage1/stage1/obj/Debug/net10.0/stage1.dll"}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stage1", "stage1\stage1.csproj", "{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DE0CB194-B073-4AE3-97D0-1DF92131C4D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
namespace stage1;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.Write("стадия развития: \n ");
|
||||||
|
string stage = Console.ReadLine();
|
||||||
|
Console.Write("имя покемона: \n ");
|
||||||
|
string name = Console.ReadLine();
|
||||||
|
Console.Write("вид покемона: \n ");
|
||||||
|
string category = Console.ReadLine();
|
||||||
|
Console.Write("название первой атаки: \n ");
|
||||||
|
string attack1Name = Console.ReadLine();
|
||||||
|
Console.Write("эффект первой атаки: \n ");
|
||||||
|
string attack1Desc = Console.ReadLine();
|
||||||
|
Console.Write("название второй атаки: \n ");
|
||||||
|
string attack2Name = Console.ReadLine();
|
||||||
|
Console.Write("эффект второй атаки: \n ");
|
||||||
|
string attack2Desc = Console.ReadLine();
|
||||||
|
Console.Write("уязвимость: \n ");
|
||||||
|
string wekness = Console.ReadLine();
|
||||||
|
Console.Write("устойчивость: \n ");
|
||||||
|
string resistsnce = Console.ReadLine();
|
||||||
|
|
||||||
|
int hp = 60;
|
||||||
|
int number = 25;
|
||||||
|
double height = 0.4;
|
||||||
|
double weight = 6.0;
|
||||||
|
int attack2Damage = 20;
|
||||||
|
int retreatCost = 1;
|
||||||
|
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine($"====================================================================== \n [{stage}] {name,-42} ОЖ: {hp} [⚡] \n " +
|
||||||
|
$"---------------------------------------------------------------------- \n" +
|
||||||
|
$" № {number} | Вид: {category} | Рост: {height} м | Вес: {weight} кг \n" +
|
||||||
|
$"---------------------------------------------------------------------- \n " +
|
||||||
|
$"[Атака 1] {attack1Name} \n Эффект: {attack1Desc} \n \n" +
|
||||||
|
$"[Атака 2] {attack2Name,-42} Урон: {attack2Damage} \n Эффект: {attack2Desc} \n " +
|
||||||
|
$"---------------------------------------------------------------------- \n" +
|
||||||
|
$"Слабость: {wekness} \n Устойчивость: {resistsnce} \n Отступление: {retreatCost} \n" +
|
||||||
|
$"======================================================================");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
# Лабораторная работа №2
|
||||||
|
|
||||||
|
## Ключевой код
|
||||||
|
```csharp
|
||||||
|
// Задание 1.1: Расчёт характеристик покемона при повышении уровня
|
||||||
|
namespace pokemon;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("=== Прокачка покемона ===");
|
||||||
|
Console.Write("введите базовое значение атаки покемона: ");
|
||||||
|
int pokemonAttak = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("введите количество полученных уровней: ");
|
||||||
|
int levels = int.Parse(Console.ReadLine());
|
||||||
|
int finalAttack = pokemonAttak + (levels * 5);
|
||||||
|
Console.WriteLine($"Итоговое значение атаки: {finalAttack}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Задание 1.2: Расчёт стоимости зелий в магазине
|
||||||
|
namespace trener;
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
int openingBalance = 1500;
|
||||||
|
int pricePotion = 200;
|
||||||
|
Console.WriteLine($"Текущий баланс: {openingBalance} монет");
|
||||||
|
Console.Write("Введите количество приобретаемых зелий: ");
|
||||||
|
int potion = int.Parse(Console.ReadLine());
|
||||||
|
if (potion < 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Количество не может быть отрицательным!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int price = pricePotion * potion;
|
||||||
|
int remainder = openingBalance - price;
|
||||||
|
|
||||||
|
if (remainder >= 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Покупка совершена! Оплата: {price} монет");
|
||||||
|
Console.WriteLine($"Остаток средств: {remainder} монет");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Ошибка! Недостаточно средств для покупки!");
|
||||||
|
Console.WriteLine($"Вам не хватает {Math.Abs(remainder)} монет");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Задание 2.1: Проверка состояния покемона в бою (if / else)
|
||||||
|
namespace fight;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.Write("введите текущее количество HP покемона: ");
|
||||||
|
int hp = int.Parse(Console.ReadLine());
|
||||||
|
if (hp <= 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Покемон потерял сознание! Верните его в покебол");
|
||||||
|
}
|
||||||
|
else if (hp >= 1 && hp <= 20)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
|
||||||
|
}
|
||||||
|
else if (hp >= 21 && hp <= 50)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Покемон ранен, будьте осторожны.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
|
||||||
|
{
|
||||||
|
Console.WriteLine("Покемон полон сил и готов к бою!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Задание 2.2: Консольное меню боя (switch)
|
||||||
|
namespace menu;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("МЕНЮ \n 1 — Атака \n 2 — Инвентарь \n 3 — Сменить покемона \n" +
|
||||||
|
" 4 — Побег");
|
||||||
|
int number = int.Parse(Console.ReadLine());
|
||||||
|
switch (number)
|
||||||
|
{
|
||||||
|
case 1 :
|
||||||
|
Console.WriteLine("1: Покемон наносит быстрый удар!");
|
||||||
|
break;
|
||||||
|
case 2 :
|
||||||
|
Console.WriteLine( " 2: Вы открыли сумку и применили Зелье Лечения.");
|
||||||
|
break;
|
||||||
|
case 3 :
|
||||||
|
Console.WriteLine("3: Вы отозвали покемона и выпустили нового!");
|
||||||
|
break;
|
||||||
|
case 4 :
|
||||||
|
Console.WriteLine("4: Вы успешно сбежали из боя!");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Console.WriteLine(" Неизвестная команда! Вы пропустили ход.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Техническое задание: Интерактивная механика карточки Pokémon TCG
|
||||||
|
namespace TCG;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.Write("введите имя покемона : ");
|
||||||
|
string name = Console.ReadLine();
|
||||||
|
Console.Write("введите название первой атаки: ");
|
||||||
|
string attack1Name = Console.ReadLine();
|
||||||
|
Console.Write("введите название второй атаки: ");
|
||||||
|
string attack2Name = Console.ReadLine();
|
||||||
|
Console.WriteLine("====================================================================== \n" +
|
||||||
|
"ИНИЦИАЛИЗА КАРТОЧКИ \n" +
|
||||||
|
"----------------------------------------------------------------------");
|
||||||
|
Console.Write("Введите очки здоровья: ");
|
||||||
|
int hp = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("Введите базовый урон атаки «Быстрая Атака»:");
|
||||||
|
Console.WriteLine();
|
||||||
|
int attack2BaseDamage = int.Parse(Console.ReadLine());
|
||||||
|
Console.WriteLine("---------------------------------------------------------------------- \n" +
|
||||||
|
"ИСПОЛЬЗОВАНИЕ АТАК \n" +
|
||||||
|
"----------------------------------------------------------------------");
|
||||||
|
Console.Write($"[Атака 1: {attack1Name} ]\nБросок монеты (1 - Орёл, 0 - Решка): ");
|
||||||
|
int coin = int.Parse(Console.ReadLine());
|
||||||
|
|
||||||
|
if (coin == 1)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Результат: aктивный Покемон противника парализован!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Результат: Эффект паралича не сработал.");
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.Write($"[Атака 2: {attack2Name}] \nБросок монеты (1 - Орёл, 0 - Решка): ");
|
||||||
|
int coin1 = int.Parse(Console.ReadLine());
|
||||||
|
if (coin1 == 1)
|
||||||
|
{
|
||||||
|
int attack2 = attack2BaseDamage + 10;
|
||||||
|
Console.WriteLine($"Результат: Выпал орёл! Итоговый урон: {attack2}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Результат: Выпала решка! Итоговый урон: {attack2BaseDamage}");
|
||||||
|
}
|
||||||
|
Console.WriteLine();
|
||||||
|
Console.Write("---------------------------------------------------------------------- \n" +
|
||||||
|
"ПОЛУЧЕНИЕ УРОНА \n" +
|
||||||
|
"---------------------------------------------------------------------- \n" +
|
||||||
|
"Введите базовый урон атаки противника: ");
|
||||||
|
int incomingDamage = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("Выберите тип атаки противника (1 - Боевой, 2 - Стальной, 3 - Обычный):");
|
||||||
|
int attackType = int.Parse(Console.ReadLine());
|
||||||
|
int finalIncomingDamag = 0;
|
||||||
|
|
||||||
|
Console.WriteLine();
|
||||||
|
switch (attackType)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
finalIncomingDamag = incomingDamage * 2;
|
||||||
|
Console.WriteLine($"Расчёт: Боевой тип! Урон удваивается (x2). \n " +
|
||||||
|
$"Получено урона: {finalIncomingDamag}");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
finalIncomingDamag = incomingDamage - 20;
|
||||||
|
if (finalIncomingDamag < 0)
|
||||||
|
{
|
||||||
|
finalIncomingDamag = 0;
|
||||||
|
}
|
||||||
|
Console.WriteLine($"Расчёт: Стальной тип! Урон уменьшается на 20 (Resistance: -20).\n"+
|
||||||
|
$"Получено урона: {finalIncomingDamag}");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
Console.WriteLine("Расчёт: Обычный тип! Урон наносится без изменений");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Console.WriteLine("Ошибка: Выбран неизвестный тип атаки!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int damageReceived = hp - finalIncomingDamag;
|
||||||
|
if (damageReceived <= 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Пикачу нокаутирован!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Пикачу выдержал удар! Остаток HP: {damageReceived}");
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user