面板详情的圣遗物词条增加词条数展示

This commit is contained in:
Kokomi 2023-04-14 04:13:17 +08:00
parent 7f0029ab73
commit 8bcdb5340a
9 changed files with 76 additions and 35 deletions

View File

@ -1,6 +1,7 @@
# 2.3.8 # 2.3.8
* 面板服务增加由**Snap Hutao**提供的Enka转发代理可通过`#喵喵设置面板服务4`进行选择 * 面板服务增加由**Snap Hutao**提供的Enka转发代理可通过`#喵喵设置面板服务4`进行选择
* 面板详情的圣遗物词条增加词条数展示
* 部分角色资源文件结构调整 * 部分角色资源文件结构调整
# 2.3.1~2.3.7 # 2.3.1~2.3.7

View File

@ -85,12 +85,14 @@ class Artifact extends Base {
tmp[key] = { tmp[key] = {
key, key,
upNum: 0, upNum: 0,
eff: 0,
value: 0 value: 0
} }
ret.push(tmp[key]) ret.push(tmp[key])
} }
tmp[key].value += value * (attrMap[key].format === 'pct' ? 100 : 1) tmp[key].value += value * (attrMap[key].format === 'pct' ? 100 : 1)
tmp[key].upNum++ tmp[key].upNum++
tmp[key].eff += value / attrMap[key].value * (attrMap[key].format === 'pct' ? 100 : 1)
}) })
return ret return ret
} }

View File

@ -1,6 +1,6 @@
import lodash from 'lodash' import lodash from 'lodash'
import { Format } from '#miao' 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 = { let ArtisMark = {
// 根据Key获取标题 // 根据Key获取标题
@ -116,11 +116,13 @@ let ArtisMark = {
let ret = { let ret = {
key, key,
value: val, value: val,
upNum: ds.upNum || 0 upNum: ds.upNum || 0,
eff: ds.eff || 0
} }
if (!isMain && !ret.upNum) { if (!isMain && !ret.upNum) {
let incRet = ArtisMark.getIncNum(key, value) let incRet = ArtisMark.getIncNum(key, value)
ret.upNum = incRet.num ret.upNum = incRet.num
ret.eff = incRet.eff
ret.hasGt = incRet.hasGt ret.hasGt = incRet.hasGt
ret.hasLt = incRet.hasLt ret.hasLt = incRet.hasLt
ret.isCalcNum = true ret.isCalcNum = true
@ -135,6 +137,7 @@ let ArtisMark = {
ret.mark = Format.comma(mark || 0) ret.mark = Format.comma(mark || 0)
ret._mark = mark || 0 ret._mark = mark || 0
} }
ret.eff = ret.eff ? Format.comma(ret.eff, 1) : '-'
return ret return ret
}, },
@ -148,11 +151,12 @@ let ArtisMark = {
let minNum = Math.max(1, Math.ceil((value / cfg.value).toFixed(1) * 1)) let minNum = Math.max(1, Math.ceil((value / cfg.value).toFixed(1) * 1))
// 相等时直接返回 // 相等时直接返回
if (maxNum === minNum) { if (maxNum === minNum) {
return { num: minNum } return { num: minNum, eff: value / cfg.value }
} }
let avg = Math.round(value / (cfg.value + cfg.valueMin) * 2) let avg = Math.round(value / (cfg.value + cfg.valueMin) * 2)
return { return {
num: avg, num: avg,
eff: value / cfg.value,
hasGt: maxNum > avg, hasGt: maxNum > avg,
hasLt: minNum < avg hasLt: minNum < avg
} }
@ -212,13 +216,13 @@ let ArtisMark = {
} }
fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + posIdx]))) fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + posIdx])))
} }
if(key === 'cpct'|| key === 'cdmg' ){ if (key === 'cpct' || key === 'cdmg') {
ret += 9.41 ret += 9.41
} }
lodash.forEach(subAttr, (ds) => { lodash.forEach(subAttr, (ds) => {
if (ds.key === 'cpct' || ds.key === 'cdmg' ){ if (ds.key === 'cpct' || ds.key === 'cdmg') {
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 ret += temp_s
} }
}) })
@ -244,7 +248,7 @@ let ArtisMark = {
fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + posIdx]))) fixPct = Math.max(0, Math.min(1, (attrs[mainKey]?.weight || 0) / (posMaxMark['m' + posIdx])))
} }
lodash.forEach(subAttr, (ds) => { 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 ret += temp_s
}) })
return ret return ret

View File

@ -29,7 +29,7 @@
{{each ds.attrs attr}} {{each ds.attrs attr}}
{{if attr && attr.key}} {{if attr && attr.key}}
<li class="{{ds.charWeight[attr.key]*1 > 79.9 ?`great`:(ds.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}"> <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> <span class="val">+{{attr.value}}</span></li>
{{/if}} {{/if}}
{{/each}} {{/each}}

View File

@ -62,7 +62,7 @@
{{each ds.attrs attr}} {{each ds.attrs attr}}
{{if attr.key}} {{if attr.key}}
<li class="{{ad.charWeight[attr.key]*1 > 79.9 ?`great`:(ad.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}"><span <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> class="val">+{{attr.value}}</span>
<span class="mark">{{ ( 46.6 / 6 / 100 * attr._mark ).toFixed(1) }}</span> <span class="mark">{{ ( 46.6 / 6 / 100 * attr._mark ).toFixed(1) }}</span>
</li> </li>

View File

@ -562,14 +562,29 @@ body {
} }
.artis ul.detail li span.title { .artis ul.detail li span.title {
text-align: left; 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 { .artis ul.detail li span.title i.up-num {
position: absolute; position: absolute;
display: block; display: block;
left: 80px; left: 91px;
top: 8px; top: 9px;
height: 9px; height: 8px;
width: 50px; width: 50px;
background-image: url('./imgs/up-num-icon1.png'); background-image: url('./imgs/up-num-icon1.png');
background-position: 0 0; background-position: 0 0;
@ -577,16 +592,16 @@ body {
background-size: auto 500%; background-size: auto 500%;
} }
.artis ul.detail li span.title i.up-num.up-5 { .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 { .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 { .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 { .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 { .artis ul.detail li span.title i.up-num.up-1 {
background: none !important; background: none !important;
@ -594,6 +609,7 @@ body {
.artis ul.detail li span.val { .artis ul.detail li span.val {
text-align: right; text-align: right;
padding-right: 10px; padding-right: 10px;
font-size: 14px;
} }
.artis ul.detail li.great span.title { .artis ul.detail li.great span.title {
color: #ffe699; color: #ffe699;

View File

@ -143,8 +143,9 @@
{{each ds.attrs attr}} {{each ds.attrs attr}}
{{if attr && attr.key}} {{if attr && attr.key}}
<li class="{{ad.charWeight[attr.key]*1 > 79.9 ?`great`:(ad.charWeight[attr.key]*1>0 ? `useful`:`nouse`)}}"> <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> <span class="val">+{{attr.value}}</span>
</li> </li>
{{/if}} {{/if}}
{{/each}} {{/each}}

View File

@ -696,14 +696,30 @@ body {
&.title { &.title {
text-align: left; 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 { i.up-num {
position: absolute; position: absolute;
display: block; display: block;
left: 80px; left: 91px;
top: 8px; top: 9px;
height: 9px; height: 8px;
width: 50px; width: 50px;
background-image: url('./imgs/up-num-icon1.png'); background-image: url('./imgs/up-num-icon1.png');
background-position: 0 0; background-position: 0 0;
@ -712,19 +728,19 @@ body {
&.up-5 { &.up-5 {
background-position: 0 -9px; background-position: 0 -8px;
} }
&.up-4 { &.up-4 {
background-position: 0 -18px; background-position: 0 -16px;
} }
&.up-3 { &.up-3 {
background-position: 0 -27px; background-position: 0 -24px;
} }
&.up-2 { &.up-2 {
background-position: 0 -36px; background-position: 0 -32px;
} }
&.up-1 { &.up-1 {
@ -736,6 +752,7 @@ body {
&.val { &.val {
text-align: right; text-align: right;
padding-right: 10px; padding-right: 10px;
font-size: 14px;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 124 KiB