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