Exemple #1
0
 //Méthodes permmettant l'ajout d'un gladiateur et la suppression
 public void NewGladiator(Gladiator g)
 {
     if (this.GladiatorList.Count < gladiatorNumberMaximumByTeam)
     {
         this.GladiatorList.Add(g);
     }
     else
     {
         Console.WriteLine("Nombre maximum de gladiateurs atteint");
     }
 }
Exemple #2
0
        //Lance le duel de gladiateur et renvoi le gagnant. Sont incrémentés les nb de victoires/défaites de chaque gladiateur
        public Gladiator FightToDeath()
        {
            Thread.Sleep(2000);
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n--------------------------------------------------------------------------------");
            Console.WriteLine("\t\tCOMBAT: " + gladInT1.GladiatorName + " VS " + gladInT2.GladiatorName + "\n");
            Console.WriteLine("--------------------------------------------------------------------------------");
            Console.ResetColor();
            Thread.Sleep(2000);

            while(gladInT1.InCourse == true && gladInT2.InCourse == true)
            {
                if(gladInT1.EquipmentPriority > gladInT2.EquipmentPriority)
                {
                    resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                    Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                    if (resAttack == true)
                    {
                        Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                        resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                        if (resDefend == false)
                        {
                            gladInT2.InCourse = false;
                            Winner = gladInT1;
                            Looser = gladInT2;

                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                            Thread.Sleep(1800);
                            Console.ResetColor();
                        }
                        else
                        {
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                        }
                    }
                    else
                    {
                        resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT1.InCourse = false;
                                Winner = gladInT2;
                                Looser = gladInT1;

                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                            }
                        }
                    }
                }
                else if(gladInT1.EquipmentPriority < gladInT2.EquipmentPriority)
                {
                    resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                    Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                    if (resAttack == true)
                    {
                        Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                        resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                        if (resDefend == false)
                        {
                            gladInT1.InCourse = false;
                            Winner = gladInT2;
                            Looser = gladInT1;

                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                            Thread.Sleep(1800);
                            Console.ResetColor();
                        }
                        else
                        {
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                        }
                    }
                    else
                    {
                        resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT2.InCourse = false;
                                Winner = gladInT1;
                                Looser = gladInT2;

                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                            }
                        }
                    }
                }
                else if (gladInT1.EquipmentPriority == gladInT2.EquipmentPriority)
                {
                    resEngageToss = Tools.whoEngageFight(1, 2);

                    if (resEngageToss == 1)
                    {
                        resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT2.InCourse = false;
                                Winner = gladInT1;
                                Looser = gladInT2;

                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                            }
                        }
                        else
                        {
                            resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                            if (resAttack == true)
                            {
                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                                resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                                if (resDefend == false)
                                {
                                    gladInT1.InCourse = false;
                                    Winner = gladInT2;
                                    Looser = gladInT1;

                                    Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                                    Thread.Sleep(1800);
                                    Console.ResetColor();
                                }
                                else
                                {
                                    Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                                }
                            }
                        }
                    }
                    else
                    {
                        resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT1.InCourse = false;
                                Winner = gladInT2;
                                Looser = gladInT1;

                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                            }
                        }
                        else
                        {
                            resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                            if (resAttack == true)
                            {
                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                                resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                                if (resDefend == false)
                                {
                                    gladInT2.InCourse = false;
                                    Winner = gladInT1;
                                    Looser = gladInT2;

                                    Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                                    Thread.Sleep(1800);
                                    Console.ResetColor();
                                }
                                else
                                {
                                    Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                                }
                            }
                        }
                    }
                }
            }

            if(gladInT1.InCourse == true && gladInT2.InCourse == false)
            {
                gladInT1.Victories++;
                gladInT2.Defeats++;
            }
            else if(gladInT2.InCourse == true && gladInT1.InCourse == false)
            {
                gladInT2.Victories++;
                gladInT1.Defeats++;
            }

            return Looser;
        }
Exemple #3
0
 public Duel(Gladiator gladInT1, Gladiator gladInT2)
 {
     this.gladInT1 = gladInT1;
     this.gladInT2 = gladInT2;
 }
