From 5cdbda77a2f4d3d4120503f920a9e2c0f00678c2 Mon Sep 17 00:00:00 2001 From: ctrlcvs <1509167646@qq.com> Date: Wed, 7 Jun 2023 18:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=AD=A6=E5=99=A8=E5=88=AB?= =?UTF-8?q?=E5=90=8D=E5=8C=B9=E9=85=8D=EF=BC=8C=E5=A2=9E=E5=8A=A0`*?= =?UTF-8?q?=E9=93=B6=E7=8B=BC=E5=9B=9B=E6=98=9F=E4=B8=93=E6=AD=A6`?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/srGallery.js | 25 +++++++++++++++++++------ resources/sr/weapon/data.json | 5 ++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/model/srGallery.js b/model/srGallery.js index e25f9e1..4654a94 100644 --- a/model/srGallery.js +++ b/model/srGallery.js @@ -22,25 +22,38 @@ export async function AtlasAlias(e,{render}) { export async function GetData(e) { - let name=e.msg.replace(/\*|#|星铁|星穹铁道|图鉴|专武/g,'') + let name=e.msg.replace(/\*|#|星铁|(四|4)星|(五|5)星|星穹铁道|图鉴|专武/g,'') let list = Data.readJSON(pathPlus, 'weapon/data.json') let items = Data.readJSON(pathPlus, 'items/data.json') let role=GetRole(name) + let isUp=false; if(role) { name=role.name + isUp=true } - let roleData; - let isUp=e.msg.includes('专武'); + let roleData,roleList =[]; lodash.forEach(list,(v,k)=>{ if(isUp&&v.belongRole.includes(name)){ - roleData= v + roleList.push(v) return }else if([v.name,...v.names,...v?.suitRole].includes(name)&&!isUp){ - roleData= v + roleList.push(v) return } }) - + let isUp4=/4|四/.test(e.msg) + let isUp5=/5|五/.test(e.msg) + if(roleList.length==0) return false + roleData=roleList[0] + for (const role of roleList) { + if(isUp4&&role.star==4){ + roleData=role + }else if (isUp5&&role.star==5){ + roleData=role + }else if(!isUp4&&!isUp5&&roleData.star20%/25%/30%/35%/40%。当装备者攻击防御力被降低的敌方目标后,恢复4/5/6/7/8点能量。",