Add ability to hit NPCs and see different dialogue, add interrupt feature for dialogue controller singleton

This commit is contained in:
2024-09-09 17:20:54 -07:00
parent 699b4b95cf
commit fc33b07dc7
12 changed files with 489 additions and 420 deletions

View File

@@ -12,26 +12,10 @@ public partial class Overworld : Node3D, IDungeonFloor
[Dependency]
public IGameRepo GameRepo => this.DependOn<IGameRepo>();
[Node] public Area3D NPCBox { get; set; } = default!;
[Node] public Marker3D PlayerSpawnPoint { get; set; } = default!;
[Export] public Resource Dialogue { get; set; }
public void InitializeDungeon()
{
NPCBox.AreaEntered += NPCBox_AreaEntered;
NPCBox.AreaExited += NPCBox_AreaExited;
GameRepo.SetPlayerGlobalPosition(PlayerSpawnPoint.GlobalPosition);
}
private void NPCBox_AreaExited(Area3D area)
{
GameRepo.IsWithinDialogueSpace = false;
}
private void NPCBox_AreaEntered(Area3D area)
{
GameRepo.IsWithinDialogueSpace = true;
}
}