Esempio n. 1
0
        /// <summary>
        /// Divides the algorithms for deciding how to light up an area from the scroll's effect
        /// </summary>
        private void LightSpaces()
        {
            Point startingPoint = DungeonGameEngine.Hero.Location;

            if (FloorGenerator.FloorPlan
                [startingPoint.X, startingPoint.Y] == FloorTile.Surfaces.DarkRoom)
            {
                FloorGenerator.LightRoom(startingPoint);
            }
            else
            if (FloorGenerator.FloorPlan
                [startingPoint.X, startingPoint.Y] == FloorTile.Surfaces.Tunnel)
            {
                LightTunnel();
            }
            else
            if (FloorGenerator.FloorPlan
                [startingPoint.X, startingPoint.Y] == FloorTile.Surfaces.OpenDoor)
            {
                LightTunnel();

                // Check all four sides of door to find the room tile
                if (FloorGenerator.FloorPlan
                    [startingPoint.X, startingPoint.Y + 1] == FloorTile.Surfaces.DarkRoom)
                {
                    startingPoint.Y++;
                }
                else if (FloorGenerator.FloorPlan
                         [startingPoint.X, startingPoint.Y - 1] == FloorTile.Surfaces.DarkRoom)
                {
                    startingPoint.Y--;
                }
                else if (FloorGenerator.FloorPlan
                         [startingPoint.X, startingPoint.X + 1] == FloorTile.Surfaces.DarkRoom)
                {
                    startingPoint.X++;
                }
                else if (FloorGenerator.FloorPlan
                         [startingPoint.X, startingPoint.X - 1] == FloorTile.Surfaces.DarkRoom)
                {
                    startingPoint.X--;
                }

                FloorGenerator.LightRoom(startingPoint);
            }
        }