同步关卡属性编辑与Boss小怪置灰提示

This commit is contained in:
2026-11-24 19:38:56 +08:00
parent 9d0218a864
commit 30a59acb69
11 changed files with 212 additions and 21 deletions
+11 -1
View File
@@ -20,7 +20,12 @@
};
const inventory = model.sourceOrder(bundle), count = inventory.length;
if (index.chunkSize !== 50 || count > 20000) throw new Error('项目分块规格不受支持');
const byId = new Map(inventory.map(id => [id, { ...model.sourceLevel(bundle, id), displayLevel: id }]));
const byId = new Map(inventory.map(id => {
const source = { ...model.sourceLevel(bundle, id), displayLevel: id };
// 游戏以敌人、难度文件为唯一来源,避免分块中残留另一份过期配置。
delete source.levelSettings;
return [id, source];
}));
const chunks = [];
for (let first = 1; first <= count; first += index.chunkSize) {
const chunkId = String(chunks.length + 1).padStart(3, '0'), last = Math.min(count, first + index.chunkSize - 1);
@@ -41,6 +46,11 @@
encounters.levels[id] = JSON.parse(JSON.stringify(encounters.levels[template]));
templates[id] = data.sourceTemplates[template] ?? template;
}
for (const id of inventory) {
const settings = model.sourceLevel(bundle, id).levelSettings;
if (!settings) continue;
encounters.levels[id] = settings.encounter; difficulty.levels[id] = settings.difficulty;
}
difficulty.levelCount = count;
scheduleJson(directory + 'MainlineDifficulty.json', difficulty);
scheduleJson(directory + 'MainlineEncounterConfig.json', encounters);