Split custom world generation into staged lightweight batches
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -8,6 +8,13 @@ import type { FunctionDocumentationEntry } from '../types';
|
||||
* 向眼前 NPC 送礼的入口 function。
|
||||
* 这里直接提供 gift modal 的默认构造逻辑。
|
||||
*/
|
||||
export function buildNpcGiftModalIntroText(encounter: Encounter) {
|
||||
return [
|
||||
'你:我想送你一样东西。',
|
||||
`${encounter.npcName}:先让我看看你带了什么,我再决定该怎么收下。`,
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
export function buildNpcGiftModalState(
|
||||
state: GameState,
|
||||
encounter: Encounter,
|
||||
@@ -17,6 +24,7 @@ export function buildNpcGiftModalState(
|
||||
return {
|
||||
encounter,
|
||||
actionText,
|
||||
introText: buildNpcGiftModalIntroText(encounter),
|
||||
selectedItemId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,6 +8,13 @@ import type { FunctionDocumentationEntry } from '../types';
|
||||
* 邀请眼前 NPC 加入队伍的 function。
|
||||
* 这里直接收口了“队伍已满时弹窗,否则立即进入招募序列”的分流逻辑。
|
||||
*/
|
||||
export function buildNpcRecruitModalIntroText(encounter: Encounter) {
|
||||
return [
|
||||
'你:我想认真谈谈同行的事。',
|
||||
`${encounter.npcName}:先把你队伍里的位置理顺,再给我一个明确答复。`,
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
export function buildNpcRecruitModalState(
|
||||
state: GameState,
|
||||
encounter: Encounter,
|
||||
@@ -16,6 +23,7 @@ export function buildNpcRecruitModalState(
|
||||
return {
|
||||
encounter,
|
||||
actionText,
|
||||
introText: buildNpcRecruitModalIntroText(encounter),
|
||||
selectedReleaseNpcId: state.companions[0]?.npcId ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,6 +8,13 @@ import type { FunctionDocumentationEntry } from '../types';
|
||||
* 与眼前 NPC 发起交易的入口 function。
|
||||
* 这里直接提供 trade modal 的默认构造逻辑,避免窗口初始化散落在别处。
|
||||
*/
|
||||
export function buildNpcTradeModalIntroText(encounter: Encounter) {
|
||||
return [
|
||||
'你:我想先看看你手里有什么能换。',
|
||||
`${encounter.npcName}:先看货吧,买卖和回收的价都写得清楚。`,
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
export function buildNpcTradeModalState(
|
||||
state: GameState,
|
||||
encounter: Encounter,
|
||||
@@ -17,6 +24,7 @@ export function buildNpcTradeModalState(
|
||||
return {
|
||||
encounter,
|
||||
actionText,
|
||||
introText: buildNpcTradeModalIntroText(encounter),
|
||||
mode: 'buy',
|
||||
selectedNpcItemId: npcInventory[0]?.id ?? null,
|
||||
selectedPlayerItemId: state.playerInventory[0]?.id ?? null,
|
||||
|
||||
Reference in New Issue
Block a user