Example #1
0
        private void btnContinue_Click(object sender, EventArgs e)
        {
            #region Arrivée Du Boss /  Monstre aléatoire
            m_NbrestantMonstreBoss--;

            if (m_NbrestantMonstreBoss == 0)
            {
                m_NumeroMonstre = 4;
                InitialisteurDeVieMechant(m_NumeroMonstre);
            }

            //Rotation des monstres
            else
            {
                m_NumeroMonstre = ChoisirHasardMechant();
            }
            #endregion

            btnAttack.Enabled = true;
            if (Soin <= 0)
            {
                btnSoin.Enabled = true;
            }

            //remettre attack et action comme debut
            #region lbdommage remis a neuf des 2 personnages
            lbActionMechant.Text = "";
            lbDomMechant.Text    = "Dommage";
            lbDomPerso.Text      = "Dommage";
            #endregion

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

            //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 Compteur pour paralysie(si Rune 2 acquise)
            if (Rune2 == 1)
            {
                Paralysie--;
                if (Paralysie == 0)
                {
                    cMonstre[] TabCMonstre = new cMonstre[1];
                    TabCMonstre[0] = m_monstreChoisi;
                    dChoixEnnemiAParalyser ChoixEnnemi = new dChoixEnnemiAParalyser(TabCMonstre);
                    ChoixEnnemi.ShowDialog();
                    lbDomMechant.Text = "ENNEMI \n PARALYSÉ";
                }
            }
            #endregion

            btnContinue.Enabled = false;
        }
Example #2
0
        public void EnnemiChoisiPourParalyser()
        {
            //Donne la possibilité au joueur de décider quel monstre il veut paralyse
            cMonstre[] TabMonstreAuCombat = new cMonstre[3]
            {
                m_monstreChoisi,
                m_monstreChoisi2,
                m_monstreChoisi3,
            };

            dChoixEnnemiAParalyser ChoixEnnemi = new dChoixEnnemiAParalyser(TabMonstreAuCombat);

            ChoixEnnemi.ShowDialog();
            TextePourChoixEnnemiParalysé(ChoixEnnemi.retourneMonstreChoisi());
        }
Example #3
0
        private void btnContinue_Click(object sender, EventArgs e)
        {
            IndiceTabMonstre++;
            m_NumeroMonstre = TabOrdreDesMonstre[IndiceTabMonstre];

            btnAttack.Enabled = true;
            if (Soin <= 0)
            {
                btnSoin.Enabled = true;
            }

            //remettre attack et action comme debut
            #region lbdommage remis a neuf des 2 personnages
            lbActionMechant.Text = "";
            lbDomMechant.Text    = "Dommage";
            lbDomPerso.Text      = "Dommage";
            #endregion

            m_monstreChoisi = ((cMonstre)TabMonstre[m_NumeroMonstre]);
            InitialisteurDeVieMechant(m_NumeroMonstre, 1);
            MechantMort          = false;
            pbMechant.Enabled    = true;
            LbVieMechant.Enabled = true;

            #region NextEnnemi
            if (IndiceTabMonstre + 1 < TabMonstre.Length)
            {
                pbNextEnnemi.Image = (Image)(TabMonstre[TabOrdreDesMonstre[IndiceTabMonstre + 1]].m_ImageMonstre);
            }
            else
            {
                #region Si BOSS ACTIVATE (form)
                BossActivate             = true;
                BarreVieMechant2.Visible = true;
                BarreVieMechant3.Visible = true;
                lbDomMechant2.Visible    = true;
                lbDomMechant3.Visible    = true;
                lbViemechant2.Visible    = true;
                lbVieMechant3.Visible    = true;
                lbMiniboss3.Visible      = true;
                pbMiniBoss3.Visible      = true;
                #endregion

                m_monstreChoisi = ((cMonstre)TabMonstre[16]);
                InitialisteurDeVieMechant(m_NumeroMonstre, 2);
                InitialisteurDeVieMechant(m_NumeroMonstre, 3);
            }
            #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 Compteur pour paralysie(si Rune 2 acquise)
            if (Rune2 == 1)
            {
                if (Paralysie == 2)
                {
                    MonstreParalysé = false;
                }

                if (Paralysie == 0)
                {
                    MonstreParalysé = true;
                    Paralysie       = 3;
                    cMonstre[] TabCMonstre = new cMonstre[1];
                    TabCMonstre[0] = m_monstreChoisi;
                    dChoixEnnemiAParalyser ChoixEnnemi = new dChoixEnnemiAParalyser(TabCMonstre);
                    ChoixEnnemi.ShowDialog();
                    lbDomMechant.Text = "ENNEMI \n PARALYSÉ";
                }
            }
            #endregion

            btnContinue.Enabled = false;
        }
Example #4
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
        }