Implement scene-based chapter quest progression
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { resolveCustomWorldAnchorWorldType } from '../services/customWorldTheme';
|
||||
import {
|
||||
type CustomWorldThemeMode,
|
||||
detectCustomWorldThemeMode,
|
||||
resolveCustomWorldAnchorWorldType,
|
||||
} from '../services/customWorldTheme';
|
||||
import { CustomWorldItem, CustomWorldProfile, InventoryItem, WorldTemplateType, WorldType } from '../types';
|
||||
|
||||
let runtimeCustomWorldProfile: CustomWorldProfile | null = null;
|
||||
@@ -94,9 +98,13 @@ const CATEGORY_DEFAULT_TAGS: Record<string, string[]> = {
|
||||
稀有品: ['rare', '线索'],
|
||||
专属物: ['rare', '剧情关键'],
|
||||
};
|
||||
const WORLD_ITEM_PREFIXES: Record<WorldTemplateType, string[]> = {
|
||||
[WorldType.WUXIA]: ['江湖', '风雨', '断桥', '青锋', '旧案', '夜行'],
|
||||
[WorldType.XIANXIA]: ['灵潮', '云阙', '星砂', '裂界', '玄脉', '天舟'],
|
||||
const WORLD_ITEM_PREFIXES: Record<CustomWorldThemeMode, string[]> = {
|
||||
mythic: ['远岸', '回声', '曙迹', '长旅', '微光', '新铭'],
|
||||
martial: ['风雨', '断桥', '青锋', '旧案', '夜行', '残影'],
|
||||
arcane: ['灵纹', '道痕', '云篆', '星芒', '界辉', '玉简'],
|
||||
machina: ['铁脊', '脉冲', '新星', '等离', '钢律', '核列'],
|
||||
tide: ['潮纹', '霜浪', '天澜', '海晕', '潮歌', '沧流'],
|
||||
rift: ['裂痕', '灰域', '界桥', '断层', '回响', '前哨'],
|
||||
};
|
||||
const WORLD_ITEM_NOUNS: Record<string, string[]> = {
|
||||
武器: ['刃', '剑', '弓', '枪', '印', '锤'],
|
||||
@@ -127,7 +135,7 @@ function getWorldSeedLabel(profile: CustomWorldProfile) {
|
||||
const fromSetting = sanitizeNameFragment(profile.settingText);
|
||||
if (fromSetting) return fromSetting;
|
||||
|
||||
return profile.templateWorldType === WorldType.XIANXIA ? '灵境' : '江湖';
|
||||
return '旅境';
|
||||
}
|
||||
|
||||
function buildRuntimeItemTags(
|
||||
@@ -228,7 +236,7 @@ function buildProceduralRuntimeItem(
|
||||
options: RuntimeCustomWorldItemQueryOptions,
|
||||
index: number,
|
||||
) {
|
||||
const anchorWorldType = resolveCustomWorldAnchorWorldType(profile);
|
||||
const themeMode = detectCustomWorldThemeMode(profile);
|
||||
const seed = hashText(`${profile.id}:${seedKey}:${index}`);
|
||||
const defaultCategory = DEFAULT_RUNTIME_CATEGORIES[0] ?? 'world-item';
|
||||
const categories = compactStrings(options.categories?.length ? options.categories : [...DEFAULT_RUNTIME_CATEGORIES]);
|
||||
@@ -236,7 +244,7 @@ function buildProceduralRuntimeItem(
|
||||
const rarityFloorValue = getRarityFloorValue(options.rarityFloor);
|
||||
const rarity = inferRuntimeItemRarity(seed, rarityFloorValue);
|
||||
const tags = buildRuntimeItemTags(category, options, seed);
|
||||
const prefixPool = WORLD_ITEM_PREFIXES[anchorWorldType];
|
||||
const prefixPool = WORLD_ITEM_PREFIXES[themeMode];
|
||||
const nounPool = WORLD_ITEM_NOUNS[category] ?? WORLD_ITEM_NOUNS.稀有品;
|
||||
const fallbackNounPool = ['sigil', 'relic', 'token', 'seal', 'core', 'mark'];
|
||||
const resolvedNounPool = nounPool ?? fallbackNounPool;
|
||||
|
||||
Reference in New Issue
Block a user