Exemple #4
0
        //Lance le duel de gladiateur et renvoi le gagnant. Sont incrémentés les nb de victoires/défaites de chaque gladiateur
        public Gladiator FightToDeath()
        {
            Thread.Sleep(2000);
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n--------------------------------------------------------------------------------");
            Console.WriteLine("\t\tCOMBAT: " + gladInT1.GladiatorName + " VS " + gladInT2.GladiatorName + "\n");
            Console.WriteLine("--------------------------------------------------------------------------------");
            Console.ResetColor();
            Thread.Sleep(2000);

            while (gladInT1.InCourse == true && gladInT2.InCourse == true)
            {
                if (gladInT1.EquipmentPriority > gladInT2.EquipmentPriority)
                {
                    resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                    Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                    if (resAttack == true)
                    {
                        Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                        resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                        if (resDefend == false)
                        {
                            gladInT2.InCourse = false;
                            Winner            = gladInT1;
                            Looser            = gladInT2;

                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                            Thread.Sleep(1800);
                            Console.ResetColor();
                        }
                        else
                        {
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                        }
                    }
                    else
                    {
                        resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT1.InCourse = false;
                                Winner            = gladInT2;
                                Looser            = gladInT1;

                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                            }
                        }
                    }
                }
                else if (gladInT1.EquipmentPriority < gladInT2.EquipmentPriority)
                {
                    resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                    Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                    if (resAttack == true)
                    {
                        Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                        resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                        if (resDefend == false)
                        {
                            gladInT1.InCourse = false;
                            Winner            = gladInT2;
                            Looser            = gladInT1;

                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                            Thread.Sleep(1800);
                            Console.ResetColor();
                        }
                        else
                        {
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                        }
                    }
                    else
                    {
                        resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT2.InCourse = false;
                                Winner            = gladInT1;
                                Looser            = gladInT2;

                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                            }
                        }
                    }
                }
                else if (gladInT1.EquipmentPriority == gladInT2.EquipmentPriority)
                {
                    resEngageToss = Tools.whoEngageFight(1, 2);

                    if (resEngageToss == 1)
                    {
                        resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT2.InCourse = false;
                                Winner            = gladInT1;
                                Looser            = gladInT2;

                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                            }
                        }
                        else
                        {
                            resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                            if (resAttack == true)
                            {
                                Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                                resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                                if (resDefend == false)
                                {
                                    gladInT1.InCourse = false;
                                    Winner            = gladInT2;
                                    Looser            = gladInT1;

                                    Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                                    Thread.Sleep(1800);
                                    Console.ResetColor();
                                }
                                else
                                {
                                    Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                                }
                            }
                        }
                    }
                    else
                    {
                        resAttack = Tools.doOrNot(gladInT2.ChanceToAttack);
                        Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " tente d'attaquer.");
                        if (resAttack == true)
                        {
                            Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " touche.");
                            resDefend = Tools.doOrNot(gladInT1.ChanceToDefend);
                            if (resDefend == false)
                            {
                                gladInT1.InCourse = false;
                                Winner            = gladInT2;
                                Looser            = gladInT1;

                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " meurt.");
                                Console.ForegroundColor = ConsoleColor.Red;
                                Console.WriteLine("VICTOIRE DE " + gladInT2.GladiatorName);
                                Thread.Sleep(1800);
                                Console.ResetColor();
                            }
                            else
                            {
                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " réussi à parer.");
                            }
                        }
                        else
                        {
                            resAttack = Tools.doOrNot(gladInT1.ChanceToAttack);
                            Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " tente d'attaquer.");
                            if (resAttack == true)
                            {
                                Console.WriteLine("Le gladiateur " + gladInT1.GladiatorName + " touche.");
                                resDefend = Tools.doOrNot(gladInT2.ChanceToDefend);
                                if (resDefend == false)
                                {
                                    gladInT2.InCourse = false;
                                    Winner            = gladInT1;
                                    Looser            = gladInT2;

                                    Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " meurt.");
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.WriteLine("VICTOIRE DE " + gladInT1.GladiatorName);
                                    Thread.Sleep(1800);
                                    Console.ResetColor();
                                }
                                else
                                {
                                    Console.WriteLine("Le gladiateur " + gladInT2.GladiatorName + " réussi à parer.");
                                }
                            }
                        }
                    }
                }
            }

            if (gladInT1.InCourse == true && gladInT2.InCourse == false)
            {
                gladInT1.Victories++;
                gladInT2.Defeats++;
            }
            else if (gladInT2.InCourse == true && gladInT1.InCourse == false)
            {
                gladInT2.Victories++;
                gladInT1.Defeats++;
            }

            return(Looser);
        }
Exemple #5
0
 public Duel(Gladiator gladInT1, Gladiator gladInT2)
 {
     this.gladInT1 = gladInT1;
     this.gladInT2 = gladInT2;
 }
