miao-plugin/models/artis/ArtisMarkCfg.js
jkl8753 d614f9629e
添加和修改神里绫华、钟离、希诺宁的评分规则。修改有关武器类的圣遗物默认权重。 (#809)
* 敌人默认等级,从91提高至103(配合世界等级9).

* 降低夏沃蕾和闲云的治疗权重(防止分数溢出)。
新增希诺宁的评分权重。

* 添加希格雯满命情况下的评分权重。
优化芙宁娜满命情况下的评分权重部分的代码。

* 添加和修改神里绫华、钟离、希诺宁的特殊评分规则

* 修改钟离、神里绫华、香菱的默认评分规则
绫华的充能权重,从 30 提升至 45.
香菱的充能权重,从 55 提升至 75.
钟离的默认评分规则,改成“血牛”性质(原先钟离的默认评分规则为“战斗”性质,代码移动至特殊评分规则里)。

* 修改有关武器类的圣遗物默认权重
删除赤角石溃杵、辰砂之纺锤两把武器的权重。
将护摩之杖的权重,从原先的45-75,调整为10-18.
将磐岩结绿的权重,从原先的45-75,调整为15-30.
2024-10-10 17:52:47 +08:00

139 lines
3.9 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import lodash from 'lodash'
import ArtisMark from './ArtisMark.js'
import { Meta } from '#miao'
const weaponCfg = {
磐岩结绿: {
attr: 'hp',
abbr: '绿剑',
max: 30,
min: 15
},
猎人之径: {
attr: 'mastery'
},
薙草之稻光: {
attr: 'recharge',
abbr: '薙刀'
},
护摩之杖: {
attr: 'hp',
abbr: '护摩',
max: 18,
min: 10
}
}
const ArtisMarkCfg = {
getCharArtisCfg (profile) {
let { attr, weapon, elem, char, artis, game } = profile
let { isGs } = char
let { usefulAttr } = Meta.getMeta(game, 'arti')
let rule = function (title, attrWeight) {
return {
title,
attrWeight
}
}
let def = function (attrWeight) {
let title = []
let weight = lodash.extend({}, attrWeight || usefulAttr[char.name] || {})
let check = (key, max = 75, maxPlus = 75, isWeapon = true) => {
let original = weight[key] || 0
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
}
/* maxAffix_attr 精5武器权重
minAffix_attr 精1武器权重 */
let weaponCheck = (key, maxAffix_attr = 20, minAffix_attr = 10, max = 100) => {
let original = weight[key] || 0
if (original == max) {
return false
} else {
let plus = minAffix_attr + (maxAffix_attr - minAffix_attr) * (weapon.affix - 1) / 4
weight[key] = Math.min(Math.round(original + plus), max)
return true
}
}
let wn = weapon?.name || ''
if (isGs) {
// 对原神一些特殊情况做适配与判定
// 增加攻击力或直接伤害类武器判定
if (weight.atk > 0 && weaponCfg[wn]) {
let wCfg = weaponCfg[wn]
if (weaponCheck(wCfg.attr, wCfg.max || 20, wCfg.min || 10)) {
title.push(wCfg.abbr || wn)
}
}
// 圣遗物判定如果是绝缘4将充能权重拉高至沙漏圣遗物当前最高权重齐平
let maxWeight = Math.max(weight.atk || 0, weight.hp || 0, weight.def || 0, weight.mastery || 0)
if (artis.is('绝缘4') && check('recharge', maxWeight, 75, false)) {
title.push('绝缘4')
}
}
title = title.length > 0 ? title.join('') : '通用'
return {
title: `${char.abbr}-${title}`,
attrWeight: weight
}
}
let charRule = char.getArtisCfg() || function ({ def }) {
let defaultAttrWeight = isGs ? { atk: 75, cpct: 100, cdmg: 100, dmg: 100, phy: 100 } : { atk: 75, cpct: 100, cdmg: 100, dmg: 100, speed: 100 }
return def(usefulAttr[char.name] || defaultAttrWeight)
}
if (charRule) {
return charRule({ attr, elem, artis, rule, def, weapon, cons: profile.cons })
}
},
getCfg (profile) {
let { char } = profile
let { game } = char
let { attrWeight, title } = ArtisMarkCfg.getCharArtisCfg(profile)
let attrs = {}
let baseAttr = char.baseAttr || { hp: 14000, atk: 230, def: 700 }
let { attrMap } = Meta.getMeta(game, 'arti')
lodash.forEach(attrMap, (attr, key) => {
let k = attr.base || ''
let weight = attrWeight[k || key]
if (!weight || weight * 1 === 0) {
return true
}
let ret = {
...attr, weight, fixWeight: weight, mark: weight / attr.value
}
if (!k) {
ret.mark = weight / attr.value
} else {
let plus = k === 'atk' ? 520 : 0
ret.mark = weight / attrMap[k].value / (baseAttr[k] + plus) * 100
ret.fixWeight = weight * attr.value / attrMap[k].value / (baseAttr[k] + plus) * 100
}
attrs[key] = ret
})
let posMaxMark = ArtisMark.getMaxMark(attrs, game)
// 返回内容待梳理简化
return {
attrs,
classTitle: title,
posMaxMark
}
}
}
export default ArtisMarkCfg