Skip to content

Commit

Permalink
fix(adventure): optimize ending output
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jun 19, 2021
1 parent 33f04ff commit b527e0e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/plugin-adventure/src/phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

Expand Down

0 comments on commit b527e0e

Please sign in to comment.