Esempio n. 1
0
        public override void Attack(Hero defender)
        {
            bool   canAttackW300 = rnd.Next(1, 101) <= 30;
            double damage        = ActualAttack() - defender.ActualArmor();

            if (damage > 0 && defender.CanBlock() == false)
            {
                if (canAttackW300)
                {
                    Console.WriteLine($"\n\t\t{Name} increase his points with 300%");
                    damage *= 3;
                }
                defender.HealthPoints -= damage;
                Console.WriteLine();
                Console.WriteLine($"\t\t{Name} attack {defender.Name} with {damage}");
                Console.WriteLine();
                Console.WriteLine($"{Name}- Attack Points - {AttackPoints} - Armor Points - " +
                                  $"{ArmorPoints} - Health  {HealthPoints}");
                Console.WriteLine($"{defender.Name}- Attack Points - {defender.AttackPoints} - Armor Points - " +
                                  $"{defender.ArmorPoints} - Health  {defender.HealthPoints}");
            }
            else
            {
                Console.WriteLine($"\n\t\t{Name} cannot attack");
            }
        }
Esempio n. 2
0
        public override void Attack(Hero defender)
        {
            double damage = ActualAttack() - defender.ActualArmor();

            Console.WriteLine($"\t\t{Name} attack {defender.Name} with {damage}");
            Console.WriteLine();
            Console.WriteLine($"{Name}- Attack Points - {AttackPoints} - Armor Points - " +
                              $"{ArmorPoints} - Health  {HealthPoints}");
            Console.WriteLine($"{defender.Name}- Attack Points - {defender.AttackPoints} - Armor Points - " +
                              $"{defender.ArmorPoints} - Health  {defender.HealthPoints}");
        }