mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-22 11:00:51 +08:00
优化武器别名匹配,增加*银狼四星专武
匹配
This commit is contained in:
parent
79597dae99
commit
5cdbda77a2
@ -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.star<role.star){
|
||||
roleData=role
|
||||
}
|
||||
}
|
||||
if(roleData){
|
||||
let newMaterial=[]
|
||||
for (const materialElement of roleData.material) {
|
||||
|
@ -7414,7 +7414,9 @@
|
||||
"三月七",
|
||||
"开拓者"
|
||||
],
|
||||
"belongRole": [],
|
||||
"belongRole": [
|
||||
"杰帕德"
|
||||
],
|
||||
"values": [
|
||||
{
|
||||
"hp": {
|
||||
@ -13885,6 +13887,7 @@
|
||||
"佩拉"
|
||||
],
|
||||
"belongRole": [
|
||||
"银狼"
|
||||
],
|
||||
"names": ["新手任务前","游戏开始前","游戏开始"],
|
||||
"attribute": "使装备者的效果命中提高<span class='text-num'>20%/25%/30%/35%/40%</span>。当装备者攻击防御力被降低的敌方目标后,恢复<span class='text-num'>4/5/6/7/8</span>点能量。",
|
||||
|
Loading…
Reference in New Issue
Block a user