Overhaul game state logic to support gameplay loop

This commit is contained in:
2025-04-30 00:43:55 -07:00
parent 78cdda97b9
commit 68c91d8f13
60 changed files with 2503 additions and 1116 deletions

View File

@@ -1,6 +1,7 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -63,5 +64,9 @@ public partial class BossRoomA : Node3D, IBossRoom
public void ExitReached()
=> Game.FloorExitReached();
private void Exit_AreaEntered(Area3D area) => ExitReached();
private void Exit_AreaEntered(Area3D area)
{
if (area.GetOwner() is IPlayer)
ExitReached();
}
}

View File

@@ -1,6 +1,7 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -21,5 +22,9 @@ public partial class ExitRoom : DungeonRoom
public void ExitReached()
=> Game.FloorExitReached();
private void Exit_AreaEntered(Area3D area) => ExitReached();
private void Exit_AreaEntered(Area3D area)
{
if (area.GetOwner() is IPlayer)
ExitReached();
}
}

View File

@@ -2,6 +2,7 @@ using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System.Collections.Immutable;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -22,12 +23,16 @@ public partial class Floor0 : Node3D, IDungeonFloor
public override void _Ready()
{
Show();
Exit.AreaEntered += Exit_AreaEntered;
FloorIsLoaded = true;
Show();
Exit.AreaEntered += Exit_AreaEntered;
FloorIsLoaded = true;
}
private void Exit_AreaEntered(Area3D area) => ExitReached();
private void Exit_AreaEntered(Area3D area)
{
if (area.GetOwner() is IPlayer)
ExitReached();
}
public void ExitReached() => Game.FloorExitReached();
public void InitializeDungeon() { return; }