extends Node3D
class_name Cave

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

func setup_room(door_id : int):
    var rng := RandomNumberGenerator.new()
    rng.seed = door_id

    %Cristal.rotate_y(rng.randf_range(-PI,PI))

    %Cristal.broken.connect(
        func ():
            GameInfo.game_data.current_region_data.completed_doors.append(door_id)
    );


func _on_exit_clicked():
    %Exit.interactable = false
    SceneManager.change_to_scene(RegionScene.new(GameInfo.game_data.current_region_data))
