extends Node3D
class_name EstiaBase

const DIALOG_PATH = "res://dialogs/timelines/4_estia/2_estia_arrival.dtl"

func _ready():
    if not Engine.is_editor_hint():
        Input.mouse_mode = Input.MOUSE_MODE_CAPTURED

    AudioManager.play_music_alone("Estia", false, 0.)
    SteamConnection.unlock_achievement(SteamConnection.ACH_STW_REACH_ESTIA_BASE)


func _on_pearl_clicked():
    %Pearl.hide()
    AudioManager.play_sfx("PickUp")

    await get_tree().create_timer(3.).timeout

    %ExitDoor.to_scene = RelayBaseScene.new(
        "ESTIA_BASE",
        "007",
    )
    %ExitDoor.interactable = true

    AudioManager.play_sfx("DoorOpen")


func _on_ai_receptacle_clicked():
    Dialogic.start(DIALOG_PATH)

    %AiReceptacle.screen_turned_on = false
    %AiReceptacle.interactable = false
