From 81413bc49499187e07f050be5393061026d1c248 Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Tue, 24 Oct 2023 00:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A4=E7=94=B2=E4=B8=8A?= =?UTF-8?q?=E9=99=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化护甲超出上限后的获得逻辑 --- game/game.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/game/game.js b/game/game.js index 599e317d9..053f00a5a 100644 --- a/game/game.js +++ b/game/game.js @@ -19548,9 +19548,9 @@ } } player.hujia+=num; - /*if(player.hujia<0){ - player.hujia=0; - }*/ + //if(player.hujia<0){ + // player.hujia=0; + //} player.update(); }, dying:function(){ @@ -24793,6 +24793,10 @@ if(typeof num!='number'){ num=1; } + if(limit===true) limit=5; + if(typeof limit=='number'&&this.hujia+num>parseInt(limit)){ + num=Math.max(0, parseInt(limit)-this.hujia); + } if(typeof type!='string'){ if(num>0) type='gain'; else if(num<0) type='lose'; @@ -24802,12 +24806,6 @@ next.player=this; 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); - } return next; }, getBuff:function(){