From a43e4b66e035bd0d6708cfa7a2f485abbbcd4d8a Mon Sep 17 00:00:00 2001 From: Lumine <66518048+1umine@users.noreply.github.com> Date: Thu, 29 Aug 2024 06:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=87=E5=8F=B6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=9A=E7=94=A8=E8=AF=84=E5=88=86=E6=A0=87=E5=87=86?= =?UTF-8?q?=E8=A2=AB=E8=87=AA=E5=AE=9A=E4=B9=89=E9=80=9A=E7=94=A8=E6=A0=87?= =?UTF-8?q?=E5=87=86=E8=A6=86=E7=9B=96=E5=AF=BC=E8=87=B4=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A0=87=E5=87=86=E4=BF=AE=E6=94=B9=E5=90=8E=E6=9C=AA=E7=94=9F?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=20(#768)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feature: 添加老婆 在原来的基础上添加而非直接设置为此次指定的老婆(们) * fix issue #761 (pr #754 中万叶通用评分标准未生效) 修复万叶默认评分标准被自定义通用标准覆盖的问题 * fix: 可能会找不到模块导入失败 * 枫原万叶这里原来的 import from 可能报错找不到模块,明明之前还可以突然就不行了( --- apps/character/AvatarWife.js | 10 ++++++++-- models/MysApi.js | 3 +++ resources/meta-gs/character/枫原万叶/artis.js | 12 +++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/apps/character/AvatarWife.js b/apps/character/AvatarWife.js index b51b1561..b6f3d078 100644 --- a/apps/character/AvatarWife.js +++ b/apps/character/AvatarWife.js @@ -32,7 +32,7 @@ const relationMap = { } const relation = lodash.flatMap(relationMap, (d) => d.keyword) -const wifeReg = `^#?\\s*(${relation.join('|')})\\s*(设置|选择|指定|列表|查询|列表|是|是谁|照片|相片|图片|写真|图像)?\\s*([^\\d]*)\\s*(\\d*)$` +const wifeReg = `^#?\\s*(${relation.join('|')})\\s*(设置|选择|指定|添加|列表|查询|列表|是|是谁|照片|相片|图片|写真|图像)?\\s*([^\\d]*)\\s*(\\d*)$` async function getAvatarList (player, type) { await player.refreshMysDetail() @@ -78,7 +78,7 @@ const Wife = { let action = msgRet[2] || '卡片' let actionParam = msgRet[3] || '' - if (!'设置,选择,挑选,指定'.split(',').includes(action) && actionParam) { + if (!'设置,选择,挑选,指定,添加'.split(',').includes(action) && actionParam) { return false } @@ -136,10 +136,15 @@ const Wife = { case '选择': case '挑选': case '指定': + case '添加': if (!isSelf) { e.reply('只能指定自己的哦~') return true } + let existingWife = [] + if (action === '添加') { + existingWife = await selfUser.getCfg(`wife.${targetCfg.key}`, []) + } // 选择老婆 actionParam = actionParam.replace(/(,|、|;|;)/g, ',') wifeList = actionParam.split(',') @@ -152,6 +157,7 @@ const Wife = { return char.name } }) + wifeList = wifeList.concat(existingWife) wifeList = lodash.filter(lodash.uniq(wifeList), (d) => !!d) addRet = wifeList if (addRet.length === 0) { diff --git a/models/MysApi.js b/models/MysApi.js index 6b72b6a1..0ac1131e 100644 --- a/models/MysApi.js +++ b/models/MysApi.js @@ -34,6 +34,9 @@ export default class MysApi { return new User({ id: this.e.user_id, uid: this.uid }) } + /** + * @returns {Promise} + */ static async init (e, auth = 'all') { if (!e.runtime) { Version.runtime() diff --git a/resources/meta-gs/character/枫原万叶/artis.js b/resources/meta-gs/character/枫原万叶/artis.js index 5b6ae92a..2e79f252 100644 --- a/resources/meta-gs/character/枫原万叶/artis.js +++ b/resources/meta-gs/character/枫原万叶/artis.js @@ -1,6 +1,8 @@ +import { usefulAttr } from "../../artifact/artis-mark.js" + export default function ({ cons, rule, def }) { - if (cons === 6) { - return rule('万叶-满命', { atk: 75, cpct: 100, cdmg: 100, mastery: 100, dmg: 100, recharge: 55 }) - } - return def({ hp: 0, atk: 75, def: 0, cpct: 50, cdmg: 50, mastery: 100, dmg: 100, phy: 0, recharge: 55, heal: 0 }) - } \ No newline at end of file + if (cons === 6) { + return rule('万叶-满命', { atk: 75, cpct: 100, cdmg: 100, mastery: 100, dmg: 100, recharge: 55 }) + } + return def(usefulAttr['枫原万叶']) +} \ No newline at end of file