修正已知问题

This commit is contained in:
Kokomi 2023-11-28 04:18:06 +08:00
parent d08a03831b
commit ad4d0dd48b
15 changed files with 122 additions and 88 deletions

View File

@ -71,6 +71,8 @@ async function sysCfg (e) {
let cfgSchema = cfgSchemaMap[regRet[1]]
if (cfgSchema.input) {
val = cfgSchema.input(val)
} else if (cfgSchema.type === 'str') {
val = (val || cfgSchema.def) + ''
} else {
val = cfgSchema.type === 'num' ? (val * 1 || cfgSchema.def) : !/关闭/.test(val)
}

View File

@ -218,11 +218,11 @@ let Cal = {
// 遍历角色数据
Character.forEach((char) => {
if (charBirth[char.birth] && (char.isRelease || char.birth !== '1-1')) {
charBirth[char.birth].push(char.getData('id,name:sName,star,face'))
charBirth[char.birth].push(char.getData('id,name:abbr,star,face'))
}
let t = char.materials?.talent
if (t && charTalent[t] && !char.isTraveler) {
let data = char.getData('id,name:sName,star,face')
let data = char.getData('id,name:abbr,star,face')
data.weekly = char.getMaterials('weekly')?.icon
charTalent[t].chars.push(data)
}

View File

@ -14,7 +14,11 @@ let cfgData = {
if (cfgItem.input) {
val = cfgItem.input(val)
}
if (cfgItem.type === 'str') {
ret.push(`export const ${cfgKey} = '${val.toString()}'`, '')
} else {
ret.push(`export const ${cfgKey} = ${val.toString()}`, '')
}
})
})
fs.writeFileSync(`${process.cwd()}/plugins/miao-plugin/config/cfg.js`, ret.join('\n'), 'utf8')

View File

@ -82,17 +82,17 @@ export const cfgSchema = {
profileServer: {
title: '面板服务',
key: '面板服务',
type: 'num',
def: 0,
input: (n) => /[0-4]{1,3}/.test(n) ? n : 0,
def: '0',
type: 'str',
input: (n) => /[0-4]{1,3}/.test(n) ? n : '0',
desc: '面板服务选择0:自动1:喵Api(需具备Token) 2:Enka-API 3:MiniGG-Api, 4:Hutao-Enka代理。如设置三位数字则为分服务器设置按顺序分别为 国服/B服/外服例如112代表国服B服Miao,国外Enka'
},
srProfileServer: {
title: '星铁面板服务',
key: '星铁面板服务',
type: 'num',
def: 0,
input: (n) => /[0-4]{1,3}/.test(n) ? n : 0,
def: '0',
type: 'str',
input: (n) => /[0-4]{1,3}/.test(n) ? n : '0',
desc: '星铁面板服务选择0:自动1:喵Api(需具备Token) 2:Mihomo 3:Avocado(鳄梨), 4:EnkaHSR。如设置三位数字则为分服务器设置按顺序分别为 国服/B服/外服例如114代表国服B服Miao,国外Enka'
},
costumeSplash: {

View File

@ -69,7 +69,6 @@ class Character extends Base {
}
_get (key) {
if (metaKey.includes(key)) {
return this.meta[key]
}
@ -181,6 +180,11 @@ class Character extends Base {
return new Character(id)
}
static sample (game = 'gs') {
let id = CharId.getRandomId(game)
return Character.get(id)
}
static forEach (fn, type = 'all', game = 'gs') {
let ids = Meta.getIds(game, 'char')
lodash.forEach(ids, (id) => {

View File

@ -134,7 +134,7 @@ export default class ProfileDmg extends Base {
trees: this.trees()
}
let { id, weapon, attr } = profile
let { id, weapon, attr, artis } = profile
defParams = defParams || {}
@ -142,7 +142,7 @@ export default class ProfileDmg extends Base {
buffs = this.getBuffs(buffs)
let { msg } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params: defParams || {}, game })
let { msg } = DmgAttr.calcAttr({ originalAttr, buffs, artis, meta, params: defParams || {}, game })
let msgList = []
let ret = []
@ -172,22 +172,24 @@ export default class ProfileDmg extends Base {
}
if (lodash.isFunction(detail)) {
let { attr } = DmgAttr.calcAttr({ originalAttr, buffs, meta })
let { attr } = DmgAttr.calcAttr({ originalAttr, artis, buffs, meta })
let ds = lodash.merge({ talent }, DmgAttr.getDs(attr, meta))
detail = detail({ ...ds, attr, profile })
}
let params = lodash.merge({}, defParams, detail?.params || {})
let { attr, msg } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params, talent: detail.talent || '', game })
let { attr, msg } = DmgAttr.calcAttr({ originalAttr, buffs, artis, meta, params, talent: detail.talent || '', game })
if (detail.isStatic) {
return
}
if (detail.check && !detail.check(DmgAttr.getDs(attr, meta, params))) {
let ds = lodash.merge({ talent }, DmgAttr.getDs(attr, meta, params))
ds.artis = artis
if (detail.check && !detail.check(ds)) {
return
}
if (detail.cons && meta.cons < detail.cons * 1) {
return
}
let ds = lodash.merge({ talent }, DmgAttr.getDs(attr, meta, params))
let dmg = DmgCalc.getDmgFn({ ds, attr, level: profile.level, enemyLv, showDetail: detail.showDetail, game })
let basicDmgRet
@ -218,7 +220,7 @@ export default class ProfileDmg extends Base {
}
if (lodash.isFunction(detail)) {
let { attr } = DmgAttr.calcAttr({ originalAttr, buffs, meta })
let { attr } = DmgAttr.calcAttr({ originalAttr, buffs, artis, meta })
let ds = lodash.merge({ talent }, DmgAttr.getDs(attr, meta))
detail = detail({ ...ds, attr, profile })
}
@ -246,6 +248,7 @@ export default class ProfileDmg extends Base {
let { attr } = DmgAttr.calcAttr({
originalAttr,
buffs,
artis,
meta,
params,
incAttr,

View File

@ -64,6 +64,15 @@ const CharId = {
return false
},
getRandomId (game = 'gs') {
let meta = Meta.create(game, 'char')
let ids = meta.getIds()
if (game === 'gs') {
ids = lodash.filter(ids, (id) => /^\d+$/.test(id))
}
return lodash.sample(ids)
},
isTraveler (id) {
if (id) {
return [10000007, 10000005, 20000000].includes(id * 1)

View File

@ -117,7 +117,7 @@ let DmgAttr = {
},
// 计算属性
calcAttr ({ originalAttr, buffs, meta, params = {}, incAttr = '', reduceAttr = '', talent = '', game = 'gs' }) {
calcAttr ({ originalAttr, buffs, meta, artis, params = {}, incAttr = '', reduceAttr = '', talent = '', game = 'gs' }) {
let attr = DmgAttr.getAttr({ originalAttr, game })
let msg = []
let { attrMap } = Meta.getMeta(game, 'arti')
@ -135,6 +135,7 @@ let DmgAttr = {
let ds = DmgAttr.getDs(attr, meta, params)
ds.currentTalent = talent
ds.artis = artis
if (buff.isStatic) {
return

View File

@ -23,7 +23,7 @@
{{if cfgItem.type==='num'}} {{cfgItem.def}}{{else}} 开启/关闭{{/if}}
</span>
{{/if}}
{{if cfgItem.type === 'num'}}
{{if cfgItem.type === 'num' || cfgItem.type === 'str'}}
<div class="cfg-status">{{cfg[cfgKey]}}</div>
{{else}}
{{if cfg[cfgKey] || (cfgItem.miao && isMiao)}}

View File

@ -81,7 +81,7 @@ export const alias = {
菲米尼: 'Freminet,非米尼,潜水员',
莱欧斯利: 'Wriothesley,莱欧,枫丹桑博,公爵',
那维莱特: 'Neuvillette,那维,水龙王,水龙,审判官,海獭,龙王,最高审判官,水之龙王',
夏洛蒂: 'Charlotte,夏洛,夏洛帝,记者,小记者',
夏洛蒂: 'Charlotte,夏洛,夏洛帝,记者,小记者,佳能400D,400D',
芙宁娜: 'Furina,Focalors,水神,芙芙,芙卡洛斯,傻芙芙',
娜维娅: 'navia,大小姐,刺玫会,黄豆,流汗黄豆,黄豆姐',
夏沃蕾: 'chevreuse,夏沃雷',

View File

@ -292,7 +292,7 @@ body {
}
.cal-abyss-cont .cal-item {
border-radius: 0;
background: url("imgs/abyss.jpg") #333465 top right no-repeat;
background: url("./imgs/abyss.jpg") #333465 top right no-repeat;
position: absolute;
}
.cal-abyss-cont .cal-item .info {
@ -450,3 +450,4 @@ body {
.daily-talent .card .banner.city-5 .line {
background: #557dd6;
}
/*# sourceMappingURL=calendar.css.map */

View File

@ -28,7 +28,7 @@
</div>
{{ if line[0]?.num !== 'NaN'}}
<div class="data-box">
<div class="tab-label">90级基础数据</div>
<div class="tab-label">{{game === 'gs' ? '90' : '80'}}级基础数据</div>
<div class="data-line">
{{each line item}}
<div class="data_line_item">

View File

@ -34,6 +34,10 @@ body {
.char-meta {
padding-left: 370px;
}
.wiki-cont {
padding: 0 10px;
margin-right: 5px;
}
.detail {
right: 18px;
}

View File

@ -55,9 +55,10 @@
</div>
</div>
{{if holding.num}}
{{set cNum ='零一二三四五满'.split('')}}
<div class="cont cont-bg">
<div class="wiki-cont">
{{if holding.num}}
{{set cNum ='零一二三四五满'.split('')}}
<div class="cont cont-bg">
<div class="char-holding">
<div class="char-pct">
<strong>{{holding.num}}</strong>
@ -79,17 +80,17 @@
{{/each}}
</div>
</div>
</div>
{{/if}}
</div>
{{/if}}
<div class="talent-notice">输入<strong>#{{data.abbr}}天赋、#{{data.abbr}}命座</strong>可查看详细天赋/命座信息</div>
{{set weapons = usage.weapons || [] }}
{{if weapons.length >0}}
<div class="cont">
<div class="talent-notice">输入<strong>#{{data.abbr}}天赋、#{{data.abbr}}命座</strong>可查看详细天赋/命座信息</div>
{{set weapons = usage.weapons || [] }}
{{if weapons.length >0}}
<div class="cont">
<div class="cont-title border-less">常用武器</div>
<div class="item-list weapon-list">
{{each weapons weapon idx}}
{{if idx <7}}
{{if idx < 7}}
<div class="item item-card">
<div class="item-icon star{{weapon.star}}">
<div class="item-bg" style="background-image:url({{_res_path}}{{weapon.img}})"></div>
@ -100,15 +101,15 @@
{{/if}}
{{/each}}
</div>
</div>
{{/if}}
{{set artis = usage.artis || [] }}
{{if artis.length >0}}
<div class="cont">
</div>
{{/if}}
{{set artis = usage.artis || [] }}
{{if artis.length >0}}
<div class="cont">
<div class="cont-title border-less">常用圣遗物<span>持有率、武器、圣遗物统计来自胡桃API未经允许请勿使用此数据</span></div>
<div class="item-list weapon-list artis-list">
{{each artis arti idx}}
{{if idx <7}}
{{if idx < 7}}
<div class="item item-card">
<div class="item-icon star5 artis-count{{arti.imgs.length}}">
{{each arti.imgs img idx}}
@ -122,8 +123,8 @@
{{/if}}
{{/each}}
</div>
</div>
<div class="talent-notice"></div>
{{/if}}
</div>
<div class="talent-notice"></div>
{{/if}}
{{/block}}

View File

@ -51,6 +51,11 @@ body {
}
}
.wiki-cont {
padding: 0 10px;
margin-right: 5px;
}
.detail {
right: 18px;