Fix `get.is.sameNature`, `get.is.differentNature`, and add `get.seatTranslation`.

This commit is contained in:
Tipx-L 2023-10-26 08:41:20 -07:00
parent ce9ecf3d7b
commit 832cf82220
3 changed files with 15 additions and 4 deletions

View File

@ -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);
});
},
//判断一张牌是否为明置手牌

View File

@ -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<game.players.length;i++){
game.players[i].name='unknown'+get.distance(player,game.players[i],'absolute');
game.players[i].name=get.seatTranslation(get.distance(player,game.players[i],'absolute'));
game.players[i].node.name_seat=ui.create.div('.name.name_seat',get.verticalStr(lib.translate[game.players[i].name]),game.players[i]);
// if(game.players[i]==game.me){
// lib.translate[game.players[i].name]+='(你)';

View File

@ -1660,7 +1660,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
for(var i=0;i<game.players.length;i++){
if(!game.players[i].node.name_seat){
game.players[i].node.name_seat=ui.create.div('.name.name_seat',get.verticalStr(lib.translate['unknown'+get.distance(_status.firstAct,game.players[i],'absolute')]),game.players[i]);
game.players[i].node.name_seat=ui.create.div('.name.name_seat',get.verticalStr(get.seatTranslation(_status.firstAct,game.players[i],'absolute')),game.players[i]);
game.players[i].node.name_seat.style.opacity=1;
}
}