Exemple #6
0
        static void Main(string[] args)
        {
            //CONSTRUCTION DES JOUEURS----------------------------------------------------------------------------------------------------------------------------
            Player firstPlayer  = new Player("Grurm", "Jean", "Dubois");
            Player secondPlayer = new Player("Zadin", "Jeanne", "Dutilleul");
            Player thirdPlayer  = new Player("Lycan", "Pierre", "Dupont");
            Player fourthPlayer = new Player("Goteka", "Marie", "Martin");


            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n---------------------------QUE LE TOURNOI COMMENCE !!---------------------------"); // <-- This line is still white on blue.
            Console.ResetColor();

            Thread.Sleep(1800);

            Console.WriteLine("\nVont s'affronter les joueurs suivants: " + firstPlayer.Pseudo + ", " + secondPlayer.Pseudo + ", " + thirdPlayer.Pseudo + " et " + fourthPlayer.Pseudo + "\n");

            //CONSTRUCTION DES EQUIPES ET ATTRIBUTION AUX JOUEURS (1équipe/joueur pour ce test)---------------------------------------------------------------------------------------------------
            Team firstTeam  = new Team("Seventh Device", "EncoreUneDescription");
            Team secondTeam = new Team("Order of the Imperial", "UneNouvelleDescription");
            Team thirdTeam  = new Team("Council of the Blue Threat", "UneDescriptio");
            Team fourthTeam = new Team("Ninja Eagles", "UneDernièreDescription");

            firstTeam.Victories  = 0;
            firstTeam.Defeats    = 2;
            secondTeam.Victories = 3;
            secondTeam.Defeats   = 0;
            thirdTeam.Victories  = 8;
            thirdTeam.Defeats    = 1;
            fourthTeam.Victories = 2;
            fourthTeam.Defeats   = 2;

            firstPlayer.newTeam(firstTeam);
            secondPlayer.newTeam(secondTeam);
            thirdPlayer.newTeam(thirdTeam);
            fourthPlayer.newTeam(fourthTeam);

            Console.WriteLine("Le joueur " + firstPlayer.Pseudo + " engage son équipe: " + firstPlayer.TeamList[0].TeamName);
            Console.WriteLine("Le joueur " + secondPlayer.Pseudo + " engage son équipe: " + secondPlayer.TeamList[0].TeamName);
            Console.WriteLine("Le joueur " + thirdPlayer.Pseudo + " engage son équipe: " + thirdPlayer.TeamList[0].TeamName);
            Console.WriteLine("Le joueur " + fourthPlayer.Pseudo + " engage son équipe: " + fourthPlayer.TeamList[0].TeamName + "\n");
            Console.WriteLine("\n");

            Thread.Sleep(1800);
            //CONSTRUCTION DES GLADIATEURS ET EQUIPEMENTS ET ATTRIBUTION AUX EQUIPES (3gladiateurs/équipe pour ce test)---------------------------------------------------------------------------------------------------

            Gladiator g1 = new Gladiator("Spartacus");

            g1.newEquipment(new Dagger());
            g1.newEquipment(new Shield());

            Gladiator g2 = new Gladiator("Crixus");

            g2.newEquipment(new Helmet());
            g2.newEquipment(new Sword());

            Gladiator g3 = new Gladiator("Marcus");

            g3.newEquipment(new Helmet());
            g3.newEquipment(new Net());

            Gladiator g4 = new Gladiator("Attilius");

            g4.newEquipment(new Net());
            g4.newEquipment(new Helmet());

            Gladiator g5 = new Gladiator("Flamma");

            g5.newEquipment(new Trident());
            g5.newEquipment(new Helmet());

            Gladiator g6 = new Gladiator("Commodus");

            g6.newEquipment(new Sword());
            g6.newEquipment(new Dagger());

            Gladiator g7 = new Gladiator("Priscus");

            g7.newEquipment(new Helmet());
            g7.newEquipment(new Spear());

            Gladiator g8 = new Gladiator("Verus");

            g8.newEquipment(new Dagger());
            g8.newEquipment(new Dagger());
            g8.newEquipment(new Helmet());

            Gladiator g9 = new Gladiator("Carpophorus");

            g9.newEquipment(new Dagger());
            g9.newEquipment(new Spear());

            Gladiator g10 = new Gladiator("Ivy");

            g10.newEquipment(new Dagger());
            g10.newEquipment(new Spear());

            Gladiator g11 = new Gladiator("Kilik");

            g11.newEquipment(new Sword());
            g11.newEquipment(new Dagger());

            Gladiator g12 = new Gladiator("Paul");

            g12.newEquipment(new SmallShield());
            g12.newEquipment(new Dagger());

            firstTeam.NewGladiator(g1);
            firstTeam.NewGladiator(g2);
            firstTeam.NewGladiator(g3);
            secondTeam.NewGladiator(g4);
            secondTeam.NewGladiator(g5);
            secondTeam.NewGladiator(g6);
            thirdTeam.NewGladiator(g7);
            thirdTeam.NewGladiator(g8);
            thirdTeam.NewGladiator(g9);
            fourthTeam.NewGladiator(g10);
            fourthTeam.NewGladiator(g11);
            fourthTeam.NewGladiator(g12);

            Tournament trnmt = new Tournament(firstPlayer, secondPlayer, thirdPlayer, fourthPlayer);

            trnmt.startTournament();

            Console.Read();
        }
