2025-06-28 10:23:35 +02:00
|
|
|
extends Node2D
|
|
|
|
|
2025-06-28 14:33:47 +02:00
|
|
|
@export_file("*.tscn") var wrong_building: String
|
|
|
|
@export_file("*.tscn") var next_level: String
|
|
|
|
|
2025-06-28 10:23:35 +02:00
|
|
|
@export var base_mode: GUIDEMappingContext
|
|
|
|
|
2025-06-28 21:37:41 +02:00
|
|
|
@onready var interact: AudioStreamPlayer2D = $Player/Interact
|
|
|
|
|
|
|
|
var is_interjection_next = false
|
|
|
|
var current_info = 0
|
|
|
|
@onready var vo_interjection: AudioStreamPlayer2D = $RightDoor/VOInterjection
|
|
|
|
|
|
|
|
@onready var vo_player_1: AudioStreamPlayer2D = $RightDoor/VOPlayer1
|
|
|
|
@onready var vo_player_2: AudioStreamPlayer2D = $RightDoor/VOPlayer2
|
|
|
|
@onready var vo_player_3: AudioStreamPlayer2D = $RightDoor/VOPlayer3
|
|
|
|
@onready var vo_player_4: AudioStreamPlayer2D = $RightDoor/VOPlayer4
|
|
|
|
@onready var vo_player_5: AudioStreamPlayer2D = $RightDoor/VOPlayer5
|
|
|
|
@onready var vo_player_6: AudioStreamPlayer2D = $RightDoor/VOPlayer6
|
|
|
|
@onready var vo_player_7: AudioStreamPlayer2D = $RightDoor/VOPlayer7
|
|
|
|
@onready var vo_player_8: AudioStreamPlayer2D = $RightDoor/VOPlayer8
|
|
|
|
@onready var vo_player_9: AudioStreamPlayer2D = $RightDoor/VOPlayer9
|
|
|
|
@onready var vo_player_10: AudioStreamPlayer2D = $RightDoor/VOPlayer10
|
|
|
|
@onready var vo_player_11: AudioStreamPlayer2D = $RightDoor/VOPlayer11
|
|
|
|
@onready var vo_player_12: AudioStreamPlayer2D = $RightDoor/VOPlayer12
|
|
|
|
@onready var vo_player_13: AudioStreamPlayer2D = $RightDoor/VOPlayer13
|
2025-06-28 10:23:35 +02:00
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready() -> void:
|
|
|
|
GUIDE.enable_mapping_context(base_mode)
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
pass
|
2025-06-28 11:04:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
func _on_door_event_triggered(event_id: String) -> void:
|
2025-06-28 21:37:41 +02:00
|
|
|
interact.play()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_door_event_confirmed(event_id: String) -> void:
|
2025-06-28 14:33:47 +02:00
|
|
|
if event_id == "right":
|
|
|
|
SceneLoader.load_scene(next_level)
|
|
|
|
return
|
|
|
|
|
|
|
|
SceneLoader.load_scene(wrong_building)
|
2025-06-28 21:37:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
func _on_timer_between_vo_timeout() -> void:
|
|
|
|
if is_interjection_next:
|
|
|
|
print("interjection")
|
|
|
|
vo_interjection.play()
|
|
|
|
is_interjection_next = not is_interjection_next
|
|
|
|
return
|
|
|
|
|
|
|
|
if current_info > 13:
|
|
|
|
return
|
|
|
|
|
|
|
|
print("info")
|
|
|
|
if current_info == 0:
|
|
|
|
vo_player_1.play()
|
|
|
|
if current_info == 1:
|
|
|
|
vo_player_2.play()
|
|
|
|
if current_info == 2:
|
|
|
|
vo_player_3.play()
|
|
|
|
if current_info == 3:
|
|
|
|
vo_player_4.play()
|
|
|
|
if current_info == 4:
|
|
|
|
vo_player_5.play()
|
|
|
|
if current_info == 5:
|
|
|
|
vo_player_6.play()
|
|
|
|
if current_info == 6:
|
|
|
|
vo_player_7.play()
|
|
|
|
if current_info == 7:
|
|
|
|
vo_player_8.play()
|
|
|
|
if current_info == 8:
|
|
|
|
vo_player_9.play()
|
|
|
|
if current_info == 9:
|
|
|
|
vo_player_10.play()
|
|
|
|
if current_info == 10:
|
|
|
|
vo_player_11.play()
|
|
|
|
if current_info == 11:
|
|
|
|
vo_player_12.play()
|
|
|
|
if current_info == 12:
|
|
|
|
vo_player_13.play()
|
|
|
|
|
|
|
|
current_info += 1
|
|
|
|
is_interjection_next = not is_interjection_next
|