damage函数优化

添加不同伤害配音和打中护甲的配音
添加给真实伤害使用的额外特殊时机damageBegin5
This commit is contained in:
mengxinzxz 2023-09-19 09:00:34 +08:00 committed by GitHub
parent 4706a4a059
commit 3e2e17231e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 7 deletions

View File

@ -18488,14 +18488,31 @@
event.trigger('damageBegin4');
"step 4"
//moved changeHujia to changeHp
if(lib.config.background_audio){
game.playAudio('effect','damage'+(num>1?'2':''));
}
game.broadcast(function(num){
if(lib.config.background_audio){
game.playAudio('effect','damage'+(num>1?'2':''));
if(!event.unreal) event.trigger('damageBegin5');
if(['fire','thunder','ice'].contains(event.nature)){
if(player.hujia>0&&!player.hasSkillTag('nohujia')&&event.nature!='ice'){
game.broadcastAll(function(num){
if(lib.config.background_audio) game.playAudio('effect','hujia_damage_'+event.nature+(num>1?'2':''));
},num);
}
},num);
else{
game.broadcastAll(function(num){
if(lib.config.background_audio) game.playAudio('effect','damage_'+event.nature+(num>1?'2':''));
},num);
}
}
else{
if(player.hujia>0&&!player.hasSkillTag('nohujia')){
game.broadcastAll(function(num){
if(lib.config.background_audio) game.playAudio('effect','hujia_damage'+(num>1?'2':''));
},num);
}
else{
game.broadcastAll(function(num){
if(lib.config.background_audio) game.playAudio('effect','damage'+(num>1?'2':''));
},num);
}
}
var str=event.unreal?'视为受到了':'受到了';
if(source) str+='来自<span class="bluetext">'+(source==player?'自己':get.translation(source))+'</span>的';
str+=get.cnNumber(num)+'点';