Merge pull request #520 from nofficalfs/Dev-FixGetNoArgs

#514 补充修订
This commit is contained in:
Spmario233 2023-10-13 16:09:37 +08:00 committed by GitHub
commit c4d462ac89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 21 deletions

View File

@ -57022,7 +57022,7 @@
} }
return true; return true;
}, },
altered:lib.filter.none, altered:()=>false,
/* /*
skill=>{ skill=>{
return false; return false;
@ -58965,8 +58965,9 @@
result._filter_args=[filter,i]; result._filter_args=[filter,i];
return result; return result;
}, },
cardCount:function(card,player){ cardCount:(card,player)=>{
var num; var num;
if(player==undefined) player=_status.event.player;
if(card==true){ if(card==true){
num=0; num=0;
var stat=player.getStat('card'); var stat=player.getStat('card');
@ -58975,7 +58976,6 @@
} }
return num; return num;
} }
if(player==undefined) player=_status.event.player;
if(typeof card=='object'){ if(typeof card=='object'){
card=card.name; card=card.name;
} }
@ -58983,7 +58983,7 @@
if(num==undefined) return 0; if(num==undefined) return 0;
return num; return num;
}, },
skillCount:function(skill,player){ skillCount:(skill,player)=>{
if(player==undefined) player=_status.event.player; if(player==undefined) player=_status.event.player;
var num=player.getStat('skill')[skill]; var num=player.getStat('skill')[skill];
if(num==undefined) return 0; if(num==undefined) return 0;
@ -58994,23 +58994,13 @@
noSelected:()=>ui.selected.buttons.length+ui.selected.cards.length+ui.selected.targets.length==0, noSelected:()=>ui.selected.buttons.length+ui.selected.cards.length+ui.selected.targets.length==0,
population:identity=>identity==undefined? population:identity=>identity==undefined?
game.players.length+game.dead.length: game.players.length+game.dead.length:
game.players.filter(current=>current.identity==identity), game.players.filter(current=>current.identity==identity).length,
totalPopulation:identity=>{ totalPopulation:identity=>identity==undefined?
if(identity==undefined) return game.players.length+game.dead.length; game.players.length+game.dead.length:
var i,players=game.players.concat(game.dead); game.players.concat(game.dead).filter(current=>current.identity==identity).length,
var num=0; cardtag:(item,tag)=>
for(i=0;i<players.length;i++){ (item.cardid&&(get.itemtype(item)=='card'||!item.cards||!item.cards.length||item.name==item.cards[0].name)&&_status.cardtag&&_status.cardtag[tag]&&_status.cardtag[tag].contains(item.cardid))
if(players[i].identity==identity) num++; ||(item.cardtags&&item.cardtags.contains(tag)),
}
return num;
},
cardtag:(item,tag)=>{
if(item.cardid&&(get.itemtype(item)=='card'||!item.cards||!item.cards.length||item.name==item.cards[0].name)&&_status.cardtag&&_status.cardtag[tag]&&_status.cardtag[tag].contains(item.cardid)){
return true;
}
if(item.cardtags&&item.cardtags.contains(tag)) return true;
return false;
},
tag:(item,tag,item2,bool)=>{ tag:(item,tag,item2,bool)=>{
var result; var result;
if(get.info(item)&&get.info(item).ai&&get.info(item).ai.tag){ if(get.info(item)&&get.info(item).ai&&get.info(item).ai.tag){