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] 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