完成六区域银河城战役与16帧美术资源

This commit is contained in:
2026-07-16 15:42:39 +08:00
parent 42080fb6b0
commit 170f0a2ed5
114 changed files with 2109 additions and 11 deletions
View File
+115
View File
@@ -0,0 +1,115 @@
# AI 游戏资产记录
本页记录本项目通过 Codex 内置 `imagegen` 生成的游戏资产规格,便于后续继续生成时保持统一模型。
## 黑化真冬 Boss
- 最终文件:`mafuyu-boss.png`
- 绿幕原图:`mafuyu-boss-chroma.png`
- 身份参考:`mafuyu-model-reference.png`
- 布局:4 列 × 4 行,共 16 帧
- 动作:悬浮待机 4 帧、指挥/施法 4 帧、冲刺斩击 4 帧、受击与崩解 4 帧
- 最终提示规格:保留参考图的紫瞳、深紫高马尾、宫益坂风黑色开衫、灰色百褶裙、海员领和红领结;变化仅限疲惫冷淡表情、黑紫污染、洋红/青色音符故障、破裂白色面具碎片。严格侧视、面向左侧、同一人物比例、纯 `#00ff00` 绿幕、无文字和水印。
## SEKAI 怪物图集
- 四帧关键原画源:`sekai-enemies.png`;当前运行文件为后文记录的 `sekai-enemies-16.png`
- 绿幕原图:`sekai-enemies-chroma.png`
- 风格参考:`mafuyu-boss.png`
- 布局:4 列 × 4 行,共 16 帧
- 行 1:残响影兽,4 帧地面移动
- 行 2:水族馆微光,4 帧漂浮脉动
- 行 3:失真爬行体,4 帧伏地/跃击
- 行 4:信号哨兵,4 帧蓄力/射击
- 最终提示规格:统一黑紫阴影材质、青色与洋红数字音符故障、日系音乐手游式赛璐璐渲染和清晰轮廓;严格侧视、面向左侧、纯 `#00ff00` 绿幕、无人物、文字和水印。
透明版本使用 imagegen 技能自带的 `remove_chroma_key.py` 进行软遮罩、去绿边处理;游戏运行时仅在图片加载失败时使用 Canvas 几何兜底。
## 真冬远程音律投射(旧版,已停用)
- 旧版运行文件:`mafuyu-ranged.png`;当前运行时已由 16 帧冰弓动画替代
- 绿幕原图:`mafuyu-ranged-chroma.png`
- 身份参考:`mafuyu-model-reference.png`、`mafuyu-attack-chroma.png`
- 布局:4 列 × 2 行,共 8 帧
- 动作:蓄力 3 帧、向右释放 3 帧、音律残光与回到待机 2 帧
- 运行规格:完整动作 0.52 秒,弹体在第 4 帧附近生成;固定脚底基线,并使用逐帧人物锚点避免长投射特效导致模型横向跳动。
- 关键约束:保持紫色高马尾、黑色开衫校服、灰色百褶裙、红领结和侧视比例;青紫音符能量不能遮挡脸部;纯 `#00ff00` 绿幕,无文字、水印或相邻帧重叠。
## 序幕与结局 CG
- 序幕:`cg-prologue-nightcord.png`、`cg-prologue-arrival.png`、`cg-prologue-aquarium.png`
- 结局:`cg-ending-true.png`、`cg-ending-return.png`
- 身份参考:`mafuyu-model-reference.png`、`mafuyu-key-visual.png`
- 叙事顺序:25:00 雨夜断线 → 抵达空白 SEKAI → 水族馆记忆;结局根据是否收齐十枚歌词切换黎明抵达或回望未完成回廊。
- 画面规格:16:9 横向动画 CG,人物位于右侧,左侧保留对话与结局文字区域;图片内不生成文字,所有字幕由 HTML 界面绘制。
## 真冬交互与长椅休息动作
- 最终运行文件:`mafuyu-interactions-normalized.png`
- 修正后的透明源图:`mafuyu-interactions-v2.png`
- 修正后的绿幕源图:`mafuyu-interactions-v2-chroma.png`
- 初稿保留:`mafuyu-interactions.png`、`mafuyu-interactions-chroma.png`(初稿休息姿势为跪坐,未接入运行时)
- 身份参考:`mafuyu-model-reference.png`
- 布局:4 列 × 4 行,共 16 帧
- 动作:终端触碰 4 帧、坐下 4 帧、休息呼吸循环 8 帧;起身使用坐下动作反向播放
- 规范化:Game Studio `normalize_sprite_strip.py`,统一 256×256 帧位与底部中心锚点,再重组为 1024×1024 图集
- 关键约束:严格保持深紫色高马尾、紫瞳、黑色开衫、水手领、红领结、灰色百褶裙、黑色及膝袜和棕色皮鞋;始终面向画面右侧。坐姿要求大腿水平、膝盖约 90°、小腿垂直、双脚落地,禁止跪坐、正坐或蹲姿。
## 真冬正面长椅动作(当前版本)
- 最终运行文件:`mafuyu-bench-front-normalized.png`
- 透明生成源:`mafuyu-bench-front.png`
- 绿幕原图:`mafuyu-bench-front-chroma.png`
- 身份参考:`mafuyu-model-reference.png`、`mafuyu-interactions-normalized.png`
- 布局:4 列 × 3 行,共 12 帧;第 1 行为正面坐下 4 帧,第 2–3 行为正面休息 8 帧
- 规范化:按 Game Studio `sprite-pipeline` 流程一次性生成整条动作,再使用 `normalize_sprite_strip.py` 统一为 256×256 帧位与底部中心锚点
- 关键约束:全程正对镜头,身体中轴、头部大小和座面高度稳定;坐姿双膝朝前、小腿垂直、双脚平放,双手自然放在膝上;人物图层不包含长椅。
## SEKAI 交互实体图集
- 四帧关键原画源:`sekai-interactables.png`;当前运行文件为后文记录的 `sekai-interactables-16.png`
- 绿幕源图:`sekai-interactables-chroma.png`
- 布局:4 列 × 4 行,共 16 帧
- 第 1 行:Nightcord 记忆长椅,4 帧青紫波形灯带呼吸循环
- 第 2 行:共鸣水晶与破损底座,4 帧沉睡/苏醒能量循环
- 第 3 行:双向回声节点,4 帧青色浮环旋转循环
- 第 4 行:Nightcord 记忆终端,4 帧波形屏幕扫描循环
- 关键约束:日系音乐手游环境实体风格、黑紫/青色/洋红配色、严格侧视图、每行轮廓与尺寸稳定、纯 `#00ff00` 绿幕、无人物、文字、水印、投影和地面。
## 真冬动态对话立绘
- 最终运行文件:`mafuyu-portrait-normalized.png`
- 绿幕原图:`mafuyu-portrait-chroma.png`
- 预览:`mafuyu-portrait-preview.png`
- 身份参考:`mafuyu-model-reference.png`
- 布局:4 列 × 2 行,共 8 帧;第 1 行为呼吸、半眨眼和闭眼,第 2 行为三档口型与轻微表情变化
- 规范化:`tools/prepare_portrait_atlas.py` 按单元格去除绿幕、清理绿色溢色,再统一为 320×320 胸像帧位和固定肩线/眼线
- 关键约束:双手与前臂完全不入画,固定 3/4 机位、脸型、发束、肩宽和制服线条;只允许眼睛、嘴型与极轻微发梢摆动,避免逐帧重新生成造成的人物漂移和常见 AI 手部瑕疵。
以上新增素材均使用 Codex 内置 imagegen 模式生成,再通过本地绿幕移除与 Game Studio 精灵规范化流程接入项目。
## 冰系战斗动画(2026-07)
- `mafuyu-attack-16.png`:4×4 固定格、共 16 帧;普通音符剑从音符生成、短距离水平挥砍到收势。它与冰剑重斩分开整条生成,避免用光流在大幅人体姿势间制造双轮廓;绿幕源与透明中间文件分别为 `mafuyu-attack-16-chroma.png` 和 `mafuyu-attack-16-alpha.png`。
- `mafuyu-ice-bow.png`:4×4 固定格、共 16 帧;音符在双手凝聚、形成浅青冰弓、拉弦生成冰箭、释放并回收。角色严格沿用 `mafuyu-model-reference.png` 的高马尾、制服、脸型与侧视比例。
- `mafuyu-ice-charge.png`:4×4 固定格、共 16 帧;低位双手持冰剑的移动蓄力循环。生成图最下排存在贴边风险,因此运行图只使用前 12 个完整姿势,并按 `0…11 → 8 → 5 → 2 → 0` 重编排,使第 16 帧与第 1 帧同姿闭环。
- `mafuyu-ice-release.png`:4×4 固定格、共 16 帧;低位预备、举剑、水平冰霜重斩、短距离冰弧、跟随动作与收势。
- 绿幕源分别为 `mafuyu-ice-bow-chroma.png`、`mafuyu-ice-charge-chroma.png`、`mafuyu-ice-release-chroma.png`;`*-alpha.png` 是内置 imagegen 输出经 `remove_chroma_key.py` 去除纯色背景后的中间文件。
- 三套最终图均由 Codex 内置 imagegen 模式一次性生成完整 16 格,而非逐帧独立生成;提示词的共同约束为:同一角色、同一右朝向、同一比例与脚底基线、每格仅一个完整人物、人物与武器不得跨格、纯 `#00ff00` 背景、无文字/场景/阴影/水印。
- `tools/build_high_frame_atlases.py` 会统一加入安全边距、清理与主体断开的暗色残片、检查帧边缘 Alpha,并生成 `combat-animation-preview.png`。
## 16 帧环境实体与怪物循环
- `sekai-interactables-16.png`:保留原 AI 交互物外观,以每行 4 张关键原画进行双向光流形变,生成每种实体 16 个固定格中间帧;每个循环的最后一段回到第一张关键原画,避免首尾跳变。
- `sekai-enemies-16.png`:保留四类怪物的单张完整主体,以轻微位移、呼吸缩放和角度变化生成 16 帧单轮廓循环。怪物不再同时透明叠画两张差异较大的原画,因此第一关不会出现一帧中带有两个头部或肢体残片的情况。
- 运行时对以上两套 16 帧图集只绘制一个整数帧,不再做相邻帧 Alpha 交叉淡化。
## 战役扩展图集(2026-07)
- 生成模式:Codex 内置 `imagegen`,以既有真冬模型、黑紫/青色 SEKAI 配色和日系音乐手游赛璐璐渲染为统一视觉约束。
- `sekai-expansion-enemies-16.png`:面具游灵、节拍器守卫、雨声唱诗体、镜像猎犬四行,每行 16 个独立动作姿势。提示要求严格侧视、单帧单主体、固定脚底/身体中心、轮廓连续、无文字/水印/场景,并避免相邻格肢体串联。
- `mafuyu-final-boss-16.png`:未写下的真冬,待机、谱面施法、镜面冲刺、崩解四行,每行 16 帧。提示锁定紫瞳、深紫高马尾、黑色开衫校服、灰色百褶裙、红领结和冷淡神情,只允许黑紫污染、洋红/青色音符故障与白色面具碎片变化。
- `sekai-expansion-interactables-16.png`:雨幕记忆灯、Nightcord 电话亭终端、镜面神龛、谱面能力门各 16 帧闭环;由四张 AI 关键原画经双向光流补间并首尾闭合。
- `tools/build_expansion_atlases.py`:统一裁切、脚底/中心锚点、清除主体上方离散残片并打包运行图集;施法动作使用完整姿势回摆序列,避开生成源贴边的一行。
- `assets/expansion-animation-preview.png`:最终扩展图集抽帧预览,用于检查轮廓、单主体、锚点和动作一致性。
- 绿幕与透明中间稿命名为 `*-chroma.png` / `*-alpha.png`,本地保留用于再处理,但 Git 默认忽略;运行时只依赖上述最终图集。
+32
View File
@@ -0,0 +1,32 @@
# Audio Sources
## Music and two system sounds
Source: [Dark Sci-Fi Audio Pack](https://opengameart.org/content/dark-sci-fi-audio-pack) by SRG774.
License: CC0 1.0 Universal / Public Domain. Attribution is not required; this credit is retained for provenance.
- `bgm-empty.mp3` ← `Airy.mp3`
- `bgm-aquarium.mp3` ← `Sector.mp3`
- `bgm-corridor.mp3` ← `Pulse.mp3`
- `bgm-stage.mp3` ← `Urgent.mp3`
- `bgm-ending.mp3` ← `Transmission.mp3`
- `sfx-victory.mp3` ← `Victory.mp3`
五首 BGM 在不改变曲目内容的前提下使用 FFmpeg `loudnorm` 统一至约 -18 LUFS、峰值上限 -1.5 dB,解决原文件平均响度约 -40 dB 导致的不可闻问题。
## Gameplay and interface sounds
Sources: Kenney [Interface Sounds](https://kenney.nl/assets/interface-sounds), [Digital Audio](https://kenney.nl/assets/digital-audio), [RPG Audio](https://kenney.nl/assets/rpg-audio), and [Impact Sounds](https://kenney.nl/assets/impact-sounds).
License: Creative Commons CC0. The original Kenney license notice is preserved as `KENNEY_LICENSE.txt`.
Selected sounds were renamed by gameplay role: menu hover/confirm/back, transition, checkpoint, death, attack, hit, hurt, footsteps, jump, dash, collect, enemy shot, and boss cast.
## Attack sound audition library
`attack-candidates/` contains 18 optional CC0 attack sounds for local A/B comparison. The normal note-blade now uses the selected `layered-swish-phaser.ogg`; the previous file is retained as `sfx-attack-legacy.ogg`. Additional sources are [Swishes Sound Pack](https://lpc.opengameart.org/content/swishes-sound-pack) by artisticdude and [Magic Spell SFX](https://opengameart.org/content/magic-spell-sfx) by JaggedStone. Exact source-to-file mapping and edit notes are recorded in `attack-candidates/LICENSES.md` and `attack-candidates/README.md`.
## Ice combat sound set
`sfx-ice-bow-charge.ogg`, `sfx-ice-arrow.ogg`, `sfx-ice-charge.ogg`, `sfx-ice-heavy.ogg`, and `sfx-freeze.ogg` are short mono mixes built from the same CC0 Swishes, Magic Spell SFX, Kenney Digital Audio, and Kenney Impact Sounds sources. They were trimmed, faded, layered, and normalized for the ice bow, ice sword, arrow release, heavy slash, and freeze state. Rebuild details are in `tools/build_ice_combat_sfx.ps1`.
+20
View File
@@ -0,0 +1,20 @@
Interface Sounds (1.0)
Created/distributed by Kenney (www.kenney.nl)
Creation date: 11-02-2020
------------------------------
License: Creative Commons Zero (CC0)
http://creativecommons.org/publicdomain/zero/1.0/
This content is free to use in personal, educational and commercial projects.
Support us by crediting Kenney or www.kenney.nl (this is not mandatory).
------------------------------
Donate: http://support.kenney.nl
Patreon: http://patreon.com/kenney/
Follow on Twitter for updates:
http://twitter.com/KenneyNL
@@ -0,0 +1,27 @@
# Sources and licenses
All source sounds used in this candidate library are released under Creative Commons CC0 / public domain terms. Attribution is not required; these details are retained for provenance.
## Kenney
- [RPG Audio](https://www.kenney.nl/assets/rpg-audio): `knifeSlice.ogg`
- [Digital Audio](https://www.kenney.nl/assets/digital-audio): `phaserUp2.ogg`, `phaseJump2.ogg`, `laser3.ogg`
- License: CC0. Kenney's included license notice is preserved at `../KENNEY_LICENSE.txt`.
## Swishes Sound Pack
- Source: [Swishes Sound Pack](https://lpc.opengameart.org/content/swishes-sound-pack)
- Author: artisticdude
- Files used: `swish-1.wav`, `swish-2.wav`, `swish-3.wav`, `swish-4.wav`, `swish-7.wav`, `swish-8.wav`, `swish-9.wav`, `swish-12.wav`
- License: CC0
## Magic Spell SFX
- Source: [Magic Spell SFX](https://opengameart.org/content/magic-spell-sfx)
- Author: JaggedStone
- Files used: `magical_1.ogg`, `magical_2.ogg`, `magical_3.ogg`
- License: CC0
## Edits
The files in this directory are format conversions, loudness-normalized edits, short fades, or mixes of the CC0 inputs listed above. The layered candidates contain no additional source material.
+35
View File
@@ -0,0 +1,35 @@
# Attack sound candidate library
Open `index.html` through the project's local web server to compare every candidate against the current in-game attack sound.
```powershell
python -m http.server 5501 --bind 127.0.0.1
```
Then visit <http://127.0.0.1:5501/assets/audio/attack-candidates/>.
The current `assets/audio/sfx-attack.ogg` is the A reference. The ice-combat update selected `layered-swish-phaser.ogg` for the normal note-blade attack. The former Kenney RPG Audio `knifeSlice2.ogg` version is preserved as `assets/audio/sfx-attack-legacy.ogg`.
## Candidates
| Files | Count | Purpose | Source |
| --- | ---: | --- | --- |
| `physical-swish-*.ogg` | 8 | Fast wind and weapon movement | Swishes Sound Pack |
| `physical-knife-slice-alt.ogg` | 1 | Alternate physical slice | Kenney RPG Audio |
| `energy-*.ogg` | 6 | Digital, laser, and short magic accents | Kenney Digital Audio / Magic Spell SFX |
| `layered-*.ogg` | 3 | Physical attack plus a quieter energy layer | CC0 sources above |
All candidates are mono 48 kHz Ogg Vorbis files normalized near -18 LUFS, with a -2 dB true-peak target. The longer laser and magic sources are trimmed and faded for a short player attack.
## Replacing the current sound
Back up the current sound, then copy the selected file over it:
```powershell
Copy-Item -LiteralPath 'assets\audio\sfx-attack.ogg' -Destination 'assets\audio\sfx-attack.backup.ogg'
Copy-Item -LiteralPath 'assets\audio\attack-candidates\layered-swish-phaser.ogg' -Destination 'assets\audio\sfx-attack.ogg' -Force
```
Alternatively, point `SFX_TRACKS.attack` in `game.js` at a candidate file. Browser caching can preserve the previous sound during development; use a hard refresh after replacing it.
See `LICENSES.md` for source and license details. Rebuild the processed files with `tools/build_attack_candidates.ps1`.
Binary file not shown.
+254
View File
@@ -0,0 +1,254 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>朝比奈真冬 · 攻击音效 A/B 试听</title>
<style>
:root {
color-scheme: dark;
--ink: #f6f1ff;
--muted: #aca3bd;
--panel: rgba(23, 19, 35, .82);
--line: rgba(226, 209, 255, .14);
--violet: #b39aff;
--pink: #f3a6d5;
--cyan: #8ce0ef;
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
color: var(--ink);
font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
background:
radial-gradient(circle at 18% 8%, rgba(134, 100, 208, .19), transparent 35rem),
radial-gradient(circle at 88% 4%, rgba(77, 185, 207, .11), transparent 28rem),
linear-gradient(150deg, #0b0912, #171121 52%, #0c1018);
}
body::before {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
opacity: .19;
background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
background-size: 36px 36px;
mask-image: linear-gradient(to bottom, black, transparent 80%);
}
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 80px; }
.eyebrow { color: var(--pink); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
h1 { margin: 10px 0 12px; font-size: clamp(30px, 5vw, 54px); font-weight: 650; letter-spacing: -.035em; }
.intro { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.75; }
.toolbar {
position: sticky;
top: 12px;
z-index: 5;
display: grid;
grid-template-columns: 1fr auto auto;
gap: 12px;
align-items: center;
margin: 30px 0 34px;
padding: 14px;
border: 1px solid var(--line);
border-radius: 18px;
background: rgba(16, 13, 25, .88);
box-shadow: 0 16px 50px rgba(0,0,0,.3);
backdrop-filter: blur(16px);
}
.now { min-width: 0; }
.now small { display: block; margin-bottom: 3px; color: var(--muted); }
#nowName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button {
border: 1px solid var(--line);
border-radius: 12px;
padding: 10px 14px;
color: var(--ink);
font: inherit;
cursor: pointer;
background: rgba(255,255,255,.055);
transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
button:hover { border-color: rgba(179,154,255,.62); background: rgba(179,154,255,.11); }
button:active { transform: translateY(1px) scale(.985); }
button.primary { color: #130d1c; border: 0; background: linear-gradient(135deg, var(--violet), var(--pink)); font-weight: 700; }
.settings {
display: flex;
gap: 18px;
align-items: center;
flex-wrap: wrap;
margin-bottom: 34px;
color: var(--muted);
font-size: 13px;
}
.settings label { display: flex; gap: 9px; align-items: center; }
input[type="range"] { accent-color: var(--violet); width: 150px; }
section { margin-top: 34px; }
.section-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 13px; }
h2 { margin: 0; font-size: 20px; font-weight: 620; }
.section-head span { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card {
position: relative;
min-height: 152px;
padding: 17px;
border: 1px solid var(--line);
border-radius: 17px;
background: var(--panel);
overflow: hidden;
transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(179,154,255,.36); }
.card.selected { border-color: var(--violet); background: rgba(47, 36, 69, .91); box-shadow: inset 0 0 0 1px rgba(179,154,255,.18); }
.card::after { content: ""; position: absolute; right: -32px; bottom: -42px; width: 110px; height: 110px; border-radius: 50%; background: var(--accent, var(--violet)); opacity: .08; filter: blur(2px); }
.card-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.card h3 { margin: 12px 0 7px; font-size: 17px; }
.card p { min-height: 37px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.card-actions { display: flex; gap: 8px; }
.card-actions button { position: relative; z-index: 1; padding: 8px 11px; font-size: 12px; }
.physical { --accent: var(--pink); }
.energy { --accent: var(--cyan); }
.layered { --accent: var(--violet); }
.help { margin-top: 46px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; color: var(--muted); background: rgba(10,9,16,.55); line-height: 1.7; }
.help strong { color: var(--ink); }
code { color: #e4d7ff; overflow-wrap: anywhere; }
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; translate: -50% 12px; padding: 10px 15px; border-radius: 999px; color: #160e21; background: #eadfff; opacity: 0; pointer-events: none; transition: .2s ease; }
#toast.show { translate: -50% 0; opacity: 1; }
@media (max-width: 800px) { .grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 590px) {
main { width: min(100% - 22px, 1120px); padding-top: 32px; }
.toolbar { grid-template-columns: 1fr 1fr; }
.now { grid-column: 1 / -1; }
.toolbar button { width: 100%; }
.grid { grid-template-columns: 1fr; }
input[type="range"] { width: 122px; }
}
</style>
</head>
<body>
<main>
<div class="eyebrow">Silent Corridor · Sound Lab</div>
<h1>攻击音效 A/B 试听</h1>
<p class="intro">现有攻击音效作为 A 基准,不会被这个页面修改。先在卡片中选择一个候选 B,再用顶部按钮反复对比;建议戴耳机,同时尝试不同播放速度。</p>
<div class="toolbar">
<div class="now"><small>当前候选 B</small><div id="nowName">尚未选择</div></div>
<button id="playA">A · 当前音效</button>
<button id="playB" class="primary" disabled>B · 播放候选</button>
</div>
<div class="settings">
<label>音量 <input id="volume" type="range" min="0" max="1" step="0.05" value="0.75"><output id="volumeOut">75%</output></label>
<label>速度 <input id="rate" type="range" min="0.75" max="1.35" step="0.05" value="1"><output id="rateOut">1.00×</output></label>
<span>快捷键:A 播放原音效,B 播放候选,空格重播上一次</span>
</div>
<div id="groups"></div>
<div class="help">
<strong>选定后如何替换:</strong>先备份 <code>assets/audio/sfx-attack.ogg</code>,再把所选候选文件复制并改名为 <code>sfx-attack.ogg</code>。也可以只修改 <code>game.js</code> 中 <code>SFX_TRACKS.attack</code> 的路径。点击卡片里的“复制替换命令”可复制一条 PowerShell 命令;页面本身不会写入游戏文件。
</div>
</main>
<div id="toast" role="status"></div>
<script>
const groups = [
{ id: 'physical', title: '挥砍 / 风切', hint: '短促、实体感强,适合普通近战', items: [
['physical-swish-01.ogg', 'Swish 01', '极短挥动样本,适合轻攻击。'],
['physical-swish-02.ogg', 'Swish 02', '另一种极短风切,可用于更快的起手。'],
['physical-swish-03.ogg', 'Swish 03', '短挥动样本,轮廓相对完整。'],
['physical-swish-04.ogg', 'Swish 04', '紧凑风切,可尝试稍低播放速度。'],
['physical-swish-07.ogg', 'Swish 07', '较长的挥动尾音,动作存在感更明显。'],
['physical-swish-08.ogg', 'Swish 08', '轻量短尾,适合连续攻击。'],
['physical-swish-09.ogg', 'Swish 09', '中短风切,适合作为节拍音刃底层。'],
['physical-swish-12.ogg', 'Swish 12', '非常短促,可叠加命中特效音。'],
['physical-knife-slice-alt.ogg', 'Knife Slice Alt', 'Kenney 的另一条切割声,不是游戏当前文件。']
]},
{ id: 'energy', title: '能量 / 音符', hint: '更贴近 SEKAI 与节奏音刃的电子质感', items: [
['energy-phaser-rise.ogg', 'Phaser Rise', '短数字上升音,适合 PERFECT 攻击。'],
['energy-phase-snap.ogg', 'Phase Snap', '紧凑相位脉冲,起音较明确。'],
['energy-laser-short.ogg', 'Laser Short', '激光素材的短裁切版,尾部已淡出。'],
['energy-magic-01-short.ogg', 'Magic 01 Short', '魔法素材短版,可尝试 1.10× 速度。'],
['energy-magic-02-short.ogg', 'Magic 02 Short', '第二条魔法素材短版。'],
['energy-magic-03-short.ogg', 'Magic 03 Short', '第三条魔法素材短版。']
]},
{ id: 'layered', title: '混合版本', hint: '挥动声负责手感,电子或魔法层负责角色辨识度', items: [
['layered-swish-phaser.ogg', 'Swish + Phaser', '风切与数字上升音的双层版本。'],
['layered-swish-magic.ogg', 'Swish + Magic', '风切与短魔法尾音的双层版本。'],
['layered-knife-phase.ogg', 'Knife + Phase', '切割与相位脉冲结合,实体感更强。']
]}
];
const root = document.querySelector('#groups');
const audio = new Audio();
const volume = document.querySelector('#volume');
const rate = document.querySelector('#rate');
const playB = document.querySelector('#playB');
const nowName = document.querySelector('#nowName');
const toast = document.querySelector('#toast');
let selected = null;
let lastSource = null;
let toastTimer = 0;
function escapeShellSingle(value) { return value.replaceAll("'", "''"); }
function notify(message) {
toast.textContent = message;
toast.classList.add('show');
clearTimeout(toastTimer);
toastTimer = setTimeout(() => toast.classList.remove('show'), 1800);
}
function play(source, label) {
lastSource = { source, label };
audio.pause();
audio.src = source;
audio.currentTime = 0;
audio.volume = Number(volume.value);
audio.playbackRate = Number(rate.value);
audio.play().then(() => { nowName.textContent = `正在播放:${label}`; }).catch(() => notify('浏览器阻止了播放,请再点击一次'));
}
function select(item, title, card) {
selected = { source: item, title };
document.querySelectorAll('.card').forEach(node => node.classList.toggle('selected', node === card));
card.classList.add('selected');
nowName.textContent = title;
playB.disabled = false;
localStorage.setItem('attack-candidate', item);
}
async function copyCommand(file) {
const command = `Copy-Item -LiteralPath 'assets\\audio\\attack-candidates\\${escapeShellSingle(file)}' -Destination 'assets\\audio\\sfx-attack.ogg' -Force`;
try { await navigator.clipboard.writeText(command); notify('替换命令已复制'); }
catch { window.prompt('请手动复制:', command); }
}
groups.forEach(group => {
const section = document.createElement('section');
section.innerHTML = `<div class="section-head"><h2>${group.title}</h2><span>${group.hint}</span></div><div class="grid"></div>`;
const grid = section.querySelector('.grid');
group.items.forEach(([file, title, note], index) => {
const card = document.createElement('article');
card.className = `card ${group.id}`;
card.innerHTML = `<div class="card-top"><span>${group.id}</span><span class="duration">读取时长…</span></div><h3>${title}</h3><p>${note}</p><div class="card-actions"><button class="listen">选择并播放</button><button class="copy">复制替换命令</button></div>`;
const probe = new Audio(file);
probe.preload = 'metadata';
probe.addEventListener('loadedmetadata', () => card.querySelector('.duration').textContent = `${probe.duration.toFixed(2)} s`);
card.querySelector('.listen').addEventListener('click', () => { select(file, title, card); play(file, title); });
card.querySelector('.copy').addEventListener('click', () => copyCommand(file));
grid.append(card);
if (localStorage.getItem('attack-candidate') === file) select(file, title, card);
});
root.append(section);
});
document.querySelector('#playA').addEventListener('click', () => play('../sfx-attack.ogg', 'A · 游戏当前音效'));
playB.addEventListener('click', () => selected && play(selected.source, `B · ${selected.title}`));
volume.addEventListener('input', () => { audio.volume = Number(volume.value); document.querySelector('#volumeOut').value = `${Math.round(volume.value * 100)}%`; });
rate.addEventListener('input', () => { audio.playbackRate = Number(rate.value); document.querySelector('#rateOut').value = `${Number(rate.value).toFixed(2)}×`; });
document.addEventListener('keydown', event => {
if (event.target.matches('input, button')) return;
if (event.code === 'KeyA') play('../sfx-attack.ogg', 'A · 游戏当前音效');
if (event.code === 'KeyB' && selected) play(selected.source, `B · ${selected.title}`);
if (event.code === 'Space' && lastSource) { event.preventDefault(); play(lastSource.source, lastSource.label); }
});
</script>
</body>
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB