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(game.hasPlayer(function(current){
return (ai.get.attitude(target,current)<0&&

View File

@ -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;i<shas.length;i++){
if(lib.filter.filterCard(shas[i],target)){
ok=true;break;
card=shas[i];break;
}
}
}
if(ok){
var card=target.get('h','sha',0);
for(var i=0;i<game.players.length;i++){
if(ai.get.attitude(target,game.players[i])<0&&
target.canUse(card,game.players[i],true,true)){
if(ai.get.effect(game.players[i],card,target)>0) 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;

View File

@ -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'));