xiandie/manager/scene/global_functor.gd

78 lines
2.6 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

extends Node
var dialogue_c02 = preload("res://asset/dialogue/c02.dialogue")
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
# TODO 音效
# res://asset/audio/BGM/心跳背景音.mp3
var c02_fire_count_down_sfx = preload("uid://b3g7ubpcldrhe")
# 尝试燃烧倒计时(每次回到 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
if GlobalConfig.DEBUG:
SceneManager.pop_debug_dialog_info("debug", "当前为测试模式,倒计时 10s正式模式倒计时 60s")
c02_fire_count_down_timer.wait_time = 10
else:
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("音效", "霸凌救小蝉倒计时")
AudioManager.loop_bgm_music("霸凌救小蝉倒计时", c02_fire_count_down_sfx)
func _on_c02_fire_count_down_timeout():
SceneManager.pop_debug_dialog_info("音效", "【重开】霸凌救小蝉倒计时")
c02_fire_count_down_timer.stop()
AudioManager.stop_bgm_music("霸凌救小蝉倒计时")
DialogueManager.show_dialogue_balloon(dialogue_c02, "c02_未完成拯救小蝉的游戏", [GlobalConfig.DIALOG_IGNORE_INPUT])
await get_tree().create_timer(1.0).timeout
SceneManager.show_black_hand(true, 0.5)
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("音效", "霸凌救小蝉倒计时")
AudioManager.loop_bgm_music("霸凌救小蝉倒计时", c02_fire_count_down_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()
# 停止音效
AudioManager.stop_bgm_music("霸凌救小蝉倒计时")