Fixed monster rooms having matching locks

This commit is contained in:
Max 2025-02-28 14:32:23 +01:00
parent 0c4592ac7c
commit 514d985ddb
16 changed files with 6470 additions and 28709 deletions

View file

@ -15,7 +15,7 @@ class Program
// Call the method you want to run
int width = 30;
int height = 20;
int height = 30;
DungeonMap map = generator.GenerateDungeon(width, height, 5);
DungeonLockPopulator.PopulateLocksOfDungeon(map);
DungeonLockPopulator.AddExtraLocksToMonsterRooms(map.GetMonsterRooms());

View file

@ -128,7 +128,8 @@ namespace DungeonMapGenerator
int extraLockCounter = 0;
foreach (Room adjacentRoom in monsterRoom.GetAdjacentRooms())
{
if (Lock.VeryHardLocks.All(l => l.GetLock() != adjacentRoom.Lock.GetLock()))
if (Lock.VeryHardLocks.All(l => l.GetLock() != adjacentRoom.Lock.GetLock())
&& monsterRoom.GetBlockingRooms().All(room => room.Lock.GetLock() != adjacentRoom.Lock.GetLock()))
{
if (extraLockCounter < maxExtraMonsterRoomLocks)
{
@ -147,7 +148,8 @@ namespace DungeonMapGenerator
int extraLockCounter = 0;
foreach (Room adjacentRoom in bossRoom.GetAdjacentRooms())
{
if (Lock.VeryHardLocks.All(l => l.GetLock() != adjacentRoom.Lock.GetLock()))
if (Lock.VeryHardLocks.All(l => l.GetLock() != adjacentRoom.Lock.GetLock()
&& bossRoom.GetBlockingRooms().All(room => room.Lock.GetLock() != adjacentRoom.Lock.GetLock()))) // No duplicates
{
if (extraLockCounter < maxExtraBossRooms)
{

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c12dd780e583270409abb0715fc5ed53
guid: 74f218119c07e2047b8c2c25a411aecf
folderAsset: yes
DefaultImporter:
externalObjects: {}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5bebaf6441114ba46a00d957f57e6ce5
guid: 3a70533bacac8d843b6716c71b72367a
DefaultImporter:
externalObjects: {}
userData:

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 0ed963a1744096d44bd78dcfcbc17c3e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 6ab384ea2f1e30041bd20b5c3ac636ba
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: