xiandie/manager/scene/global_functor.gd

76 lines
2.2 KiB
GDScript

extends Node
func _ready() -> void:
process_mode = Node.PROCESS_MODE_PAUSABLE
# called from dialogue
# 传送进入隧道
func transfer_to_tunnel():
SceneManager.get_ground_loader().transition_to_scene("c02_s09", "right")
# called from Amush2D's global_method
# c02 盒子猫游戏,小猫交互门
var knocking = false
func c02_cat_play_with_door():
if knocking:
return
knocking = true
var knock_stream = preload("uid://6q5qi1qon35r")
AudioManager.play_sfx(knock_stream)
SceneManager.freeze_player(1.5, 6, true)
await get_tree().create_timer(1.5).timeout
knocking = false
var c02_fire_count_down_timer: Timer
# 尝试燃烧倒计时(每次回到 s03 院子都会尝试一次)
func c02_fire_count_down_try_start():
if c02_fire_count_down_timer:
return
c02_fire_count_down_timer = Timer.new()
c02_fire_count_down_timer.autostart = true
c02_fire_count_down_timer.wait_time = 60
c02_fire_count_down_timer.one_shot = false
c02_fire_count_down_timer.timeout.connect(_on_c02_fire_count_down_timeout)
add_child(c02_fire_count_down_timer)
SceneManager.pop_debug_dialog_info("音效", "霸凌救小蝉倒计时")
# TODO 音效
# res://asset/audio/BGM/心跳背景音.mp3
var sfx = preload("uid://b3g7ubpcldrhe")
AudioManager.loop_bgm_music("霸凌救小蝉倒计时", sfx)
func _on_c02_fire_count_down_timeout():
SceneManager.pop_debug_dialog_info("音效", "【重开】霸凌救小蝉倒计时")
c02_fire_count_down_timer.stop()
AudioManager.stop_bgm_music("霸凌救小蝉倒计时")
# c02_9小蝉_游戏失败效果
var sfx = preload("uid://chebys30sd8ee")
AudioManager.play_sfx(sfx)
await get_tree().create_timer(3.0).timeout
SceneManager.get_ground_loader().transition_to_scene("c02_s03", "4")
# TODO 音效
# res://asset/audio/BGM/心跳背景音.mp3
await get_tree().create_timer(3.0).timeout
SceneManager.pop_debug_dialog_info("音效", "霸凌救小蝉倒计时")
sfx = preload("uid://b3g7ubpcldrhe")
AudioManager.loop_bgm_music("霸凌救小蝉倒计时", sfx)
c02_fire_count_down_timer.start()
func c02_fire_count_down_stop():
if c02_fire_count_down_timer:
c02_fire_count_down_timer.stop()
#TODO 同时停止音效
AudioManager.stop_bgm_music("霸凌救小蝉倒计时")
#