29 lines
943 B
GDScript
29 lines
943 B
GDScript
extends CanvasLayer
|
|
|
|
@onready var bg = $BG as TextureRect
|
|
@onready var rope_with_mahjong = $"Draggable2D麻绳" as Draggable2D
|
|
@onready var dusted_face = $"BG灰尘脸" as Control
|
|
|
|
|
|
func _ready() -> void:
|
|
layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME
|
|
var mahjong_picked = ArchiveManager.get_global_value("c03_s03_mahjong_picked")
|
|
if mahjong_picked:
|
|
rope_with_mahjong.queue_free()
|
|
dusted_face.hide()
|
|
else:
|
|
rope_with_mahjong.picked.connect(_on_btn_pressed, CONNECT_ONE_SHOT)
|
|
|
|
|
|
func _on_btn_pressed(_arg):
|
|
ArchiveManager.set_global_entry("c03_s03_mahjong_picked", true)
|
|
SceneManager.enable_prop_item("prop_麻将2")
|
|
rope_with_mahjong.queue_free()
|
|
await SceneManager.get_inspector().quit_and_hidden
|
|
# TODO 诡异小孩声
|
|
SceneManager.pop_debug_dialog_info("音效", "诡异小孩声")
|
|
$"Sfx诡异小孩声".play()
|
|
var tween := create_tween()
|
|
tween.tween_interval(1.5)
|
|
tween.tween_property(dusted_face, "modulate:a", 0.0, 1.5)
|