From 1aac828633c0501566123c2a4bac6678db2a887c Mon Sep 17 00:00:00 2001 From: yan Date: Sun, 11 Jan 2026 22:12:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(game):=20=E6=B7=BB=E5=8A=A0=E4=B8=83?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E9=98=9F=E4=BC=8D=E9=85=8D=E7=BD=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 SevenElement 配置对象,包含七元素及其对应材料映射 - 添加 team 配置对象,支持当前元素和战斗状态管理 - 实现路径执行前检查战斗策略配置的功能 - 添加团队七元素设置选项到配置文件 - 优化路径执行流程,增加调试信息输出 --- repo/js/FullyAutoAndSemiAutoTools/main.js | 29 ++++++++++++++++++- .../FullyAutoAndSemiAutoTools/settings.json | 6 ++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/repo/js/FullyAutoAndSemiAutoTools/main.js b/repo/js/FullyAutoAndSemiAutoTools/main.js index 6a2cee742..16c65a5d3 100644 --- a/repo/js/FullyAutoAndSemiAutoTools/main.js +++ b/repo/js/FullyAutoAndSemiAutoTools/main.js @@ -39,6 +39,25 @@ const config_list = { white: [], } +const SevenElement = { + SevenElements: ['火', '水', '风', '雷', '草', '冰', '岩'], + SevenElementsMap: new Map([ + ['火', []], + ['水', ['海露花']], + ['风', ['蒲公英籽']], + ['雷', ['琉鳞石', '绯樱绣球']], + ['草', []], + ['冰', []], + ['岩', []], + ]), +} +const team = { + current: undefined, + currentElementName: undefined, + fight: false, + SevenElements: settings.teamSevenElements.split(',').map(item => item.trim()), +} + /** * 保存当前记录到记录列表并同步到文件 * 该函数在保存前会将Set类型的数据转换为数组格式,确保JSON序列化正常进行 @@ -652,6 +671,15 @@ async function runPath(path, stopKey = AUTO_STOP) { log.info(`[{mode}] 路径已执行: {path},跳过执行`, settings.mode, path) return } + try { + const one = JSON.parse(file.readTextSync(path)) + if (one.info && one.info.description.includes("请配置好战斗策略")) { + log.warn(`[{mode}] 路径需要配置好战斗策略: {path},如已配置请忽略`, settings.mode, path) + } + } catch (error) { + // log.error("路径执行失败: {path}, 错误: {error}", path, error.message) + // return + } try { log.debug("开始执行路径: {path}", path) @@ -688,7 +716,6 @@ async function runList(list = [], stopKey = AUTO_STOP) { log.debug('路径列表为空,跳过执行'); return; } - log.debug(`[{mode}] 开始执行路径列表,共{count}个路径`, settings.mode, list.length); // 遍历路径列表 for (let i = 0; i < list.length; i++) { diff --git a/repo/js/FullyAutoAndSemiAutoTools/settings.json b/repo/js/FullyAutoAndSemiAutoTools/settings.json index 5e07e9bc7..2c7c90039 100644 --- a/repo/js/FullyAutoAndSemiAutoTools/settings.json +++ b/repo/js/FullyAutoAndSemiAutoTools/settings.json @@ -46,6 +46,12 @@ ], "default": "全自动" }, + { + "name": "teamSevenElements", + "type": "input-text", + "label": "7元素队伍配置 按 火,水,风,雷,草,冰,岩 该顺序填写", + "default": "" + }, { "name": "choose_best", "type": "checkbox",