From 644a534b4ee19810a391bd5284267a63346139d3 Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Sun, 22 Oct 2023 00:34:21 +0800 Subject: [PATCH 1/8] Update changeHujia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改changeHujia函数,增加失去护甲的log,将护甲抵挡伤害的log移动至该函数 对应谋曹仁(及可能出现的谋关羽)等武将的不因伤害而失去护甲的机制 --- game/game.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/game/game.js b/game/game.js index 583cc86ae..6df8eb5b4 100644 --- a/game/game.js +++ b/game/game.js @@ -19504,7 +19504,6 @@ event.hujia=Math.min(-num,player.hujia); event.getParent().hujia=event.hujia; event.num+=event.hujia; - game.log(player,'的护甲抵挡了'+get.cnNumber(event.hujia)+'点伤害'); player.changeHujia(-event.hujia).type='damage'; } //old part @@ -19529,12 +19528,26 @@ event.trigger('changeHp'); }, changeHujia:function(){ + if(-num>player.hujia){ + num=-player.hujia; + event.num=num; + } player.hujia+=num; if(num>0){ game.log(player,'获得了'+get.cnNumber(num)+'点护甲'); } - if(player.hujia<0){ - player.hujia=0; + // if(player.hujia<0){ + // player.hujia=0; + // } + if(num<0){ + switch(type){ + case 'damage': + game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); + break; + case 'lose': + game.log(player,'失去了'+get.cnNumber(-num)+'点护甲'); + break; + } } player.update(); }, @@ -24778,9 +24791,13 @@ if(typeof num!='number'){ num=1; } + if(typeof type!='string'){ + if(num>=0) type='gain'; + else type='lose'; + } next.num=num; next.player=this; - if(type) next.type=type; + next.type=type; next.setContent('changeHujia'); if(limit===true) limit=5; if(typeof limit=='number'&&this.hujia+num>parseInt(limit)){ From f4aa4915f197d8f7f4200cc217e3983d2009c43b Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Sun, 22 Oct 2023 00:39:28 +0800 Subject: [PATCH 2/8] Update game.js --- game/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 6df8eb5b4..fb2b0f255 100644 --- a/game/game.js +++ b/game/game.js @@ -19540,7 +19540,7 @@ // player.hujia=0; // } if(num<0){ - switch(type){ + switch(event.type){ case 'damage': game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); break; From 34530c6ccffd828bff300a2c5d24adf26f0460b7 Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:58:33 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8Clog=E6=97=B6=E6=9C=BA=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=8F=90=E5=88=B0=E6=8A=A4=E7=94=B2=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/game/game.js b/game/game.js index fb2b0f255..1f5211e0d 100644 --- a/game/game.js +++ b/game/game.js @@ -19504,6 +19504,7 @@ event.hujia=Math.min(-num,player.hujia); event.getParent().hujia=event.hujia; event.num+=event.hujia; + // game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); player.changeHujia(-event.hujia).type='damage'; } //old part @@ -19528,18 +19529,14 @@ event.trigger('changeHp'); }, changeHujia:function(){ - if(-num>player.hujia){ - num=-player.hujia; - event.num=num; - } - player.hujia+=num; - if(num>0){ + if(num>=0){ game.log(player,'获得了'+get.cnNumber(num)+'点护甲'); } - // if(player.hujia<0){ - // player.hujia=0; - // } - if(num<0){ + else{ + if(-num>player.hujia){ + num=-player.hujia; + event.num=num; + } switch(event.type){ case 'damage': game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); @@ -19549,6 +19546,10 @@ break; } } + player.hujia+=num; + // if(player.hujia<0){ + // player.hujia=0; + // } player.update(); }, dying:function(){ From 3148fdb8a706c3328b61c8091df48d7ef9ac064b Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:09:50 +0800 Subject: [PATCH 4/8] Update game.js --- game/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 1f5211e0d..d4e128e00 100644 --- a/game/game.js +++ b/game/game.js @@ -19504,7 +19504,7 @@ event.hujia=Math.min(-num,player.hujia); event.getParent().hujia=event.hujia; event.num+=event.hujia; - // game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); + // game.log(player,'的护甲抵挡了'+get.cnNumber(event.hujia)+'点伤害'); player.changeHujia(-event.hujia).type='damage'; } //old part From 96e5a464a9b13e7f50f4080c07284b64c3cb57aa Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:17:15 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A4=E7=94=B2?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E6=97=B6damagepop=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复damage函数animate部分中,定义numx时未判断角色护甲是否失效,导致之后的$damagepop即使在角色护甲失效时也计算角色护甲的bug --- game/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index d4e128e00..a3b84da1e 100644 --- a/game/game.js +++ b/game/game.js @@ -19366,7 +19366,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) From f6fd5259ded8073897fc468276cc209f30227f37 Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:25:59 +0800 Subject: [PATCH 6/8] Update game.js --- game/game.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/game/game.js b/game/game.js index a3b84da1e..5d9f22d6a 100644 --- a/game/game.js +++ b/game/game.js @@ -19529,10 +19529,10 @@ event.trigger('changeHp'); }, changeHujia:function(){ - if(num>=0){ + if(num>0){ game.log(player,'获得了'+get.cnNumber(num)+'点护甲'); } - else{ + else if(num<0){ if(-num>player.hujia){ num=-player.hujia; event.num=num; @@ -24793,8 +24793,9 @@ num=1; } if(typeof type!='string'){ - if(num>=0) type='gain'; - else type='lose'; + if(num>0) type='gain'; + else if(num<0) type='lose'; + else type='null'; } next.num=num; next.player=this; From 4b69a510c7f2a144668ac5bc121a20fe8361d72b Mon Sep 17 00:00:00 2001 From: CatIgnore <137709037+CatIgnore@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:38:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8A=A4=E7=94=B2?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=8A=A4=E7=94=B2?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E6=97=B6damagepop=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/game/game.js b/game/game.js index 5d9f22d6a..599e317d9 100644 --- a/game/game.js +++ b/game/game.js @@ -19504,7 +19504,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 @@ -19537,7 +19538,7 @@ num=-player.hujia; event.num=num; } - switch(event.type){ + switch(event.type){ //log moved here case 'damage': game.log(player,'的护甲抵挡了'+get.cnNumber(-num)+'点伤害'); break; @@ -19547,9 +19548,9 @@ } } player.hujia+=num; - // if(player.hujia<0){ - // player.hujia=0; - // } + /*if(player.hujia<0){ + player.hujia=0; + }*/ player.update(); }, dying:function(){ 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 8/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A4=E7=94=B2?= =?UTF-8?q?=E4=B8=8A=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(){