This commit is contained in:
Spmario233 2023-10-17 22:51:51 +08:00
parent 89186ff31b
commit ab87506a79
1 changed files with 23 additions and 18 deletions

View File

@ -22637,7 +22637,7 @@
player.hujia=hujia; player.hujia=hujia;
player.$update(); player.$update();
},this,this.hp,this.maxHp,this.hujia); },this,this.hp,this.maxHp,this.hujia);
this.$update(); this.$update(...arguments);
} }
$update(){ $update(){
if(this.hp>=this.maxHp) this.hp=this.maxHp; if(this.hp>=this.maxHp) this.hp=this.maxHp;
@ -36076,25 +36076,30 @@
} }
}, },
playAudio:function(){ playAudio:function(){
if(_status.video&&arguments[1]!='video') return;
let path='',emptyPath=true,notCheckDBPath=true,onError=null; let path='',emptyPath=true,notCheckDBPath=true,onError=null;
for(const argument of arguments){ if(_status.video){
if(typeof argument==='string'||typeof argument=='number'){ if(arguments[1]!='video') return;
if(emptyPath) emptyPath=false; path=arguments[0];
else if(notCheckDBPath){ }
notCheckDBPath=false; else{
if(/^db:extension-[^:]*$/.test(path)) path+=':'; for(const argument of arguments){
else path+='/'; if(typeof argument==='string'||typeof argument=='number'){
} if(emptyPath) emptyPath=false;
else path+='/'; else if(notCheckDBPath){
path+=argument; notCheckDBPath=false;
} if(/^db:extension-[^:]*$/.test(path)) path+=':';
else if(typeof argument=='function') onError=argument; else path+='/';
if(_status.video) break; }
else path+='/';
path+=argument;
}
else if(typeof argument=='function') onError=argument;
if(_status.video) break;
}
if(path.startsWith('ext:')) path=path.replace(/^ext:/,'extension/');
else if(!path.startsWith('db:')) path=`audio/${path}`;
if(!lib.config.repeat_audio&&_status.skillaudio.contains(path)) return;
} }
if(path.startsWith('ext:')) path=path.replace(/^ext:/,'extension/');
else if(!path.startsWith('db:')) path=`audio/${path}`;
if(!lib.config.repeat_audio&&_status.skillaudio.contains(path)) return;
_status.skillaudio.add(path); _status.skillaudio.add(path);
game.addVideo('playAudio',null,path); game.addVideo('playAudio',null,path);
setTimeout(()=>_status.skillaudio.remove(path),1000); setTimeout(()=>_status.skillaudio.remove(path),1000);