Merge pull request #574 from CatIgnore/update-changeHujia
完善护甲机制,修复护甲失效时damagepop不正确的bug
This commit is contained in:
commit
52ee2958e6
42
game/game.js
42
game/game.js
|
@ -19909,7 +19909,7 @@
|
|||
}
|
||||
}
|
||||
},natures,player);
|
||||
var numx=Math.max(0,num-player.hujia);
|
||||
var numx=player.hasSkillTag('nohujia')?num:Math.max(0,num-player.hujia);
|
||||
player.$damagepop(-numx,natures[0]);
|
||||
}
|
||||
if(event.unreal) event.goto(6)
|
||||
|
@ -20047,7 +20047,8 @@
|
|||
event.hujia=Math.min(-num,player.hujia);
|
||||
event.getParent().hujia=event.hujia;
|
||||
event.num+=event.hujia;
|
||||
game.log(player,'的护甲抵挡了'+get.cnNumber(event.hujia)+'点伤害');
|
||||
//log moved to changeHujia
|
||||
//game.log(player,'的护甲抵挡了'+get.cnNumber(event.hujia)+'点伤害');
|
||||
player.changeHujia(-event.hujia).type='damage';
|
||||
}
|
||||
//old part
|
||||
|
@ -20072,13 +20073,27 @@
|
|||
event.trigger('changeHp');
|
||||
},
|
||||
changeHujia:function(){
|
||||
player.hujia+=num;
|
||||
if(num>0){
|
||||
game.log(player,'获得了'+get.cnNumber(num)+'点护甲');
|
||||
}
|
||||
if(player.hujia<0){
|
||||
player.hujia=0;
|
||||
else if(num<0){
|
||||
if(-num>player.hujia){
|
||||
num=-player.hujia;
|
||||
event.num=num;
|
||||
}
|
||||
switch(event.type){ //log moved here
|
||||
case 'damage':
|
||||
game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害');
|
||||
break;
|
||||
case 'lose':
|
||||
game.log(player,'失去了'+get.cnNumber(-num)+'点护甲');
|
||||
break;
|
||||
}
|
||||
}
|
||||
player.hujia+=num;
|
||||
//if(player.hujia<0){
|
||||
// player.hujia=0;
|
||||
//}
|
||||
player.update();
|
||||
},
|
||||
dying:function(){
|
||||
|
@ -25501,16 +25516,19 @@
|
|||
if(typeof num!='number'){
|
||||
num=1;
|
||||
}
|
||||
next.num=num;
|
||||
next.player=this;
|
||||
if(type) next.type=type;
|
||||
next.setContent('changeHujia');
|
||||
if(limit===true) limit=5;
|
||||
if(typeof limit=='number'&&this.hujia+num>parseInt(limit)){
|
||||
var numx=parseInt(limit)-this.hujia;
|
||||
if(numx>0) next.num=numx;
|
||||
else _status.event.next.remove(next);
|
||||
num=Math.max(0, parseInt(limit)-this.hujia);
|
||||
}
|
||||
if(typeof type!='string'){
|
||||
if(num>0) type='gain';
|
||||
else if(num<0) type='lose';
|
||||
else type='null';
|
||||
}
|
||||
next.num=num;
|
||||
next.player=this;
|
||||
next.type=type;
|
||||
next.setContent('changeHujia');
|
||||
return next;
|
||||
}
|
||||
getBuff(){
|
||||
|
|
Loading…
Reference in New Issue