Ejemplo n.º 1
0
        public Area(RandomTable <Type> arearoomtable, RandomTable <Type> areamobtable,
                    int width     = AREA_WIDTH, int height = AREA_HEIGHT,
                    bool populate = true, int nullRooms    = 30)
        {
            rooms       = new Room[width, height];
            this.width  = width;
            this.height = height;

            if (!populate)
            {
                return;
            }

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    setRoom(x, y, (Room)Activator.CreateInstance(arearoomtable.PickRandomly()));
                    rooms[x, y].mobs        = AreaTables.CreateMobs(areamobtable.PickRandomly());
                    rooms[x, y].mobscleared = false;
                }
            }

            setRoom(4, 4, new Haven());
            rooms[4, 4].mobscleared = true;
            int[] GiantLairPos = { Game.r.Next(rooms.GetLength(0)), Game.r.Next(rooms.GetLength(1)) };
            while ((rooms[GiantLairPos[0], GiantLairPos[1]] is Haven) || (rooms[GiantLairPos[0], GiantLairPos[1]] is CryptGate))
            {
                GiantLairPos[0] = Game.r.Next(rooms.GetLength(0));
                GiantLairPos[1] = Game.r.Next(rooms.GetLength(1));
            }
            setRoom(GiantLairPos[0], GiantLairPos[1], new GiantLair());
            int[] CryptGatePos = { Game.r.Next(rooms.GetLength(0)), Game.r.Next(rooms.GetLength(1)) };
            while ((rooms[CryptGatePos[0], CryptGatePos[1]] is Haven) || (rooms[CryptGatePos[0], CryptGatePos[1]] is GiantLair))
            {
                CryptGatePos[0] = Game.r.Next(rooms.GetLength(0));
                CryptGatePos[1] = Game.r.Next(rooms.GetLength(1));
            }
            setRoom(CryptGatePos[0], CryptGatePos[1], new CryptGate());

            for (int r = 0; r < nullRooms; r++)
            {
                createNullRoom();
            }
        }
Ejemplo n.º 2
0
 public CryptGate() : base()
 {
     this.name        = "Crypt Gate";
     this.mobs        = AreaTables.CreateMobs(typeof(UndeadDragonlings));
     this.mobscleared = false;
 }
Ejemplo n.º 3
0
 public GiantLair() : base()
 {
     this.name        = "Giant's lair";
     this.mobs        = AreaTables.CreateMobs(typeof(Giant));
     this.mobscleared = false;
 }