public MapDescription<int> GetMapDescription()
		{
			var mapDescription = new MapDescription<int>();
			mapDescription.SetupWithGraph(GraphsDatabase.GetExample5());

			// Add room shapes
			var doorMode = new OverlapMode(1, 1);

			var squareRoomBig = new RoomDescription(
				GridPolygon.GetSquare(8),
				doorMode
			);
			var squareRoomSmall = new RoomDescription(
				GridPolygon.GetSquare(6),
				doorMode
			);
			var rectangleRoomBig = new RoomDescription(
				GridPolygon.GetRectangle(8, 12),
				doorMode
			);
			var rectangleRoomSmall = new RoomDescription(
				GridPolygon.GetRectangle(6, 10),
				doorMode
			);

			mapDescription.AddRoomShapes(squareRoomBig, probability: 10);
			mapDescription.AddRoomShapes(squareRoomSmall);
			mapDescription.AddRoomShapes(rectangleRoomBig);
			mapDescription.AddRoomShapes(rectangleRoomSmall);

			return mapDescription;
		}
Ejemplo n.º 2
0
        IZone IZoneCode.Generate()
        {
            RandomZoneGeneration randZoneGen = new RandomZoneGeneration(10, 10, zoneId);
            RoomDescription description = new RoomDescription();
            description.LongDescription = "Dunes gently roll off into the horizon like waves on the ocean.";
            description.ExamineDescription = "The sand is a soft almost powdery substance that lets you sink up to your ankles.";
            description.ShortDescription = "Desert";
            randZoneGen.RoomDescriptions.Add(description);

            IZone zone = randZoneGen.Generate();
            zone.InGameDaysTillReset = 1;
            zone.Name = nameof(EndLessDesert);


            Random random = new Random(zoneId);
            IRoom room = zone.Rooms[random.Next(zone.Rooms.Count) + 1];
            room.LongDescription = "Lush trees grow around the small lake forming every desert travelers dream, an oasis.";
            room.ExamineDescription = "A small lake is a pale cool blue color inviting you to take a drink and cool off from the hot desert air.";
            room.ShortDescription = "Oasis";

            IEnchantment enchantment = new HeartbeatBigTickEnchantment();
            enchantment.ActivationPercent = 100;
            enchantment.Effect = new DoorwayToUnderworld();
            room.Enchantments.Add(enchantment);

            ZoneHelper.ConnectZone(zone.Rooms[6], Direction.North, 9, 93);

            return zone;
        }
        public void Generate_BasicTest()
        {
            // This test cannot check if the generated configuration spaces are valid
            var mapDescription = new MapDescription <int>();
            var squareRoom     = new RoomDescription(GridPolygon.GetSquare(3), new OverlapMode(1, 0));
            var rectangleRoom  = new RoomDescription(GridPolygon.GetRectangle(4, 5), new OverlapMode(1, 1));

            mapDescription.AddRoomShapes(squareRoom);
            mapDescription.AddRoomShapes(rectangleRoom, probability: 0.5d);

            mapDescription.AddRoom(0);
            mapDescription.AddRoom(1);
            mapDescription.AddPassage(0, 1);

            mapDescription.AddRoomShapes(1, rectangleRoom, new List <Transformation>()
            {
                Transformation.Identity
            });

            // var configurationSpaces = generator.Generate(mapDescription);
            Assert.IsTrue(false);             // TODO: repair

            //Assert.AreEqual(3, configurationSpaces.GetShapesForNode(0).Count);
            //Assert.AreEqual(1, configurationSpaces.GetShapesForNode(1).Count);
        }
        public MapDescription <int> GetMapDescription()
        {
            var mapDescription = new MapDescription <int>();

            // Add rooms ( - you would normally use a for cycle)
            mapDescription.AddRoom(0);
            mapDescription.AddRoom(1);
            mapDescription.AddRoom(2);
            mapDescription.AddRoom(3);

            // Add passages
            mapDescription.AddPassage(0, 1);
            mapDescription.AddPassage(0, 3);
            mapDescription.AddPassage(1, 2);
            mapDescription.AddPassage(2, 3);

            // Add room shapes
            var doorMode = new OverlapMode(1, 1);

            var squareRoom = new RoomDescription(
                GridPolygon.GetSquare(8),
                doorMode
                );
            var rectangleRoom = new RoomDescription(
                GridPolygon.GetRectangle(6, 10),
                doorMode
                );

            mapDescription.AddRoomShapes(squareRoom);
            mapDescription.AddRoomShapes(rectangleRoom);

            return(mapDescription);
        }
