Added end of night scene

This commit is contained in:
jonathan
2025-11-25 18:07:21 +01:00
parent 073a74bb22
commit 3c370e30a0
3 changed files with 27 additions and 0 deletions
@@ -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();
}
}