✨Added end of night scene
This commit is contained in:
@@ -11,6 +11,7 @@ public partial class FightSceneSwitcher : Node
|
||||
[Export] private Node _sceneRoot = null!;
|
||||
[Export] private string _fightRoomScenePath = null!;
|
||||
[Export] private string _fightHappeningScene = null!;
|
||||
[Export] private string _nightEndScene = null!;
|
||||
|
||||
private void LoadNext()
|
||||
{
|
||||
@@ -36,6 +37,12 @@ public partial class FightSceneSwitcher : Node
|
||||
if (!FightWorld.Instance.currentRoom.paths.TryGetValue(pathIndex, out var nextRoom))
|
||||
throw new Exception("Trying to go down a non-existent path");
|
||||
|
||||
if (nextRoom.specialRoom == FightWorld.Room.Special.EndOfNight)
|
||||
{
|
||||
ExitFightWorld();
|
||||
return;
|
||||
}
|
||||
|
||||
FightWorld.Instance.currentRoom = nextRoom;
|
||||
LoadNext();
|
||||
}
|
||||
@@ -60,4 +67,10 @@ public partial class FightSceneSwitcher : Node
|
||||
FightWorld.Instance.fightHappeningData = null;
|
||||
LoadNext();
|
||||
}
|
||||
|
||||
public void ExitFightWorld()
|
||||
{
|
||||
SceneTransitionThreaded.Instance.ChangeSceneToFile(_nightEndScene);
|
||||
_ = UnloadAfterDelay();
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,14 @@ public partial class FightWorld : Node
|
||||
|
||||
public class Room
|
||||
{
|
||||
public enum Special
|
||||
{
|
||||
None,
|
||||
EndOfNight
|
||||
}
|
||||
public required Dictionary<int, Room> paths;
|
||||
public required List<FighterGroup> enemyGroups;
|
||||
public Special specialRoom = Special.None;
|
||||
}
|
||||
|
||||
public class FighterGroup
|
||||
@@ -108,6 +114,13 @@ public partial class FightWorld : Node
|
||||
{
|
||||
rooms.Add(GenerateDisconnectedRoom());
|
||||
}
|
||||
|
||||
rooms.Add(new Room
|
||||
{
|
||||
paths = [],
|
||||
enemyGroups = [],
|
||||
specialRoom = Room.Special.EndOfNight
|
||||
});
|
||||
|
||||
// Connect rooms linearly
|
||||
for (var i = 0; i < rooms.Count - 1; i++)
|
||||
|
||||
Reference in New Issue
Block a user