Add plastique item
Add Door object Initial work for look up animation
This commit is contained in:
@@ -2,6 +2,7 @@ using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
@@ -13,6 +14,8 @@ public partial class Altar : Node3D, IDungeonFloor
|
||||
|
||||
[Dependency] protected IGame Game => this.DependOn<IGame>();
|
||||
|
||||
[Dependency] protected IPlayer _player => this.DependOn(() => GetParent().GetChildren().OfType<IPlayer>().Single());
|
||||
|
||||
[Node] private Area3D Exit { get; set; } = default!;
|
||||
|
||||
[Node] private Marker3D PlayerSpawnPoint { get; set; } = default!;
|
||||
@@ -25,25 +28,29 @@ public partial class Altar : Node3D, IDungeonFloor
|
||||
|
||||
public bool FloorIsLoaded { get; set; }
|
||||
|
||||
public override void _Ready()
|
||||
public void OnResolved()
|
||||
{
|
||||
Show();
|
||||
Exit.AreaEntered += Exit_AreaEntered;
|
||||
NoExitArea.AreaEntered += NoExitArea_AreaEntered;
|
||||
FloorIsLoaded = true;
|
||||
_player.PointUpFinished += _player_PointUpFinished;
|
||||
FloorIsLoaded = true;
|
||||
}
|
||||
|
||||
private void _player_PointUpFinished()
|
||||
{
|
||||
_player.Activate();
|
||||
}
|
||||
|
||||
private void NoExitArea_AreaEntered(Area3D area)
|
||||
{
|
||||
DialogueController.ShowDialogue(Dialogue, "no_exit");
|
||||
//if (area.GetOwner() is IPlayer player)
|
||||
// player.Deactivate();
|
||||
}
|
||||
|
||||
private void Exit_AreaEntered(Area3D area)
|
||||
{
|
||||
if (area.GetOwner() is IPlayer)
|
||||
ExitReached();
|
||||
if (area.GetOwner() is IPlayer)
|
||||
ExitReached();
|
||||
}
|
||||
|
||||
public void ExitReached() => Game.FloorExitReached();
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user