diff --git a/card/extra.js b/card/extra.js index 80dc0ebc4..652f0997d 100644 --- a/card/extra.js +++ b/card/extra.js @@ -91,6 +91,9 @@ card.extra={ } } } + else if(player.hasSha()){ + card={name:'sha'}; + } if(card){ if(game.hasPlayer(function(current){ return (ai.get.attitude(target,current)<0&& diff --git a/card/swd.js b/card/swd.js index b963896c4..fc54ae4c6 100644 --- a/card/swd.js +++ b/card/swd.js @@ -1584,22 +1584,34 @@ card.swd={ if(lib.config.mode=='stone'&&!player.isMin()){ if(player.getActCount()+1>=player.actcount) return false; } - var shas=target.get('h','sha'); - var ok=false; + var shas=player.get('h','sha'); + if(shas.length>1){ + if(player.num('e','zhuge')) return 0; + if(player.hasSkill('paoxiao')) return 0; + if(player.hasSkill('fengnu')) return 0; + if(!player.getStat().card.sha){ + if(player.hasSkill('tanlin3')) return 0; + if(player.hasSkill('zhaxiang2')) return 0; + } + } + var card; if(shas.length){ for(var i=0;i0) return 1; - } + else if(player.hasSha()){ + card={name:'sha'}; + } + if(card){ + if(game.hasPlayer(function(current){ + return (ai.get.attitude(target,current)<0&& + target.canUse(card,current,true,true)&& + ai.get.effect(current,card,target)>0); + })){ + return 1; } } return 0; diff --git a/game/game.js b/game/game.js index cb6fa61b4..08e7f5fd6 100644 --- a/game/game.js +++ b/game/game.js @@ -34058,6 +34058,17 @@ if(method=='attack') return m; return n; }, + cardUsable:function(player,card){ + var info=get.info(card); + if(info.autoViewAs){ + card={name:info.autoViewAs,suit:card.suit,number:card.number}; + } + var num=get.info(card).usable; + if(typeof num=='function') num=num(card,player); + num=game.checkMod(card,player,num,'cardUsable',player.get('s')); + if(typeof num!='number') return Infinity; + else return num-get.cardCount(card,player); + }, attackRange:function(player){ var range=0; range=game.checkMod(player,player,range,'globalFrom',player.get('s'));