Created
December 16, 2021 08:55
-
-
Save Ana19997/1b83cb470572286a136b144c4dcf26b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace игра | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Random rand = new Random(); | |
float livesMagician = 550; | |
int demage1 = rand.Next(38, 55); | |
int mana = 400; | |
int demageThunderclaps = rand.Next(70, 100); //удар молнии | |
bool usedDemageThunderclaps= false; | |
int demageKonvergencia = rand.Next(30, 50); // удар молнии + звуковая волна | |
int earthquake = 0; // раскол земли под ногами | |
int tornado =0; // сильный порыв ветра\ураган | |
float livesBoss = 1500; | |
int demage2 = rand.Next(83, 109); | |
string choosingAMagician; | |
bool gameOver = livesBoss <= 0 || livesMagician <= 0; | |
Console.WriteLine($"Вам предстоит сражаться против Босса.\nУ Вас есть 4 заклинания с различными свойствами.\nВыберите заклинание:"); | |
Console.WriteLine($"1. Удар молнии (действует 3 хода) - наносит {demageThunderclaps} урона и отнимает 60 маны. "); | |
Console.WriteLine($"2. Звуковая волна (работает после использования Удара молнии) - наносит {demageKonvergencia} урона и отнимает 20 маны."); | |
Console.WriteLine($"3. Раскол земли наносит {earthquake} урона Боссу, прибавляет 100 к Вашей жизни и отнимает 50 маны, а также защищает от урона от Босса."); | |
Console.WriteLine($"4. Ураган наносит {tornado} урона Боссу, прибавляет 20 к Вашей жизни и 150 маны, но при этом отнимает 20 маны."); | |
while (gameOver == false) | |
{ | |
Console.WriteLine($"Мана: {mana}\nКоличество Вашей жизни: {livesMagician}\nКоличество жизни Босса: {livesBoss}"); | |
choosingAMagician = Console.ReadLine(); | |
switch (choosingAMagician) | |
{ | |
case "1": | |
if(mana >= 60) | |
{ | |
demage1 += demageThunderclaps; | |
mana -= 60; | |
livesBoss -= demage1; | |
Console.WriteLine("Вы нанесли удар молнией"); | |
livesMagician -= demage2; | |
usedDemageThunderclaps = true; | |
} | |
else | |
{ | |
Console.WriteLine("Не достаточно маны."); | |
} | |
break; | |
case "2": | |
if (usedDemageThunderclaps == true) | |
{ | |
demage1 += demageThunderclaps + demageKonvergencia; | |
mana -= 20; | |
livesBoss -= demage1; | |
Console.WriteLine("Вы вызвали звуковую волну!"); | |
livesMagician -= demage2; | |
} | |
else | |
{ | |
Console.WriteLine("Вы не можете использовать звуковую волну, пока не использован удар молнии."); | |
} | |
break; | |
case "3": | |
mana -= 50; | |
livesMagician += 100; | |
break; | |
case "4": | |
mana -= 20; | |
livesMagician += 20; | |
mana += 150; | |
livesMagician -= demage2; | |
break; | |
default: | |
Console.WriteLine("Не верный выбор"); | |
break; | |
} | |
gameOver = livesBoss <= 0 || livesMagician <= 0; | |
} | |
if (livesBoss <= 0 && livesMagician <= 0) | |
{ | |
Console.WriteLine("Ничья."); | |
} | |
else if (livesBoss <= 0) | |
{ | |
Console.WriteLine("Победа! Босс побежден."); | |
} | |
else if (livesMagician <= 0) | |
{ | |
Console.WriteLine("Вы проиграли"); | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment