图鉴武器增加别名展示,增加雷神面板彩蛋

一些Bugfix
This commit is contained in:
yoimiya-kokomi 2022-09-06 01:05:06 +08:00
parent b360827c57
commit ac418b012a
13 changed files with 65 additions and 13 deletions

View File

@ -54,6 +54,9 @@ export async function wiki (e) {
return true
}
if (char.isCustom) {
if (mode === 'wiki') {
return false
}
e.reply('暂不支持自定义角色')
return true
}
@ -84,8 +87,7 @@ async function renderWiki ({ e, char }) {
lodash.forEach(wu[char.id], (ds) => {
let weapon = Weapon.get(ds.name) || {}
weapons.push({
name: ds.name,
star: weapon.star || 4,
...weapon.getData('name,abbr,img,star'),
value: Format.percent(ds.value, 1)
})
})

View File

@ -26,7 +26,7 @@ export default class ProfileData extends Base {
this.level = ds.lv || ds.level || 1
this.cons = ds.cons || 0
this.fetter = ds.fetter || 0
this.costume = ds.costume || 0
this._costume = ds.costume || 0
this.elem = ds.elem || ''
this.dataSource = ds.dataSource || 'enka'
this._time = ds._time || ds.updateTime || new Date() * 1
@ -91,6 +91,17 @@ export default class ProfileData extends Base {
return this.hasData && this.artis.length > 0
}
get costume () {
let cMap = {
// 10000033: 900001, // 公子
10000052: 900002 // 雷神
}
if (cMap[this.id] && this.cons === 6) {
return cMap[this.id]
}
return this._costume
}
// toJSON 供保存使用
toJSON () {
return this.getData('id,name,level,cons,fetter,attr,weapon,talent,artis,dataSource,costume,elem,_time')

View File

@ -1,6 +1,7 @@
import lodash from 'lodash'
import Base from './Base.js'
import { Data } from '../components/index.js'
import WeaponMeta from './weapon/WeaponMeta.js'
let data = Data.readJSON('resources/meta/weapons/data.json')
let wData = {}
@ -8,6 +9,7 @@ lodash.forEach(data, (ds) => {
wData[ds.name] = ds
})
class Weapon extends Base {
constructor (name) {
super(name)
@ -27,7 +29,7 @@ class Weapon extends Base {
}
get abbr () {
return this.name
return WeaponMeta.getAbbr(this.name)
}
get title () {
@ -35,7 +37,7 @@ class Weapon extends Base {
}
get img () {
return `meta/weapons/icons/${this.name}.webp`
return `meta/weapons/icon/${this.name}.png`
}
get icon () {

View File

@ -69,7 +69,7 @@ const CharMeta = {
})
ret.push({
title: '成长·' + (grow.key === 'dmg' ? `${elem}` : growAttrName[grow.key]),
value: grow.value
value: grow.value.toString().length > 10 ? Format.comma(grow.value, 1) : grow.value
})
return ret
},

View File

@ -0,0 +1,31 @@
export const abbr = {
磐岩结绿: '绿箭',
赤角石溃杵: '赤角',
终末嗟叹之诗: '终末',
松籁响起之时: '松籁',
苍古自由之誓: '苍古',
阿莫斯之弓: '阿莫斯',
雾切之回光: '雾切',
飞雷之弦振: '飞雷',
薙草之稻光: '薙草',
神乐之真意: '神乐铃',
波乱月白经津: '波乱',
笼钓瓶一心: '妖刀',
幽夜华尔兹: '幽夜弓',
雪葬的星银: '雪葬大剑',
喜多院十文字: '喜多院',
万国诸海图谱: '万国书',
天目影打刀: '天目刀',
桂木斩长正: '桂木刀',
证誓之明瞳: '证誓明瞳',
嘟嘟可故事集: '嘟嘟可',
辰砂之纺锤: '辰砂',
讨龙英杰谭: '讨龙',
神射手之誓: '神射手'
}
let WeaponMeta = {
getAbbr (name) {
return abbr[name] || name
}
}
export default WeaponMeta

View File

@ -12,7 +12,9 @@
"desc": "愚人众执行官第十一位,「公子」,其战绩威名远扬。",
"cncv": "鱼冻",
"jpcv": "木村良平",
"costume": false,
"costume": [
900001
],
"ver": 1,
"baseAttr": {
"hp": 13103,

View File

@ -12,7 +12,9 @@
"desc": "其身为御建鸣神主尊大御所大人,许稻妻人民以亘古不变之「永恒」。",
"cncv": "菊花花",
"jpcv": "泽城美雪",
"costume": false,
"costume": [
900002
],
"ver": 1,
"baseAttr": {
"hp": 12907,

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 KiB

View File

@ -64,10 +64,10 @@
{{each weapons weapon}}
<div class="item item-card">
<div class="item-icon star{{weapon.star}}">
<div class="item-bg" style="background-image:url({{_res_path}}/meta/weapons/icon/{{weapon.name}}.png)"></div>
<div class="item-bg" style="background-image:url({{_res_path}}{{weapon.img}})"></div>
<div class="item-badge">{{weapon.value}}</div>
</div>
<div class="item-title">{{weapon.name}}</div>
<div class="item-title">{{weapon.abbr}}</div>
</div>
{{/each}}
</div>

View File

@ -251,4 +251,4 @@ const charData = {
71: { key: 'cyno', name: '赛诺' },
72: { key: 'candace', name: '坎蒂丝' }
}
await down('4,5,7', true)
await down('雷电将军,达达利亚', true)

View File

@ -7,7 +7,9 @@ let costumes = {
刻晴: [204201], // 刻晴
凝光: [202701], // 凝光
迪卢克: [201601], // 迪卢克
菲谢尔: [203101] // 菲谢尔
菲谢尔: [203101], // 菲谢尔
达达利亚: [900001],
雷电将军: [900002]
}
const fixData = {
4: {
@ -42,7 +44,7 @@ const CharData = {
ret.elem = title('Element').toLowerCase()
ret.allegiance = title('Occupation')
ret.weapon = title('Weapon').toLowerCase()
ret.birthday = title('Month of Birth') + '-' + title('Day of Birth')
ret.birth = title('Month of Birth') + '-' + title('Day of Birth')
ret.astro = title('Constellation')
ret.desc = title('Description')
ret.cncv = fix.cncv || title('Chinese')