From bfb9b5b1e302b1d0236243bdce0b8975b4e6ce7c Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:57:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B0=8B=E8=B2=82?= =?UTF-8?q?=E8=9D=89=E3=80=90=E7=A6=BB=E9=97=B4=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sb.js | 81 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/character/sb.js b/character/sb.js index f3fb404f5..973f38078 100644 --- a/character/sb.js +++ b/character/sb.js @@ -768,9 +768,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sblijian:{ audio:2, enable:'phaseUse', - usable:1, filter:function(event,player){ - return game.countPlayer(current=>{ + return !player.getStat('skill').sblijian&&game.countPlayer(current=>{ return current!=player; })>1; }, @@ -784,6 +783,59 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterOk:function(){ return ui.selected.targets.length==ui.selected.cards.length+1; }, + check:function(card){ + let player=get.owner(card),targets=_status.event.getTempCache('sblijian','targets'); + if(!Array.isArray(targets)){ + lib.skill.sblijian.selectTargetAi(_status.event,player); + targets=_status.event.getTempCache('sblijian','targets'); + } + targets=Math.min(player.countCards('he')+1,targets.length); + if(ui.selected.cards.lengthcurrent!==player),res; + for(let i of players){ + res=get.attitude(event.player,i); + if(restarget[1]) target=[i,res]; + } + game.players.remove(vp); + if(target[1]<=0){ + event.putTempCache('sblijian','targets',[]); + return; + } + let targets=[],idx=-1; + do{ + idx++; + targets.push(target.concat([get.sgn(get.attitude(player,target[0]))])); + players.remove(target[0]); + target[1]=0; + for(let i of players){ + res=get.effect(i,{name:'juedou',isCard:true},targets[idx][0],event.player); + if(res>target[1]) target=[i,res]; + } + }while(target[1]>0); + if(!player.hasSkill('sbbiyue')) targets=targets.filter(i=>i[2]!==0); + event.putTempCache('sblijian','targets',targets); + }, multiline:true, content:function(){ var targetx=targets.slice().sortBySeat(target)[1]; @@ -793,7 +845,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ threaten:3, order:7, - result:{target:-1} + result:{ + player:function(player,target){ + if(!player.hasSkill('sbbiyue') return 0; + let targets=_status.event.getTempCache('sblijian','targets'); + if(Array.isArray(targets)) for(let i=0;i0) return targets[i][1]/5; + return -targets[i][1]; + } + } + if(ui.selected.targets.length){ + let tars=ui.selected.targets.concat([target]); + return get.effect(target,{name:'juedou',isCard:true},tars[tars.length-2],target)+get.effect(tars[0],{name:'juedou',isCard:true},target,target); + } + return 0; + } + } } }, sbbiyue:{ From 7c5ed99d38c15ef8d9775c165f61b05b6ef24e79 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:43:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=9B=E6=AF=97?= =?UTF-8?q?=E3=80=90=E5=BC=95=E8=A3=BE=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp2.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/character/sp2.js b/character/sp2.js index 52e13dfc7..5acf54286 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -8452,6 +8452,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ result:{ + order:10, player:function(player,target){ if(player.countCards('hs',function(card){ return get.tag(card,'damage')&&player.canUse(card,target); @@ -8499,7 +8500,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player:function(card,player,target){ if(target!=player.storage.yinju2) return; if(card.name=='lebu') return; - return [0,0.5,0,0.5]; + if(card.name!=='huogong'&&get.tag(card,'damage')&&target.isDamaged()) [1,0.6,0,2.4]; + return [1,0.6,1,0.6]; }, }, }, From c2c22c61c2fc4276b83401f26fce2eb0a64ce6a3 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:59:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=91=9B=E7=8E=84?= =?UTF-8?q?=E3=80=90=E6=9C=AD=E7=AC=A6=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/character/xianding.js b/character/xianding.js index f6e485adc..a18d9da6f 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -11806,6 +11806,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addSkill('zhafu_hf'); target.addMark('zhafu_hf',1); }, + ai:{ + order:1, + result:{ + player:function(player,target){ + return Math.max(0,1+target.countCards('h')-game.countPlayer(current=>{ + if(get.attitude(target,current)>0) return 0.3; + if(target.hasJudge('lebu')) return 0.6; + if(target.inRange(current)) return 1.5; + return 1; + })); + }, + target:function(player,target){ + return -Math.max(0,1+target.countCards('h')-game.countPlayer(current=>{ + if(get.attitude(target,current)>0) return 0.3; + if(target.hasJudge('lebu')) return 0.6; + if(target.inRange(current)) return 1.5; + return 1; + })); + } + } + }, subSkill:{ hf:{ trigger:{ From c04dbe40b162141f29df7b4b932f59c925612b67 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Sat, 30 Sep 2023 15:28:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=90=E4=B8=88?= =?UTF-8?q?=E5=85=AB=E8=9B=87=E7=9F=9B=E3=80=91=E3=80=90=E8=B4=AF=E7=9F=B3?= =?UTF-8?q?=E6=96=A7=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/standard.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/card/standard.js b/card/standard.js index 7d1ebad6e..f6e4152c9 100644 --- a/card/standard.js +++ b/card/standard.js @@ -2108,8 +2108,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){ audio:true, prompt:'将两张手牌当杀使用或打出', check:function(card){ - if(card.name=='sha') return 0; - return 5-get.value(card) + let player=_status.event.player; + if(player.hasCard(function(card){ + return get.name(card)=='sha'; + })) return 0; + if(_status.event&&_status.event.name=='chooseToRespond'&&player.hp<3&&!player.countCards('hs',function(card){ + return get.name(card)!='tao'&&get.name(card)!='jiu'; + })) return (player.hp>1?10:8)-get.value(card); + return Math.max(5,8-0.7*player.hp)-get.value(card); }, ai:{ respondSha:true, @@ -2144,10 +2150,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){ next.set('ai',function(card){ var evt=_status.event.getTrigger(); if(get.attitude(evt.player,evt.target)<0){ - if(evt.baseDamage+evt.extraDamage>=Math.min(2,evt.target.hp)){ - return 8-get.value(card) - } - return 5-get.value(card) + if(player.needsToDiscard()) return 15-get.value(card); + if(evt.baseDamage+evt.extraDamage>=Math.min(2,evt.target.hp)) return 8-get.value(card); + return 5-get.value(card); } return -1; });