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
56206b1296
commit
1b173e7b3d
@ -39,20 +39,20 @@ const ProfileChange = {
|
||||
const isGs = game === 'gs'
|
||||
const keyMap = isGs ? {
|
||||
artis: '圣遗物',
|
||||
arti1: '花',
|
||||
arti2: '毛,羽,羽毛',
|
||||
arti3: '沙,沙漏,表',
|
||||
arti4: '杯,杯子',
|
||||
arti5: '头,冠',
|
||||
arti1: '花,生之花',
|
||||
arti2: '毛,羽,羽毛,死之羽',
|
||||
arti3: '沙,沙漏,表,时之沙',
|
||||
arti4: '杯,杯子,空之杯',
|
||||
arti5: '头,冠,理之冠,礼冠,帽子,帽',
|
||||
weapon: '武器'
|
||||
} : {
|
||||
artis: '圣遗物,遗器',
|
||||
arti1: '头,帽子',
|
||||
arti2: '手,手套',
|
||||
arti3: '衣,衣服,甲,躯干',
|
||||
arti4: '鞋,靴,鞋子,靴子',
|
||||
arti5: '球',
|
||||
artis6: '绳',
|
||||
arti1: '头,帽子,头部',
|
||||
arti2: '手,手套,手部',
|
||||
arti3: '衣,衣服,甲,躯干,',
|
||||
arti4: '鞋,靴,鞋子,靴子,脚,脚部',
|
||||
arti5: '球,位面球',
|
||||
artis6: '绳,线,链接绳,连接绳',
|
||||
weapon: '武器,光锥'
|
||||
}
|
||||
let keyTitleMap = {}
|
||||
@ -80,7 +80,10 @@ const ProfileChange = {
|
||||
let keyRet = keyReg.exec(txt)
|
||||
if (keyRet && keyRet[4]) {
|
||||
let char = Character.get(lodash.trim(keyRet[2]))
|
||||
if (char && (char.game === game)) {
|
||||
if (char) {
|
||||
if (char.game !== game) {
|
||||
return true
|
||||
}
|
||||
lodash.forEach(keyRet[4].split('+'), (key) => {
|
||||
key = lodash.trim(key)
|
||||
let type = keyTitleMap[key]
|
||||
@ -90,7 +93,7 @@ const ProfileChange = {
|
||||
type
|
||||
}
|
||||
})
|
||||
} else if (!['武器', '光锥', '花', '手'].includes(keyRet[4])) {
|
||||
} else if (keyRet[4].length > 2) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -124,12 +124,16 @@ export default class AvatarData extends Base {
|
||||
this._costume = ds.costume || this._costume || 0
|
||||
this.elem = ds.elem || this.elem || this.char.elem || ''
|
||||
this.promote = lodash.isUndefined(ds.promote) ? (this.promote || AttrCalc.calcPromote(this.level)) : (ds.promote || 0)
|
||||
this.trees = ds.trees || this.trees || []
|
||||
this.trees = this.trees || []
|
||||
this._source = ds._source || this._source || ''
|
||||
this._time = ds._time || this._time || now
|
||||
this._update = ds._update || this._update || ds._time || now
|
||||
this._talent = ds._talent || this._talent || ds._time || now
|
||||
|
||||
if (ds.trees) {
|
||||
this.setTrees(ds.trees)
|
||||
}
|
||||
|
||||
// 存在数据源时更新时间
|
||||
if (source) {
|
||||
this._update = now
|
||||
@ -143,6 +147,28 @@ export default class AvatarData extends Base {
|
||||
}
|
||||
}
|
||||
|
||||
setTrees (ds) {
|
||||
this.trees = []
|
||||
let prefix = ''
|
||||
let map = {}
|
||||
lodash.forEach(this.char?.detail?.tree || {}, (ds, key) => {
|
||||
let ret = /(\d{4})(\d{3})/.exec(key)
|
||||
if (ret && ret[1] && ret[2]) {
|
||||
prefix = prefix || ret[1]
|
||||
map[ret[2]] = key
|
||||
}
|
||||
})
|
||||
if (prefix) {
|
||||
for (let i = 0; i <= 3; i++) {
|
||||
map[`10${i}`] = `${prefix}10${i}`
|
||||
}
|
||||
}
|
||||
lodash.forEach(ds,(id)=>{
|
||||
let ret = /\d{4}(\d{3})/.exec(id)
|
||||
this.trees.push(map[ret?.[1] || id] || id)
|
||||
})
|
||||
}
|
||||
|
||||
setWeapon (ds = {}) {
|
||||
let w = Weapon.get(ds.name || ds.id, this.game)
|
||||
if (!w) {
|
||||
|
@ -74,8 +74,11 @@ class Weapon extends Base {
|
||||
}
|
||||
|
||||
get maxAffix () {
|
||||
let datas = this.detail?.affixData?.datas || {}
|
||||
return (datas['0'] && datas['0'][4]) ? 5 : 1
|
||||
if(this.isSr){
|
||||
return 5
|
||||
}
|
||||
let data = this.detail?.affixData?.datas || {}
|
||||
return (data['0'] && data['0'][4]) ? 5 : 1
|
||||
}
|
||||
|
||||
static isWeaponSet (name) {
|
||||
|
@ -82,7 +82,7 @@ export const abbr = {
|
||||
伊须磨洲的坼裂缆索: '伊须磨洲的缆索',
|
||||
|
||||
盗匪荒漠的废土客: '虚数套',
|
||||
繁星璀璨的天才: '繁星',
|
||||
繁星璀璨的天才: '量子套',
|
||||
激奏雷电的乐队: '雷套',
|
||||
熔岩锻铸的火匠: '火套',
|
||||
晨昏交界的翔鹰: '风套',
|
||||
@ -109,14 +109,14 @@ export const abbr = {
|
||||
|
||||
let aliasCfg = {
|
||||
盗匪荒漠的废土客: '虚数套,废土',
|
||||
繁星璀璨的天才: '繁星',
|
||||
繁星璀璨的天才: '量子套',
|
||||
激奏雷电的乐队: '雷套,雷电',
|
||||
熔岩锻铸的火匠: '火套',
|
||||
晨昏交界的翔鹰: '风套',
|
||||
野穗伴行的快枪手: '快枪手,快枪',
|
||||
密林卧雪的猎人: '冰套',
|
||||
流星追迹的怪盗: '怪盗',
|
||||
街头出身的拳王: '拳王',
|
||||
街头出身的拳王: '拳王,物理套',
|
||||
云无留迹的过客: '过客,云无留迹',
|
||||
戍卫风雪的铁卫: '铁卫,风雪',
|
||||
净庭教宗的圣骑士: '圣骑士,圣骑士',
|
||||
|
@ -106,8 +106,8 @@ let aliasCfg = {
|
||||
'睿见': '',
|
||||
'「我」的诞生': '我的诞生',
|
||||
'别让世界静下来': '让世界静下来',
|
||||
'天才们的休憩': '天才的休憩',
|
||||
'早餐的仪式感': '早餐',
|
||||
'天才们的休憩': '天才的休憩,天才',
|
||||
'早餐的仪式感': '早餐,仪式感',
|
||||
'今日亦是和平的一日': '和平的一日,和平一日',
|
||||
'银河铁道之夜': '银河铁道,星穹铁道之夜,星穹铁道',
|
||||
'拂晓之前': '拂晓'
|
||||
|
Loading…
Reference in New Issue
Block a user