Example #1
0
        public bool Battle(Ship enemy)
        {
            Console.WriteLine($"\n\n-- The {Name} ship sets its sight " +
                              $"on the {enemy.Name} ship! --");

            int weAlive   = AliveCount;
            int theyAlive = enemy.AliveCount;

            int ourScore   = (weAlive - Capn.ShotsTaken);
            int enemyScore = (theyAlive - enemy.Capn.ShotsTaken);

            if (ourScore > enemyScore)
            {
                Console.WriteLine($"The {Name} ship leaves only a smoking " +
                                  $"wreck where the {enemy.Name} ship used to be!\n" +
                                  $"--Battle Aftermath:");
                WinBattle();
                enemy.LoseBattle();
                return(true);
            }
            else
            {
                Console.WriteLine($"The {Name} ship gets ploughed for such an " +
                                  $"insolence by the {enemy.Name} ship!\n" +
                                  $"--Battle Aftermath:");
                enemy.WinBattle();
                LoseBattle();
                return(false);
            }
        }