Пример #1
0
        private void btnSoin_Click(object sender, EventArgs e)
        {
            SoinActif = true;
            //Nb point de vie guérison
            m_ViePerso += (int)PersonnageComplet[4] / 4;
            //Depacement vie
            #region depacement de capacité
            if (m_ViePerso > (int)PersonnageComplet[4])
            {
                m_ViePerso = (int)PersonnageComplet[4];
            }
            #endregion
            //Affichage
            #region Affichage
            BarreVie.Step = (int)PersonnageComplet[4] / 4;
            BarreVie.PerformStep();
            lbViePerso.Text = m_ViePerso.ToString() + "/" + PersonnageComplet[4].ToString();
            lbSoin.Visible  = true;
            lbSoin.Text     = "+" + ((int)PersonnageComplet[4] / 4).ToString();
            #endregion

            btnAttack_Click(sender, e);

            //remise a neuf de la variable soin pour faire disparaitre bouton
            Soin = (int)PersonnageComplet[8];
            #region changement graphique
            btnSoin.Enabled = false;
            #endregion
            SoinActif = false;
        }
Пример #2
0
        public Monde_2(int ChoixPerso, int Money, int[] ArmeenMain)
        {
            InitializeComponent();
            sp.PlayLooping();

            #region Initialisation Arme choix perso + Argent
            m_Argent      = Money;
            lbArgent.Text = m_Argent.ToString();
            m_choix       = ChoixPerso;
            TabArmeenMain = ArmeenMain;
            TabArmes      = (object[])a.TableauDarme();
            lbBoss.Text   = "BOSS DANS " + m_NbrestantMonstreBoss + " VAGUES";
            #endregion
            #region Initialisation globale Premier combat en ouvrant la forme
            //Choix du personnage;
            #region choixPerso

            switch (m_choix)
            {
            case 0: pbPerso.Image = global::Jeu.Properties.Resources.AlienArmurelegerte;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien Armure legerte", 120);
                choixArme         = 0;

                break;

            case 1: pbPerso.Image = global::Jeu.Properties.Resources.AlienHeavyWarrior;
                pbArme1.Image     = global::Jeu.Properties.Resources.PlasmaGun;
                m_persoChoisi     = new cPersonnage("Alien Armure lourde", 140);
                choixArme         = 1;

                break;

            case 2: pbPerso.Image = global::Jeu.Properties.Resources.AlienIngenieur;
                pbArme1.Image     = global::Jeu.Properties.Resources.PlasmaGun;
                m_persoChoisi     = new cPersonnage("Alien Ingenieur", 130);
                choixArme         = 1;

                break;

            case 3: pbPerso.Image = global::Jeu.Properties.Resources.AlienMedic;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien Medic", 120);
                choixArme         = 0;

                break;

            case 4: pbPerso.Image = global::Jeu.Properties.Resources.AlienÉclaireur;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien eclaireur", 100);
                choixArme         = 0;

                break;

            case 5: pbPerso.Image = global::Jeu.Properties.Resources.AlienSamourai;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien Samourai", 110);
                choixArme         = 0;
                break;
            }
            #endregion

            //Choix darmes (initialiser ak les armes acquises)
            #region ChoixArme
            if (TabArmeenMain[2] == 1)
            {
                pbArme2.Image = global::Jeu.Properties.Resources.klarix;
            }
            if (TabArmeenMain[3] == 1)
            {
                pbArme3.Image = global::Jeu.Properties.Resources.Catagan;
            }
            if (TabArmeenMain[4] == 1)
            {
                pbArme4.Image = global::Jeu.Properties.Resources.TwisterGun;
            }
            if (TabArmeenMain[5] == 1)
            {
                pbArme5.Image = global::Jeu.Properties.Resources.Desintregrateur;
            }
            #endregion

            //initialisateur de vie perso
            #region InitialisateurviePerso
            m_ViePerso       = m_persoChoisi.Vie;
            BarreVie.Step    = m_ViePerso;
            BarreVie.Maximum = m_ViePerso;
            BarreVie.PerformStep();
            lbViePerso.Text = m_persoChoisi.Vie.ToString() + "/" + m_persoChoisi.Vie.ToString();
            #endregion

            ///Choix mechant
            ///initialisateur
            #region ChoixMechant + InitialisateurvieMechant
            TabMonstre[0] = new cMonstre("Akasha", 30, 40, 5, 40);   //Vie- Attack++ defense- xp++
            TabMonstre[1] = new cMonstre("Malakai", 50, 20, 5, 30);  //Vie+ Attack+ defense- xp+
            TabMonstre[2] = new cMonstre("Scythe", 60, 15, 10, 20);  //Vie++ Attack defense xp
            TabMonstre[3] = new cMonstre("Nergal", 40, 15, 5, 10);   // Vie Attack defense- xp-
            TabMonstre[4] = new cMonstre("Devdan", 100, 50, 10, 70); //BOSS


            //; Tibarn; Tormod;  Zihark; Haar; Lethe; Reyson; ; Caineghis; Kurthnaga ...

            m_NumeroMonstre  = ChoisirHasardMechant(1);
            m_NumeroMonstre2 = ChoisirHasardMechant(2);

            m_monstreChoisi  = ((cMonstre)TabMonstre[m_NumeroMonstre]);
            m_monstreChoisi2 = ((cMonstre)TabMonstre[m_NumeroMonstre2]);

            #endregion

            //actions initialisateur
            #region ActionMechantInitialisateur
            /*ATTACK*/
            TabActions[0] = new cActionMechant(m_monstreChoisi.m_Dommage, 0);
            /*DEFENSE*/
            TabActions[1] = new cActionMechant(0, m_monstreChoisi.m_defense);
            #endregion

            #region ActionMechantInitialisateur2
            /*ATTACK*/
            TabActionsMechant2[0] = new cActionMechant(m_monstreChoisi2.m_Dommage, 0);
            /*DEFENSE*/
            TabActionsMechant2[1] = new cActionMechant(0, m_monstreChoisi2.m_defense);
            #endregion

            #endregion
        }
Пример #3
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            //Action aleatoire mechant
            #region Action Choisi 2 monstre
            if (!MechantMort)
            {
                NumAction = ActionMechatHasard();
            }
            else
            {
                NumAction = -1;
            }
            if (!MechantMort2)
            {
                NumActionMechant2 = ActionMechatHasard();
            }
            else
            {
                NumActionMechant2 = -1;
            }
            #endregion

            //texte selon choix de ladversaire
            #region texte
            Thread.Sleep(800);
            #region Mechant1
            if (NumAction == 0)
            {
                lbActionMechant.Text      = "Attack";
                lbActionMechant.ForeColor = Color.Red;
                lbActionMechant.Visible   = true;
            }
            else
            if (NumAction == 1)
            {
                lbActionMechant.Text      = "Defense";
                lbActionMechant.ForeColor = Color.Cyan;
                lbActionMechant.Visible   = true;
            }
            #endregion
            #region Mechant2
            if (NumActionMechant2 == 0)
            {
                lbActionMechant2.Text      = "Attack";
                lbActionMechant2.ForeColor = Color.Red;
                lbActionMechant2.Visible   = true;
            }
            else
            if (NumActionMechant2 == 1)
            {
                lbActionMechant2.Text      = "Defense";
                lbActionMechant2.ForeColor = Color.Cyan;
                lbActionMechant2.Visible   = true;
            }
            Thread.Sleep(1000);
            #endregion
            #endregion

            //Selon lactionchoisi
            #region Point dattack et de defense 2 monstre
            if (!MechantMort)
            {
                ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
                ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;
            }
            if (!MechantMort2)
            {
                ActionAttackmechant2  = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Domm;
                ActionDefensemechant2 = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Protection;
            }
            #endregion

            //selon larme choisi du perso
            Attack = ((cArme)TabArmes[choixArme]).DommageMax;

            //Calcul ds letat de vie (mechant)
            #region Calcul etat de vie mechant
            if (!MechantMort)
            {
                #region Monstre 1
                if (m_MonstreaAttaquer == 1)
                {
                    BarreVieMechant.Step = -Attack + ActionDefensemechant;
                    m_VieMechant        += BarreVieMechant.Step;
                    Thread.Sleep(500);
                }
                #endregion
            }
            if (!MechantMort2)
            {
                #region Monstre 2
                if (m_MonstreaAttaquer == 2)
                {
                    BarreVieMechant2.Step = -Attack + ActionDefensemechant2;
                    m_VieMechant2        += BarreVieMechant2.Step;
                    Thread.Sleep(500);
                }
                #endregion
            }
            #endregion

            //changement graphique apres attack contre mechant
            #region changementGraphMechant
            #region Monstre 1
            if (m_MonstreaAttaquer == 1)
            {
                BarreVieMechant.PerformStep();
                lbDomMechant.Text = BarreVieMechant.Step.ToString();
            }
            #endregion
            #region Monstre 2
            else
            {
                BarreVieMechant2.PerformStep();
                lbDomMechant2.Text = BarreVieMechant2.Step.ToString();
            }
            #endregion

            //texte vie mechant
            lbVieMechant.Text  = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
            lbVieMechant2.Text = m_VieMechant2 + "/" + m_monstreChoisi2.m_Vie.ToString();
            #endregion

            //Si la vie du montre tombe a zero(et celle du boss)
            #region SI Monstre 0 HP + desactivation de lattack pour continuer
            string cs = "";


            #region si Monstre 1 battu (boss inclus dedans)
            if (m_VieMechant <= 0 && MechantMort == false)
            {
                MechantMort = true;
                #region Mise a zero du monstre 1
                m_VieMechant         = 0;
                lbVieMechant.Text    = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text    = "0";
                lbActionMechant.Text = "";
                pbMechant.Enabled    = false;
                lbMechant.Enabled    = false;
                pbMechant.Image      = null;
                #endregion
                #region passe a lennemi 2
                if (!MechantMort2)
                {
                    pbMechant2_Click(sender, e);
                }
                #endregion
                m_Argent += m_monstreChoisi.m_ArgentRecu;
                //AFFICHAGE DE Largent ACQUISE

                #region si Boss Vaincu
                if (m_NbrestantMonstreBoss == 0)    //SI BOSS VAINCU
                {
                    PLanete3Permise = true;
                    cs = String.Format("VOUS AVEZ VAINCU LE BOSS alias ({0}) \n \n {1}\n\n ARGENT RECU {2}", m_monstreChoisi.m_nom, m_persoChoisi.nom, m_monstreChoisi.m_ArgentRecu);
                    this.Close();
                }

                #endregion

                else
                {
                    cs = String.Format("{0}\n\n ARGENT RECU {1}", m_persoChoisi.nom, m_monstreChoisi.m_ArgentRecu);
                    MessageBox.Show(cs);
                }
            }
            #endregion
            #region si Monstre 2 battu
            if (m_VieMechant2 <= 0 && MechantMort2 == false)
            {
                MechantMort2 = true;
                #region mise a zero du monstre 2
                pbMechant2.Enabled    = false;
                pbMechant2.Image      = null;
                lbMechant2.Enabled    = false;
                m_VieMechant2         = 0;
                lbVieMechant2.Text    = m_VieMechant2 + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre2]).m_Vie.ToString();
                lbDomMechant2.Text    = "0";
                lbActionMechant2.Text = "";
                #endregion
                #region passe a l'ennemi 1
                if (!MechantMort)
                {
                    pbMechant_Click(sender, e);
                }
                #endregion
                m_Argent += m_monstreChoisi2.m_ArgentRecu;

                //AFFICHAGE DE Largent ACQUISE
                cs = String.Format("{0}\n\n ARGENT RECU {1}", m_persoChoisi.nom, m_monstreChoisi2.m_ArgentRecu);
                MessageBox.Show(cs);
            }
            #endregion

            lbArgent.Text = m_Argent.ToString();

            #region Si les 2 monstres sont battus
            if (m_VieMechant <= 0 && m_VieMechant2 <= 0)
            {
                //desactivation du bouton dattack
                btnAttack.Enabled   = false;
                btnContinue.Enabled = true;
                return;
            }
            #endregion


            #endregion

            //calcul de vie perso (attack des 2 monstre)

            if (MechantMort == true)
            {
                ActionAttackmechant = 0;
            }
            if (MechantMort2 == true)
            {
                ActionAttackmechant2 = 0;
            }
            BarreVie.Step = -(ActionAttackmechant + ActionAttackmechant2);
            m_ViePerso   += BarreVie.Step;



            //Si la vie du perso tombe a zero
            #region SI Perso 0 HP+desactivation de lattack
            if (m_ViePerso <= 0)
            {
                m_ViePerso      = 0;
                lbViePerso.Text = m_ViePerso + "/" + m_persoChoisi.Vie.ToString();
                lbDomPerso.Text = "0";
                BarreVie.Step   = -400;
                BarreVie.PerformStep();

                //AFFICHAGE Du MESSAGE DE LA MORT
                cs = "";
                cs = String.Format("{0}\n\n VOUS ETES MORT ", m_persoChoisi.nom);
                this.Close();
                MessageBox.Show(cs);

                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            #endregion


            //Changement graphique vie perso
            #region changementGraphPerso
            BarreVie.PerformStep();

            if (ActionAttackmechant == 0 && ActionAttackmechant2 == 0)
            {
                lbDomPerso.Text = "0";
            }
            else
            {
                lbDomPerso.Text = BarreVie.Step.ToString();
            }

            lbViePerso.Text = m_ViePerso + "/" + m_persoChoisi.Vie.ToString();
            #endregion
        }
Пример #4
0
        public dNiveauFinale(object [] Pcomplet, int WeaponSelected, int R1, int R2) : this()
        {
            sp.PlayLooping();
            PersonnageComplet = Pcomplet;
            #region Initialisation Arme choix perso + Argent
            m_Argent      = (int)Pcomplet[6];
            lbArgent.Text = m_Argent.ToString();
            ArmeChoisi    = WeaponSelected;
            #endregion
            #region Experience et Planete + Rune
            m_Experience      = (int)Pcomplet[7];
            lbExperience.Text = m_Experience.ToString();
            Rune1             = R1;
            Rune2             = R2;
            #endregion
            #region Soin
            Soin = (int)PersonnageComplet[8];
            #endregion
            #region Initialisation globale Premier combat en ouvrant la forme
            //Choix du personnage;
            #region choixPerso
            pbPerso.Image = (Image)Pcomplet[2];
            #endregion

            //Choix darmes (avec l'arme Choisi)
            #region ChoixArme
            switch (ArmeChoisi)
            {
            case 0:
                pbArme1.Image             = Image.FromFile("Arme\\Zat.jpg");
                lbArmeEncours.Text        = "ZAT";
                lbDommageArmeEncours.Text = (cArme.Tabarme[0]).DommageMax.ToString();
                break;

            case 1:
                pbArme1.Image             = Image.FromFile("Arme\\PlasmaGun.jpg");
                lbArmeEncours.Text        = "PLASMA GUN";
                lbDommageArmeEncours.Text = (cArme.Tabarme[1]).DommageMax.ToString();
                break;

            case 2:
                pbArme1.Image             = Image.FromFile("Arme\\Klarix.jpg");
                lbArmeEncours.Text        = "Klarix";
                lbDommageArmeEncours.Text = (cArme.Tabarme[2]).DommageMax.ToString();

                break;

            case 3:
                pbArme1.Image             = Image.FromFile("Arme\\Catagan.jpg");
                lbArmeEncours.Text        = "Catagan";
                lbDommageArmeEncours.Text = (cArme.Tabarme[3]).DommageMax.ToString();
                break;

            case 4:
                pbArme1.Image             = Image.FromFile("Arme\\TwisterGun.jpg");
                lbArmeEncours.Text        = "Twister Gun";
                lbDommageArmeEncours.Text = (cArme.Tabarme[4]).DommageMax.ToString();
                break;

            case 5:
                pbArme1.Image             = Image.FromFile("Arme\\Desintegrateur.jpg");
                lbArmeEncours.Text        = "Désintégrateur";
                lbDommageArmeEncours.Text = (cArme.Tabarme[5]).DommageMax.ToString();
                break;

            case 6:
                pbArme1.Image             = Image.FromFile("Arme\\NUKE.jpg");
                lbArmeEncours.Text        = "Bombe";
                lbDommageArmeEncours.Text = (cArme.Tabarme[6]).DommageMax.ToString();
                break;
            }

            #endregion

            //rune en main et bouton magie
            #region Rune/Initialisation Bouton Magie
            if (Rune1 == 1)
            {
                pbRune1.Image   = Image.FromFile("Runes\\Rune4.jpg");
                pbRune1.Visible = true;
                btnSoin.Visible = true;
            }
            if (Rune2 == 1)
            {
                pbRune2.Image   = Image.FromFile("Runes\\Rune1.jpg");
                pbRune2.Visible = true;
            }
            #endregion

            //initialisateur de vie perso
            #region InitialisateurviePerso
            m_ViePerso       = (int)Pcomplet[4];
            BarreVie.Step    = m_ViePerso;
            BarreVie.Maximum = m_ViePerso;
            BarreVie.PerformStep();
            lbViePerso.Text = ((int)Pcomplet[4]).ToString() + "/" + ((int)Pcomplet[4]).ToString();
            #endregion

            ///Choix mechant
            ///initialisateur
            #region ChoixMechant + InitialisateurvieMechant

            for (int i = 0; i < 5; i++)
            {
                TabMonstre[i]      = dMonde_1.RetourneTabMonstre1()[i];
                TabMonstre[i + 5]  = Monde_2.RetourneTabMonstre2()[i];
                TabMonstre[i + 10] = dMonde_3.RetourneTabMonstre3()[i];
            }

            TabMonstre[15]  = dMonde_3.RetourneTabMonstre3()[5];
            TabMonstre[16]  = new cMonstre("Blutbad BOSS FINAL", 200, 20, 5, 80, Image.FromFile("Mechant.Marchand\\P4MechantBoss.jpg"));//BOSS
            m_NumeroMonstre = TabOrdreDesMonstre[IndiceTabMonstre];
            InitialisteurDeVieMechant(m_NumeroMonstre, 1);
            m_monstreChoisi = ((cMonstre)TabMonstre[m_NumeroMonstre]);

            #endregion

            #region NextEnnemi
            pbNextEnnemi.Image = (Image)(TabMonstre[TabOrdreDesMonstre[IndiceTabMonstre + 1]].m_ImageMonstre);
            #endregion

            //actions initialisateur
            #region ActionMechantInitialisateur
            /*ATTACK*/
            TabActions[0] = new cActionMechant(m_monstreChoisi.m_Dommage, 0);
            /*DEFENSE*/
            TabActions[1] = new cActionMechant(0, m_monstreChoisi.m_defense);
            #endregion

            #region ActionMechantInitialisateur2
            /*ATTACK*/
            TabActionsMechant2[0] = new cActionMechant(((cMonstre)TabMonstre[16]).m_Dommage, 0);
            /*DEFENSE*/
            TabActionsMechant2[1] = new cActionMechant(0, ((cMonstre)TabMonstre[16]).m_defense);
            #endregion

            #region ActionMechantInitialisateur3
            /*ATTACK*/
            TabActionsMechant3[0] = new cActionMechant(((cMonstre)TabMonstre[16]).m_Dommage, 0);
            /*DEFENSE*/
            TabActionsMechant3[1] = new cActionMechant(0, ((cMonstre)TabMonstre[16]).m_defense);
            #endregion
            #endregion
        }
Пример #5
0
        public Monde_1(int ChoixPerso)
        {
            InitializeComponent();
            sp.PlayLooping();
            m_choix  = ChoixPerso;
            TabArmes = (object[])a.TableauDarme();
            switch (m_choix)
            {
            case 0: pbPerso.Image = global::Jeu.Properties.Resources.AlienArmurelegerte;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien Armure legerte", 120);

                break;

            case 1: pbPerso.Image = global::Jeu.Properties.Resources.AlienHeavyWarrior;
                pbArme1.Image     = global::Jeu.Properties.Resources.PlasmaGun;
                m_persoChoisi     = new cPersonnage("Alien Armure lourde", 140);

                break;

            case 2: pbPerso.Image = global::Jeu.Properties.Resources.AlienIngenieur;
                pbArme1.Image     = global::Jeu.Properties.Resources.PlasmaGun;
                m_persoChoisi     = new cPersonnage("Alien Ingenieur", 130);

                break;

            case 3: pbPerso.Image = global::Jeu.Properties.Resources.AlienMedic;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien Medic", 120);

                break;

            case 4: pbPerso.Image = global::Jeu.Properties.Resources.AlienÉclaireur;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien eclaireur", 100);

                break;

            case 5: pbPerso.Image = global::Jeu.Properties.Resources.AlienSamourai;
                pbArme1.Image     = global::Jeu.Properties.Resources.Zat;
                m_persoChoisi     = new cPersonnage("Alien Samourai", 110);

                break;
            }

            //initialisateur de vie perso
            m_ViePerso       = m_persoChoisi.Vie;
            BarreVie.Step    = m_ViePerso;
            BarreVie.Maximum = m_ViePerso;
            BarreVie.PerformStep();
            lbViePerso.Text = m_persoChoisi.Vie.ToString() + "/" + m_persoChoisi.Vie.ToString();
            ///Choix mechant
            ///initialisateur
            TabMonstre[0] = new cMonstre("Alastor", 30, 40, 5, 40);  //Vie- Attack++ defense- xp++
            TabMonstre[1] = new cMonstre("Scorn", 50, 20, 5, 30);    //Vie+ Attack+ defense- xp+
            TabMonstre[2] = new cMonstre("Kragoth", 60, 15, 10, 20); //Vie++ Attack defense xp
            TabMonstre[3] = new cMonstre("Nasir", 40, 15, 5, 10);    // Vie Attack defense- xp-
            //Sinon ^^ , Scythe, Scorn, Malakai, Akasha,
            //Ashnard; Nergal; Tibarn; Tormod; Devdan; Zihark; Haar; Lethe; Reyson; ; Caineghis; Kurthnaga ...

            m_NumeroMonstre = ChoisirHasardMechant();
            m_monstreChoisi = ((cMonstre)TabMonstre[m_NumeroMonstre]);
            //initialisateur de vie mechant
            m_VieMechant            = m_monstreChoisi.m_Vie;
            BarreVieMechant.Step    = m_VieMechant;
            BarreVieMechant.Maximum = m_VieMechant;
            BarreVieMechant.PerformStep();
            LbVieMechant.Text = m_VieMechant.ToString() + "/" + m_VieMechant.ToString();
            //actions initialisateur
            /*ATTACK*/
            TabActions[0] = new cActionMechant(m_monstreChoisi.m_Dommage, 0);
            /*DEFENSE*/
            TabActions[1] = new cActionMechant(0, m_monstreChoisi.m_defense);
        }
