Example #1
0
		public DungeonFloor(DungeonGenerator dungeonGenerator, DungeonFloorData floorData, bool isLastFloor, DungeonFloor prevFloor)
		{
			_pos = new Position(0, 0);
			_startPos = new Position(0, 0);
			_startDirection = Direction.Down;
			this.Width = 1;
			this.Height = 1;
			this.MazeGenerator = new MazeGenerator();
			this.Sections = new List<DungeonFloorSection>();

			_dungeonGenerator = dungeonGenerator;
			_branchProbability = floorData.Branch;
			_coverageFactor = floorData.Coverage;
			this.IsLastFloor = isLastFloor;
			_prevFloor = prevFloor;

			this.HasBossRoom = floorData.HasBoss;
			this.Statue = floorData.Statue;

			this.CalculateSize(floorData);
			this.InitRoomtraits();
			this.GenerateMaze(floorData);
			this.GenerateRooms(floorData);
			this.InitSections(floorData);
		}
Example #2
0
        public DungeonFloor(DungeonGenerator dungeonGenerator, DungeonFloorData floorData, bool isLastFloor, DungeonFloor prevFloor)
        {
            _pos               = new Position(0, 0);
            _startPos          = new Position(0, 0);
            _startDirection    = Direction.Down;
            this.Width         = 1;
            this.Height        = 1;
            this.MazeGenerator = new MazeGenerator();
            this.Sections      = new List <DungeonFloorSection>();

            _dungeonGenerator  = dungeonGenerator;
            _branchProbability = floorData.Branch;
            _coverageFactor    = floorData.Coverage;
            this.IsLastFloor   = isLastFloor;
            _prevFloor         = prevFloor;

            this.HasBossRoom = floorData.HasBoss;
            this.Statue      = floorData.Statue;

            this.CalculateSize(floorData);
            this.InitRoomtraits();
            this.GenerateMaze(floorData);
            this.GenerateRooms(floorData);
            this.InitSections(floorData);
        }
Example #3
0
		public DungeonGenerator(string dungeonName, int itemId, int seed, int floorPlan, string option)
		{
			this.Name = dungeonName.ToLower();
			this.Data = AuraData.DungeonDb.Find(this.Name);

			this.Seed = seed;
			this.FloorPlan = floorPlan;
			this.Option = (option ?? "").ToLower();
			this.RngMaze = new MTRandom(this.Data.BaseSeed + itemId + floorPlan);
			this.RngPuzzles = new MTRandom(seed);
			this.Floors = new List<DungeonFloor>();

			DungeonFloor prev = null;
			for (int i = 0; i < this.Data.Floors.Count; i++)
			{
				var isLastFloor = (i == this.Data.Floors.Count - 1);

				var floor = new DungeonFloor(this, this.Data.Floors[i], isLastFloor, prev);
				this.Floors.Add(floor);

				prev = floor;
			}
		}
Example #4
0
        public DungeonGenerator(string dungeonName, int itemId, int seed, int floorPlan, string option)
        {
            this.Name = dungeonName.ToLower();
            this.Data = AuraData.DungeonDb.Find(this.Name);

            this.Seed       = seed;
            this.FloorPlan  = floorPlan;
            this.Option     = (option ?? "").ToLower();
            this.RngMaze    = new MTRandom(this.Data.BaseSeed + itemId + floorPlan);
            this.RngPuzzles = new MTRandom(seed);
            this.Floors     = new List <DungeonFloor>();

            DungeonFloor prev = null;

            for (int i = 0; i < this.Data.Floors.Count; i++)
            {
                var isLastFloor = (i == this.Data.Floors.Count - 1);

                var floor = new DungeonFloor(this, this.Data.Floors[i], isLastFloor, prev);
                this.Floors.Add(floor);

                prev = floor;
            }
        }
Example #5
0
		/// <summary>
		/// Creates new floor region.
		/// </summary>
		/// <param name="regionId"></param>
		/// <param name="dungeon"></param>
		/// <param name="floorId"></param>
		public DungeonFloorRegion(int regionId, Dungeon dungeon, int floorId)
			: base(regionId, dungeon)
		{
			this.FloorId = floorId;
			this.Floor = dungeon.Generator.Floors[floorId];

			this.GenerateAreas();
		}