public void InitialisteurDeVieMechant(int nb, int Numennemi) { switch (Numennemi) { case 1: //initialisateur de vie mechant + graphique m_VieMechant = ((cMonstre)TabMonstre[nb]).m_Vie; pbMechant.Image = ((cMonstre)TabMonstre[nb]).m_ImageMonstre; BarreVieMechant.Step = m_VieMechant; BarreVieMechant.Maximum = m_VieMechant; BarreVieMechant.PerformStep(); LbVieMechant.Text = m_VieMechant.ToString() + "/" + m_VieMechant.ToString(); LbMechant.Text = ((cMonstre)TabMonstre[nb]).m_nom; break; case 2: m_VieMechant2 = ((cMonstre)TabMonstre[nb]).m_Vie; pbNextEnnemi.Image = ((cMonstre)TabMonstre[nb]).m_ImageMonstre; BarreVieMechant2.Step = m_VieMechant; BarreVieMechant2.Maximum = m_VieMechant; BarreVieMechant2.PerformStep(); lbViemechant2.Text = m_VieMechant.ToString() + "/" + m_VieMechant.ToString(); lbNextEnnemi.Text = ((cMonstre)TabMonstre[nb]).m_nom + " (mini)"; break; case 3: m_VieMechant3 = ((cMonstre)TabMonstre[nb]).m_Vie; pbMiniBoss3.Image = ((cMonstre)TabMonstre[nb]).m_ImageMonstre; BarreVieMechant3.Step = m_VieMechant; BarreVieMechant3.Maximum = m_VieMechant; BarreVieMechant3.PerformStep(); lbVieMechant3.Text = m_VieMechant.ToString() + "/" + m_VieMechant.ToString(); lbMiniboss3.Text = ((cMonstre)TabMonstre[nb]).m_nom + " (mini)"; break; } }
public void InitialisteurDeVieMechant(int nb, int Monstre1ou2ou3) { //+graphique dans pbImageMonstre switch (Monstre1ou2ou3) { case 1: #region initialisateur de vie mechant m_VieMechant = ((cMonstre)TabMonstre[nb]).m_Vie; pbMechant.Image = ((cMonstre)TabMonstre[nb]).m_ImageMonstre; BarreVieMechant.Step = m_VieMechant; BarreVieMechant.Maximum = m_VieMechant; BarreVieMechant.PerformStep(); lbVieMechant.Text = m_VieMechant.ToString() + "/" + m_VieMechant.ToString(); lbMechant.Text = ((cMonstre)TabMonstre[nb]).m_nom; #endregion break; case 2: #region initialisateur de vie mechant2 m_VieMechant2 = ((cMonstre)TabMonstre[nb]).m_Vie; pbMechant2.Image = ((cMonstre)TabMonstre[nb]).m_ImageMonstre; BarreVieMechant2.Step = m_VieMechant2; BarreVieMechant2.Maximum = m_VieMechant2; BarreVieMechant2.PerformStep(); lbVieMechant2.Text = m_VieMechant2.ToString() + "/" + m_VieMechant2.ToString(); lbMechant2.Text = ((cMonstre)TabMonstre[nb]).m_nom; #endregion break; case 3: #region initialisateur de vie mechant3 m_VieMechant3 = ((cMonstre)TabMonstre[nb]).m_Vie; pbMechant3.Image = ((cMonstre)TabMonstre[nb]).m_ImageMonstre; BarreVieMechant3.Step = m_VieMechant3; BarreVieMechant3.Maximum = m_VieMechant3; BarreVieMechant3.PerformStep(); lbVieMechant3.Text = m_VieMechant3.ToString() + "/" + m_VieMechant3.ToString(); lbMechant3.Text = ((cMonstre)TabMonstre[nb]).m_nom; #endregion break; } }
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 }
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 }