Created
November 26, 2021 10:55
-
-
Save Ana19997/fd67ba3b3ccbecf4567d362719b788a5 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); //удар молнии | |
int numberOfMoves = 3; //количество ходов действия удара молнии | |
int demageKonvergencia = rand.Next(30, 50); // удар молнии + звуковая волна | |
bool earthquake; // раскол земли под ногами | |
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. Раскол земли - прибавляет 100 к Вашей жизни и отнимает 50 маны, а также защищает от урона от Босса."); | |
Console.WriteLine("4. Ураган - прибавляет 20 к Вашей жизни и 150 маны, но при этом отнимает 20 маны."); | |
while (gameOver == false) | |
{ | |
Console.WriteLine($"Мана: {mana}\nКоличество Вашей жизни: {livesMagician}\nКоличество жизни Босса: {livesBoss}"); | |
choosingAMagician = Console.ReadLine(); | |
livesMagician -= demage2; | |
switch (choosingAMagician) | |
{ | |
case "1": | |
if(mana >= 60) | |
{ | |
demage1 += demageThunderclaps; | |
mana -= 60; | |
livesBoss -= demage1; | |
Console.WriteLine("Вы нанесли удар молнией"); | |
} | |
else | |
{ | |
Console.WriteLine("Не достаточно маны."); | |
} | |
break; | |
case "2": | |
if (numberOfMoves-- < 0) | |
{ | |
demage1 += demageThunderclaps + demageKonvergencia; | |
mana -= 20; | |
livesBoss -= demage1; | |
Console.WriteLine("Вы вызвали звуковую волну!"); | |
} | |
break; | |
case "3": | |
if (earthquake) | |
{ | |
mana -= 50; | |
livesMagician += 100; | |
} | |
break; | |
case "4": | |
mana -= 20; | |
livesMagician += 20; | |
mana += 150; | |
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