Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Random enemy_esely = new Random();
- Random kritikus = new Random();
- urhajo e = new urhajo();
- ellenseg a = new ellenseg();
- Console.WriteLine("Hogy is hívják önt?");
- e.pilota = Convert.ToString(Console.ReadLine()); ;
- Console.WriteLine("Kedves {0}!", e.pilota);
- Console.WriteLine("A következő küldetés során egy V2-es raktéta állomást kell elpusztítania, még a kilővés előtt!");
- Console.WriteLine("Sok szerencsét!");
- Console.WriteLine();
- Console.WriteLine("Mit tesz? toltes vagy mozgas");
- while (e.tavolsag != 20)
- {
- string parancs = Console.ReadLine();
- switch (parancs)
- {
- case "m":
- e.tavolsag++;
- e.mozog();
- if (enemy_esely.Next(0, 20) == 10)
- a.harc(10);
- break;
- case "t":
- e.toltes();
- if (enemy_esely.Next(0, 20) == 10)
- a.harc(10);
- break;
- }
- }
- if (e.uzemanyag <= 0 || e.moral <= 50 || e.uzemanyag > 100)
- Console.WriteLine("Küldetés sikertelen!");
- else Console.WriteLine("Küldetésed siker koronázza!");
- Console.ReadLine();
- }
- }
- class urhajo
- {
- public string pilota;
- public int tavolsag = 0;
- public int uzemanyag = 100;
- public int moral = 100;
- public int raketa = 10;
- public int minigun = 200;
- public bool dodge = true;
- public int critical;
- public void mozog()
- {
- uzemanyag -= 20;
- if (uzemanyag <= 20 && uzemanyag != 0)
- {
- moral -= 10;
- Console.WriteLine("-20 megy üzemanyagszint: {0}", uzemanyag);
- Console.Write("morál: {0}", moral);
- Console.WriteLine("Adjá' má' kerozin!");
- }
- else Console.WriteLine("-20 megy üzemanyagszint: {0}", uzemanyag);
- Console.WriteLine("morál: {0}", moral);
- if (uzemanyag <= 0)
- {
- Console.WriteLine("Zuhanunk! üzemanyagszint: {0}", uzemanyag);
- Console.WriteLine("morál: {0}", moral);
- tavolsag = 20;
- }
- if (moral < 50)
- {
- Console.WriteLine("Autofail");
- Console.WriteLine("morál: {0}", moral);
- tavolsag = 20;
- }
- }
- public void toltes()
- {
- uzemanyag += 10;
- if (moral >= 100)
- {
- }
- else moral += 10;
- Console.WriteLine("Töltés! üzemanyagszint: {0}", uzemanyag);
- Console.WriteLine("morál: {0}", moral);
- if (uzemanyag > 100)
- {
- Console.WriteLine("A tank felrobbant!");
- tavolsag = 20;
- }
- }
- }
- class ellenseg
- {
- public string nev;
- public int eletero;
- private Random enemy_nev = new Random();
- public int fegyver = 20;
- public bool panic = false;
- public void harc(int enemy_esely)
- {
- while (enemy_esely == 10)
- {
- if (enemy_nev.Next(0, 2) == 0)
- {
- Console.WriteLine("");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement