Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int numBoss = new Range(0, 1).Random(rand);
- int numMinion = new Range(3, 5).Random(rand);
- int numBlood = new Range(4, 7).Random(rand);
- int numCandle = new Range(1, 3).Random(rand);
- var buf = rasterizer.Bitmap;
- var bounds = Bounds;
- while (numBoss > 0 || numMinion > 0 || numBlood > 0 || numCandle > 0 )
- {
- int x = rand.Next(bounds.X, bounds.MaxX);
- int y = rand.Next(bounds.Y, bounds.MaxY);
- if (buf[x, y].Object != null)
- continue;
- switch (rand.Next(4))
- {
- case 0:
- if (numBoss > 0)
- {
- buf[x, y].Object = new DungeonObject
- {
- ObjectType = UndeadLairTemplate.Big[rand.Next(UndeadLairTemplate.Big.Length)]
- };
- numBoss--;
- }
- break;
- case 1:
- if (numMinion > 0)
- {
- buf[x, y].Object = new DungeonObject
- {
- ObjectType = UndeadLairTemplate.Small[rand.Next(UndeadLairTemplate.Small.Length)]
- };
- numMinion--;
- }
- break;
- case 2:
- if (numBlood > 0)
- {
- buf[x, y].Object = new DungeonObject
- {
- ObjectType = UndeadLairTemplate.Blood[rand.Next(UndeadLairTemplate.Blood.Length)]
- };
- numBlood--;
- }
- break;
- case 3:
- if (numCandle > 0)
- {
- buf[x, y].Object = new DungeonObject
- {
- ObjectType = UndeadLairTemplate.Candel[rand.Next(UndeadLairTemplate.Candel.Length)]
- };
- numCandle--;
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement