mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-09-28 03:46:09 +00:00
面板详情的圣遗物词条增加词条数展示
This commit is contained in:
parent
7f0029ab73
commit
8bcdb5340a
@ -1,6 +1,7 @@
|
||||
# 2.3.8
|
||||
|
||||
* 面板服务增加由**Snap Hutao**提供的Enka转发代理,可通过`#喵喵设置面板服务4`进行选择
|
||||
* 面板详情的圣遗物词条增加词条数展示
|
||||
* 部分角色资源文件结构调整
|
||||
|
||||
# 2.3.1~2.3.7
|
||||
|
@ -85,12 +85,14 @@ class Artifact extends Base {
|
||||
tmp[key] = {
|
||||
key,
|
||||
upNum: 0,
|
||||
eff: 0,
|
||||
value: 0
|
||||
}
|
||||
ret.push(tmp[key])
|
||||
}
|
||||
tmp[key].value += value * (attrMap[key].format === 'pct' ? 100 : 1)
|
||||
tmp[key].upNum++
|
||||
tmp[key].eff += value / attrMap[key].value * (attrMap[key].format === 'pct' ? 100 : 1)
|
||||
})
|
||||
return ret
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import lodash from 'lodash'
|
||||
import { Format } from '#miao'
|
||||
import { attrNameMap, mainAttr, subAttr, attrMap ,basicNum,attrPct} from '../../resources/meta/artifact/index.js'
|
||||
import { attrNameMap, mainAttr, subAttr, attrMap, basicNum, attrPct } from '../../resources/meta/artifact/index.js'
|
||||
|
||||
let ArtisMark = {
|
||||
// 根据Key获取标题
|
||||
@ -116,11 +116,13 @@ let ArtisMark = {
|
||||
let ret = {
|
||||
key,
|
||||
value: val,
|
||||
upNum: ds.upNum || 0
|
||||
upNum: ds.upNum || 0,
|
||||
eff: ds.eff || 0
|
||||
}
|
||||
if (!isMain && !ret.upNum) {
|
||||
let incRet = ArtisMark.getIncNum(key, value)
|
||||
ret.upNum = incRet.num
|
||||
ret.eff = incRet.eff
|
||||
ret.hasGt = incRet.hasGt
|
||||
ret.hasLt = incRet.hasLt
|
||||
ret.isCalcNum = true
|
||||
@ -135,6 +137,7 @@ let ArtisMark = {
|
||||
ret.mark = Format.comma(mark || 0)
|
||||
ret._mark = mark || 0
|
||||
}
|
||||
ret.eff = ret.eff ? Format.comma(ret.eff, 1) : '-'
|
||||
return ret
|
||||
},
|
||||
|
||||
@ -148,11 +151,12 @@ let ArtisMark = {
|
||||
let minNum = Math.max(1, Math.ceil((value / cfg.value).toFixed(1) * 1))
|
||||
// 相等时直接返回
|
||||
if (maxNum === minNum) {
|
||||
return { num: minNum }
|
||||
return { num: minNum, eff: value / cfg.value }
|
||||
}
|
||||
let avg = Math.round(value / (cfg.value + cfg.valueMin) * 2)
|
||||
return {
|
||||
num: avg,
|
||||
eff: value / cfg.value,
|
||||
hasGt: maxNum > avg,
|
||||
hasLt: minNum < avg
|
||||
}
|
||||
@ -195,7 +199,7 @@ let ArtisMark = {
|
||||
})
|
||||
return ret * (1 + fixPct) / 2 / posMaxMark[posIdx] * 66
|
||||
},
|
||||
|
||||
|
||||
getCritMark (charCfg, posIdx, mainAttr, subAttr, elem = '') {
|
||||
let ret = 0
|
||||
let { attrs, posMaxMark } = charCfg
|
||||
@ -208,23 +212,23 @@ let ArtisMark = {
|
||||
if (posIdx >= 4) {
|
||||
let mainKey = key
|
||||
if (posIdx === 4 && Format.isElem(key) && key === elem) {
|
||||
mainKey = 'dmg'
|
||||
mainKey = 'dmg'
|
||||
}
|
||||
fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + posIdx])))
|
||||
}
|
||||
if(key === 'cpct'|| key === 'cdmg' ){
|
||||
ret += 9.41
|
||||
}
|
||||
if (key === 'cpct' || key === 'cdmg') {
|
||||
ret += 9.41
|
||||
}
|
||||
|
||||
lodash.forEach(subAttr, (ds) => {
|
||||
if (ds.key === 'cpct' || ds.key === 'cdmg' ){
|
||||
let temp_s = (attrs[ds.key]?.mark || 0) * (ds.value || 0)/85
|
||||
ret += temp_s
|
||||
if (ds.key === 'cpct' || ds.key === 'cdmg') {
|
||||
let temp_s = (attrs[ds.key]?.mark || 0) * (ds.value || 0) / 85
|
||||
ret += temp_s
|
||||
}
|
||||
})
|
||||
return ret
|
||||
},
|
||||
|
||||
|
||||
getValidMark (charCfg, posIdx, mainAttr, subAttr, elem = '') {
|
||||
let ret = 0
|
||||
let { attrs, posMaxMark } = charCfg
|
||||
@ -237,14 +241,14 @@ let ArtisMark = {
|
||||
if (posIdx >= 4) {
|
||||
let mainKey = key
|
||||
if (posIdx === 4 && Format.isElem(key) && key === elem) {
|
||||
mainKey = 'dmg'
|
||||
mainKey = 'dmg'
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + posIdx])))
|
||||
}
|
||||
lodash.forEach(subAttr, (ds) => {
|
||||
let temp_s = (attrs[ds.key]?.mark || 0) * (ds.value || 0)/85
|
||||
let temp_s = (attrs[ds.key]?.mark || 0) * (ds.value || 0) / 85
|
||||
ret += temp_s
|
||||
})
|
||||
return ret
|
||||
|
@ -29,7 +29,7 @@
|
||||
{{each ds.attrs attr}}
|
||||
{{if attr && attr.key}}
|
||||
<li class="{{ds.charWeight[attr.key]*1 > 79.9 ?`great`:(ds.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}">
|
||||
<span class="title"> {{if attr.upNum}}<i class="up-num up-{{attr.upNum}}"></i>{{/if}}{{artisKeyTitle[attr.key]}}</span>
|
||||
<span class="title">{{if attr.eff}}<i class="eff">{{attr.eff || ''}}</i>{{/if}}{{if attr.upNum}}<i class="up-num up-{{attr.upNum}}"></i>{{/if}}{{artisKeyTitle[attr.key]}}</span>
|
||||
<span class="val">+{{attr.value}}</span></li>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
@ -62,7 +62,7 @@
|
||||
{{each ds.attrs attr}}
|
||||
{{if attr.key}}
|
||||
<li class="{{ad.charWeight[attr.key]*1 > 79.9 ?`great`:(ad.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}"><span
|
||||
class="title">{{artisKeyTitle[attr.key]}} </span><span
|
||||
class="title">{{if attr.eff}}<i class="eff">{{attr.eff || ''}}</i>{{/if}}{{artisKeyTitle[attr.key]}} </span><span
|
||||
class="val">+{{attr.value}}</span>
|
||||
<span class="mark">{{ ( 46.6 / 6 / 100 * attr._mark ).toFixed(1) }}</span>
|
||||
</li>
|
||||
|
@ -562,14 +562,29 @@ body {
|
||||
}
|
||||
.artis ul.detail li span.title {
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
padding-left: 30px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.artis ul.detail li span.title i.eff {
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: 3px;
|
||||
top: 4px;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 5px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
width: 23px;
|
||||
text-align: center;
|
||||
}
|
||||
.artis ul.detail li span.title i.up-num {
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: 80px;
|
||||
top: 8px;
|
||||
height: 9px;
|
||||
left: 91px;
|
||||
top: 9px;
|
||||
height: 8px;
|
||||
width: 50px;
|
||||
background-image: url('./imgs/up-num-icon1.png');
|
||||
background-position: 0 0;
|
||||
@ -577,16 +592,16 @@ body {
|
||||
background-size: auto 500%;
|
||||
}
|
||||
.artis ul.detail li span.title i.up-num.up-5 {
|
||||
background-position: 0 -9px;
|
||||
background-position: 0 -8px;
|
||||
}
|
||||
.artis ul.detail li span.title i.up-num.up-4 {
|
||||
background-position: 0 -18px;
|
||||
background-position: 0 -16px;
|
||||
}
|
||||
.artis ul.detail li span.title i.up-num.up-3 {
|
||||
background-position: 0 -27px;
|
||||
background-position: 0 -24px;
|
||||
}
|
||||
.artis ul.detail li span.title i.up-num.up-2 {
|
||||
background-position: 0 -36px;
|
||||
background-position: 0 -32px;
|
||||
}
|
||||
.artis ul.detail li span.title i.up-num.up-1 {
|
||||
background: none !important;
|
||||
@ -594,6 +609,7 @@ body {
|
||||
.artis ul.detail li span.val {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.artis ul.detail li.great span.title {
|
||||
color: #ffe699;
|
||||
|
@ -143,8 +143,9 @@
|
||||
{{each ds.attrs attr}}
|
||||
{{if attr && attr.key}}
|
||||
<li class="{{ad.charWeight[attr.key]*1 > 79.9 ?`great`:(ad.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}">
|
||||
<span class="title"> {{if attr.upNum}}<i class="up-num up-{{attr.upNum}}"></i>{{/if}}{{artisKeyTitle[attr.key]}}</span>
|
||||
<span class="title">{{if attr.eff}}<i class="eff">{{attr.eff || ''}}</i>{{/if}}{{if attr.upNum}}<i class="up-num up-{{attr.upNum}}"></i>{{/if}}{{artisKeyTitle[attr.key]}}</span>
|
||||
<span class="val">+{{attr.value}}</span>
|
||||
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
@ -696,14 +696,30 @@ body {
|
||||
|
||||
&.title {
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
padding-left: 30px;
|
||||
font-size: 14px;
|
||||
|
||||
i.eff {
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: 3px;
|
||||
top: 4px;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 5px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
width: 23px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
i.up-num {
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: 80px;
|
||||
top: 8px;
|
||||
height: 9px;
|
||||
left: 91px;
|
||||
top: 9px;
|
||||
height: 8px;
|
||||
width: 50px;
|
||||
background-image: url('./imgs/up-num-icon1.png');
|
||||
background-position: 0 0;
|
||||
@ -712,19 +728,19 @@ body {
|
||||
|
||||
|
||||
&.up-5 {
|
||||
background-position: 0 -9px;
|
||||
background-position: 0 -8px;
|
||||
}
|
||||
|
||||
&.up-4 {
|
||||
background-position: 0 -18px;
|
||||
background-position: 0 -16px;
|
||||
}
|
||||
|
||||
&.up-3 {
|
||||
background-position: 0 -27px;
|
||||
background-position: 0 -24px;
|
||||
}
|
||||
|
||||
&.up-2 {
|
||||
background-position: 0 -36px;
|
||||
background-position: 0 -32px;
|
||||
}
|
||||
|
||||
&.up-1 {
|
||||
@ -736,6 +752,7 @@ body {
|
||||
&.val {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 124 KiB |
Loading…
Reference in New Issue
Block a user