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 lookAtCheminsInitialize(MoteurGraphique moteurgraphique_) { { moteurgraphique_.viderChemin(); moteurgraphique_.map[i, j].poidsAcces = 0; #region chemin possibles if (i > 0) { lookAtChemins(moteurgraphique_, 0, i - 1, j); } if (j > 0) { lookAtChemins(moteurgraphique_, 0, i, j - 1); } if (i + 1 < moteurgraphique_.longueur) { lookAtChemins(moteurgraphique_, 0, i + 1, j); } if (j + 1 < moteurgraphique_.largeur) { lookAtChemins(moteurgraphique_, 0, i, j + 1); } #endregion poidsPathFindingLoohy(moteurgraphique_); } }
public void FinDeTour(MoteurGraphique moteurgraphique_, /*Lecteur coldman_,*/ HUD hud_, ref int time, ref bool transition_) { numeroDeTour += 0.5f; //coldman_.Play(Lecteur.EffectKey.laser); bool vousAvezTousFini = true; foreach (Unite bob in listeDesJoueurs[tourencours].bataillon) { vousAvezTousFini = vousAvezTousFini && bob.fileDeMouvements.Count == 0; } if (vousAvezTousFini) { transition_ = listeDesJoueurs[(tourencours + 1) % listeDesJoueurs.Count].difficulte == 0; #region si limite de tours if (conditionsDeVictoire == e_typeDePartie.Colline) { limiteDeTours -= 1/(float)listeDesJoueurs.Count; if (limiteDeTours > 0) { waitForFinDeTour = false; listeDesJoueurs[tourencours].FindeTour(); do { tourencours = (tourencours + 1) % listeDesJoueurs.Count; } while (!listeDesJoueurs[tourencours].atLeastOneAlive); listeDesJoueurs[tourencours].reactiverIA(); time = 0; hud_.DoAFlash(listeDesJoueurs[tourencours].couleur); moteurgraphique_.viderVueChangementDeJoueur(); listeDesJoueurs[tourencours].soeurAnne(moteurgraphique_, this); listeDesJoueurs[tourencours].auras(moteurgraphique_, this); mood = e_modeAction.Mouvement; if (moteurgraphique_.map[tresor_i, tresor_j].presence && listeDesJoueurs[moteurgraphique_.map[tresor_i, tresor_j].pointeurArmee]. bataillon[moteurgraphique_.map[tresor_i, tresor_j].pointeurUnite].alive) { listeDesJoueurs[moteurgraphique_.map[tresor_i, tresor_j].pointeurArmee].score += Math.Max(50 - (int)limiteDeTours, 0); } } else { int v = 0; for (int i = 0; i < listeDesJoueurs.Count; i++) { if (listeDesJoueurs[i].score > listeDesJoueurs[v].score) { v = listeDesJoueurs[i].camp; } } victory(v, hud_); } } #endregion #region sinon else { waitForFinDeTour = false; listeDesJoueurs[tourencours].FindeTour(); moteurgraphique_.viderChemin(); listeDesJoueurs[tourencours].FindeTour(); do { tourencours = (tourencours + 1) % listeDesJoueurs.Count; } while (!listeDesJoueurs[(int)limiteDeTours].atLeastOneAlive); listeDesJoueurs[tourencours].reactiverIA(); time = 0; hud_.DoAFlash(listeDesJoueurs[tourencours].couleur); moteurgraphique_.viderVueChangementDeJoueur(); listeDesJoueurs[tourencours].soeurAnne(moteurgraphique_, this); listeDesJoueurs[tourencours].auras(moteurgraphique_, this); mood = e_modeAction.Mouvement; } #endregion moteurgraphique_.centrerSur(listeDesJoueurs[tourencours].QG.X, listeDesJoueurs[tourencours].QG.Y); clic = false; } else { waitForFinDeTour = true; } }