Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复万叶默认通用评分标准被自定义通用标准覆盖导致默认标准修改后未生效的问题 #764

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/character/AvatarWife.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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(',')
Expand All @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions models/MysApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export default class MysApi {
return new User({ id: this.e.user_id, uid: this.uid })
}

/**
* @returns {Promise<MysApi>}
*/
static async init (e, auth = 'all') {
if (!e.runtime) {
Version.runtime()
Expand Down
13 changes: 8 additions & 5 deletions resources/meta-gs/character/枫原万叶/artis.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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) {
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 })
}
if (cons === 6) {
return rule('万叶-满命', { atk: 75, cpct: 100, cdmg: 100, mastery: 100, dmg: 100, recharge: 55 })
}
return def(usefulAttr['枫原万叶'])
}