面板圣遗物评分初步增加流派判定能力

其他一些已知Bug修复
This commit is contained in:
yoimiya-kokomi 2022-09-07 03:28:46 +08:00
parent f9e5240ecc
commit a977434ef3
21 changed files with 247 additions and 131 deletions

View File

@ -1,3 +1,10 @@
# 1.10.5
* 面板圣遗物评分初步增加流派判定能力
* 实验性,尚未完全稳定,可能会导致一些角色圣遗物评分变化
* 目前实验暴力芭芭拉、血牛钟离的判定
* 其他一些已知Bug修复
# 1.10.4
* 增加`#心海图鉴`功能,可查看突破材料及常用武器

View File

@ -53,7 +53,6 @@ class Mys {
e.reply = function (msg) {
if (!e._isReplyed) {
e._isReplyed = true
e.reply = e._original_reply
return e._original_reply(msg)
}
}

View File

@ -54,7 +54,7 @@ export async function renderProfile (e, char, mode = 'profile', params = {}) {
dmg: p(Math.max(a.dmg * 1 || 0, a.phy * 1 || 0))
}
let { artis, mark: totalMark, markClass: totalMarkClass, usefulMark } = profile.getArtisMark()
let { artis, mark: totalMark, markClass: totalMarkClass, usefulMark, classTitle } = profile.getArtisMark()
let enemyLv = await selfUser.getCfg('char.enemyLv', 91)
let dmgMsg = []
@ -109,6 +109,7 @@ export async function renderProfile (e, char, mode = 'profile', params = {}) {
enemyName: dmgCalc.enemyName || '小宝',
totalMark: c(totalMark, 1),
totalMarkClass,
classTitle,
usefulMark,
talentMap: { a: '普攻', e: '战技', q: '爆发' },
bodyClass: `char-${char.name}${costume}`,

View File

@ -5,6 +5,7 @@ import CharImg from './character-lib/CharImg.js'
import CharTalent from './character-lib/CharTalent.js'
import CharId from './character-lib/CharId.js'
import CharMeta from './character-lib/CharMeta.js'
import CharArtis from './character-lib/CharArtis.js'
let { abbrMap, wifeMap, idSort } = CharId
@ -210,6 +211,10 @@ class Character extends Base {
}
return await this.getTraveler(uid)
}
getArtisMarkCfg (profile, artis) {
return CharArtis.getCharArtisCfg(this, profile, artis)
}
}
let getMeta = function (name) {

View File

@ -6,9 +6,7 @@ import Base from './Base.js'
import { Artifact, Character } from './index.js'
import { Format } from '../components/index.js'
import ArtisMark from './profile-lib/ArtisMark.js'
import { attrMap, attrValue, usefulAttr } from '../resources/meta/reliquaries/artis-mark.js'
let charCfg = {}
import { attrMap, attrNameMap, attrValue } from '../resources/meta/reliquaries/artis-mark.js'
export default class ProfileArtis extends Base {
constructor (charid = 0, ds = false) {
@ -20,6 +18,11 @@ export default class ProfileArtis extends Base {
}
}
setProfile (profile, artis) {
this.profile = profile
this.setArtisSet(artis)
}
setArtisSet (ds) {
for (let key in ds) {
this.setArtis(key, ds[key] || {})
@ -78,6 +81,93 @@ export default class ProfileArtis extends Base {
return this.getData('1,2,3,4,5')
}
get sets () {
return this.getSetData().sets
}
get names () {
return this.getSetData().names
}
mainAttr (idx) {
let main = this.artis[idx]?.main
if (!main) {
return ''
}
let title = main.title
if (/元素伤害/.test(title)) {
return 'dmg'
}
if (attrNameMap[main.title]) {
return attrNameMap[main.title]
} else {
console.log(main.title)
}
return ''
}
getSetData () {
let setCount = {}
this.forEach((arti, idx) => {
setCount[arti.set] = (setCount[arti.set] || 0) + 1
})
let sets = {}
let names = []
for (let set in setCount) {
if (setCount[set] >= 2) {
sets[set] = setCount[set] >= 4 ? 4 : 2
names.push(Artifact.getArtiBySet(set))
}
}
return { sets, names }
}
getCharCfg () {
let char = Character.get(this.charid)
let { attrWeight, title } = char.getArtisMarkCfg(this.profile, this)
let attrMark = {}
let baseAttr = char.baseAttr || { hp: 14000, atk: 230, def: 700 }
lodash.forEach(attrWeight, (weight, attr) => {
attrMark[attr] = weight / attrValue[attr]
})
// let baseAttr = [400, 500, 300];
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
titleWeight[aTitle] = attrWeight[attr] || 0
if (/大/.test(aTitle)) {
let sTitle = aTitle.replace('大', '小')
titleWeight[sTitle] = titleWeight[aTitle]
}
})
return {
classTitle: title,
weight: attrWeight,
mark: attrMark,
titleMap: titleMark,
titleWeight,
maxMark
}
}
getMarkDetail (withDetail = true) {
let charCfg = this.getCharCfg()
let artis = {}
@ -115,91 +205,20 @@ export default class ProfileArtis extends Base {
names.push(Artifact.getArtiBySet(set))
}
}
this.mark = totalMark
this.markClass = ArtisMark.getMarkClass(totalMark / 5)
let ret = {
mark: Format.comma(totalMark, 1),
_mark: totalMark,
markClass: ArtisMark.getMarkClass(totalMark / 5),
artis,
sets,
names
names,
classTitle: charCfg.classTitle
}
if (withDetail) {
ret.usefulMark = usefulMark
}
return ret
}
getSetData () {
let setCount = {}
this.forEach((arti, idx) => {
setCount[arti.set] = (setCount[arti.set] || 0) + 1
})
let sets = {}
let names = []
for (let set in setCount) {
if (setCount[set] >= 2) {
sets[set] = setCount[set] >= 4 ? 4 : 2
names.push(Artifact.getArtiBySet(set))
}
}
return { sets, names }
}
get sets () {
return this.getSetData().sets
}
get names () {
return this.getSetData().names
}
getCharCfg () {
let char = Character.get(this.charid)
let name = char.name
if (charCfg[name]) {
return charCfg[name]
}
let attrWeight = usefulAttr[name] || { atk: 75, cp: 100, cd: 100 }
let attrMark = {}
let baseAttr = char.baseAttr || { hp: 14000, atk: 230, def: 700 }
lodash.forEach(attrWeight, (weight, attr) => {
attrMark[attr] = weight / attrValue[attr]
})
// let baseAttr = [400, 500, 300];
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
titleWeight[aTitle] = attrWeight[attr] || 0
if (/大/.test(aTitle)) {
let sTitle = aTitle.replace('大', '小')
titleWeight[sTitle] = titleWeight[aTitle]
}
})
charCfg[name] = {
weight: attrWeight,
mark: attrMark,
titleMap: titleMark,
titleWeight,
maxMark
}
return charCfg[name]
}
}

