canCompare添加参数,在player/target没牌时仍视为满足条件

This commit is contained in:
mengxinzxz 2023-12-07 09:08:32 +08:00
parent 5e646da84d
commit 7225dcc149
4 changed files with 7 additions and 8 deletions

View File

@ -1096,7 +1096,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return event.targets.length==1&&event.card.name=='sha'&&!player.hasSkillTag('noCompareSource')&&event.target.countCards('h')>0&&!event.target.hasSkillTag('noCompareTarget');
return event.targets.length==1&&event.card.name=='sha'&&player.canCompare(event.target,true);
},
check:function(event,player){
return get.attitude(player,event.target)<=0||game.hasPlayer(current=>get.damageEffect(current,player,player)>0);

View File

@ -2276,11 +2276,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse',
usable:1,
filter:function(event,player){
return !player.hasSkillTag('noCompareSource');
return game.hasPlayer(target=>player.canCompare(target,true));
},
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0&&
!target.hasSkillTag('noCompareTarget');
return player.canCompare(target,true);
},
content:function(){
'step 0'

View File

@ -8586,14 +8586,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){
if(!event.isFirstTarget||!get.tag(event.card,'damage')) return false;
return !player.hasSkillTag('noCompareSource')&&game.hasPlayer(target=>{
return target!=player&&target.countCards('h')>0&&!target.hasSkillTag('noCompareTarget');
return player.canCompare(target,true);
});
},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt2('twzhenhu'),[1,3],function(card,player,target){
return target!=player&&target.countCards('h')>0&&!target.hasSkillTag('noCompareTarget');
return player.canCompare(target,true);
}).set('ai',function(target){
var player=_status.event.player,targets=_status.event.getTrigger().targets;
var num=0;

View File

@ -22383,9 +22383,9 @@ new Promise(resolve=>{
next.setContent('swapEquip');
return next;
}
canCompare(target){
canCompare(target,goon,bool){
if(this==target) return false;
if(!this.countCards('h')||!target.countCards('h')) return false;
if((!this.countCards('h')&&goon!==true)||(!target.countCards('h')&&bool!==true)) return false;
if(this.hasSkillTag('noCompareSource')||target.hasSkillTag('noCompareTarget')) return false;
return true;
}