60 lines
1.4 KiB
C#
60 lines
1.4 KiB
C#
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 BossRoomB : Node3D, IBossRoom, IDungeonFloor
|
|
{
|
|
public override void _Notification(int what) => this.Notify(what);
|
|
|
|
[Dependency] public IGame Game => this.DependOn<IGame>();
|
|
|
|
[Node] public Marker3D PlayerSpawn { get; set; } = default!;
|
|
|
|
[Node] public DemonWall DemonWall { get; set; } = default!;
|
|
|
|
[Node] private Area3D ActivateTrap { get; set; } = default!;
|
|
public ImmutableList<IDungeonRoom> Rooms { get; }
|
|
public bool FloorIsLoaded { get; set; }
|
|
|
|
[Node] private Area3D _exit { get; set; } = default!;
|
|
|
|
public void OnReady()
|
|
{
|
|
ActivateTrap.BodyEntered += ActivateTrap_AreaEntered;
|
|
_exit.AreaEntered += Exit_AreaEntered;
|
|
}
|
|
|
|
private void ActivateTrap_AreaEntered(Node3D area) => StartBossFight();
|
|
|
|
public void OnBossFightEnded()
|
|
{
|
|
|
|
}
|
|
|
|
public void StartBossFight()
|
|
{
|
|
DemonWall.Activate();
|
|
}
|
|
|
|
public void InitializeDungeon()
|
|
{
|
|
|
|
}
|
|
|
|
public void ExitReached()
|
|
=> Game.FloorExitReached();
|
|
|
|
private void Exit_AreaEntered(Area3D area)
|
|
{
|
|
if (area.GetOwner() is IPlayer)
|
|
ExitReached();
|
|
}
|
|
|
|
public (Vector3 Rotation, Vector3 Position) GetPlayerSpawnPoint() { return (PlayerSpawn.Rotation, new Vector3(PlayerSpawn.GlobalPosition.X, 0, PlayerSpawn.GlobalPosition.Z)); }
|
|
}
|