View File

@ -17,9 +17,9 @@ export default class ProfileData extends Base {
this.setBasic(ds)
ds.attr && this.setAttr(ds.attr)
ds.weapon && this.setWeapon(ds.weapon)
ds.talent && this.setTalent(ds.talent)
this.artis = new ProfileArtis(this.id)
ds.artis && this.setArtis(ds.artis)
ds.talent && this.setTalent(ds.talent)
}
setBasic (ds = {}) {
@ -54,7 +54,7 @@ export default class ProfileData extends Base {
setArtis (ds = false) {
if (ds) {
this.artis.setArtisSet(ds)
this.artis.setProfile(this, ds)
}
}
@ -96,8 +96,10 @@ export default class ProfileData extends Base {
// 10000033: 900001, // 公子
10000052: 900002 // 雷神
}
if (cMap[this.id] && this.cons === 6) {
return cMap[this.id]
if (cMap[this.id]) {
if (this.cons === 6 || ['ACE', 'ACE²'].includes(this.artis?.markClass)) {
return cMap[this.id]
}
}
return this._costume
}

View File

@ -0,0 +1,50 @@
import { usefulAttr } from '../../resources/meta/reliquaries/artis-mark.js'
const CharArtis = {
getCharArtisCfg (char, profile, artis) {
let { attr, weapon } = profile
let cn = '通用'
let check = true
// 实验性实现,后期逐步迁移至配置文件
switch (char.name) {
case '芭芭拉':
if (attr.cpct * 2 + attr.cdmg >= 180 && artis.mainAttr(4) === 'dmg') {
cn = '暴力'
}
break
case '钟离':
for (let idx = 3; idx <= 5; idx++) {
check = check && (artis.mainAttr(idx) === '大生命')
}
if (check) {
cn = '血牛'
}
break
case '雷电将军':
if (weapon.name === '薙草之稻光' && weapon.affix >= 3) {
cn = '高精'
}
break
}
if (cn !== '通用' && usefulAttr[`${char.name}-${cn}`]) {
return {
title: `${char.abbr}-${cn}`,
attrWeight: usefulAttr[`${char.name}-${cn}`]
}
} else {
let artisSet = artis.getSetData()?.sets || {}
let weight = usefulAttr[char.name] || { atk: 75, cp: 100, cd: 100 }
if (artisSet['绝缘之旗印'] === 4 && weight.recharge < 75) {
weight.recharge = 75
cn = '绝缘4'
}
return {
title: `${char.abbr}-${cn}`,
attrWeight: weight
}
}
}
}
export default CharArtis

View File

@ -20,8 +20,11 @@
<span class="cons cons-{{data.cons}}">{{data.cons}}命</span></div>
<div class="cont">
<div class="item arti-stat">
<div><strong class="mark-{{totalMarkClass}}">{{totalMarkClass}}</strong><span>圣遗物评级</span></div>
<div><strong>{{totalMark}}</strong><span>圣遗物总分</span></div>
<div class="arti-class-title">评分规则:{{charCfg.classTitle}}</div>
<div class="arti-stat-ret">
<div><strong class="mark-{{totalMarkClass}}">{{totalMarkClass}}</strong><span>圣遗物评级</span></div>
<div><strong>{{totalMark}}</strong><span>圣遗物总分</span></div>
</div>
</div>
</div>
</div>
@ -96,7 +99,7 @@
<!-- 词条规则 -->
<div class="cont">
<div class="cont-title">
{{data.name}}评分规则 - 通用
{{data.name}}评分规则: {{charCfg.classTitle}}
</div>
<div class="cont-table mark-table">
<div class="tr thead">

View File

@ -598,25 +598,35 @@ body {
box-shadow: 0 0 4px 0 #deaf39 inset;
background: #fff6dd;
}
.artis .arti-stat {
.artis .artis-stat {
height: 85px;
}
.arti-stat {
height: 90px;
margin-top: 10px;
padding: 13px 10px;
.arti-class-title {
height: 25px;
line-height: 20px;
font-size: 12px;
color: #fff;
padding: 5px 10px 0;
text-align: center;
color: rgba(255, 255, 255, 0.9);
text-shadow: 0 0 2px #000;
}
.arti-stat-ret {
height: 55px;
padding: 0 10px 5px;
width: 100%;
display: table;
}
.arti-stat > div {
.arti-stat-ret > div {
display: table-cell;
text-align: center;
color: #fff;
}
.arti-stat strong {
.arti-stat-ret strong {
display: block;
height: 40px;
height: 35px;
font-size: 30px;
line-height: 40px;
line-height: 35px;
}
.dmg-msg {
font-size: 13px;

View File

@ -75,8 +75,11 @@
</div>
</div>
<div class="item arti-stat">
<div><strong class="mark-{{totalMarkClass}}">{{totalMarkClass}}</strong><span>圣遗物评级</span></div>
<div><strong>{{totalMark}}</strong><span>圣遗物总分</span></div>
<div class="arti-class-title">评分规则:{{classTitle}}</div>
<div class="arti-stat-ret">
<div><strong class="mark-{{totalMarkClass}}">{{totalMarkClass}}</strong><span>圣遗物评级</span></div>
<div><strong>{{totalMark}}</strong><span>圣遗物总分</span></div>
</div>
</div>
</div>
{{each artis ds idx}}

View File

@ -740,14 +740,25 @@ body {
background: #fff6dd;
}
.artis .arti-stat {
.artis .artis-stat {
height: 85px;
}
.arti-stat {
height: 90px;
margin-top: 10px;
padding: 13px 10px;
.arti-class-title {
height: 25px;
line-height: 20px;
font-size: 12px;
color: #fff;
padding: 5px 10px 0;
text-align: center;
color: rgba(255, 255, 255, .9);
text-shadow: 0 0 2px #000;
}
.arti-stat-ret {
height: 55px;
padding: 0 10px 5px;
width: 100%;
display: table;
& > div {
@ -758,9 +769,9 @@ body {
strong {
display: block;
height: 40px;
height: 35px;
font-size: 30px;
line-height: 40px;
line-height: 35px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -23,12 +23,12 @@ export const buffs = [{
check: ({ cons }) => cons < 2,
title: '4层浪闪提高瞬水剑伤害[aPlus]',
data: {
aPlus: ({ attr, calc, talent }) => calc(attr.hp) * talent.e['浪闪伤害值提高'][0] / 100 * 4
aPlus: ({ attr, calc, talent }) => calc(attr.hp) * talent.e['浪闪伤害值提高'] / 100 * 4
}
}, {
cons: 2,
title: '绫人2命5层浪闪提高瞬水剑伤害[aPlus]',
data: {
aPlus: ({ attr, calc, talent }) => calc(attr.hp) * talent.e['浪闪伤害值提高'][0] / 100 * 5
aPlus: ({ attr, calc, talent }) => calc(attr.hp) * talent.e['浪闪伤害值提高'] / 100 * 5
}
}, 'zf']

View File

@ -6,7 +6,7 @@ export const details = [{
title: '满层勠心拳伤害',
params: { e: 4 },
dmg: ({ talent }, dmg) => {
return dmg(talent.e['技能伤害'] * 1 + talent.e['变格伤害提升'][0] * 4 + talent.e['正论伤害提升'] * 1, 'e')
return dmg(talent.e['技能伤害'] * 1 + talent.e['变格伤害提升'] * 4 + talent.e['正论伤害提升'] * 1, 'e')
}
}, {
title: 'Q真空弹伤害',

View File

@ -252,24 +252,24 @@
},
{
"name": "变格伤害提升",
"unit": "",
"unit": " / 层",
"isSame": false,
"values": [
"56.88% / 层",
"61.15% / 层",
"65.41% / 层",
"71.1% / 层",
"75.37% / 层",
"79.63% / 层",
"85.32% / 层",
"91.01% / 层",
"96.7% / 层",
"102.38% / 层",
"108.07% / 层",
"113.76% / 层",
"120.87% / 层",
"127.98% / 层",
"135.09% / 层"
"56.88%",
"61.15%",
"65.41%",
"71.1%",
"75.37%",
"79.63%",
"85.32%",
"91.01%",
"96.7%",
"102.38%",
"108.07%",
"113.76%",
"120.87%",
"127.98%",
"135.09%"
]
},
{

View File

@ -51,9 +51,10 @@ export const usefulAttr = {
班尼特: { hp: 100, atk: 50, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 80, phy: 0, recharge: 55, heal: 100 },
枫原万叶: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 100, dmg: 100, phy: 0, recharge: 55, heal: 0 },
雷电将军: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 75, phy: 0, recharge: 90, heal: 0 },
'雷电将军-高精': { hp: 0, atk: 90, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 90, phy: 0, recharge: 90, heal: 0 },
行秋: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 75, heal: 0 },
钟离: { hp: 80, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 50, recharge: 55, heal: 0 },
'钟离-血牛': { hp: 100, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 75, phy: 0, recharge: 55, heal: 0 },
'钟离-血牛': { hp: 100, atk: 50, def: 0, cp: 50, cd: 50, mastery: 0, dmg: 0, phy: 0, recharge: 50, heal: 0 },
神里绫华: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 30, heal: 0 },
香菱: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 },
胡桃: { hp: 80, atk: 50, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
@ -79,7 +80,7 @@ export const usefulAttr = {
托马: { hp: 100, atk: 50, def: 0, cp: 50, cd: 50, mastery: 0, dmg: 75, phy: 0, recharge: 90, heal: 0 },
迪卢克: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
芭芭拉: { hp: 100, atk: 50, def: 0, cp: 50, cd: 50, mastery: 0, dmg: 80, phy: 0, recharge: 55, heal: 100 },
'芭芭拉-暴力': { hp: 50, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 50 },
'芭芭拉-暴力': { hp: 50, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 30, heal: 50 },
诺艾尔: { hp: 0, atk: 50, def: 90, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 70, heal: 0 },
旅行者: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 55, heal: 0 },
重云: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 },
@ -98,4 +99,6 @@ export const usefulAttr = {
鹿野院平藏: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 30, heal: 0 },
提纳里: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 90, dmg: 100, phy: 0, recharge: 30, heal: 0 },
柯莱: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 30, heal: 0 },
: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 },
: { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 }
}

View File

@ -114,7 +114,7 @@ body {
font-weight: normal;
}
.cont .cont-title.border-less {
padding: 10px 10px 3px;
padding: 10px 15px 3px;
}
.talent-cont {
text-align: center;

View File

@ -54,7 +54,7 @@
{{/each}}
</div>
</div>
<div class="talent-notice">输入<strong>#{{data.abbr}}天赋、#{{data.abbr}}命座</strong>可查看详细天赋/命座信息</div>
{{if holding.num}}
{{set cNum ='零一二三四五满'.split('')}}
<div class="cont cont-bg">
@ -69,6 +69,8 @@
<div class="talent-icon">
{{if cons.cons > 0}}
<div class="talent-icon-img" style="background-image:url({{_res_path}}{{imgs[`cons${cons.cons}`]}})"></div>
{{else}}
<div class="talent-icon-img" style="background-image:url({{_res_path}}common/item/cons0.webp)"></div>
{{/if}}
</div>
<div class="cons-num">{{cons.num}}</div>
@ -80,6 +82,7 @@
</div>
{{/if}}
<div class="talent-notice">输入<strong>#{{data.abbr}}天赋、#{{data.abbr}}命座</strong>可查看详细天赋/命座信息</div>
{{if weapons.length >0}}
<div class="cont">

View File

@ -148,7 +148,7 @@ body {
}
.cont .cont-title.border-less {
padding: 10px 10px 3px;
padding: 10px 15px 3px;
}
.talent-cont {

View File

@ -251,4 +251,4 @@ const charData = {
71: { key: 'cyno', name: '赛诺' },
72: { key: 'candace', name: '坎蒂丝' }
}
await down('雷电将军,达达利亚', true)
await down('鹿野院平藏', true)

View File

@ -202,7 +202,7 @@ const CharData = {
if (i > 0 && values[0] !== val) {
isSame = false
}
let ur = /^(.*)(生命值上限|防御力|最大生命值|攻击力|生命值上限 \/ 层|当前生命值)(\s*\*\s*\d)?$/.exec(val)
let ur = /^(.*)(生命值上限|防御力|最大生命值|攻击力|生命值上限 \/ 层|当前生命值| \/ 层)(\s*\*\s*\d)?$/.exec(val)
if (ur && ur[1] && ur[2]) {
values2.push(ur[1] + (ur[3] || ''))
unit = ur[2]