From 832cf822208abf8a3fbce151fc110bed91628665 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:41:20 -0700 Subject: [PATCH 1/2] Fix `get.is.sameNature`, `get.is.differentNature`, and add `get.seatTranslation`. --- game/game.js | 15 +++++++++++++-- mode/guozhan.js | 2 +- mode/versus.js | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/game/game.js b/game/game.js index c11da6f16..1dd868654 100644 --- a/game/game.js +++ b/game/game.js @@ -12334,6 +12334,10 @@ unknown5:'六号位', unknown6:'七号位', unknown7:'八号位', + unknown8:'九号位', + unknown9:'十号位', + unknown10:'十一号位', + unknown11:'十二号位', feichu_equip1:"已废除", feichu_equip1_info:"武器栏已废除", @@ -58041,6 +58045,11 @@ }, }; const get={ + /** + * 根据座次数n(从0开始)获取对应的“n+1号位”翻译 + * @param {number} seat + */ + seatTranslation:seat=>`${get.cnNumber(seat+1,true)}号位`, /** * @param {number} numberOfPlayers * @returns {string[]} @@ -58328,7 +58337,8 @@ if(every) return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).every(testingNatures=>testingNatures.length==natures.length&&testingNatures.every(nature=>natures.includes(nature)))); return testingNaturesList.every((natures,index)=>{ const comparingNaturesList=naturesList.slice(index+1); - return natures.some(nature=>comparingNaturesList.every(testingNatures=>testingNatures.includes(nature))); + if(natures.length) return natures.some(nature=>comparingNaturesList.every(testingNatures=>testingNatures.includes(nature))); + return comparingNaturesList.every(testingNatures=>!testingNatures.length); }); }, /** @@ -58359,7 +58369,8 @@ if(every) return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).every(testingNatures=>testingNatures.every(nature=>!natures.includes(nature)))); return testingNaturesList.every((natures,index)=>{ const comparingNaturesList=naturesList.slice(index+1); - return natures.some(nature=>comparingNaturesList.every(testingNatures=>testingNatures.some(testingNature=>testingNature!=nature))); + if(natures.length) return natures.some(nature=>comparingNaturesList.every(testingNatures=>!testingNatures.length||testingNatures.some(testingNature=>testingNature!=nature))); + return comparingNaturesList.every(testingNatures=>testingNatures.length); }); }, //判断一张牌是否为明置手牌 diff --git a/mode/guozhan.js b/mode/guozhan.js index aa0128282..2907ed996 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -192,7 +192,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.gameDraw(event.playerx); game.broadcastAll(function(player){ for(var i=0;i Date: Thu, 26 Oct 2023 23:08:31 -0700 Subject: [PATCH 2/2] Ensure the compatibility, and fix the error when clicking again on a identity card. --- character/extra.js | 5 ++--- game/game.js | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/character/extra.js b/character/extra.js index 59de042ed..6059245a1 100755 --- a/character/extra.js +++ b/character/extra.js @@ -167,9 +167,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var list=lib.config.mode_config.identity.identity.lastItem.slice(); list.removeArray(game.filterPlayer().map(i=>{ - let identity=i.identity; - if(identity=='mingzhong') identity='zhong'; - return identity; + var identity=i.identity; + return identity=='mingzhong'?'zhong':identity; })).unique(); player.chooseButton([ '###炼魄:请选择一个身份###
你选择的身份对应的阵营角色数于本轮内视为+1
', diff --git a/game/game.js b/game/game.js index 1dd868654..a6d9789c3 100644 --- a/game/game.js +++ b/game/game.js @@ -43447,6 +43447,7 @@ //创建身份牌实例 identityCard:function(identity,position,noclick){ const card=ui.create.card(position,'noclick',noclick); + card.removeEventListener(lib.config.touchscreen?'touchend':'click',ui.click.card); card.classList.add('button'); card._customintro=uiintro=>uiintro.add(`${get.translation(`${identity}${2}`)}的身份牌`); const fileName=`image/card/identity_${identity}.jpg`;