From 5d2d8f54331762bdb9133f578b733034a59e40e4 Mon Sep 17 00:00:00 2001 From: 157 <144450955+PZ157@users.noreply.github.com> Date: Sat, 23 Sep 2023 15:37:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A2=81=E5=A7=AC=E3=80=90?= =?UTF-8?q?=E8=92=99=E6=96=A5=E3=80=91=E3=80=90=E8=8A=B3=E5=A6=92=E3=80=91?= =?UTF-8?q?=E3=80=90=E8=8A=82=E8=A1=8C=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 109 +++++++++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 38 deletions(-) diff --git a/character/xianding.js b/character/xianding.js index 4715edc84..856e79e0a 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -4563,14 +4563,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target,current){ + if(get.itemtype(player)!='player'||player._dcmengchi_aiChecking||target.getStat('gain')) return; + if(card.name=='tiesuo'&&!target.isLinked()) return 0; if(player.hasSkillTag('jueqing',false,target)) return; - if(target.getStat('gain')) return; - if(get.tag(card,'natureDamage')) return; - if(target.hp==1) return 0.75; - if(card.name=='sha'&&!player.hasSkill('jiu')||target.hasSkillTag('filterDamage',null,{ + if(!get.tag(card,'damage')||get.tag(card,'natureDamage')) return; + if(target.hp<=1) return 0.75; + if(!target.hasSkillTag('filterDamage',null,{ player:player, - card:card, - })) return [1,Math.min(1.5,0.75+0.25*target.hp)]; + card:card + })&&player.hasSkillTag('damageBonus',false,{ + target:target, + card:card + })){ + if(target.hp>2) return 0.5; + return 0.75; + } + if(get.attitude(player,target)>0) return [0,0]; + var sha=player.getCardUsable({name:'sha'}); + player._dcmengchi_aiChecking=true; + var num=player.countCards('h',function(card){ + if(get.name(card)=='sha'){ + if(sha==0) return false; + else sha--; + } + return player.canUse(card,target)&&get.effect(target,card,player,player)>0; + }); + delete player._dcmengchi_aiChecking; + if(player.hasSkillTag('damage')) num++; + if(num<2) return [0,0]; }, }, }, @@ -4612,44 +4632,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target){ - if(!get.tag(card,'damage')) return; - if(player.hasSkillTag('jueqing',false,target)) return; - if(target==_status.currentPhase) return; - if(player._dcfangdu_aiChecking) return; + if(player._dcfangdu_aiChecking||target==_status.currentPhase) return; + if(!get.tag(card,'damage')||player.hasSkillTag('jueqing',false,target)) return; if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return; if(!get.tag(card,'natureDamage')){ - if(target.hasHistory('damage',evt=>!evt.nature)){ - return [1,-2]; - } + if(target.hasHistory('damage',evt=>!evt.nature)) return 1.5; + else if(target.hp<=1||player.hasSkillTag('damageBonus',false,{ + target:target, + card:card + })&&!target.hasSkillTag('filterDamage',null,{ + player:player, + card:card + })) return 0.75; else{ - if(get.attitude(player,target)>0){ - if(target.hasSkill('dcjiexing')) return [0,0.2]; - } - if(get.attitude(player,target)<0&&!player.hasSkillTag('damageBonus')){ - var sha=player.getCardUsable({name:'sha'}); - player._dcfangdu_aiChecking=true; - var num=player.countCards('h',function(card){ - if(get.name(card)=='sha'){ - if(sha==0){ - return false; - } - else{ - sha--; - } - } - return player.canUse(card,target)&&get.effect(target,card,player,player)>0; - }); - delete player._dcfangdu_aiChecking; - if(player.hasSkillTag('damage')){ - num++; + if(get.attitude(player,target)>0) return [0,0]; + var sha=player.getCardUsable({name:'sha'}); + player._dcfangdu_aiChecking=true; + var num=player.countCards('h',function(card){ + if(get.name(card)=='sha'){ + if(sha==0) return false; + else sha--; } - if(num<2){ - return [0,0.8]; - } - } + return player.canUse(card,target)&&get.effect(target,card,player,player)>0; + }); + delete player._dcfangdu_aiChecking; + if(player.hasSkillTag('damage')) num++; + if(num<2) return [0,0]; } } - if(!target.hasHistory('damage',evt=>evt.nature)&&player.countCards('h')>1&&get.tag(card,'natureDamage')) return [1,1]; + if(get.tag(card,'natureDamage')&&!target.hasHistory('damage',evt=>evt.nature)&&player.countCards('he')>1) return [1,1,1,-1]; } } } @@ -4685,6 +4696,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.removeGaintag('dcjiexing'); }, } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'recover')) return [1,1]; + if(get.tag(card,'damage')){ + var draw=0.9; + if(target.hasSkill('dcmengchi')&&target.getStat('gain')) draw=1.8; + if(target.hp<=1||card.name=='sha'&&player.hasSkill('jiu')||get.itemtype(player)=='player'&&!target.hasSkillTag('filterDamage',null,{ + player:player, + card:card + })&&player.hasSkillTag('damageBonus',false,{ + target:target, + card:card + })){ + if(target.hp>2) return [1,draw]; + return; + } + return [1,draw]; + } + } + } } }, //朱建平