This commit is contained in:
2025-09-27 00:22:06 -07:00
parent 2ea96e5933
commit 0bac61a762
13 changed files with 57 additions and 648 deletions

View File

@@ -0,0 +1,40 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System.Collections.Immutable;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
public partial class Altar : Node3D, IDungeonFloor
{
public override void _Notification(int what) => this.Notify(what);
[Dependency] protected IGame Game => this.DependOn<IGame>();
[Node] private Area3D Exit { get; set; } = default!;
[Node] private Marker3D PlayerSpawnPoint { get; set; } = default!;
public ImmutableList<IDungeonRoom> Rooms => [];
public bool FloorIsLoaded { get; set; }
public override void _Ready()
{
Show();
Exit.AreaEntered += Exit_AreaEntered;
FloorIsLoaded = true;
}
private void Exit_AreaEntered(Area3D area)
{
if (area.GetOwner() is IPlayer)
ExitReached();
}
public void ExitReached() => Game.FloorExitReached();
public void InitializeDungeon() { return; }
public Transform3D GetPlayerSpawnPoint() { return new Transform3D(PlayerSpawnPoint.Basis, new Vector3(PlayerSpawnPoint.GlobalPosition.X, -3, PlayerSpawnPoint.GlobalPosition.Z)); }
}