generated from admin/template
44 lines
1.7 KiB
C#
44 lines
1.7 KiB
C#
|
|
int pokemonHP = 20;
|
|
Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ===");
|
|
Console.WriteLine($"Здоровье до лечения: {pokemonHP} HP.");
|
|
HealPokemon(ref pokemonHP);
|
|
Console.WriteLine($"Здоровье после лечения: {pokemonHP} HP.");
|
|
|
|
Console.WriteLine("\n=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ===");
|
|
Console.WriteLine("Вы зашли в высокую траву...");
|
|
SearchBushes(out string foundPokemon, out int pokemonLevel);
|
|
Console.WriteLine($"Шорох! Из кустов появляется дикий {foundPokemon} (Уровень: {pokemonLevel})!");
|
|
|
|
Console.WriteLine("\n=== РЕГИСТРАЦИЯ НА ТУРНИР ===");
|
|
double difficulty = 1.5;
|
|
RegisterTournament(difficulty, "Булбазавр", "Чармандер" );
|
|
Console.WriteLine("-----------------------------");
|
|
RegisterTournament(difficulty, "Сквиртл", "Пикачу", "Псайдак", "Мяут" );
|
|
Console.WriteLine("=============================");
|
|
|
|
void HealPokemon(ref int pokemonHP)
|
|
{
|
|
if (pokemonHP >= 100)
|
|
return;
|
|
pokemonHP += 80;
|
|
if (pokemonHP > 100)
|
|
pokemonHP = 100;
|
|
Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP.");
|
|
}
|
|
|
|
void SearchBushes(out string foundPokemon, out int pokemonLevel)
|
|
{
|
|
foundPokemon = "Пикачу";
|
|
pokemonLevel = new Random().Next(1, 15);
|
|
}
|
|
|
|
void RegisterTournament(in double difficulty, params string[] participants)
|
|
{
|
|
//difficulty = 3;
|
|
Console.WriteLine($"Коэффициент стадиона: {difficulty}");
|
|
foreach (var pokemon in participants )
|
|
{
|
|
Console.WriteLine($"* {pokemon}");
|
|
}
|
|
} |