This commit is contained in:
libccy 2017-02-11 22:29:25 +08:00
parent e7ca2b8a42
commit e4a55059a6
3 changed files with 36 additions and 10 deletions

View File

@ -91,6 +91,9 @@ card.extra={
} }
} }
} }
else if(player.hasSha()){
card={name:'sha'};
}
if(card){ if(card){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (ai.get.attitude(target,current)<0&& return (ai.get.attitude(target,current)<0&&

View File

@ -1584,22 +1584,34 @@ card.swd={
if(lib.config.mode=='stone'&&!player.isMin()){ if(lib.config.mode=='stone'&&!player.isMin()){
if(player.getActCount()+1>=player.actcount) return false; if(player.getActCount()+1>=player.actcount) return false;
} }
var shas=target.get('h','sha'); var shas=player.get('h','sha');
var ok=false; 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){ if(shas.length){
for(var i=0;i<shas.length;i++){ for(var i=0;i<shas.length;i++){
if(lib.filter.filterCard(shas[i],target)){ if(lib.filter.filterCard(shas[i],target)){
ok=true;break; card=shas[i];break;
} }
} }
} }
if(ok){ else if(player.hasSha()){
var card=target.get('h','sha',0); card={name:'sha'};
for(var i=0;i<game.players.length;i++){ }
if(ai.get.attitude(target,game.players[i])<0&& if(card){
target.canUse(card,game.players[i],true,true)){ if(game.hasPlayer(function(current){
if(ai.get.effect(game.players[i],card,target)>0) return 1; return (ai.get.attitude(target,current)<0&&
} target.canUse(card,current,true,true)&&
ai.get.effect(current,card,target)>0);
})){
return 1;
} }
} }
return 0; return 0;

View File

@ -34058,6 +34058,17 @@
if(method=='attack') return m; if(method=='attack') return m;
return n; 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){ attackRange:function(player){
var range=0; var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s')); range=game.checkMod(player,player,range,'globalFrom',player.get('s'));