Created
December 16, 2021 11:14
-
-
Save Ana19997/e8eaa5b8aa693ee3a57c365d3c4b7838 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 bossDamage = 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 magicianDamage = 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) | |
{ | |
bossDamage += demageThunderclaps; | |
mana -= 60; | |
livesBoss -= bossDamage; | |
Console.WriteLine("Вы нанесли удар молнией"); | |
livesMagician -= magicianDamage; | |
usedDemageThunderclaps = true; | |
} | |
else | |
{ | |
Console.WriteLine("Не достаточно маны."); | |
} | |
break; | |
case "2": | |
if (usedDemageThunderclaps == true) | |
{ | |
bossDamage += demageThunderclaps + demageKonvergencia; | |
mana -= 20; | |
livesBoss -= bossDamage; | |
Console.WriteLine("Вы вызвали звуковую волну!"); | |
livesMagician -= magicianDamage; | |
} | |
else | |
{ | |
Console.WriteLine("Вы не можете использовать звуковую волну, пока не использован удар молнии."); | |
} | |
break; | |
case "3": | |
mana -= 50; | |
livesMagician += 100; | |
break; | |
case "4": | |
mana -= 20; | |
livesMagician += 20; | |
mana += 150; | |
livesMagician -= magicianDamage; | |
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