Ejemplo n.º 5
0
        static void GenerateMap(SpaceGraph graph, int seed = 0)
        {
            var mapDescription = new MapDescription <int>();

            //Add rooms
            graph.AllNodes.ForEach(node => mapDescription.AddRoom(node.Id));

            //Add connections
            List <List <int> > connections = graph.ConvertToAdjList(false);

            for (int node = 0; node < connections.Count; node++)
            {
                for (int link = 0; link < connections[node].Count; link++)
                {
                    mapDescription.AddPassage(node, connections[node][link]);
                }
            }
            //Add room descriptions
            using (var reader = new StreamReader(@"Resources\Rooms\SMB.yml"))
            {
                var roomLoader = cfloader.LoadRoomDescriptionsSetModel(reader);
                foreach (var roomDescription in roomLoader.RoomDescriptions)
                {
                    GridPolygon     shape     = new GridPolygon(roomDescription.Value.Shape);
                    RoomDescription roomShape = new RoomDescription(shape, (roomDescription.Value.DoorMode == null) ? roomLoader.Default.DoorMode : roomDescription.Value.DoorMode);
                    mapDescription.AddRoomShapes(roomShape);
                }
            }

            // Generate bitmap
            SaveBitmap(mapDescription, seed);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Computes the length of a given corridor.
        /// </summary>
        /// <param name="roomDescription"></param>
        /// <returns></returns>
        public int GetCorridorLength(RoomDescription roomDescription)
        {
            var doorsHandler  = DoorHandler.DefaultHandler;
            var doorPositions = doorsHandler.GetDoorPositions(roomDescription.Shape, roomDescription.DoorsMode);

            if ((doorPositions.Count != 2 ||
                 doorPositions.Any(x => x.Line.Length != 0) ||
                 doorPositions[0].Line.GetDirection() != GeneralAlgorithms.DataStructures.Common.OrthogonalLine.GetOppositeDirection(doorPositions[1].Line.GetDirection())) &&
                !((doorPositions.Count == 3 || doorPositions.Count == 4) && doorPositions.All(x => x.Length == 0))
                )
            {
                throw new ArgumentException("Corridors must currently have exactly 2 door positions that are on the opposite sides of the corridor.");
            }

            var firstLine  = doorPositions[0].Line;
            var secondLine = doorPositions[1].Line;

            if (firstLine.Equals(secondLine))
            {
                secondLine = doorPositions.Select(x => x.Line).First(x => !x.Equals(secondLine));
            }

            if (firstLine.GetDirection() == GeneralAlgorithms.DataStructures.Common.OrthogonalLine.Direction.Bottom || firstLine.GetDirection() == GeneralAlgorithms.DataStructures.Common.OrthogonalLine.Direction.Top)
            {
                return(Math.Abs(firstLine.From.X - secondLine.From.X));
            }
            else
            {
                return(Math.Abs(firstLine.From.Y - secondLine.From.Y));
            }
        }
 public RoomInfo(RoomDescription roomDescription, GridPolygon roomShape, List <Transformation> transformations, List <IDoorLine> doorLines)
 {
     RoomDescription = roomDescription;
     RoomShape       = roomShape;
     Transformations = transformations;
     DoorLines       = doorLines;
 }
Ejemplo n.º 8
0
    public void Select(RoomBehaviour selectedRoom)
    {
        selectedBehaviour.gameObject.GetComponent <Outline> ().enabled = false;
        selectedBehaviour = selectedRoom;
        selectedBehaviour.gameObject.GetComponent <Outline> ().enabled = true;

        this.selectedDescription = selectedRoom.roomDescription;
        Debug.Log(selectedDescription.roomName + " isCrime? " + selectedDescription.isCrime);
        viewer.roomBehaviour = selectedRoom;
    }
Ejemplo n.º 9
0
 void UpdateRoomDescription()
 {
     currentRoomDescription = roomBehaviour.roomDescription;
     if (currentRoomDescription != null)
     {
         roomImage.sprite     = currentRoomDescription.roomImage;
         roomImage.color      = currentRoomDescription.color;
         roomTitle.text       = currentRoomDescription.roomName;
         roomDescription.text = currentRoomDescription.roomDescription;
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Adds basic room shapes to a given map description.
        /// </summary>
        /// <typeparam name="TNode"></typeparam>
        /// <param name="mapDescription"></param>
        /// <param name="scale"></param>
        /// <returns></returns>
        public static MapDescription <TNode> AddClassicRoomShapes <TNode>(this MapDescription <TNode> mapDescription,
                                                                          IntVector2 scale)
        {
            var overlapScale = Math.Min(scale.X, scale.Y);
            var doorMode     = new OverlapMode(1 * overlapScale, 0);

            var squareRoom    = new RoomDescription(GridPolygon.GetSquare(6).Scale(scale), doorMode);
            var rectangleRoom = new RoomDescription(GridPolygon.GetRectangle(6, 9).Scale(scale), doorMode);
            var room1         = new RoomDescription(
                new GridPolygonBuilder()
                .AddPoint(0, 0)
                .AddPoint(0, 6)
                .AddPoint(3, 6)
                .AddPoint(3, 3)
                .AddPoint(6, 3)
                .AddPoint(6, 0)
                .Build().Scale(scale)
                , doorMode);
            var room2 = new RoomDescription(
                new GridPolygonBuilder()
                .AddPoint(0, 0)
                .AddPoint(0, 9)
                .AddPoint(3, 9)
                .AddPoint(3, 3)
                .AddPoint(6, 3)
                .AddPoint(6, 0)
                .Build().Scale(scale)
                , doorMode);
            var room3 = new RoomDescription(
                new GridPolygonBuilder()
                .AddPoint(0, 0)
                .AddPoint(0, 3)
                .AddPoint(3, 3)
                .AddPoint(3, 6)
                .AddPoint(6, 6)
                .AddPoint(6, 3)
                .AddPoint(9, 3)
                .AddPoint(9, 0)
                .Build().Scale(scale)
                , doorMode);

            mapDescription.AddRoomShapes(squareRoom, probability: 4);
            mapDescription.AddRoomShapes(rectangleRoom, probability: 2);
            mapDescription.AddRoomShapes(room1);
            mapDescription.AddRoomShapes(room2);
            mapDescription.AddRoomShapes(room3);

            return(mapDescription);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Computes a room description from a given room template.
        /// </summary>
        /// <param name="roomTemplate"></param>
        /// <returns></returns>
        public RoomDescription GetRoomDescription(GameObject roomTemplate)
        {
            var polygon = GetPolygonFromTilemaps(roomTemplate.GetComponentsInChildren <Tilemap>());
            var doors   = roomTemplate.GetComponent <Doors>();

            if (doors == null)
            {
                throw new DungeonGeneratorException($"Room template \"{roomTemplate.name}\" does not have any doors assigned.");
            }

            var doorMode        = doors.GetDoorMode();
            var roomDescription = new RoomDescription(polygon, doorMode);

            return(roomDescription);
        }
Ejemplo n.º 12
0
    void DeactivateState()
    {
        if (this.state == RoomStates.CRIME)
        {
            this.gameManager.criminalCount--;
        }
        if (this.state != RoomStates.OFF)
        {
            gameManager.lightsCount--;
        }

        // Reset room to default state
        image.color     = Color.white;
        roomDescription = defaultRoomDescription;
        this.state      = RoomStates.OFF;
    }
Ejemplo n.º 13
0
    public void ActivateState(float invokeMin, float invokeMax, RoomDescription description)
    {
        if (description.isCrime)
        {
            this.state = RoomStates.CRIME;
        }
        else
        {
            this.state = RoomStates.NORMAL;
        }

        this.roomDescription = description;
        // TODO: change the sprite
        this.image.color = Color.yellow;

        Invoke("DeactivateStateAuto", Random.Range(invokeMin, invokeMax));
    }
        /// <summary>
        /// Applies all given transformation to a given room description.
        /// </summary>
        /// <remarks>
        /// Groups room shapes that are equal after transformation.
        /// </remarks>
        /// <param name="roomDescription"></param>
        /// <param name="transformations"></param>
        /// <returns></returns>
        private List <RoomInfo> TransformPolygons(RoomDescription roomDescription, IEnumerable <Transformation> transformations)
        {
            var result    = new List <RoomInfo>();
            var doorLines = doorHandler.GetDoorPositions(roomDescription.Shape, roomDescription.DoorsMode);
            var shape     = roomDescription.Shape;

            foreach (var transformation in transformations)
            {
                var transformedShape = shape.Transform(transformation);
                var smallestPoint    = transformedShape.BoundingRectangle.A;

                // Both the shape and doors are moved so the polygon is in the first quadrant and touches axes
                transformedShape = transformedShape + (-1 * smallestPoint);
                transformedShape = polygonUtils.NormalizePolygon(transformedShape);
                var transformedDoorLines = doorLines
                                           .Select(x => DoorUtils.TransformDoorLine(x, transformation))
                                           .Select(x => new DoorLine(x.Line + (-1 * smallestPoint), x.Length))
                                           .Cast <IDoorLine>()
                                           .ToList();

                // Check if we already have the same room shape (together with door lines)
                var sameRoomShapeFound = false;
                foreach (var roomInfo in result)
                {
                    if (roomInfo.RoomShape.Equals(transformedShape) &&
                        roomInfo.DoorLines.SequenceEqualWithoutOrder(transformedDoorLines))
                    {
                        roomInfo.Transformations.Add(transformation);

                        sameRoomShapeFound = true;
                        break;
                    }
                }

                if (sameRoomShapeFound)
                {
                    continue;
                }

                result.Add(new RoomInfo(roomDescription, transformedShape, transformation, transformedDoorLines));
            }

            return(result);
        }
        public MapDescription <int> GetMapDescription()
        {
            var mapDescription = new MapDescription <int>();

            mapDescription.SetupWithGraph(GraphsDatabase.GetExample1());

            // Add room shapes
            var doorMode = new OverlapMode(1, 1);

            var squareRoom = new RoomDescription(
                GridPolygon.GetSquare(8),
                doorMode
                );
            var rectangleRoom = new RoomDescription(
                GridPolygon.GetRectangle(6, 10),
                doorMode
                );

            mapDescription.AddRoomShapes(squareRoom);
            mapDescription.AddRoomShapes(rectangleRoom);

            // Setup corridor shapes
            var corridorRoom = new RoomDescription(
                GridPolygon.GetSquare(1),
                new SpecificPositionsMode(new List <OrthogonalLine>()
            {
                new OrthogonalLine(new IntVector2(0, 0), new IntVector2(1, 0)),
                new OrthogonalLine(new IntVector2(0, 1), new IntVector2(1, 1))
            })
                );

            mapDescription.AddCorridorShapes(corridorRoom);

            // Enable corridors
            mapDescription.SetWithCorridors(true, new List <int>()
            {
                1
            });

            return(mapDescription);
        }
Ejemplo n.º 16
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        RoomBehaviour target = getTarget();

        if (lightsCount <= maxLights && timer > roomActivationDelay)
        {
            RoomDescription desc = GetRandomRoomDescription();
            target.ActivateState(minRoomActiveTime, maxRoomActiveTime, desc);
            timer = 0;
        }

        if (timeManager.IsTimeUp() && !guiCanvas.gameObject.activeInHierarchy)
        {
            Time.timeScale = 0f;
            guiCanvas.gameObject.SetActive(true);
            if (scoreManager.score > PlayerPrefs.GetInt("HighScore", 0))
            {
                PlayerPrefs.SetInt("HighScore", scoreManager.score);
            }
        }
    }
		public MapDescription<int> GetMapDescription()
		{
			var mapDescription = new MapDescription<int>();
			mapDescription.SetupWithGraph(GraphsDatabase.GetExample2());

			// Add room shapes
			var doorMode = new OverlapMode(1, 1);

			var squareRoom = new RoomDescription(
				GridPolygon.GetSquare(8),
				doorMode
			);
			var rectangleRoom = new RoomDescription(
				GridPolygon.GetRectangle(6, 10),
				doorMode
			);

			mapDescription.AddRoomShapes(squareRoom);
			mapDescription.AddRoomShapes(rectangleRoom);

			// Add boss room shape
			var bossRoom = new RoomDescription(
				new GridPolygonBuilder()
					.AddPoint(2, 0).AddPoint(2, 1).AddPoint(1, 1).AddPoint(1, 2)
					.AddPoint(0, 2).AddPoint(0, 7).AddPoint(1, 7).AddPoint(1, 8)
					.AddPoint(2, 8).AddPoint(2, 9).AddPoint(7, 9).AddPoint(7, 8)
					.AddPoint(8, 8).AddPoint(8, 7).AddPoint(9, 7).AddPoint(9, 2)
					.AddPoint(8, 2).AddPoint(8, 1).AddPoint(7, 1).AddPoint(7, 0)
				.Build().Scale(new IntVector2(2, 2)),
				new OverlapMode(1, 1)
			);

			mapDescription.AddRoomShapes(8, bossRoom);

			return mapDescription;
		}
Ejemplo n.º 18
0
        /// <summary>
        /// Adds basic corridor room shape to a given map description.
        /// </summary>
        /// <typeparam name="TNode"></typeparam>
        /// <param name="mapDescription"></param>
        /// <param name="offsets"></param>
        /// <param name="enableCorridors"></param>
        /// <returns></returns>
        public static MapDescription <TNode> AddCorridorRoomShapes <TNode>(this MapDescription <TNode> mapDescription, List <int> offsets, bool enableCorridors = true)
        {
            foreach (var offset in offsets)
            {
                var width = offset;
                var room  = new RoomDescription(
                    GridPolygon.GetRectangle(width, 1),
                    new SpecificPositionsMode(new List <OrthogonalLine>()
                {
                    new OrthogonalLine(new IntVector2(0, 0), new IntVector2(0, 1)),
                    new OrthogonalLine(new IntVector2(width, 0), new IntVector2(width, 1)),
                })
                    );

                mapDescription.AddCorridorShapes(room);
            }

            if (enableCorridors)
            {
                mapDescription.SetWithCorridors(true, offsets);
            }

            return(mapDescription);
        }
 private void Awake()
 {
     ins = this;
 }
Ejemplo n.º 20
0
        IZone IZoneCode.Generate()
        {
            RandomZoneGeneration randZoneGen = new RandomZoneGeneration(10, 10, zoneId);
            RoomDescription      description = new RoomDescription();

            description.LongDescription    = "This part of the field is tilled and ready to be planted.";
            description.ExamineDescription = "The dirt is rich and will support a good crop.";
            description.ShortDescription   = "Farmland";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LongDescription    = "While the {crop} looks healthy it is still to young to eat.";
            description.ExamineDescription = "A tall crop of {crop} is growing here.";
            description.ShortDescription   = "Farmland";
            FlavorOption option = new FlavorOption();

            option.FlavorValues.Add("{crop}", new List <string>()
            {
                "corn", "wheat", "grapes"
            });
            description.FlavorOption.Add(option);
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LongDescription    = "The field is full of tall grass.";
            description.ExamineDescription = "The field is full of tall grass that seems to flow around you as you walk through it.";
            description.ShortDescription   = "Farmland";
            randZoneGen.RoomDescriptions.Add(description);

            option            = new FlavorOption();
            option.FlavorText = "A {type} fence runs parallel to you a {distance} away.";
            option.FlavorValues.Add("{type}", new List <string>()
            {
                "wooden", "stone"
            });
            option.FlavorValues.Add("{distance}", new List <string>()
            {
                "short", "long"
            });
            randZoneGen.RoomFlavorText.Add(option);

            option            = new FlavorOption();
            option.FlavorText = "A rusted horse shoe has been lost and lies rusting away.";
            randZoneGen.RoomFlavorText.Add(option);

            option            = new FlavorOption();
            option.FlavorText = "A small hill rises to the {direction} in the distance.";
            option.FlavorValues.Add("{direction}", new List <string>()
            {
                "north", "east", "south", "west"
            });
            randZoneGen.RoomFlavorText.Add(option);

            IZone zone = randZoneGen.Generate();

            zone.InGameDaysTillReset = 1;
            zone.Name = nameof(GrandViewDeepForest);


            description = new RoomDescription();
            description.LongDescription    = "A road runs through the farm lands.";
            description.ExamineDescription = "Two wagon ruts cut into the soil.";
            description.ShortDescription   = "Road";
            randZoneGen.RoadDescription    = description;
            randZoneGen.AddRoad(zone, null, new ZoneConnection()
            {
                ZoneId = 8, RoomId = 1
            }, new ZoneConnection()
            {
                ZoneId = 14, RoomId = 6
            }, new ZoneConnection()
            {
                ZoneId = 4, RoomId = 6
            });

            int animalChoices = 0;

            MethodInfo[] methods = this.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance);
            foreach (MethodInfo info in methods)
            {
                if (info.ReturnType == typeof(INonPlayerCharacter) && info.Name != "BuildNpc")
                {
                    animalChoices++;
                }
            }


            int percent = 20 / animalChoices;

            foreach (IRoom room in zone.Rooms.Values)
            {
                ILoadableItems loadable = (ILoadableItems)room;
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Cow()
                });
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Horse()
                });
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Chicken()
                });
            }
            return(zone);
        }
