Example #1
0
        private void FinDePartie()
        {
            FinPartieEventArgs p  = new FinPartieEventArgs();
            TrousseGlobale     TG = new TrousseGlobale();

            TG.OnFinPartie(p);
        }
Example #2
0
        private void PlaySound(System.IO.Stream uri)
        {
            JouerSonEventArgs p  = new JouerSonEventArgs(uri);
            TrousseGlobale    TG = new TrousseGlobale();

            TG.OnJouerSon(p);
        }
Example #3
0
        /// <summary>
        /// Permet d'avancer les phases du jeu.
        /// </summary>
        public void AvancerPhase()
        {
            if (Phase != 4)
            {
                Phase++;
            }
            else
            {
                Phase = 1;
                if (JoueurActifEst1)
                {
                    joueurActifEst1 = false;
                }
                else
                {
                    joueurActifEst1 = true;
                    NbTourComplet++;
                }
            }
            PhaseChangeEventArgs p  = new PhaseChangeEventArgs();
            TrousseGlobale       TG = new TrousseGlobale();

            TG.OnPhaseChange(p);
        }
Example #4
0
        private void ExecuterEffet()
        {
            if (AExecuter.Type == "impact")
            {
                // Si pas le nombre de cible n'est pas important, donc frappe tous ce qu'il y a dans cible.
                if (AExecuter.getCible() == 10 || AExecuter.getCible() == 11 || AExecuter.getNbCible() == 0)
                {
                    ExecuterImpact();
                }
                else if (joueurActifEst1)
                {
                    if (ChoixEffetPossible(AExecuter) >= AExecuter.getNbCible())
                    {
                        // Lancer un evenement pour que parti le catch.
                        ChoisirCibleEventArgs p  = new ChoisirCibleEventArgs(AExecuter.getCible(), AExecuter.getNbCible());
                        TrousseGlobale        TG = new TrousseGlobale();
                        TG.OnChoisirCible(p);
                    }
                    else if (ChoixEffetPossible(AExecuter) < AExecuter.getNbCible() && ChoixEffetPossible(AExecuter) > 0)
                    {
                        // Lancer un evenement pour que parti le catch.
                        ChoisirCibleEventArgs p  = new ChoisirCibleEventArgs(AExecuter.getCible(), ChoixEffetPossible(AExecuter));
                        TrousseGlobale        TG = new TrousseGlobale();
                        TG.OnChoisirCible(p);
                    }
                }
            }
            if (AExecuter.Type == "gain")
            {
                ExecuterGain();
            }
            if (AExecuter.Type == "recyclage")
            {
                ExecuterRecyclage();
            }

            /*
             *  Cible
             *  0	Tout le monde
             *  1	Tout les enemies
             *  2	Tout les allié
             *  3	Tout les bâtiments
             *  4	Bâtiments Enemies
             *  5	Bâtiments Allié
             *  6	Tout les Unités
             *  7	Unités Enemies
             *  8	Unités Allié
             *  9	Tout les Hero
             *  10	Hero Enemies
             *  11	Hero Allié
             *  12	Tout les Unités/Hero
             *  13	Unités/Hero Enemies
             *  14	Unités/Hero Allié
             *  15	Tout les Unités/Bâtiments
             *  16	Unités/Bâtiments Enemies
             *  17	Unités/Bâtiments Allié
             *  18	Tout les bâtiments/hero
             *  19	Bâtiments/Hero Enemies
             *  20	Bâtiments/Hero Allié
             *
             *  Valeur
             *  0	Destroy
             *  1 à 60	Quantité de dégats
             *
             *  NbCible
             *  0	Tout le monde
             *  1-2-3-4-etc...	La quantité exacte.
             *
             */
        }
Example #5
0
        /// <summary>
        /// Fonction qui permet de jouer une carte
        /// </summary>
        /// <param name="index">Position de la carte dans la main du joueur</param>
        /// <param name="position">Position dans le champs de bataille</param>
        public void JouerCarte(int index, int position)
        {
            // Le coup à pas été validé
            Carte aJouer;

            AExecuter = null;

            // Enlever la carte de la main du joueur et la mettre à l'endroit qu'elle va
            if (joueurActifEst1)
            {
                aJouer = LstMainJ1[index];

                Joueur1.RessourceActive -= aJouer.Cout;
                if (aJouer is Unite)
                {
                    ChampBatailleUnitesJ1.AjouterAuChamp(aJouer, position);
                    if (aJouer.EffetCarte != null)
                    {
                        AExecuter = aJouer.EffetCarte;
                    }
                    PlaySound(Cosmos.Properties.Resources.rebel);
                }
                else if (aJouer is Batiment)
                {
                    ChampConstructionsJ1.AjouterAuChamp(aJouer);
                    PlaySound(Cosmos.Properties.Resources.batiment);
                }
                else if (aJouer is Gadget)
                {
                    if (aJouer.EffetCarte != null)
                    {
                        AExecuter = aJouer.EffetCarte;
                        PlaySound(Cosmos.Properties.Resources.jabba);
                    }
                    LstUsineRecyclageJ1.Add(aJouer);
                }
                // On enleve la carte de la main
                LstMainJ1.Remove(aJouer);
            }
            else
            {
                aJouer = LstMainJ2[index];

                // On enleve les ressources au joueurs
                Joueur2.RessourceActive -= aJouer.Cout;

                if (aJouer is Unite)
                {
                    ChampBatailleUnitesJ2.AjouterAuChamp(aJouer, position);
                    if (aJouer.EffetCarte != null)
                    {
                        AExecuter = aJouer.EffetCarte;
                    }
                    PlaySound(Cosmos.Properties.Resources.imperial);
                }
                if (aJouer is Batiment)
                {
                    ChampConstructionsJ2.AjouterAuChamp(aJouer);
                    PlaySound(Cosmos.Properties.Resources.batiment);
                }
                if (aJouer is Gadget)
                {
                    if (aJouer.EffetCarte != null)
                    {
                        AExecuter = aJouer.EffetCarte;
                        PlaySound(Cosmos.Properties.Resources.doh1);
                    }
                    LstUsineRecyclageJ2.Add(aJouer);
                }
                // On enleve la carte de la main
                LstMainJ2.Remove(aJouer);
                // Refresh all
                RefreshAllEventArgs p  = new RefreshAllEventArgs();
                TrousseGlobale      TG = new TrousseGlobale();
                TG.OnRefreshAll(p);
            }
            if (AExecuter != null)
            {
                ExecuterEffet();
            }
        }