diff --git a/card/sp.js b/card/sp.js index 12a809800..c19178de3 100644 --- a/card/sp.js +++ b/card/sp.js @@ -268,10 +268,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ multitarget:true, targetprompt:['给一张牌','得两张牌'], filterTarget:function(card,player,target){ - return target!=player; + return target!==player; }, - filterAddedTarget:function(card,player,target){ - return target!=player; + filterAddedTarget:function(card,player,target,preTarget){ + return target!==preTarget&&target!==player; }, content:function(){ 'step 0' @@ -313,21 +313,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, result:{ target:function(player,target){ - var ok=false; - var hs=player.getCards('h'); - if(hs.length<=1) return 0; - for(var i=0;i{ + return get.value(hs[i])<5.5; + })) return 0; + let targets=get.copy(ui.selected.targets); + if(_status.event.preTarget) targets.add(_status.event.preTarget); + if(targets.length){ + if(target.hasSkillTag('nogain')) return 0.01; return 2; } - if(target.countCards('he')==0) return 0; + if(!target.countCards('he')) return 0; if(player.hasFriend()) return -1; return 0; } diff --git a/card/standard.js b/card/standard.js index d60b449a8..3c64fc25c 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1838,23 +1838,39 @@ game.import('card',function(lib,game,ui,get,ai,_status){ useful:1, }, result:{ - target:function(player,target){ - if(ui.selected.targets.length){ - const preTarget=ui.selected.targets.lastItem; - const eff=get.effect(target,{name:'sha'},preTarget,player); - return Math.sign(eff)*get.sgnAttitude(player,target); + player:(player,target)=>{ + if(!target.hasSkillTag('noe')&&get.attitude(player,target)>0) return 0; + return (player.hasSkillTag('noe')?0.32:0.15)*target.getEquips(1).reduce((num,i)=>{ + return num+get.value(i,player); + },0); + }, + target:(player,target)=>{ + let targets=get.copy(ui.selected.targets); + if(_status.event.preTarget) targets.add(_status.event.preTarget); + if(targets.length){ + let preTarget=targets.lastItem,pre=_status.event.getTempCache('jiedao_result',preTarget); + if(pre&&pre.target.isIn()) return target===pre.target?pre.eff:0; + return get.effect(target,{name:'sha'},preTarget,player)/get.attitude(player,target); } - const filter=get.info({name:'jiedao'}).filterAddedTarget; - if(game.hasPlayer(current=>{ - return filter(null,null,current,target)&&get.effect(current,{name:'sha'},target,player)>=0; - })) return -1; - if(target.mayHaveSha(player,'use')) return 0.25; - return -1; - }, - player:function(player){ - if(player.getCards('he',{subtype:'equip1'}).length) return 0; - return 1.25; - }, + let arms=(target.hasSkillTag('noe')?0.32:-0.15)*target.getEquips(1).reduce((num,i)=>{ + return num+get.value(i,target); + },0); + if(!target.mayHaveSha(player,'use')) return arms; + let sha=game.filterPlayer(get.info({name:'jiedao'}).filterAddedTarget),addTar=null; + sha=sha.reduce((num,current)=>{ + let eff=get.effect(current,{name:'sha'},target,player); + if(eff<=num) return num; + addTar=current; + return eff; + },-100); + if(!addTar) return arms; + sha/=get.attitude(player,target); + _status.event.putTempCache('jiedao_result',target,{ + target:addTar, + eff:sha + }); + return Math.max(arms,sha); + } }, tag:{ gain:1, diff --git a/character/mobile.js b/character/mobile.js index 6a9820ce5..36f1c8b55 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -6840,8 +6840,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards,player,'give').gaintag.add('quanji'); } "step 4" - if(event.count>0&&player.hasSkill('requanji')){ - player.chooseBool(get.prompt2('requanji')).set('frequentSkill','requanji'); + if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('requanji')).set('frequentSkill',event.name); } else event.finish(); "step 5" @@ -12909,8 +12909,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.draw(); event.count--; "step 2" - if(event.count){ - player.chooseBool(get.prompt2('mingzhe')).set('frequentSkill',event.name); + if(event.count&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('mingzhe')).set('frequentSkill',event.name); } else event.finish(); "step 3" diff --git a/character/offline.js b/character/offline.js index 9c55be2d5..bb48350bc 100644 --- a/character/offline.js +++ b/character/offline.js @@ -4593,8 +4593,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 4' if(cards.length) player.gain(cards,'gain2','log'); 'step 5' - if(event.count>0&&player.hasSkill('spyinzhi')){ - player.chooseBool(get.prompt2('spyinzhi')).set('frequentSkill','spyinzhi'); + if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('spyinzhi')).set('frequentSkill',event.name); } else event.finish(); 'step 6' diff --git a/character/refresh.js b/character/refresh.js index b10e1cbfa..2522c00c1 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -2856,7 +2856,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, nokeep:true, skillTagFilter:function(player,tag,arg){ - if(tag==='nokeep') return (!arg||arg.card&&get.name(arg.card)==='tao')&&player.isPhaseUsing()&&player.countSkill('rezhanjue_draw')<3&&player.hasCard((card)=>get.name(card)!='tao'&&!card.hasGaintag('reqinwang'),'h'); + if(tag==='nokeep') return (!arg||arg.card&&get.name(arg.card)==='tao')&&player.isPhaseUsing()&&player.countSkill('rezhanjue_draw')<3&&player.hasCard((card)=>{ + return get.name(card)!=='tao'&&!card.hasGaintag('reqinwang'); + },'h'); } }, }, @@ -5510,8 +5512,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards,'giveAuto',player).gaintag.add('xinquanji'); } 'step 4' - if(event.count>0&&player.hasSkill('xinquanji')){ - player.chooseBool(get.prompt2('xinquanji')).set('frequentSkill','xinquanji'); + if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('xinquanji')).set('frequentSkill',event.name); } else event.finish(); 'step 5' diff --git a/character/shenhua.js b/character/shenhua.js index 8f62c5edd..33d156ba3 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -4493,7 +4493,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.syncStorage('huashen'); player.updateMarks('huashen'); 'step 2' - if(--event.num>0) player.chooseBool(get.prompt2('xinsheng')).set('frequentSkill','xinsheng'); + if(--event.num>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('xinsheng')).set('frequentSkill',event.name); + } else event.finish(); 'step 3' if(result.bool&&player.hasSkill('xinsheng')){ diff --git a/character/sp.js b/character/sp.js index 4ed53977d..7971642e6 100755 --- a/character/sp.js +++ b/character/sp.js @@ -23349,8 +23349,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.draw(); event.count--; "step 2" - if(event.count){ - player.chooseBool(get.prompt2('mingzhe')).set('frequentSkill','mingzhe'); + if(event.count&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('mingzhe')).set('frequentSkill',event.name); } else event.finish(); "step 3" diff --git a/character/standard.js b/character/standard.js index 3f5275e5a..f86a3f6f3 100755 --- a/character/standard.js +++ b/character/standard.js @@ -649,7 +649,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ animate:'draw', }).setContent('gaincardMultiple'); 'step 6' - if(event.count>0&&player.hasSkill(event.name)){ + if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ player.chooseBool(get.prompt2(event.name)).set('frequentSkill',event.name); } else event.finish(); @@ -1937,7 +1937,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.count--; player.draw(2); "step 2" - if(event.count>0){ + if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ player.chooseBool(get.prompt2('xiaoji')).set('frequentSkill','xiaoji').ai=lib.filter.all; } "step 3" diff --git a/character/yijiang.js b/character/yijiang.js index c6041972f..e6b09f184 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -1388,10 +1388,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, cardname:function(card){ - if(card.hasGaintag('kousheng')) return 'sha'; + if(get.itemtype(card)=='card'&&card.hasGaintag('kousheng')) return 'sha'; }, cardnature:function(card){ - if(card.hasGaintag('kousheng')) return false; + if(get.itemtype(card)=='card'&&card.hasGaintag('kousheng')) return false; }, }, group:'kousheng_damage', @@ -10852,8 +10852,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards,player,'giveAuto').gaintag.add('quanji'); } "step 4" - if(event.count>0&&player.hasSkill('quanji')){ - player.chooseBool(get.prompt2('quanji')).set('frequentSkill','quanji'); + if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ + player.chooseBool(get.prompt2('quanji')).set('frequentSkill',event.name); } else event.finish(); "step 5" diff --git a/game/game.js b/game/game.js index 098c76f59..e8ea1b654 100644 --- a/game/game.js +++ b/game/game.js @@ -14497,6 +14497,7 @@ new Promise(resolve=>{ },true); next.set('_get_card',card); next.set('preTarget',targets[num]); + next.set('ai',target=>get.effect(target,get.card(),player,_status.event.player)); } else{ event.addedTargets[num]=false;