From 7225dcc149fcd15f21d8a7beb8243980ef998faa Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 7 Dec 2023 09:08:32 +0800 Subject: [PATCH] =?UTF-8?q?canCompare=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8player/target=E6=B2=A1=E7=89=8C=E6=97=B6?= =?UTF-8?q?=E4=BB=8D=E8=A7=86=E4=B8=BA=E6=BB=A1=E8=B6=B3=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sb.js | 2 +- character/shiji.js | 5 ++--- character/tw.js | 4 ++-- game/game.js | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/character/sb.js b/character/sb.js index a44b548af..b00f1f549 100644 --- a/character/sb.js +++ b/character/sb.js @@ -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); diff --git a/character/shiji.js b/character/shiji.js index 7845bbdbc..594e50385 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -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' diff --git a/character/tw.js b/character/tw.js index 9c7ac9621..ae223f2f4 100644 --- a/character/tw.js +++ b/character/tw.js @@ -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; diff --git a/game/game.js b/game/game.js index e7840298e..a80eb6678 100644 --- a/game/game.js +++ b/game/game.js @@ -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; }