Implement even more inventory/UI stuff

This commit is contained in:
2024-09-10 01:22:34 -07:00
parent 911f75da14
commit 62a9f99b81
18 changed files with 79 additions and 51 deletions

View File

@@ -50,8 +50,6 @@ public partial class Game : Node3D, IGame
private List<IDungeonFloor> Floors;
private int _currentFloor = -1;
public void Setup()
{
GameRepo = new GameRepo();
@@ -88,7 +86,7 @@ public partial class Game : Node3D, IGame
.Handle((in GameLogic.Output.LoadNextFloor _) =>
{
AnimationPlayer.Play("wait_and_load");
var currentFloor = Floors.ElementAt(_currentFloor);
var currentFloor = Floors.ElementAt(GameRepo.CurrentFloor);
currentFloor.CallDeferred(MethodName.QueueFree, []);
if (GameRepo.EquippedWeapon.Value.WeaponInfo != null && GameRepo.EquippedWeapon.Value.WeaponInfo.WeaponTags.Contains(WeaponTag.BreaksOnChange))
@@ -120,7 +118,7 @@ public partial class Game : Node3D, IGame
private void AnimationPlayer_AnimationStarted(StringName animName)
{
var newFloor = Floors.ElementAt(_currentFloor + 1);
var newFloor = Floors.ElementAt(GameRepo.CurrentFloor + 1);
newFloor.CallDeferred(nameof(newFloor.InitializeDungeon), []);
newFloor.Show();
}
@@ -129,7 +127,7 @@ public partial class Game : Node3D, IGame
{
var spawnPoints = GetTree().GetNodesInGroup("Exit").OfType<Marker3D>();
Teleport.GlobalPosition = spawnPoints.Last().GlobalPosition;
_currentFloor++;
GameRepo.CurrentFloor++;
}
public override void _Process(double delta)