From c1221c0320536b26e98f628501bc2f389aea55c2 Mon Sep 17 00:00:00 2001 From: PZ157 <3619242020@qq.com> Date: Tue, 14 Nov 2023 23:57:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=90=E7=A7=B0?= =?UTF-8?q?=E8=B1=A1=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/yijiang.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/character/yijiang.js b/character/yijiang.js index 600c0285f..e89e2b2ad 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -13248,7 +13248,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); next.set('maxNum',event.name=='oldchengxiang'?12:13); next.set('ai',function(button){ - return get.value(button.link,_status.event.player); + let player=_status.event.player,name=get.name(button.link),val=get.value(button.link,player); + if(name==='tao') return val + 2*Math.min(3,1+player.getDamagedHp()); + if(name==='jiu'&&player.hp<3) return val + 2*(2.8-player.hp); + if(name==='wuxie'&&player.countCards('j')&&!player.hasWuxie()) return val + 5; + if(player.hp>1&&player.hasSkill('renxin')&&player.hasFriend()&&get.type(button.link)==='equip') return val + 4; + return val; }); "step 2" if(result.bool&&result.links){ From 270499d66041f6442bae0f324d0957e4d2859aa3 Mon Sep 17 00:00:00 2001 From: PZ157 <3619242020@qq.com> Date: Wed, 15 Nov 2023 19:20:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?bugfix,=20ai=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp2.js | 15 ++++++++++++--- character/tw.js | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/character/sp2.js b/character/sp2.js index 64a4ff12c..16331a173 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -5529,7 +5529,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target,current,isLink){ - if(isLink||!player.isPhaseUsing()) return; + if(isLink||typeof card!=='object'||!player.isPhaseUsing()) return; var num; var evt=_status.event.getParent('useCard'),evt2=_status.event.getParent('phaseUse'); if(evt.card==card){ @@ -5541,8 +5541,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return evt.getParent('phaseUse')==evt2; }).length; if(num<0||num>1) return; - if(num==0&&get.tag(card,'damage')) return 'zerotarget'; - if(num==1&&get.color(card)=='black') return 'zeroplayertarget'; + if(num===0&&get.tag(card,'damage')){ + if(target.hasSkillTag('filterDamage',null,{ + player:player, + card:card + })||!player.hasSkillTag('damageBonus',true,{ + target:target, + card:card + })) return 'zerotarget'; + return [0.5,0,0.5,0]; + } + if(num===1&&get.color(card)=='black') return 'zeroplayertarget'; }, }, }, diff --git a/character/tw.js b/character/tw.js index ce0aaca15..5cb3b4060 100644 --- a/character/tw.js +++ b/character/tw.js @@ -13712,11 +13712,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ effect:{ target:function(card,player,target){ if(typeof card=='object'&&target.storage.gx_chongyingshenfu_effect&&target.getStorage('gx_chongyingshenfu_effect').includes(card.name)&&!target.hasSkillTag('unequip2')&& - get.itemtype(player)!=='player'||!player.hasSkillTag('jueqing',false,target)&&!player.hasSkillTag('unequip',false,{ + (get.itemtype(player)!=='player'||!player.hasSkillTag('jueqing',false,target)&&!player.hasSkillTag('unequip',false,{ name:card.name, target:target, card:card, - })){ + }))){ if(player&&player.hasSkillTag('damageBonus',true,{ target:target, card:card From 2920ebf9c7bd184aede423692ef3f93628eb6403 Mon Sep 17 00:00:00 2001 From: PZ157 <3619242020@qq.com> Date: Wed, 15 Nov 2023 20:20:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?ai=E4=BC=98=E5=8C=96=EF=BC=8Cbugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/guozhan.js | 2 +- card/standard.js | 4 +-- card/yingbian.js | 69 ++++++++++++++++++++++----------------------- card/yunchou.js | 10 ++++--- character/mobile.js | 4 +-- 5 files changed, 44 insertions(+), 45 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index e087fc6a0..9d2049cad 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -1531,7 +1531,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ target:target, card:card })) return; - if(get.tag(card,'natureDamage')) return 'zerotarget'; + if(get.tag(card,'natureDamage')) return 'zeroplayertarget'; if(card.name=='tiesuo'){ return [0,0]; } diff --git a/card/standard.js b/card/standard.js index a496e7a0b..868ea7143 100644 --- a/card/standard.js +++ b/card/standard.js @@ -2216,7 +2216,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target){ - if(target.hasSkillTag('unequip2')) return; + if(typeof card!=='object'||target.hasSkillTag('unequip2')) return; if(player.hasSkillTag('unequip',false,{ name:card?card.name:null, target:target, @@ -2226,7 +2226,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ target:target, card:card })) return; - if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget'; + if(card.name=='sha'&&get.color(card)=='black') return 'zeroplayertarget'; } } } diff --git a/card/yingbian.js b/card/yingbian.js index 13ecc0006..f00b13dd4 100644 --- a/card/yingbian.js +++ b/card/yingbian.js @@ -594,46 +594,43 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ player:function(card,player,target){ - if(typeof card!='object'||!target||get.name(card)!='sha'&&(get.type(card)!='trick'||(get.color(card)!='black'&&!get.tag(card,'damage')))) return; - var info=get.info(card); - var targets=[]; + if(typeof card!=='object'||!target||get.name(card)!=='sha'&&(get.type(card)!=='trick'||get.color(card)!=='black'&&!get.tag(card,'damage'))) return; + if(!target.hasSkill('heiguangkai_skill')||target.hasSkillTag('unequip2')||player.hasSkillTag('unequip',false,{ + name:card?card.name:null, + target:target, + card:card, + })||player.hasSkillTag('unequip_ai',false,{ + name:card?card.name:null, + target:target, + card:card, + })) return; + let targets=[],evt=_status.event.getParent('useCard'); targets.addArray(ui.selected.targets); - var evt=_status.event.getParent('useCard'); if(evt&&evt.card==card) targets.addArray(evt.targets); if(targets.length){ - if(!targets.contains(target)){ - if(target.hasSkill('heiguangkai_skill')&&!target.hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card, - })&&!player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card, - })) return 'zerotarget'; - } - else{ - if(targets.length>1) return; - if(info.selectTarget!=-1&&targets[0].hasSkill('heiguangkai_skill')&&!targets[0].hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:targets[0], - card:card, - })&&!player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:targets[0], - card:card, - })) return 'zerotarget'; - } + if(targets.length>1||!targets.includes(target)) return 'zeroplayertarget'; + return; } - if(target.hasSkill('heiguangkai_skill')&&!target.hasSkillTag('unequip2')&&!player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:target, - card:card, - })&&!player.hasSkillTag('unequip_ai',false,{ - name:card?card.name:null, - target:target, - card:card, - })) return [1,0,0.7,0]; + let info=get.info(card); + if(!info||info.notarget||!info.filterTarget) return; + let range,select=get.copy(info.selectTarget),filter; + if(select===undefined) range=[1,1]; + else if(typeof select==='number') range=[select,select]; + else if(get.itemtype(select)==='select') range=select; + else if(typeof select==='function') range=select(card,player); + if(info.singleCard) range=[1,1]; + game.checkMod(card,player,range,'selectTarget',player); + if(range[1]<-1) range=[1, 1]; + else if(range[0]<0){ + if(info.filterTarget===true) filter=game.players.length; + else filter=game.countPlayer(current=>{ + return info.filterTarget(card,player,current); + }); + range=[filter,filter]; + } + if(!range) return; + if(range[0]>1&&range[1]>1) return 'zeroplayertarget'; + return [1,0,0.7,0]; }, }, }, diff --git a/card/yunchou.js b/card/yunchou.js index 60b18712e..c4713cb59 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -841,15 +841,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){ nothunder:true, effect:{ target:function(card,player,target,current){ + if(target.hasSkillTag('unequip2')) return; if(player.hasSkillTag('unequip',false,{ name:card?card.name:null, target:player, card:card + })||player.hasSkillTag('unequip_ai',false,{ + name:card?card.name:null, + target:target, + card:card })) return; - if(get.tag(card,'natureDamage')) return 'zerotarget'; - if(card.name=='tiesuo'){ - return [0,0]; - } + if(card.name=='tiesuo'||get.tag(card,'natureDamage')) return 'zeroplayertarget'; } } } diff --git a/character/mobile.js b/character/mobile.js index 05cd9e5e2..8e4d203f4 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -12941,7 +12941,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target){ - if(target.hasSkillTag('unequip2')) return; + if(typeof card!=='object'||target.hasSkillTag('unequip2')) return; if(player.hasSkillTag('unequip',false,{ name:card?card.name:null, target:player, @@ -12951,7 +12951,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target:player, card:card })) return; - if(card.name=='sha'&&['spade','club','heart'].contains(get.suit(card))) return 'zerotarget'; + if(card.name=='sha'&&['spade','club','heart'].contains(get.suit(card))) return 'zeroplayertarget'; }, }, }, From 2aa842efa84f76ecfdf2c1978eb9ae4aeda579da Mon Sep 17 00:00:00 2001 From: PZ157 <3619242020@qq.com> Date: Thu, 16 Nov 2023 20:37:18 +0800 Subject: [PATCH 4/4] bugfix --- character/offline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/offline.js b/character/offline.js index a8bb1277f..9c55be2d5 100644 --- a/character/offline.js +++ b/character/offline.js @@ -949,7 +949,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target){ - if(card.name==='sha'&&!game.hasNature(card)&&target.hasEmptySlot(2)) return 'zeroplayertarget'; + 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]; } }