public override void Rasterize(BitmapRasterizer <DungeonTile> rasterizer, Random rand)
        {
            rasterizer.FillRect(Bounds, new DungeonTile
            {
                TileType = PirateCaveTemplate.BrownLines
            });

            int numBoss   = new Range(0, 1).Random(rand);
            int numMinion = new Range(3, 5).Random(rand);
            int numPet    = new Range(0, 2).Random(rand);

            var buf    = rasterizer.Bitmap;
            var bounds = Bounds;

            while (numBoss > 0 || numMinion > 0 || numPet > 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(3))
                {
                case 0:
                    if (numBoss > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = PirateCaveTemplate.Boss[rand.Next(PirateCaveTemplate.Boss.Length)]
                        };
                        numBoss--;
                    }
                    break;

                case 1:
                    if (numMinion > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = PirateCaveTemplate.Minion[rand.Next(PirateCaveTemplate.Minion.Length)]
                        };
                        numMinion--;
                    }
                    break;

                case 2:
                    if (numPet > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = PirateCaveTemplate.Pet[rand.Next(PirateCaveTemplate.Pet.Length)]
                        };
                        numPet--;
                    }
                    break;
                }
            }
        }
Exemple #2
0
        public override void Rasterize(BitmapRasterizer <DungeonTile> rasterizer, Random rand)
        {
            rasterizer.FillRect(Bounds, new DungeonTile {
                TileType = AbyssTemplate.RedSmallChecks
            });

            var buf    = rasterizer.Bitmap;
            var bounds = Bounds;

            bool portalPlaced = false;

            while (!portalPlaced)
            {
                int x = rand.Next(bounds.X + 2, bounds.MaxX - 4);
                int y = rand.Next(bounds.Y + 2, bounds.MaxY - 4);
                if (buf[x, y].Object != null)
                {
                    continue;
                }

                buf[x, y].Region = "Spawn";
                buf[x, y].Object = new DungeonObject {
                    ObjectType = AbyssTemplate.CowardicePortal
                };
                portalPos    = new Point(x, y);
                portalPlaced = true;
            }
        }
        public override void Rasterize(BitmapRasterizer<DungeonTile> rasterizer, Random rand)
        {
            rasterizer.FillRect(Bounds, new DungeonTile
            {
                TileType = AbyssTemplate.RedSmallChecks
            });

            var buf = rasterizer.Bitmap;
            var bounds = Bounds;

            bool portalPlaced = false;
            while (!portalPlaced)
            {
                int x = rand.Next(bounds.X + 2, bounds.MaxX - 4);
                int y = rand.Next(bounds.Y + 2, bounds.MaxY - 4);
                if (buf[x, y].Object != null)
                    continue;

                buf[x, y].Region = "Spawn";
                buf[x, y].Object = new DungeonObject
                {
                    ObjectType = AbyssTemplate.CowardicePortal
                };
                portalPos = new Point(x, y);
                portalPlaced = true;
            }
        }
        public override void Rasterize(BitmapRasterizer<DungeonTile> rasterizer, Random rand)
        {
            rasterizer.FillRect(Bounds, new DungeonTile
            {
                TileType = PirateCaveTemplate.BrownLines
            });

            int numBoss = new Range(0, 1).Random(rand);
            int numMinion = new Range(3, 5).Random(rand);
            int numPet = new Range(0, 2).Random(rand);

            var buf = rasterizer.Bitmap;
            var bounds = Bounds;
            while (numBoss > 0 || numMinion > 0 || numPet > 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(3))
                {
                    case 0:
                        if (numBoss > 0)
                        {
                            buf[x, y].Object = new DungeonObject
                            {
                                ObjectType = PirateCaveTemplate.Boss[rand.Next(PirateCaveTemplate.Boss.Length)]
                            };
                            numBoss--;
                        }
                        break;

                    case 1:
                        if (numMinion > 0)
                        {
                            buf[x, y].Object = new DungeonObject
                            {
                                ObjectType = PirateCaveTemplate.Minion[rand.Next(PirateCaveTemplate.Minion.Length)]
                            };
                            numMinion--;
                        }
                        break;

                    case 2:
                        if (numPet > 0)
                        {
                            buf[x, y].Object = new DungeonObject
                            {
                                ObjectType = PirateCaveTemplate.Pet[rand.Next(PirateCaveTemplate.Pet.Length)]
                            };
                            numPet--;
                        }
                        break;
                }
            }
        }
        public override void Rasterize(BitmapRasterizer<DungeonTile> rasterizer, Random rand)
        {
            rasterizer.FillRect(Bounds, new DungeonTile {
                TileType = AbyssTemplate.RedSmallChecks
            });

            int numImp = new Range(0, 2).Random(rand);
            int numDemon = new Range(2, 4).Random(rand);
            int numBrute = new Range(1, 4).Random(rand);
            int numSkull = new Range(1, 3).Random(rand);

            var buf = rasterizer.Bitmap;
            var bounds = Bounds;
            while (numImp > 0 || numDemon > 0 || numBrute > 0 || numSkull > 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 (numImp > 0) {
                            buf[x, y].Object = new DungeonObject {
                                ObjectType = AbyssTemplate.AbyssImp
                            };
                            numImp--;
                        }
                        break;
                    case 1:
                        if (numDemon > 0) {
                            buf[x, y].Object = new DungeonObject {
                                ObjectType = AbyssTemplate.AbyssDemon[rand.Next(AbyssTemplate.AbyssDemon.Length)]
                            };
                            numDemon--;
                        }
                        break;
                    case 2:
                        if (numBrute > 0) {
                            buf[x, y].Object = new DungeonObject {
                                ObjectType = AbyssTemplate.AbyssBrute[rand.Next(AbyssTemplate.AbyssBrute.Length)]
                            };
                            numBrute--;
                        }
                        break;
                    case 3:
                        if (numSkull > 0) {
                            buf[x, y].Object = new DungeonObject {
                                ObjectType = AbyssTemplate.AbyssBones
                            };
                            numSkull--;
                        }
                        break;
                }
            }
        }
        public override void Rasterize(BitmapRasterizer <DungeonTile> rasterizer, Random rand)
        {
            rasterizer.FillRect(Bounds, new DungeonTile
            {
                TileType = AbyssTemplate.RedSmallChecks
            });


            int numImp   = new Range(0, 2).Random(rand);
            int numDemon = new Range(2, 4).Random(rand);
            int numBrute = new Range(1, 4).Random(rand);
            int numSkull = new Range(1, 3).Random(rand);

            var buf    = rasterizer.Bitmap;
            var bounds = Bounds;

            while (numImp > 0 || numDemon > 0 || numBrute > 0 || numSkull > 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 (numImp > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = AbyssTemplate.AbyssImp
                        };
                        numImp--;
                    }
                    break;

                case 1:
                    if (numDemon > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = AbyssTemplate.AbyssDemon[rand.Next(AbyssTemplate.AbyssDemon.Length)]
                        };
                        numDemon--;
                    }
                    break;

                case 2:
                    if (numBrute > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = AbyssTemplate.AbyssBrute[rand.Next(AbyssTemplate.AbyssBrute.Length)]
                        };
                        numBrute--;
                    }
                    break;

                case 3:
                    if (numSkull > 0)
                    {
                        buf[x, y].Object = new DungeonObject
                        {
                            ObjectType = AbyssTemplate.AbyssBones
                        };
                        numSkull--;
                    }
                    break;
                }
            }
        }