Пример #6
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            //decrementation variable Soin
            #region Rune de soin - Utilisation
            Soin--;
            if (!SoinActif)
            {
                lbSoin.Visible = false;
                lbSoin.Enabled = false;
            }
            if (Soin <= 0)
            {
                btnSoin.Enabled = true;
            }

            #endregion

            //Action aleatoire mechant si NON PARALYSÉ
            #region Action Choisi par les 3 monstre
            #region si monstre 1 est pas paralysée et pas mort

            if (!MechantMort && !MonstreParalysé)
            {
                NumAction = ActionMechatHasard();
            }
            else
            {
                NumAction = -1;
            }

            #endregion
            if (BossActivate)
            {
                #region si monstre 2 est pas paralysé et pas mort

                if (!MechantMort2)
                {
                    NumActionMechant2 = ActionMechatHasard();
                }
                else
                {
                    NumActionMechant2 = -1;
                }

                #endregion
                #region si monstre 3 est pas paralysé et pas mort
                if (!MechantMort3)
                {
                    NumActionMechant3 = ActionMechatHasard();
                }
                else
                {
                    NumActionMechant3 = -1;
                }

                #endregion
            }
            #endregion

            #region Point dattack et de defense 3 monstre
            #region Monstre 1
            if (!MechantMort && !MonstreParalysé)
            {
                ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
                ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;
            }

            #endregion

            if (BossActivate)
            {
                #region Monstre 2
                if (!MechantMort2)
                {
                    ActionAttackmechant2  = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Domm;
                    ActionDefensemechant2 = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Protection;
                }

                #endregion
                #region Monstre 3
                if (!MechantMort3)
                {
                    ActionAttackmechant3  = ((cActionMechant)TabActionsMechant3[NumActionMechant3]).Domm;
                    ActionDefensemechant3 = ((cActionMechant)TabActionsMechant3[NumActionMechant3]).Protection;
                }

                #endregion
            }
            #endregion

            //Texte selon Lattaque du monstre
            #region texte
            Thread.Sleep(500);
            #region Mechant1


            if (NumAction == 0)
            {
                lbActionMechant.Text      = "Attack";
                lbActionMechant.ForeColor = Color.Red;
                lbActionMechant.Visible   = true;
            }
            else
            if (NumAction == 1)
            {
                lbActionMechant.Text      = "Defense";
                lbActionMechant.ForeColor = Color.Cyan;
                lbActionMechant.Visible   = true;
            }


            #endregion
            if (BossActivate)
            {
                #region Mechant2

                if (NumActionMechant2 == 0)
                {
                    lbActionMechant2.Text      = "Attack";
                    lbActionMechant2.ForeColor = Color.Red;
                    lbActionMechant2.Visible   = true;
                }
                else
                if (NumActionMechant2 == 1)
                {
                    lbActionMechant2.Text      = "Defense";
                    lbActionMechant2.ForeColor = Color.Cyan;
                    lbActionMechant2.Visible   = true;
                }

                #endregion
                #region Mechant3
                if (NumActionMechant3 == 0)
                {
                    lbActionMechant3.Text      = "Attack";
                    lbActionMechant3.ForeColor = Color.Red;
                    lbActionMechant3.Visible   = true;
                }
                else
                if (NumActionMechant3 == 1)
                {
                    lbActionMechant3.Text      = "Defense";
                    lbActionMechant3.ForeColor = Color.Cyan;
                    lbActionMechant3.Visible   = true;
                }


                #endregion
            }
            #endregion

            //selon larme choisi
            #region Attack du joueur si nest pas en mode Soin
            if (!SoinActif)
            {
                Attack = (cArme.Tabarme[ArmeChoisi]).DommageMax;
            }
            else
            {
                Attack = 0;
            }
            #endregion

            //Calcul ds letat de vie (mechant)
            #region Calcul etat de vie mechant
            if (!MechantMort)
            {
                #region Monstre 1
                if (m_MonstreaAttaquer == 1)
                {
                    if (!SoinActif)
                    {
                        BarreVieMechant.Step = -Attack + ActionDefensemechant;
                        m_VieMechant        += BarreVieMechant.Step;
                    }
                    else
                    {
                        BarreVieMechant.Step = 0;
                    }
                }
                #endregion
            }


            if (BossActivate)
            {
                if (!MechantMort2)
                {
                    #region Monstre 2
                    if (m_MonstreaAttaquer == 2)
                    {
                        if (!SoinActif)
                        {
                            BarreVieMechant2.Step = -Attack + ActionDefensemechant2;
                            m_VieMechant2        += BarreVieMechant2.Step;
                        }
                        else
                        {
                            BarreVieMechant2.Step = 0;
                        }
                    }
                    #endregion
                }

                if (!MechantMort3)
                {
                    #region Monstre 3
                    if (m_MonstreaAttaquer == 3)
                    {
                        if (!SoinActif)
                        {
                            BarreVieMechant3.Step = -Attack + ActionDefensemechant3;
                            m_VieMechant3        += BarreVieMechant3.Step;
                        }
                        else
                        {
                            BarreVieMechant3.Step = 0;
                        }
                    }
                    #endregion
                }
            }
            Thread.Sleep(500);
            #endregion



            //changement graphique apres attack contre mechant
            #region changementGraphMechant

            if (m_MonstreaAttaquer == 1)
            {
                #region Monstre 1
                BarreVieMechant.PerformStep();
                if (!MonstreParalysé)
                {
                    lbDomMechant.Text = BarreVieMechant.Step.ToString();
                }
                LbVieMechant.Text = m_VieMechant.ToString() + "/" + (TabMonstre[m_NumeroMonstre].m_Vie).ToString();
                #endregion
            }

            if (BossActivate)
            {
                if (m_MonstreaAttaquer == 2)
                {
                    #region Monstre 2
                    BarreVieMechant2.PerformStep();
                    lbDomMechant2.Text = BarreVieMechant2.Step.ToString();
                    lbViemechant2.Text = m_VieMechant2.ToString() + "/" + (TabMonstre[16].m_Vie).ToString();
                    #endregion
                }
                else
                {
                    #region Monstre 3
                    BarreVieMechant3.PerformStep();
                    lbDomMechant3.Text = BarreVieMechant3.Step.ToString();
                    lbVieMechant3.Text = m_VieMechant3.ToString() + "/" + (TabMonstre[16].m_Vie).ToString();
                    #endregion
                }
            }
            #endregion

            //Si la vie du montre tombe a zero(et celle du boss)
            #region SI Monstre 0 HP + desactivation de lattack pour continuer
            string cs = "";

            #region si Monstre 1 battu (boss inclus dedans)
            if (m_VieMechant <= 0 && MechantMort == false)
            {
                MechantMort = true;
                #region Compteur pour paralysie(si Rune 2 acquise)
                if (Rune2 == 1)
                {
                    Paralysie--;
                }
                #endregion
                #region Mise a zero du monstre 1
                m_VieMechant         = 0;
                LbVieMechant.Text    = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text    = "0";
                lbActionMechant.Text = "";
                LbMechant.Text      += " (MORT)";
                pbMechant.Enabled    = false;
                LbVieMechant.Enabled = false;
                pbMechant.Image      = null;

                #endregion
                #region passe a lennemi 2 ou 3 tout dependant s'il est mort
                if (BossActivate)
                {
                    if (!MechantMort2)
                    {
                        pbNextEnnemi_Click(sender, e);
                    }
                    else
                    if (!MechantMort3)
                    {
                        pbMiniBoss3_Click(sender, e);
                    }
                }
                #endregion
                m_Argent += m_monstreChoisi.m_ArgentRecu;
                m_Experience++;
                lbArgent.Text     = m_Argent.ToString();
                lbExperience.Text = m_Experience.ToString();
                //AFFICHAGE DE Largent ACQUISE

                cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                MessageBox.Show(cs);
            }
            #endregion

            if (BossActivate)
            {
                #region si Monstre 2 battu
                if (m_VieMechant2 <= 0 && MechantMort2 == false)
                {
                    MechantMort2 = true;
                    #region Compteur pour paralysie(si Rune 2 acquise)
                    if (Rune2 == 1)
                    {
                        Paralysie--;
                    }
                    #endregion
                    #region mise a zero du monstre 2
                    pbNextEnnemi.Enabled  = false;
                    pbNextEnnemi.Image    = null;
                    pbNextEnnemi.Enabled  = false;
                    lbNextEnnemi.Text    += " (MORT)";
                    m_VieMechant2         = 0;
                    lbViemechant2.Text    = m_VieMechant2 + "/" + ((cMonstre)TabMonstre[16]).m_Vie.ToString();
                    lbDomMechant2.Text    = "0";
                    lbActionMechant2.Text = "";
                    //  panMechant2.BackColor = Color.Black;
                    #endregion
                    #region passe a l'ennemi 1 ou 3
                    if (!MechantMort)
                    {
                        pbMechant_Click(sender, e);
                    }
                    else
                    if (!MechantMort3)
                    {
                        pbMiniBoss3_Click(sender, e);
                    }
                    #endregion
                    m_Argent += ((cMonstre)TabMonstre[16]).m_ArgentRecu;
                    m_Experience++;
                    lbArgent.Text     = m_Argent.ToString();
                    lbExperience.Text = m_Experience.ToString();
                    //AFFICHAGE DE Largent ACQUISE
                    cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], ((cMonstre)TabMonstre[16]).m_ArgentRecu, m_Experience);
                    MessageBox.Show(cs);
                }
                #endregion
                #region si Monstre 3 battu
                if (m_VieMechant3 <= 0 && MechantMort3 == false)
                {
                    MechantMort3 = true;
                    #region Compteur pour paralysie(si Rune 2 acquise)
                    if (Rune2 == 1)
                    {
                        Paralysie--;
                    }
                    #endregion
                    #region mise a zero du monstre 3
                    pbMiniBoss3.Enabled   = false;
                    pbMiniBoss3.Image     = null;
                    pbMiniBoss3.Enabled   = false;
                    lbMiniboss3.Text     += " (MORT)";
                    m_VieMechant3         = 0;
                    lbVieMechant3.Text    = m_VieMechant3 + "/" + ((cMonstre)TabMonstre[16]).m_Vie.ToString();
                    lbDomMechant3.Text    = "0";
                    lbActionMechant3.Text = "";
                    // panMechant3.BackColor = Color.Black;
                    #endregion
                    #region passe a l'ennemi 1 ou 2
                    if (!MechantMort)
                    {
                        pbMechant_Click(sender, e);
                    }
                    else
                    if (!MechantMort2)
                    {
                        pbMiniBoss3_Click(sender, e);
                    }
                    #endregion
                    m_Argent += ((cMonstre)TabMonstre[16]).m_ArgentRecu;
                    m_Experience++;
                    lbArgent.Text     = m_Argent.ToString();
                    lbExperience.Text = m_Experience.ToString();
                    //AFFICHAGE DE Largent ACQUISE
                    cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], ((cMonstre)TabMonstre[16]).m_ArgentRecu, m_Experience);
                    MessageBox.Show(cs);
                }
                #endregion
            }

            #region Si les 3 monstres sont battus
            if (BossActivate)
            {
                if (m_VieMechant <= 0 && m_VieMechant2 <= 0 && m_VieMechant3 <= 0)
                {
                    #region si Boss Vaincu
                    FIN = true;
                    MessageBox.Show("VOUS AVEZ VAINCU LE  DERNIER ET ULTIME BOSS BRAVO", "fin du jeu", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    this.Close();
                    #endregion
                }
            }
            else
            if (!BossActivate && m_VieMechant <= 0)
            {
                //desactivation du bouton dattack
                btnAttack.Enabled   = false;
                btnSoin.Enabled     = false;
                btnContinue.Enabled = true;
                return;
            }
            #endregion



            #endregion

            //calcul de vie perso (attack des 3 monstre)
            #region calcul vie perso
            #region Si mechant 1 ou 2 ou 3 mort
            if (MechantMort == true || MonstreParalysé)
            {
                ActionAttackmechant = 0;
            }
            if (BossActivate)
            {
                if (MechantMort2 == true)
                {
                    ActionAttackmechant2 = 0;
                }
                if (MechantMort3 == true)
                {
                    ActionAttackmechant3 = 0;
                }

                BarreVie.Step = -(ActionAttackmechant + ActionAttackmechant2 + ActionAttackmechant3);
            }
            else
            {
                BarreVie.Step = -ActionAttackmechant;
            }
            #endregion
            m_ViePerso += BarreVie.Step;
            #endregion


            //Si la vie du perso tombe a zero
            #region SI Perso 0 HP+desactivation de lattack
            if (m_ViePerso <= 0)
            {
                m_ViePerso      = 0;
                lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
                lbDomPerso.Text = "0";
                BarreVie.Step   = -400;
                BarreVie.PerformStep();

                //AFFICHAGE Du MESSAGE DE LA MORT
                cs = "";
                cs = String.Format("{0}\n\n VOUS ETES MORT ", PersonnageComplet[1]);
                this.Close();
                MessageBox.Show(cs);

                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            #endregion


            //Changement graphique vie perso
            #region changementGraphPerso
            BarreVie.PerformStep();

            if (BossActivate)
            {
                if (ActionAttackmechant == 0 && ActionAttackmechant2 == 0 && ActionAttackmechant3 == 0)
                {
                    lbDomPerso.Text = "0";
                }
                else
                {
                    lbDomPerso.Text = BarreVie.Step.ToString();
                }
            }
            else
            {
                if (ActionAttackmechant == 0)
                {
                    lbDomPerso.Text = "0";
                }
                else
                {
                    lbDomPerso.Text = BarreVie.Step.ToString();
                }
            }
            lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
            #endregion
        }
Пример #7
0
        public dMonde_1(object [] Pcomplet, int WeaponSelected, bool P2, int R1, int R2) : this()
        {
            sp.PlayLooping();
            PersonnageComplet = Pcomplet;
            #region Initialisation Arme choix perso + Argent
            m_Argent      = (int)Pcomplet[6];
            lbArgent.Text = m_Argent.ToString();
            ArmeChoisi    = WeaponSelected;
            #endregion
            #region Experience et Planete + Rune
            m_Experience      = (int)Pcomplet[7];
            lbExperience.Text = m_Experience.ToString();
            PLanete2Permise   = P2;
            Rune1             = R1;
            Rune2             = R2;
            #endregion
            #region Soin
            Soin = (int)PersonnageComplet[8];
            #endregion
            #region Initialisation globale Premier combat en ouvrant la forme
            //Choix du personnage;
            #region choixPerso
            pbPerso.Image = (Image)Pcomplet[2];
            #endregion

            //Choix darmes (avec l'arme Choisi)
            #region ChoixArme
            switch (ArmeChoisi)
            {
            case 0:
                pbArme1.Image             = Image.FromFile("Arme\\Zat.jpg");
                lbArmeEncours.Text        = "ZAT";
                lbDommageArmeEncours.Text = (cArme.Tabarme[0]).DommageMax.ToString();
                break;

            case 1:
                pbArme1.Image             = Image.FromFile("Arme\\PlasmaGun.jpg");
                lbArmeEncours.Text        = "PLASMA GUN";
                lbDommageArmeEncours.Text = (cArme.Tabarme[1]).DommageMax.ToString();
                break;

            case 2:
                pbArme1.Image             = Image.FromFile("Arme\\Klarix.jpg");
                lbArmeEncours.Text        = "Klarix";
                lbDommageArmeEncours.Text = (cArme.Tabarme[2]).DommageMax.ToString();

                break;

            case 3:
                pbArme1.Image             = Image.FromFile("Arme\\Catagan.jpg");
                lbArmeEncours.Text        = "Catagan";
                lbDommageArmeEncours.Text = (cArme.Tabarme[3]).DommageMax.ToString();
                break;

            case 4:
                pbArme1.Image             = Image.FromFile("Arme\\TwisterGun.jpg");
                lbArmeEncours.Text        = "Twister Gun";
                lbDommageArmeEncours.Text = (cArme.Tabarme[4]).DommageMax.ToString();
                break;

            case 5:
                pbArme1.Image             = Image.FromFile("Arme\\Desintegrateur.jpg");
                lbArmeEncours.Text        = "Désintégrateur";
                lbDommageArmeEncours.Text = (cArme.Tabarme[5]).DommageMax.ToString();
                break;

            case 6:
                pbArme1.Image             = Image.FromFile("Arme\\NUKE.jpg");
                lbArmeEncours.Text        = "Bombe";
                lbDommageArmeEncours.Text = (cArme.Tabarme[6]).DommageMax.ToString();
                break;
            }

            #endregion

            //rune en main et bouton magie
            #region Rune/Initialisation Bouton Magie
            if (Rune1 == 1)
            {
                pbRune1.Image   = Image.FromFile("Runes\\Rune4.jpg");
                pbRune1.Visible = true;
                btnSoin.Visible = true;
            }
            if (Rune2 == 1)
            {
                pbRune2.Image   = Image.FromFile("Runes\\Rune1.jpg");
                pbRune2.Visible = true;
            }
            #endregion

            //initialisateur de vie perso
            #region InitialisateurviePerso
            m_ViePerso       = (int)Pcomplet[4];
            BarreVie.Step    = m_ViePerso;
            BarreVie.Maximum = m_ViePerso;
            BarreVie.PerformStep();
            lbViePerso.Text = ((int)Pcomplet[4]).ToString() + "/" + ((int)Pcomplet[4]).ToString();
            #endregion

            ///Choix mechant
            ///initialisateur
            #region ChoixMechant + InitialisateurvieMechant
            TabMonstre[0] = new cMonstre("Alastor", 30, 40, 5, 40, Image.FromFile("Mechant.Marchand\\Mechant1.jpg"));
            TabMonstre[1] = new cMonstre("Scorn", 50, 20, 5, 30, Image.FromFile("Mechant.Marchand\\Mechant2.jpg"));
            TabMonstre[2] = new cMonstre("Kragoth", 60, 15, 10, 20, Image.FromFile("Mechant.Marchand\\Mechant3.jpg"));
            TabMonstre[3] = new cMonstre("Nasir", 40, 15, 5, 10, Image.FromFile("Mechant.Marchand\\Mechant4.jpg"));         // Vie Attack defense- xp-
            TabMonstre[4] = new cMonstre("Ashnard (BOSS)", 100, 50, 10, 70, Image.FromFile("Mechant.Marchand\\Boss1.jpg")); //BOSS

            m_NumeroMonstre = ChoisirHasardMechant();
            m_monstreChoisi = ((cMonstre)TabMonstre[m_NumeroMonstre]);

            #endregion

            //actions initialisateur
            #region ActionMechantInitialisateur
            /*ATTACK*/
            TabActions[0] = new cActionMechant(m_monstreChoisi.m_Dommage, 0);
            /*DEFENSE*/
            TabActions[1] = new cActionMechant(0, m_monstreChoisi.m_defense);
            #endregion
            #endregion
        }
Пример #8
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            //Action aleatoire mechant
            NumAction = ActionMechatHasard();
            //selon larme choisi
            Attack = ((cArme)TabArmes[0]).DommageMax;
            //Selon lactionchoisi
            ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
            ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;
            //Calcul ds letat de vie
            m_VieMechant        -= Attack - ActionDefensemechant;
            m_ViePerso          -= ActionAttackmechant;
            BarreVieMechant.Step = -Attack + ActionDefensemechant;
            BarreVie.Step        = -ActionAttackmechant;
            Thread.Sleep(500);
            //changement graphique mechant
            BarreVieMechant.PerformStep();
            lbDomMechant.Text = (-Attack + ActionDefensemechant).ToString();
            //texte vie mechant
            LbVieMechant.Text = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
            //Si la vie du montre tombe a zero
            if (m_VieMechant <= 0)
            {
                m_VieMechant      = 0;
                LbVieMechant.Text = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text = "0";
                //AFFICHAGE DE LEXPERIENCE ACQUISE
                string cs = "";
                cs = String.Format("{0}\n\n EXPERIENCE ACQUISE {1}", m_persoChoisi.nom, m_monstreChoisi.m_xp);
                MessageBox.Show(cs);
                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            //texte selon choix de ladversaire
            Thread.Sleep(800);
            if (NumAction == 0)
            {
                lbActionMechant.Text      = "Attack";
                lbActionMechant.ForeColor = Color.Red;
                lbActionMechant.Visible   = true;
            }
            else
            {
                lbActionMechant.Text      = "Defense";
                lbActionMechant.ForeColor = Color.Blue;
                lbActionMechant.Visible   = true;
            }

            Thread.Sleep(1000);
            //Changement graphique vie perso
            BarreVie.PerformStep();

            if (ActionAttackmechant == 0)
            {
                lbDomPerso.Text = "0";
            }
            else
            {
                lbDomPerso.Text = (-ActionAttackmechant).ToString();
            }

            lbViePerso.Text = m_ViePerso + "/" + m_persoChoisi.Vie.ToString();
        }
Пример #9
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            //decrementation variable Soin
            #region Rune de soin - Utilisation
            Soin--;
            if (!SoinActif)
            {
                lbSoin.Visible = false;
                lbSoin.Enabled = false;
            }
            if (Soin <= 0)
            {
                btnSoin.Enabled = true;
            }

            #endregion

            //Action aleatoire mechant et si NON PARALYSÉ
            #region Action si non paralysé avec dommage dattack et point def mechant
            if (Paralysie != 0)
            {
                NumAction = ActionMechatHasard();
                //Selon lactionchoisi
                ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
                ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;
            }
            #endregion

            //selon larme choisi
            #region Attack du joueur si nest pas en mode Soin
            if (!SoinActif)
            {
                Attack = (cArme.Tabarme[ArmeChoisi]).DommageMax;
            }
            else
            {
                Attack = 0;
            }
            #endregion

            //Calcul ds letat de vie (mechant)
            #region Calcul etat de vie mechant si nest pas en Mode soin
            if (!SoinActif)
            {
                BarreVieMechant.Step = -Attack + ActionDefensemechant;
                m_VieMechant        += BarreVieMechant.Step;
            }
            else
            {
                BarreVieMechant.Step = 0;
            }

            Thread.Sleep(500);
            #endregion

            //changement graphique mechant
            #region changementGraphMechant
            BarreVieMechant.PerformStep();

            if (Paralysie != 0)/*si Non Paralysé*/
            {
                lbDomMechant.Text = BarreVieMechant.Step.ToString();
            }

            //texte vie mechant
            LbVieMechant.Text = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
            #endregion

            //Si la vie du montre tombe a zero(et celle du boss)
            #region SI Monstre 0 HP + desactivation de lattack pour continuer

            if (m_VieMechant <= 0)
            {
                m_VieMechant      = 0;
                LbVieMechant.Text = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text = "0";
                m_Argent         += m_monstreChoisi.m_ArgentRecu;
                m_Experience++;
                //AFFICHAGE DE Largent ACQUISE

                #region si Boss Vaincu
                string cs = "";
                if (m_NbrestantMonstreBoss == 0)//SI BOSS VAINCU
                {
                    PLanete2Permise = true;
                    m_Experience   += 2;
                    cs = String.Format("VOUS AVEZ VAINCU {0} \n \n {1}\n\n ARGENT RECU {2}\n\n Experience en main {3}\n\n***PLANETE 2 Débloquée***", m_monstreChoisi.m_nom, PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                    this.Close();
                }

                #endregion

                else
                {
                    cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                }

                MessageBox.Show(cs);

                lbArgent.Text     = m_Argent.ToString();
                lbExperience.Text = m_Experience.ToString();
                //desactivation du bouton dattack
                btnAttack.Enabled   = false;
                btnSoin.Enabled     = false;
                btnContinue.Enabled = true;
                return;
            }
            #endregion

            //calcul de vie perso si ENNEMI NON PARALYSÉ
            #region calcul vie perso
            else
            if (Paralysie != 0)
            {
                m_ViePerso   -= ActionAttackmechant;
                BarreVie.Step = -ActionAttackmechant;
            }
            #endregion

            //Si la vie du perso tombe a zero
            #region SI Perso 0 HP+desactivation de lattack
            if (m_ViePerso <= 0)
            {
                m_ViePerso      = 0;
                lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
                lbDomPerso.Text = "0";
                BarreVie.Step   = -400;
                BarreVie.PerformStep();

                //AFFICHAGE Du MESSAGE DE LA MORT
                string cs = "";
                cs = String.Format("{0}\n\n VOUS ETES MORT ", PersonnageComplet[1]);
                this.Close();
                MessageBox.Show(cs);

                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            #endregion

            //texte selon choix de ladversaire si ENNEMI NON PARALYSÉ
            #region texte
            if (Paralysie != 0)
            {
                if (NumAction == 0)
                {
                    lbActionMechant.Text      = "Attack";
                    lbActionMechant.ForeColor = Color.Red;
                    lbActionMechant.Visible   = true;
                }
                else
                {
                    lbActionMechant.Text      = "Defense";
                    lbActionMechant.ForeColor = Color.Blue;
                    lbActionMechant.Visible   = true;
                }
            }
            Thread.Sleep(1000);
            #endregion

            //Changement graphique vie perso si ENNEMI NON PARALYSÉ
            #region changementGraphPerso
            if (Paralysie != 0)
            {
                BarreVie.PerformStep();

                if (ActionAttackmechant == 0)
                {
                    lbDomPerso.Text = "0";
                }
                else
                {
                    lbDomPerso.Text = (-ActionAttackmechant).ToString();
                }

                lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
            }
            #endregion
        }
Пример #10
0
        public dMonde_3(object[] pComplet, int WeaponSelected, bool P4, int R1, int R2)
        {
            InitializeComponent();
            sp.PlayLooping();

            PersonnageComplet = pComplet;
            #region Initialisation Arme choix perso + Argent
            m_Argent      = (int)pComplet[6];
            lbArgent.Text = m_Argent.ToString();
            #endregion
            #region Experience et Planete + Rune
            m_Experience      = (int)pComplet[7];
            lbExperience.Text = m_Experience.ToString();
            PLanete4Permise   = P4;
            Rune1             = R1;
            Rune2             = R2;
            #endregion
            #region Soin
            Soin = (int)PersonnageComplet[8];
            #endregion
            #region Initialisation globale Premier combat en ouvrant la forme
            //Choix du personnage;
            #region choixPerso
            pbPerso.Image = (Image)pComplet[2];
            ArmeChoisi    = WeaponSelected;
            #endregion

            //Choix darmes (initialiser ak les armes acquises)
            #region ChoixArme
            switch (ArmeChoisi)
            {
            case 0:
                pbArme1.Image             = Image.FromFile("Arme\\Zat.jpg");
                lbArmeEncours.Text        = "ZAT";
                lbDommageArmeEncours.Text = (cArme.Tabarme[0]).DommageMax.ToString();
                break;

            case 1:
                pbArme1.Image             = Image.FromFile("Arme\\PlasmaGun.jpg");
                lbArmeEncours.Text        = "PLASMA GUN";
                lbDommageArmeEncours.Text = (cArme.Tabarme[1]).DommageMax.ToString();
                break;

            case 2:
                pbArme1.Image             = Image.FromFile("Arme\\Klarix.jpg");
                lbArmeEncours.Text        = "Klarix";
                lbDommageArmeEncours.Text = (cArme.Tabarme[2]).DommageMax.ToString();

                break;

            case 3:
                pbArme1.Image             = Image.FromFile("Arme\\Catagan.jpg");
                lbArmeEncours.Text        = "Catagan";
                lbDommageArmeEncours.Text = (cArme.Tabarme[3]).DommageMax.ToString();
                break;

            case 4:
                pbArme1.Image             = Image.FromFile("Arme\\TwisterGun.jpg");
                lbArmeEncours.Text        = "Twister Gun";
                lbDommageArmeEncours.Text = (cArme.Tabarme[4]).DommageMax.ToString();
                break;

            case 5:
                pbArme1.Image             = Image.FromFile("Arme\\Desintegrateur.jpg");
                lbArmeEncours.Text        = "Désintégrateur";
                lbDommageArmeEncours.Text = (cArme.Tabarme[5]).DommageMax.ToString();
                break;

            case 6:
                pbArme1.Image             = Image.FromFile("Arme\\NUKE.jpg");
                lbArmeEncours.Text        = "Bombe";
                lbDommageArmeEncours.Text = (cArme.Tabarme[6]).DommageMax.ToString();
                break;
            }

            #endregion

            //rune en main et bouton magie
            #region Rune/Initialisation Bouton Magie
            if (Rune1 == 1)
            {
                pbRune1.Image   = Image.FromFile("Runes\\Rune4.jpg");
                pbRune1.Visible = true;
                btnSoin.Visible = true;
            }
            if (Rune2 == 1)
            {
                pbRune2.Image   = Image.FromFile("Runes\\Rune1.jpg");
                pbRune2.Visible = true;
            }
            #endregion

            //initialisateur de vie perso
            #region InitialisateurviePerso
            m_ViePerso       = (int)pComplet[4];
            BarreVie.Step    = m_ViePerso;
            BarreVie.Maximum = m_ViePerso;
            BarreVie.PerformStep();
            lbViePerso.Text = pComplet[4].ToString() + "/" + pComplet[4].ToString();
            #endregion

            ///Choix mechant
            ///initialisateur
            #region ChoixMechant + InitialisateurvieMechant
            TabMonstre[0] = new cMonstre("Tibarn", 30, 40, 5, 40, Image.FromFile("Mechant.Marchand\\P3Mechant1.jpg"));
            TabMonstre[1] = new cMonstre("Tormod", 50, 20, 5, 30, Image.FromFile("Mechant.Marchand\\P3Mechant2.jpg"));
            TabMonstre[2] = new cMonstre("Zihark", 60, 15, 10, 20, Image.FromFile("Mechant.Marchand\\P3Mechant3.jpg"));
            TabMonstre[3] = new cMonstre("Haar", 40, 15, 5, 10, Image.FromFile("Mechant.Marchand\\P3Mechant4.jpg"));
            TabMonstre[4] = new cMonstre("Reyson", 70, 35, 10, 20, Image.FromFile("Mechant.Marchand\\P3Mechant5.jpg"));
            TabMonstre[5] = new cMonstre("Letharshnor (BOSS)", 100, 50, 10, 70, Image.FromFile("Mechant.Marchand\\P3MechantBoss.jpg")); //BOSS
            TabMonstre[6] = Image.FromFile("Mechant.Marchand\\P3BossSuprise.jpg");                                                      //BOSS
            //; Caineghis; Kurtnaga ...

            m_NumeroMonstre  = ChoisirHasardMechant(1);
            m_NumeroMonstre2 = ChoisirHasardMechant(2);
            m_NumeroMonstre3 = ChoisirHasardMechant(3);

            m_monstreChoisi  = ((cMonstre)TabMonstre[m_NumeroMonstre]);
            m_monstreChoisi2 = ((cMonstre)TabMonstre[m_NumeroMonstre2]);
            m_monstreChoisi3 = ((cMonstre)TabMonstre[m_NumeroMonstre3]);
            #endregion

            //actions initialisateur
            #region ActionMechantInitialisateur
            /*ATTACK*/
            TabActions[0] = new cActionMechant(m_monstreChoisi.m_Dommage, 0);
            /*DEFENSE*/
            TabActions[1] = new cActionMechant(0, m_monstreChoisi.m_defense);
            #endregion

            #region ActionMechantInitialisateur2
            /*ATTACK*/
            TabActionsMechant2[0] = new cActionMechant(m_monstreChoisi2.m_Dommage, 0);
            /*DEFENSE*/
            TabActionsMechant2[1] = new cActionMechant(0, m_monstreChoisi2.m_defense);
            #endregion

            #region ActionMechantInitialisateur3
            /*ATTACK*/
            TabActionsMechant3[0] = new cActionMechant(m_monstreChoisi3.m_Dommage, 0);
            /*DEFENSE*/
            TabActionsMechant3[1] = new cActionMechant(0, m_monstreChoisi3.m_defense);
            #endregion
            #endregion
        }
Пример #11
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            #region si le boss est là debut de l'operation mise en place graphique
            //choix du boss (deplacement)
            if (BossActivate)
            {
                GoodSelection = b.Next(1, 4);
                RemiseFormDurantBoss();
                switch (GoodSelection)
                {
                case 1: pbMechant.Image   = ((cMonstre)TabMonstre[5]).m_ImageMonstre;
                    pbMechant2.Image      = (Image)TabMonstre[6];
                    pbMechant3.Image      = (Image)TabMonstre[6];
                    BarreVieMechant.Value = m_VieMechant;
                    break;

                case 2: pbMechant.Image    = (Image)TabMonstre[6];
                    pbMechant2.Image       = ((cMonstre)TabMonstre[5]).m_ImageMonstre;
                    pbMechant3.Image       = (Image)TabMonstre[6];
                    BarreVieMechant2.Value = m_VieMechant;
                    break;

                case 3: pbMechant.Image    = (Image)TabMonstre[6];
                    pbMechant2.Image       = (Image)TabMonstre[6];
                    pbMechant3.Image       = ((cMonstre)TabMonstre[5]).m_ImageMonstre;
                    BarreVieMechant3.Value = m_VieMechant;
                    break;
                }
            }
            #endregion

            //decrementation variable Soin
            #region Rune de soin - Utilisation
            Soin--;
            if (Soin <= 0)
            {
                btnSoin.Enabled = true;
            }
            if (!SoinActif)
            {
                lbSoin.Visible = false;
            }
            #endregion

            //Action aleatoire mechant si NON PARALYSÉ
            #region Action Choisi par les 3 monstre
            #region si monstre 1 est pas paralysée et pas mort
            if (Monstre1paralyser == false)
            {
                if (!MechantMort)
                {
                    NumAction = ActionMechatHasard();
                }
                else
                {
                    NumAction = -1;
                }
            }
            #endregion
            #region si monstre 2 est pas paralysé et pas mort
            if (Monstre2Paralyser == false)
            {
                if (!MechantMort2)
                {
                    NumActionMechant2 = ActionMechatHasard();
                }
                else
                {
                    NumActionMechant2 = -1;
                }
            }
            #endregion
            #region si monstre 3 est pas paralysé et pas mort
            if (Monstre3Paralyser == false)
            {
                if (!MechantMort3)
                {
                    NumActionMechant3 = ActionMechatHasard();
                }
                else
                {
                    NumActionMechant3 = -1;
                }
            }
            #endregion
            #endregion

            //Selon lactionchoisi si NON PARALYSÉ ET VIVANT
            #region Point dattack et de defense 3 monstre
            #region Monstre 1
            if (Monstre1paralyser == false)
            {
                if (!MechantMort)
                {
                    ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
                    ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;
                }
            }
            #endregion
            #region Monstre 2
            if (Monstre2Paralyser == false)
            {
                if (!MechantMort2)
                {
                    ActionAttackmechant2  = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Domm;
                    ActionDefensemechant2 = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Protection;
                }
            }
            #endregion
            #region Monstre 3
            if (Monstre3Paralyser == false)
            {
                if (!MechantMort3)
                {
                    ActionAttackmechant3  = ((cActionMechant)TabActionsMechant3[NumActionMechant3]).Domm;
                    ActionDefensemechant3 = ((cActionMechant)TabActionsMechant3[NumActionMechant3]).Protection;
                }
            }
            #endregion
            #endregion

            //texte selon choix de ladversaire Si NON PARALYSÉ
            #region texte
            Thread.Sleep(500);
            #region Mechant1
            if (Monstre1paralyser == false)
            {
                if (!BossActivate)
                {
                    if (NumAction == 0)
                    {
                        lbActionMechant.Text      = "Attack";
                        lbActionMechant.ForeColor = Color.Red;
                        lbActionMechant.Visible   = true;
                    }
                    else
                    if (NumAction == 1)
                    {
                        lbActionMechant.Text      = "Defense";
                        lbActionMechant.ForeColor = Color.Cyan;
                        lbActionMechant.Visible   = true;
                    }
                }
                else
                {
                    if (NumAction == 0)
                    {
                        lbActionBoss.Text      = "Attack";
                        lbActionBoss.ForeColor = Color.Red;
                    }
                    else
                    if (NumAction == 1)
                    {
                        lbActionBoss.Text      = "Defense";
                        lbActionBoss.ForeColor = Color.Cyan;
                    }
                }
            }
            #endregion
            #region Mechant2
            if (Monstre2Paralyser == false)
            {
                if (NumActionMechant2 == 0)
                {
                    lbActionMechant2.Text      = "Attack";
                    lbActionMechant2.ForeColor = Color.Red;
                    lbActionMechant2.Visible   = true;
                }
                else
                if (NumActionMechant2 == 1)
                {
                    lbActionMechant2.Text      = "Defense";
                    lbActionMechant2.ForeColor = Color.Cyan;
                    lbActionMechant2.Visible   = true;
                }
            }

            #endregion
            #region Mechant3
            if (Monstre3Paralyser == false)
            {
                if (NumActionMechant3 == 0)
                {
                    lbActionMechant3.Text      = "Attack";
                    lbActionMechant3.ForeColor = Color.Red;
                    lbActionMechant3.Visible   = true;
                }
                else
                if (NumActionMechant3 == 1)
                {
                    lbActionMechant3.Text      = "Defense";
                    lbActionMechant3.ForeColor = Color.Cyan;
                    lbActionMechant3.Visible   = true;
                }
            }

            #endregion
            #endregion

            //selon larme choisi
            #region Attack si nest pas en mode Soin
            if (!SoinActif)
            {
                Attack = (cArme.Tabarme[ArmeChoisi]).DommageMax;
            }
            else
            {
                Attack = 0;
            }
            #endregion

            // Calcul ds letat de vie (mechant)
            if (!BossActivate)
            {
                #region Calcul etat de vie mechant
                if (!MechantMort)
                {
                    #region Monstre 1
                    if (m_MonstreaAttaquer == 1)
                    {
                        if (!SoinActif)
                        {
                            BarreVieMechant.Step = -Attack + ActionDefensemechant;
                            m_VieMechant        += BarreVieMechant.Step;
                        }
                        else
                        {
                            BarreVieMechant.Step = 0;
                        }
                    }
                    #endregion
                }
                if (!MechantMort2)
                {
                    #region Monstre 2
                    if (m_MonstreaAttaquer == 2)
                    {
                        if (!SoinActif)
                        {
                            BarreVieMechant2.Step = -Attack + ActionDefensemechant2;
                            m_VieMechant2        += BarreVieMechant2.Step;
                        }
                        else
                        {
                            BarreVieMechant2.Step = 0;
                        }
                    }
                    #endregion
                }

                if (!MechantMort3)
                {
                    #region Monstre 3
                    if (m_MonstreaAttaquer == 3)
                    {
                        if (!SoinActif)
                        {
                            BarreVieMechant3.Step = -Attack + ActionDefensemechant3;
                            m_VieMechant3        += BarreVieMechant3.Step;
                        }
                        else
                        {
                            BarreVieMechant3.Step = 0;
                        }
                    }
                    #endregion
                }
                Thread.Sleep(500);
                #endregion
            }
            //Calcul de vie boss
            else
            {
                #region bossLifeCalcul

                #region GoodSelection1
                if (m_MonstreaAttaquer == 1 && GoodSelection == 1)
                {
                    if (!SoinActif)
                    {
                        BarreVieMechant.Step = -Attack + ActionDefensemechant;
                        m_VieMechant        += BarreVieMechant.Step;
                    }
                    else
                    {
                        BarreVieMechant.Step = 0;
                    }
                }
                #endregion
                else
                #region GoodSelection 2
                if (m_MonstreaAttaquer == 2 && GoodSelection == 2)
                {
                    if (!SoinActif)
                    {
                        BarreVieMechant2.Step = -Attack + ActionDefensemechant2;
                        m_VieMechant         += BarreVieMechant2.Step;
                    }
                    else
                    {
                        BarreVieMechant2.Step = 0;
                    }
                }
                #endregion
                else
                #region GoodSelection 3
                if (m_MonstreaAttaquer == 3 && GoodSelection == 3)
                {
                    if (!SoinActif)
                    {
                        BarreVieMechant3.Step = -Attack + ActionDefensemechant3;
                        m_VieMechant3        += BarreVieMechant3.Step;
                        if (GoodSelection == 3)
                        {
                            m_VieMechant += BarreVieMechant3.Step;
                        }
                    }
                    else
                    {
                        BarreVieMechant3.Step = 0;
                    }
                }
                #endregion
                #endregion
            }
            Thread.Sleep(500);



            //changement graphique apres attack contre mechant
            #region changementGraphMechant

            if (m_MonstreaAttaquer == 1)
            {
                #region Monstre 1
                BarreVieMechant.PerformStep();
                if (Monstre1paralyser == false)
                {
                    lbDomMechant.Text = BarreVieMechant.Step.ToString();
                }

                if (GoodSelection != 1 && GoodSelection != -1)
                {
                    lbDomMechant.Text = "Manqué";
                }

                #endregion
            }
            else
            if (m_MonstreaAttaquer == 2)
            {
                #region Monstre 2
                BarreVieMechant2.PerformStep();
                if (Monstre2Paralyser == false)
                {
                    lbDomMechant2.Text = BarreVieMechant2.Step.ToString();
                }

                if (GoodSelection != 2 && GoodSelection != -1)
                {
                    lbDomMechant2.Text = "Manqué";
                }


                #endregion
            }
            else
            {
                #region Monstre 3
                BarreVieMechant3.PerformStep();
                if (Monstre3Paralyser == false)
                {
                    lbDomMechant3.Text = BarreVieMechant3.Step.ToString();
                }

                if (GoodSelection != 3 && GoodSelection != -1)
                {
                    lbDomMechant3.Text = "Manqué";
                }

                #endregion
            }



            //texte vie mechant(scene du boss incluse)
            if (GoodSelection == -1)
            {
                lbVieMechant.Text  = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
                lbVieMechant2.Text = m_VieMechant2 + "/" + m_monstreChoisi2.m_Vie.ToString();
                lbVieMechant3.Text = m_VieMechant3 + "/" + m_monstreChoisi3.m_Vie.ToString();
            }
            else
            {
                lbBossLife.Text = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
            }
            #endregion


            //Si la vie du montre tombe a zero(et celle du boss)
            #region SI Monstre 0 HP + desactivation de lattack pour continuer
            string cs = "";

            #region si Monstre 1 battu (boss inclus dedans)
            if (m_VieMechant <= 0 && MechantMort == false)
            {
                MechantMort = true;
                #region Compteur pour paralysie(si Rune 2 acquise)
                if (Rune2 == 1)
                {
                    Paralysie--;
                }
                #endregion
                #region Mise a zero du monstre 1
                m_VieMechant          = 0;
                lbVieMechant.Text     = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text     = "0";
                lbActionMechant.Text  = "";
                pbMechant.Enabled     = false;
                lbMechant.Enabled     = false;
                pbMechant.Image       = null;
                panMechant1.BackColor = Color.Black;
                #endregion
                #region passe a lennemi 2 ou 3 tout dependant s'il est mort
                if (!MechantMort2)
                {
                    pbMechant2_Click(sender, e);
                }
                else
                if (!MechantMort3)
                {
                    pbMechant3_Click(sender, e);
                }

                #endregion
                m_Argent += m_monstreChoisi.m_ArgentRecu;
                m_Experience++;
                lbArgent.Text     = m_Argent.ToString();
                lbExperience.Text = m_Experience.ToString();
                //AFFICHAGE DE Largent ACQUISE

                #region si Boss Vaincu
                if (m_NbrestantMonstreBoss == 0)//SI BOSS VAINCU
                {
                    PLanete4Permise  = true;
                    pbMechant2.Image = null;
                    pbMechant3.Image = null;
                    m_Experience    += 2;
                    m_Argent        += m_monstreChoisi.m_ArgentRecu;
                    cs = String.Format("VOUS AVEZ VAINCU LE BOSS {0} \n \n {1}\n\n ARGENT RECU {2}\n\n Experience en main {3} \n ***Derniere planète débloqué***", m_monstreChoisi.m_nom, PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                    MessageBox.Show(cs);
                    this.Close();
                }

                #endregion

                else
                {
                    cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                    MessageBox.Show(cs);
                }
            }
            #endregion
            #region si Monstre 2 battu
            if (m_VieMechant2 <= 0 && MechantMort2 == false)
            {
                MechantMort2 = true;
                #region Compteur pour paralysie(si Rune 2 acquise)
                if (Rune2 == 1)
                {
                    Paralysie--;
                }
                #endregion
                #region mise a zero du monstre 2
                pbMechant2.Enabled    = false;
                pbMechant2.Image      = null;
                lbMechant2.Enabled    = false;
                m_VieMechant2         = 0;
                lbVieMechant2.Text    = m_VieMechant2 + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre2]).m_Vie.ToString();
                lbDomMechant2.Text    = "0";
                lbActionMechant2.Text = "";
                panMechant2.BackColor = Color.Black;
                #endregion
                #region passe a l'ennemi 1 ou 3
                if (!MechantMort)
                {
                    pbMechant_Click(sender, e);
                }
                else
                if (!MechantMort3)
                {
                    pbMechant3_Click(sender, e);
                }
                #endregion
                m_Argent += m_monstreChoisi2.m_ArgentRecu;
                m_Experience++;
                lbArgent.Text     = m_Argent.ToString();
                lbExperience.Text = m_Experience.ToString();
                //AFFICHAGE DE Largent ACQUISE
                cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi2.m_ArgentRecu, m_Experience);
                MessageBox.Show(cs);
            }
            #endregion
            #region si Monstre 3 battu
            if (m_VieMechant3 <= 0 && MechantMort3 == false)
            {
                MechantMort3 = true;
                #region Compteur pour paralysie(si Rune 2 acquise)
                if (Rune2 == 1)
                {
                    Paralysie--;
                }
                #endregion
                #region mise a zero du monstre 3
                pbMechant3.Enabled    = false;
                pbMechant3.Image      = null;
                lbMechant3.Enabled    = false;
                m_VieMechant3         = 0;
                lbVieMechant3.Text    = m_VieMechant3 + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre3]).m_Vie.ToString();
                lbDomMechant3.Text    = "0";
                lbActionMechant3.Text = "";
                panMechant3.BackColor = Color.Black;
                #endregion
                #region passe a l'ennemi 1 ou 2
                if (!MechantMort)
                {
                    pbMechant_Click(sender, e);
                }
                else
                if (!MechantMort2)
                {
                    pbMechant2_Click(sender, e);
                }
                #endregion
                m_Argent += m_monstreChoisi3.m_ArgentRecu;
                m_Experience++;
                lbArgent.Text     = m_Argent.ToString();
                lbExperience.Text = m_Experience.ToString();
                //AFFICHAGE DE Largent ACQUISE
                cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi3.m_ArgentRecu, m_Experience);
                MessageBox.Show(cs);
            }
            #endregion

            #region Si les 3 monstres sont battus
            if (m_VieMechant <= 0 && m_VieMechant2 <= 0 && m_VieMechant3 <= 0)
            {
                //desactivation du bouton dattack
                btnAttack.Enabled     = false;
                btnSoin.Enabled       = false;
                btnContinue.Enabled   = true;
                panMechant1.BackColor = Color.Black;
                panMechant2.BackColor = Color.Black;
                panMechant3.BackColor = Color.Black;
                return;
            }
            #endregion



            #endregion

            //calcul de vie perso (attack des 3 monstre)
            #region calcul vie perso
            #region Si mechant 1 ou 2 ou 3 mort
            if (MechantMort == true)
            {
                ActionAttackmechant = 0;
            }
            if (MechantMort2 == true)
            {
                ActionAttackmechant2 = 0;
            }
            if (MechantMort3 == true)
            {
                ActionAttackmechant3 = 0;
            }
            #endregion
            #region Si Monstre 1 paralyse ou monstre 2 ou 3  ou aucun

            if (Monstre1paralyser == true)
            {
                BarreVie.Step = -(ActionAttackmechant2 + ActionAttackmechant3);
            }
            else
            if (Monstre2Paralyser == true)
            {
                BarreVie.Step = -(ActionAttackmechant + ActionAttackmechant3);
            }
            else
            if (Monstre3Paralyser == true)
            {
                BarreVie.Step = -(ActionAttackmechant + ActionAttackmechant2);
            }
            else
            if (Monstre1paralyser == false && Monstre2Paralyser == false && Monstre3Paralyser == false)
            {
                BarreVie.Step = -(ActionAttackmechant + ActionAttackmechant2 + ActionAttackmechant3);
            }
            #endregion
            m_ViePerso += BarreVie.Step;
            #endregion


            //Si la vie du perso tombe a zero
            #region SI Perso 0 HP+desactivation de lattack
            if (m_ViePerso <= 0)
            {
                m_ViePerso      = 0;
                lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
                lbDomPerso.Text = "0";
                BarreVie.Step   = -400;
                BarreVie.PerformStep();

                //AFFICHAGE Du MESSAGE DE LA MORT
                cs = "";
                cs = String.Format("{0}\n\n VOUS ETES MORT ", PersonnageComplet[1]);
                this.Close();
                MessageBox.Show(cs);

                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            #endregion


            //Changement graphique vie perso
            #region changementGraphPerso
            BarreVie.PerformStep();

            if (ActionAttackmechant == 0 && ActionAttackmechant2 == 0 && ActionAttackmechant3 == 0)
            {
                lbDomPerso.Text = "0";
            }
            else
            {
                lbDomPerso.Text = BarreVie.Step.ToString();
            }

            lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
            #endregion
        }
Пример #12
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            //Action aleatoire mechant
            NumAction = ActionMechatHasard();
            //selon larme choisi
            Attack = ((cArme)TabArmes[choixArme]).DommageMax;
            //Selon lactionchoisi
            ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
            ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;

            //Calcul ds letat de vie (mechant)
            #region Calcul etat de vie mechant
            BarreVieMechant.Step = -Attack + ActionDefensemechant;
            m_VieMechant        += BarreVieMechant.Step;
            Thread.Sleep(500);
            #endregion



            //changement graphique mechant
            #region changementGraphMechant
            BarreVieMechant.PerformStep();
            lbDomMechant.Text = BarreVieMechant.Step.ToString();

            //texte vie mechant
            LbVieMechant.Text = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
            #endregion

            //Si la vie du montre tombe a zero(et celle du boss)
            #region SI Monstre 0 HP + desactivation de lattack pour continuer

            if (m_VieMechant <= 0)
            {
                m_VieMechant      = 0;
                LbVieMechant.Text = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text = "0";
                m_Argent         += m_monstreChoisi.m_ArgentRecu;
                //AFFICHAGE DE Largent ACQUISE

                #region si Boss Vaincu
                string cs = "";
                if (m_NbrestantMonstreBoss == 0)//SI BOSS VAINCU
                {
                    PLanete2Permise = true;
                    cs = String.Format("VOUS AVEZ VAINCU LE BOSS alias ({0}) \n \n {1}\n\n ARGENT RECU {2}", m_monstreChoisi.m_nom, m_persoChoisi.nom, m_monstreChoisi.m_ArgentRecu);
                    this.Close();
                }

                #endregion

                else
                {
                    cs = String.Format("{0}\n\n ARGENT RECU {1}", m_persoChoisi.nom, m_monstreChoisi.m_ArgentRecu);
                }

                MessageBox.Show(cs);

                lbArgent.Text = m_Argent.ToString();


                //desactivation du bouton dattack
                btnAttack.Enabled   = false;
                btnContinue.Enabled = true;
                return;
            }
            #endregion

            //calcul de vie perso
            else
            {
                m_ViePerso -= ActionAttackmechant;
            }
            BarreVie.Step = -ActionAttackmechant;


            //Si la vie du perso tombe a zero
            #region SI Perso 0 HP+desactivation de lattack
            if (m_ViePerso <= 0)
            {
                m_ViePerso      = 0;
                lbViePerso.Text = m_ViePerso + "/" + m_persoChoisi.Vie.ToString();
                lbDomPerso.Text = "0";
                BarreVie.Step   = -400;
                BarreVie.PerformStep();

                //AFFICHAGE Du MESSAGE DE LA MORT
                string cs = "";
                cs = String.Format("{0}\n\n VOUS ETES MORT ", m_persoChoisi.nom);
                this.Close();
                MessageBox.Show(cs);

                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            #endregion

            //texte selon choix de ladversaire
            #region texte
            Thread.Sleep(800);
            if (NumAction == 0)
            {
                lbActionMechant.Text      = "Attack";
                lbActionMechant.ForeColor = Color.Red;
                lbActionMechant.Visible   = true;
            }
            else
            {
                lbActionMechant.Text      = "Defense";
                lbActionMechant.ForeColor = Color.Blue;
                lbActionMechant.Visible   = true;
            }

            Thread.Sleep(1000);
            #endregion

            //Changement graphique vie perso
            #region changementGraphPerso
            BarreVie.PerformStep();

            if (ActionAttackmechant == 0)
            {
                lbDomPerso.Text = "0";
            }
            else
            {
                lbDomPerso.Text = (-ActionAttackmechant).ToString();
            }

            lbViePerso.Text = m_ViePerso + "/" + m_persoChoisi.Vie.ToString();
            #endregion
        }