Ejemplo n.º 21
0
        public IZone Generate()
        {
            List <string> names = new List <string>()
            {
                "Falim Nasha", "Bushem Dinon", "Stavelm Eaglelash", "Giu Thunderbash", "Marif Hlisk", "Fim Grirgav", "Strarcar Marshgem", "Storth Shadowless", "Tohkue-zid Lendikrafk", "Vozif Jikrehd", "Dranrovelm Igenomze", "Zathis Vedergi", "Mieng Chiao", "Thuiy Chim", "Sielbonron Canderger", "Craldu Gacevi",
                "Rumeim Shennud", "Nilen Cahrom", "Bei Ashspark", "Hii Clanbraid", "Sodif Vatsk", "Por Rorduz", "Grorcerth Forestsoar", "Gath Distantthorne", "Duhvat-keuf Faltrueltrim", "Ham-kaoz Juhpafk", "Rolvoumvald Gibenira", "Rondit Vumregi", "Foy Sheiy", "Fiop Tei", "Fruenrucu Jalbese", "Fhanun Guldendal"
            };

            RandomZoneGeneration randZoneGen = new RandomZoneGeneration(5, 5, Zone.Id);
            RoomDescription      description = new RoomDescription();

            description.LookDescription    = "The dirt has been freshly disturbed where a body has been recently placed in the ground.";
            description.ExamineDescription = "Some flowers have been placed on the headstone that belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "The headstone has been here a while and is starting to show its age.";
            description.ExamineDescription = "The headstone name has worn off and is impossible to read.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "A grand tower of marble rises to the sky.  This person must have been important or rich in life.";
            description.ExamineDescription = "The tombstone belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "A small flat stone marker is all shows where this person is buried.";
            description.ExamineDescription = "The grave marker belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "There is a small bench for resting as one walks among the tombstones.";
            description.ExamineDescription = "A pair of angles are carved into the sides of the feet on the bench.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "Crosses give hint that the owner might have been religions in life.";
            description.ExamineDescription = "Here lies {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            description = new RoomDescription();
            description.LookDescription    = "The statue a weeping angle stands watch over the deceased.";
            description.ExamineDescription = "The grave belongs to {name}.";
            description.ShortDescription   = "Graveyard";
            randZoneGen.RoomDescriptions.Add(description);

            FlavorOption option = new FlavorOption();

            option.FlavorValues.Add("{name}", names);
            description.FlavorOption.Add(option);
            randZoneGen.RoomDescriptions.Add(description);

            Zone      = randZoneGen.Generate();
            Zone.Name = nameof(GrandViewGraveYard);

            int creatueChoices = 0;

            MethodInfo[] methods = this.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance);
            foreach (MethodInfo info in methods)
            {
                if (info.ReturnType == typeof(INonPlayerCharacter) && info.Name != "BuildNpc")
                {
                    creatueChoices++;
                }
            }

            int        percent            = (int)Math.Round(5d / creatueChoices, 0);
            List <int> hoursToSpawnUndead = new List <int>();

            for (int i = 12; i < 24; i++)
            {
                hoursToSpawnUndead.Add(i);
            }

            HeartbeatBigTickEnchantment enchantmentSkeleton = new HeartbeatBigTickEnchantment();

            enchantmentSkeleton.ActivationPercent = .2;
            enchantmentSkeleton.Effect            = new LoadMob()
            {
                HoursToLoad = hoursToSpawnUndead
            };
            enchantmentSkeleton.Parameter = new EffectParameter()
            {
                Performer = Skeleton(), RoomMessage = new TranslationMessage("The skeleton rises slowly out of its grave.")
            };

            HeartbeatBigTickEnchantment enchantmentZombie = new HeartbeatBigTickEnchantment();

            enchantmentSkeleton.ActivationPercent = .2;
            enchantmentZombie.Effect = new LoadMob()
            {
                HoursToLoad = hoursToSpawnUndead
            };
            enchantmentZombie.Parameter = new EffectParameter()
            {
                Performer = Zombie(), RoomMessage = new TranslationMessage("A zombie burst forth from it grave hungry for brains.")
            };

            foreach (IRoom room in Zone.Rooms.Values)
            {
                ILoadableItems loadable = (ILoadableItems)room;
                loadable.LoadableItems.Add(new LoadPercentage()
                {
                    PercentageLoad = percent, Object = Crow()
                });
                room.Attributes.Add(RoomAttribute.Outdoor);
                room.Attributes.Add(RoomAttribute.Weather);

                room.Enchantments.Add(enchantmentSkeleton);
                room.Enchantments.Add(enchantmentZombie);
            }

            SetRoom13();

            Zone.Rooms.Add(26, Room26());

            ConnectRooms();

            return(Zone);
        }
 public RoomInfo(RoomDescription roomDescription, GridPolygon roomShape, Transformation transformation, List <IDoorLine> doorLines)
     : this(roomDescription, roomShape, new List <Transformation>() { transformation }, doorLines)
 {
 }