Maps fixes

This commit is contained in:
Marco 2025-05-02 11:52:06 +02:00
commit 7f69b8fa0f
15 changed files with 64 additions and 17 deletions

View file

@ -139,9 +139,11 @@ public partial class RogueliteRoomManager : Node2D
AddRandomOffshootType(offshoots, CurrentFloorData.MinSecrets, CurrentFloorData.MaxSecrets, RoomType.Secret);
AddRandomOffshootType(offshoots, CurrentFloorData.MinTreasures, CurrentFloorData.MaxTreasures, RoomType.Treasure);
var shuffledOffshoots = offshoots.Shuffle().ToList();
// Always add guaranteed treasure first
var shuffledOffshoots = offshoots.Shuffle();
var offshootsQueue = new Queue<RoomType>();
offshootsQueue.Enqueue(RoomType.Treasure); // Always add a guaranteed treasure first
offshootsQueue.EnqueueRange(shuffledOffshoots);
int currentOffshoot = 0;
@ -353,7 +355,6 @@ public partial class RogueliteRoomManager : Node2D
var spawnedRoom = TrySpawnRoom(roomToSpawn, nextPos, direction);
if (spawnedRoom is null)
{
GD.PrintErr($"Could not spawn room {roomToSpawn} at {nextPos}");
roomsList.Enqueue(roomToSpawn);
tries++;
continue;