From ac3d772bc3c22c401095dcee01065c2a4e7853f0 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:04:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=90=E7=9F=AD?= =?UTF-8?q?=E5=85=B5=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复filter只检测手牌的bug --- character/ddd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/character/ddd.js b/character/ddd.js index 53dbc276e..ad2e67a17 100644 --- a/character/ddd.js +++ b/character/ddd.js @@ -3304,14 +3304,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dddduanbing:{ enable:'phaseUse', filter:function(event,player){ - return player.canAddJudge('bingliang')&&player.hasCard((card)=>lib.skill['dddduanbing'].filterCard(card,player),'h'); + return player.canAddJudge('bingliang')&&player.hasCard((card)=>lib.skill['dddduanbing'].filterCard(card,player),'he'); }, filterCard:function(card,player){ if(get.color(card)!='black'||get.type2(card)=='trick') return false; return player.canAddJudge(get.autoViewAs({name:'bingliang'},[card])); }, check:function(card){ - return 6-get.value(card); + return 8.2-get.value(card); }, discard:false, lose:false, From ba97fb46f4563774bf798a2d47b6a27ba635d846 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:12:59 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A9=AC=E6=97=A5?= =?UTF-8?q?=E7=A3=BE=E3=80=90=E7=A7=89=E8=8A=82=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/character/huicui.js b/character/huicui.js index 3411e5a22..1263ceb13 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -6398,6 +6398,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger.directHit.push(trigger.target); } }, + ai:{ + effect:{ + player:function(card,player,target){ + if(player!==target&&get.itemtype(target)==='player'&&(card.name==='sha'||get.type(card,false)==='trick')&& + target.countCards('he')&&!target.hasSkillTag('noh')) return [1,0,1,-1]; + } + } + } }, }, }, From be7c1f5facaf2d63f051539669996d0f162e217e Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:22:53 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8A=80=E8=83=BDai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【激昂】【好施】【雷击】 --- character/shenhua.js | 87 +++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/character/shenhua.js b/character/shenhua.js index f3098cfe5..12d929fba 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3804,6 +3804,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, preHidden:true, audioname:['sp_lvmeng','re_sunben','re_sunce'], + mod:{ + aiOrder:function(player,card,num){ + if(get.color(card)==='red'&&get.name(card)==='sha') return get.order({name: 'sha'})+0.15; + } + }, trigger:{ player:'useCardToPlayered', target:'useCardToTargeted', @@ -3812,6 +3817,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!(event.card.name=='juedou'||(event.card.name=='sha'&&get.color(event.card)=='red'))) return false; return player==event.target||event.getParent().triggeredTargets3.length==1; }, + locked:false, frequent:true, content:function(){ player.draw(); @@ -4872,9 +4878,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, preHidden:true, check:function(event,player){ - if(player.countCards('h')<=1) return true; - return game.hasPlayer(function(current){ - return current!=player&¤t.isMinHandcard()&&get.attitude(player,current)>0; + return (player.countCards('h')+2+event.num)<=5||game.hasPlayer(function(target){ + return player!==target&&!game.hasPlayer(function(current){ + return current!==player&¤t!==target&¤t.countCards('h')0; }); }, content:function(){ @@ -6276,30 +6283,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ useShan:true, effect:{ target:function(card,player,target,current){ - if(get.tag(card,'respondShan')){ - var hastarget=game.hasPlayer(function(current){ - return get.attitude(target,current)<0; - }); - var be=target.countCards('e',{color:'black'}); - if(target.countCards('h','shan')&&be){ - if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.countCards('he')/2:0]; + if(get.tag(card,'respondShan')&&!player.hasSkillTag('directHit_ai',true,{ + target: target, + card: card + },true)){ + let club=0,spade=0; + if(game.hasPlayer(function(current){ + return get.attitude(target,current)<0&&get.damageEffect(current,target,target,'thunder')>0; + })){ + club=2; + spade=4; } - if(target.countCards('h','shan')&&target.countCards('h')>2){ - if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.countCards('h')/4:0]; - } - if(target.countCards('h')>3||(be&&target.countCards('h')>=2)){ - return [0,0]; - } - if(target.countCards('h')==0){ - return [1.5,0]; - } - if(target.countCards('h')==1&&!be){ - return [1.2,0]; - } - if(!target.hasSkill('guidao')) return [1,0.05]; - return [1,Math.min(0.5,(target.countCards('h')+be)/4)]; + if(!target.isHealthy()) club+=2; + if(!club&&!spade) return 1; + if(!target.mayHaveShan(player)) return 1-0.1*Math.min(5,target.countCards('hs')); + if(!target.hasSkillTag('rejudge')) return [1,(club+spade)/4]; + let pos=player.hasSkillTag('viewHandcard',null,target,true)?'hes':'e',better=club>spade?'club':'spade',max=0; + target.hasCard(function(cardx){ + if(get.suit(cardx)===better){ + max=2; + return true; + } + if(spade&&get.color(cardx)==='black') max=1; + },pos); + if(max===2) return [1,Math.max(club,spade)]; + if(max===1) return [1,Math.min(club,spade)]; + if(pos==='e') return [1,Math.min(Math.max(1,target.countCards('hs'))*(club+spade)/4,Math.max(club,spade))]; + return [1,(club+spade)/4]; } } } @@ -7259,17 +7269,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ useShan:true, effect:{ target:function(card,player,target,current){ - if(get.tag(card,'respondShan')){ - var hastarget=game.hasPlayer(function(current){ - return get.attitude(target,current)<0; - }); - if(target.countCards('h','shan')&&target.countCards('e',{suit:'spade'})){ - return [0,hastarget?target.countCards('he')/2:0]; - } - if(target.countCards('h','shan')){ - return [1,hastarget?target.countCards('he')/2:0]; - } - return [1,target.countCards('h')/4]; + if(get.tag(card,'respondShan')&&!player.hasSkillTag('directHit_ai',true,{ + target: target, + card: card + },true)&&game.hasPlayer(function(current){ + return get.attitude(target,current)<0&&get.damageEffect(current,target,target,'thunder')>0; + })){ + if(!target.mayHaveShan(player)) return 1-0.1*Math.min(5,target.countCards('hs')); + if(!target.hasSkillTag('rejudge')) return [1,1]; + let pos=player.hasSkillTag('viewHandcard',null,target,true)?'hes':'e'; + if(target.hasCard(function(cardx){ + return get.suit(cardx)==='spade'; + },pos)) return [1,4]; + if(pos==='e') return [1,Math.min(4,1+0.75*Math.max(1,target.countCards('hs')))]; + return [1,1]; } } } From a58363fcfbd544ff046adaf7a0ca00e52cfb21ff Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:27:22 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=94=E8=9E=8D?= =?UTF-8?q?=E3=80=90=E5=90=8D=E5=A3=AB=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/offline.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/character/offline.js b/character/offline.js index 0b0164d47..1955c0bf0 100644 --- a/character/offline.js +++ b/character/offline.js @@ -944,6 +944,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ trigger.cancel(); + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(card.name==='sha'&&!game.hasNature(card)&&target.hasEmptySlot(2)) return 'zeroplayertarget'; + if(get.subtype(card)=='equip2'&&target.isEmpty(2)) return [0.6,-0.8]; + } + } } }, //战役篇蒋钦 From 25831d1b2927ea46d0f2de885d25c0fcb67cf28f Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:34:17 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=98=E8=BE=A9?= =?UTF-8?q?=E3=80=90=E8=AF=97=E6=80=A8=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/character/xianding.js b/character/xianding.js index 1e2b7904c..9975edbb7 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -10550,6 +10550,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ player.draw(2+get.sgn(trigger.player.hp-player.hp)); }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.itemtype(player)!=='player'||player===target) return 1; + let num=1,ds=2+get.sgn(player.hp-target.hp); + if(player===_status.currentPhase&&_status.currentPhase.group==='qun'&&target.hasZhuSkill('yuwei',player)) num=2; + if(target.getHistory('gain',function(evt){ + return evt.getParent(2).name==='shiyuan'&&evt.cards.length===ds; + }).length>=num) return 1; + let name=get.name(card); + if(get.tag(card,'lose')||name==='huogong'||name==='juedou'||name==='tiesuo') return [1,ds]; + if(!target.hasFriend()) return 1; + return [1,0.8*ds]; + } + } + } }, dushi:{ audio:2, From b3c2da14d1a5139ccd3b8a06243e558e84af454c Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:36:21 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=90=E7=8C=AE?= =?UTF-8?q?=E5=9B=BE=E3=80=91=E8=BA=AB=E4=BB=BD=E6=9A=B4=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/yijiang.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/character/yijiang.js b/character/yijiang.js index f430bfe6e..ea57992f9 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -10583,6 +10583,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ "step 0" + if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.2); player.draw(2); "step 1" player.chooseCard(2,'he',true,'交给'+get.translation(trigger.player)+'两张牌').set('ai',function(card){ @@ -10597,8 +10598,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger.player.storage.xiantu4.push(player); }, ai:{ - threaten:1.1, - expose:0.3 + threaten:1.1 } }, xiantu1:{audio:true}, From bec0faf0d273ce78e12f4c57a13df31f09b51c44 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:44:15 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=90=E5=A4=B7?= =?UTF-8?q?=E7=81=AD=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/yingbian.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/character/yingbian.js b/character/yingbian.js index e6f489f3c..181424f12 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -2592,10 +2592,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player!=event.player&&event.num-2) return false; - if(player.hp>2) return true; - if(player.hp==2&&event.player.hp<3) return false; - return player.hp>1; + if(event.player.hasSkillTag('nodamage')) return false; + let tj = player.countCards('hs', function (card) { + return get.name(card) === 'tao' || get.name(card) === 'jiu'; + }), + att = get.attitude(_status.event.player, event.player), + eff = get.damageEffect(event.player, player, _status.event.player, event.nature), + fd = event.player.hasSkillTag('filterDamage', null, { + player: player, + card: event.card + }), + hp = player.hp + tj; + if(player.storage.tairan2) hp -= player.storage.tairan2; + if(eff <= 0 || fd || att >= -2 || Math.abs(hp) <= 1) return false; + if(hp > 2 || event.player.isLinked() && event.nature && eff > 0) return true; + return !event.player.countCards('hs') || event.player.hp > 2 * event.num && !event.player.hasSkillTag('maixie'); }, logTarget:'player', content:function(){ @@ -2604,6 +2615,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger.yimie_num=trigger.player.hp-trigger.num; trigger.num=trigger.player.hp; }, + ai:{ + damageBonus:true, + skillTagFilter:function(player,tag,arg){ + return arg && arg.target && arg.target.hp > 1 && player.hp > 1 && get.attitude(player, arg.target) < -2; + } + } }, yimie2:{ trigger:{player:'damageEnd'},