Exemple #7
0
 public void deleteGladiator(Gladiator g)
 {
     this.GladiatorList.Remove(g);
 }
Exemple #8
0
        //Méthode envoyant les gladiateurs se battre en duel 2 par deux et renvoi l'équipe perdante
        public Team teamsFight()
        {
            t1.GladiatorList[0].InCourse = true;
            t2.GladiatorList[0].InCourse = true;
            t1.GladiatorList[1].InCourse = true;
            t2.GladiatorList[1].InCourse = true;
            t1.GladiatorList[2].InCourse = true;
            t2.GladiatorList[2].InCourse = true;

            while (t1.GladiatorList[2].InCourse == true && t2.GladiatorList[2].InCourse == true)
            {
                gladInT1 = t1.GladiatorList[0];
                gladInT2 = t2.GladiatorList[0];

                if (t1.GladiatorList[0].InCourse == false)
                {
                    gladInT1 = t1.GladiatorList[1];
                }
                if (t1.GladiatorList[1].InCourse == false)
                {
                    gladInT1 = t1.GladiatorList[2];
                }

                if (t2.GladiatorList[0].InCourse == false)
                {
                    gladInT2 = t2.GladiatorList[1];
                }
                if (t2.GladiatorList[1].InCourse == false)
                {
                    gladInT2 = t2.GladiatorList[2];
                }

                Duel duel = new Duel(gladInT1, gladInT2);
                looser          = duel.FightToDeath();
                looser.InCourse = false;
            }

            if (t1.GladiatorList[2].InCourse == false && t2.GladiatorList[2].InCourse == true)
            {
                winnerTeam = t1;
                looserTeam = t2;

                Thread.Sleep(2000);
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("\n" + winnerTeam.TeamName + " remporte la manche");
                Console.ResetColor();
                Thread.Sleep(2000);
            }
            else if (t1.GladiatorList[2].InCourse == true && t2.GladiatorList[2].InCourse == false)
            {
                winnerTeam = t1;
                looserTeam = t2;

                Thread.Sleep(2000);
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("\n" + winnerTeam.TeamName + " remporte la manche");
                Console.ResetColor();
                Thread.Sleep(2000);
            }

            return(looserTeam);
        }
Exemple #9
0
        static void Main(string[] args)
        {
            //CONSTRUCTION DES JOUEURS----------------------------------------------------------------------------------------------------------------------------
            Player firstPlayer = new Player("Grurm", "Jean", "Dubois");
            Player secondPlayer = new Player("Zadin", "Jeanne", "Dutilleul");
            Player thirdPlayer = new Player("Lycan", "Pierre", "Dupont");
            Player fourthPlayer = new Player("Goteka", "Marie", "Martin");

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n---------------------------QUE LE TOURNOI COMMENCE !!---------------------------"); // <-- This line is still white on blue.
            Console.ResetColor();

            Thread.Sleep(1800);

            Console.WriteLine("\nVont s'affronter les joueurs suivants: " + firstPlayer.Pseudo + ", " + secondPlayer.Pseudo + ", " + thirdPlayer.Pseudo + " et " + fourthPlayer.Pseudo+"\n");

            //CONSTRUCTION DES EQUIPES ET ATTRIBUTION AUX JOUEURS (1équipe/joueur pour ce test)---------------------------------------------------------------------------------------------------
            Team firstTeam = new Team("Seventh Device", "EncoreUneDescription");
            Team secondTeam = new Team("Order of the Imperial", "UneNouvelleDescription");
            Team thirdTeam = new Team("Council of the Blue Threat", "UneDescriptio");
            Team fourthTeam = new Team("Ninja Eagles", "UneDernièreDescription");

            firstTeam.Victories = 0;
            firstTeam.Defeats = 2;
            secondTeam.Victories = 3;
            secondTeam.Defeats = 0;
            thirdTeam.Victories = 8;
            thirdTeam.Defeats = 1;
            fourthTeam.Victories = 2;
            fourthTeam.Defeats = 2;

            firstPlayer.newTeam(firstTeam);
            secondPlayer.newTeam(secondTeam);
            thirdPlayer.newTeam(thirdTeam);
            fourthPlayer.newTeam(fourthTeam);

            Console.WriteLine("Le joueur " + firstPlayer.Pseudo + " engage son équipe: "+ firstPlayer.TeamList[0].TeamName);
            Console.WriteLine("Le joueur " + secondPlayer.Pseudo + " engage son équipe: "+ secondPlayer.TeamList[0].TeamName);
            Console.WriteLine("Le joueur " + thirdPlayer.Pseudo + " engage son équipe: "+ thirdPlayer.TeamList[0].TeamName);
            Console.WriteLine("Le joueur " + fourthPlayer.Pseudo + " engage son équipe: "+ fourthPlayer.TeamList[0].TeamName + "\n");
            Console.WriteLine("\n");

            Thread.Sleep(1800);
            //CONSTRUCTION DES GLADIATEURS ET EQUIPEMENTS ET ATTRIBUTION AUX EQUIPES (3gladiateurs/équipe pour ce test)---------------------------------------------------------------------------------------------------

            Gladiator g1 = new Gladiator("Spartacus");
            g1.newEquipment(new Dagger());
            g1.newEquipment(new Shield());

            Gladiator g2 = new Gladiator("Crixus");
            g2.newEquipment(new Helmet());
            g2.newEquipment(new Sword());

            Gladiator g3 = new Gladiator("Marcus");
            g3.newEquipment(new Helmet());
            g3.newEquipment(new Net());

            Gladiator g4 = new Gladiator("Attilius");
            g4.newEquipment(new Net());
            g4.newEquipment(new Helmet());

            Gladiator g5 = new Gladiator("Flamma");
            g5.newEquipment(new Trident());
            g5.newEquipment(new Helmet());

            Gladiator g6 = new Gladiator("Commodus");
            g6.newEquipment(new Sword());
            g6.newEquipment(new Dagger());

            Gladiator g7 = new Gladiator("Priscus");
            g7.newEquipment(new Helmet());
            g7.newEquipment(new Spear());

            Gladiator g8 = new Gladiator("Verus");
            g8.newEquipment(new Dagger());
            g8.newEquipment(new Dagger());
            g8.newEquipment(new Helmet());

            Gladiator g9 = new Gladiator("Carpophorus");
            g9.newEquipment(new Dagger());
            g9.newEquipment(new Spear());

            Gladiator g10 = new Gladiator("Ivy");
            g10.newEquipment(new Dagger());
            g10.newEquipment(new Spear());

            Gladiator g11 = new Gladiator("Kilik");
            g11.newEquipment(new Sword());
            g11.newEquipment(new Dagger());

            Gladiator g12 = new Gladiator("Paul");
            g12.newEquipment(new SmallShield());
            g12.newEquipment(new Dagger());

            firstTeam.NewGladiator(g1);
            firstTeam.NewGladiator(g2);
            firstTeam.NewGladiator(g3);
            secondTeam.NewGladiator(g4);
            secondTeam.NewGladiator(g5);
            secondTeam.NewGladiator(g6);
            thirdTeam.NewGladiator(g7);
            thirdTeam.NewGladiator(g8);
            thirdTeam.NewGladiator(g9);
            fourthTeam.NewGladiator(g10);
            fourthTeam.NewGladiator(g11);
            fourthTeam.NewGladiator(g12);

            Tournament trnmt = new Tournament(firstPlayer, secondPlayer, thirdPlayer, fourthPlayer);
            trnmt.startTournament();

            Console.Read();
        }
Exemple #10
0
 //Méthodes permmettant l'ajout d'un gladiateur et la suppression
 public void NewGladiator(Gladiator g)
 {
     if (this.GladiatorList.Count < gladiatorNumberMaximumByTeam)
     {
         this.GladiatorList.Add(g);
     }
     else { Console.WriteLine("Nombre maximum de gladiateurs atteint"); }
 }
Exemple #11
0
 public void deleteGladiator(Gladiator g)
 {
     this.GladiatorList.Remove(g);
 }