Add collisions to A2 corridors
Start implementation of fading ambient audio in/out on level load
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Altar : Node3D, IDungeonFloor
|
||||
public partial class Altar : SpecialFloor, IDungeonFloor
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
@@ -22,18 +22,26 @@ public partial class Altar : Node3D, IDungeonFloor
|
||||
|
||||
[Node] private Area3D NoExitArea { get; set; } = default!;
|
||||
|
||||
public ImmutableList<IDungeonRoom> Rooms => [];
|
||||
[Node] private Node DimmableAudio { get; set; } = default!;
|
||||
|
||||
[Export] public Resource Dialogue { get; set; } = default!;
|
||||
|
||||
public bool FloorIsLoaded { get; set; }
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
Show();
|
||||
Exit.AreaEntered += Exit_AreaEntered;
|
||||
NoExitArea.AreaEntered += NoExitArea_AreaEntered;
|
||||
FloorIsLoaded = true;
|
||||
var dimmableAudio = DimmableAudio.GetChildren().OfType<IDimmableAudioStreamPlayer>();
|
||||
foreach (var dimmable in dimmableAudio)
|
||||
dimmable.FadeIn();
|
||||
}
|
||||
|
||||
public override void FadeOutAudio()
|
||||
{
|
||||
var dimmableAudio = DimmableAudio.GetChildren().OfType<IDimmableAudioStreamPlayer>();
|
||||
foreach (var dimmable in dimmableAudio)
|
||||
dimmable.FadeOut();
|
||||
}
|
||||
|
||||
private void _player_PointUpFinished()
|
||||
@@ -53,7 +61,4 @@ public partial class Altar : Node3D, IDungeonFloor
|
||||
}
|
||||
|
||||
public void ExitReached() => Game.FloorExitReached();
|
||||
public void InitializeDungeon() { return; }
|
||||
|
||||
public (Vector3 Rotation, Vector3 Position) GetPlayerSpawnPoint() { return (PlayerSpawnPoint.Rotation, new Vector3(PlayerSpawnPoint.GlobalPosition.X, 0, PlayerSpawnPoint.GlobalPosition.Z)); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user