Example #1
0
        public MonsterSpawnInfo SpawnMonstersToRoom(MapRoom room, string monsterTypeName, MapRoom.RoomType type, int direction, int countRooms, int countMobsPerRoom, bool randomOffset = false, int level = 1, int chance = 100, bool exclude = true)
        {
            if (chance < 100 && !ChanceCheck(chance))
            {
                return(null);
            }

            Tile[] rooms = room.GetSubRooms(type, direction, countRooms, exclude);

            MonsterSpawnInfo info = null;

            foreach (Tile t in rooms)
            {
                if (t == null)
                {
                    break;
                }

                for (int i = 0; i < countMobsPerRoom; i++)
                {
                    info = SpawnMonsterToRoom(room, monsterTypeName, t, randomOffset, level);
                }
            }

            return(info);
        }