Add more NPCs, update dialogue manager to 4.4 compatible version

This commit is contained in:
2025-03-12 00:29:39 -07:00
parent 76b94f7be3
commit 22c9590442
167 changed files with 5874 additions and 5697 deletions

View File

@@ -20,45 +20,45 @@ public partial class Npc : Node3D
public void OnReady()
{
SetPhysicsProcess(true);
DialogueZone.BodyEntered += DialogueZone_BodyEntered;
DialogueZone.BodyExited += DialogueZone_BodyExited;
Hitbox.AreaEntered += Hitbox_AreaEntered;
SetPhysicsProcess(true);
DialogueZone.BodyEntered += DialogueZone_BodyEntered;
DialogueZone.BodyExited += DialogueZone_BodyExited;
Hitbox.AreaEntered += Hitbox_AreaEntered;
}
private void Hitbox_AreaEntered(Area3D area)
{
DialogueController.ShowDialogue(Dialogue, "hit");
DialogueController.ShowDialogue(Dialogue, "hit");
}
private void Hitbox_BodyEntered(Node body)
{
DialogueController.ShowDialogue(Dialogue, "hit");
DialogueController.ShowDialogue(Dialogue, "hit");
}
private void DialogueZone_BodyExited(Node3D body)
{
_isInDialogueZone = false;
DialogueController.Interrupt();
_isInDialogueZone = false;
DialogueController.Interrupt();
}
private void DialogueZone_BodyEntered(Node3D body)
{
_isInDialogueZone = true;
_isInDialogueZone = true;
}
public override void _UnhandledInput(InputEvent @event)
{
if (@event.IsActionPressed(GameInputs.Interact) && _isInDialogueZone)
{
if (_isIntroductionComplete)
DialogueController.ShowDialogue(Dialogue, "general");
else
{
DialogueController.ShowDialogue(Dialogue, "introduction");
_isIntroductionComplete = true;
}
}
if (@event.IsActionPressed(GameInputs.Interact) && _isInDialogueZone)
{
if (_isIntroductionComplete)
DialogueController.ShowDialogue(Dialogue, "general");
else
{
DialogueController.ShowDialogue(Dialogue, "introduction");
_isIntroductionComplete = true;
}
}
}
}