From 02637ece3f58ec86eb3bbb36a1fd36aacca46d15 Mon Sep 17 00:00:00 2001 From: Kokomi <102026640+yoimiya-kokomi@users.noreply.github.com> Date: Tue, 30 May 2023 03:42:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E9=93=81=E9=9D=A2=E6=9D=BF=E5=88=9D?= =?UTF-8?q?=E6=AD=A5=E5=B1=95=E7=A4=BA=E5=9C=A3=E9=81=97=E7=89=A9=E8=AF=84?= =?UTF-8?q?=E5=88=86=E5=8F=8A=E8=AF=8D=E6=9D=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 25 +++++--- apps/profile/ProfileArtis.js | 2 + models/Artifact.js | 5 +- models/ProfileArtis.js | 11 ++-- models/profile/ArtisMark.js | 44 ++++++++------ models/profile/CharArtis.js | 77 ++++++++++++++---------- models/profile/DmgBuffs.js | 1 + resources/character/artis-mark.html | 19 ++++-- resources/character/profile-detail.html | 2 +- resources/meta-sr/artifact/artis-mark.js | 30 +++++++++ resources/meta-sr/artifact/meta.js | 10 +-- 11 files changed, 148 insertions(+), 78 deletions(-) create mode 100644 resources/meta-sr/artifact/artis-mark.js diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d9bfb8..55e56041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,19 @@ -# 2.4.0 +# 2.4.2 + +* 星铁面板展示圣遗物评分,评分功能尚未完全完成,分值与样式不为最终版本 +* 一些已知问题修复 + +# 2.4.1 * 初步支持星铁面板数据获取与展示 * 可使用`#星铁更新面板`来获取面板信息,通过`#希儿面板`来进行查看 * 部分角色的伤害计算,以及圣遗物评分功能仍在补全中 - * 使用Miao-Yunzai可使用`*`来代填`#星铁`前缀,并能区分游戏使用不同UID,目前仍在Dev版本,请等待后续更新 +* 请配合使用Miao-Yunzai 3.1.0可达到最佳效果 + * Miao-Yunzai可使用`*`来代填`#星铁`前缀,能区分游戏使用不同UID + * 其他Yunzai版本出现原神与星铁UID混淆情况为正常情况,请手动切换UID或命令后附加UID查询 +* 停用旧面板格式数据,非AttrIDs格式的数据不会展示,部分角色面板数据不展示是正常情况,重新更新面板数据即可 -# 2.3.8 - -* 面板服务增加由**Snap Hutao**提供的Enka转发代理,可通过`#喵喵设置面板服务4`进行选择 -* 面板详情的圣遗物词条增加词条数展示 -* 角色面板使用平均词条值作为词条数计算基础 -* 部分角色资源文件结构调整 - -# 2.3.1~2.3.7 +# 2.4.0 * 增加`#角色记录``#抽卡统计`功能,可在`#喵喵设置`中开启 * `#角色记录`、`#武器记录`、`#常驻记录` 可查看对应池子的抽卡记录 @@ -35,6 +36,10 @@ * 圣遗物评级的分数上限微调 * 增加3.6新圣遗物数据及资源 * 增加绮良良的角色信息,可通过`#绮良良天赋`、`#绮良良图鉴`等查看 +* 面板服务增加由**Snap Hutao**提供的Enka转发代理,可通过`#喵喵设置面板服务4`进行选择 +* 面板详情的圣遗物词条增加词条数展示 +* 角色面板使用平均词条值作为词条数计算基础 +* 部分角色资源文件结构调整 # 2.3.0 diff --git a/apps/profile/ProfileArtis.js b/apps/profile/ProfileArtis.js index bc71e5ad..94838778 100644 --- a/apps/profile/ProfileArtis.js +++ b/apps/profile/ProfileArtis.js @@ -21,6 +21,7 @@ export async function profileArtis (e) { return true } let char = profile.char + let { game } = char let charCfg = profile.artis.getCharCfg() let { attrMap } = Artifact.getMeta() @@ -39,6 +40,7 @@ export async function profileArtis (e) { artisKeyTitle, attrMap, charCfg, + game, changeProfile: e._profileMsg }, { e, scale: 1.3 }) } diff --git a/models/Artifact.js b/models/Artifact.js index 6b8eb2a1..2b223563 100644 --- a/models/Artifact.js +++ b/models/Artifact.js @@ -138,10 +138,13 @@ class Artifact extends Base { console.log('not found attr', ds, _ds) return true } + let value = attrCfg?.base * ds.count + attrCfg.step * ds.step attrs.push({ ...ds, key: attrCfg?.key, - value: attrCfg?.base * ds.count + attrCfg.step * ds.step + upNum: ds.count, + eff: value / (attrCfg.base + attrCfg.step * 2), + value }) }) return { diff --git a/models/ProfileArtis.js b/models/ProfileArtis.js index 407a42d3..65978396 100644 --- a/models/ProfileArtis.js +++ b/models/ProfileArtis.js @@ -6,7 +6,8 @@ import AvatarArtis from './AvatarArtis.js' import { Artifact, ArtifactSet, Character } from './index.js' import { Format } from '../components/index.js' import ArtisMark from './profile/ArtisMark.js' -import { attrMap } from '../resources/meta/artifact/index.js' +import { attrMap as attrMapGS } from '../resources/meta/artifact/index.js' +import { attrMap as attrMapSR } from '../resources/meta-sr/artifact/index.js' import CharArtis from './profile/CharArtis.js' export default class ProfileArtis extends AvatarArtis { @@ -29,9 +30,11 @@ export default class ProfileArtis extends AvatarArtis { */ getCharCfg () { let char = Character.get(this.charid) + let { game, isGs } = char let { attrWeight, title } = CharArtis.getCharArtisCfg(char, this.profile, this) let attrs = {} let baseAttr = char.baseAttr || { hp: 14000, atk: 230, def: 700 } + let attrMap = isGs ? attrMapGS : attrMapSR lodash.forEach(attrMap, (attr, key) => { let k = attr.base || '' let weight = attrWeight[k || key] @@ -53,7 +56,7 @@ export default class ProfileArtis extends AvatarArtis { } attrs[key] = ret }) - let posMaxMark = ArtisMark.getMaxMark(attrs) + let posMaxMark = ArtisMark.getMaxMark(attrs, game) // 返回内容待梳理简化 return { attrs, @@ -116,10 +119,6 @@ export default class ProfileArtis extends AvatarArtis { let ret = { mark: Format.comma(totalMark, 1), _mark: totalMark, - /* crit: Format.comma(totalCrit, 1), - _crit: totalCrit, - valid: Format.comma(totalVaild, 1), - _valid: totalVaild, */ markClass: ArtisMark.getMarkClass(totalMark / 5), artis, sets, diff --git a/models/profile/ArtisMark.js b/models/profile/ArtisMark.js index 83ec144d..a3a85eb2 100644 --- a/models/profile/ArtisMark.js +++ b/models/profile/ArtisMark.js @@ -1,8 +1,15 @@ import lodash from 'lodash' import { Format } from '#miao' -import { attrNameMap, mainAttr, subAttr, attrMap } from '../../resources/meta/artifact/index.js' import { - attrMap as attrMapSR + attrNameMap, + mainAttr as mainAttrGS, + subAttr as subAttrGS, + attrMap as attrMapGS +} from '../../resources/meta/artifact/index.js' +import { + attrMap as attrMapSR, + mainAttr as mainAttrSR, + subAttr as subAttrSR } from '../../resources/meta-sr/artifact/meta.js' let ArtisMark = { @@ -14,12 +21,13 @@ let ArtisMark = { } else if (title === '物理伤害加成') { return 'phy' } - return (game === 'gs' ? attrNameMap : attrMap)[title] + return attrNameMap[title] || attrMapGS[title] }, getKeyTitleMap (game = 'gs') { let ret = {} - lodash.forEach(game === 'gs' ? attrMap : attrMapSR, (ds, key) => { + let attrMap = game === 'gs' ? attrMapGS : attrMapSR + lodash.forEach(attrMap, (ds, key) => { ret[key] = ds.title }) Format.eachElem((key, name) => { @@ -77,7 +85,7 @@ let ArtisMark = { if (!key || key === 'undefined') { return {} } - let arrCfg = (game === 'gs' ? attrMap : attrMapSR)[isDmg ? 'dmg' : key] + let arrCfg = (game === 'gs' ? attrMapGS : attrMapSR)[isDmg ? 'dmg' : key] val = Format[arrCfg?.format || 'comma'](val, 1) let ret = { key, @@ -95,7 +103,7 @@ let ArtisMark = { ret.mark = Format.comma(mark || 0) ret._mark = mark || 0 } - ret.eff = ret.eff ? Format.comma(ret.eff / 0.85, 1) : '-' + ret.eff = ret.eff ? Format.comma(ret.eff / (game === 'gs' ? 0.85 : 0.9), 1) : '-' return ret }, @@ -112,14 +120,11 @@ let ArtisMark = { // 获取位置分数 getMark ({ charCfg, idx, arti, elem = '', game = 'gs' }) { - if (game === 'sr') { - return 0 - } let ret = 0 - let mainAttr = arti.main - let subAttr = arti.attrs + let mAttr = arti.main + let sAttr = arti.attrs let { attrs, posMaxMark } = charCfg - let key = mainAttr?.key + let key = mAttr?.key if (!key) { return 0 } @@ -128,24 +133,27 @@ let ArtisMark = { if (idx >= 3) { let mainKey = key if (key !== 'recharge') { - if (idx === 4 && Format.isElem(key) && key === elem) { + let dmgIdx = { gs: 4, sr: 5 } + if (idx === dmgIdx[game] && Format.sameElem(elem, key, game)) { mainKey = 'dmg' } fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + idx]))) } - ret += (attrs[mainKey]?.mark || 0) * (mainAttr.value || 0) / 4 + ret += (attrs[mainKey]?.mark || 0) * (mAttr.value || 0) / 4 } - lodash.forEach(subAttr, (ds) => { + lodash.forEach(sAttr, (ds) => { ret += (attrs[ds.key]?.mark || 0) * (ds.value || 0) }) return ret * (1 + fixPct) / 2 / posMaxMark[idx] * 66 }, // 获取位置最高分 - getMaxMark (attrs) { + getMaxMark (attrs, game = 'gs') { let ret = {} - for (let idx = 1; idx <= 5; idx++) { + let mainAttr = game === 'gs' ? mainAttrGS : mainAttrSR + let subAttr = game === 'gs' ? subAttrGS : subAttrSR + for (let idx = 1; idx <= (game === 'gs' ? 5 : 6); idx++) { let totalMark = 0 let mMark = 0 let mAttr = '' @@ -184,7 +192,7 @@ let ArtisMark = { return ret.slice(0, maxLen) }, - hasAttr (artis) { + hasAttr (artis, game = 'gs') { for (let idx = 1; idx <= 5; idx++) { let ds = artis[idx] if (ds) { diff --git a/models/profile/CharArtis.js b/models/profile/CharArtis.js index 53e38d20..45f37d8a 100644 --- a/models/profile/CharArtis.js +++ b/models/profile/CharArtis.js @@ -1,10 +1,14 @@ -import { usefulAttr } from '../../resources/meta/artifact/artis-mark.js' +import { usefulAttr as usefulAttrGS } from '../../resources/meta/artifact/artis-mark.js' +import { usefulAttr as usefulAttrSR } from '../../resources/meta-sr/artifact/artis-mark.js' import lodash from 'lodash' const CharArtis = { getCharArtisCfg (char, profile, artis) { let { attr, weapon } = profile + let { isGs } = char + let usefulAttr = isGs ? usefulAttrGS : usefulAttrSR + let rule = function (title, attrWeight) { return { title, @@ -14,6 +18,7 @@ const CharArtis = { let def = function (attrWeight) { let title = [] + let weight = lodash.extend({}, attrWeight || usefulAttr[char.name] || { atk: 75, cpct: 100, cdmg: 100, dmg: 100 }) let check = (key, max = 75, maxPlus = 75, isWeapon = true) => { let original = weight[key] || 0 @@ -24,42 +29,48 @@ const CharArtis = { } 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 (isGs) { + // 对原神一些特殊情况做适配与判定 - // 不与攻击力挂钩的武器判定 - if (wn === '辰砂之纺锤' && check('def')) { - title.push('纺锤') - } + // 增加攻击力或直接伤害类武器判定 + const weaponCfg = { + 磐岩结绿: { + attr: 'hp', + abbr: '绿剑' + }, + 赤角石溃杵: { + attr: 'def', + abbr: '赤角' + }, + 猎人之径: { + attr: 'mastery' + }, + 薙草之稻光: { + attr: 'recharge', + abbr: '薙刀' + } + } - // 圣遗物判定,如果是绝缘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') + 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('纺锤') + } + + // 圣遗物判定,如果是绝缘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('') : '通用' diff --git a/models/profile/DmgBuffs.js b/models/profile/DmgBuffs.js index 7b8e0522..7586b7e8 100644 --- a/models/profile/DmgBuffs.js +++ b/models/profile/DmgBuffs.js @@ -17,6 +17,7 @@ let DmgBuffs = { let mKey2 = { aggravate: '超激化' } + buffs = lodash.filter(buffs, (b) => !!b) lodash.forEach(buffs, (buff, idx) => { if (lodash.isString(buff)) { if (mKey[buff]) { diff --git a/resources/character/artis-mark.html b/resources/character/artis-mark.html index a01c645e..28a2100a 100644 --- a/resources/character/artis-mark.html +++ b/resources/character/artis-mark.html @@ -33,10 +33,10 @@
- <% for(let idx = 1; idx<=5; idx++) { + <% for(let idx = 1; idx<=(game==='gs'?5:6); idx++) { let ds = ad?.artis[idx] %> - {{if idx === 1 }} + {{if idx === 1 && game === 'gs'}}
{{/if}}
@@ -77,16 +77,17 @@ *{{( 66 / (46.6/6/100 * charCfg.posMaxMark[idx]) * 100).toFixed(1)}}% - {{if idx>2}} + {{if idx>2 || game==='sr' }}
  • 最优主词缀 + {{if game==='sr' && idx<=2 }} - {{else}} {{if ds.main.title === '充能效率'}} *100% {{else}} {{set mainWeight = charCfg?.attrs[ds.main?.key===data.elem?'dmg':ds.main?.key]?.weight || 0}} *{{(50 + 50 * mainWeight / charCfg.posMaxMark["m"+idx] ).toFixed(0)}}% - {{/if}} + {{/if}}{{/if}}
  • {{/if}} @@ -158,12 +159,22 @@
    +
    位置
    + {{if game === 'sr'}}
    生之花
    死之羽
    时之沙
    空之杯
    理之冠
    + {{else}} +
    帽子
    +
    手套
    +
    衣服
    +
    靴子
    +
    +
    + {{/if}}
    最高分(对齐前)
    diff --git a/resources/character/profile-detail.html b/resources/character/profile-detail.html index 0fd3c315..de0bb3a5 100644 --- a/resources/character/profile-detail.html +++ b/resources/character/profile-detail.html @@ -202,7 +202,7 @@ {{else}}
    {{/if}} diff --git a/resources/meta-sr/artifact/artis-mark.js b/resources/meta-sr/artifact/artis-mark.js new file mode 100644 index 00000000..88a83c4d --- /dev/null +++ b/resources/meta-sr/artifact/artis-mark.js @@ -0,0 +1,30 @@ +/** + * 角色的默认评分规则 + * 如character/${name}/artis.js下有角色自定义规则优先使用自定义 + */ +export const usefulAttr = { + 景元: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 希儿: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 布洛妮娅: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 0, cdmg: 100, stance: 0, heal: 0, recharge: 100, effPct: 0, effDef: 0, dmg: 100 }, + 杰帕德: { hp: 50, atk: 0, def: 100, speed: 100, cpct: 0, cdmg: 0, stance: 0, heal: 0, recharge: 100, effPct: 50, effDef: 50, dmg: 0 }, + 姬子: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 50, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 瓦尔特: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 彦卿: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 75, effPct: 100, effDef: 0, dmg: 100 }, + 白露: { hp: 100, atk: 0, def: 50, speed: 75, cpct: 0, cdmg: 0, stance: 0, heal: 100, recharge: 100, effPct: 0, effDef: 50, dmg: 0 }, + 克拉拉: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 三月七: { hp: 50, atk: 0, def: 100, speed: 100, cpct: 0, cdmg: 0, stance: 0, heal: 0, recharge: 100, effPct: 50, effDef: 50, dmg: 0 }, + 丹恒: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 阿兰: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 艾丝妲: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 0, cdmg: 0, stance: 75, heal: 0, recharge: 100, effPct: 0, effDef: 0, dmg: 100 }, + 黑塔: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 希露瓦: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 娜塔莎: { hp: 100, atk: 0, def: 50, speed: 75, cpct: 0, cdmg: 0, stance: 0, heal: 100, recharge: 75, effPct: 0, effDef: 50, dmg: 0 }, + 佩拉: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 100, effDef: 0, dmg: 100 }, + 桑博: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 100, effDef: 0, dmg: 100 }, + 虎克: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 青雀: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 停云: { hp: 50, atk: 100, def: 0, speed: 100, cpct: 0, cdmg: 0, stance: 0, heal: 0, recharge: 100, effPct: 0, effDef: 0, dmg: 0 }, + 素裳: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 50, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 }, + 开拓者火: { hp: 50, atk: 0, def: 100, speed: 100, cpct: 0, cdmg: 0, stance: 0, heal: 0, recharge: 0, effPct: 100, effDef: 50, dmg: 0 }, + 开拓者物理: { hp: 0, atk: 75, def: 0, speed: 75, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 } +} diff --git a/resources/meta-sr/artifact/meta.js b/resources/meta-sr/artifact/meta.js index 1d4114a2..71a8d5a4 100644 --- a/resources/meta-sr/artifact/meta.js +++ b/resources/meta-sr/artifact/meta.js @@ -22,16 +22,16 @@ export const subAttr = 'atk,atkPlus,def,defPlus,hp,hpPlus,speed,cpct,cdmg,effPct */ const attrMap = { atk: { title: '大攻击', format: 'pct', calc: 'pct', value: 4.32 }, - atkPlus: { title: '小攻击', format: 'comma', value: 21 }, + atkPlus: { title: '小攻击', format: 'comma', value: 127 / 6 }, def: { title: '大防御', format: 'pct', calc: 'pct', value: 5.4 }, - defPlus: { title: '小防御', format: 'comma', value: 21 }, + defPlus: { title: '小防御', format: 'comma', value: 127 / 6 }, hp: { title: '大生命', format: 'pct', calc: 'pct', value: 4.32 }, - hpPlus: { title: '小生命', format: 'comma', value: 42 }, + hpPlus: { title: '小生命', format: 'comma', value: 254 / 6 }, speed: { title: '速度', format: 'comma', calc: 'plus', value: 2.6 }, cpct: { title: '暴击率', format: 'pct', calc: 'plus', value: 3.24 }, cdmg: { title: '暴击伤害', format: 'pct', calc: 'plus', value: 6.48 }, - recharge: { title: '充能效率', format: 'pct', calc: 'plus' }, - dmg: { title: '伤害加成', format: 'pct' }, + recharge: { title: '充能效率', format: 'pct', calc: 'plus', value: 3.11 }, + dmg: { title: '伤害加成', format: 'pct', value: 6.22 }, heal: { title: '治疗加成', format: 'pct' }, stance: { title: '击破特攻', format: 'pct', value: 6.48 }, effPct: { title: '效果命中', format: 'pct', value: 4.32 },