mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
增加角色实装时间判定
增加莱依拉的角色图像
This commit is contained in:
parent
3f98642a9e
commit
4a4fdd1664
@ -14,7 +14,7 @@ export async function renderAvatar (e, avatar, renderType = 'card') {
|
||||
let mys = await MysApi.init(e)
|
||||
if (!mys) return true
|
||||
uid = mys.uid
|
||||
if (char.isCustom) {
|
||||
if (!char.isArrive) {
|
||||
avatar = { id: char.id, name: char.name, detail: false }
|
||||
} else {
|
||||
let profile = Profile.get(uid, char.id, true)
|
||||
@ -52,7 +52,8 @@ async function renderCard (e, ds, renderType = 'card') {
|
||||
let uid = e.uid || (e.targetUser && e.targetUser.uid)
|
||||
let data = {}
|
||||
let custom = char.isCustom
|
||||
if (!custom) {
|
||||
let arrive = char.isArrive
|
||||
if (arrive) {
|
||||
let mys = await MysApi.init(e)
|
||||
let avatar = new Avatar(ds, uid, mys.isSelfCookie)
|
||||
data = avatar.getData('id,name,sName,level,fetter,cons,weapon,elem,artis,artisSet,imgs,dataSourceName,updateTime')
|
||||
@ -82,6 +83,7 @@ async function renderCard (e, ds, renderType = 'card') {
|
||||
widthStyle: `<style>html,body,#container{width:${width}px} ${imgCss}</style>`,
|
||||
mode: bg.mode,
|
||||
custom,
|
||||
arrive,
|
||||
data
|
||||
}, { e, scale, retMsgId: true })
|
||||
if (msgRes && msgRes.message_id) {
|
||||
|
@ -126,6 +126,10 @@ export async function profileDetail (e) {
|
||||
e.reply('自定义角色暂不支持此功能')
|
||||
return true
|
||||
}
|
||||
if (!char.isArrive) {
|
||||
e.reply('角色尚未实装')
|
||||
return true
|
||||
}
|
||||
|
||||
if (mode === 'profile' || mode === 'dmg') {
|
||||
return renderProfile(e, char, mode, { dmgIdx })
|
||||
|
@ -1,7 +1,7 @@
|
||||
import HutaoApi from '../stat/HutaoApi.js';
|
||||
import lodash from 'lodash';
|
||||
import { Format } from '../../components/index.js';
|
||||
import { Artifact, ArtifactSet, Weapon } from '../../models/index.js';
|
||||
import { ArtifactSet, Weapon } from '../../models/index.js';
|
||||
|
||||
let CharWiki = {
|
||||
// 命座持有
|
||||
|
@ -43,6 +43,16 @@ class Character extends Base {
|
||||
return !/[12]0\d{6}/.test(this._id)
|
||||
}
|
||||
|
||||
get isArrive () {
|
||||
if (this.isCustom) {
|
||||
return false
|
||||
}
|
||||
if (this.eta) {
|
||||
return this.eta * 1 < new Date() * 1
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
get id () {
|
||||
return this.isCustom ? this._id : this._id * 1
|
||||
}
|
||||
|
BIN
resources/character-img/莱依拉/01.jpg
Normal file
BIN
resources/character-img/莱依拉/01.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 315 KiB |
BIN
resources/character-img/莱依拉/02.jpg
Normal file
BIN
resources/character-img/莱依拉/02.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 376 KiB |
BIN
resources/character-img/莱依拉/03.jpg
Normal file
BIN
resources/character-img/莱依拉/03.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 398 KiB |
BIN
resources/character-img/莱依拉/04.jpg
Normal file
BIN
resources/character-img/莱依拉/04.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 315 KiB |
@ -86,6 +86,8 @@
|
||||
{{else}}
|
||||
{{if custom}}
|
||||
<div class="no-info">自定义角色暂无角色信息</div>
|
||||
{{else if !arrive}}
|
||||
<div class="no-info">角色尚未实装,暂无信息</div>
|
||||
{{else}}
|
||||
<div class="no-info">未能获取到角色信息,请将角色放置在米游社角色展柜中</div>
|
||||
{{/if}}
|
||||
|
@ -44,5 +44,6 @@
|
||||
"normal": "孢囊晶尘",
|
||||
"talent": "「笃行」的哲学",
|
||||
"weekly": "祸神之禊泪"
|
||||
}
|
||||
},
|
||||
"eta": 1665741600000
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
"id": 10000073,
|
||||
"name": "纳西妲",
|
||||
"abbr": "纳西妲",
|
||||
"title": "???",
|
||||
"title": "白草净华",
|
||||
"star": 5,
|
||||
"elem": "dendro",
|
||||
"allegiance": "???",
|
||||
@ -40,5 +40,6 @@
|
||||
"normal": "孢囊晶尘",
|
||||
"talent": "「巧思」的哲学",
|
||||
"weekly": "???"
|
||||
}
|
||||
},
|
||||
"eta": 1667358000000
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
"id": 10000074,
|
||||
"name": "莱依拉",
|
||||
"abbr": "莱依拉",
|
||||
"title": "???",
|
||||
"title": "绮思晚星",
|
||||
"star": 4,
|
||||
"elem": "hydro",
|
||||
"allegiance": "???",
|
||||
@ -40,5 +40,6 @@
|
||||
"normal": "禁咒绘卷",
|
||||
"talent": "「巧思」的哲学",
|
||||
"weekly": "???"
|
||||
}
|
||||
},
|
||||
"eta": 1667358000000
|
||||
}
|
@ -1274,7 +1274,7 @@
|
||||
"star": 4
|
||||
},
|
||||
"???": {
|
||||
"id": "n113041",
|
||||
"id": "n113042",
|
||||
"name": "???",
|
||||
"type": "weekly",
|
||||
"star": 5
|
||||
|
@ -157,6 +157,9 @@ async function saveCharData (id, key, name = '', force = false, _id = id) {
|
||||
if (checkName(name) && !force) {
|
||||
return
|
||||
}
|
||||
if (eta[name]) {
|
||||
data.eta = new Date(eta[name]) * 1
|
||||
}
|
||||
let charPath = `${_path}/plugins/miao-plugin/resources/meta/character/${name}/`
|
||||
fs.writeFileSync(`${charPath}data.json`, JSON.stringify(data, '', 2))
|
||||
if (details.length === 1) {
|
||||
@ -253,4 +256,9 @@ const charData = {
|
||||
73: { key: 'nahida', name: '纳西妲' },
|
||||
74: { key: 'layla', name: '莱依拉' }
|
||||
}
|
||||
await down('73', true)
|
||||
let eta = {
|
||||
妮露: '2022-10-14 18:00:00',
|
||||
纳西妲: '2022-11-02 11:00:00',
|
||||
莱依拉: '2022-11-02 11:00:00'
|
||||
}
|
||||
await down('73,74', true)
|
||||
|
@ -1,5 +1,6 @@
|
||||
import abbr from './abbr.js'
|
||||
import lodash from 'lodash'
|
||||
import fixData from './fixData.js'
|
||||
|
||||
let costumes = {
|
||||
琴: [200301], // 琴
|
||||
@ -9,20 +10,6 @@ let costumes = {
|
||||
迪卢克: [201601], // 迪卢克
|
||||
菲谢尔: [203101], // 菲谢尔
|
||||
}
|
||||
const fixData = {
|
||||
4: {
|
||||
id: 20000000,
|
||||
title: '异界的旅人',
|
||||
cncv: '宴宁/鹿喑',
|
||||
jpcv: '悠木碧/堀江瞬'
|
||||
},
|
||||
5: {
|
||||
title: '异界的旅人'
|
||||
},
|
||||
7: {
|
||||
title: '异界的旅人'
|
||||
}
|
||||
}
|
||||
|
||||
const CharData = {
|
||||
getBasic ($, id, name = '', _id = id) {
|
||||
|
20
tools/sprider/fixData.js
Normal file
20
tools/sprider/fixData.js
Normal file
@ -0,0 +1,20 @@
|
||||
export default {
|
||||
4: {
|
||||
id: 20000000,
|
||||
title: '异界的旅人',
|
||||
cncv: '宴宁/鹿喑',
|
||||
jpcv: '悠木碧/堀江瞬'
|
||||
},
|
||||
5: {
|
||||
title: '异界的旅人'
|
||||
},
|
||||
7: {
|
||||
title: '异界的旅人'
|
||||
},
|
||||
73: {
|
||||
title: '白草净华'
|
||||
},
|
||||
74: {
|
||||
title: '绮思晚星'
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user