mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 03:05:54 +00:00
Mapping and generation fixes
This commit is contained in:
parent
7482cfa496
commit
8c17738371
18 changed files with 628 additions and 53 deletions
|
|
@ -59,6 +59,7 @@ public partial class RogueliteRoomManager : Node2D
|
|||
|
||||
public void InitSpawning()
|
||||
{
|
||||
GlobalState.Instance.SessionSettings.GameMode = GameMode.Roguelite;
|
||||
GenerateStraightLineDungeon();
|
||||
}
|
||||
|
||||
|
|
@ -109,6 +110,7 @@ public partial class RogueliteRoomManager : Node2D
|
|||
rng.Dispose();
|
||||
}
|
||||
|
||||
GD.Seed(_seed);
|
||||
GD.Print($"Seed: {_seed}");
|
||||
}
|
||||
|
||||
|
|
@ -209,7 +211,7 @@ public partial class RogueliteRoomManager : Node2D
|
|||
|
||||
if (!offshootsQueue.TryDequeue(out var offshootTypeToSpawn))
|
||||
{
|
||||
GD.Print("Ran out of offshoot types, add more");
|
||||
GD.Print("Ran out of offshoot types");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -240,14 +242,20 @@ public partial class RogueliteRoomManager : Node2D
|
|||
lockNext = true;
|
||||
}
|
||||
|
||||
if (offshootTypeToSpawn is RoomType.Key &&
|
||||
offshootsQueue.Peek() is RoomType.Key)
|
||||
if (offshootTypeToSpawn is RoomType.Key)
|
||||
{
|
||||
bool hasNextRoom = offshootsQueue.TryPeek(out var nextRoom);
|
||||
if (!hasNextRoom || nextRoom is RoomType.Key)
|
||||
|
||||
// Stop if next room is a key
|
||||
break;
|
||||
}
|
||||
//break;
|
||||
}
|
||||
else
|
||||
{
|
||||
offshootsQueue.Enqueue(offshootTypeToSpawn);
|
||||
}
|
||||
}
|
||||
|
||||
// Add more dungeon if not enough rooms are generated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue