Exemple #1
0
        public override void UseHit(AbstractHero hero)
        {
            Random rnd = new Random();

            if (rnd.Next(0, 1) == 0)
            {
                hero.GetDamage(2);
            }
            else
            {
                hero.GetDamage(1);
            }
            Console.WriteLine("Long distance hit");
        }
Exemple #2
0
 public BumForm(AbstractHero hero)
 {
     InitializeComponent();
     this.label1.Text = hero.GetPowers();
 }
Exemple #3
0
 public override void UseHit(AbstractHero hero)
 {
     hero.GetDamage(1);
     Console.WriteLine("Short distance hit");
 }
Exemple #4
0
 public override void UseMagic(AbstractHero hero)
 {
     hero.GetDamage(-2);
     Console.WriteLine("Regen health");
 }
Exemple #5
0
 public override void UseMagic(AbstractHero hero)
 {
     Console.WriteLine("Make block");
 }
Exemple #6
0
 public abstract void UseHit(AbstractHero hero);
Exemple #7
0
        static void Use(AbstractHero h1, AbstractHero h2)
        {
            SaverSingleton saverSingleton;

            saverSingleton = SaverSingleton.GetInstance(1);

            int choice1, choice2;

            Console.WriteLine("Select action for first hero: ");
            Console.WriteLine("Hit: 1");
            Console.WriteLine("Magic: 2");
            Console.WriteLine("Special skill: 3");
            choice1 = int.Parse(Console.ReadLine());

            Console.WriteLine("Select action for second hero: ");
            Console.WriteLine("Hit: 1");
            Console.WriteLine("Magic: 2");
            Console.WriteLine("Special skill: 3");
            choice2 = int.Parse(Console.ReadLine());

            try
            {
                switch (choice1)
                {
                case 1:
                    h1.Hit.UseHit(h2);
                    break;

                case 2:
                    h1.Magic.UseMagic(h2);
                    if (h1.Magic is MagicType1)
                    {
                        return;
                    }
                    break;

                case 3:
                    h1.SpecialSkill.UsePsecialSkill();
                    if (h1.SpecialSkill is SpecialSkillType1)
                    {
                        return;
                    }
                    h1.Hit.UseHit(h2);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.Clear();
                Console.WriteLine(ex.Message);
                Console.WriteLine("Second hero win");
                Console.ReadKey();
                saverSingleton.SaveLog("Second win");
                Environment.Exit(0);
            }


            try
            {
                switch (choice2)
                {
                case 1:
                    h2.Hit.UseHit(h1);
                    break;

                case 2:
                    h2.Magic.UseMagic(h1);
                    if (h2.Magic is MagicType1)
                    {
                        return;
                    }
                    break;

                case 3:
                    h2.SpecialSkill.UsePsecialSkill();
                    if (h2.SpecialSkill is SpecialSkillType1)
                    {
                        return;
                    }
                    h2.Hit.UseHit(h1);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.Clear();
                Console.WriteLine(ex.Message);
                Console.WriteLine("First hero win");
                Console.ReadKey();
                saverSingleton.SaveLog("First win");
                Environment.Exit(0);
            }
        }
Exemple #8
0
 public abstract void UseMagic(AbstractHero hero);
Exemple #9
0
 public override Form CreateCard(AbstractHero hero)
 {
     return(new BoozerForm(hero));
 }
Exemple #10
0
 public abstract Form CreateCard(AbstractHero abtractProperties);
Exemple #11
0
 public override void UseMagic(AbstractHero hero)
 {
     hero.GetDamage(2);
     Console.WriteLine("Make damage");
 }