Fix up special floors

This commit is contained in:
2026-04-27 23:33:03 -07:00
parent a55ab4a342
commit f2a164b262
21 changed files with 1335 additions and 781 deletions

View File

@@ -0,0 +1,36 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode))]
public partial class Cellular : SpecialFloor
{
public override void _Notification(int what) => this.Notify(what);
[Node] private Area3D Exit { get; set; } = default!;
[Dependency] protected IGame Game => this.DependOn<IGame>();
public void OnResolved()
{
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 OnExitTree()
{
Exit.AreaEntered -= Exit_AreaEntered;
}
}