Fix `get.is.sameNature`, `get.is.differentNature`, and add `get.seatTranslation`.
This commit is contained in:
parent
ce9ecf3d7b
commit
832cf82220
15
game/game.js
15
game/game.js
|
@ -12334,6 +12334,10 @@
|
||||||
unknown5:'六号位',
|
unknown5:'六号位',
|
||||||
unknown6:'七号位',
|
unknown6:'七号位',
|
||||||
unknown7:'八号位',
|
unknown7:'八号位',
|
||||||
|
unknown8:'九号位',
|
||||||
|
unknown9:'十号位',
|
||||||
|
unknown10:'十一号位',
|
||||||
|
unknown11:'十二号位',
|
||||||
|
|
||||||
feichu_equip1:"已废除",
|
feichu_equip1:"已废除",
|
||||||
feichu_equip1_info:"武器栏已废除",
|
feichu_equip1_info:"武器栏已废除",
|
||||||
|
@ -58041,6 +58045,11 @@
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const get={
|
const get={
|
||||||
|
/**
|
||||||
|
* 根据座次数n(从0开始)获取对应的“n+1号位”翻译
|
||||||
|
* @param {number} seat
|
||||||
|
*/
|
||||||
|
seatTranslation:seat=>`${get.cnNumber(seat+1,true)}号位`,
|
||||||
/**
|
/**
|
||||||
* @param {number} numberOfPlayers
|
* @param {number} numberOfPlayers
|
||||||
* @returns {string[]}
|
* @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))));
|
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)=>{
|
return testingNaturesList.every((natures,index)=>{
|
||||||
const comparingNaturesList=naturesList.slice(index+1);
|
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))));
|
if(every) return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).every(testingNatures=>testingNatures.every(nature=>!natures.includes(nature))));
|
||||||
return testingNaturesList.every((natures,index)=>{
|
return testingNaturesList.every((natures,index)=>{
|
||||||
const comparingNaturesList=naturesList.slice(index+1);
|
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);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//判断一张牌是否为明置手牌
|
//判断一张牌是否为明置手牌
|
||||||
|
|
|
@ -192,7 +192,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
game.gameDraw(event.playerx);
|
game.gameDraw(event.playerx);
|
||||||
game.broadcastAll(function(player){
|
game.broadcastAll(function(player){
|
||||||
for(var i=0;i<game.players.length;i++){
|
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]);
|
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){
|
// if(game.players[i]==game.me){
|
||||||
// lib.translate[game.players[i].name]+='(你)';
|
// lib.translate[game.players[i].name]+='(你)';
|
||||||
|
|
|
@ -1660,7 +1660,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
for(var i=0;i<game.players.length;i++){
|
for(var i=0;i<game.players.length;i++){
|
||||||
if(!game.players[i].node.name_seat){
|
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;
|
game.players[i].node.name_seat.style.opacity=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue