generated from admin/template
Compare commits
14
Commits
52465c5b3e
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e8c9a742e | ||
|
|
c753e0b8ea | ||
|
|
dcf07ab19c | ||
|
|
6cb82939e0 | ||
|
|
cc51d41fdb | ||
|
|
8936fbdcb2 | ||
|
|
47b21a24ec | ||
|
|
2a06aa5b8c | ||
|
|
224b78ba03 | ||
|
|
26dca4f3e0 | ||
|
|
03191a8a52 | ||
|
|
a49dcc6744 | ||
|
|
3bf313e72b | ||
|
|
b9c82229ac |
@@ -7,6 +7,12 @@
|
|||||||
* [Лабораторная работа №2](./works/lab-02)
|
* [Лабораторная работа №2](./works/lab-02)
|
||||||
* [Лабораторная работа №3](./works/lab-03)
|
* [Лабораторная работа №3](./works/lab-03)
|
||||||
* [Лабораторная работа №4](./works/lab-04)
|
* [Лабораторная работа №4](./works/lab-04)
|
||||||
|
* [Лабораторная работа №5](./works/lab-05)
|
||||||
|
* [Лабораторная работа №6](./works/lab-06)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
* [Техническое заданеи №1](./works/stage-01)
|
* [Техническое заданеи №1](./works/stage-01)
|
||||||
* [Техническое заданеи №1](./works/stage-02)
|
* [Техническое заданеи №2](./works/stage-02)
|
||||||
|
* [Техническое заданеи №3](./works/stage-03)
|
||||||
|
* [Техническое заданеи №4](./works/stage-04)
|
||||||
|
|||||||
+23
-6
@@ -1,15 +1,32 @@
|
|||||||
# Лабораторная работа №1
|
# Лабораторная работа №1
|
||||||
|
|
||||||
* **Студент:** [ФИО]
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
* **Вариант / Карточка:** [Например: #025 Pikachu]
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Ключевой код
|
## Ключевой код
|
||||||
```csharp
|
```csharp
|
||||||
// Самая важная часть реализации (методы, структуры, логика)
|
namespace DefaultNamespace;
|
||||||
public class Card
|
|
||||||
|
public class main
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
static void Main(string[] args) {
|
||||||
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("****************************************");
|
||||||
|
Console.WriteLine("ПАСПОРТ ПОКЕМОНА");
|
||||||
|
Console.WriteLine($"Тренер: {trainerName} (Регион: {regionName})");
|
||||||
|
Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]");
|
||||||
|
Console.WriteLine("****************************************");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class main
|
||||||
|
{
|
||||||
|
static void Main(string[] args) {
|
||||||
|
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("****************************************");
|
||||||
|
Console.WriteLine("ПАСПОРТ ПОКЕМОНА");
|
||||||
|
Console.WriteLine($"Тренер: {trainerName} (Регион: {regionName})");
|
||||||
|
Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]");
|
||||||
|
Console.WriteLine("****************************************");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Лабораторная работа №1
|
# Лабораторная работа №3
|
||||||
|
|
||||||
* **Студент:** [Мастио Вячеслав Алексеевич]
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Лабораторная работа №1
|
# Лабораторная работа №4
|
||||||
|
|
||||||
* **Студент:** [Мастио Вячеслав Алексеевич]
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
# Техническое задание №1
|
||||||
|
|
||||||
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ключевой код
|
||||||
|
```csharp
|
||||||
|
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 attacck2Name = Console.ReadLine();
|
||||||
|
|
||||||
|
Console.Write("Введите, пожалуйста, описание второй атаки: ");
|
||||||
|
string attacck2Desc = 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 = 1.0;
|
||||||
|
int attack2Damage = 20;
|
||||||
|
int retreatCost = 1;
|
||||||
|
Console.Clear();
|
||||||
|
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
Console.WriteLine($"[{stage}]{name} ОЖ: {hp}[⚡]" );
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"№ {number} | Вид: {category} | Рост: {height} | Вес: {weight}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"[Атака 1]{attack1Name}");
|
||||||
|
Console.WriteLine($"Эффект: {attack1Desc}");
|
||||||
|
Console.WriteLine();
|
||||||
|
Console.WriteLine($"[Атака] {attacck2Name} Урон: {attack2Damage}+");
|
||||||
|
Console.WriteLine($"Эффект: {attacck2Desc}");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"Слабость: {weakness}");
|
||||||
|
Console.WriteLine($"Устойчиов: {resistance}");
|
||||||
|
Console.WriteLine($"Отступление: {retreatCost} энергия");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class ex1
|
||||||
|
{
|
||||||
|
static void HealPokemon(ref int pokemonHP)
|
||||||
|
{
|
||||||
|
pokemonHP += 80;
|
||||||
|
Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP.");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ===");
|
||||||
|
int pokemonHP = 20;
|
||||||
|
Console.WriteLine($"Здоровье до лечения: {pokemonHP} HP.");
|
||||||
|
|
||||||
|
HealPokemon(ref pokemonHP);
|
||||||
|
|
||||||
|
Console.WriteLine($"Здоровье после лечения: {pokemonHP} HP.");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class ex2
|
||||||
|
{
|
||||||
|
static void SearchBushes(out string foundPokemon, out int pokemonLevel)
|
||||||
|
{
|
||||||
|
foundPokemon = "Пикачу";
|
||||||
|
|
||||||
|
Random random = new Random();
|
||||||
|
pokemonLevel = random.Next(1, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ===");
|
||||||
|
Console.WriteLine("Вы зашли в высокую траву...");
|
||||||
|
|
||||||
|
SearchBushes(out string foundPokemon, out int pokemonLevel);
|
||||||
|
|
||||||
|
Console.WriteLine($"Шорох! Из кустов появляеться дикикй {foundPokemon} (Уровень: {pokemonLevel})");
|
||||||
|
Console.WriteLine();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class ex3
|
||||||
|
{
|
||||||
|
static void RegisterTourment(in double x, in double difficulty, params string[] participants)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Коэффициент стадиона: {difficulty}");
|
||||||
|
Console.WriteLine("Список участников:");
|
||||||
|
|
||||||
|
foreach (string pokemon in participants)
|
||||||
|
{
|
||||||
|
Console.WriteLine($" * {pokemon}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ===");
|
||||||
|
double stadiumDifficulty = 1.5;
|
||||||
|
|
||||||
|
// Первый вызов: 2 покемона через params
|
||||||
|
RegisterTournament(in stadiumDifficulty, "Булбазавр", "Чармандер");
|
||||||
|
Console.WriteLine("-----------------------------");
|
||||||
|
|
||||||
|
// Второй вызов: 4 покемона через params
|
||||||
|
RegisterTournament(in stadiumDifficulty, "Сквиртл", "Пикачу", "Псайдак", "Мяут");
|
||||||
|
Console.WriteLine("=============================");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class ex1
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Pokemon pikachu = new Pokemon("Пикачу", 5, 100);
|
||||||
|
Pokemon sqr = new Pokemon("Сквиртл", 7, 90);
|
||||||
|
|
||||||
|
pikachu.ShowInfo();
|
||||||
|
sqr.ShowInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Pokemon
|
||||||
|
{
|
||||||
|
private string name;
|
||||||
|
private int level;
|
||||||
|
private int hp;
|
||||||
|
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get { return name; }
|
||||||
|
set { name = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Level
|
||||||
|
{
|
||||||
|
get { return level; }
|
||||||
|
set { level = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Hp
|
||||||
|
{
|
||||||
|
get { return hp; }
|
||||||
|
set { hp = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pokemon(string name, int level, int hp)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.level = level;
|
||||||
|
this.hp = hp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowInfo()
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Имя: {this.Name}, Уровень: {this.Level}, HP: {this.Hp}");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class ex2
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Pokemon pika = new Pokemon("Пикачу", 1, 1);
|
||||||
|
|
||||||
|
pika.Hp = -50;
|
||||||
|
Console.WriteLine($"Текущее HP: {pika.Hp} (защита сработала)");
|
||||||
|
|
||||||
|
pika.TakeDamage(30);
|
||||||
|
Console.WriteLine($"Покемон получил 30 урона. HP: {pika.Hp}");
|
||||||
|
|
||||||
|
pika.Heal();
|
||||||
|
Console.WriteLine($"Покемон вылечился. HP: {pika.Hp}");
|
||||||
|
|
||||||
|
|
||||||
|
Pokemon egg = new Pokemon();
|
||||||
|
Console.WriteLine($"Создан покемон из яйца: Имя: {egg.Name}, Уровень: {egg.Level}, HP: {egg.Hp}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Pokemon
|
||||||
|
{
|
||||||
|
private string name;
|
||||||
|
private int level;
|
||||||
|
private int hp;
|
||||||
|
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get { return name; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (name == "") name = "Безымянный";
|
||||||
|
else name = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Level
|
||||||
|
{
|
||||||
|
get { return level; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value < 1) level = 1;
|
||||||
|
else if (value > 100) level = 100;
|
||||||
|
else level = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Hp
|
||||||
|
{
|
||||||
|
get { return hp; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (hp < 0) hp = 0;
|
||||||
|
else if (hp > 100) hp = 100;
|
||||||
|
else hp = value;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pokemon()
|
||||||
|
{
|
||||||
|
Name = "Яйцо";
|
||||||
|
Level = 1;
|
||||||
|
Hp = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pokemon(string nmme, int level, int hp)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
Level = level;
|
||||||
|
Hp = hp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int TakeDamage(int damage)
|
||||||
|
{
|
||||||
|
hp -= damage;
|
||||||
|
if (hp <= 0) return 0;
|
||||||
|
return hp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Heal()
|
||||||
|
{
|
||||||
|
hp = 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class ex3
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Pokemon pika = new Pokemon("Пикачу", 5, 100);
|
||||||
|
Pokemon squirtle = new Pokemon("Сквиртл", 7, 90);
|
||||||
|
Pokemon bulba = new Pokemon("Бульбазавр", 6, 95);
|
||||||
|
|
||||||
|
Console.WriteLine("=== ПОКЕДЕКС: СТАТИСТИКА ===");
|
||||||
|
Console.WriteLine($"Создано покемонов: {Pokemon.Count}\n");
|
||||||
|
|
||||||
|
pika.Battle(squirtle);
|
||||||
|
|
||||||
|
Console.WriteLine("=== СОСТОЯНИЕ ПОСЛЕ БОЯ ===");
|
||||||
|
Console.WriteLine($"{pika.Name} — HP: {pika.Hp}");
|
||||||
|
Console.WriteLine($"{squirtle.Name} — HP: {squirtle.Hp}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Pokemon
|
||||||
|
{
|
||||||
|
public static int Count { get; private set; } = 0;
|
||||||
|
private string name;
|
||||||
|
private int level;
|
||||||
|
private int hp;
|
||||||
|
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get { return name; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (name == "") name = "Безымянный";
|
||||||
|
else name = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Level
|
||||||
|
{
|
||||||
|
get { return level; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value < 1) level = 1;
|
||||||
|
else if (value > 100) level = 100;
|
||||||
|
else level = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Hp
|
||||||
|
{
|
||||||
|
get { return hp; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (hp < 0) hp = 0;
|
||||||
|
else if (hp > 100) hp = 100;
|
||||||
|
else hp = value;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Pokemon(string nmme, int level, int hp)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
Level = level;
|
||||||
|
Hp = hp;
|
||||||
|
Count++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pokemon()
|
||||||
|
{
|
||||||
|
Name = "Безымянный";
|
||||||
|
Level = 1;
|
||||||
|
Hp = 100;
|
||||||
|
Count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Battle(Pokemon enemy)
|
||||||
|
{
|
||||||
|
Console.WriteLine("=== БИТВА ===");
|
||||||
|
Console.WriteLine($"{Name} (Ур. {Level}, HP {Hp}) против {enemy.Name} (Ур. {enemy.Level}, HP {enemy.Hp})");
|
||||||
|
|
||||||
|
if (Level >= enemy.Level)
|
||||||
|
{
|
||||||
|
int damage = Level;
|
||||||
|
enemy.Hp -= damage;
|
||||||
|
|
||||||
|
Console.WriteLine($"{Name} побеждает! {enemy.Name} теряет {damage} HP.");
|
||||||
|
Console.WriteLine($"Победитель: {Name}. Осталось HP: {this.Hp}");
|
||||||
|
Console.WriteLine($"Побеждённый: {enemy.Name}. Осталось HP: {enemy.Hp}\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int damage = enemy.Level;
|
||||||
|
Hp -= damage;
|
||||||
|
|
||||||
|
Console.WriteLine($"{enemy.Name} побеждает! {Name} теряет {damage} HP.");
|
||||||
|
Console.WriteLine($"Победитель: {enemy.Name}. Осталось HP: {enemy.Hp}");
|
||||||
|
Console.WriteLine($"Побеждённый: {Name}. Осталось HP: {this.Hp}\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Лабораторная работа №1
|
# Техническое задание №1
|
||||||
|
|
||||||
* **Студент:** [Мастио Вячеслав Алексеевич]
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Лабораторная работа №1
|
# Техническоке задание №2
|
||||||
|
|
||||||
* **Студент:** [Мастио Вячеслав Алексеевич]
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# Лабораторная работа №1
|
|
||||||
|
|
||||||
* **Студент:** [ФИО]
|
|
||||||
* **Вариант / Карточка:** [Например: #025 Pikachu]
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Ключевой код
|
|
||||||
```csharp
|
|
||||||
// Самая важная часть реализации (методы, структуры, логика)
|
|
||||||
public class Card
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
public int Hp { get; set; }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
# Техническое задание №3
|
||||||
|
|
||||||
|
* **Студент:** [Мастио Вячеслав Алексеевич]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ключевой код
|
||||||
|
```csharp
|
||||||
|
Console.WriteLine("Приготовьтесь к дуэли!");
|
||||||
|
for (int i = 3; i >= 1; i--)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{i}...");
|
||||||
|
}
|
||||||
|
Console.WriteLine($"\n=== СТАРТ ДУЭЛИ: {name} (HP: {hp}) VS {enemyName} (HP: {enemyHp}) ===\n");
|
||||||
|
|
||||||
|
while (hp > 0 && enemyHp > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"--- Раунд {roundNumber} ---");
|
||||||
|
int actionChoice;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write($"Выберите действие (1 - {attack1Name}, 2 - {attack2Name}): ");
|
||||||
|
actionChoice = int.Parse(Console.ReadLine());
|
||||||
|
} 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("======================================================================");
|
||||||
|
}
|
||||||
|
```
|
||||||
+131
-31
@@ -4,69 +4,169 @@ 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
|
||||||
{
|
{
|
||||||
Console.Write($"Выберите действие (1 - {attack1Name}, 2 - {attack2Name}): ");
|
Console.Write($"Выберите действие (1 - {attack1Name}, 2 - {attack2Name}): ");
|
||||||
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("======================================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
namespace DefaultNamespace;
|
||||||
|
|
||||||
|
public class main
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
int currentPokemonIndex = 0;
|
||||||
|
|
||||||
|
Console.Write("Введите стадию развития: ");
|
||||||
|
string stage = Console.ReadLine();
|
||||||
|
Console.Write("Введите вид покемона: ");
|
||||||
|
string category = Console.ReadLine();
|
||||||
|
Console.Write("Введите название 1-й атаки: ");
|
||||||
|
string attack1Name = Console.ReadLine();
|
||||||
|
Console.Write("Введите базовый урон 1-й атаки: ");
|
||||||
|
int attack1BaseDamage = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("Введите название 2-й атаки: ");
|
||||||
|
string attack2Name = 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());
|
||||||
|
Console.Clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string[] enemyTeam = new string[3] { "Бульбазавар", "Сквиртл", "Коффинг" };
|
||||||
|
int enemyIndex = 0;
|
||||||
|
int enemyHP = 70;
|
||||||
|
int enemyBaseDamage = 15;
|
||||||
|
int roundNumber = 1;
|
||||||
|
int actionChoice = 0;
|
||||||
|
bool isEnemyDebuffed = false;
|
||||||
|
|
||||||
|
string[] ememyNames = new string[3] { "Мяут", "Геодуд", "Гарчомп" };
|
||||||
|
int[] enemyHPs = new int[3] {40, 65, 90};
|
||||||
|
int[] enemyDamages = new int[3] { 10, 15, 25 };
|
||||||
|
int[] enemyTypes = new int[3] { 3, 1, 2 };
|
||||||
|
|
||||||
|
int currentEnemyIndex = 0;
|
||||||
|
int activeFighterIndex = 0;
|
||||||
|
|
||||||
|
Console.WriteLine("=== РЕГИСТРАЦИЯ КОМАНДЫ ===");
|
||||||
|
string[] activeTeam = new string[3];
|
||||||
|
for (int i = 0; i < activeTeam.Length; i++)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Введите имя покемона №{i + 1}: ");
|
||||||
|
activeTeam[i] = Console.ReadLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
string name = activeTeam[0];
|
||||||
|
|
||||||
|
Console.WriteLine("--- Ваша команда на этот бой ---");
|
||||||
|
for (int i = 0; i < activeTeam.Length; i++)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"1. {activeTeam[i]}");
|
||||||
|
}
|
||||||
|
|
||||||
|
int[] pokedexHP = new int[activeTeam.Length];
|
||||||
|
for (int i = 0; i < activeTeam.Length; i++)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Введите макс. HP для {activeTeam[i]}: ");
|
||||||
|
pokedexHP[i] = int.Parse(Console.ReadLine());
|
||||||
|
}
|
||||||
|
|
||||||
|
int [] pokedexDamage = new int[activeTeam.Length];
|
||||||
|
for (int i = 0; i < activeTeam.Length; i++)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Введите базовый урон для {activeTeam[i]}: ");
|
||||||
|
pokedexDamage[i] = int.Parse(Console.ReadLine());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> backpack = new List<string>();
|
||||||
|
backpack.Add("Зелеья HP");
|
||||||
|
backpack.Add("Покебол");
|
||||||
|
backpack.Add("Антидот");
|
||||||
|
|
||||||
|
bool hasHealingItem = false;
|
||||||
|
if (backpack.Contains("Зелья HP"))
|
||||||
|
{
|
||||||
|
hasHealingItem = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
hasHealingItem = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||||
|
Console.WriteLine($"Вы положили вещи в сумку. Предметов в инвентаре: {backpack.Count}");
|
||||||
|
backpack.Remove("Покебол");
|
||||||
|
Console.WriteLine("Вы использовали один Покебол для поимки дикого покемона!");
|
||||||
|
Console.WriteLine($"Обновленный инвентарь. Осталось предметов: {backpack.Count}");
|
||||||
|
|
||||||
|
Console.WriteLine($"--- Содержимое вашей сумки ---");
|
||||||
|
foreach (string item in backpack)
|
||||||
|
{
|
||||||
|
Console.WriteLine( $"[Предмет] -> {item}");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user