From 4fb155af69855d9c3c3842e4540b6efc8a07d1d7 Mon Sep 17 00:00:00 2001 From: Kokomi <1379177109@qq.com> Date: Wed, 1 Nov 2023 04:07:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/AvatarCard.js | 4 ++++ apps/profile/ProfileChange.js | 6 +++--- apps/wiki/CharWiki.js | 4 ++++ components/Cfg.js | 5 +++-- models/character/CharImg.js | 3 ++- models/serv/Serv.js | 2 +- resources/meta-sr/character/三月七/calc.js | 2 ++ resources/meta-sr/character/刃/calc.js | 2 ++ resources/meta-sr/character/娜塔莎/calc.js | 13 ++++--------- resources/meta-sr/character/罗刹/calc.js | 2 ++ resources/meta-sr/character/黑塔/calc.js | 2 ++ 11 files changed, 29 insertions(+), 16 deletions(-) diff --git a/apps/character/AvatarCard.js b/apps/character/AvatarCard.js index 2edf03e3..69d8e4ed 100644 --- a/apps/character/AvatarCard.js +++ b/apps/character/AvatarCard.js @@ -41,6 +41,10 @@ let Avatar = { return false } let bg = char.getCardImg(Cfg.get('charPicSe', false)) + if (!bg) { + e.reply(`${char.name}暂无角色图片`) + return true + } if (renderType === 'photo') { e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${bg.img}`)) return true diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index a0a7cc67..6672d728 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -277,7 +277,7 @@ const ProfileChange = { } // 设置圣遗物 - let artis = getSource(ds.artis)?.artis?.artis || {} + let artis = getSource(ds.artis)?.artis?.toJSON() || {} for (let idx = 1; idx <= (isGs ? 5 : 6); idx++) { if (ds['arti' + idx]) { let source = getSource(ds['arti' + idx]) @@ -290,8 +290,8 @@ const ProfileChange = { let as = ArtifactSet.get(ds.artisSet[artisIdx], game) if (as) { artis[idx].id = as.getArti(idx)?.getIdByStar(artis[idx].star || 5) - artis[idx]._name = artis[idx].name = as.getArtiName(idx) - artis[idx]._set = artis[idx].set = as.name + artis[idx].name = as.getArtiName(idx) + artis[idx].set = as.name } } } diff --git a/apps/wiki/CharWiki.js b/apps/wiki/CharWiki.js index c17fb2f1..9bcb3a80 100644 --- a/apps/wiki/CharWiki.js +++ b/apps/wiki/CharWiki.js @@ -76,6 +76,10 @@ const CharWiki = { e.reply('暂不支持该角色图鉴展示') return true } + if (char.isSr) { + e.reply('暂不支持星铁角色') + return true + } return await CharWiki.render({ e, char }) } else if (mode === 'material') { return CharMaterial.render({ e, char }) diff --git a/components/Cfg.js b/components/Cfg.js index 860b9b22..eabce460 100644 --- a/components/Cfg.js +++ b/components/Cfg.js @@ -22,11 +22,12 @@ try { } let Cfg = { - get (rote) { + get (rote, def = '') { if (Version.isMiao && miaoCfg[rote]) { return true } - return lodash.get(cfg, rote) + let ret = lodash.get(cfg, rote) + return lodash.isUndefined(cfg) ? def : ret }, set (rote, val) { cfg[rote] = val diff --git a/models/character/CharImg.js b/models/character/CharImg.js index b2a712c1..e58a6aba 100644 --- a/models/character/CharImg.js +++ b/models/character/CharImg.js @@ -44,7 +44,8 @@ const CharImg = { let img = lodash.sample(list) if (!img) { if (def) { - img = '/character-img/default/01.jpg' + // img = '/character-img/default/01.jpg' + return false } else { return false } diff --git a/models/serv/Serv.js b/models/serv/Serv.js index 9ffad35e..833d07ba 100644 --- a/models/serv/Serv.js +++ b/models/serv/Serv.js @@ -36,7 +36,7 @@ const Serv = { let servType = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 2, 7: 2, 8: 2, 9: 2 }[uid[0]] // 获取原神、星铁对应服务选择的配置 - let servCfg = Cfg.get(isGs ? 'profileServer' : 'srProfileServer', '0').toString() || '0' + let servCfg = (Cfg.get(isGs ? 'profileServer' : 'srProfileServer', '0') || '0').toString() let servIdx = servCfg[servType] || servCfg[0] || '0' // 设置为自动或1时,如果具备token则使用miao diff --git a/resources/meta-sr/character/三月七/calc.js b/resources/meta-sr/character/三月七/calc.js index 2db44205..85514c14 100644 --- a/resources/meta-sr/character/三月七/calc.js +++ b/resources/meta-sr/character/三月七/calc.js @@ -29,3 +29,5 @@ export const buffs = [{ tPlus: ({ calc, attr }) => calc(attr.def) * 0.3 } }] + +export const createdBy = 'Aluxes' diff --git a/resources/meta-sr/character/刃/calc.js b/resources/meta-sr/character/刃/calc.js index ce56bf50..84fbb68a 100644 --- a/resources/meta-sr/character/刃/calc.js +++ b/resources/meta-sr/character/刃/calc.js @@ -96,3 +96,5 @@ export const buffs = [{ tPlus: ({ attr, calc }) => calc(attr.hp) * 0.5 } }] + +export const createdBy = 'Aluxes' diff --git a/resources/meta-sr/character/娜塔莎/calc.js b/resources/meta-sr/character/娜塔莎/calc.js index 7e43a328..e533c5ec 100644 --- a/resources/meta-sr/character/娜塔莎/calc.js +++ b/resources/meta-sr/character/娜塔莎/calc.js @@ -8,20 +8,13 @@ export const details = [{ title: '战技治疗量(目标生命<=30%)', params: { tBuff: true }, dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.e['治疗·百分比生命'] + talent.e['治疗·固定值']) -}, { - title: '战技持续治疗量', - dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.e['复活·百分比生命'] + talent.e['复活·固定值']) -}, { - title: '战技持续治疗量(目标生命<=30%)', - params: { tBuff: true }, - dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.e['复活·百分比生命'] + talent.e['复活·固定值']) }, { title: '终结技治疗量', - dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.e['百分比生命'] + talent.e['固定值']) + dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.q['百分比生命'] + talent.q['固定值']) }, { title: '终结技治疗量(目标生命<=30%)', params: { tBuff: true }, - dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.e['百分比生命'] + talent.e['固定值']) + dmg: ({ talent, calc, attr }, { heal }) => heal(calc(attr.hp) * talent.q['百分比生命'] + talent.q['固定值']) }, { title: '1命治疗量', params: { tBuff: true }, @@ -54,3 +47,5 @@ export const buffs = [{ heal: 10 } }] + +export const createdBy = 'Aluxes' diff --git a/resources/meta-sr/character/罗刹/calc.js b/resources/meta-sr/character/罗刹/calc.js index 726fa87a..956e6ca0 100644 --- a/resources/meta-sr/character/罗刹/calc.js +++ b/resources/meta-sr/character/罗刹/calc.js @@ -41,3 +41,5 @@ export const buffs = [{ kx: 20 } }] + +export const createdBy = 'Aluxes' diff --git a/resources/meta-sr/character/黑塔/calc.js b/resources/meta-sr/character/黑塔/calc.js index f4b30332..df2069b2 100644 --- a/resources/meta-sr/character/黑塔/calc.js +++ b/resources/meta-sr/character/黑塔/calc.js @@ -56,3 +56,5 @@ export const buffs = [{ atkPct: 25 } }] + +export const createdBy = 'Aluxes'