Exemplo n.º 1
0
        public static void Fight(Transformer firstTransformer, Transformer secondTransformer)
        {
            Console.WriteLine("Fight!!!");

            firstTransformer.Transform();
            secondTransformer.Transform();
            firstTransformer.FindEnemy();
            secondTransformer.FindEnemy();
            firstTransformer.Run();
            secondTransformer.Run();
            firstTransformer.CaptureTheTarget(secondTransformer);
            secondTransformer.CaptureTheTarget(firstTransformer);

            while (firstTransformer.Armour > 0 && secondTransformer.Armour > 0)
            {
                if (GreatRandom.GenerateMove() == 0)
                {
                    firstTransformer.ShootAtEnemy();
                }
                else
                {
                    secondTransformer.ShootAtEnemy();
                }
            }
            Console.WriteLine(firstTransformer.Armour > 0 ? $"{firstTransformer.Name} wins!" : $"{secondTransformer.Name} wins!");
        }
Exemplo n.º 2
0
        public override void ShootAtEnemy()
        {
            var currentDamage = GreatRandom.GenerateDamage();

            if (Weapon.GetChargeCritCounter() == 2)
            {
                Fire();
                EnemyTransformer.GetDamage(currentDamage * 4);
                Console.WriteLine($"CRIT! {Name} DEALS {currentDamage*4} DAMAGE!");
                Weapon.ResetChargeCritCounter();
            }
            else
            {
                Fire();
                EnemyTransformer.GetDamage(currentDamage);
                Console.WriteLine($"{Name} deals {currentDamage} damage!");
            }
        }