完善护甲机制,修复护甲失效时damagepop不正确的bug

This commit is contained in:
CatIgnore 2023-10-23 23:38:44 +08:00 committed by GitHub
parent f6fd5259de
commit 4b69a510c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -19504,6 +19504,7 @@
event.hujia=Math.min(-num,player.hujia); event.hujia=Math.min(-num,player.hujia);
event.getParent().hujia=event.hujia; event.getParent().hujia=event.hujia;
event.num+=event.hujia; event.num+=event.hujia;
//log moved to changeHujia
//game.log(player,'的护甲抵挡了'+get.cnNumber(event.hujia)+'点伤害'); //game.log(player,'的护甲抵挡了'+get.cnNumber(event.hujia)+'点伤害');
player.changeHujia(-event.hujia).type='damage'; player.changeHujia(-event.hujia).type='damage';
} }
@ -19537,7 +19538,7 @@
num=-player.hujia; num=-player.hujia;
event.num=num; event.num=num;
} }
switch(event.type){ switch(event.type){ //log moved here
case 'damage': case 'damage':
game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害');
break; break;
@ -19547,9 +19548,9 @@
} }
} }
player.hujia+=num; player.hujia+=num;
// if(player.hujia<0){ /*if(player.hujia<0){
// player.hujia=0; player.hujia=0;
// } }*/
player.update(); player.update();
}, },
dying:function(){ dying:function(){