Пример #13
0
        private void btnAttack_Click(object sender, EventArgs e)
        {
            //decrementation variable Soin
            #region Rune de soin - Utilisation
            Soin--;
            if (Soin <= 0)
            {
                btnSoin.Enabled = true;
            }
            if (!SoinActif)
            {
                lbSoin.Visible = false;
            }
            #endregion

            //Action aleatoire mechant si NON PARALYSÉ
            #region Action Choisi par les 2 monstre
            #region si monstre 1 est pas paralysée et pas mort
            if (Monstre1paralyser == false)
            {
                if (!MechantMort)
                {
                    NumAction = ActionMechatHasard();
                }
                else
                {
                    NumAction = -1;
                }
            }
            #endregion
            #region si monstre 2 est pas paralysé et pas mort
            if (Monstre2Paralyser == false)
            {
                if (!MechantMort2)
                {
                    NumActionMechant2 = ActionMechatHasard();
                }
                else
                {
                    NumActionMechant2 = -1;
                }
            }
            #endregion
            #endregion

            //Selon lactionchoisi si NON PARALYSÉ ET VIVANT
            #region Point dattack et de defense 2 monstre
            if (Monstre1paralyser == false)
            {
                if (!MechantMort)
                {
                    ActionAttackmechant  = ((cActionMechant)TabActions[NumAction]).Domm;
                    ActionDefensemechant = ((cActionMechant)TabActions[NumAction]).Protection;
                }
            }
            if (Monstre2Paralyser == false)
            {
                if (!MechantMort2)
                {
                    ActionAttackmechant2  = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Domm;
                    ActionDefensemechant2 = ((cActionMechant)TabActionsMechant2[NumActionMechant2]).Protection;
                }
            }
            #endregion

            //texte selon choix de ladversaire Si NON PARALYSÉ
            #region texte
            Thread.Sleep(500);
            #region Mechant1
            if (Monstre1paralyser == false)
            {
                if (NumAction == 0)
                {
                    lbActionMechant.Text      = "Attack";
                    lbActionMechant.ForeColor = Color.Red;
                    lbActionMechant.Visible   = true;
                }
                else
                if (NumAction == 1)
                {
                    lbActionMechant.Text      = "Defense";
                    lbActionMechant.ForeColor = Color.Cyan;
                    lbActionMechant.Visible   = true;
                }
            }
            #endregion
            #region Mechant2
            if (Monstre2Paralyser == false)
            {
                if (NumActionMechant2 == 0)
                {
                    lbActionMechant2.Text      = "Attack";
                    lbActionMechant2.ForeColor = Color.Red;
                    lbActionMechant2.Visible   = true;
                }
                else
                if (NumActionMechant2 == 1)
                {
                    lbActionMechant2.Text      = "Defense";
                    lbActionMechant2.ForeColor = Color.Cyan;
                    lbActionMechant2.Visible   = true;
                }
            }

            #endregion
            #endregion

            //selon larme choisi
            #region Attack si nest pas en mode Soin
            if (!SoinActif)
            {
                Attack = (cArme.Tabarme[ArmeChoisi]).DommageMax;
            }
            else
            {
                Attack = 0;
            }
            #endregion

            //Calcul ds letat de vie (mechant)
            #region Calcul etat de vie mechant
            if (!MechantMort)
            {
                #region Monstre 1
                if (m_MonstreaAttaquer == 1)
                {
                    if (!SoinActif)
                    {
                        BarreVieMechant.Step = -Attack + ActionDefensemechant;
                        m_VieMechant        += BarreVieMechant.Step;
                    }
                    else
                    {
                        BarreVieMechant.Step = 0;
                    }
                }
                #endregion
            }
            if (!MechantMort2)
            {
                #region Monstre 2
                if (m_MonstreaAttaquer == 2)
                {
                    if (!SoinActif)
                    {
                        BarreVieMechant2.Step = -Attack + ActionDefensemechant2;
                        m_VieMechant2        += BarreVieMechant2.Step;
                    }
                    else
                    {
                        BarreVieMechant2.Step = 0;
                    }
                }
                #endregion
            }
            Thread.Sleep(500);
            #endregion

            //changement graphique apres attack contre mechant
            #region changementGraphMechant
            #region Monstre 1
            if (m_MonstreaAttaquer == 1)
            {
                BarreVieMechant.PerformStep();
                if (Monstre1paralyser == false)
                {
                    lbDomMechant.Text = BarreVieMechant.Step.ToString();
                }
            }
            #endregion
            #region Monstre 2
            else
            {
                BarreVieMechant2.PerformStep();
                if (Monstre2Paralyser == false)
                {
                    lbDomMechant2.Text = BarreVieMechant2.Step.ToString();
                }
            }
            #endregion

            //texte vie mechant
            lbVieMechant.Text  = m_VieMechant + "/" + m_monstreChoisi.m_Vie.ToString();
            lbVieMechant2.Text = m_VieMechant2 + "/" + m_monstreChoisi2.m_Vie.ToString();
            #endregion

            //Si la vie du montre tombe a zero(et celle du boss)
            #region SI Monstre 0 HP + desactivation de lattack pour continuer
            string cs = "";


            #region si Monstre 1 battu (boss inclus dedans)
            if (m_VieMechant <= 0 && MechantMort == false)
            {
                MechantMort = true;
                #region Compteur pour paralysie(si Rune 2 acquise)
                if (Rune2 == 1)
                {
                    Paralysie--;
                    if (Paralysie == 0)
                    {
                        lbDomMechant2.Text    = "ENNEMI \n PARALYSÉ";
                        lbActionMechant2.Text = "";
                        ActionDefensemechant2 = 0;
                        Monstre2Paralyser     = true;
                    }
                    else
                    {
                        Monstre2Paralyser = false;
                    }
                }
                #endregion
                #region Mise a zero du monstre 1
                m_VieMechant         = 0;
                lbVieMechant.Text    = m_VieMechant + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre]).m_Vie.ToString();
                lbDomMechant.Text    = "0";
                lbActionMechant.Text = "";
                pbMechant.Enabled    = false;
                lbMechant.Enabled    = false;
                pbMechant.Image      = null;
                #endregion
                #region passe a lennemi 2
                if (!MechantMort2)
                {
                    pbMechant2_Click(sender, e);
                }
                #endregion
                m_Argent += m_monstreChoisi.m_ArgentRecu;
                m_Experience++;
                //AFFICHAGE DE Largent ACQUISE

                #region si Boss Vaincu
                if (m_NbrestantMonstreBoss == 0)    //SI BOSS VAINCU
                {
                    PLanete3Permise = true;
                    m_Experience   += 2;
                    cs = String.Format("VOUS AVEZ VAINCU LE BOSS {0} \n \n {1}\n\n ARGENT RECU {2}\n\n Experience en main {3} \n ***Magasin artefact débloqué***", m_monstreChoisi.m_nom, PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                    MessageBox.Show(cs);
                    this.Close();
                }

                #endregion

                else
                {
                    cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi.m_ArgentRecu, m_Experience);
                    MessageBox.Show(cs);
                }

                if (Paralysie == 0)
                {
                    cMonstre[] TabCMonstre = new cMonstre[1];
                    TabCMonstre[0] = m_monstreChoisi2;
                    dChoixEnnemiAParalyser ChoixEnnemi = new dChoixEnnemiAParalyser(TabCMonstre);
                    ChoixEnnemi.ShowDialog();
                }
            }
            #endregion
            #region si Monstre 2 battu
            if (m_VieMechant2 <= 0 && MechantMort2 == false)
            {
                MechantMort2 = true;
                #region Compteur pour paralysie(si Rune 2 acquise)
                if (Rune2 == 1)
                {
                    Paralysie--;
                    if (Paralysie == 0)
                    {
                        lbDomMechant.Text    = "ENNEMI \n PARALYSÉ";
                        Monstre1paralyser    = true;
                        lbActionMechant.Text = "";
                        ActionDefensemechant = 0;
                    }
                    else
                    {
                        Monstre1paralyser = false;
                    }
                }
                #endregion
                #region mise a zero du monstre 2
                pbMechant2.Enabled    = false;
                pbMechant2.Image      = null;
                lbMechant2.Enabled    = false;
                m_VieMechant2         = 0;
                lbVieMechant2.Text    = m_VieMechant2 + "/" + ((cMonstre)TabMonstre[m_NumeroMonstre2]).m_Vie.ToString();
                lbDomMechant2.Text    = "0";
                lbActionMechant2.Text = "";
                #endregion
                #region passe a l'ennemi 1
                if (!MechantMort)
                {
                    pbMechant_Click(sender, e);
                }
                #endregion
                m_Argent += m_monstreChoisi2.m_ArgentRecu;
                m_Experience++;
                //AFFICHAGE DE Largent ACQUISE
                cs = String.Format("{0}\n\n ARGENT RECU {1}\n\n Experience en main {2}", PersonnageComplet[1], m_monstreChoisi2.m_ArgentRecu, m_Experience);
                MessageBox.Show(cs);
                if (Paralysie == 0)
                {
                    cMonstre[] TabCMonstre = new cMonstre[1];
                    TabCMonstre[0] = m_monstreChoisi;
                    dChoixEnnemiAParalyser ChoixEnnemi = new dChoixEnnemiAParalyser(TabCMonstre);
                    ChoixEnnemi.ShowDialog();
                }
            }
            #endregion

            lbArgent.Text     = m_Argent.ToString();
            lbExperience.Text = m_Experience.ToString();
            #region Si les 2 monstres sont battus
            if (m_VieMechant <= 0 && m_VieMechant2 <= 0)
            {
                //desactivation du bouton dattack
                btnAttack.Enabled     = false;
                btnSoin.Enabled       = false;
                btnContinue.Enabled   = true;
                panMechant1.BackColor = Color.DarkRed;
                panMechant2.BackColor = Color.DarkRed;
                return;
            }
            #endregion


            #endregion

            //calcul de vie perso (attack des 2 monstre)
            #region calcul vie perso
            #region Si mechant 1 ou 2 mort
            if (MechantMort == true)
            {
                ActionAttackmechant = 0;
            }
            if (MechantMort2 == true)
            {
                ActionAttackmechant2 = 0;
            }
            #endregion
            #region Si Monstre 1 paralyse ou monstre 2 ou aucun

            if (Monstre1paralyser == true)
            {
                BarreVie.Step = -ActionAttackmechant2;
            }
            else
            if (Monstre2Paralyser == true)
            {
                BarreVie.Step = -ActionAttackmechant;
            }
            else
            if (Monstre1paralyser == false && Monstre2Paralyser == false)
            {
                BarreVie.Step = -(ActionAttackmechant + ActionAttackmechant2);
            }
            #endregion
            m_ViePerso += BarreVie.Step;
            #endregion


            //Si la vie du perso tombe a zero
            #region SI Perso 0 HP+desactivation de lattack
            if (m_ViePerso <= 0)
            {
                m_ViePerso      = 0;
                lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
                lbDomPerso.Text = "0";
                BarreVie.Step   = -400;
                BarreVie.PerformStep();

                //AFFICHAGE Du MESSAGE DE LA MORT
                cs = "";
                cs = String.Format("{0}\n\n VOUS ETES MORT ", PersonnageComplet[1]);
                this.Close();
                MessageBox.Show(cs);

                //desactivation du bouton dattack
                btnAttack.Enabled = false;
                return;
            }
            #endregion


            //Changement graphique vie perso
            #region changementGraphPerso
            BarreVie.PerformStep();

            if (ActionAttackmechant == 0 && ActionAttackmechant2 == 0)
            {
                lbDomPerso.Text = "0";
            }
            else
            {
                lbDomPerso.Text = BarreVie.Step.ToString();
            }

            lbViePerso.Text = m_ViePerso + "/" + PersonnageComplet[4].ToString();
            #endregion
        }