From 9de17e09fe9a6be6faf94087967e5dbbda7db5c2 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Sat, 28 Oct 2023 15:34:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=81=E5=91=A8=E5=B9=B4?= =?UTF-8?q?=E8=AE=B8=E9=9D=96ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/character/xianding.js b/character/xianding.js index 7e2abdc25..107239cba 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -381,11 +381,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var cards=trigger.getd().filter(card=>{ return get.position(card)=='d'&&player.getStorage('dcshangyu').includes(card); - }); + }),targets=game.filterPlayer(current=>{ + return !player.getStorage('dcshangyu_transfer').includes(current); + }).sortBySeat(_status.currentPhase); event.cards=cards; player.chooseTarget(`赏誉:将${get.translation(cards)}交给一名可选角色`,(card,player,target)=>{ return !player.getStorage('dcshangyu_transfer').includes(target); - },true); + },true).set('ai',target=>{ + let att=get.sgn(get.attitude(_status.event.player,target)),idx=1+_status.event.targets.indexOf(target); + if(att<0) return -idx; + return att+1/idx; + }).set('targets',targets); 'step 1' if(result.bool){ var target=result.targets[0]; @@ -447,17 +453,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseControl(choices,'cancel2').set('prompt',get.prompt('dccaixia')).set('prompt2','你可以摸至多'+get.cnNumber(choices.length)+'张牌,但是你此后需要再使用等量的牌才可再发动本技能。').set('ai',()=>{ return _status.event.choice; }).set('choice',function(){ - if(player.isPhaseUsing()){ - if(!player.hasCard(card=>{ - return get.tag(card,'damage')&&player.hasValueTarget(card); - },'hs')) return 0; - var cards=player.getCards('hs',card=>{ - return player.hasValueTarget(card); - }); - if(!cards.some(card=>get.tag(card,'damage'))) return 0; - return Math.min(choices.length,cards.filter(card=>!get.tag(card,'damage')).length+1); + var cards=player.getCards('hs',card=>get.name(card,player)!=='sha'&&player.hasValueTarget(card)); + var damage=Math.min(player.getCardUsable({name:'sha'}),player.countCards('hs','sha'))+cards.filter(i=>get.tag(i,'damage')).length; + if(player.isPhaseUsing()||player.hp+player.hujia+player.countCards('hs',i=>get.tag(card,'recover'))>2){ + if(damage) return Math.min(choices.length-1,cards.length-damage); + return Math.min(choices.length-1,cards.length-1); } - return choices.length; + return choices.length-1; }()); 'step 1' if(result.control!='cancel2'){ @@ -471,7 +473,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mod:{ aiOrder:function(player,card,num){ if(!get.tag(card,'damage')) return; - if(player.countMark('dccaixia_clear')>1) return num/2; + if(player.countMark('dccaixia_clear')>1) return num/3; return num+6; }, },