From 91be8bfb24531a382069a1b3a5d7d1d0934ab149 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sat, 30 Dec 2023 15:53:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=90=E5=87=BA=E5=85=B6?= =?UTF-8?q?=E4=B8=8D=E6=84=8F=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/yingbian.js | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/card/yingbian.js b/card/yingbian.js index 885564123..431a2d8d2 100644 --- a/card/yingbian.js +++ b/card/yingbian.js @@ -184,12 +184,29 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 0; }, result:{ - target:function(player,target,cardx){ - if(player.hasSkillTag('viewHandcard',null,target,true)) return target.countCards('h',function(card){ - return get.suit(card)!=get.suit(cardx) - })>0?-1.5:0; - return -1.4; - }, + target:(player,target,card)=>{ + //if(typeof card!=='object') return -2; + let suit=get.suit(card), + view=player.hasSkillTag('viewHandcard',null,target,true), + fz=0, + fm=0; + target.getCards('h',i=>{ + if(i.isKnownBy(player)){ + if(suit!==get.suit(i)){ + if(view||get.is.shownCard(i)) return -2; + fz++; + fm++; + } + else if(!view&&!get.is.shownCard(i)) fm++; + } + else{ + fz+=0.75; + fm++; + } + }); + if(!fm) return 0; + return -2*fz/fm; + } }, tag:{ damage:1,