From fc32985aca8c23601b8ed02f2130eecd35cf6e7a Mon Sep 17 00:00:00 2001 From: 1umine Date: Sun, 7 Jul 2024 16:20:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feature:=20=E6=B7=BB=E5=8A=A0=E8=80=81?= =?UTF-8?q?=E5=A9=86=20=20=20=E5=9C=A8=E5=8E=9F=E6=9D=A5=E7=9A=84=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E4=B8=8A=E6=B7=BB=E5=8A=A0=E8=80=8C=E9=9D=9E=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=AE=BE=E7=BD=AE=E4=B8=BA=E6=AD=A4=E6=AC=A1=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E7=9A=84=E8=80=81=E5=A9=86=EF=BC=88=E4=BB=AC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/AvatarWife.js | 10 ++++++++-- models/MysApi.js | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/character/AvatarWife.js b/apps/character/AvatarWife.js index b51b15616..b6f3d0784 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 6b72b6a1b..0ac1131e6 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() From fe2e53dfdf4ac4d71a3103600205788664865239 Mon Sep 17 00:00:00 2001 From: 1umine Date: Tue, 9 Jul 2024 13:32:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=20issue=20#761=20=EF=BC=88pr=20#754=20?= =?UTF-8?q?=E4=B8=AD=E4=B8=87=E5=8F=B6=E9=80=9A=E7=94=A8=E8=AF=84=E5=88=86?= =?UTF-8?q?=E6=A0=87=E5=87=86=E6=9C=AA=E7=94=9F=E6=95=88=EF=BC=89=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=87=E5=8F=B6=E9=BB=98=E8=AE=A4=E8=AF=84?= =?UTF-8?q?=E5=88=86=E6=A0=87=E5=87=86=E8=A2=AB=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=A0=87=E5=87=86=E8=A6=86=E7=9B=96=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artis.js" | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git "a/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" "b/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" index 5b6ae92a6..ad956ad6e 100644 --- "a/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" +++ "b/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" @@ -1,6 +1,8 @@ +import { usefulAttr } from "../../artifact/artis-mark" + 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 From dd2f324d9e1ab6c66cf26f8e364945249b923a2c Mon Sep 17 00:00:00 2001 From: 1umine Date: Fri, 12 Jul 2024 20:37:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E5=8F=AF=E8=83=BD=E4=BC=9A=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E6=A8=A1=E5=9D=97=E5=AF=BC=E5=85=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20*=20=E6=9E=AB=E5=8E=9F=E4=B8=87=E5=8F=B6=E8=BF=99?= =?UTF-8?q?=E9=87=8C=E5=8E=9F=E6=9D=A5=E7=9A=84=20import=20from=20?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=8A=A5=E9=94=99=E6=89=BE=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=98=8E=E6=98=8E=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E8=BF=98=E5=8F=AF=E4=BB=A5=E7=AA=81=E7=84=B6=E5=B0=B1=E4=B8=8D?= =?UTF-8?q?=E8=A1=8C=E4=BA=86=EF=BC=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git "a/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" "b/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" index ad956ad6e..de9b9eb2a 100644 --- "a/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" +++ "b/resources/meta-gs/character/\346\236\253\345\216\237\344\270\207\345\217\266/artis.js" @@ -1,4 +1,5 @@ -import { usefulAttr } from "../../artifact/artis-mark" +import { Data } from "#miao" +const usefulAttr = await Data.importModule("resources/meta-gs/artifact/artis-mark", "miao") export default function ({ cons, rule, def }) { if (cons === 6) {