Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Random enemy_esely = new Random();
  13.             Random kritikus = new Random();
  14.             urhajo e = new urhajo();
  15.             ellenseg a = new ellenseg();
  16.             Console.WriteLine("Hogy is hívják önt?");
  17.             e.pilota = Convert.ToString(Console.ReadLine()); ;
  18.             Console.WriteLine("Kedves {0}!", e.pilota);
  19.             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!");
  20.             Console.WriteLine("Sok szerencsét!");
  21.             Console.WriteLine();
  22.             Console.WriteLine("Mit tesz? toltes vagy mozgas");
  23.             while (e.tavolsag != 20)
  24.             {
  25.                 string parancs = Console.ReadLine();
  26.                 switch (parancs)
  27.                 {
  28.                     case "m":
  29.                         e.tavolsag++;
  30.                         e.mozog();
  31.                         if (enemy_esely.Next(0, 20) == 10)
  32.                             a.harc(10);
  33.  
  34.                         break;
  35.  
  36.                     case "t":
  37.                         e.toltes();
  38.                         if (enemy_esely.Next(0, 20) == 10)
  39.                             a.harc(10);
  40.                         break;
  41.                 }
  42.             }
  43.             if (e.uzemanyag <= 0 || e.moral <= 50 || e.uzemanyag > 100)
  44.                 Console.WriteLine("Küldetés sikertelen!");
  45.             else Console.WriteLine("Küldetésed siker koronázza!");
  46.             Console.ReadLine();
  47.         }
  48.  
  49.     }
  50.     class urhajo
  51.     {
  52.         public string pilota;
  53.         public int tavolsag = 0;
  54.         public int uzemanyag = 100;
  55.         public int moral = 100;
  56.         public int raketa = 10;
  57.         public int minigun = 200;
  58.         public bool dodge = true;
  59.         public int critical;
  60.         public void mozog()
  61.         {
  62.             uzemanyag -= 20;
  63.             if (uzemanyag <= 20 && uzemanyag != 0)
  64.             {
  65.                 moral -= 10;
  66.                 Console.WriteLine("-20 megy üzemanyagszint: {0}", uzemanyag);
  67.                 Console.Write("morál: {0}", moral);
  68.                 Console.WriteLine("Adjá' má' kerozin!");
  69.             }
  70.             else Console.WriteLine("-20 megy üzemanyagszint: {0}", uzemanyag);
  71.             Console.WriteLine("morál: {0}", moral);
  72.             if (uzemanyag <= 0)
  73.             {
  74.                 Console.WriteLine("Zuhanunk! üzemanyagszint: {0}", uzemanyag);
  75.                 Console.WriteLine("morál: {0}", moral);
  76.                 tavolsag = 20;
  77.             }
  78.             if (moral < 50)
  79.             {
  80.                 Console.WriteLine("Autofail");
  81.                 Console.WriteLine("morál: {0}", moral);
  82.                 tavolsag = 20;
  83.             }
  84.  
  85.         }
  86.         public void toltes()
  87.         {
  88.             uzemanyag += 10;
  89.             if (moral >= 100)
  90.             {
  91.             }
  92.             else moral += 10;
  93.             Console.WriteLine("Töltés! üzemanyagszint: {0}", uzemanyag);
  94.             Console.WriteLine("morál: {0}", moral);
  95.             if (uzemanyag > 100)
  96.             {
  97.                 Console.WriteLine("A tank felrobbant!");
  98.                 tavolsag = 20;
  99.             }
  100.  
  101.         }
  102.     }
  103.     class ellenseg
  104.     {
  105.         public string nev;
  106.         public int eletero;
  107.         private Random enemy_nev = new Random();
  108.         public int fegyver = 20;
  109.         public bool panic = false;
  110.         public void harc(int enemy_esely)
  111.         {
  112.             while (enemy_esely == 10)
  113.             {
  114.                 if (enemy_nev.Next(0, 2) == 0)
  115.                 {
  116.                     Console.WriteLine("");
  117.                 }
  118.             }
  119.         }
  120.     }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement