简化lib.skill.rehuashen.createAudio索引配音audioname2的写法,并添加可修改derivation的audioname2

This commit is contained in:
mengxinzxz 2023-11-28 12:35:01 +08:00
parent 9cc8c95982
commit 902e6c45a3
2 changed files with 28 additions and 23 deletions

View File

@ -10548,10 +10548,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.popup(link); player.popup(link);
player.syncStorage('rehuashen'); player.syncStorage('rehuashen');
player.updateMarks('rehuashen'); player.updateMarks('rehuashen');
var skills=game.expandSkills([link]); lib.skill.rehuashen.createAudio(event.card,link,'re_zuoci');
skills.forEach(skill=>{
lib.skill.rehuashen.createAudio(event.card,skill,'re_zuoci');
});
} }
}, },
init:function(player,skill){ init:function(player,skill){
@ -10667,9 +10664,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
return node; return node;
}, },
createAudio:(character,skill,name)=>{ createAudio:(character,skillx,name)=>{
var skills=game.expandSkills([skillx]);
skills=skills.filter(skill=>get.info(skill));
if(!skills.length) return;
var skillss=skills.filter(skill=>get.info(skill).derivation);
if(skillss.length){
skillss.forEach(skill=>{
var derivationSkill=get.info(skill).derivation;
skills[Array.isArray(derivationSkill)?'addArray':'add'](derivationSkill);
});
}
skills.forEach(skill=>{
var info=lib.skill[skill]; var info=lib.skill[skill];
if(!info) return;
if(!info.audioname2) info.audioname2={}; if(!info.audioname2) info.audioname2={};
if(info.audioname&&info.audioname.includes(character)){ if(info.audioname&&info.audioname.includes(character)){
if(info.audio&&typeof info.audio=='string') skill=info.audio; if(info.audio&&typeof info.audio=='string') skill=info.audio;
@ -10683,6 +10690,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(info.audio&&typeof info.audio=='string') skill=info.audio; if(info.audio&&typeof info.audio=='string') skill=info.audio;
info.audioname2[name]=skill; info.audioname2[name]=skill;
} }
});
}, },
mark:true, mark:true,
intro:{ intro:{

View File

@ -4459,10 +4459,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.popup(skill); player.popup(skill);
player.syncStorage('huashen'); player.syncStorage('huashen');
player.updateMarks('huashen'); player.updateMarks('huashen');
var skills=game.expandSkills([skill]); lib.skill.rehuashen.createAudio(character,skill,'zuoci');
skills.forEach(skillx=>{
lib.skill.rehuashen.createAudio(character,skillx,'zuoci');
});
} }
} }
} }