Merge remote-tracking branch 'origin/demo'

This commit is contained in:
cakipaul 2025-07-14 18:03:28 +08:00
commit b232d013ff
8 changed files with 127 additions and 13 deletions

View File

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://d3tnbdx2j4tmy"
path="res://.godot/imported/sfx_一楼楼道记忆闪回.ogg-405c182ba84bc96ec0de5c140254e1d6.oggvorbisstr"
[deps]
source_file="res://asset/audio/sfx/bgm/第一章/sfx_一楼楼道记忆闪回.ogg"
dest_files=["res://.godot/imported/sfx_一楼楼道记忆闪回.ogg-405c182ba84bc96ec0de5c140254e1d6.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -76,8 +76,12 @@ func _on_timer_timeout():
# 30s 打印一次,无需首次打印
# ArchiveManager 设置 archive 时会调用 print_global_info
if _on_timer_timeout_counter % 6 == 0:
# editor 中 600s 打印一次
if Engine.is_editor_hint() and _on_timer_timeout_counter % 120 != 0:
return
print_global_info()
# @warning_ignore("intege")
func print_global_info():
var archive := ArchiveManager.archive

97
ogg_converter/convert_ogg.sh Executable file
View File

@ -0,0 +1,97 @@
#!/bin/bash
# convert_ogg.sh - Convert WAV and MP3 files to OGG format
# Usage: ./convert_ogg.sh [quality] [directory]
# Quality range: 0-10 (default: 7), Directory (default: current)
set -euo pipefail # 严格错误处理
# 默认参数
QUALITY=${1:-7}
TARGET_DIR=${2:-.}
EXTENSIONS=("mp3" "wav")
# 验证质量参数
if ! [[ "$QUALITY" =~ ^[0-9]|10$ ]]; then
echo "错误:质量参数必须在 0-10 之间" >&2
exit 1
fi
# 验证目录存在
if [[ ! -d "$TARGET_DIR" ]]; then
echo "错误:目录 '$TARGET_DIR' 不存在" >&2
exit 1
fi
# 检查 ffmpeg 是否安装
if ! command -v ffmpeg &> /dev/null; then
echo "错误:未找到 ffmpeg请先安装" >&2
exit 1
fi
# 转换函数
convert_to_ogg() {
local input_file="$1"
local output_file="${input_file%.*}.ogg"
# 检查输出文件是否已存在
if [[ -f "$output_file" ]]; then
read -p "文件 '$output_file' 已存在,是否覆盖?(y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "跳过:$input_file"
return 0
fi
fi
echo "转换中:$input_file -> $output_file"
if ffmpeg -i "$input_file" -c:a libvorbis -qscale:a "$QUALITY" "$output_file" -y &>/dev/null; then
echo "✓ 完成:$output_file"
return 0
else
echo "✗ 失败:$input_file" >&2
return 1
fi
}
# 主逻辑
cd "$TARGET_DIR"
total_files=0
converted_files=0
failed_files=0
# 统计文件总数
for ext in "${EXTENSIONS[@]}"; do
count=$(find . -maxdepth 1 -name "*.$ext" -type f | wc -l)
total_files=$((total_files + count))
done
if [[ $total_files -eq 0 ]]; then
echo "在 '$TARGET_DIR' 中未找到 MP3 或 WAV 文件"
exit 0
fi
echo "找到 $total_files 个文件,质量设置:$QUALITY"
echo "开始转换..."
echo
# 转换文件
for ext in "${EXTENSIONS[@]}"; do
while IFS= read -r -d '' file; do
if convert_to_ogg "$file"; then
((converted_files++))
else
((failed_files++))
fi
done < <(find . -maxdepth 1 -name "*.$ext" -type f -print0)
done
# 显示结果统计
echo
echo "转换完成!"
echo "成功:$converted_files 个文件"
if [[ $failed_files -gt 0 ]]; then
echo "失败:$failed_files 个文件"
exit 1
fi

View File

@ -76,12 +76,10 @@ func wood_puppet() -> void:
SceneManager.enable_prop_item("prop_木头人偶")
await SceneManager.get_inspector().quit_and_hidden
SceneManager.lock_player(0, 17, true)
$"Sfx头痛耳鸣".play()
$"../DeployLayer/DizzyShader".dizzy()
$"Sfx记忆闪回音效".play()
# SceneManager.get_camera_marker().shake_camera()
await Util.wait(2.5)
# TODO 更新 Sfx记忆闪回音
$"Sfx记忆闪回音效".play()
# 白色转场
await SceneManager.toggle_ground_mask(true, 3.0, 1.5, Color.WHITE).finished
SceneManager.get_player().toggle_pause_state(true)

View File

@ -4,7 +4,7 @@
[ext_resource type="Script" uid="uid://dydpmjpcvt3v1" path="res://scene/ground/scene/c02/s05_一楼内侧楼道.gd" id="2_70lf6"]
[ext_resource type="Script" uid="uid://cpejxlfni6n52" path="res://manager/audio_manager/vibe_sfx.gd" id="3_laquj"]
[ext_resource type="Texture2D" uid="uid://dbtepltemtmy2" path="res://asset/art/scene/c02/s05_一楼内侧楼道/bg_楼道背景.png" id="3_rcuxq"]
[ext_resource type="AudioStream" uid="uid://b8sbtn3l37uh" path="res://asset/audio/sfx/旧版/c02/红屏.ogg" id="4_iylo4"]
[ext_resource type="AudioStream" uid="uid://d3tnbdx2j4tmy" path="res://asset/audio/sfx/bgm/第一章/sfx_一楼楼道记忆闪回.ogg" id="4_74b3r"]
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_tueh3"]
[ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="5_74b3r"]
[ext_resource type="SpriteFrames" uid="uid://3nas025c2c5u" path="res://asset/art/gif/c02_杂项/c02_杂项_frames.tres" id="7_mrltr"]
@ -118,13 +118,8 @@ script = ExtResource("3_laquj")
autoplay_group = &"c02_楼道1"
metadata/_custom_type_script = "uid://cpejxlfni6n52"
[node name="Sfx头痛耳鸣" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="1"]
stream = ExtResource("4_iylo4")
bus = &"game_sfx"
script = ExtResource("5_74b3r")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m"
[node name="Sfx记忆闪回音效" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="2"]
[node name="Sfx记忆闪回音效" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="1"]
stream = ExtResource("4_74b3r")
bus = &"game_sfx"
script = ExtResource("5_74b3r")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m"

View File

@ -159,7 +159,8 @@ func _toggle_candles(show: bool) -> void:
else:
candles.modulate.a = 0.0
for light in lights:
light.energy = 0.0
# 默认保持 0.2 亮度,避免 mix 纯黑
light.energy = 0.2

View File

@ -175,7 +175,7 @@ func do_catch(front: bool):
# 其次 catch_nearby 播放 猪头怪抓盒子猫后段
sprite2d.play("猪头怪抓盒子猫后段")
# 被抓音效
Util.timer(0.5, $"Sfx猫被抓".play)
Util.timer(0.5, $"Sfx猫被抓".global_play)
# 呼吸声渐隐
$"Sfx喘气".easing_kill()
SceneManager.pop_debug_dialog_info("音效", "抓取过程。 从捡小猫开始=" + str(front))