mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-01 18:31:16 +00:00
Various
This commit is contained in:
parent
6e26eb21b1
commit
15457f4314
2 changed files with 37 additions and 32 deletions
|
|
@ -44,7 +44,6 @@ script = ExtResource("4_jtlua")
|
||||||
Rooms = Array[Object]([ExtResource("5_gwtv6"), ExtResource("6_gwtv6"), ExtResource("7_wbqvu"), ExtResource("8_3fyis"), ExtResource("9_go1yg"), ExtResource("5_pfafs"), ExtResource("11_68lig"), ExtResource("12_83bvc"), ExtResource("13_y651a"), ExtResource("14_vhvs2"), ExtResource("15_6gk3e"), ExtResource("16_4gy5m"), ExtResource("17_td7hx"), ExtResource("18_2lxq3"), ExtResource("19_6ahuq"), ExtResource("20_xrp0h")])
|
Rooms = Array[Object]([ExtResource("5_gwtv6"), ExtResource("6_gwtv6"), ExtResource("7_wbqvu"), ExtResource("8_3fyis"), ExtResource("9_go1yg"), ExtResource("5_pfafs"), ExtResource("11_68lig"), ExtResource("12_83bvc"), ExtResource("13_y651a"), ExtResource("14_vhvs2"), ExtResource("15_6gk3e"), ExtResource("16_4gy5m"), ExtResource("17_td7hx"), ExtResource("18_2lxq3"), ExtResource("19_6ahuq"), ExtResource("20_xrp0h")])
|
||||||
DungeonLength = 6
|
DungeonLength = 6
|
||||||
MaxBranchLength = 2
|
MaxBranchLength = 2
|
||||||
Seed = 1
|
|
||||||
|
|
||||||
[node name="CameraController" type="Camera2D" parent="."]
|
[node name="CameraController" type="Camera2D" parent="."]
|
||||||
process_mode = 1
|
process_mode = 1
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,12 @@ public partial class RogueliteRoomManager : Node2D
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<RogueliteRoomResource> StarterRooms => Rooms.Where(x => x.Type is RoomType.Starter);
|
private IEnumerable<RogueliteRoomResource> StarterRooms => Rooms.Where(x => x.Type is RoomType.Starter);
|
||||||
private IEnumerable<RogueliteRoomResource> RegularRooms => Rooms.Where(x => x.Type is RoomType.Regular && x.HasDoors(DoorDirections.North | DoorDirections.South));
|
|
||||||
private IEnumerable<RogueliteRoomResource> OffshootRooms => Rooms.Where(x => x.Type is RoomType.Regular && x.HasDoors(DoorDirections.East | DoorDirections.West));
|
private IEnumerable<RogueliteRoomResource> RegularRooms => Rooms.Where(x =>
|
||||||
|
x.Type is RoomType.Regular && x.HasDoors(DoorDirections.North | DoorDirections.South));
|
||||||
|
|
||||||
|
private IEnumerable<RogueliteRoomResource> OffshootRooms => Rooms.Where(x =>
|
||||||
|
x.Type is RoomType.Regular && x.HasDoors(DoorDirections.East | DoorDirections.West));
|
||||||
|
|
||||||
private IEnumerable<RogueliteRoomResource> BossRooms => Rooms.Where(x => x.Type is RoomType.Boss);
|
private IEnumerable<RogueliteRoomResource> BossRooms => Rooms.Where(x => x.Type is RoomType.Boss);
|
||||||
|
|
||||||
|
|
@ -173,6 +177,8 @@ public partial class RogueliteRoomManager : Node2D
|
||||||
{
|
{
|
||||||
var shuffledOffshootRoomsList = randomOffshootRoomsList.Shuffle().ToList();
|
var shuffledOffshootRoomsList = randomOffshootRoomsList.Shuffle().ToList();
|
||||||
|
|
||||||
|
var directions = new List<Vector2I>() { Vector2I.Left, Vector2I.Right }.Shuffle();
|
||||||
|
|
||||||
foreach (var shuffledOffshoot in shuffledOffshootRoomsList)
|
foreach (var shuffledOffshoot in shuffledOffshootRoomsList)
|
||||||
{
|
{
|
||||||
var offshootCoord = leftPosition - new Vector2I(shuffledOffshoot.Size.X, 0);
|
var offshootCoord = leftPosition - new Vector2I(shuffledOffshoot.Size.X, 0);
|
||||||
|
|
@ -187,7 +193,8 @@ public partial class RogueliteRoomManager : Node2D
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_connections.Add(new RoomConnection(leftPosition, offshootCoord + new Vector2I(shuffledOffshoot.Size.X -1, 0)));
|
_connections.Add(new RoomConnection(leftPosition,
|
||||||
|
offshootCoord + new Vector2I(shuffledOffshoot.Size.X - 1, 0)));
|
||||||
|
|
||||||
leftPosition = offshootCoord;
|
leftPosition = offshootCoord;
|
||||||
|
|
||||||
|
|
@ -208,12 +215,11 @@ public partial class RogueliteRoomManager : Node2D
|
||||||
|
|
||||||
SpawnRoom(finalRoomToSpawn, finalRoomCoord, out var spawnedFinalRoom);
|
SpawnRoom(finalRoomToSpawn, finalRoomCoord, out var spawnedFinalRoom);
|
||||||
|
|
||||||
_connections.Add(new RoomConnection(leftPosition, finalRoomCoord + new Vector2I(finalRoomToSpawn.Size.X -1, 0)));
|
_connections.Add(new RoomConnection(leftPosition,
|
||||||
|
finalRoomCoord + new Vector2I(finalRoomToSpawn.Size.X - 1, 0)));
|
||||||
|
|
||||||
leftPosition = finalRoomCoord;
|
leftPosition = finalRoomCoord;
|
||||||
// Done with last offshoot room
|
// Done with last offshoot room
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nextPos = currentPos + new Vector2I(0, 1);
|
nextPos = currentPos + new Vector2I(0, 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue