From 3aa62f025a8740231a56fc0d999b80ea43ebf834 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 14 Dec 2023 14:59:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0character[4]=E7=9A=84'tempnam?= =?UTF-8?q?e:'=E5=8F=82=E6=95=B0=EF=BC=8C=E4=BE=BF=E4=BA=8E=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E7=BB=99=E4=B8=80=E4=B8=AA=E6=AD=A6=E5=B0=86=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=8F=A6=E4=B8=80=E4=B8=AAid=E7=9A=84=E6=AD=A6?= =?UTF-8?q?=E5=B0=86=E7=9A=84audioname=E5=92=8Caudioname2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/game/game.js b/game/game.js index 59fadf260..717b37636 100644 --- a/game/game.js +++ b/game/game.js @@ -37688,13 +37688,31 @@ new Promise(resolve=>{ let audioInfo=info.audio; if(info.audioname2){ - if(info.audioname2[player.name]) audioInfo=info.audioname2[player.name]; - else if(info.audioname2[player.name1]) audioInfo=info.audioname2[player.name1]; - else if(info.audioname2[player.name2]) audioInfo=info.audioname2[player.name2]; + if(player.name&&info.audioname2[player.name]) audioInfo=info.audioname2[player.name]; + else if(player.name1&&info.audioname2[player.name1]) audioInfo=info.audioname2[player.name1]; + else if(player.name2&&info.audioname2[player.name2]) audioInfo=info.audioname2[player.name2]; else if(player.tempname){ const name=player.tempname.find(i=>info.audioname2[i]); if(name) audioInfo=info.audioname2[name]; } + else if(player.name&&get.character(player.name)&&get.character(player.name)[4]&&get.character(player.name)[4].some(tag=>tag.startsWith('tempname:'))){ + const list=get.character(player.name)[4].find(tag=>tag.startsWith('tempname:')); + list=list.split(':').slice(1); + const name=list.find(i=>info.audioname2[i]); + if(name) audioInfo=info.audioname2[name]; + } + else if(player.name1&&get.character(player.name1)&&get.character(player.name1)[4]&&get.character(player.name1)[4].some(tag=>tag.startsWith('tempname:'))){ + const list=get.character(player.name1)[4].find(tag=>tag.startsWith('tempname:')); + list=list.split(':').slice(1); + const name=list.find(i=>info.audioname2[i]); + if(name) audioInfo=info.audioname2[name]; + } + else if(player.name2&&get.character(player.name2)&&get.character(player.name2)[4]&&get.character(player.name2)[4].some(tag=>tag.startsWith('tempname:'))){ + const list=get.character(player.name2)[4].find(tag=>tag.startsWith('tempname:')); + list=list.split(':').slice(1); + const name=list.find(i=>info.audioname2[i]); + if(name) audioInfo=info.audioname2[name]; + } } if(typeof audioInfo=='function') audioInfo=audioInfo(player); @@ -37736,13 +37754,31 @@ new Promise(resolve=>{ let list=audioInfo.match(/(?:(.*):|^)(true|\d+)(?::(.*)|$)/); if(list&&list[2]){ let _audioname=''; - if(audioname.includes(player.name)) _audioname=`_${player.name}`; - else if(audioname.includes(player.name1)) _audioname=`_${player.name1}`; - else if(audioname.includes(player.name2)) _audioname=`_${player.name2}`; + if(player.name&&audioname.includes(player.name)) _audioname=`_${player.name}`; + else if(player.name1&&audioname.includes(player.name1)) _audioname=`_${player.name1}`; + else if(player.name2&&audioname.includes(player.name2)) _audioname=`_${player.name2}`; else if(player.tempname){ const name=player.tempname.find(i=>audioname.includes(i)); if(name) _audioname=`_${name}`; } + else if(player.name&&get.character(player.name)&&get.character(player.name)[4]&&get.character(player.name)[4].some(tag=>tag.startsWith('tempname:'))){ + const list=get.character(player.name)[4].find(tag=>tag.startsWith('tempname:')); + list=list.split(':').slice(1); + const name=list.find(i=>audioname.includes(i)); + if(name) _audioname=`_${player.name}`; + } + else if(player.name1&&get.character(player.name1)&&get.character(player.name1)[4]&&get.character(player.name1)[4].some(tag=>tag.startsWith('tempname:'))){ + const list=get.character(player.name1)[4].find(tag=>tag.startsWith('tempname:')); + list=list.split(':').slice(1); + const name=list.find(i=>audioname.includes(i)); + if(name) _audioname=`_${player.name1}`; + } + else if(player.name2&&get.character(player.name2)&&get.character(player.name2)[4]&&get.character(player.name2)[4].some(tag=>tag.startsWith('tempname:'))){ + const list=get.character(player.name2)[4].find(tag=>tag.startsWith('tempname:')); + list=list.split(':').slice(1); + const name=list.find(i=>audioname.includes(i)); + if(name) _audioname=`_${player.name2}`; + } list=list.slice(1);//[路径,number/true,格式] if(list[1]=='true') audioList.add(`${list[0]||'skill'}/${skill}${_audioname}.${list[2]||'mp3'}`);