优化audio为数组时的skill获取

This commit is contained in:
mengxinzxz 2023-11-28 15:56:35 +08:00
parent af454aa7b6
commit 64fad7e280
1 changed files with 20 additions and 12 deletions

View File

@ -10677,18 +10677,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
skills.forEach(skill=>{ skills.forEach(skill=>{
var info=lib.skill[skill]; var info=lib.skill[skill];
if(!info.audioname2) info.audioname2={}; if(info){
if(info.audioname&&info.audioname.includes(character)){ if(!info.audioname2) info.audioname2={};
if(info.audio&&typeof info.audio=='string') skill=info.audio; if(info.audioname&&info.audioname.includes(character)){
if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2}; if(info.audio){
info.audioname2[name]=(skill+'_'+character); if(typeof info.audio=='string') skill=info.audio;
} if(Array.isArray(info.audio)) skill=info.audio[0];
else if(info.audioname2[character]){ }
info.audioname2[name]=info.audioname2[character]; if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2};
} info.audioname2[name]=(skill+'_'+character);
else{ }
if(info.audio&&typeof info.audio=='string') skill=info.audio; else if(info.audioname2[character]){
info.audioname2[name]=skill; info.audioname2[name]=info.audioname2[character];
}
else{
if(info.audio){
if(typeof info.audio=='string') skill=info.audio;
if(Array.isArray(info.audio)) skill=info.audio[0];
}
info.audioname2[name]=skill;
}
} }
}); });
}, },