From 7052d5f058b8789debde42bb73c0df64497b3fd9 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Mon, 15 Jan 2024 19:38:35 +0800 Subject: [PATCH] =?UTF-8?q?S=E7=89=B9=E7=A5=9E=E9=A9=AC=E8=B6=85=E3=80=81?= =?UTF-8?q?=E6=AD=A6=E9=99=86=E9=80=8Aai=E5=A2=9E=E5=8A=A0ak=E6=84=8F?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/offline.js | 21 ++++++++++++++++----- character/xianding.js | 12 ++++++++---- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/character/offline.js b/character/offline.js index 97b416cd8..3786497ab 100644 --- a/character/offline.js +++ b/character/offline.js @@ -886,25 +886,36 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, pshengwu:{ audio:'hengwu', + mod:{ + aiValue:(player,card,num)=>{ + if(num>0&&card.name==='zhuge') return 20; + }, + aiUseful:(player,card,num)=>{ + if(num>0&&card.name==='zhuge') return 10; + } + }, trigger:{player:['useCard','respond']}, direct:true, + locked:false, filter:function(event,player){ return game.hasPlayer(i=>i.countCards('ej',cardx=>get.type(cardx)=='equip'&&get.suit(event.card)==get.suit(cardx))); }, content:function(){ 'step 0' - var suit=get.suit(trigger.card); - var prompt2='弃置任意张'+get.translation(suit)+'手牌,然后摸X张牌(X为你弃置的牌数+'+game.filterPlayer().map(i=>i.countCards('ej',cardx=>get.type(cardx)=='equip'&&get.suit(trigger.card)==get.suit(cardx))).reduce((p,c)=>p+c)+')'; + var suit=get.suit(trigger.card),extra=game.filterPlayer().map(i=>i.countCards('ej',cardx=>{ + return get.type(cardx)=='equip'&&get.suit(trigger.card)==get.suit(cardx); + })).reduce((p,c)=>p+c); + var prompt2='弃置任意张'+get.translation(suit)+'手牌,然后摸X张牌(X为你弃置的牌数+'+extra+')'; player.chooseToDiscard('h',[1,player.countCards('h',{suit:suit})],{suit:suit}).set('prompt',get.prompt('pshengwu')).set('prompt2',prompt2).set('ai',card=>{ - var player=_status.event.player; + if(_status.event.tie) return 0; + let player=_status.event.player; if(_status.event.goon) return 12-get.value(card); - if(player.countCards('h')>50) return 0; if(player==_status.currentPhase){ if(['shan','caochuan','tao','wuxie'].includes(card.name)) return 8-get.value(card); return 6-get.value(card); } return 5.5-get.value(card); - }).set('goon',player.countCards('h',{suit:suit})==1).set('logSkill','pshengwu'); + }).set('goon',player.countCards('h',{suit:suit})==1).set('tie',extra>ui.cardPile.childNodes.length+ui.discardPile.childNodes.length).set('logSkill','pshengwu'); 'step 1' if(result.bool){ var num=result.cards.length; diff --git a/character/xianding.js b/character/xianding.js index 41b0b18e6..e0747fec5 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -145,10 +145,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return (dis?6:1)-get.useful(card); } if(_status.event.hvt.includes(card)){ - if(_status.event.suits.length>=4){ - if(cards.length>8) return 0; - return 4.5-get.value(card); - } if(!_status.event.suits.includes(suit)) return 6-get.value(card); if(card.name==='sha') return 3-get.value(card); return 1-get.value(card); @@ -1306,6 +1302,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, dczhangcai:{ audio:2, + mod:{ + aiValue:(player,card,num)=>{ + if(num>0&&card.name==='zhuge') return 20; + }, + aiUseful:(player,card,num)=>{ + if(num>0&&card.name==='zhuge') return 10; + } + }, trigger:{ player:['useCard','respond'], },