增加猜杀猜闪函数

猜杀mayHaveSha
猜闪mayHaveShan
This commit is contained in:
157 2023-10-02 17:29:24 +08:00 committed by GitHub
parent d04957377f
commit 6a1605b25e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 3 deletions

View File

@ -27528,9 +27528,43 @@
if(this.hasSkillTag('respondShan',true,null,true)) return true; if(this.hasSkillTag('respondShan',true,null,true)) return true;
return this.hasUsableCard('shan'); return this.hasUsableCard('shan');
}, },
mayHaveShan:function(){ mayHaveSha:function(viewer,type){
return this.hasShan(); if((this.hp>2||!this.isZhu&&this.hp>1)&&this.hasSkillTag('respondSha',true,type,true)) return true;
// modify: After AngelBeats! -2nd Beat- 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){ hasCard:function(name,position){
if(typeof name=='function'){ if(typeof name=='function'){