le_lukasz

Untitled

Apr 16th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace RPG
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Wojownik Leonidas = new Wojownik("Leonidas",1000,3,4,"Miecz","Pełna Tarcza");
  14.             Mag Geralt = new Mag("Geralt", 1000, 2, 5, 10, "Rzucanie zaklęć");
  15.  
  16.             do
  17.             {
  18.                 double atakGeralta = Geralt.MocAtaku();
  19.                 double atakLeonidasa = Leonidas.MocAtaku();
  20.  
  21.                 Geralt.OdejmijZycie(atakLeonidasa);
  22.                 Leonidas.OdejmijZycie(atakGeralta);
  23.  
  24.                 Console.WriteLine("Zycie Geralta: {0}", Geralt.punktyZycia);
  25.                 Console.WriteLine("Zycie Leonidasa: {0}", Leonidas.punktyZycia);
  26.  
  27.             }while (Geralt.punktyZycia >0 && Leonidas.punktyZycia >0);
  28.  
  29.             if(Geralt.punktyZycia > Leonidas.punktyZycia)
  30.             {
  31.                 Console.WriteLine("Wygral Geralt!");
  32.             }
  33.             else if (Geralt.punktyZycia < Leonidas.punktyZycia)
  34.             {
  35.                 Console.WriteLine("wygrał Leonidas!");
  36.             }
  37.             else
  38.             {
  39.                 Console.WriteLine("remis!");
  40.             }
  41.         }
  42.     }
  43. }
Add Comment
Please, Sign In to add comment