Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NISTAAAAAAAAAAAAAAAAZW
- {
- class player
- {
- int health, attack, damage;
- double defence;
- string name;
- public player()
- {
- Random r = new Random();
- health = r.Next(800 - 1000);
- attack = r.Next(199 - 300);
- defence = (double)r.Next(25 - 100 / 100);
- }
- //methods
- public int GetHealth()
- {
- return health;
- }
- public int GetDamage()
- {
- return damage;
- }
- public double GetDefence()
- {
- return defence;
- }
- public int Getattack()
- {
- return attack;
- }
- public string GetName()
- {
- return name;
- }
- public void TakeDamage(int D)
- {
- health -= D;
- }
- public void Attack(player attackedHero)
- {
- Random rnd = new Random();
- double r1, r2;
- r1 = rnd.NextDouble();
- r2 = rnd.NextDouble();
- int damage = (int)(attack * r1 * (1 - (defence * r2)));
- Console.WriteLine(attackedHero.GetName());
- Console.WriteLine("damage dealt " + damage);
- attackedHero.TakeDamage(damage);
- }
- }
- class Program
- {
- static bool end = false;
- static void Main(String[] args)
- {
- Console.WriteLine("Welcome to Battle simulator");
- Menu();
- int choice = -1;
- while (choice != 0)
- {
- choice = int.Parse(Console.ReadLine());
- if (choice == 1)
- {
- Console.WriteLine("FIGHT GAME! ");
- Console.WriteLine(" press");
- }
- }
- }
- static void Menu()
- {
- Console.WriteLine("main Menu \n1)HELP\n2)START\n3)EXIT ");
- }
- //static int menuValidator(string inputNumber)
- //{
- // bool numberCheck = int.TryParse(inputNumber, out int result);
- // while (!numberCheck || result < 1 || result > 3)
- // {
- // Console.WriteLine("wrong number");
- // numberCheck = int.TryParse(Console.ReadLine(), out result);
- // }
- // return result;
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement