Advertisement
Nickzouk

den to exw teliosei guys... einai to fight game

Dec 13th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.42 KB | None | 0 0
  1. using System;
  2.  
  3. namespace NISTAAAAAAAAAAAAAAAAZW
  4. {
  5.     class player
  6.     {
  7.         int health, attack, damage;
  8.         double defence;
  9.         string name;
  10.  
  11.         public player()
  12.         {
  13.             Random r = new Random();
  14.             health = r.Next(800 - 1000);
  15.             attack = r.Next(199 - 300);
  16.             defence = (double)r.Next(25 - 100 / 100);
  17.         }
  18.         //methods
  19.         public int GetHealth()
  20.         {
  21.             return health;
  22.         }
  23.         public int GetDamage()
  24.         {
  25.             return damage;
  26.         }
  27.         public double GetDefence()
  28.         {
  29.             return defence;
  30.         }
  31.         public int Getattack()
  32.         {
  33.             return attack;
  34.         }
  35.         public string GetName()
  36.         {
  37.             return name;
  38.         }
  39.         public void TakeDamage(int D)
  40.         {
  41.             health -= D;
  42.         }
  43.  
  44.         public void Attack(player attackedHero)
  45.         {
  46.  
  47.             Random rnd = new Random();
  48.             double r1, r2;
  49.             r1 = rnd.NextDouble();
  50.             r2 = rnd.NextDouble();
  51.             int damage = (int)(attack * r1 * (1 - (defence * r2)));
  52.             Console.WriteLine(attackedHero.GetName());
  53.             Console.WriteLine("damage dealt " + damage);
  54.             attackedHero.TakeDamage(damage);
  55.  
  56.  
  57.         }
  58.  
  59.  
  60.     }
  61.  
  62.  
  63.     class Program
  64.     {
  65.         static bool end = false;
  66.  
  67.         static void Main(String[] args)
  68.         {
  69.             Console.WriteLine("Welcome to Battle simulator");
  70.             Menu();
  71.             int choice = -1;
  72.             while (choice != 0)
  73.             {
  74.                 choice = int.Parse(Console.ReadLine());
  75.                 if (choice == 1)
  76.                 {
  77.                     Console.WriteLine("FIGHT GAME! ");
  78.                     Console.WriteLine(" press");
  79.                 }
  80.  
  81.  
  82.  
  83.             }
  84.         }
  85.  
  86.         static void Menu()
  87.         {
  88.             Console.WriteLine("main Menu \n1)HELP\n2)START\n3)EXIT ");
  89.         }
  90.         //static int menuValidator(string inputNumber)
  91.         //{
  92.         //    bool numberCheck = int.TryParse(inputNumber, out int result);
  93.         //    while (!numberCheck || result < 1 || result > 3)
  94.         //    {
  95.         //        Console.WriteLine("wrong number");
  96.         //        numberCheck = int.TryParse(Console.ReadLine(), out result);
  97.  
  98.         //    }
  99.         //    return result;
  100.  
  101.  
  102.  
  103.  
  104.         //}
  105.  
  106.     }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement