This commit is contained in:
libccy 2017-03-27 17:30:25 +08:00
parent 6f0a7b2c95
commit bd8b81a73b
22 changed files with 176 additions and 176 deletions

View File

@ -88,7 +88,7 @@ card.extra={
}
}
else if(player.hasSha()&&player.needsToDiscard()){
if(player.num('h','hufu')!=1){
if(player.countCards('h','hufu')!=1){
card={name:'sha'};
}
}
@ -353,7 +353,7 @@ card.extra={
basic:{
equipValue:function(card,player){
if(player.hp==player.maxHp) return 5;
if(player.num('h','baiyin')) return 6;
if(player.countCards('h','baiyin')) return 6;
return 0;
}
}

View File

@ -285,7 +285,7 @@ card.hearth={
selectTarget:-1,
content:function(){
player.addTempSkill('shihuawuqi','phaseAfter');
if(!player.num('h','sha')){
if(!player.countCards('h','sha')){
var card=get.cardPile('sha');
if(card){
player.gain(card,'gain2');
@ -298,7 +298,7 @@ card.hearth={
order:8,
result:{
target:function(player,target){
return target.num('h','sha')?0:1;
return target.countCards('h','sha')?0:1;
}
}
}
@ -486,7 +486,7 @@ card.hearth={
order:1,
result:{
target:function(player,target){
if(target.num('h','tao')) return 0;
if(target.countCards('h','tao')) return 0;
var nh=target.countCards('h');
if(nh<=2) return 1;
if(target.hp==1&&target.maxHp>2) return 1;

View File

@ -232,7 +232,7 @@ card.standard={
if(nd<=0){
keep=true;
}
else if(nd==1&&target.hp>=2&&target.num('h','tao')<=1){
else if(nd==1&&target.hp>=2&&target.countCards('h','tao')<=1){
keep=true;
}
var mode=get.mode();
@ -257,7 +257,7 @@ card.standard={
if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){
var num=game.countPlayer(function(current){
if(current.identity=='fan'){
return current.num('h','tao');
return current.countCards('h','tao');
}
});
if(num>1&&player==target) return 2;
@ -342,7 +342,7 @@ card.standard={
})){
return 1;
}
var num=player.num('h','sha');
var num=player.countCards('h','sha');
if(num>1) return 4+num;
return 2+num;
}
@ -382,7 +382,7 @@ card.standard={
ai:{
basic:{
equipValue:function(card,player){
return Math.min(2.5+player.num('h','sha'),4);
return Math.min(2.5+player.countCards('h','sha'),4);
}
}
},
@ -659,7 +659,7 @@ card.standard={
},
ai:{
wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){
if(ai.get.attitude(viewer,target)>0&&target.countCards('h','sha')){
if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
}
},
@ -717,7 +717,7 @@ card.standard={
},
ai:{
wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){
if(ai.get.attitude(viewer,target)>0&&target.countCards('h','shan')){
if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
}
},

View File

@ -93,7 +93,7 @@ card.swd={
content:function(){
'step 0'
var choice;
if(target.num('h','shan')==0||target.num('h','sha')==0||target.hp<=1){
if(target.countCards('h','shan')==0||target.countCards('h','sha')==0||target.hp<=1){
choice='basic';
}
else{
@ -1788,7 +1788,7 @@ card.swd={
},
ai:{
wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){
if(ai.get.attitude(viewer,target)>0&&target.countCards('h','sha')){
if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
}
},
@ -1847,7 +1847,7 @@ card.swd={
},
ai:{
wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){
if(ai.get.attitude(viewer,target)>0&&target.countCards('h','shan')){
if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
}
},
@ -2257,7 +2257,7 @@ card.swd={
return player.canUse('sha',target);
},
filter:function(event,player){
return player.num('h','sha')>0&&lib.filter.cardUsable({name:'sha'},player);
return player.countCards('h','sha')>0&&lib.filter.cardUsable({name:'sha'},player);
},
content:function(){
'step 0'
@ -2403,7 +2403,7 @@ card.swd={
trigger:{player:'phaseBegin'},
forced:true,
filter:function(event,player){
return player.num('h','qinglongzhigui')>0;
return player.countCards('h','qinglongzhigui')>0;
},
content:function(){
'step 0'
@ -2417,7 +2417,7 @@ card.swd={
trigger:{player:'discardEnd'},
direct:true,
filter:function(event,player){
return player.num('h','baishouzhihu')>0;
return player.countCards('h','baishouzhihu')>0;
},
content:function(){
"step 0"
@ -2442,7 +2442,7 @@ card.swd={
trigger:{player:'damageEnd'},
forced:true,
filter:function(event,player){
return event.source&&event.source!=player&&event.source.isAlive()&&player.num('h','zhuquezhizhang')>0;
return event.source&&event.source!=player&&event.source.isAlive()&&player.countCards('h','zhuquezhizhang')>0;
},
logTarget:'source',
check:function(event,player){
@ -2460,7 +2460,7 @@ card.swd={
trigger:{source:'damageEnd'},
forced:true,
filter:function(event,player){
return player.num('h','xuanwuzhihuang')>0&&event.num>0&&player.hp<player.maxHp;
return player.countCards('h','xuanwuzhihuang')>0&&event.num>0&&player.hp<player.maxHp;
},
content:function(){
player.showCards(get.translation(player)+'发动了【玄武之璜】',player.getCards('h','xuanwuzhihuang'));
@ -2471,7 +2471,7 @@ card.swd={
trigger:{player:'phaseBegin'},
forced:true,
filter:function(event,player){
return !player.hujia&&player.num('h','huanglinzhicong')>0;
return !player.hujia&&player.countCards('h','huanglinzhicong')>0;
},
content:function(){
player.showCards(get.translation(player)+'发动了【黄麟之琮】',player.getCards('h','huanglinzhicong'));
@ -2483,7 +2483,7 @@ card.swd={
trigger:{player:'phaseBegin'},
direct:true,
filter:function(event,player){
return player.num('h','cangchizhibi')>0;
return player.countCards('h','cangchizhibi')>0;
},
content:function(){
'step 0'

View File

@ -165,13 +165,13 @@ card.yunchou={
},
content:function(){
'step 0'
if(target.num('h','sha')){
if(target.countCards('h','sha')){
var name=get.translation(player.name);
target.chooseControl().set('prompt',get.translation('caochuanjiejian')).set('choiceList',[
'将手牌中的所有杀交给'+name+',并视为对'+name+'使用一张杀','展示手牌并令'+name+'弃置任意一张'
],function(){
if(ai.get.effect(player,{name:'sha'},target,target)<0) return 1;
if(target.num('h','sha')>=3) return 1;
if(target.countCards('h','sha')>=3) return 1;
return 0;
});
}
@ -981,7 +981,7 @@ card.yunchou={
order:9.5,
basic:{
equipValue:function(card,player){
if(player.num('h','qiankundai')) return 6;
if(player.countCards('h','qiankundai')) return 6;
return 1;
}
}
@ -1070,7 +1070,7 @@ card.yunchou={
_hufu_sha:{
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
return player.num('h','hufu')>0;
return player.countCards('h','hufu')>0;
},
filterCard:{name:'hufu'},
viewAs:{name:'sha'},
@ -1085,7 +1085,7 @@ card.yunchou={
_hufu_shan:{
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
return player.num('h','hufu')>0;
return player.countCards('h','hufu')>0;
},
filterCard:{name:'hufu'},
viewAs:{name:'shan'},
@ -1100,7 +1100,7 @@ card.yunchou={
_hufu_jiu:{
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
return player.num('h','hufu')>0;
return player.countCards('h','hufu')>0;
},
filterCard:{name:'hufu'},
viewAs:{name:'jiu'},

View File

@ -649,7 +649,7 @@ character.gujian={
},
check:function(event,player){
return ai.get.attitude(player,event.player)<0&&
((player.countCards('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1);
((player.countCards('h')>player.hp&&player.countCards('h','lebu')==0)||get.distance(player,event.player)>1);
},
logTarget:'player',
content:function(){

View File

@ -180,7 +180,7 @@ character.gwent={
if(player.hp>=3&&target.hp==1) return -1;
return 0;
}
var num=player.num('h','shan');
var num=player.countCards('h','shan');
if(num<1){
num=1;
}

View File

@ -213,7 +213,7 @@ character.hearth={
return !target.hasSkill('moxie')&&!target.storage.fuhua_failed;
},
filter:function(event,player){
return player.num('h','du');
return player.countCards('h','du');
},
discard:false,
prepare:'give',
@ -1385,7 +1385,7 @@ character.hearth={
}
player.gain(event.cards);
'step 1'
if(player.num('h','sha')){
if(player.countCards('h','sha')){
player.chooseToUse('战意:使用一张杀').filterCard=function(card){
return card.name=='sha'&&get.itemtype(card)=='card';
}
@ -3061,7 +3061,7 @@ character.hearth={
filter:function(event,player){
return event.card.name=='sha'&&event.player!=player&&
get.distance(player,event.targets[0])<=1&&
player.num('h','shan')>0&&
player.countCards('h','shan')>0&&
event.targets.contains(player)==false&&event.targets.length==1;
},
direct:true,
@ -3793,10 +3793,10 @@ character.hearth={
var nh=player.countCards('h');
var nm=1;
var check=true;
if(player.num('h','tao')){
if(player.countCards('h','tao')){
check=false;
}
else if(player.num('h','shan')&&player.num('h','wuxie')){
else if(player.countCards('h','shan')&&player.countCards('h','wuxie')){
check=false;
}
player.chooseTarget(get.prompt('kuixin'),function(card,player,target){
@ -4849,7 +4849,7 @@ character.hearth={
var hastarget=game.hasPlayer(function(current){
return ai.get.attitude(player,current)<0;
});
var ns=target.num('h','shan');
var ns=target.countCards('h','shan');
var nh=target.countCards('h');
if(ns>1){
return [0,hastarget?1:0];

View File

@ -235,7 +235,7 @@ character.ow={
var bs=player.getCards('h',{type:'basic'});
if(bs.length<2) return 0;
if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return;
if(bs.length<=3&&player.num('h','sha')<=1){
if(bs.length<=3&&player.countCards('h','sha')<=1){
for(var i=0;i<bs.length;i++){
if(bs[i].name!='sha'&&ai.get.value(bs[i])<7){
return [1,0,1,-0.5];
@ -848,7 +848,7 @@ character.ow={
player.storage.paotai=0;
},
filter:function(event,player){
return player.num('h','sha')>0&&player.storage.paotai<3;
return player.countCards('h','sha')>0&&player.storage.paotai<3;
},
filterCard:{name:'sha'},
content:function(){
@ -1216,7 +1216,7 @@ character.ow={
target:function(player,target){
var nh=target.countCards('h');
if(ai.get.attitude(player,target)<0&&nh>=3&&
player.canUse('sha',target)&&player.num('h','sha')&&
player.canUse('sha',target)&&player.countCards('h','sha')&&
ai.get.effect(target,{name:'sha'},player,player)>0){
return -nh-5;
}
@ -1485,7 +1485,7 @@ character.ow={
order:4,
result:{
target:function(player,target){
if(!player.num('h','sha')) return 0;
if(!player.countCards('h','sha')) return 0;
if(target.countCards('h')<=1&&get.distance(player,target,'attack')<=1) return 0;
var min=[];
var num=0;
@ -2164,7 +2164,7 @@ character.ow={
direct:true,
content:function(){
"step 0"
var dis=trigger.target.num('h','shan')||trigger.target.num('e','bagua')||trigger.target.countCards('h')>2;
var dis=trigger.target.countCards('h','shan')||trigger.target.num('e','bagua')||trigger.target.countCards('h')>2;
var next=player.chooseToDiscard(get.prompt('xiandan'));
next.ai=function(card){
if(dis) return 7-ai.get.value(card);
@ -3071,7 +3071,7 @@ character.ow={
switch(get.suit(ui.selected.cards[0])){
case 'heart':if(target.hp==1) return 1;return 0.1;
case 'diamond':return 1+Math.sqrt(target.countCards('h'));
case 'club':return -target.countCards('h')-Math.sqrt(target.num('h','sha'));
case 'club':return -target.countCards('h')-Math.sqrt(target.countCards('h','sha'));
case 'spade':return ai.get.damageEffect(target,player,target,'thunder');
default:return 0;
}
@ -3153,7 +3153,7 @@ character.ow={
},
enable:'phaseUse',
filter:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
filterTarget:function(card,player,target){
return target.hp<target.maxHp&&target!=player;
@ -3179,7 +3179,7 @@ character.ow={
},
check:function(event,player){
return ai.get.attitude(player,event.player)<0&&
((player.countCards('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1);
((player.countCards('h')>player.hp&&player.countCards('h','lebu')==0)||get.distance(player,event.player)>1);
},
alter:true,
intro:{

View File

@ -388,7 +388,7 @@ character.refresh={
audio:2,
trigger:{player:'phaseDrawBegin'},
check:function(event,player){
if(player.num('h','sha')) return true;
if(player.countCards('h','sha')) return true;
return Math.random()<0.5;
},
content:function(){
@ -610,7 +610,7 @@ character.refresh={
order:9,
result:{
target:function(player,target){
return -target.countCards('he')-(player.num('h','du')?1:0);
return -target.countCards('he')-(player.countCards('h','du')?1:0);
}
},
threaten:2,
@ -1037,7 +1037,7 @@ character.refresh={
if(target.countCards('h')>target.hp+1&&ai.get.recoverEffect(target)>0){
return 1;
}
if(player.canUse('sha',target)&&(player.num('h','sha')||player.num('he',{color:'red'}))){
if(player.canUse('sha',target)&&(player.countCards('h','sha')||player.num('he',{color:'red'}))){
return -2;
}
return -0.5;
@ -1082,7 +1082,7 @@ character.refresh={
"step 1"
var suit=get.suit(result.card);
var target=trigger.target;
var num=target.num('h','shan');
var num=target.countCards('h','shan');
target.chooseToDiscard('请弃置一张'+get.translation(suit)+'牌,否则不能使用闪抵消此杀','he',function(card){
return get.suit(card)==_status.event.suit;
}).set('ai',function(card){

View File

@ -584,7 +584,7 @@ character.shenhua={
if(target.countCards('h')==0) return 0;
if(target.countCards('h')==1) return -0.1;
if(player.hp<=2) return -2;
if(player.num('h','shan')==0) return -1;
if(player.countCards('h','shan')==0) return -1;
return -0.5;
}
},
@ -658,7 +658,7 @@ character.shenhua={
var bs=player.getCards('h',{type:'basic'});
if(bs.length<2) return 0;
if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return;
if(bs.length<=3&&player.num('h','sha')<=1){
if(bs.length<=3&&player.countCards('h','sha')<=1){
for(var i=0;i<bs.length;i++){
if(bs[i].name!='sha'&&ai.get.value(bs[i])<7){
return [1,0,1,-0.5];
@ -1080,8 +1080,8 @@ character.shenhua={
return [0.5,Math.max(2,target.countCards('h'))];
}
if(target.isUnderControl(true,player)){
if((get.tag(card,'respondSha')&&target.num('h','sha'))||
(get.tag(card,'respondShan')&&target.num('h','shan'))){
if((get.tag(card,'respondSha')&&target.countCards('h','sha'))||
(get.tag(card,'respondShan')&&target.countCards('h','shan'))){
if(target.hasSkill('ziliang')) return 0.7;
return [0.5,1];
}
@ -1092,7 +1092,7 @@ character.shenhua={
if(target.countCards('h')==0) return 2;
if(target.hasSkill('ziliang')) return 0.7;
if(get.mode()=='guozhan') return 0.5;
return [0.5,Math.max(target.countCards('h')/4,target.num('h','sha')+target.num('h','shan'))];
return [0.5,Math.max(target.countCards('h')/4,target.countCards('h','sha')+target.countCards('h','shan'))];
}
}
},
@ -1275,7 +1275,7 @@ character.shenhua={
expose:0.2,
result:{
target:function(player,target){
if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1;
if(player.countCards('h','du')&&ai.get.attitude(player,target)<0) return -1;
if(player.countCards('h')<=player.hp) return 0;
var maxnum=0;
var cards2=target.getCards('h');
@ -2402,7 +2402,7 @@ character.shenhua={
var next=trigger.target.chooseToRespond({name:'shan'});
next.autochoose=lib.filter.autoRespondShan;
next.ai=function(card){
if(trigger.target.num('h','shan')>1){
if(trigger.target.countCards('h','shan')>1){
return ai.get.unuseful2(card);
}
return -1;
@ -3068,7 +3068,7 @@ character.shenhua={
ai:{
order:function(name,player){
var cards=player.getCards('h');
if(player.num('h','sha')==0){
if(player.countCards('h','sha')==0){
return 1;
}
for(var i=0;i<cards.length;i++){
@ -3080,7 +3080,7 @@ character.shenhua={
},
result:{
player:function(player){
if(player.num('h','sha')>0) return 0.6;
if(player.countCards('h','sha')>0) return 0.6;
var num=player.countCards('h');
if(num>player.hp) return 0;
if(num==1) return -2;
@ -3311,11 +3311,11 @@ character.shenhua={
return ai.get.attitude(target,current)<0;
});
var be=target.num('e',{color:'black'});
if(target.num('h','shan')&&be){
if(target.countCards('h','shan')&&be){
if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.countCards('he')/2:0];
}
if(target.num('h','shan')&&target.countCards('h')>2){
if(target.countCards('h','shan')&&target.countCards('h')>2){
if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.countCards('h')/4:0];
}
@ -3952,10 +3952,10 @@ character.shenhua={
var hastarget=game.hasPlayer(function(current){
return ai.get.attitude(target,current)<0;
});
if(target.num('h','shan')&&target.num('e',{suit:'spade'})){
if(target.countCards('h','shan')&&target.num('e',{suit:'spade'})){
return [0,hastarget?target.countCards('he')/2:0];
}
if(target.num('h','shan')){
if(target.countCards('h','shan')){
return [1,hastarget?target.countCards('he')/2:0];
}
return [1,target.countCards('h')/4];
@ -4042,14 +4042,14 @@ character.shenhua={
},
check:function(button){
var player=_status.event.player;
if(player.num('h','wuzhong')){
if(player.countCards('h','wuzhong')){
if(player.hp==1&&player.num('tao')){
return button.link=='tao'?1:0;
}
return button.link=='wuzhong'?1:0;
}
if(player.hp<player.maxHp){
if(player.num('h','tao')){
if(player.countCards('h','tao')){
return button.link=='tao'?1:0;
}
}
@ -4098,7 +4098,7 @@ character.shenhua={
prepare:'give',
filter:function(event,player){
if(player.group!='qun') return false;
if(player.num('h','shan')+player.num('h','shandian')==0) return 0;
if(player.countCards('h','shan')+player.countCards('h','shandian')==0) return 0;
return game.hasPlayer(function(target){
return target!=player&&target.hasZhuSkill('huangtian',player);
});

View File

@ -724,7 +724,7 @@ character.sp={
return -ai.get.value(card,_status.event.player,'raw');
});
if(ai.get.attitude(player,event.target)>1&&
player.num('h','shan')>1&&player.countCards('h')>event.target.countCards('h')){
player.countCards('h','shan')>1&&player.countCards('h')>event.target.countCards('h')){
next.set('shan',true);
}
if(ai.get.attitude(player,event.target)>0&&player.needsToDiscard()){
@ -751,7 +751,7 @@ character.sp={
return !target.hasSkill('fuman2')&&target!=player;
},
filter:function(event,player){
return player.num('h','sha');
return player.countCards('h','sha');
},
discard:false,
prepare:'give',
@ -894,7 +894,7 @@ character.sp={
player.addTempSkill('fenxun2','phaseAfter');
},
check:function(card){
if(card.name=='sha'&&_status.event.player.num('h','sha')<=1) return 0;
if(card.name=='sha'&&_status.event.player.countCards('h','sha')<=1) return 0;
return 6-ai.get.value(card);
},
filterCard:true,
@ -1092,7 +1092,7 @@ character.sp={
viewAs:{name:'sha'},
viewAsFilter:function(player){
if(!player.storage.fanghun) return false;
if(!player.num('h','shan')) return false;
if(!player.countCards('h','shan')) return false;
},
prompt:'将一张闪当杀使用或打出',
onuse:function(result,player){
@ -1114,7 +1114,7 @@ character.sp={
respondSha:true,
skillTagFilter:function(player){
if(!player.storage.fanghun) return false;
if(!player.num('h','shan')) return false;
if(!player.countCards('h','shan')) return false;
},
order:function(){
return ai.get.order({name:'sha'})+0.1;
@ -1130,7 +1130,7 @@ character.sp={
prompt:'将一张杀当闪打出',
viewAsFilter:function(player){
if(!player.storage.fanghun) return false;
if(!player.num('h','sha')) return false;
if(!player.countCards('h','sha')) return false;
},
onrespond:function(result,player){
player.storage.fanghun--;
@ -1146,7 +1146,7 @@ character.sp={
respondShan:true,
skillTagFilter:function(player){
if(!player.storage.fanghun) return false;
if(!player.num('h','sha')) return false;
if(!player.countCards('h','sha')) return false;
},
effect:{
target:function(card,player,target,current){
@ -2332,7 +2332,7 @@ character.sp={
juesi:{
enable:'phaseUse',
filter:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
filterTarget:function(card,player,target){
return target!=player&&target.countCards('he')>0;
@ -2503,7 +2503,7 @@ character.sp={
if(trigger.card.name=='sha'){
var target=trigger.targets[0];
if(target==player){
return !player.num('h','shan');
return !player.countCards('h','shan');
}
else{
return target.hp==1||(target.countCards('h')<=2&&target.hp<=2);
@ -3137,9 +3137,9 @@ character.sp={
var save=false;
if(ai.get.attitude(player,trigger.target)>2){
if(trigger.card.name=='sha'){
if(player.num('h','shan')||player.getEquip(2)||
if(player.countCards('h','shan')||player.getEquip(2)||
trigger.target.hp==1||player.hp>trigger.target.hp+1){
if(!trigger.target.num('h','shan')||trigger.target.countCards('h')<player.countCards('h')){
if(!trigger.target.countCards('h','shan')||trigger.target.countCards('h')<player.countCards('h')){
save=true;
}
}
@ -3168,10 +3168,10 @@ character.sp={
var trigger=_status.event.getTrigger();
var player=_status.event.player;
if(trigger.card.name=='sha'){
if(player.num('h','shan')) return '转移';
if(player.countCards('h','shan')) return '转移';
}
else if(trigger.card.name=='juedou'){
if(player.num('h','sha')) return '转移';
if(player.countCards('h','sha')) return '转移';
}
return '失效';
}).set('prompt','将'+get.translation(trigger.card)+'转移给你,或令其失效');
@ -3289,7 +3289,7 @@ character.sp={
}
}
if(!bool) return 0;
if(player.canUse('sha',target)&&(player.num('h','sha'))){
if(player.canUse('sha',target)&&(player.countCards('h','sha'))){
return -2;
}
return -0.5;
@ -3425,7 +3425,7 @@ character.sp={
var target=result.targets[0];
player.logSkill('junwei',result.targets);
event.target=target;
var nshan=target.num('h','shan');
var nshan=target.countCards('h','shan');
if(nshan==0){
event.directfalse=true;
}
@ -3452,7 +3452,7 @@ character.sp={
player.chooseTarget('将闪交给一名角色',true,function(card,player,target){
return target!=_status.event.getParent().target;
}).set('ai',function(target){
return ai.get.attitude(_status.event.player,target)/(target.num('h','shan')+1);
return ai.get.attitude(_status.event.player,target)/(target.countCards('h','shan')+1);
});
}
else{
@ -3963,7 +3963,7 @@ character.sp={
if(e2.name=='tengjia') return true;
if(e2.name=='bagua') return true;
}
return player.num('h','shan')>0;
return player.countCards('h','shan')>0;
},
content:function(){
var target=trigger.player;
@ -4676,7 +4676,7 @@ character.sp={
var target=event.target;
var tosave=trigger.player;
var att=ai.get.attitude(target,tosave);
var hastao=target.num('h','tao');
var hastao=target.countCards('h','tao');
target.chooseToDiscard(4,true,'he').set('ai',function(card){
var hastao=_status.event.hastao;
var att=_status.event.att;
@ -5293,7 +5293,7 @@ character.sp={
trigger:{player:'phaseUseBegin'},
direct:true,
filter:function(event,player){
return player.num('h','sha')==0;
return player.countCards('h','sha')==0;
},
content:function(){
"step 0"
@ -5620,7 +5620,7 @@ character.sp={
if(get.color(event.card)!='black') return false;
if(!event.player) return false;
if(event.player==player) return false;
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
direct:true,
content:function(){
@ -6318,7 +6318,7 @@ character.sp={
else if(trigger.player.hp>1&&player.countCards('h')<3){
nono=true;
}
else if(trigger.player.canUse('sha',player)&&!player.num('h','shan')&&trigger.player.countCards('h')>=3){
else if(trigger.player.canUse('sha',player)&&!player.countCards('h','shan')&&trigger.player.countCards('h')>=3){
nono=true;
}
var next=player.chooseToDiscard(get.prompt('zhendu',trigger.player));
@ -7104,7 +7104,7 @@ character.sp={
player.storage.huxiao++;
},
check:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
mod:{
cardUsable:function(card,player,num){
@ -7987,7 +7987,7 @@ character.sp={
forced:true,
popup:false,
check:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
filter:function(event,player){
return _status.currentPhase==player;

View File

@ -794,7 +794,7 @@ character.standard={
var top=[];
var judges=player.node.judges.childNodes;
var stopped=false;
if(!player.num('h','wuxie')){
if(!player.countCards('h','wuxie')){
for(var i=0;i<judges.length;i++){
var judge=get.judge(judges[i]);
cards.sort(function(a,b){
@ -1016,7 +1016,7 @@ character.standard={
filterCard:{name:'shan'},
viewAs:{name:'sha'},
viewAsFilter:function(player){
if(!player.num('h','shan')) return false;
if(!player.countCards('h','shan')) return false;
},
prompt:'将一张闪当杀使用或打出',
check:function(){return 1},
@ -1028,7 +1028,7 @@ character.standard={
},
respondSha:true,
skillTagFilter:function(player){
if(!player.num('h','shan')) return false;
if(!player.countCards('h','shan')) return false;
},
order:function(){
return ai.get.order({name:'sha'})+0.1;
@ -1045,12 +1045,12 @@ character.standard={
prompt:'将一张杀当闪打出',
check:function(){return 1},
viewAsFilter:function(player){
if(!player.num('h','sha')) return false;
if(!player.countCards('h','sha')) return false;
},
ai:{
respondShan:true,
skillTagFilter:function(player){
if(!player.num('h','sha')) return false;
if(!player.countCards('h','sha')) return false;
},
effect:{
target:function(card,player,target,current){
@ -1318,16 +1318,16 @@ character.standard={
return ai.get.unuseful(card)+9;
},
ai2:function(target){
if(_status.event.player.num('h','shan')){
if(_status.event.player.countCards('h','shan')){
return -ai.get.attitude(_status.event.player,target);
}
if(ai.get.attitude(_status.event.player,target)<5){
return 6-ai.get.attitude(_status.event.player,target);
}
if(_status.event.player.hp==1&&player.num('h','shan')==0){
if(_status.event.player.hp==1&&player.countCards('h','shan')==0){
return 10-ai.get.attitude(_status.event.player,target);
}
if(_status.event.player.hp==2&&player.num('h','shan')==0){
if(_status.event.player.hp==2&&player.countCards('h','shan')==0){
return 8-ai.get.attitude(_status.event.player,target);
}
return -1;
@ -1542,7 +1542,7 @@ character.standard={
var next=trigger.target.chooseToRespond({name:'shan'});
next.autochoose=lib.filter.autoRespondShan;
next.set('ai',function(card){
if(_status.event.player.num('h','shan')>1){
if(_status.event.player.countCards('h','shan')>1){
return ai.get.unuseful2(card);
}
return -1;
@ -1566,7 +1566,7 @@ character.standard={
var next=trigger.turn.chooseToRespond({name:'sha'});
next.autochoose=lib.filter.autoRespondSha;
next.ai=function(card){
if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.num('h','sha')>1){
if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){
return ai.get.unuseful2(card);
}
return -1;

View File

@ -505,7 +505,7 @@ character.swd={
}
if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){
if(ai.get.attitude(player,target)>0&&card.name=='juedou') return;
return [0.5,target.num('h','sha')+target.num('h','shan')];
return [0.5,target.countCards('h','sha')+target.countCards('h','shan')];
}
}
}
@ -827,7 +827,7 @@ character.swd={
effect:{
target:function(card,player,target){
if(get.tag(card,'respondShan')){
var shans=target.num('h','shan');
var shans=target.countCards('h','shan');
var hs=target.countCards('h');
if(shans>1) return [1,1];
if(shans&&hs>2) return [1,1];
@ -877,7 +877,7 @@ character.swd={
effect:{
target:function(card,player,target){
if(get.tag(card,'respondShan')){
var shans=target.num('h','shan');
var shans=target.countCards('h','shan');
var hs=target.countCards('h');
if(shans>1) return [0,1];
if(shans&&hs>2) return [0,1];
@ -1572,8 +1572,8 @@ character.swd={
order:10,
result:{
player:function(player){
if(player.num('h','juedou')) return 1;
if(player.num('h','sha')==0) return 0;
if(player.countCards('h','juedou')) return 1;
if(player.countCards('h','sha')==0) return 0;
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(player.canUse('sha',players[i])&&
@ -1848,9 +1848,9 @@ character.swd={
"step 0"
var save=false;
if(ai.get.attitude(player,trigger.target)>2){
if(player.num('h','shan')||player.getEquip(2)||
if(player.countCards('h','shan')||player.getEquip(2)||
trigger.target.hp==1||player.hp>trigger.target.hp+1){
if(!trigger.target.num('h','shan')||trigger.target.countCards('h')<player.countCards('h')){
if(!trigger.target.countCards('h','shan')||trigger.target.countCards('h')<player.countCards('h')){
save=true;
}
}
@ -2211,7 +2211,7 @@ character.swd={
if(!target.hasFriend()) return;
var hs=target.countCards('h');
if(get.tag(card,'respondShan')){
var shans=target.num('h','shan');
var shans=target.countCards('h','shan');
if(shans>1) return [0,1];
if(shans&&hs>2) return [0,1];
if(shans) return [0,0];
@ -2220,7 +2220,7 @@ character.swd={
return [1.5,0];
}
if(get.tag(card,'respondSha')){
var shas=target.num('h','sha');
var shas=target.countCards('h','sha');
if(shas>1) return [0,1];
if(shas&&hs>2) return [0,1];
if(shas) return [0,0];
@ -2342,7 +2342,7 @@ character.swd={
var next=trigger.target.chooseToRespond({name:'shan'});
next.autochoose=lib.filter.autoRespondShan;
next.ai=function(card){
if(trigger.target.num('h','shan')>1){
if(trigger.target.countCards('h','shan')>1){
return ai.get.unuseful2(card);
}
return -1;
@ -3294,7 +3294,7 @@ character.swd={
if((nme=='juedou')&&(player==trigger.targets[0]||trigger.targets[0].hp==1)) return val;
if(nme=='chenhuodajie') return val;
if(nme=='lebu'&&trigger.targets[0].countCards('h')>trigger.targets[0].hp) return val;
if(nme=='sha'&&trigger.targets[0].hp==1&&!trigger.targets[0].num('h','shan')) return val;
if(nme=='sha'&&trigger.targets[0].hp==1&&!trigger.targets[0].countCards('h','shan')) return val;
if(nme=='jiedao'&&trigger.targets[0]==player) return val;
if(nme=='yihuajiemu'&&trigger.targets[0]==player) return val;
if(nme=='shuiyanqijun'&&trigger.targets.contains(player)) return val;
@ -3332,7 +3332,7 @@ character.swd={
priority:15,
filter:function(event,player){
return event.card.name=='sha'&&event.player!=player&&
player.num('h','sha')>0&&event.targets.contains(player)==false;
player.countCards('h','sha')>0&&event.targets.contains(player)==false;
},
direct:true,
content:function(){
@ -7404,7 +7404,7 @@ character.swd={
usable:1,
alter:true,
filter:function(event,player){
return player.num('h','sha')>1;
return player.countCards('h','sha')>1;
},
filterCard:{name:'sha'},
selectCard:2,
@ -8589,7 +8589,7 @@ character.swd={
direct:true,
content:function(){
"step 0"
var dis=trigger.target.num('h','shan')||trigger.target.num('e','bagua')||trigger.target.countCards('h')>2;
var dis=trigger.target.countCards('h','shan')||trigger.target.num('e','bagua')||trigger.target.countCards('h')>2;
var next=player.chooseToDiscard(get.prompt('shoulie',trigger.target));
next.ai=function(card){
if(dis) return 7-ai.get.value(card);

View File

@ -265,7 +265,7 @@ character.xianjian={
viewAs:{name:'wanjian'},
filterCard:{name:'sha'},
filter:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
alter:true,
usable:1,
@ -706,7 +706,7 @@ character.xianjian={
filter:function(event,player){
if(event.responded) return false;
if(!event.filterCard({name:'shan'})) return false;
return player.num('h','shan')>0;
return player.countCards('h','shan')>0;
},
direct:true,
check:function(event,player){
@ -750,7 +750,7 @@ character.xianjian={
popup:false,
silent:true,
filter:function(event,player){
return player.num('h','shan')==0;
return player.countCards('h','shan')==0;
},
content:function(){
player.removeSkill('zhangmu_ai');
@ -1006,7 +1006,7 @@ character.xianjian={
diewu:{
enable:'phaseUse',
filter:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
filterCard:{name:'sha'},
filterTarget:function(card,player,target){
@ -1247,7 +1247,7 @@ character.xianjian={
effect:{
player:function(card,player){
if(_status.currentPhase!=player) return;
if(card.name=='sha'&&player.num('h','sha')<2&&!player.needsToDiscard()){
if(card.name=='sha'&&player.countCards('h','sha')<2&&!player.needsToDiscard()){
var num=0;
var player=_status.event.player;
var players=game.filterPlayer();
@ -1278,7 +1278,7 @@ character.xianjian={
ctianfu:{
enable:'phaseUse',
filter:function(event,player){
return player.num('h','shan')>0;
return player.countCards('h','shan')>0;
},
usable:1,
filterCard:{name:'shan'},

View File

@ -229,7 +229,7 @@ character.yijiang={
var goon=true;
if(ai.get.attitude(player,trigger.player)>=-0.8) goon=false;
else if(trigger.player.countCards('h')<=3) goon=false;
else if(player.num('h','shan')==0) goon=false;
else if(player.countCards('h','shan')==0) goon=false;
var es=player.getCards('e');
var color=[];
for(var i=0;i<es.length;i++){
@ -1136,7 +1136,7 @@ character.yijiang={
if(target.countCards('h')==0) return 0;
if(target.countCards('h')==1) return -0.1;
if(player.hp<=2) return -2;
if(player.num('h','shan')==0) return -1;
if(player.countCards('h','shan')==0) return -1;
return -0.5;
}
}
@ -1682,17 +1682,17 @@ character.yijiang={
},
enable:['chooseToUse','chooseToRespond'],
filter:function(event,player){
return player.num('h','jiu')>0;
return player.countCards('h','jiu')>0;
},
filterCard:{name:'jiu'},
viewAs:{name:'sha'},
viewAsFilter:function(player){
if(!player.num('h','jiu')) return false;
if(!player.countCards('h','jiu')) return false;
},
check:function(){return 1},
ai:{
skillTagFilter:function(player){
if(!player.num('h','jiu')) return false;
if(!player.countCards('h','jiu')) return false;
},
respondSha:true,
order:4,
@ -1725,7 +1725,7 @@ character.yijiang={
ai:{
order:function(name,player){
var cards=player.getCards('h');
if(player.num('h','sha')==0){
if(player.countCards('h','sha')==0){
return 1;
}
for(var i=0;i<cards.length;i++){
@ -1737,7 +1737,7 @@ character.yijiang={
},
result:{
player:function(player){
if(player.num('h','sha')>0) return 0;
if(player.countCards('h','sha')>0) return 0;
var num=player.countCards('h');
if(num>player.hp) return 0;
if(num==1) return -2;
@ -1779,7 +1779,7 @@ character.yijiang={
return card.name=='sha'&&!card.nature;
},
filter:function(event,player){
return player.num('h','sha')>0
return player.countCards('h','sha')>0
},
viewAs:{name:'sha',nature:'fire'},
mod:{
@ -1821,7 +1821,7 @@ character.yijiang={
direct:true,
audio:2,
filter:function(event,player){
return player.num('h','sha')>0&&!player.storage.chunlao.length;
return player.countCards('h','sha')>0&&!player.storage.chunlao.length;
},
init:function(player){
player.storage.chunlao=[];
@ -1831,7 +1831,7 @@ character.yijiang={
},
content:function(){
'step 0'
player.chooseCard([1,player.num('h','sha')],get.prompt('chunlao'),{name:'sha'}).set('ai',function(){
player.chooseCard([1,player.countCards('h','sha')],get.prompt('chunlao'),{name:'sha'}).set('ai',function(){
return 1;
});
'step 1'
@ -1980,7 +1980,7 @@ character.yijiang={
var trigger=_status.event.getTrigger();
if(att>0&&eff>=0) return 1;
if(att>=0&&eff>0) return 1;
if(att>0&&(trigger.player.hp>=3||trigger.player.num('e','bagua')||trigger.player.num('h','shan'))){
if(att>0&&(trigger.player.hp>=3||trigger.player.num('e','bagua')||trigger.player.countCards('h','shan'))){
if(name=='lebu'&&nh>trigger.player.hp) return 1;
if(name=='bingliang'&&nh<trigger.player.hp) return 1;
}
@ -2088,7 +2088,7 @@ character.yijiang={
}
if(i==players.length) return false;
var nh=event.player.countCards('h');
var nsha=event.player.num('h','sha');
var nsha=event.player.countCards('h','sha');
if(nh<2) return false;
switch(nh){
case 2:
@ -2159,7 +2159,7 @@ character.yijiang={
return target!=_status.event.getTrigger().target;
}).set('ai',function(target){
var att=ai.get.attitude(_status.event.player,target);
if(target.num('h','shan')&&target.countCards('h')>=2){
if(target.countCards('h','shan')&&target.countCards('h')>=2){
att/=1.5;
}
return att;
@ -2281,12 +2281,12 @@ character.yijiang={
!trigger.player.num('e','zhuge')){
var nh=trigger.player.countCards('h');
if(player==trigger.player){
go=(player.num('h','sha')>0);
go=(player.countCards('h','sha')>0);
}
else if(nh>=4){
go=true;
}
else if(player.num('h','sha')){
else if(player.countCards('h','sha')){
if(nh==3){
go=Math.random()<0.8;
}
@ -2332,7 +2332,7 @@ character.yijiang={
check:function(event,player){
var nh=player.countCards('h')-player.num('h',{type:'equip'});
if(nh<=1) return true;
if(player.num('h','tao')) return false;
if(player.countCards('h','tao')) return false;
if(nh<=2) return Math.random()<0.7;
if(nh<=3) return Math.random()<0.4;
return false;
@ -2723,13 +2723,13 @@ character.yijiang={
filterCard:{name:'shan'},
viewAs:{name:'sha'},
viewAsFilter:function(player){
if(!player.num('h','shan')) return false;
if(!player.countCards('h','shan')) return false;
if(player.hp!=1) return false;
},
check:function(){return 1},
ai:{
skillTagFilter:function(player){
if(!player.num('h','shan')) return false;
if(!player.countCards('h','shan')) return false;
if(player.hp!=1) return false;
},
respondSha:true,
@ -2919,8 +2919,8 @@ character.yijiang={
result:{
target:function(player,target){
if(player.countCards('h')>=3||target.countCards('h')>=3) return 0;
if(player.num('h','tao')) return 0;
if(target.num('h','sha')>1) return 0;
if(player.countCards('h','tao')) return 0;
if(target.countCards('h','sha')>1) return 0;
return -1.5;
}
}
@ -3002,7 +3002,7 @@ character.yijiang={
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
var nh=players[i].countCards('h');
if(players[i].group=='shu'&&ai.get.attitude(players[i],player)>1&&(nh>=4||(nh>=3&&players[i].num('h','sha')))){
if(players[i].group=='shu'&&ai.get.attitude(players[i],player)>1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){
yep=true;break;
}
}
@ -3073,7 +3073,7 @@ character.yijiang={
var player=_status.event.player,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
var nh=players[i].countCards('h');
if(players[i].group=='shu'&&ai.get.attitude(players[i],player)>1&&(nh>=4||(nh>=3&&players[i].num('h','sha')))){
if(players[i].group=='shu'&&ai.get.attitude(players[i],player)>1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){
return 5-ai.get.value(card);
}
}
@ -3204,7 +3204,7 @@ character.yijiang={
player.chooseCard(get.prompt('huomo'),'he',function(card){
return get.type(card)!='basic'&&get.color(card)=='black';
}).set('ai',function(card){
if(!_status.event.player.num('h','shan')){
if(!_status.event.player.countCards('h','shan')){
return 8-ai.get.value(card);
}
return 6-ai.get.value(card);
@ -3545,8 +3545,8 @@ character.yijiang={
order:1,
result:{
target:function(player,target){
if(player.countCards('h')==1&&player.num('h','du')) return -1;
if(player.hp<=2&&player.num('h','shan')) return 0;
if(player.countCards('h')==1&&player.countCards('h','du')) return -1;
if(player.hp<=2&&player.countCards('h','shan')) return 0;
if(target.countCards('h')+player.countCards('h')>target.hp+2) return 0;
if(ai.get.attitude(player,target)>3) return 1;
return 0;
@ -3788,7 +3788,7 @@ character.yijiang={
audio:2,
enable:'phaseUse',
filter:function(event,player){
return player.num('h','sha')>0;
return player.countCards('h','sha')>0;
},
filterCard:{name:'sha'},
prepare:function(cards,player){
@ -3842,7 +3842,7 @@ character.yijiang={
return player.countCards('he')>0;
},
check:function(event,player){
return player.num('h','sha')<=player.countCards('h')/3;
return player.countCards('h','sha')<=player.countCards('h')/3;
},
content:function(){
"step 0"
@ -5239,7 +5239,7 @@ character.yijiang={
return card.name=='sha'||get.type(card)=='equip';
},
filter:function(event,player){
return player.num('h','sha')>0||player.num('he',{type:'equip'})>0;
return player.countCards('h','sha')>0||player.num('he',{type:'equip'})>0;
},
check:function(card){return 8-ai.get.value(card)},
selectTarget:2,
@ -5897,9 +5897,9 @@ character.yijiang={
result:{
player:function(player){
if(_status.event.parent.name=='phaseUse'){
if(player.num('h','jiu')>0) return 0;
if(player.num('e','zhuge')&&player.num('h','sha')>1) return 0;
if(!player.num('h','sha')) return 0;
if(player.countCards('h','jiu')>0) return 0;
if(player.num('e','zhuge')&&player.countCards('h','sha')>1) return 0;
if(!player.countCards('h','sha')) return 0;
var targets=[];
var target;
var players=game.filterPlayer();
@ -6305,10 +6305,10 @@ character.yijiang={
"step 0"
player.chooseControl('jiangchi_less','jiangchi_more','cancel2',function(){
var player=_status.event.player;
if(player.countCards('h')>3&&player.num('h','sha')>1){
if(player.countCards('h')>3&&player.countCards('h','sha')>1){
return 'jiangchi_less';
}
if(player.num('h','sha')>2){
if(player.countCards('h','sha')>2){
return 'jiangchi_less';
}
if(player.hp-player.countCards('h')>1){

View File

@ -203,7 +203,7 @@ character.yxs={
if(n1-n2==1){
num=1;
}
if(player.num('h','du')){
if(player.countCards('h','du')){
if(n1==n2) num=0.5;
else num=0.1;
}
@ -1551,7 +1551,7 @@ character.yxs={
trigger:{global:'dying'},
priority:11,
filter:function(event,player){
return event.player.hp<=0&&(player.num('h','jiu')>0||player.num('h',{color:'black'})>=2)&&player!=event.player;
return event.player.hp<=0&&(player.countCards('h','jiu')>0||player.num('h',{color:'black'})>=2)&&player!=event.player;
},
check:function(event,player){
return ai.get.attitude(player,event.player)<0;
@ -1736,7 +1736,7 @@ character.yxs={
result:{
target:function(player,target){
if(player==target){
if(player.hp<=2&&!player.num('h','shan')){
if(player.hp<=2&&!player.countCards('h','shan')){
return 2;
}
return 0;
@ -2227,7 +2227,7 @@ character.yxs={
var next=trigger.target.chooseToRespond({name:'shan'});
next.autochoose=lib.filter.autoRespondShan;
next.ai=function(card){
if(trigger.target.num('h','shan')>1){
if(trigger.target.countCards('h','shan')>1){
return ai.get.unuseful2(card);
}
return -1;
@ -2250,7 +2250,7 @@ character.yxs={
var next=trigger.turn.chooseToRespond({name:'sha'});
next.autochoose=lib.filter.autoRespondSha;
next.ai=function(card){
if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.num('h','sha')>1){
if(ai.get.attitude(trigger.turn,player)<0&&trigger.turn.countCards('h','sha')>1){
return ai.get.unuseful2(card);
}
return -1;
@ -2282,7 +2282,7 @@ character.yxs={
priority:15,
filter:function(event,player){
return event.card.name=='sha'&&event.player!=player&&
player.num('h','sha')>0&&event.targets.contains(player)==false;
player.countCards('h','sha')>0&&event.targets.contains(player)==false;
},
direct:true,
content:function(){

View File

@ -15680,7 +15680,7 @@
return false;
},
hasWuxie:function(){
if(this.num('h','wuxie')) return true;
if(this.countCards('h','wuxie')) return true;
var skills=this.get('s',true).concat(lib.skill.global);
game.expandSkills(skills);
for(var i=0;i<skills.length;i++){
@ -15700,15 +15700,15 @@
return false;
},
hasSha:function(respond){
if(this.num('h','sha')) return true;
if(this.num('h','hufu')) return true;
// if(this.num('h','yuchanqian')) return true;
if(this.countCards('h','sha')) return true;
if(this.countCards('h','hufu')) return true;
// if(this.countCards('h','yuchanqian')) return true;
if(this.hasSkillTag('respondSha',true,respond?'respond':'use',true)) return true;
return false;
},
hasShan:function(){
if(this.num('h','shan')) return true;
if(this.num('h','hufu')) return true;
if(this.countCards('h','shan')) return true;
if(this.countCards('h','hufu')) return true;
if(this.hasSkillTag('respondShan',true,null,true)) return true;
return false;
},

View File

@ -1586,7 +1586,7 @@ mode.boss={
effect:{
target:function(card,player,target){
if(get.tag(card,'respondShan')){
var shans=target.num('h','shan');
var shans=target.countCards('h','shan');
var hs=target.countCards('h');
if(shans>1) return [1,1];
if(shans&&hs>2) return [1,1];
@ -1636,7 +1636,7 @@ mode.boss={
effect:{
target:function(card,player,target){
if(get.tag(card,'respondShan')){
var shans=target.num('h','shan');
var shans=target.countCards('h','shan');
var hs=target.countCards('h');
if(shans>1) return [0,1];
if(shans&&hs>2) return [0,1];
@ -2528,11 +2528,11 @@ mode.boss={
}
}
var be=target.num('e',{color:'black'});
if(target.num('h','shan')&&be){
if(target.countCards('h','shan')&&be){
if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.countCards('he')/2:0];
}
if(target.num('h','shan')&&target.countCards('h')>2){
if(target.countCards('h','shan')&&target.countCards('h')>2){
if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.countCards('h')/4:0];
}
@ -2704,7 +2704,7 @@ mode.boss={
order:1,
result:{
player:function(player){
if(player.num('h','shan')) return 1;
if(player.countCards('h','shan')) return 1;
var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].canUse('sha',player)&&players[i].countCards('h')>1){
@ -3473,7 +3473,7 @@ mode.boss={
trigger:{player:'damageAfter'},
direct:true,
filter:function(event,player){
return player.num('h','tao')>0;
return player.countCards('h','tao')>0;
},
content:function(){
player.chooseToUse({name:'tao'},'神躯:是否使用一张桃?').logSkill='shenqu';

View File

@ -4751,7 +4751,7 @@ mode.chess={
sanjiansheji:{
enable:'phaseUse',
filter:function(event,player){
return player.num('h','sha')>1&&lib.filter.filterCard({name:'sha'},player);
return player.countCards('h','sha')>1&&lib.filter.filterCard({name:'sha'},player);
},
filterCard:{name:'sha'},
selectCard:2,
@ -4791,7 +4791,7 @@ mode.chess={
effect:{
player:function(card,player){
if(_status.currentPhase!=player) return;
if(card.name=='sha'&&player.num('h','sha')<2&&player.countCards('h')<=player.hp){
if(card.name=='sha'&&player.countCards('h','sha')<2&&player.countCards('h')<=player.hp){
var num=0;
var player=_status.event.player;
for(var i=0;i<game.players.length;i++){
@ -5019,9 +5019,9 @@ mode.chess={
return 1;
}
var nh=player.countCards('h');
if(!player.num('h','sha')&&
!player.num('h','shunshou')&&
!player.num('h','bingliang')){
if(!player.countCards('h','sha')&&
!player.countCards('h','shunshou')&&
!player.countCards('h','bingliang')){
if(nh<=Math.min(3,player.hp)) return Math.random()-0.3;
else if(nh<=Math.min(2,player.hp)) return Math.random()-0.4;
return Math.random()-0.5;

View File

@ -299,7 +299,7 @@ mode.guozhan={
player.chooseCardButton(get.prompt('huangjintianbingfu'),zhu.storage.huangjintianbingfu).set('ai',function(){
if(_status.event.goon) return 1;
return 0;
}).set('goon',player.num('h','sha')==0);
}).set('goon',player.countCards('h','sha')==0);
"step 1"
if(result.bool){
var card=result.links[0];
@ -364,7 +364,7 @@ mode.guozhan={
},
result:{
player:function(player){
if(player.num('h','sha')) return 0;
if(player.countCards('h','sha')) return 0;
return 1;
}
}
@ -1025,7 +1025,7 @@ mode.guozhan={
var next=trigger.target.chooseToRespond({name:'shan'});
next.autochoose=lib.filter.autoRespondShan;
next.set('ai',function(card){
if(_status.event.player.num('h','shan')>1){
if(_status.event.player.countCards('h','shan')>1){
return ai.get.unuseful2(card);
}
return -1;

View File

@ -8413,7 +8413,7 @@ mode.stone={
ai:{
order:function(skill,player){
if(!player.getEquip(1)&&player.countCards('e')<2){
if(player.num('h','sha')&&player.getActCount()+3<=player.actcount){
if(player.countCards('h','sha')&&player.getActCount()+3<=player.actcount){
return 4;
}
return 0.1;