private void CréerMonstres() { int[] nbmonstres = new int[] { 7, 9, 11, 12, 5 }; for (int i = 0; i < NB_ZONES; ++i) { for (int j = 0; j < nbmonstres[i]; ++j) { Vector2 position = MapManager.ListeTerrains[i].GetRandomCoordinate(); bool isrange = GénérerBoolAvecChance(); float range = isrange ? (float)(GénérateurAléatoire.NextDouble() + 1) * 20f * (i + 1) : 15f; MonstManager.CréerMonstre(BaldorLeBrave, "Cyclops\\terrorwurm", 0.1f, ÉCHELLE_BOX_WURM, new Vector3(position.X, 0, position.Y), Vector3.Zero, new Vector3(0, -MathHelper.PiOver2, 0), "Ver Grotesque", GénérateurAléatoire.Next(15, 15 + 10 * (i + 1)), MathHelper.Pi * 4, true, GénérateurAléatoire.Next(16, 16 + 14 * (i + 1)), GénérateurAléatoire.Next(0, 2 + 2 * i), (int)((GénérateurAléatoire.Next(3, 2 + (i + 1) * 3)) * (isrange?1.5f:1)), GénérateurAléatoire.Next(1, 1 + i * 2), (float)(2 - (GénérateurAléatoire.NextDouble() * (float)(i) / 3f)), isrange, range, (float)(GénérateurAléatoire.NextDouble() + 1) * (i + 1) * 15f + 20f, GénérateurAléatoire.Next(i + 1, 2 * (i + 1)), MonstManager.GetID()); } } }
void CréerNiveau() { SectionRepos c = new SectionRepos(Jeu, Position, 0); ListSections.Add(c); Jeu.Components.Add(c); foreach (PrimitiveDeBase b in c.ObjetCollisionables) { TabListObjetCollisionables[0].Add(b); } Position = new Vector3(Position.X, Position.Y, Position.Z - c.LongueurNiveau); for (int i = 1; i < NbrSections; ++i) { int nombreAléatoire = GénérateurAléatoire.Next(0, NB_SECTIONS_DISPO); SectionDeNiveau a = null; switch (nombreAléatoire) { case 0: a = new SectionRepos(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 1: a = new SectionHache(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 2: a = new SectionHachesMultiples(Jeu, Position, 4, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 3: a = new SectionVentilateur(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 4: a = new SectionMobileHorizontale(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 5: a = new SectionMobileMultiples(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 6: a = new SectionMoitiéMur(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; case 7: a = new SectionVentilateurDroite(Jeu, Position, i); Position = new Vector3(Position.X, Position.Y, Position.Z - a.LongueurNiveau); break; } ListSections.Add(a); Jeu.Components.Add(a); foreach (PrimitiveDeBase b in a.ObjetCollisionables) { TabListObjetCollisionables[i].Add(b); } } }
private bool GénérerBoolAvecChance() { bool retour = GénérateurAléatoire.Next(0, 2) == 1; return(retour); }