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