From 6a1605b25eda660b74aa0bacac2728e1c5670343 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:29:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8C=9C=E6=9D=80=E7=8C=9C?= =?UTF-8?q?=E9=97=AA=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 猜杀mayHaveSha 猜闪mayHaveShan --- game/game.js | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/game/game.js b/game/game.js index fbc8037d0..2bca3c14f 100644 --- a/game/game.js +++ b/game/game.js @@ -27528,9 +27528,43 @@ if(this.hasSkillTag('respondShan',true,null,true)) return true; return this.hasUsableCard('shan'); }, - mayHaveShan:function(){ - return this.hasShan(); - // modify: After AngelBeats! -2nd Beat- + mayHaveSha:function(viewer,type){ + if((this.hp>2||!this.isZhu&&this.hp>1)&&this.hasSkillTag('respondSha',true,type,true)) return true; + if(get.itemtype(viewer)!=='player') viewer=_status.event.player; + let cards; + if(this===viewer||get.itemtype(viewer)==='player'&&viewer.hasSkillTag('viewHandcard',null,this,true)) cards=this.getCards('h'); + else cards=this.getShownCards(); + if(cards.some(card=>{ + let name=get.name(card,this); + if(name=='sha'||name=='hufu'||name=='yuchanqian'){ + if(type==='use') return lib.filter.cardEnabled(card,this); + if(type==='respond') return lib.filter.cardRespondable(card,this); + return true; + } + return false; + })) return true; + let hs=this.getCards('hs').removeArray(cards).length; + if(hs===0) return false; + return Math.pow(hs+(this.isPhaseUsing()?6:4),2)>100*_status.event.getRand('mayHaveSha'); + }, + mayHaveShan:function(viewer,type){ + if((this.hp>2||!this.isZhu&&this.hp>1)&&this.hasSkillTag('respondShan',true,type,true)) return true; + if(get.itemtype(viewer)!=='player') viewer=_status.event.player; + let cards; + if(this===viewer||get.itemtype(viewer)==='player'&&viewer.hasSkillTag('viewHandcard',null,this,true)) cards=this.getCards('h'); + else cards=this.getShownCards(); + if(cards.some(card=>{ + let name=get.name(card,this); + if(name==='shan'||name==='hufu'){ + if(type==='use') return lib.filter.cardEnabled(card,this); + if(type==='respond') return lib.filter.cardRespondable(card,this); + return true; + } + return false; + })) return true; + let hs=this.getCards('hs').removeArray(cards).length; + if(hs===0) return false; + return Math.pow(hs+(this.isPhaseUsing()?3:5),2)>100*_status.event.getRand('mayHaveShan'); }, hasCard:function(name,position){ if(typeof name=='function'){