From 5080559355800e3f0e720f4120e8e1ae16e6f29d Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sat, 6 Apr 2024 00:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B0=8B=E5=88=98=E5=A4=87?= =?UTF-8?q?=E3=80=90=E6=BF=80=E5=B0=86=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sb.js | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/character/sb.js b/character/sb.js index ba07cf518..471c277c1 100644 --- a/character/sb.js +++ b/character/sb.js @@ -4064,38 +4064,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var next=player.chooseTarget(get.prompt2('sbjijiang'),2); next.set('filterTarget',(card,player,target)=>{ - if(!ui.selected.targets.length) return true; + if(!ui.selected.targets.length) return target.group=='shu'&&target.hp>=player.hp&&target!=player; var current=ui.selected.targets[0]; - if(current.group=='shu'&¤t.hp>=player.hp&¤t!=player){ - return current.inRange(target); - } - else{ - return target.group=='shu'&&target.hp>=player.hp&&target.inRange(current)&&target!=player; - } - }) - next.set('targetprompt',target=>{ - var player=_status.event.player; - if(target.group=='shu'&&target.hp>=player.hp&&target!=player&&!ui.selected.targets.some(i=>{ - return i!=target&&i.hp>=player.hp&&i.group=='shu'; - })) return '进行选择'; - return '出杀对象'; + return current.inRange(target); }); + next.set('targetprompt',['进行选择','出杀对象']); + next.set('multitarget',true); next.set('ai',target=>{ var player=_status.event.player; if(ui.selected.targets.length){ var current=ui.selected.targets[0]; - if(current.group=='shu'&¤t.hp>=player.hp&¤t!=player){ - return -get.attitude(player,target); - } - return Math.abs(get.attitude(player,current)); + return get.effect(target,new lib.element.VCard({name:'sha'}),current,player); } - else{ - if(target.group=='shu'&&target.hp>=player.hp&&target!=player&&game.hasPlayer(current=>{ - return get.attitude(player,current)<0; - })) return 10; - return 1; + let curs=game.filterPlayer(current=>{ + return target!==current&&target.inRange(current)&&target.canUse({name:'sha',isCard:true},current,false); + }); + if(!curs.length){ + let att=get.attitude(player,target); + if(att>=0) return 0; + return -att*get.threaten(target,player); } - }) + return curs.reduce((max,i)=>Math.max(max,get.effect(i,new lib.element.VCard({name:'sha'}),target,player)),-1); + }); 'step 1' if(result.bool){ var targets=result.targets; @@ -4107,7 +4097,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '视为对'+get.translation(targets[1])+'使用一张【杀】', '你的下一个出牌阶段开始前,跳过此阶段' ]; - targets[0].chooseControl().set('choiceList',choiceList).set('ai',()=>{ + if(!targets[0].canUse({name:'sha',isCard:true},targets[1],false)) event._result={index:1}; + else targets[0].chooseControl().set('choiceList',choiceList).set('ai',()=>{ return _status.event.choice; }).set('choice',get.effect(targets[1],{name:'sha'},targets[0],targets[0])>get.effect(targets[0],{name:'lebu'},targets[0],targets[0])?0:1); }