From 9635174f26f8a239670cd31720ab894e2c9e6caa Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:07:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=96=99=E9=A1=B5=E8=AF=95=E5=90=AC?= =?UTF-8?q?=E9=98=B5=E4=BA=A1=E9=85=8D=E9=9F=B3=E5=85=88=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E6=97=A7=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index 4c3ce75fe..edd193bb6 100644 --- a/game/game.js +++ b/game/game.js @@ -54247,7 +54247,66 @@ clickSkill.call(skillnode,'init'); }); } - if(e!=='init') game.trySkillAudio(this.link,playername); + // if(e!=='init') game.trySkillAudio(this.link,playername); + // 有bug,先用旧版 + if(lib.config.background_speak&&e!=='init'){ + var audioname=this.link; + if(info.audioname2&&info.audioname2[playername]){ + audioname=info.audioname2[playername]; + info=lib.skill[audioname]; + } + var audioinfo=info.audio; + var that=this; + var getIndex=function(i){ + if(typeof that.audioindex!='number'){ + that.audioindex=i; + } + that.audioindex++; + if(that.audioindex>i){ + that.audioindex=1; + } + return that.audioindex; + }; + if(typeof audioinfo=='string'){ + if(audioinfo.indexOf('ext:')==0){ + audioinfo=audioinfo.split(':'); + if(audioinfo.length==3){ + if(audioinfo[2]=='true'){ + game.playAudio('..','extension',audioinfo[1],audioname); + } + else{ + audioinfo[2]=parseInt(audioinfo[2]); + if(audioinfo[2]){ + game.playAudio('..','extension',audioinfo[1],audioname+getIndex(audioinfo[2])); + } + } + } + return; + } + else{ + audioname=audioinfo; + if(lib.skill[audioinfo]){ + audioinfo=lib.skill[audioinfo].audio; + } + } + } + else if(Array.isArray(audioinfo)){ + audioname=audioinfo[0]; + audioinfo=audioinfo[1]; + } + if(typeof audioinfo=='number'){ + if(Array.isArray(info.audioname)&&info.audioname.contains(playername)) audioname=audioname+'_'+playername; + game.playAudio('skill',audioname+getIndex(audioinfo)); + } + else if(audioinfo){ + if(Array.isArray(info.audioname)&&info.audioname.contains(playername)) audioname=audioname+'_'+playername; + game.playAudio('skill',audioname); + } + else if(true&&info.audio!==false){ + if(Array.isArray(info.audioname)&&info.audioname.contains(playername)) audioname=audioname+'_'+playername; + game.playSkillAudio(audioname,getIndex(2)); + } + } } }else{ // 样式一 @@ -54446,7 +54505,66 @@ clickSkill.call(skillnode,'init'); }); } - if(e!=='init') game.trySkillAudio(this.link,playername); + // if(e!=='init') game.trySkillAudio(this.link,playername); + // 有bug,先用旧版 + if(lib.config.background_speak&&e!=='init'){ + var audioname=this.link; + if(info.audioname2&&info.audioname2[playername]){ + audioname=info.audioname2[playername]; + info=lib.skill[audioname]; + } + var audioinfo=info.audio; + var that=this; + var getIndex=function(i){ + if(typeof that.audioindex!='number'){ + that.audioindex=i; + } + that.audioindex++; + if(that.audioindex>i){ + that.audioindex=1; + } + return that.audioindex; + }; + if(typeof audioinfo=='string'){ + if(audioinfo.indexOf('ext:')==0){ + audioinfo=audioinfo.split(':'); + if(audioinfo.length==3){ + if(audioinfo[2]=='true'){ + game.playAudio('..','extension',audioinfo[1],audioname); + } + else{ + audioinfo[2]=parseInt(audioinfo[2]); + if(audioinfo[2]){ + game.playAudio('..','extension',audioinfo[1],audioname+getIndex(audioinfo[2])); + } + } + } + return; + } + else{ + audioname=audioinfo; + if(lib.skill[audioinfo]){ + audioinfo=lib.skill[audioinfo].audio; + } + } + } + else if(Array.isArray(audioinfo)){ + audioname=audioinfo[0]; + audioinfo=audioinfo[1]; + } + if(typeof audioinfo=='number'){ + if(Array.isArray(info.audioname)&&info.audioname.contains(playername)) audioname=audioname+'_'+playername; + game.playAudio('skill',audioname+getIndex(audioinfo)); + } + else if(audioinfo){ + if(Array.isArray(info.audioname)&&info.audioname.contains(playername)) audioname=audioname+'_'+playername; + game.playAudio('skill',audioname); + } + else if(true&&info.audio!==false){ + if(Array.isArray(info.audioname)&&info.audioname.contains(playername)) audioname=audioname+'_'+playername; + game.playSkillAudio(audioname,getIndex(2)); + } + } } }