//Loohy & Coldman public Partie(int map_width, int map_height) { gameplay = new SystemeDeJeu(); earthPenguin = new MoteurGraphique(32, 32); time = 0; lastUpdatesTime = 0; }
public void ActiverAura(Unite moi_, MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, int coef_) { for (int porteeAura = 1; porteeAura < moi_.getStat[4] / 4; porteeAura++) { for (int k = 0; k < porteeAura; k++) { if (moi_.i + k >= 0 && moi_.i + k < moteurgraphique_.map.GetLength(0) && moi_.j + (porteeAura - k) >= 0 && moi_.j + (porteeAura - k) < moteurgraphique_.map.GetLength(1)) { if (moteurgraphique_.map[moi_.i + k, moi_.j + (porteeAura - k)].presence) { auraAt(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i + k, moi_.j + (porteeAura - k)].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i + k, moi_.j + (porteeAura - k)].pointeurUnite], coef_, moi_.numeroArmee); } } if (moi_.i - k >= 0 && moi_.i - k < moteurgraphique_.map.GetLength(0) && moi_.j - (porteeAura - k) >= 0 && moi_.j - (porteeAura - k) < moteurgraphique_.map.GetLength(1)) { if (moteurgraphique_.map[moi_.i - k, moi_.j - (porteeAura - k)].presence) { auraAt(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i - k, moi_.j - (porteeAura - k)].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i - k, moi_.j - (porteeAura - k)].pointeurUnite], coef_, moi_.numeroArmee); } } if (moi_.i + (porteeAura - k) >= 0 && moi_.i + (porteeAura - k) < moteurgraphique_.map.GetLength(0) && moi_.j - k >= 0 && moi_.j - k < moteurgraphique_.map.GetLength(1)) { if (moteurgraphique_.map[moi_.i + (porteeAura - k), moi_.j - k].presence) { auraAt(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i + (porteeAura - k), moi_.j - k].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i + (porteeAura - k), moi_.j - k].pointeurUnite], coef_, moi_.numeroArmee); } } if (moi_.i - (porteeAura - k) >= 0 && moi_.i - (porteeAura - k) < moteurgraphique_.map.GetLength(0) && moi_.j + k >= 0 && moi_.j + k < moteurgraphique_.map.GetLength(1)) { if (moteurgraphique_.map[moi_.i - (porteeAura - k), moi_.j + k].presence) { auraAt(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i - (porteeAura - k), moi_.j + k].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i - (porteeAura - k), moi_.j + k].pointeurUnite], coef_, moi_.numeroArmee); } } } } }
public void checkContenuDansPorteeMoyenJoute(MoteurGraphique moteurgraphique_, int portee_, Unite moi_, SystemeDeJeu gameplay_, Armee armee_, HUD hud_) { //cible : gameplay_.armees[moteurgraphique_.map[i_, j_].pointeurArmee].bataillon[moteurgraphique_.map[i_, j_].pointeurUnite] List<Unite> ciblesPotentielles = new List<Unite>(); List<int> porteesPotentielles = new List<int>(); #region boucleTestCiblesPotentielles if (moi_.attaqOrNot) { for (int k = 0; k < portee_; k++) { if (moi_.i + k >= 0 && moi_.i + k < moteurgraphique_.longueur && moi_.j + (portee_ - k) >= 0 && moi_.j + (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i + k, moi_.j + (portee_ - k)].presence && gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i, moi_.j].pointeurArmee].camp != gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i + k, moi_.j + (portee_ - k)].pointeurArmee].camp) { ciblesPotentielles.Add(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i + k, moi_.j + (portee_ - k)].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i + k, moi_.j + (portee_ - k)].pointeurUnite]); porteesPotentielles.Add(portee_); } } if (moi_.i - k >= 0 && moi_.i - k < moteurgraphique_.longueur && moi_.j - (portee_ - k) >= 0 && moi_.j - (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i - k, moi_.j - (portee_ - k)].presence && gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i, moi_.j].pointeurArmee].camp != gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i - k, moi_.j - (portee_ - k)].pointeurArmee].camp) { ciblesPotentielles.Add(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i - k, moi_.j - (portee_ - k)].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i - k, moi_.j - (portee_ - k)].pointeurUnite]); porteesPotentielles.Add(portee_); } } if (moi_.i + (portee_ - k) >= 0 && moi_.i + (portee_ - k) < moteurgraphique_.longueur && moi_.j - k >= 0 && moi_.j - k < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i + (portee_ - k), moi_.j - k].presence && gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i, moi_.j].pointeurArmee].camp != gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i + (portee_ - k), moi_.j - k].pointeurArmee].camp) { ciblesPotentielles.Add(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i + (portee_ - k), moi_.j - k].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i + (portee_ - k), moi_.j - k].pointeurUnite]); porteesPotentielles.Add(portee_); } } if (moi_.i - (portee_ - k) >= 0 && moi_.i - (portee_ - k) < moteurgraphique_.longueur && moi_.j + k >= 0 && moi_.j + k < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i - (portee_ - k), moi_.j + k].presence && gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i, moi_.j].pointeurArmee].camp != gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i - (portee_ - k), moi_.j + k].pointeurArmee].camp) { ciblesPotentielles.Add(gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i - (portee_ - k), moi_.j + k].pointeurArmee]. bataillon[moteurgraphique_.map[moi_.i - (portee_ - k), moi_.j + k].pointeurUnite]); porteesPotentielles.Add(portee_); } } } for (int i = 0; i < ciblesPotentielles.Count - 1; i++) { if (!ciblesPotentielles[i].alive) { ciblesPotentielles.RemoveAt(i); porteesPotentielles.RemoveAt(i); } } #endregion #region attaqueEfficacementUniteAvecLaMeilleurePrecisionEtLeMoinsDePV for (int w = ciblesPotentielles.Count - 1; w >= 0; w--) { if (moi_.typedAttaque[porteesPotentielles[w]] == true) { if (moi_.attaque + moi_.bonusAttaque <= ciblesPotentielles[w].armure + ciblesPotentielles[w].bonusArmure) { ciblesPotentielles.RemoveAt(w); porteesPotentielles.RemoveAt(w); } } else { if (moi_.attaque + moi_.bonusresistance <= ciblesPotentielles[w].resistance + ciblesPotentielles[w].bonusresistance) { ciblesPotentielles.RemoveAt(w); porteesPotentielles.RemoveAt(w); } } } while (ciblesPotentielles.Count > 1) { for (int j = 0; j < ciblesPotentielles.Count - 1; j++) { if (ciblesPotentielles[j].pvactuel < ciblesPotentielles[j + 1].pvactuel) { ciblesPotentielles.RemoveAt(j + 1); porteesPotentielles.RemoveAt(j + 1); } else { ciblesPotentielles.RemoveAt(j); porteesPotentielles.RemoveAt(j); } } } if (ciblesPotentielles.Count > 0) { moi_.Initiative(ciblesPotentielles[0], porteesPotentielles[0], moteurgraphique_, gameplay_, ref gameplay_.mood, hud_); } } #endregion }
public void AttaqueSud(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, ref e_modeAction mood_, HUD hud_) { if (j + 1 < moteurgraphique_.largeur && moteurgraphique_.map[i, j + 1].presence) { mouvOrNot = false; Initiative(gameplay_.listeDesJoueurs[moteurgraphique_.map[i, j + 1]. pointeurArmee].bataillon[moteurgraphique_.map[i, j + 1].pointeurUnite], 1, moteurgraphique_, gameplay_, ref mood_, hud_); sousrect.X = 128; } }
public void AttaqueOuest(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, ref e_modeAction mood_, HUD hud_) { mouvOrNot = false; Initiative(gameplay_.listeDesJoueurs[moteurgraphique_.map[i - 1, j]. pointeurArmee].bataillon[moteurgraphique_.map[i - 1, j].pointeurUnite], 1, moteurgraphique_, gameplay_, ref mood_, hud_); sousrect.X = 256; }
public void utiliserIA(MoteurGraphique moteurgraphique_, Armee armee_, SystemeDeJeu gameplay_, HUD hud_) { if (fileDeMouvements.Count == 0) { IA.Play(this, moteurgraphique_, armee_, gameplay_, hud_); } }
public void soeurAnne(MoteurGraphique moteurgraphique_, ref bool[,] casesVisitees_, SystemeDeJeu gameplay_) { if (IA.difficulte == 0 && alive) { if (i >= 0 && i < moteurgraphique_.longueur && j >= 0 && j < moteurgraphique_.largeur) { casesVisitees_[i, j] = true; moteurgraphique_.map[i, j].apercue = true; moteurgraphique_.map[i, j].visible = true; #region detecter les invisibles proches for (int p = -1; p < 2; p++) { for (int q = -1; q < 2; q++) { if (i + p >= 0 && i + p < moteurgraphique_.longueur && j + q >= 0 && j + q < moteurgraphique_.largeur && (p != 0 || q != 0) && moteurgraphique_.map[i + p, j + q].visible && moteurgraphique_.map[i + p, j + q].presence) { if (gameplay_.listeDesJoueurs[moteurgraphique_.map[i + p, j + q].pointeurArmee]. bataillon[moteurgraphique_.map[i + p, j + q].pointeurUnite].numeroArmee != numeroArmee) { gameplay_.listeDesJoueurs[moteurgraphique_.map[i + p, j + q].pointeurArmee]. bataillon[moteurgraphique_.map[i + p, j + q].pointeurUnite].estInvisible = false; } } } } #endregion #region Annes if (i != 0) { anneOuest(moteurgraphique_, ref casesVisitees_, i - 1, j, moteurgraphique_.map[i - 1, j].altitude, 7, true); if (j != 0) { anneOuestNord(moteurgraphique_, ref casesVisitees_, i - 1, j - 1, moteurgraphique_.map[i - 1, j - 1].altitude, 7, true); } if (j != moteurgraphique_.largeur - 1) { anneSudOuest(moteurgraphique_, ref casesVisitees_, i - 1, j + 1, moteurgraphique_.map[i - 1, j + 1].altitude, 7, true); } } if (i != moteurgraphique_.longueur - 1) { anneEst(moteurgraphique_, ref casesVisitees_, i + 1, j, moteurgraphique_.map[i + 1, j].altitude, 7, true); if (j != 0) { anneNordEst(moteurgraphique_, ref casesVisitees_, i + 1, j - 1, moteurgraphique_.map[i + 1, j - 1].altitude, 7, true); } if (j != moteurgraphique_.largeur - 1) { anneEstSud(moteurgraphique_, ref casesVisitees_, i + 1, j + 1, moteurgraphique_.map[i + 1, j + 1].altitude, 7, true); } } if (j != 0) { anneNord(moteurgraphique_, ref casesVisitees_, i, j - 1, moteurgraphique_.map[i, j - 1].altitude, 7, true); } if (j != moteurgraphique_.largeur - 1) { anneSud(moteurgraphique_, ref casesVisitees_, i, j + 1, moteurgraphique_.map[i, j + 1].altitude, 7, true); } #endregion } } }
public void Mouvement(MoteurGraphique moteurgraphique_, Armee armee_, SystemeDeJeu gameplay_) { #region Touches if ((i + 1 < moteurgraphique_.longueur) && ((Keyboard.GetState().IsKeyDown(Keys.S) || (moteurgraphique_.map[i + 1, j].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && mouvOrNot)) { goEst(moteurgraphique_, armee_, gameplay_); lookAtCheminsInitialize(moteurgraphique_); } if ((j > 0) && ((Keyboard.GetState().IsKeyDown(Keys.W) || (moteurgraphique_.map[i, j - 1].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && mouvOrNot)) { goNord(moteurgraphique_, armee_, gameplay_); lookAtCheminsInitialize(moteurgraphique_); } if ((i > 0) && ((Keyboard.GetState().IsKeyDown(Keys.Q) || (moteurgraphique_.map[i - 1, j].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && mouvOrNot)) { goOuest(moteurgraphique_, armee_, gameplay_); lookAtCheminsInitialize(moteurgraphique_); } if ((j + 1 < moteurgraphique_.largeur) && ((Keyboard.GetState().IsKeyDown(Keys.A) || (moteurgraphique_.map[i, j + 1].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && mouvOrNot)) { goSud(moteurgraphique_, armee_, gameplay_); lookAtCheminsInitialize(moteurgraphique_); } #endregion if (Keyboard.GetState().IsKeyUp(Keys.S) && Keyboard.GetState().IsKeyUp(Keys.A) && Keyboard.GetState().IsKeyUp(Keys.W) && Keyboard.GetState().IsKeyUp(Keys.Q) && Mouse.GetState().LeftButton == ButtonState.Released && state == e_EtatAnim.repos1) { mouvOrNot = true; } if (Mouse.GetState().RightButton == ButtonState.Pressed && mouvOrNot && fileDeMouvements.Count == 0) { for (int c = 0; c < moteurgraphique_.longueur; c++) { for (int d = 0; d < moteurgraphique_.largeur; d++) { if (mouvOrNot && moteurgraphique_.map[c, d].estAccessible && moteurgraphique_.map[c, d].estEnSurbrillance && moteurgraphique_.map[c, d].cheminValid) { PathFindingLoohy(moteurgraphique_, c, d); } } } } }
public void Initiative(Unite ennemi_, int porteDeFrappe_, MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, ref e_modeAction mood, HUD hud_) { if (!ennemi_.estInvisible) { estInvisible = false; assassin = ennemi_.numeroArmee; ennemi_.assassin = numeroArmee; if ((initiative + bonusInitiative) >= ennemi_.initiative) { Frappe(ennemi_, porteDeFrappe_, moteurgraphique_, gameplay_, hud_); } else { ennemi_.Frappe(this, porteDeFrappe_, moteurgraphique_, gameplay_, hud_); } mood = e_modeAction.Mouvement; attaqOrNot = false; } }
public void checkPV(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_) { for (int i = 0; i < effectif; i++) { if (bataillon[i].alive && bataillon[i].pvactuel <= 0) { mort(i, moteurgraphique_, gameplay_); } } atLeastOneAlive = false; foreach (Unite item in bataillon) { atLeastOneAlive = atLeastOneAlive || item.alive; } atLeastOneHeroAlive = false; foreach (Unite item in bataillon) { atLeastOneHeroAlive = atLeastOneHeroAlive || (item.alive && item.typeUnite == e_typeUnite.Heros); } }
public void auras(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_) { foreach (Unite item in bataillon) { item.profiteDuneAura = false; } foreach (Unite item in bataillon) { if (item.alive && item.typeUnite == e_typeUnite.Heros && item.aura != null) { item.aura.ActiverAura(item, moteurgraphique_, gameplay_, -1); item.aura.ActiverAura(item, moteurgraphique_, gameplay_, 1); } } }
public void Afficher(MoteurGraphique loohy_, SystemeDeJeu gameplay_) { for (int i = 0; i < effectif; i++) { if (bataillon[i].alive) { bataillon[i].Afficher(loohy_.map[bataillon[i].i, bataillon[i].j], gameplay_); } } }
public void utiliserIA(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, HUD hud_) { bataillon[uniteselect].utiliserIA(moteurgraphique_, this, gameplay_, hud_); }
public void UpdateSelonIAouNon(MoteurGraphique loohy_, SystemeDeJeu gameplay_, ref e_modeAction mood_, /*Lecteur coldman_,*/ HUD hud_, ref int time_, ref bool transition_) { if (IA) { UpdateIA(loohy_, gameplay_,/* coldman_,*/ hud_, ref time_, ref transition_); } else { Update(loohy_, gameplay_, ref mood_, /*coldman_, */hud_); } }
public void UpdateSansClicSelonIAouNon(MoteurGraphique loohy_, SystemeDeJeu gameplay_) { foreach (Unite item in bataillon) { item.lireLaFile(loohy_, gameplay_.listeDesJoueurs[gameplay_.tourencours], gameplay_); } }
public void deplacementDifficileJoute(MoteurGraphique moteurgraphique_, Unite moi_, SystemeDeJeu gameplay_, Armee armee_, HUD hud_) { dejaBienPlace = false; ilABouger = false; bool yaUnEnnemiFaible = false; List<Unite> unitesEnnemis = new List<Unite>(); List<int> distanceAvecEnnemis = new List<int>(); List<Vector2> positionsEnnemies = new List<Vector2>(); List<Unite> unitesAlliees = new List<Unite>(); List<int> distanceAvecAlliees = new List<int>(); List<Vector2> positionsAlliees = new List<Vector2>(); List<int> porteesDeMeilleuresPrecisionsPouvoir = new List<int>(); int porteeMaxPouvoir = 0; #region obtenirPorteeMaxPouvoir if (moi_.typeUnite == e_typeUnite.Elite) { for (int carapuce = 0; carapuce < moi_.SHORYUKEN.porteePouvoir.Count; carapuce++) { if (moi_.SHORYUKEN.porteePouvoir[carapuce] > porteeMaxPouvoir) { porteeMaxPouvoir = moi_.SHORYUKEN.porteePouvoir[carapuce]; } } } #endregion #region ajouterToutesLesUnitesEnnemies for (int wazaaa = 0; wazaaa < gameplay_.listeDesJoueurs.Count; wazaaa++) { if (gameplay_.listeDesJoueurs[wazaaa].camp != gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i, moi_.j].pointeurArmee].camp) { foreach (Unite unite in gameplay_.listeDesJoueurs[wazaaa].bataillon) { if (unite.alive && Math.Abs(moi_.i - unite.i) + Math.Abs(moi_.j - unite.j) <= (moi_.mouvement + porteeMaxPouvoir)) { unitesEnnemis.Add(unite); distanceAvecEnnemis.Add(Math.Abs(moi_.i - unite.i) + Math.Abs(moi_.j - unite.j)); positionsEnnemies.Add(new Vector2(unite.i, unite.j)); } } } } #endregion #region ajouterToutesLesUnitesAlliees foreach (Unite bulbizarre in gameplay_.listeDesJoueurs[moteurgraphique_.map[moi_.i, moi_.j].pointeurArmee].bataillon) { unitesAlliees.Add(bulbizarre); distanceAvecAlliees.Add(Math.Abs((moi_.i - bulbizarre.i) + (moi_.j - bulbizarre.j))); positionsAlliees.Add(new Vector2(bulbizarre.i, bulbizarre.j)); } #endregion if (moi_.typeUnite == e_typeUnite.Elite) { for (int f = 10; f > 0; f--) { for (int g = moi_.SHORYUKEN.porteePouvoir.Count - 1; g >= 0; g--) { if (moi_.SHORYUKEN.porteePouvoir[g] == f) { porteesDeMeilleuresPrecisionsPouvoir.Add(g); } } } } if (ilABouger == false && dejaBienPlace == false) { if (moi_.typeUnite == e_typeUnite.Elite && moi_.energieactuel >= moi_.SHORYUKEN.coutEnergie) { if (moi_.SHORYUKEN.type == e_typeDePouvoir.Degat) { #region trouverEnnemiLeMieuxPlace if (moi_.SHORYUKEN.vertical == false) { #region preTestDuLosange for (int i = distanceAvecEnnemis.Count - 1; i >= 0; i--) { ilAFaussementBouger = false; for (int n = porteesDeMeilleuresPrecisionsPouvoir.Count - 1; n > 0; n--) { for (int j = 0; j <= porteesDeMeilleuresPrecisionsPouvoir[n] - 1; j++) { if (porteesDeMeilleuresPrecisionsPouvoir[n] == distanceAvecEnnemis[i]) { ilAFaussementBouger = true; } else { if ((int)positionsEnnemies[i].X + j >= 0 && (int)positionsEnnemies[i].X + j < moteurgraphique_.longueur && (int)positionsEnnemies[i].Y + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsEnnemies[i].Y + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[i].X + j, (int)positionsEnnemies[i].Y + (porteesDeMeilleuresPrecisionsPouvoir[n] - j)].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[i].X - j >= 0 && (int)positionsEnnemies[i].X - j < moteurgraphique_.longueur && (int)positionsEnnemies[i].Y - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsEnnemies[i].Y - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[i].X - j, (int)positionsEnnemies[i].Y - (porteesDeMeilleuresPrecisionsPouvoir[n] - j)].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[i].X + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsEnnemies[i].X + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.longueur && (int)positionsEnnemies[i].Y - j >= 0 && (int)positionsEnnemies[i].Y - j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[i].X + (porteesDeMeilleuresPrecisionsPouvoir[n] - j), (int)positionsEnnemies[i].Y - j].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[i].X - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsEnnemies[i].X - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.longueur && (int)positionsEnnemies[i].Y + j >= 0 && (int)positionsEnnemies[i].Y + j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[i].X - (porteesDeMeilleuresPrecisionsPouvoir[n] - j), (int)positionsEnnemies[i].Y + j].cheminValid) { ilAFaussementBouger = true; } } } } } } } } if (ilAFaussementBouger == false) { distanceAvecEnnemis.RemoveAt(i); unitesEnnemis.RemoveAt(i); positionsEnnemies.RemoveAt(i); } } #endregion } else { #region preTestDeLaLigneDroite for (int salameche = distanceAvecEnnemis.Count - 1; salameche >= 0; salameche--) { ilAFaussementBouger = false; for (int reptincel = porteesDeMeilleuresPrecisionsPouvoir.Count - 1; reptincel >= 0; reptincel--) { if (porteesDeMeilleuresPrecisionsPouvoir[reptincel] == distanceAvecEnnemis[salameche] && (moi_.i == unitesEnnemis[salameche].i || moi_.j == unitesEnnemis[salameche].j)) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[salameche].X + porteesDeMeilleuresPrecisionsPouvoir[reptincel] >= 0 && (int)positionsEnnemies[salameche].X + porteesDeMeilleuresPrecisionsPouvoir[reptincel] < moteurgraphique_.longueur) { if (moteurgraphique_.map[(int)positionsEnnemies[salameche].X + porteesDeMeilleuresPrecisionsPouvoir[reptincel], moi_.j].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[salameche].X - porteesDeMeilleuresPrecisionsPouvoir[reptincel] >= 0 && (int)positionsEnnemies[salameche].X - porteesDeMeilleuresPrecisionsPouvoir[reptincel] < moteurgraphique_.longueur) { if (moteurgraphique_.map[(int)positionsEnnemies[salameche].X - porteesDeMeilleuresPrecisionsPouvoir[reptincel], moi_.j].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[salameche].Y + porteesDeMeilleuresPrecisionsPouvoir[reptincel] >= 0 && (int)positionsEnnemies[salameche].Y + porteesDeMeilleuresPrecisionsPouvoir[reptincel] < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i, (int)positionsEnnemies[salameche].Y + porteesDeMeilleuresPrecisionsPouvoir[reptincel]].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsEnnemies[salameche].Y - porteesDeMeilleuresPrecisionsPouvoir[reptincel] >= 0 && (int)positionsEnnemies[salameche].Y - porteesDeMeilleuresPrecisionsPouvoir[reptincel] < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i, (int)positionsEnnemies[salameche].Y - porteesDeMeilleuresPrecisionsPouvoir[reptincel]].cheminValid) { ilAFaussementBouger = true; } } } } } } if (ilAFaussementBouger == false) { distanceAvecEnnemis.RemoveAt(salameche); unitesEnnemis.RemoveAt(salameche); positionsEnnemies.RemoveAt(salameche); } } #endregion } #region avoirPlusQuUnEnnemi while (distanceAvecEnnemis.Count > 1) { for (int i = distanceAvecEnnemis.Count - 2; i >= 0; i--) { if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsEnnemies[i].X, (int)positionsEnnemies[i].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsEnnemies[i].X, (int)positionsEnnemies[i].Y].pointeurUnite].pvactuel < gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsEnnemies[i + 1].X, (int)positionsEnnemies[i + 1].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsEnnemies[i + 1].X, (int)positionsEnnemies[i + 1].Y].pointeurUnite].pvactuel) { unitesEnnemis.RemoveAt(i + 1); positionsEnnemies.RemoveAt(i + 1); distanceAvecEnnemis.RemoveAt(i + 1); } else if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsEnnemies[i].X, (int)positionsEnnemies[i].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsEnnemies[i].X, (int)positionsEnnemies[i].Y].pointeurUnite].pvactuel > gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsEnnemies[i + 1].X, (int)positionsEnnemies[i + 1].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsEnnemies[i + 1].X, (int)positionsEnnemies[i + 1].Y].pointeurUnite].pvactuel) { unitesEnnemis.RemoveAt(i); positionsEnnemies.RemoveAt(i); distanceAvecEnnemis.RemoveAt(i); } else { if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsEnnemies[i].X, (int)positionsEnnemies[i].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsEnnemies[i].X, (int)positionsEnnemies[i].Y].pointeurUnite].typeUnite == e_typeUnite.Elite) { unitesEnnemis.RemoveAt(i + 1); positionsEnnemies.RemoveAt(i + 1); distanceAvecEnnemis.RemoveAt(i + 1); } else if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsEnnemies[i + 1].X, (int)positionsEnnemies[i + 1].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsEnnemies[i + 1].X, (int)positionsEnnemies[i + 1].Y].pointeurUnite].typeUnite == e_typeUnite.Elite) { unitesEnnemis.RemoveAt(i); positionsEnnemies.RemoveAt(i); distanceAvecEnnemis.RemoveAt(i); } else { unitesEnnemis.RemoveAt(i); positionsEnnemies.RemoveAt(i); distanceAvecEnnemis.RemoveAt(i); } } } } #endregion #endregion #region deplacementVersEnnemiLePlusPratique if (distanceAvecEnnemis.Count > 0) { if (moi_.SHORYUKEN.vertical == false) { #region seMettreALaMeilleurePorteeLosange for (int i = 0; i < porteesDeMeilleuresPrecisionsPouvoir.Count; i++) { for (int j = 0; j <= porteesDeMeilleuresPrecisionsPouvoir[i] - 1; j++) { if (ilABouger == false && dejaBienPlace == false) { if (porteesDeMeilleuresPrecisionsPouvoir[i] == distanceAvecEnnemis[0]) { dejaBienPlace = true; moi_.SHORYUKEN.UtiliserPouvoir(moi_, moteurgraphique_, gameplay_, unitesEnnemis[0].i, unitesEnnemis[0].j, ref gameplay_.mood, hud_); } else { if ((int)positionsEnnemies[0].X + j >= 0 && (int)positionsEnnemies[0].X + j < moteurgraphique_.longueur && (int)positionsEnnemies[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsEnnemies[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[0].X + j, (int)positionsEnnemies[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j)].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsEnnemies[0].X + j, (int)positionsEnnemies[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j)); } else if ((int)positionsEnnemies[0].X - j >= 0 && (int)positionsEnnemies[0].X - j < moteurgraphique_.longueur && (int)positionsEnnemies[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsEnnemies[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[0].X - j, (int)positionsEnnemies[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j)].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsEnnemies[0].X - j, (int)positionsEnnemies[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j)); } else if ((int)positionsEnnemies[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsEnnemies[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.longueur && (int)positionsEnnemies[0].Y - j >= 0 && (int)positionsEnnemies[0].Y - j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsEnnemies[0].Y - j].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsEnnemies[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsEnnemies[0].Y - j); } else if ((int)positionsEnnemies[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsEnnemies[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.longueur && (int)positionsEnnemies[0].Y + j >= 0 && (int)positionsEnnemies[0].Y + j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsEnnemies[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsEnnemies[0].Y + j].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsEnnemies[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsEnnemies[0].Y + j); } } } } } } } } } #endregion } else { #region seMettreALaMeilleurePorteeDroite for (int raichu = porteesDeMeilleuresPrecisionsPouvoir.Count - 1; raichu >= 0; raichu--) { if (porteesDeMeilleuresPrecisionsPouvoir[raichu] == distanceAvecEnnemis[0] && (moi_.i == unitesEnnemis[0].i || moi_.j == unitesEnnemis[0].j)) { dejaBienPlace = true; moi_.SHORYUKEN.UtiliserPouvoir(moi_, moteurgraphique_, gameplay_, unitesEnnemis[0].i, unitesEnnemis[0].j, ref gameplay_.mood, hud_); } else if ((int)positionsEnnemies[0].X + porteesDeMeilleuresPrecisionsPouvoir[raichu] >= 0 && (int)positionsEnnemies[0].X + porteesDeMeilleuresPrecisionsPouvoir[raichu] < moteurgraphique_.longueur) { if (moteurgraphique_.map[(int)positionsEnnemies[0].X + porteesDeMeilleuresPrecisionsPouvoir[raichu], moi_.j].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsEnnemies[0].X + porteesDeMeilleuresPrecisionsPouvoir[raichu], moi_.j); } else if ((int)positionsEnnemies[0].X - porteesDeMeilleuresPrecisionsPouvoir[raichu] >= 0 && (int)positionsEnnemies[0].X - porteesDeMeilleuresPrecisionsPouvoir[raichu] < moteurgraphique_.longueur) { if (moteurgraphique_.map[(int)positionsEnnemies[0].X - porteesDeMeilleuresPrecisionsPouvoir[raichu], moi_.j].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsEnnemies[0].X - porteesDeMeilleuresPrecisionsPouvoir[raichu], moi_.j); } else if ((int)positionsEnnemies[0].Y + porteesDeMeilleuresPrecisionsPouvoir[raichu] >= 0 && (int)positionsEnnemies[0].Y + porteesDeMeilleuresPrecisionsPouvoir[raichu] < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i, (int)positionsEnnemies[0].Y + porteesDeMeilleuresPrecisionsPouvoir[raichu]].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, moi_.i, (int)positionsEnnemies[0].Y + porteesDeMeilleuresPrecisionsPouvoir[raichu]); } else if ((int)positionsEnnemies[0].Y - porteesDeMeilleuresPrecisionsPouvoir[raichu] >= 0 && (int)positionsEnnemies[0].Y - porteesDeMeilleuresPrecisionsPouvoir[raichu] < moteurgraphique_.largeur) { if (moteurgraphique_.map[moi_.i, (int)positionsEnnemies[0].Y - porteesDeMeilleuresPrecisionsPouvoir[raichu]].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, moi_.i, (int)positionsEnnemies[0].Y - porteesDeMeilleuresPrecisionsPouvoir[raichu]); } } } } } } #endregion } } #endregion } else { for (int alakazam = 0; alakazam < unitesAlliees.Count; alakazam++) { if (unitesAlliees[alakazam].pvactuel < unitesAlliees[alakazam].pvmax / 2) { yaUnEnnemiFaible = true; } } if (yaUnEnnemiFaible) { #region trouverAllieLeMieuxPlace #region preTestDuLosange for (int i = distanceAvecAlliees.Count - 1; i >= 0; i--) { ilAFaussementBouger = false; for (int n = porteesDeMeilleuresPrecisionsPouvoir.Count - 1; n >= 0; n--) { for (int j = 0; j <= porteesDeMeilleuresPrecisionsPouvoir[n] - 1; j++) { if (porteesDeMeilleuresPrecisionsPouvoir[n] == distanceAvecAlliees[i]) { ilAFaussementBouger = true; } else { if ((int)positionsAlliees[i].X + j >= 0 && (int)positionsAlliees[i].X + j < moteurgraphique_.longueur && (int)positionsAlliees[i].Y + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsAlliees[i].Y + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[i].X + j, (int)positionsAlliees[i].Y + (porteesDeMeilleuresPrecisionsPouvoir[n] - j)].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsAlliees[i].X - j >= 0 && (int)positionsAlliees[i].X - j < moteurgraphique_.longueur && (int)positionsAlliees[i].Y - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsAlliees[i].Y - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[i].X - j, (int)positionsAlliees[i].Y - (porteesDeMeilleuresPrecisionsPouvoir[n] - j)].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsAlliees[i].X + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsAlliees[i].X + (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.longueur && (int)positionsAlliees[i].Y - j >= 0 && (int)positionsAlliees[i].Y - j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[i].X + (porteesDeMeilleuresPrecisionsPouvoir[n] - j), (int)positionsAlliees[i].Y - j].cheminValid) { ilAFaussementBouger = true; } else if ((int)positionsAlliees[i].X - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) >= 0 && (int)positionsAlliees[i].X - (porteesDeMeilleuresPrecisionsPouvoir[n] - j) < moteurgraphique_.longueur && (int)positionsAlliees[i].Y + j >= 0 && (int)positionsAlliees[i].Y + j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[i].X - (porteesDeMeilleuresPrecisionsPouvoir[n] - j), (int)positionsAlliees[i].Y + j].cheminValid) { ilAFaussementBouger = true; } } } } } } } } if (ilAFaussementBouger == false) { distanceAvecAlliees.RemoveAt(i); unitesAlliees.RemoveAt(i); positionsAlliees.RemoveAt(i); } } #endregion #region avoirPlusQuUnEnnemi for (int leveinard = unitesAlliees.Count - 1; leveinard >= 0; leveinard--) { if (!unitesAlliees[leveinard].alive) { unitesAlliees.RemoveAt(leveinard); positionsAlliees.RemoveAt(leveinard); distanceAvecAlliees.RemoveAt(leveinard); } } while (distanceAvecAlliees.Count > 1) { for (int i = distanceAvecAlliees.Count - 2; i >= 0; i--) { if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsAlliees[i].X, (int)positionsAlliees[i].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsAlliees[i].X, (int)positionsAlliees[i].Y].pointeurUnite].pvactuel < gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsAlliees[i + 1].X, (int)positionsAlliees[i + 1].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsAlliees[i + 1].X, (int)positionsAlliees[i + 1].Y].pointeurUnite].pvactuel) { unitesAlliees.RemoveAt(i + 1); positionsAlliees.RemoveAt(i + 1); distanceAvecAlliees.RemoveAt(i + 1); } else if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsAlliees[i].X, (int)positionsAlliees[i].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsAlliees[i].X, (int)positionsAlliees[i].Y].pointeurUnite].pvactuel < gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsAlliees[i + 1].X, (int)positionsAlliees[i + 1].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsAlliees[i + 1].X, (int)positionsAlliees[i + 1].Y].pointeurUnite].pvactuel) { unitesAlliees.RemoveAt(i); positionsAlliees.RemoveAt(i); distanceAvecAlliees.RemoveAt(i); } else { if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsAlliees[i].X, (int)positionsAlliees[i].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsAlliees[i].X, (int)positionsAlliees[i].Y].pointeurUnite].typeUnite == e_typeUnite.Elite) { unitesAlliees.RemoveAt(i + 1); positionsAlliees.RemoveAt(i + 1); distanceAvecAlliees.RemoveAt(i + 1); } else if (gameplay_.listeDesJoueurs[moteurgraphique_.map[(int)positionsAlliees[i + 1].X, (int)positionsAlliees[i + 1].Y].pointeurArmee].bataillon[moteurgraphique_.map[(int)positionsAlliees[i + 1].X, (int)positionsAlliees[i + 1].Y].pointeurUnite].typeUnite == e_typeUnite.Elite) { unitesAlliees.RemoveAt(i); positionsAlliees.RemoveAt(i); distanceAvecAlliees.RemoveAt(i); } else { unitesAlliees.RemoveAt(i); positionsAlliees.RemoveAt(i); distanceAvecAlliees.RemoveAt(i); } } } } #endregion #endregion #region deplacementVersAllieLePlusPratique if (distanceAvecAlliees.Count > 0) { for (int i = 0; i < porteesDeMeilleuresPrecisionsPouvoir.Count; i++) { for (int j = 0; j <= porteesDeMeilleuresPrecisionsPouvoir[i] - 1; j++) { if (ilABouger == false && dejaBienPlace == false) { if (porteesDeMeilleuresPrecisionsPouvoir[i] == distanceAvecAlliees[0]) { dejaBienPlace = true; moi_.SHORYUKEN.UtiliserPouvoir(moi_, moteurgraphique_, gameplay_, unitesAlliees[0].i, unitesAlliees[0].j, ref gameplay_.mood, hud_); } else { if ((int)positionsAlliees[0].X + j >= 0 && (int)positionsAlliees[0].X + j < moteurgraphique_.longueur && (int)positionsAlliees[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsAlliees[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[0].X + j, (int)positionsAlliees[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j)].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsAlliees[0].X + j, (int)positionsAlliees[0].Y + (porteesDeMeilleuresPrecisionsPouvoir[i] - j)); } else if ((int)positionsAlliees[0].X - j >= 0 && (int)positionsAlliees[0].X - j < moteurgraphique_.longueur && (int)positionsAlliees[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsAlliees[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[0].X - j, (int)positionsAlliees[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j)].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsAlliees[0].X - j, (int)positionsAlliees[0].Y - (porteesDeMeilleuresPrecisionsPouvoir[i] - j)); } else if ((int)positionsAlliees[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsAlliees[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.longueur && (int)positionsAlliees[0].Y - j >= 0 && (int)positionsAlliees[0].Y - j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsAlliees[0].Y - j].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsAlliees[0].X + (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsAlliees[0].Y - j); } else if ((int)positionsAlliees[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) >= 0 && (int)positionsAlliees[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j) < moteurgraphique_.longueur && (int)positionsAlliees[0].Y + j >= 0 && (int)positionsAlliees[0].Y + j < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)positionsAlliees[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsAlliees[0].Y + j].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)positionsAlliees[0].X - (porteesDeMeilleuresPrecisionsPouvoir[i] - j), (int)positionsAlliees[0].Y + j); } } } } } } } } } } #endregion } else { deplacementMoyenJoute(moteurgraphique_, gameplay_, moi_, armee_, hud_); } } } if (moi_.pvactuel < moi_.pvmax * (3 / 10) && !ilABouger && !dejaBienPlace) { #region battreEnRetraite for (int distanceQG = 0; distanceQG < 32; distanceQG++) { for (int k = 0; k <= distanceQG; k++) { if (ilABouger == false) { if ((int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + k >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + k < moteurgraphique_.longueur && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + (distanceQG - k) >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + (distanceQG - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + k, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + (distanceQG - k)].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + k, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + (distanceQG - k)); } else if ((int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - k >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - k < moteurgraphique_.longueur && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - (distanceQG - k) >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - (distanceQG - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - k, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - (distanceQG - k)].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - k, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - (distanceQG - k)); } else if ((int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + (distanceQG - k) >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + (distanceQG - k) < moteurgraphique_.longueur && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - k >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - k < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + (distanceQG - k), (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - k].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X + (distanceQG - k), (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y - k); } else if ((int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - (distanceQG - k) >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - (distanceQG - k) < moteurgraphique_.longueur && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + k >= 0 && (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + k < moteurgraphique_.largeur) { if (moteurgraphique_.map[(int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - (distanceQG - k), (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + k].cheminValid) { ilABouger = true; moi_.PathFindingLoohy(moteurgraphique_, (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.X - (distanceQG - k), (int)gameplay_.listeDesJoueurs[moi_.numeroArmee].QG.Y + k); } } } } } } } } #endregion } else { if (ilABouger == false) { deplacementMoyenJoute(moteurgraphique_, gameplay_, moi_, armee_, hud_); } } } }
public bool goSud(MoteurGraphique moteurgraphique_, Armee armee_, SystemeDeJeu gameplay_) { if (j + 1 < moteurgraphique_.largeur && moteurgraphique_.map[i, j + 1].estAccessible && mouvement >= moteurgraphique_.map[i, j + 1].coutEnMouvement) { mouvOrNot = false; debug = 0; if (aura != null) { aura.ActiverAura(this, moteurgraphique_, gameplay_, -1); } moteurgraphique_.map[i, j].pointeurUnite = 0; moteurgraphique_.map[i, j].pointeurArmee = 0; moteurgraphique_.map[i, j].presence = false; moteurgraphique_.map[i, j].estAccessible = true; jDepart = 0; iDepart = 0; j++; if (aura != null) { aura.ActiverAura(this, moteurgraphique_, gameplay_, 1); } mouvement -= moteurgraphique_.map[i, j].coutEnMouvement; sousrect.X = 128; tourner(); state = e_EtatAnim.mouvement1; sousrect.Y = 256; vitesseAnim = 0.2f; jDepart = -1; iDepart = 1; moteurgraphique_.viderChemin(); lookAtCheminsInitialize(moteurgraphique_); armee_.soeurAnne(moteurgraphique_, gameplay_); armee_.auras(moteurgraphique_, gameplay_); return true; } else { mouvOrNot = false; return false; } }
public void mort(int numeroDelUnite_, MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_) { int p = bataillon[numeroDelUnite_].Agonie(moteurgraphique_); if (gameplay_.conditionsDeVictoire != e_typeDePartie.Colline) { gameplay_.listeDesJoueurs[bataillon[numeroDelUnite_].assassin].score += bataillon[numeroDelUnite_].points; } gameplay_.listeDesJoueurs[gameplay_.tourencours].soeurAnne(moteurgraphique_, gameplay_); }
public void lireLaFile(MoteurGraphique moteurgraphique_, Armee armee_, SystemeDeJeu gameplay_) { if (fileDeMouvements.Count > 0) { if (IA.difficulte != 0 ||state == e_EtatAnim.repos1 || state == e_EtatAnim.repos2) { switch (fileDeMouvements[0]) { case mouv.Sud: goSud(moteurgraphique_, armee_, gameplay_); break; case mouv.Nord: goNord(moteurgraphique_, armee_, gameplay_); break; case mouv.Est: goEst(moteurgraphique_, armee_, gameplay_); break; case mouv.Ouest: goOuest(moteurgraphique_, armee_, gameplay_); break; default: break; } //depiler fileDeMouvements.RemoveAt(0); } } }
public void pop(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_) { for (int f = 0; f < effectif; f++) { switch (f) { case 0: bataillon[f].i = (int)QG.X; bataillon[f].j = (int)QG.Y; break; case 1: bataillon[f].i = (int)QG.X - 1; bataillon[f].j = (int)QG.Y; break; case 2: bataillon[f].i = (int)QG.X - 1; bataillon[f].j = (int)QG.Y - 1; break; case 3: bataillon[f].i = (int)QG.X; bataillon[f].j = (int)QG.Y - 1; break; case 4: bataillon[f].i = (int)QG.X + 1; bataillon[f].j = (int)QG.Y - 1; break; case 5: bataillon[f].i = (int)QG.X + 1; bataillon[f].j = (int)QG.Y; break; case 6: bataillon[f].i = (int)QG.X + 1; bataillon[f].j = (int)QG.Y + 1; break; case 7: bataillon[f].i = (int)QG.X; bataillon[f].j = (int)QG.Y + 1; break; case 8: bataillon[f].i = (int)QG.X - 1; bataillon[f].j = (int)QG.Y + 1; break; default: break; } #region case libre //if (moteurgraphique_.map[(int)QG.X, (int)QG.Y].estAccessible) //{ // bataillon[f].i = (int)QG.X; // bataillon[f].j = (int)QG.Y; //} //else //{ // if ((int)QG.X - 1 >= 0 && (int)QG.X - 1 < moteurgraphique_.longueur && moteurgraphique_.map[(int)QG.X - 1, (int)QG.Y].estAccessible) // { // bataillon[f].i = (int)QG.X - 1; // bataillon[f].j = (int)QG.Y; // } // else // { // if ((int)QG.X - 1 >= 0 && (int)QG.Y - 1 >= 0 && moteurgraphique_.map[(int)QG.X - 1, (int)QG.Y - 1].estAccessible) // { // bataillon[f].i = (int)QG.X - 1; // bataillon[f].j = (int)QG.Y - 1; // } // else // { // if (QG.Y - 1 >= 0 && moteurgraphique_.map[(int)QG.X, (int)QG.Y - 1].estAccessible) // { // bataillon[f].i = (int)QG.X; // bataillon[f].j = (int)QG.Y - 1; // } // else // { // if ((int)QG.Y - 1 >= 0 && (int)QG.X + 1 < moteurgraphique_.longueur && moteurgraphique_.map[(int)QG.X + 1, (int)QG.Y - 1].estAccessible) // { // bataillon[f].i = (int)QG.X + 1; // bataillon[f].j = (int)QG.Y - 1; // } // else // { // if ((int)QG.X + 1 >= 0 && (int)QG.X + 1 < moteurgraphique_.longueur && moteurgraphique_.map[(int)QG.X + 1, (int)QG.Y].estAccessible) // { // bataillon[f].i = (int)QG.X + 1; // bataillon[f].j = (int)QG.Y; // } // else // { // if ((int)QG.X + 1 >= 0 && (int)QG.X + 1 < moteurgraphique_.longueur && moteurgraphique_.map[(int)QG.X + 1, (int)QG.Y + 1].estAccessible) // { // bataillon[f].i = (int)QG.X + 1; // bataillon[f].j = (int)QG.Y + 1; // } // else // { // if ((int)QG.Y + 1 < moteurgraphique_.largeur && // moteurgraphique_.map[(int)QG.X, (int)QG.Y + 1].estAccessible) // { // bataillon[f].i = (int)QG.X; // bataillon[f].j = (int)QG.Y + 1; // } // else // { // if ((int)QG.Y + 1 < moteurgraphique_.largeur && // (int)QG.X - 1 >= 0 && moteurgraphique_.map[(int)QG.X - 1, (int)QG.Y + 1].estAccessible) // { // bataillon[f].i = (int)QG.X - 1; // bataillon[f].j = (int)QG.Y + 1; // } // else // { // if ((int)QG.Y + 1 < moteurgraphique_.largeur && // (int)QG.X - 2 >= 0 && moteurgraphique_.map[(int)QG.X - 2, (int)QG.Y + 1].estAccessible) // { // bataillon[f].i = (int)QG.X - 2; // bataillon[f].j = (int)QG.Y + 1; // } // else // { // if ((int)QG.X - 2 >= 0 && moteurgraphique_.map[(int)QG.X - 2, (int)QG.Y].estAccessible) // { // bataillon[f].i = (int)QG.X - 2; // bataillon[f].j = (int)QG.Y; // } // else // { // if ((int)QG.Y - 1 >= 0 && // (int)QG.X - 2 >= 0 && moteurgraphique_.map[(int)QG.X - 2, (int)QG.Y - 1].estAccessible) // { // bataillon[f].i = (int)QG.X - 2; // bataillon[f].j = (int)QG.Y - 1; // } // else // { // if ((int)QG.Y - 2 >= 0 && // (int)QG.X - 2 >= 0 && moteurgraphique_.map[(int)QG.X - 2, (int)QG.Y - 2].estAccessible) // { // bataillon[f].i = (int)QG.X - 2; // bataillon[f].j = (int)QG.Y - 2; // } // else // { // if ((int)QG.Y - 2 >= 0 && // (int)QG.X - 1 >= 0 && moteurgraphique_.map[(int)QG.X - 1, (int)QG.Y - 2].estAccessible) // { // bataillon[f].i = (int)QG.X - 1; // bataillon[f].j = (int)QG.Y - 2; // } // else // { // if ((int)QG.Y - 2 >= 0 && // moteurgraphique_.map[(int)QG.X, (int)QG.Y - 2].estAccessible) // { // bataillon[f].i = (int)QG.X; // bataillon[f].j = (int)QG.Y - 2; // } // else // { // if ((int)QG.Y - 2 >= 0 && // (int)QG.X + 1 < moteurgraphique_.longueur && moteurgraphique_.map[(int)QG.X + 1, (int)QG.Y - 2].estAccessible) // { // bataillon[f].i = (int)QG.X + 1; // bataillon[f].j = (int)QG.Y - 2; // }}}}}}}}}}}}}}}} #endregion bataillon[f].Afficher(moteurgraphique_.map[bataillon[f].i, bataillon[f].j], gameplay_); } }
public void Riposte(Unite ennemi_, int porteeDeFrappe_, MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, string txt_, int dgts_,//-- Color clr_, e_race e_race_, HUD hud_) { string txt1, txt2; int dgts1, dgts2; Color clr1, clr2; e_race e_race1, e_race2; if (pvactuel > 0) { #region frapper if (typedAttaque[porteeDeFrappe_]) { //type dattaque : physique si typedAttaque[porteedeFrappe]= vrai #region Physique if ((precision + bonusprecision) * portee[porteeDeFrappe_] / 10 - ennemi_.esquive >= (r.Next(1000) % 100)) { if (r.Next(1000) % 100 < (coupcritique + bonusCoupcritique)) { if (ennemi_.armure < (attaque + bonusAttaque) * 2) { ennemi_.pvactuel -= ((attaque + bonusAttaque) * 2 - ennemi_.armure); txt2 = "Coup Critique !!"; dgts2 = ((attaque + bonusAttaque) * 2 - ennemi_.armure); } else { txt2 = " Inefficace ! "; dgts2 = 0; } } else { if (ennemi_.armure < (attaque + bonusAttaque)) { ennemi_.pvactuel -= ((attaque + bonusAttaque) - ennemi_.armure); txt2 = " Attaque ! "; dgts2 = ((attaque + bonusAttaque) - ennemi_.armure); } else { txt2 = " Inefficace ! "; dgts2 = 0; } } } else { xp += 1; if (portee[porteeDeFrappe_] == 0) { txt2 = " Trop loin ! "; dgts2 = 0; } else { txt2 = " Rate ! "; dgts2 = 0; } } #endregion } else { #region Magique if ((precision + bonusprecision) * portee[porteeDeFrappe_] / 10 - ennemi_.esquive >= (r.Next(1000) % 100)) { if (r.Next(1000) % 100 < (coupcritique + bonusCoupcritique)) { if (ennemi_.resistance < (puissance + bonuspuissance) * 2) { ennemi_.pvactuel -= ((puissance + bonuspuissance) * 2 - ennemi_.resistance); txt2 = "Coup Critique !!"; dgts2 = ((puissance + bonuspuissance) * 2 - ennemi_.armure); } else { txt2 = " Inefficace ! "; dgts2 = 0; } } else { if (ennemi_.resistance < (puissance + bonuspuissance)) { ennemi_.pvactuel -= ((puissance + bonuspuissance) - ennemi_.resistance); txt2 = " Attaque ! "; dgts2 = ((puissance + bonuspuissance) - ennemi_.armure); } else { txt2 = " Inefficace ! "; dgts2 = 0; } } } else { xp += 1; if (portee[porteeDeFrappe_] == 0) { txt2 = " Trop loin ! "; dgts2 = 0; } else { txt2 = " Rate ! "; dgts2 = 0; } } #endregion } #endregion } else { txt2 = " Deja morte ! "; dgts2 = 0; } txt1 = txt_; dgts1 = dgts_; clr1 = clr_; e_race1 = e_race_; clr2 = gameplay_.listeDesJoueurs[numeroArmee].couleur; e_race2 = gameplay_.listeDesJoueurs[numeroArmee].espece; hud_.fight(ennemi_, this, txt1, dgts1, clr1, txt2, dgts2, clr2, e_race1, e_race2); gameplay_.CheckPV(moteurgraphique_, hud_); }
public void soeurAnne(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_) { if (!IA) { if (moteurgraphique_.fog == e_brouillardDeGuerre.Normal) appliquerVues(moteurgraphique_); if (moteurgraphique_.fog == e_brouillardDeGuerre.ToutVisite) moteurgraphique_.viderVue(); foreach (Unite item in bataillon) { if (item.pvactuel > 0) { item.soeurAnne(moteurgraphique_, ref casesVisitees, gameplay_); } } } }
public void UpdatePouvoir(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, ref e_modeAction mood_, HUD hud_) { if (Mouse.GetState().RightButton == ButtonState.Pressed && attaqOrNot) { foreach (int portee_ in SHORYUKEN.porteePouvoir) { if (SHORYUKEN.vertical) { int k = 0; #region 1 if (i + k >= 0 && i + k < moteurgraphique_.longueur && j + (portee_ - k) >= 0 && j + (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[i + k, j + (portee_ - k)].presence && moteurgraphique_.map[i + k, j + (portee_ - k)].estEnSurbrillance && moteurgraphique_.map[i + k, j + (portee_ - k)].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i + k, j + (portee_ - k), ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion #region 2 if (i - k >= 0 && i - k < moteurgraphique_.longueur && j - (portee_ - k) >= 0 && j - (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[i - k, j - (portee_ - k)].presence && moteurgraphique_.map[i - k, j - (portee_ - k)].estEnSurbrillance && moteurgraphique_.map[i - k, j - (portee_ - k)].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i - k, j - (portee_ - k), ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion #region 3 if (i + (portee_ - k) >= 0 && i + (portee_ - k) < moteurgraphique_.longueur && j - k >= 0 && j - k < moteurgraphique_.largeur) { if (moteurgraphique_.map[i + (portee_ - k), j - k].presence && moteurgraphique_.map[i + (portee_ - k), j - k].estEnSurbrillance && moteurgraphique_.map[i + (portee_ - k), j - k].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i + (portee_ - k), j - k, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion #region 4 if (i - (portee_ - k) >= 0 && i - (portee_ - k) < moteurgraphique_.longueur && j + k >= 0 && j + k < moteurgraphique_.largeur) { if (moteurgraphique_.map[i - (portee_ - k), j + k].presence && moteurgraphique_.map[i - (portee_ - k), j + k].estEnSurbrillance && moteurgraphique_.map[i - (portee_ - k), j + k].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i - (portee_ - k), j + k, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion } else { for (int k = 0; k <= portee_; k++) { #region 1 if (i + k >= 0 && i + k < moteurgraphique_.longueur && j + (portee_ - k) >= 0 && j + (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[i + k, j + (portee_ - k)].presence && moteurgraphique_.map[i + k, j + (portee_ - k)].estEnSurbrillance && moteurgraphique_.map[i + k, j + (portee_ - k)].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i + k, j + (portee_ - k), ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion #region 2 if (i - k >= 0 && i - k < moteurgraphique_.longueur && j - (portee_ - k) >= 0 && j - (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[i - k, j - (portee_ - k)].presence && moteurgraphique_.map[i - k, j - (portee_ - k)].estEnSurbrillance && moteurgraphique_.map[i - k, j - (portee_ - k)].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i - k, j - (portee_ - k), ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion #region 3 if (i + (portee_ - k) >= 0 && i + (portee_ - k) < moteurgraphique_.longueur && j - k >= 0 && j - k < moteurgraphique_.largeur) { if (moteurgraphique_.map[i + (portee_ - k), j - k].presence && moteurgraphique_.map[i + (portee_ - k), j - k].estEnSurbrillance && moteurgraphique_.map[i + (portee_ - k), j - k].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i + (portee_ - k), j - k, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion #region 4 if (i - (portee_ - k) >= 0 && i - (portee_ - k) < moteurgraphique_.longueur && j + k >= 0 && j + k < moteurgraphique_.largeur) { if (moteurgraphique_.map[i - (portee_ - k), j + k].presence && moteurgraphique_.map[i - (portee_ - k), j + k].estEnSurbrillance && moteurgraphique_.map[i - (portee_ - k), j + k].visible && attaqOrNot) { mouvOrNot = false; SHORYUKEN.UtiliserPouvoir(this, moteurgraphique_, gameplay_, i - (portee_ - k), j + k, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } #endregion } } } } }
public void Update(MoteurGraphique loohy_, SystemeDeJeu gameplay_, ref e_modeAction mood_, /*Lecteur coldman_,*/ HUD hud_) { if (bataillon[uniteselect].fileDeMouvements.Count == 0) { switch (mood_) { case e_modeAction.Attaque: bataillon[uniteselect].Attaquer(loohy_, gameplay_, ref mood_, hud_); break; case e_modeAction.Pouvoir: if (bataillon[uniteselect].SHORYUKEN != null) { bataillon[uniteselect].UpdatePouvoir(loohy_, gameplay_, ref mood_, hud_); } break; default: bataillon[uniteselect].Mouvement(loohy_, gameplay_.listeDesJoueurs[gameplay_.tourencours], gameplay_); break; } } loohy_.porteeEgal0(); if (gameplay_.mood == e_modeAction.Attaque) { bataillon[uniteselect].lookAtPortee(loohy_); } if (gameplay_.mood == e_modeAction.Pouvoir) { bataillon[uniteselect].lookAtPorteePouvoir(loohy_); } if ((bataillon[uniteselect].state == e_EtatAnim.repos1 || bataillon[uniteselect].state == e_EtatAnim.repos2) && !hud_.sontvises()) { Selectionner(loohy_, /*coldman_,*/ hud_); } foreach (Unite item in bataillon) { item.lireLaFile(loohy_, gameplay_.listeDesJoueurs[gameplay_.tourencours], gameplay_); } }
public void Afficher(Tile tile_, SystemeDeJeu gameplay_) { tile_.pointeurUnite = numeroUnite; tile_.pointeurArmee = numeroArmee; tile_.textureUnite = image; tile_.presence = true; tile_.estAccessible = false; tile_.dessinTomb = false; tile_.pourcentageDePv = (100 * pvactuel) / pvmax; tile_.mouvUnite = mouvement; tile_.mouvUniteMax = (mouvement * 40) / mouvementmax; tile_.xpUnite = (xp); Anim += vitesseAnim; tile_.jDepart = jDepart; tile_.iDepart = iDepart; if (Anim > 1) { #region anim Anim = 0; switch (state) { case e_EtatAnim.mouvement1: state = e_EtatAnim.mouvement2; sousrect.Y = 0; break; case e_EtatAnim.mouvement2: state = e_EtatAnim.mouvement3; sousrect.Y = 3 * 128; break; case e_EtatAnim.mouvement3: state = e_EtatAnim.repos1; sousrect.Y = 0; vitesseAnim = 0.025f; break; case e_EtatAnim.repos1: state = e_EtatAnim.repos2; sousrect.Y = 128; ivirtuel = i; jvirtuel = j; break; case e_EtatAnim.repos2: state = e_EtatAnim.repos1; sousrect.Y = 0; break; default: break; } #endregion } tile_.state = state; tile_.sousRectUnite = sousrect; tile_.AttaqOrNot = attaqOrNot; tile_.aura = profiteDuneAura; tile_.heros = typeUnite == e_typeUnite.Heros; tile_.cachette = e_Cache.Visible; if (estInvisible) { if (gameplay_.tourencours == numeroArmee) { tile_.cachette = e_Cache.InvisibleAmi; } else { tile_.cachette = e_Cache.Invisible; } } }
public void UpdateIA(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, /*Lecteur coldman_,*/ HUD hud_, ref int time_, ref bool transition_) { if (!bataillon[uniteselect].IA.finish) { utiliserIA(moteurgraphique_, gameplay_, hud_); } else { if (allFinished()) { gameplay_.FinDeTour(moteurgraphique_, /*coldman_,*/ hud_, ref time_, ref transition_); } else { suivant(moteurgraphique_, false, hud_); } } }
public void Attaquer(MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, ref e_modeAction mood_, HUD hud_) { if ((i + 1 < moteurgraphique_.longueur && moteurgraphique_.map[i + 1, j].presence) && ((Keyboard.GetState().IsKeyDown(Keys.F) || (moteurgraphique_.map[i + 1, j].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && attaqOrNot)) { AttaqueEst(moteurgraphique_, gameplay_, ref mood_, hud_); } if ((j > 0 && moteurgraphique_.map[i, j - 1].presence) && ((Keyboard.GetState().IsKeyDown(Keys.R) || (moteurgraphique_.map[i, j - 1].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && attaqOrNot)) { AttaqueNord(moteurgraphique_, gameplay_, ref mood_, hud_); } if ((i > 0 && moteurgraphique_.map[i - 1, j].presence) && ((Keyboard.GetState().IsKeyDown(Keys.E) || (moteurgraphique_.map[i - 1, j].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && attaqOrNot)) { AttaqueOuest(moteurgraphique_, gameplay_, ref mood_, hud_); } if ((j + 1 < moteurgraphique_.largeur && moteurgraphique_.map[i, j + 1].presence) && ((Keyboard.GetState().IsKeyDown(Keys.D) || (moteurgraphique_.map[i, j + 1].estEnSurbrillance && Mouse.GetState().RightButton == ButtonState.Pressed)) && attaqOrNot)) { AttaqueSud(moteurgraphique_, gameplay_, ref mood_, hud_); } #region attaque a distance if (Mouse.GetState().RightButton == ButtonState.Pressed && attaqOrNot) { for (int portee_ = 1; portee_ < 7; portee_++) { if (portee[portee_] != 0) { for (int k = 0; k < portee_; k++) { if (i + k >= 0 && i + k < moteurgraphique_.longueur && j + (portee_ - k) >= 0 && j + (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[i + k, j + (portee_ - k)].presence && moteurgraphique_.map[i + k, j + (portee_ - k)].estEnSurbrillance && moteurgraphique_.map[i + k, j + (portee_ - k)].visible && attaqOrNot) { mouvOrNot = false; Initiative(gameplay_.listeDesJoueurs[moteurgraphique_.map[i + k, j + (portee_ - k)]. pointeurArmee].bataillon[moteurgraphique_.map[i + k, j + (portee_ - k)].pointeurUnite], portee_, moteurgraphique_, gameplay_, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } if (i - k >= 0 && i - k < moteurgraphique_.longueur && j - (portee_ - k) >= 0 && j - (portee_ - k) < moteurgraphique_.largeur) { if (moteurgraphique_.map[i - k, j - (portee_ - k)].presence && moteurgraphique_.map[i - k, j - (portee_ - k)].estEnSurbrillance && moteurgraphique_.map[i - k, j - (portee_ - k)].visible && attaqOrNot) { mouvOrNot = false; Initiative(gameplay_.listeDesJoueurs[moteurgraphique_.map[i - k, j - (portee_ - k)]. pointeurArmee].bataillon[moteurgraphique_.map[i - k, j - (portee_ - k)].pointeurUnite], portee_, moteurgraphique_, gameplay_, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } if (i + (portee_ - k) >= 0 && i + (portee_ - k) < moteurgraphique_.longueur && j - k >= 0 && j - k < moteurgraphique_.largeur) { if (moteurgraphique_.map[i + (portee_ - k), j - k].presence && moteurgraphique_.map[i + (portee_ - k), j - k].estEnSurbrillance && moteurgraphique_.map[i + (portee_ - k), j - k].visible && attaqOrNot) { mouvOrNot = false; Initiative(gameplay_.listeDesJoueurs[moteurgraphique_.map[i + (portee_ - k), j - k]. pointeurArmee].bataillon[moteurgraphique_.map[i + (portee_ - k), j - k].pointeurUnite], portee_, moteurgraphique_, gameplay_, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } if (i - (portee_ - k) >= 0 && i - (portee_ - k) < moteurgraphique_.longueur && j + k >= 0 && j + k < moteurgraphique_.largeur) { if (moteurgraphique_.map[i - (portee_ - k), j + k].presence && moteurgraphique_.map[i - (portee_ - k), j + k].estEnSurbrillance && moteurgraphique_.map[i - (portee_ - k), j + k].visible && attaqOrNot) { mouvOrNot = false; Initiative(gameplay_.listeDesJoueurs[moteurgraphique_.map[i - (portee_ - k), j + k]. pointeurArmee].bataillon[moteurgraphique_.map[i - (portee_ - k), j + k].pointeurUnite], portee_, moteurgraphique_, gameplay_, ref mood_, hud_); gameplay_.CheckPV(moteurgraphique_, hud_); } } } } } } #endregion }
private void DrawScore(SystemeDeJeu gameplay_, Point v_) { for (int i = 0; i < gameplay_.listeDesJoueurs.Count; i++) { Contents.Draw("px", new Rectangle(v_.X + 5 - 20 * gameplay_.listeDesJoueurs.Count + 40 * i, v_.Y - 5 - gameplay_.listeDesJoueurs[i].score / (gameplay_.listeDesJoueurs.Count * 2), 20, gameplay_.listeDesJoueurs[i].score / (gameplay_.listeDesJoueurs.Count * 2)), gameplay_.listeDesJoueurs[i].couleur); Contents.DrawString(gameplay_.listeDesJoueurs[i].score.ToString(), new Rectangle(v_.X - 20 * gameplay_.listeDesJoueurs.Count + 40 * i, v_.Y, 30, 30), gameplay_.listeDesJoueurs[i].couleur); } //sprite_.Draw(Textures.textures[85], // new Rectangle((int)v_.X + 9, (int)v_.Y - 1, 282, 32), // Color.Black); //sprite_.Draw(Textures.textures[109], // new Rectangle((int)v_.X + 10, (int)v_.Y, 279, 30), // gameplay_.armees[gameplay_.tourencours].couleur); //sprite_.Draw(Textures.textures[109], // new Rectangle((int)v_.X + 10 + (gameplay_.armees[gameplay_.tourencours].score * 280) / // (gameplay_.armees[gameplay_.tourencours].score + gameplay_.armees[(gameplay_.tourencours + 1) % 2].score), // (int)v_.Y, // (gameplay_.armees[(gameplay_.tourencours + 1) % 2].score * 280) / // (gameplay_.armees[gameplay_.tourencours].score + gameplay_.armees[(gameplay_.tourencours + 1) % 2].score), 30), // new Rectangle((gameplay_.armees[gameplay_.tourencours].score * 280) / // (gameplay_.armees[gameplay_.tourencours].score + gameplay_.armees[(gameplay_.tourencours + 1) % 2].score), // 0, // (gameplay_.armees[(gameplay_.tourencours + 1) % 2].score * 280) / // (gameplay_.armees[gameplay_.tourencours].score + gameplay_.armees[(gameplay_.tourencours + 1) % 2].score), 30), // gameplay_.armees[(gameplay_.tourencours + 1) % 2].couleur); //sprite_.Draw(Textures.textures[85], // new Rectangle((int)v_.X + 148, (int)v_.Y - 1, 4, 8), // Color.Black); //sprite_.Draw(Textures.textures[85], // new Rectangle((int)v_.X + 148, (int)v_.Y + 23, 4, 8), // Color.Black); //compteTour(sprite_, tex_, t_, new Vector2(v_.X + 150, v_.Y + 40)); }
public void Frappe(Unite ennemi_, int porteeDeFrappe_, MoteurGraphique moteurgraphique_, SystemeDeJeu gameplay_, HUD hud_) { string txt1; int dgts1; Color clr1; e_race race1; #region frapper if (typedAttaque[porteeDeFrappe_]) { //type dattaque : physique si typedAttaque[porteedeFrappe]= vrai #region Physique if ((precision + bonusprecision) * portee[porteeDeFrappe_] / 10 - ennemi_.esquive >= (r.Next(1000) % 100)) { if (r.Next(1000) % 100 < (coupcritique + bonusCoupcritique)) { if (ennemi_.armure < (attaque + bonusAttaque) * 2) { ennemi_.pvactuel -= ((attaque + bonusAttaque) * 2 - ennemi_.armure); txt1 = "Coup Critique !!"; dgts1 = ((attaque + bonusAttaque) * 2 - ennemi_.armure); } else { txt1 = " Inefficace ! "; dgts1 = 0; } } else { if (ennemi_.armure < (attaque + bonusAttaque)) { ennemi_.pvactuel -= ((attaque + bonusAttaque) - ennemi_.armure); txt1 = " Attaque ! "; dgts1 = ((attaque + bonusAttaque) - ennemi_.armure); } else { txt1 = " Inefficace ! "; dgts1 = 0; } } xp += 3; ennemi_.xp += 1; } else { xp += 1; if (portee[porteeDeFrappe_] == 0) { txt1 = " Trop loin ! "; dgts1 = 0; } else { txt1 = " Rate ! "; dgts1 = 0; } } #endregion } else { #region magique if ((precision + bonusprecision) * portee[porteeDeFrappe_] / 10 - ennemi_.esquive >= (r.Next(1000) % 100)) { if (r.Next(1000) % 100 < (coupcritique + bonusCoupcritique)) { if (ennemi_.resistance < (puissance + bonuspuissance) * 2) { ennemi_.pvactuel -= ((puissance + bonuspuissance) * 2 - ennemi_.resistance); txt1 = "Coup Critique !!"; dgts1 = ((puissance + bonuspuissance) * 2 - ennemi_.armure); } else { txt1 = " Inefficace ! "; dgts1 = 0; } } else { if (ennemi_.resistance < (puissance + bonuspuissance)) { ennemi_.pvactuel -= ((puissance + bonuspuissance) - ennemi_.resistance); txt1 = " Attaque ! "; dgts1 = ((puissance + bonuspuissance) - ennemi_.armure); } else { txt1 = " Inefficace ! "; dgts1 = 0; } } xp += 3; ennemi_.xp += 1; } else { xp += 1; if (portee[porteeDeFrappe_] == 0) { txt1 = " Trop loin ! "; dgts1 = 0; } else { txt1 = " Rate ! "; dgts1 = 0; } } #endregion } #endregion clr1 = gameplay_.listeDesJoueurs[numeroArmee].couleur; race1 = gameplay_.listeDesJoueurs[numeroArmee].espece; ennemi_.Riposte(this, porteeDeFrappe_, moteurgraphique_, gameplay_, txt1, dgts1, clr1, race1, hud_); }
public void Draw(SystemeDeJeu gameplay_, MoteurGraphique moteurgraphique_, int tempsRestant_) { #region HUD+Time int sub; switch (gameplay_.listeDesJoueurs[gameplay_.tourencours].espece) { case e_race.Fenrir: sub = 3; break; case e_race.Krissa: sub = 2; break; case e_race.Pandawan: sub = 1; break; default: sub = 0; break; } Contents.Draw("px3", new Rectangle(0, 700, 1200, 200), Color.DarkGray); //Contents.Draw("Cercles", new Rectangle(0, 600, 100, 100), new Rectangle(100+200*sub, 0, 100, 100)); if (!Victory) Contents.Draw("Cercles", new Rectangle(500, 620, 200, 80), new Rectangle(200 * sub, 0, 200, 80)); Contents.Draw("px3", new Rectangle(25, 725, 150, 150), Color.Red); Contents.DrawStringInBoxCenteredChrono(Math.Max(0, tempsRestant_).ToString(), new Rectangle(25, 725, 150, 150)); #endregion if (gameplay_.listeDesJoueurs[gameplay_.tourencours].difficulte == 0 && gameplay_.listeDesJoueurs[gameplay_.tourencours].bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect].alive) { #region stats unite statUnite(gameplay_.listeDesJoueurs[gameplay_.tourencours].bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect], gameplay_.listeDesJoueurs[gameplay_.tourencours].couleur); #endregion } #region Boutons d'action if (gameplay_.listeDesJoueurs[gameplay_.tourencours].difficulte == 0 && gameplay_.listeDesJoueurs[gameplay_.tourencours].bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect].alive) { int i = gameplay_.listeDesJoueurs[gameplay_.tourencours].bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect].i; int j = gameplay_.listeDesJoueurs[gameplay_.tourencours].bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect].j; Rectangle rect = genererRectangle(i, j, moteurgraphique_.map[i, j].altitude, moteurgraphique_.camerax, moteurgraphique_.cameray, moteurgraphique_.direction); DrawButtons(600, 725, gameplay_.listeDesJoueurs[gameplay_.tourencours]. bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect].typeUnite == e_typeUnite.Elite); UpdateButtons(ref gameplay_.mood, gameplay_.listeDesJoueurs[gameplay_.tourencours]. bataillon[gameplay_.listeDesJoueurs[gameplay_.tourencours].uniteselect].typeUnite == e_typeUnite.Elite); } #endregion if (doFlash) { #region flash flash -= 50; Contents.Draw("gordon", new Rectangle(flash, 0, 1200, 900), flashColor); Contents.Draw("gordon inverse", new Rectangle(-flash, 0, 1200, 900), flashColor); if (flash < -(int)(1200)) { doFlash = false; } #endregion } #region Affichage Combat if (AffichageCombat > 0) { #region combat //if (AffichageCombat % 35 == 0) //{ // respi(); //} //AffichageCombat -= 18; //sprite_.Draw(tex_.Textures_[12], new Rectangle((int)(100 * resolution_x), (int)(300 * resolution_y), (int)(700 * resolution_x), //(int)(300 * resolution_y)), Color.White); #region drawpv switch (race1) { case e_race.Fenrir: //sprite_.Draw(tex_.Textures_[15], new Rectangle((int)(120 * resolution_x), // (int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre1b) * 32), 288), 0, 32, 100), // color1); break; case e_race.Krissa: //sprite_.Draw(tex_.Textures_[16], new Rectangle((int)(120 * resolution_x), // (int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre1b) * 32), 288), 0, 32, 100), // color1); break; case e_race.Pandawan: //sprite_.Draw(tex_.Textures_[14], new Rectangle((int)(120 * resolution_x), // (int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre1b) * 32), 288), 0, 32, 100), // color1); break; case e_race.Pingvin: //sprite_.Draw(tex_.Textures_[17], new Rectangle((int)(120 * resolution_x), // (int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre1b) * 32), 288), 0, 32, 100), // color1); break; default: break; } switch (race2) { case e_race.Fenrir: //sprite_.Draw(tex_.Textures_[15], new Rectangle((int)(732 * resolution_x), //(int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre2b) * 32), 288), 0, 32, 100), // color2); break; case e_race.Krissa: //sprite_.Draw(tex_.Textures_[16], new Rectangle((int)(732 * resolution_x), //(int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre2b) * 32), 288), 0, 32, 100), // color2); break; case e_race.Pandawan: //sprite_.Draw(tex_.Textures_[14], new Rectangle((int)(732 * resolution_x), // (int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre2b) * 32), 288), 0, 32, 100), // color2); break; case e_race.Pingvin: //sprite_.Draw(tex_.Textures_[17], new Rectangle((int)(732 * resolution_x), //(int)(320 * resolution_y), 48, 144), new Rectangle(Math.Min(320 - ((nombre2b) * 32), 288), 0, 32, 100), // color2); break; default: break; } #endregion //Unite 1 if ((AffichageCombat) / 200 > nombre1) { for (int k = Math.Min(Math.Max(nombre1, 1), (AffichageCombat) / 200) - 1; k >= 0; k--) { // sprite_.Draw(tex_.Textures_[UniteAttaquante], new Rectangle((int)((110 + k * 23 + tableauDecalage[k]) * resolution_x), // (int)((500 - k * 16 + tableauDecalage[k] / 2) * resolution_y), (int)((100) * resolution_x), (int)(100 * resolution_y)), // new Rectangle(0, 128 * tableauRespiration[k], 128, 128), Color.White); } } else { for (int k = Math.Max(Math.Max(nombre1b, (AffichageCombat) / 200) - 1, 1); k >= 0; k--) { // sprite_.Draw(tex_.Textures_[UniteAttaquante], new Rectangle((int)((110 + k * 23 + tableauDecalage[k]) * resolution_x), // (int)((500 - k * 16 + tableauDecalage[k] / 2) * resolution_y), (int)((100) * resolution_x), (int)(100 * resolution_y)), // new Rectangle(0, 128 * tableauRespiration[k], 128, 128), Color.White); } } //Unite 2 if ((AffichageCombat) / 200 > nombre2) { for (int k = Math.Min(Math.Max(nombre2, 1), (AffichageCombat) / 200) - 1; k >= 0; k--) { // sprite_.Draw(tex_.Textures_[UniteDefenseuse], new Rectangle((int)((690 - k * 23 - tableauDecalage[k + 10]) * resolution_x), // (int)((500 - k * 16 + tableauDecalage[k + 10] / 2) * resolution_y), (int)(100 * resolution_x), (int)(100 * resolution_y)), // new Rectangle(128, 128 * tableauRespiration[k], 128, 128), Color.White); } } else { for (int k = Math.Max(Math.Max(nombre2b, (AffichageCombat) / 200) - 1, 1); k >= 0; k--) { // sprite_.Draw(Textures.textures[UniteDefenseuse], new Rectangle((int)((690 - k * 23 - tableauDecalage[k + 10]) * resolution_x), // (int)((500 - k * 16 + tableauDecalage[k + 10] / 2) * resolution_y), (int)(100 * resolution_x), (int)(100 * resolution_y)), // new Rectangle(128, 128 * tableauRespiration[k], 128, 128), Color.White); } } if (AffichageCombat < 1750) { //sprite_.DrawString(Textures.tahoma, texteCombat1, new Vector2((int)(390 * resolution_x), (int)(360 * resolution_y)), color1); } if (AffichageCombat < 1500) { //sprite_.DrawString(Textures.tahoma, degats1.ToString(), new Vector2((int)(405 * resolution_x), (int)(390 * resolution_y)), color1); //sprite_.DrawString(Textures.tahoma, "Degat(s)", new Vector2((int)(444 * resolution_x), (int)(390 * resolution_y)), color1); } if (AffichageCombat < 1250) { //sprite_.DrawString(Textures.tahoma, texteCombat2, new Vector2((int)(430 * resolution_x), (int)(510 * resolution_y)), color2); } if (AffichageCombat < 1000) { //sprite_.DrawString(tex_.Tahoma_, degats2.ToString(), new Vector2((int)(445 * resolution_x), (int)(540 * resolution_y)), color2); //sprite_.DrawString(tex_.Tahoma_, "Degat(s)", new Vector2((int)(464 * resolution_x), (int)(540 * resolution_y)), color2); } #endregion if (Keyboard.GetState().IsKeyDown(Keys.Space)) { AffichageCombat = 0; } } #endregion #region Affichage Pouvoir if (AffichagePowa > 0) { #region pouvoir AffichagePowa -= 18; switch (powaa) { case e_pouvoir.PandaSceau: //sprite_.Draw(tex_.Textures_[104], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(0, 0, 300, 300), Color.White); break; case e_pouvoir.PandaSniper: //sprite_.Draw(tex_.Textures_[104], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(300, 0, 300, 300), Color.White); break; case e_pouvoir.PandaNinja: //sprite_.Draw(tex_.Textures_[104], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(600, 0, 300, 300), Color.White); break; case e_pouvoir.PingvinSoin: //sprite_.Draw(tex_.Textures_[106], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(0, 0, 300, 300), Color.White); break; case e_pouvoir.PingvinThor: //sprite_.Draw(tex_.Textures_[106], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(300, 0, 300, 300), Color.White); break; case e_pouvoir.PingvinRage: //sprite_.Draw(tex_.Textures_[106], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(600, 0, 300, 300), Color.White); break; case e_pouvoir.FenrirMissiles: //sprite_.Draw(tex_.Textures_[105], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(0, 0, 300, 300), Color.White); break; case e_pouvoir.FenrirBoost: //sprite_.Draw(tex_.Textures_[105], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(300, 0, 300, 300), Color.White); break; case e_pouvoir.FenrirRailgun: //sprite_.Draw(tex_.Textures_[105], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(600, 0, 300, 300), Color.White); break; default: //sprite_.Draw(tex_.Textures_[99], // new Rectangle((int)(300 * resolution_x), (int)(300 * resolution_y), (int)(300 * resolution_x), // (int)(300 * resolution_y)), // new Rectangle(0, 0, 300, 300), Color.White); break; } #endregion if (Keyboard.GetState().IsKeyDown(Keys.Space)) { AffichagePowa = 0; } } #endregion #region score DrawScore(gameplay_, new Point(900, 840)); #endregion if (Victory /*&& AffichageCombat <= 0*/) { #region victoire Contents.Draw("victoire", new Rectangle(0, 0, 1200, 900), VictoryColor[0]); for (int i = 0; i < VictoryRace.Count; i++) { Contents.Draw("e_race", new Rectangle(602 + 254 * i - 127 * VictoryRace.Count, 375, 250, 250), new Rectangle(250 * VictoryRace[i], 0, 250, 250)); Contents.Draw("e_race", new Rectangle(602 + 254 * i - 127 * VictoryRace.Count, 375, 250, 250), new Color(VictoryColor[i].R, VictoryColor[i].G, VictoryColor[i].B, VictoryColor[i].A / 3), new Rectangle(250 * VictoryRace[i], 0, 250, 250)); } //DrawScore(gameplay_, tex_, new Vector2(450, 720), (int)gameplay_.numeroDeTour); #endregion } }