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'; }, }, },