Change get.is.sameNature and add get.is.differentNature.

This commit is contained in:
Tipx-L 2023-09-27 09:19:41 -07:00
parent 70448dccf3
commit f4ce4c0f42
14 changed files with 13 additions and 17 deletions

View File

@ -38438,7 +38438,7 @@
for(i=0;i<cards.length;i++){
if(lib.config.cardtempname!='off'){
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 cardtempnameConfig=lib.config.cardtempname;
if(cardtempnameConfig!=='default') node.classList.remove('vertical');
@ -55418,7 +55418,9 @@
if(!processedArguments.length) return true;
if(processedArguments.length==1){
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;
}
const naturesList=processedArguments.map(card=>{
@ -55426,13 +55428,9 @@
else if(Array.isArray(card)) return card;
return get.natureList(card||{});
});
if(naturesList.some(natures=>natures.length)) for(const nature of new Set(naturesList.flat())){
if(!nature) continue;
const lengths=Array.from(new Set(naturesList.map(natures=>natures.filter(n=>n===nature).length)));
if(!every&&lengths.length==1) return true;
if(every&&lengths.length!=1) return false;
}
return !every;
const testingNaturesList=naturesList.slice(0,naturesList.length-1);
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)=>naturesList.slice(index+1).some(testingNatures=>testingNatures.some(nature=>natures.includes(nature))));
},
/**
* 判断传入的参数的属性是否不同参数可以为卡牌卡牌信息属性等
@ -55448,7 +55446,9 @@
if(!processedArguments.length) return false;
if(processedArguments.length==1){
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;
}
const naturesList=processedArguments.map(card=>{
@ -55456,13 +55456,9 @@
else if(Array.isArray(card)) return card;
return get.natureList(card||{});
});
if(naturesList.some(natures=>natures.length)) for(const nature of new Set(naturesList.flat())){
if(!nature) continue;
const lengths=Array.from(new Set(naturesList.map(natures=>natures.filter(n=>n!==nature).length)));
if(!every&&lengths.length==2) return true;
if(every&&lengths.length!=2) return false;
}
return !every;
const testingNaturesList=naturesList.slice(0,naturesList.length-1);
if(every) return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).every(testingNatures=>testingNatures.every(nature=>!natures.includes(nature))));
return testingNaturesList.every((natures,index)=>naturesList.slice(index+1).some(testingNatures=>testingNatures.length!=natures.length||testingNatures.some(nature=>!natures.includes(nature))));
},
//判断一张牌是否为明置手牌
shownCard:function(card){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB