Esempio n. 1
0
        /// <summary>
        /// Method PVP.
        /// </summary>
        public void PVP()
        {
            Squad orc = Orcs.GetRandomSquad();
            Squad elv = Elves.GetRandomSquad();

            Warrior wr1 = orc.GetRandomWarrior();
            Warrior wr2 = elv.GetRandomWarrior();
            bool    who = false;

            while (wr1.Health >= 0 && wr2.Health >= 0)
            {
                if (who)
                {
                    wr1.Attack(wr2, elv, orc);
                }
                else
                {
                    wr2.Attack(wr1, orc, elv);
                }

                who = !who;
            }

            if (wr1.Health <= 0)
            {
                LostWarrior(wr1, Orcs);
            }
            else
            {
                LostWarrior(wr2, Elves);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Method Battle Fraction Vs Fraction.
        /// </summary>
        public void BattleFractionVsFraction()
        {
            Squad s1 = Orcs.GetRandomSquad();
            Squad s2 = Elves.GetRandomSquad();

            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.WriteLine($"\t\tThe firs battle between {Orcs.NameFraction} Squad: {s1.NameSquad} and {Elves.NameFraction} Squad: {s2.NameSquad}");
            Squad s3 = BattleSquadVsSquad(s1, s2);

            while (Orcs.Squads.Count != 0 && Elves.Squads.Count != 0)
            {
                Console.WriteLine("\nNext Battle\n");
                if (s1 == s3)
                {
                    s2 = Elves.GetRandomSquad();
                }
                else if (s2 == s3)
                {
                    s1 = Orcs.GetRandomSquad();
                }

                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                Console.WriteLine($"\t\tThe second battle between {Orcs.NameFraction} Squad: {s1.NameSquad} and {Elves.NameFraction} Squad: {s2.NameSquad}");
                s3 = BattleSquadVsSquad(s1, s2);
            }

            if (Elves.Squads.Count > 0)
            {
                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                Console.WriteLine($"\tGame OVEwr");
                Console.WriteLine("\nElves WIN");
                Console.ResetColor();
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                Console.WriteLine($"\tGame OVEwr");
                Console.WriteLine("\nOrcs WIN");
                Console.ResetColor();
            }
        }