Change get.is.sameNature and add get.is.differentNature.
30
game/game.js
|
@ -38438,7 +38438,7 @@
|
||||||
for(i=0;i<cards.length;i++){
|
for(i=0;i<cards.length;i++){
|
||||||
if(lib.config.cardtempname!='off'){
|
if(lib.config.cardtempname!='off'){
|
||||||
var cardname=get.name(cards[i]);
|
var cardname=get.name(cards[i]);
|
||||||
if(cards[i].name!=cardname||!get.is.sameNature(get.nature(cards[i]),cards[i].nature)){
|
if(cards[i].name!=cardname||!get.is.sameNature(get.nature(cards[i]),cards[i].nature,true)){
|
||||||
var node=ui.create.cardTempName(cards[i]);
|
var node=ui.create.cardTempName(cards[i]);
|
||||||
var cardtempnameConfig=lib.config.cardtempname;
|
var cardtempnameConfig=lib.config.cardtempname;
|
||||||
if(cardtempnameConfig!=='default') node.classList.remove('vertical');
|
if(cardtempnameConfig!=='default') node.classList.remove('vertical');
|
||||||
|
@ -55418,7 +55418,9 @@
|
||||||
if(!processedArguments.length) return true;
|
if(!processedArguments.length) return true;
|
||||||
if(processedArguments.length==1){
|
if(processedArguments.length==1){
|
||||||
const argument=processedArguments[0];
|
const argument=processedArguments[0];
|
||||||
if(!Array.isArray(argument)||argument.length==1) return false;
|
if(!Array.isArray(argument)) return false;
|
||||||
|
if(!argument.length) return true;
|
||||||
|
if(argument.length==1) return false;
|
||||||
processedArguments=argument;
|
processedArguments=argument;
|
||||||
}
|
}
|
||||||
const naturesList=processedArguments.map(card=>{
|
const naturesList=processedArguments.map(card=>{
|
||||||
|
@ -55426,13 +55428,9 @@
|
||||||
else if(Array.isArray(card)) return card;
|
else if(Array.isArray(card)) return card;
|
||||||
return get.natureList(card||{});
|
return get.natureList(card||{});
|
||||||
});
|
});
|
||||||
if(naturesList.some(natures=>natures.length)) for(const nature of new Set(naturesList.flat())){
|
const testingNaturesList=naturesList.slice(0,naturesList.length-1);
|
||||||
if(!nature) continue;
|
if(every) return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).every(testingNatures=>testingNatures.length==natures.length&&testingNatures.every(nature=>natures.includes(nature))));
|
||||||
const lengths=Array.from(new Set(naturesList.map(natures=>natures.filter(n=>n===nature).length)));
|
return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).some(testingNatures=>testingNatures.some(nature=>natures.includes(nature))));
|
||||||
if(!every&&lengths.length==1) return true;
|
|
||||||
if(every&&lengths.length!=1) return false;
|
|
||||||
}
|
|
||||||
return !every;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 判断传入的参数的属性是否不同(参数可以为卡牌、卡牌信息、属性等)
|
* 判断传入的参数的属性是否不同(参数可以为卡牌、卡牌信息、属性等)
|
||||||
|
@ -55448,7 +55446,9 @@
|
||||||
if(!processedArguments.length) return false;
|
if(!processedArguments.length) return false;
|
||||||
if(processedArguments.length==1){
|
if(processedArguments.length==1){
|
||||||
const argument=processedArguments[0];
|
const argument=processedArguments[0];
|
||||||
if(!Array.isArray(argument)||argument.length==1) return true;
|
if(!Array.isArray(argument)) return true;
|
||||||
|
if(!argument.length) return false;
|
||||||
|
if(argument.length==1) return true;
|
||||||
processedArguments=argument;
|
processedArguments=argument;
|
||||||
}
|
}
|
||||||
const naturesList=processedArguments.map(card=>{
|
const naturesList=processedArguments.map(card=>{
|
||||||
|
@ -55456,13 +55456,9 @@
|
||||||
else if(Array.isArray(card)) return card;
|
else if(Array.isArray(card)) return card;
|
||||||
return get.natureList(card||{});
|
return get.natureList(card||{});
|
||||||
});
|
});
|
||||||
if(naturesList.some(natures=>natures.length)) for(const nature of new Set(naturesList.flat())){
|
const testingNaturesList=naturesList.slice(0,naturesList.length-1);
|
||||||
if(!nature) continue;
|
if(every) return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).every(testingNatures=>testingNatures.every(nature=>!natures.includes(nature))));
|
||||||
const lengths=Array.from(new Set(naturesList.map(natures=>natures.filter(n=>n!==nature).length)));
|
return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).some(testingNatures=>testingNatures.length!=natures.length||testingNatures.some(nature=>!natures.includes(nature))));
|
||||||
if(!every&&lengths.length==2) return true;
|
|
||||||
if(every&&lengths.length!=2) return false;
|
|
||||||
}
|
|
||||||
return !every;
|
|
||||||
},
|
},
|
||||||
//判断一张牌是否为明置手牌
|
//判断一张牌是否为明置手牌
|
||||||
shownCard:function(card){
|
shownCard:function(card){
|
||||||
|
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 513 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 529 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 313 B |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 6.5 KiB |