This commit is contained in:
2026-04-21 18:27:46 +08:00
parent 04bff9617d
commit 4372ab5be1
358 changed files with 30788 additions and 14737 deletions

View File

@@ -51,7 +51,8 @@ export const CAMP_TRAVEL_HOME_FUNCTION: FunctionDocumentationEntry = {
storyMode: 'special_travel',
uiMode: 'none',
visuals: CAMP_TRAVEL_HOME_OPTION_VISUALS,
executor: 'src/hooks/story/choiceActions.ts -> handleCampTravelHome',
executor:
'src/hooks/rpg-runtime-story/choiceActions.ts -> handleCampTravelHome',
animationNote:
'先播放营地离场的 run 演出,再切到正式场景并生成 encounter preview。',
storyNote:

View File

@@ -52,7 +52,7 @@ export const CONTINUE_ADVENTURE_FUNCTION: FunctionDocumentationEntry = {
storyMode: 'reveal_deferred_options',
uiMode: 'none',
visuals: CONTINUE_ADVENTURE_OPTION_VISUALS,
executor: 'src/hooks/story/choiceActions.ts -> handleChoice',
executor: 'src/hooks/rpg-runtime-story/choiceActions.ts -> handleChoice',
animationNote: '按钮本身沿用轻量前进动画,但不驱动新的战斗或场景演出。',
storyNote:
'点击时直接把 deferredOptions 放回 currentStory.options不再请求新的 generateNextStep。',

View File

@@ -29,7 +29,8 @@ export const STORY_OPENING_CAMP_DIALOGUE_FUNCTION: FunctionDocumentationEntry =
runtime: {
storyMode: 'special_sequence',
uiMode: 'none',
executor: 'src/hooks/story/openingAdventure.ts + src/services/prompt.ts',
executor:
'src/hooks/rpg-runtime-story/openingAdventure.ts + src/services/prompt.ts',
animationNote: '重点在对白本身,不额外驱动独立战斗/位移动画。',
storyNote: '会把 prompt 切到营地开场对白模式,并要求输出结构化对话行。',
uiNote: '不弹 modal直接进入对白流。',

View File

@@ -1,6 +1,6 @@
import { existsSync } from 'node:fs';
import { SERVER_RUNTIME_FUNCTION_IDS } from '../../../packages/shared/src/contracts/story';
import { SERVER_RUNTIME_FUNCTION_IDS } from '../../../packages/shared/src/contracts/rpgRuntimeStoryAction';
import { describe, expect, it } from 'vitest';
import {

View File

@@ -23,7 +23,8 @@ export const NPC_CHAT_FUNCTION: FunctionDocumentationEntry = {
runtime: {
storyMode: 'stream_then_defer',
uiMode: 'none',
executor: 'src/hooks/story/npcEncounterActions.ts -> commitNpcChatState',
executor:
'src/hooks/rpg-runtime-story/npcEncounterActions.ts -> commitNpcChatState',
animationNote: '重点在流式对白和轻量站场,不额外打开窗口。',
storyNote:
'先生成聊天正文,再把真正的新选项放入 deferredOptions等待 continue adventure。',

View File

@@ -22,7 +22,8 @@ export const NPC_FIGHT_FUNCTION: FunctionDocumentationEntry = {
runtime: {
storyMode: 'special_sequence',
uiMode: 'none',
executor: 'src/hooks/story/npcEncounterActions.ts -> handleNpcInteraction',
executor:
'src/hooks/rpg-runtime-story/npcEncounterActions.ts -> handleNpcInteraction',
animationNote: '切到 NPC 战斗模式后,由战斗播放链路驱动后续动画。',
storyNote: '不会先弹窗,直接把当前 encounter 切成战斗态并进入后续结算。',
uiNote: '不弹 modal直接进入战斗。',

View File

@@ -1,4 +1,4 @@
import type { GiftModalState } from '../../../hooks/story/uiTypes';
import type { GiftModalState } from '../../../hooks/rpg-runtime-story/uiTypes';
import type { Encounter, GameState } from '../../../types';
import type { FunctionDocumentationEntry } from '../types';
@@ -46,7 +46,7 @@ export const NPC_GIFT_FUNCTION: FunctionDocumentationEntry = {
storyMode: 'modal_then_generate',
uiMode: 'gift_modal',
executor:
'src/hooks/story/storyGenerationState.ts + src/hooks/story/npcInteraction.ts',
'src/hooks/rpg-runtime-story/storyGenerationState.ts + src/hooks/rpg-runtime-story/npcInteraction.ts',
animationNote: '第一次点击不驱动额外演出,重点是切到礼物面板。',
storyNote:
'真正的剧情推进发生在 confirmGift 之后,届时才会写入好感变化与结果文本。',

View File

@@ -21,7 +21,8 @@ export const NPC_HELP_FUNCTION: FunctionDocumentationEntry = {
runtime: {
storyMode: 'local_effect_then_generate',
uiMode: 'none',
executor: 'src/hooks/story/npcEncounterActions.ts -> handleNpcInteraction',
executor:
'src/hooks/rpg-runtime-story/npcEncounterActions.ts -> handleNpcInteraction',
animationNote: '不单独开窗口,直接在当前交互里结算帮助结果。',
storyNote: '点击后立即按本地奖励规则结算,并继续生成新的故事状态。',
uiNote: '不弹 modal直接获得帮助反馈。',

View File

@@ -20,7 +20,8 @@ export const NPC_LEAVE_FUNCTION: FunctionDocumentationEntry = {
runtime: {
storyMode: 'local_effect_then_generate',
uiMode: 'none',
executor: 'src/hooks/story/npcEncounterActions.ts -> handleNpcInteraction',
executor:
'src/hooks/rpg-runtime-story/npcEncounterActions.ts -> handleNpcInteraction',
animationNote: '通常只做轻量离场,不单独打开窗口。',
storyNote: '点击后结束当前 NPC 交互,并回到新的探索剧情。',
uiNote: '不弹 modal直接退出互动。',

View File

@@ -60,7 +60,7 @@ export const NPC_PREVIEW_TALK_FUNCTION: FunctionDocumentationEntry = {
uiMode: 'npc_interaction_entry',
visuals: NPC_PREVIEW_TALK_OPTION_VISUALS,
executor:
'src/hooks/story/choiceActions.ts + src/hooks/story/npcEncounterActions.ts',
'src/hooks/rpg-runtime-story/choiceActions.ts + src/hooks/rpg-runtime-story/npcEncounterActions.ts',
animationNote:
'保持轻量 idle 站场,不做额外位移,重点是把交互焦点切到 NPC 身上。',
storyNote:

View File

@@ -1,4 +1,4 @@
import type { RecruitModalState } from '../../../hooks/story/uiTypes';
import type { RecruitModalState } from '../../../hooks/rpg-runtime-story/uiTypes';
import type { Encounter, GameState } from '../../../types';
import type { FunctionDocumentationEntry } from '../types';
@@ -53,7 +53,7 @@ export const NPC_RECRUIT_FUNCTION: FunctionDocumentationEntry = {
storyMode: 'special_sequence',
uiMode: 'recruit_modal_or_sequence',
executor:
'src/hooks/story/storyGenerationState.ts + src/hooks/story/npcInteraction.ts',
'src/hooks/rpg-runtime-story/storyGenerationState.ts + src/hooks/rpg-runtime-story/npcInteraction.ts',
animationNote:
'若直接进入招募,会先播放招募对话流;若队伍已满,先进入替换弹窗。',
storyNote:

View File

@@ -20,7 +20,8 @@ export const NPC_SPAR_FUNCTION: FunctionDocumentationEntry = {
runtime: {
storyMode: 'special_sequence',
uiMode: 'none',
executor: 'src/hooks/story/npcEncounterActions.ts -> handleNpcInteraction',
executor:
'src/hooks/rpg-runtime-story/npcEncounterActions.ts -> handleNpcInteraction',
animationNote: '切到 spar 战斗模式后,由战斗播放链路驱动切磋演出。',
storyNote: '不会先弹窗,直接进入点到为止的切磋流程。',
uiNote: '不弹 modal直接切磋。',

View File

@@ -1,4 +1,4 @@
import type { TradeModalState } from '../../../hooks/story/uiTypes';
import type { TradeModalState } from '../../../hooks/rpg-runtime-story/uiTypes';
import type { Encounter, GameState, InventoryItem } from '../../../types';
import type { FunctionDocumentationEntry } from '../types';
@@ -54,7 +54,7 @@ export const NPC_TRADE_FUNCTION: FunctionDocumentationEntry = {
storyMode: 'modal_then_generate',
uiMode: 'trade_modal',
executor:
'src/hooks/story/storyGenerationState.ts + src/hooks/story/npcInteraction.ts',
'src/hooks/rpg-runtime-story/storyGenerationState.ts + src/hooks/rpg-runtime-story/npcInteraction.ts',
animationNote: '第一次点击不播额外战斗或位移动画,重点是切到交易窗口。',
storyNote:
'真正的剧情推进发生在 confirmTrade 之后,而不是打开 modal 的瞬间。',