From b527e0e7850fcef26b4eb6537c7de8b0c8d894aa Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Sat, 19 Jun 2021 19:57:12 +0800 Subject: [PATCH] fix(adventure): optimize ending output --- packages/plugin-adventure/src/phase.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/plugin-adventure/src/phase.ts b/packages/plugin-adventure/src/phase.ts index 64f7f7e668..e07356f463 100644 --- a/packages/plugin-adventure/src/phase.ts +++ b/packages/plugin-adventure/src/phase.ts @@ -415,14 +415,15 @@ export namespace Phase { ].join('\n') } - const titles = storyMap[reversedLineMap[name]] + const prefix = reversedLineMap[name] + const titles = storyMap[prefix] if (!titles) return options['pass'] ? next().then(() => '') : `你尚未解锁剧情「${name}」。` const output = titles.map((name) => { const id = reversedEndingMap[name] - return `${id}. ${name}×${endings[id]}${badEndings.has(id) ? `(BE)` : ''}` + return `${id.slice(prefix.length + 1)}. ${name}×${endings[id]}${badEndings.has(id) ? `(BE)` : ''}` }).sort() - const [title, count] = lines[reversedLineMap[name]] - output.unshift(`${session.username},你已达成${title}剧情线的 ${titles.length}/${count} 个结局:`) + const [title, count] = lines[prefix] + output.unshift(`${session.username},你已达成${title}的 ${titles.length}/${count} 个结局:`) return output.join('\n') }