Fixed monster rooms having matching locks
This commit is contained in:
parent
0c4592ac7c
commit
514d985ddb
16 changed files with 6470 additions and 28709 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue