mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
调整部分角色的流派权重,增加武器判定
This commit is contained in:
parent
4654d99f7a
commit
e410642bb1
@ -23,7 +23,7 @@ export default new ProfileServ({
|
|||||||
// 处理服务返回
|
// 处理服务返回
|
||||||
async response (data, req) {
|
async response (data, req) {
|
||||||
if (!data.playerInfo) {
|
if (!data.playerInfo) {
|
||||||
if(data.error) {
|
if (data.error) {
|
||||||
console.log(`Enka ReqErr: ${data.error}`)
|
console.log(`Enka ReqErr: ${data.error}`)
|
||||||
}
|
}
|
||||||
return req.err('error', 60)
|
return req.err('error', 60)
|
||||||
|
@ -86,9 +86,9 @@ export const characters = {
|
|||||||
duizhang: ['卡皮塔诺', '队长'],
|
duizhang: ['卡皮塔诺', '队长'],
|
||||||
nahida: ['纳西妲', '草神', '小吉祥', '小吉祥草王', '花神', '草萝莉'],
|
nahida: ['纳西妲', '草神', '小吉祥', '小吉祥草王', '花神', '草萝莉'],
|
||||||
alhaitham: ['艾尔海森', '海哥', '埃尔海森'],
|
alhaitham: ['艾尔海森', '海哥', '埃尔海森'],
|
||||||
dixiya: ['迪希雅'],
|
dixiya: ['迪希雅', '迪希亚', '迪希娅', '迪西雅', '迪西亚'],
|
||||||
daiyin: ['戴因斯雷布', '戴因', '男派蒙'],
|
daiyin: ['戴因斯雷布', '戴因', '男派蒙', '大派蒙', '末光之剑', '拾枝者'],
|
||||||
tianli: ['天理']
|
tianli: ['天理', '天理维系者', '维系者']
|
||||||
}
|
}
|
||||||
|
|
||||||
export const wifeData = {
|
export const wifeData = {
|
||||||
|
@ -155,47 +155,36 @@ export default class ProfileArtis extends Base {
|
|||||||
|
|
||||||
getCharCfg () {
|
getCharCfg () {
|
||||||
let char = Character.get(this.charid)
|
let char = Character.get(this.charid)
|
||||||
// let { attrWeight, title } = char.getArtisMarkCfg(this.profile, this)
|
|
||||||
let { attrWeight, title } = CharArtis.getCharArtisCfg(char, this.profile, this)
|
let { attrWeight, title } = CharArtis.getCharArtisCfg(char, this.profile, this)
|
||||||
let attrMark = {}
|
let attrs = {}
|
||||||
|
|
||||||
let baseAttr = char.baseAttr || { hp: 14000, atk: 230, def: 700 }
|
let baseAttr = char.baseAttr || { hp: 14000, atk: 230, def: 700 }
|
||||||
lodash.forEach(attrWeight, (weight, attr) => {
|
lodash.forEach(attrMap, (attr, key) => {
|
||||||
attrMark[attr] = weight / attrValue[attr]
|
let k = attr.base || ''
|
||||||
})
|
let weight = attrWeight[k || key]
|
||||||
|
if (!weight || weight * 1 === 0) {
|
||||||
// let baseAttr = [400, 500, 300];
|
return true
|
||||||
if (attrMark.hp) {
|
|
||||||
attrMark.hpPlus = attrMark.hp / baseAttr.hp * 100
|
|
||||||
}
|
|
||||||
if (attrMark.atk) {
|
|
||||||
// 以520作为武器白值均值计算
|
|
||||||
attrMark.atkPlus = attrMark.atk / (baseAttr.atk * 1 + 520) * 100
|
|
||||||
}
|
|
||||||
if (attrMark.def) {
|
|
||||||
attrMark.defPlus = attrMark.def / baseAttr.def * 100
|
|
||||||
}
|
|
||||||
let maxMark = ArtisMark.getMaxMark(attrWeight)
|
|
||||||
let titleMark = {}
|
|
||||||
let titleWeight = {}
|
|
||||||
lodash.forEach(attrMark, (mark, attr) => {
|
|
||||||
let aTitle = attrMap[attr].title
|
|
||||||
if (/小/.test(aTitle)) {
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
titleMark[aTitle] = mark
|
let ret = {
|
||||||
titleWeight[aTitle] = attrWeight[attr] || 0
|
...attr,
|
||||||
if (/大/.test(aTitle)) {
|
weight,
|
||||||
let sTitle = aTitle.replace('大', '小')
|
fixWeight: weight,
|
||||||
titleWeight[sTitle] = titleWeight[aTitle]
|
mark: weight / attrValue[key]
|
||||||
}
|
}
|
||||||
|
if (!k) {
|
||||||
|
ret.mark = weight / attrValue[key]
|
||||||
|
} else {
|
||||||
|
let plus = k === 'atk' ? 520 : 0
|
||||||
|
ret.mark = weight / attrValue[k] / (baseAttr[k] + plus) * 100
|
||||||
|
ret.fixWeight = weight * attr.value / attrMap[k].value / (baseAttr[k] + plus) * 100
|
||||||
|
}
|
||||||
|
attrs[key] = ret
|
||||||
})
|
})
|
||||||
|
let maxMark = ArtisMark.getMaxMark(attrs)
|
||||||
return {
|
return {
|
||||||
|
attrs,
|
||||||
classTitle: title,
|
classTitle: title,
|
||||||
weight: attrWeight,
|
weight: attrWeight,
|
||||||
mark: attrMark,
|
mark: lodash.mapValues(attrs, (ds) => ds.mark),
|
||||||
titleMap: titleMark,
|
|
||||||
titleWeight,
|
|
||||||
maxMark
|
maxMark
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,7 +193,10 @@ export default class ProfileArtis extends Base {
|
|||||||
let charCfg = this.getCharCfg()
|
let charCfg = this.getCharCfg()
|
||||||
let artis = {}
|
let artis = {}
|
||||||
let setCount = {}
|
let setCount = {}
|
||||||
let usefulMark = charCfg.titleWeight
|
let usefulMark = {}
|
||||||
|
lodash.forEach(charCfg.attrs, (ds) => {
|
||||||
|
usefulMark[ds.title] = ds.weight
|
||||||
|
})
|
||||||
let totalMark = 0
|
let totalMark = 0
|
||||||
this.forEach((arti, idx) => {
|
this.forEach((arti, idx) => {
|
||||||
let mark = ArtisMark.getMark(charCfg, idx, arti.main, arti.attrs)
|
let mark = ArtisMark.getMark(charCfg, idx, arti.main, arti.attrs)
|
||||||
|
@ -69,9 +69,9 @@ export default class ProfileReq extends Base {
|
|||||||
params.timeout = params.timeout || 1000 * 20
|
params.timeout = params.timeout || 1000 * 20
|
||||||
let req = await fetch(reqParam.url, params)
|
let req = await fetch(reqParam.url, params)
|
||||||
data = await req.text()
|
data = await req.text()
|
||||||
if(data[0] === '<'){
|
if (data[0] === '<') {
|
||||||
let titleRet = /<title>(.+)<\/title>/.exec(data)
|
let titleRet = /<title>(.+)<\/title>/.exec(data)
|
||||||
if(titleRet && titleRet[1]) {
|
if (titleRet && titleRet[1]) {
|
||||||
data = { error: titleRet[1] }
|
data = { error: titleRet[1] }
|
||||||
} else {
|
} else {
|
||||||
return this.err('error', 60)
|
return this.err('error', 60)
|
||||||
|
@ -49,7 +49,7 @@ export default class ProfileServ extends Base {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
url: param.api || api,
|
url: param.api || api,
|
||||||
params: param.params || {}
|
params: param.params || {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ let ArtisMark = {
|
|||||||
let val = ds.value || ds[1]
|
let val = ds.value || ds[1]
|
||||||
return (attrMark[attr] || 0) * val
|
return (attrMark[attr] || 0) * val
|
||||||
},
|
},
|
||||||
getMaxMark (attrWeight) {
|
getMaxMark (attrs) {
|
||||||
let ret = {}
|
let ret = {}
|
||||||
for (let idx = 1; idx <= 5; idx++) {
|
for (let idx = 1; idx <= 5; idx++) {
|
||||||
let totalMark = 0
|
let totalMark = 0
|
||||||
@ -128,26 +128,26 @@ let ArtisMark = {
|
|||||||
} else if (idx === 2) {
|
} else if (idx === 2) {
|
||||||
mAttr = 'atkPlus'
|
mAttr = 'atkPlus'
|
||||||
} else if (idx >= 3) {
|
} else if (idx >= 3) {
|
||||||
mAttr = ArtisMark.getMaxAttr(attrWeight, mainAttr[idx])[0]
|
mAttr = ArtisMark.getMaxAttr(attrs, mainAttr[idx])[0]
|
||||||
mMark = attrWeight[mAttr]
|
mMark = attrs[mAttr].fixWeight
|
||||||
totalMark += attrWeight[mAttr] * 2
|
totalMark += attrs[mAttr].fixWeight * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
let sAttr = ArtisMark.getMaxAttr(attrWeight, subAttr, 4, mAttr)
|
let sAttr = ArtisMark.getMaxAttr(attrs, subAttr, 4, mAttr)
|
||||||
lodash.forEach(sAttr, (attr, aIdx) => {
|
lodash.forEach(sAttr, (attr, aIdx) => {
|
||||||
totalMark += attrWeight[attr] * (aIdx === 0 ? 6 : 1)
|
totalMark += attrs[attr].fixWeight * (aIdx === 0 ? 6 : 1)
|
||||||
})
|
})
|
||||||
ret[idx] = totalMark
|
ret[idx] = totalMark
|
||||||
ret['m' + idx] = mMark
|
ret['m' + idx] = mMark
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
},
|
},
|
||||||
getMaxAttr (charAttr = {}, list2 = [], maxLen = 1, banAttr = '') {
|
getMaxAttr (attrs = {}, list2 = [], maxLen = 1, banAttr = '') {
|
||||||
let tmp = []
|
let tmp = []
|
||||||
lodash.forEach(list2, (attr) => {
|
lodash.forEach(list2, (attr) => {
|
||||||
if (attr === banAttr) return
|
if (attr === banAttr) return
|
||||||
if (!charAttr[attr]) return
|
if (!attrs[attr]) return
|
||||||
tmp.push({ attr, mark: charAttr[attr] })
|
tmp.push({ attr, mark: attrs[attr].fixWeight })
|
||||||
})
|
})
|
||||||
tmp = lodash.sortBy(tmp, 'mark')
|
tmp = lodash.sortBy(tmp, 'mark')
|
||||||
tmp = tmp.reverse()
|
tmp = tmp.reverse()
|
||||||
|
@ -20,8 +20,16 @@ async function init () {
|
|||||||
|
|
||||||
await init()
|
await init()
|
||||||
const CharArtis = {
|
const CharArtis = {
|
||||||
|
reduceWeight (weight, key, plus, max) {
|
||||||
|
let original = weight[key] || 0
|
||||||
|
if (original < max) {
|
||||||
|
weight[key] = Math.max(original + plus, max)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
getCharArtisCfg (char, profile, artis) {
|
getCharArtisCfg (char, profile, artis) {
|
||||||
let { attr } = profile
|
let { attr, weapon } = profile
|
||||||
|
|
||||||
let rule = function (title, attrWeight) {
|
let rule = function (title, attrWeight) {
|
||||||
return {
|
return {
|
||||||
@ -31,12 +39,55 @@ const CharArtis = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let def = function (attrWeight) {
|
let def = function (attrWeight) {
|
||||||
let title = '通用'
|
let title = []
|
||||||
let weight = attrWeight || usefulAttr[char.name] || { atk: 75, cp: 100, cd: 100 }
|
let weight = attrWeight || usefulAttr[char.name] || { atk: 75, cp: 100, cd: 100 }
|
||||||
if (artis.is('绝缘4') && weight.recharge < 75) {
|
let check = (key, max = 75, maxPlus = 75, isWeapon = true) => {
|
||||||
weight.recharge = 75
|
let original = weight[key] || 0
|
||||||
title = '绝缘4'
|
if (original < max) {
|
||||||
|
let plus = isWeapon ? maxPlus * (1 + weapon.affix / 5) / 2 : maxPlus
|
||||||
|
weight[key] = Math.min(Math.round(original + plus), max)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
let wn = weapon.name
|
||||||
|
|
||||||
|
// 增加攻击力或直接伤害类武器判定
|
||||||
|
const weaponCfg = {
|
||||||
|
磐岩结绿: {
|
||||||
|
attr: 'hp',
|
||||||
|
abbr: '绿剑'
|
||||||
|
},
|
||||||
|
赤角石溃杵: {
|
||||||
|
attr: 'def',
|
||||||
|
abbr: '赤角'
|
||||||
|
},
|
||||||
|
猎人之径: {
|
||||||
|
attr: 'mastery'
|
||||||
|
},
|
||||||
|
薙草之稻光: {
|
||||||
|
attr: 'recharge',
|
||||||
|
abbr: '薙刀'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (weight.atk > 0 && weaponCfg[wn]) {
|
||||||
|
let wCfg = weaponCfg[wn]
|
||||||
|
if (check(wCfg.attr, wCfg.max || 75, wCfg.plus || 75)) {
|
||||||
|
title.push(wCfg.abbr || wn)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不与攻击力挂钩的武器判定
|
||||||
|
if (wn === '辰砂之纺锤' && check('def')) {
|
||||||
|
title.push('纺锤')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 圣遗物判定
|
||||||
|
if (artis.is('绝缘4') && check('recharge', 75, 45, false)) {
|
||||||
|
title.push('绝缘4')
|
||||||
|
}
|
||||||
|
|
||||||
|
title = title.length > 0 ? title.join('') : '通用'
|
||||||
return {
|
return {
|
||||||
title: `${char.abbr}-${title}`,
|
title: `${char.abbr}-${title}`,
|
||||||
attrWeight: weight
|
attrWeight: weight
|
||||||
@ -48,7 +99,7 @@ const CharArtis = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (charRule) {
|
if (charRule) {
|
||||||
return charRule({ attr, artis, rule, def, weapon: profile.weapon, cons: profile.cons })
|
return charRule({ attr, artis, rule, def, weapon, cons: profile.cons })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
export default function ({ attr, rule, def }) {
|
export default function ({ attr, rule, def }) {
|
||||||
// 优菈核爆
|
// 优菈核爆
|
||||||
if (attr.cpct < 30 && attr.cdmg > 150) {
|
if (attr.cpct < 15 && attr.cdmg > 200) {
|
||||||
return rule('优菈-核爆', { atk: 100, cd: 100, phy: 100 })
|
return rule('优菈-核爆', { atk: 100, cd: 100, phy: 100 })
|
||||||
}
|
}
|
||||||
return def({ atk: 75, cp: 100, cd: 100, phy: 100, recharge: 55 })
|
return def({ atk: 75, cp: 100, cd: 100, phy: 100, recharge: 55 })
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
export default function ({ attr, weapon, rule, def }) {
|
export default function ({ attr, weapon, rule, def }) {
|
||||||
// 蒸发可莉,具体数值待定
|
if (attr.mastery < 50 && attr.cp * 2 + attr.cd > 320) {
|
||||||
if (attr.mastery < 80) {
|
return rule('可莉-纯火', { atk: 85, cp: 100, cd: 100, dmg: 100, recharge: 55 })
|
||||||
return rule('可莉-纯火', { atk: 75, cp: 100, cd: 100, dmg: 100, recharge: 30 })
|
|
||||||
}
|
}
|
||||||
return def({ atk: 75, cp: 100, cd: 100, mastery: 75, dmg: 100, recharge: 30 })
|
return def({ atk: 75, cp: 100, cd: 100, mastery: 75, dmg: 100, recharge: 30 })
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
export default function ({ attr, rule, def }) {
|
export default function ({ attr, artis, rule, def }) {
|
||||||
// 宵宫纯色流派
|
// 宵宫纯色流派
|
||||||
if (attr.mastery < 80) {
|
if (attr.mastery < 50 && attr.cp * 2 + attr.cd > 320) {
|
||||||
return rule('宵宫-纯色', { atk: 75, cp: 100, cd: 100, dmg: 100 })
|
return rule('宵宫-纯火', { atk: 85, cp: 100, cd: 100, dmg: 100 })
|
||||||
}
|
}
|
||||||
if (attr.mastery > 200) {
|
if (attr.mastery > 200 && artis.is('mastery', 3)) {
|
||||||
return rule('宵宫-精通', { atk: 75, cp: 100, cd: 100, mastery: 100, dmg: 100 })
|
return rule('宵宫-精通', { atk: 75, cp: 100, cd: 100, mastery: 100, dmg: 100 })
|
||||||
}
|
}
|
||||||
return def({ atk: 75, cp: 100, cd: 100, mastery: 75, dmg: 100 })
|
return def({ atk: 75, cp: 100, cd: 100, mastery: 75, dmg: 100 })
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export default function ({ artis, rule, def }) {
|
export default function ({ artis, rule, def }) {
|
||||||
if (artis.is('冰套4')) {
|
if (artis.is('冰套4')) {
|
||||||
return rule('甘雨-永冻', { atk: 75, cp: 100, cd: 100, dmg: 100, recharge: 75 })
|
return rule('甘雨-永冻', { atk: 75, cp: 100, cd: 100, dmg: 100, recharge: 55 })
|
||||||
}
|
}
|
||||||
return def({ atk: 75, cp: 100, cd: 100, mastery: 75, dmg: 100 })
|
return def({ atk: 75, cp: 100, cd: 100, mastery: 75, dmg: 100 })
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
export default function ({ attr, rule, def }) {
|
export default function ({ attr, rule, def }) {
|
||||||
// 核爆胡桃,具体数值待定
|
// 核爆胡桃
|
||||||
if (attr.cpct < 30 && attr.cdmg > 200) {
|
if (attr.cpct < 15 && attr.cdmg > 280) {
|
||||||
return rule('胡桃-核爆', { hp: 85, atk: 50, cd: 100, mastery: 85, dmg: 100 })
|
return rule('胡桃-核爆', { hp: 90, atk: 50, cd: 100, mastery: 90, dmg: 100 })
|
||||||
}
|
}
|
||||||
return def({ hp: 80, atk: 50, cp: 100, cd: 100, mastery: 75, dmg: 100 })
|
return def({ hp: 80, atk: 50, cp: 100, cd: 100, mastery: 75, dmg: 100 })
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,11 @@ export const attrValue = {
|
|||||||
}
|
}
|
||||||
export const attrMap = {
|
export const attrMap = {
|
||||||
atk: { title: '大攻击', format: 'pct', type: 'normal', value: 5.83, text: '5.83%' },
|
atk: { title: '大攻击', format: 'pct', type: 'normal', value: 5.83, text: '5.83%' },
|
||||||
atkPlus: { title: '小攻击', format: 'comma', type: 'plus' },
|
atkPlus: { title: '小攻击', format: 'comma', type: 'plus', base: 'atk', value: 15.56 },
|
||||||
def: { title: '大防御', format: 'pct', type: 'normal', value: 7.29, text: '7.29%' },
|
def: { title: '大防御', format: 'pct', type: 'normal', value: 7.29, text: '7.29%' },
|
||||||
defPlus: { title: '小防御', format: 'comma', type: 'plus' },
|
defPlus: { title: '小防御', format: 'comma', type: 'plus', base: 'def', value: 18.52 },
|
||||||
hp: { title: '大生命', format: 'pct', type: 'normal', value: 5.83, text: '5.83%' },
|
hp: { title: '大生命', format: 'pct', type: 'normal', value: 5.83, text: '5.83%' },
|
||||||
hpPlus: { title: '小生命', format: 'comma', type: 'plus' },
|
hpPlus: { title: '小生命', format: 'comma', type: 'plus', base: 'hp', value: 239.0 },
|
||||||
cp: { title: '暴击率', format: 'pct', type: 'normal', value: 3.89, text: '3.89%' },
|
cp: { title: '暴击率', format: 'pct', type: 'normal', value: 3.89, text: '3.89%' },
|
||||||
cd: { title: '暴击伤害', format: 'pct', type: 'normal', value: 7.77, text: '7.77%' },
|
cd: { title: '暴击伤害', format: 'pct', type: 'normal', value: 7.77, text: '7.77%' },
|
||||||
mastery: { title: '元素精通', format: 'comma', type: 'normal', value: 23.31, text: '23.31' },
|
mastery: { title: '元素精通', format: 'comma', type: 'normal', value: 23.31, text: '23.31' },
|
||||||
|
Loading…
Reference in New Issue
Block a user