mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 22:48:13 +00:00
修正已知问题
This commit is contained in:
parent
d08a03831b
commit
ad4d0dd48b
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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')
|
||||
|
@ -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: {
|
||||
|
@ -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) => {
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)}}
|
||||
|
@ -81,7 +81,7 @@ export const alias = {
|
||||
菲米尼: 'Freminet,非米尼,潜水员',
|
||||
莱欧斯利: 'Wriothesley,莱欧,枫丹桑博,公爵',
|
||||
那维莱特: 'Neuvillette,那维,水龙王,水龙,审判官,海獭,龙王,最高审判官,水之龙王',
|
||||
夏洛蒂: 'Charlotte,夏洛,夏洛帝,记者,小记者',
|
||||
夏洛蒂: 'Charlotte,夏洛,夏洛帝,记者,小记者,佳能400D,400D',
|
||||
芙宁娜: 'Furina,Focalors,水神,芙芙,芙卡洛斯,傻芙芙',
|
||||
娜维娅: 'navia,大小姐,刺玫会,黄豆,流汗黄豆,黄豆姐',
|
||||
夏沃蕾: 'chevreuse,夏沃雷',
|
||||
|
@ -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 */
|
@ -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">
|
||||
|
@ -34,6 +34,10 @@ body {
|
||||
.char-meta {
|
||||
padding-left: 370px;
|
||||
}
|
||||
.wiki-cont {
|
||||
padding: 0 10px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.detail {
|
||||
right: 18px;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wiki-cont">
|
||||
{{if holding.num}}
|
||||
{{set cNum ='零一二三四五满'.split('')}}
|
||||
<div class="cont cont-bg">
|
||||
@ -125,5 +126,5 @@
|
||||
</div>
|
||||
<div class="talent-notice"></div>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
{{/block}}
|
@ -51,6 +51,11 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
.wiki-cont {
|
||||
padding: 0 10px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.detail {
|
||||
right: 18px;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user