From 120e2dc6f3c8b9d2aed9498674404a42e90a5a45 Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 27 Mar 2017 17:37:24 +0800 Subject: [PATCH] xx --- card/gujian.js | 6 ++--- card/guozhan.js | 4 +-- card/swd.js | 8 +++--- character/diy.js | 12 ++++----- character/extra.js | 12 ++++----- character/gujian.js | 8 +++--- character/hearth.js | 26 +++++++++--------- character/ow.js | 22 +++++++-------- character/refresh.js | 4 +-- character/shenhua.js | 14 +++++----- character/sp.js | 20 +++++++------- character/standard.js | 10 +++---- character/swd.js | 62 +++++++++++++++++++++---------------------- character/xianjian.js | 8 +++--- character/yijiang.js | 10 +++---- character/yxs.js | 6 ++--- mode/chess.js | 4 +-- mode/guozhan.js | 4 +-- 18 files changed, 120 insertions(+), 120 deletions(-) diff --git a/card/gujian.js b/card/gujian.js index 6531f35e2..4a99f6fed 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -156,7 +156,7 @@ card.gujian={ result:{ target:function(player,target){ if(target==player){ - if(target.num('he',{suit:'heart'})){ + if(target.countCards('he',{suit:'heart'})){ if(target.isDamaged()) return 1.5; } else{ @@ -1021,13 +1021,13 @@ card.gujian={ position:'he', viewAs:{name:'tao'}, viewAsFilter:function(player){ - return player.num('he',{suit:'heart'})>0; + return player.countCards('he',{suit:'heart'})>0; }, prompt:'将一张红桃牌当桃使用', check:function(card){return 10-ai.get.value(card)}, ai:{ skillTagFilter:function(player){ - return player.num('he',{suit:'heart'})>0; + return player.countCards('he',{suit:'heart'})>0; }, save:true, } diff --git a/card/guozhan.js b/card/guozhan.js index 05b2019f0..737edcea2 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -245,7 +245,7 @@ card.guozhan={ content:function(){ 'step 0' var choiceList=['明置一张武将牌,然后摸一张牌','失去1点体力']; - if(target.num('he',{type:'equip'})){ + if(target.countCards('he',{type:'equip'})){ choiceList.push('弃置一张装备牌'); } target.chooseControl(lib.card.chiling.chooseai).set('prompt','敕令').set('choiceList',choiceList); @@ -915,7 +915,7 @@ card.guozhan={ var target=event.targets.shift(); event.current=target; var choiceList=['明置一张武将牌,然后摸一张牌','失去1点体力']; - if(target.num('he',{type:'equip'})){ + if(target.countCards('he',{type:'equip'})){ choiceList.push('弃置一张装备牌'); } target.chooseControl(lib.card.chiling.chooseai).set('prompt','敕令').set('choiceList',choiceList); diff --git a/card/swd.js b/card/swd.js index 614d8aa52..d5f6e76ca 100644 --- a/card/swd.js +++ b/card/swd.js @@ -2539,7 +2539,7 @@ card.swd={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{color:'black'})>0&&player.hujia==0 + return player.countCards('he',{color:'black'})>0&&player.hujia==0 }, content:function(){ 'step 0' @@ -2570,7 +2570,7 @@ card.swd={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{color:'red'})>0&&player.hp0&&player.hp0; + return player.countCards('he',{color:'red'})>0; }, content:function(){ "step 0" @@ -4461,7 +4461,7 @@ card.swd={ return get.subtype(card)=='equip1'; }, filter:function(event,player){ - return player.num('he',{subtype:'equip1'})>0; + return player.countCards('he',{subtype:'equip1'})>0; }, discard:false, prepare:'give', diff --git a/character/diy.js b/character/diy.js index 7a612c9c1..e0f3fe65c 100644 --- a/character/diy.js +++ b/character/diy.js @@ -140,7 +140,7 @@ character.diy={ juntun:{ enable:'phaseUse', filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, position:'he', filterCard:{type:'equip'}, @@ -393,7 +393,7 @@ character.diy={ trigger:{global:'shaBefore'}, direct:true, filter:function(event,player){ - return get.distance(player,event.target)<=1&&player.num('he',{type:'equip'}); + return get.distance(player,event.target)<=1&&player.countCards('he',{type:'equip'}); }, content:function(){ 'step 0' @@ -850,9 +850,9 @@ character.diy={ }, position:'he', filter:function(event,player){ - return player.num('he',function(card){ + return player.hasCard(function(card){ return get.type(card)!='basic'; - })>0; + },'he'); }, viewAs:{name:'shuiyanqijun'}, prompt:'将一张非基本牌当水淹七军使用', @@ -900,7 +900,7 @@ character.diy={ return ai.get.attitude(player,event.player)<0; }, filter:function(event,player){ - return event.source&&event.source!=player&&event.source.num('he',{color:'red'})>0; + return event.source&&event.source!=player&&event.source.countCards('he',{color:'red'})>0; }, content:function(){ trigger.source.discard(trigger.source.getCards('he',{color:'red'})); @@ -911,7 +911,7 @@ character.diy={ threaten:0.8, target:function(card,player,target){ if(get.tag(card,'damage')&&ai.get.attitude(target,player)<0){ - return [1,0,0,-player.num('he',{color:'red'})]; + return [1,0,0,-player.countCards('he',{color:'red'})]; } } } diff --git a/character/extra.js b/character/extra.js index b4902427d..43231cab0 100644 --- a/character/extra.js +++ b/character/extra.js @@ -895,15 +895,15 @@ character.extra={ skillTagFilter:function(player,tag){ switch(tag){ case 'respondSha':{ - if(player.num('he',{suit:'diamond'})=player.hp; + return player.countCards('he',{suit:'heart'})>=player.hp; }, filterCard:function(card){ return get.suit(card)=='heart'; @@ -963,7 +963,7 @@ character.extra={ }, viewAs:{name:'sha',nature:'fire'}, filter:function(event,player){ - return player.num('he',{suit:'diamond'})>=player.hp; + return player.countCards('he',{suit:'diamond'})>=player.hp; }, filterCard:function(card){ return get.suit(card)=='diamond'; @@ -985,7 +985,7 @@ character.extra={ }, viewAs:{name:'wuxie'}, viewAsFilter:function(player){ - return player.num('he',{suit:'spade'})>=player.hp; + return player.countCards('he',{suit:'spade'})>=player.hp; }, filterCard:function(card){ return get.suit(card)=='spade'; diff --git a/character/gujian.js b/character/gujian.js index 55e5db7d3..e5eb40ba7 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -573,7 +573,7 @@ character.gujian={ globalSilent:true, trigger:{global:'phaseEnd'}, filter:function(event,player){ - return event.player!=player&&!event.player.tempSkills.meiying3&&event.player.isAlive()&&player.num('he',{color:'red'})>0; + return event.player!=player&&!event.player.tempSkills.meiying3&&event.player.isAlive()&&player.countCards('he',{color:'red'})>0; }, direct:true, content:function(){ @@ -992,7 +992,7 @@ character.gujian={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.maxHp>player.hp&&player.num('he',{color:'red'})>0; + return player.maxHp>player.hp&&player.countCards('he',{color:'red'})>0; }, alter:true, content:function(){ @@ -1128,7 +1128,7 @@ character.gujian={ yanjia_old:{ enable:'chooseToUse', filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, filterCard:function(card){ return get.type(card)=='equip'; @@ -1138,7 +1138,7 @@ character.gujian={ prompt:'将一张装备牌当无中生有使用', check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } if(player.countCards('h')0) return 10-ai.get.value(card); return 7-ai.get.value(card); @@ -638,7 +638,7 @@ character.hearth={ yuelu:{ enable:'chooseToUse', filter:function(event,player){ - return event.type=='dying'&&player.num('he',{color:'black'}); + return event.type=='dying'&&player.countCards('he',{color:'black'}); }, alter:true, filterCard:{color:'black'}, @@ -657,7 +657,7 @@ character.hearth={ ai:{ order:10, skillTagFilter:function(player){ - if(player.num('he',{color:'black'})==0) return false; + if(player.countCards('he',{color:'black'})==0) return false; }, save:true, result:{ @@ -753,7 +753,7 @@ character.hearth={ filterCard:{color:'black'}, position:'he', viewAsFilter:function(player){ - if(!player.num('he',{color:'black'})) return false; + if(!player.countCards('he',{color:'black'})) return false; }, check:function(card){ return 6-ai.get.value(card); @@ -868,7 +868,7 @@ character.hearth={ }, viewAs:{name:'wuzhong'}, viewAsFilter:function(player){ - if(!player.num('he',{suit:'spade'})) return false; + if(!player.countCards('he',{suit:'spade'})) return false; }, prompt:'将一张黑桃手牌当作无中生有使用', check:function(card){return 7-ai.get.value(card)}, @@ -1114,7 +1114,7 @@ character.hearth={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return !player.getStat('damage')&&player.num('he',{color:'black'})>0; + return !player.getStat('damage')&&player.countCards('he',{color:'black'})>0; }, content:function(){ 'step 0' @@ -1544,7 +1544,7 @@ character.hearth={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('he',{color:'red'})>0 + return player.countCards('he',{color:'red'})>0 }, init:function(player){ player.storage.nuyan=[]; @@ -4065,7 +4065,7 @@ character.hearth={ enable:['chooseToRespond'], filterCard:{type:'equip'}, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, viewAs:{name:'shan'}, position:'he', @@ -4074,7 +4074,7 @@ character.hearth={ ai:{ respondShan:true, skillTagFilter:function(player){ - if(!player.num('he',{type:'equip'})) return false; + if(!player.countCards('he',{type:'equip'})) return false; } } }, @@ -4099,7 +4099,7 @@ character.hearth={ filterCard:{subtype:'equip2'}, position:'he', filter:function(event,player){ - return player.num('he',{subtype:'equip2'})>0; + return player.countCards('he',{subtype:'equip2'})>0; }, check:function(card){ return 7-ai.get.value(card); @@ -4153,7 +4153,7 @@ character.hearth={ enable:'phaseUse', filterCard:{color:'red'}, filter:function(event,player){ - return player.num('he',{color:'red'})>0; + return player.countCards('he',{color:'red'})>0; }, position:'he', usable:1, @@ -4191,7 +4191,7 @@ character.hearth={ enable:'phaseUse', filterCard:{color:'black'}, filter:function(event,player){ - return player.num('he',{color:'black'})>0; + return player.countCards('he',{color:'black'})>0; }, position:'he', usable:1, @@ -4222,7 +4222,7 @@ character.hearth={ animationColor:'thunder', derivation:'xinci', filter:function(event,player){ - return !player.storage.anying&&player.num('he',{color:'black'})>1; + return !player.storage.anying&&player.countCards('he',{color:'black'})>1; }, selectCard:2, filterCard:{color:'black'}, diff --git a/character/ow.js b/character/ow.js index 6be3763d2..cf8f526a5 100644 --- a/character/ow.js +++ b/character/ow.js @@ -667,7 +667,7 @@ character.ow={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, content:function(){ "step 0" @@ -948,7 +948,7 @@ character.ow={ filterCard:{suit:'spade'}, position:'he', filter:function(event,player){ - return player.num('he',{suit:'spade'})>0; + return player.countCards('he',{suit:'spade'})>0; }, check:function(card){ return 7-ai.get.value(card); @@ -1199,7 +1199,7 @@ character.ow={ filterCard:{suit:'diamond'}, position:'he', filter:function(event,player){ - return player.num('he',{suit:'diamond'})>0; + return player.countCards('he',{suit:'diamond'})>0; }, filterTarget:function(card,player,target){ return target!=player&&get.distance(player,target,'attack')<=1; @@ -1264,13 +1264,13 @@ character.ow={ animationColor:'water', line:'thunder', filter:function(event,player){ - return !player.storage.baoxue&&player.num('he',{color:'black'})>0; + return !player.storage.baoxue&&player.countCards('he',{color:'black'})>0; }, filterTarget:function(card,player,target){ return target!=player; }, selectTarget:function(){ - return [1,_status.event.player.num('he',{color:'black'})]; + return [1,_status.event.player.countCards('he',{color:'black'})]; }, alter:true, content:function(){ @@ -1300,7 +1300,7 @@ character.ow={ var num=game.countPlayer(function(current){ return ai.get.attitude(player,current)<0; }); - var nh=player.num('he',{color:'black'}); + var nh=player.countCards('he',{color:'black'}); if(nh==1&&num>1) return 0; if(nh>num) return 1; return 11; @@ -2217,13 +2217,13 @@ character.ow={ position:'he', viewAs:{name:'sha'}, viewAsFilter:function(player){ - if(!player.num('he',{color:'black'})) return false; + if(!player.countCards('he',{color:'black'})) return false; }, prompt:'将一张黑色牌当杀使用或打出', check:function(card){return 4-ai.get.value(card)}, ai:{ skillTagFilter:function(player){ - if(!player.num('he',{color:'black'})) return false; + if(!player.countCards('he',{color:'black'})) return false; }, respondSha:true, }, @@ -2245,7 +2245,7 @@ character.ow={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{color:'red'})>0; + return player.countCards('he',{color:'red'})>0; }, content:function(){ "step 0" @@ -2716,7 +2716,7 @@ character.ow={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{color:'black'})>0&&!player.hasSkill('yihun2'); + return player.countCards('he',{color:'black'})>0&&!player.hasSkill('yihun2'); }, content:function(){ 'step 0' @@ -2789,7 +2789,7 @@ character.ow={ }, filter:function(event,player){ if(player.storage.huoyu) return false; - if(player.num('he',{color:'red'})<2) return false; + if(player.countCards('he',{color:'red'})<2) return false; return true; }, filterTarget:function(card,player,target){ diff --git a/character/refresh.js b/character/refresh.js index 403073c3f..9614d5f5d 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -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.countCards('h','sha')||player.num('he',{color:'red'}))){ + if(player.canUse('sha',target)&&(player.countCards('h','sha')||player.countCards('he',{color:'red'}))){ return -2; } return -0.5; @@ -1290,7 +1290,7 @@ character.refresh={ usable:1, discard:false, filter:function(event,player){ - return player.num('he',{suit:'diamond'})>0; + return player.countCards('he',{suit:'diamond'})>0; }, prepare:'throw', position:'he', diff --git a/character/shenhua.js b/character/shenhua.js index 7f363c4a5..a30aab826 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -1306,7 +1306,7 @@ character.shenhua={ }, check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } return 6-ai.get.value(card); @@ -2025,7 +2025,7 @@ character.shenhua={ return get.color(card)=='black'; }, filter:function(event,player){ - return player.num('he',{type:['basic','equip'],color:'black'}) + return player.countCards('he',{type:['basic','equip'],color:'black'}) }, position:'he', viewAs:{name:'bingliang'}, @@ -2991,7 +2991,7 @@ character.shenhua={ return !player.hasSkill('xinqiangxi3'); } else if(player.hasSkill('xinqiangxi3')){ - return !player.hasSkill('xinqiangxi2')&&player.num('he',{type:'equip'})>0; + return !player.hasSkill('xinqiangxi2')&&player.countCards('he',{type:'equip'})>0; } else{ return true; @@ -3032,7 +3032,7 @@ character.shenhua={ order:8.5, result:{ target:function(player,target){ - if(player.hasSkill('xinqiangxi2')||!player.num('he',{type:'equip'})){ + if(player.hasSkill('xinqiangxi2')||!player.countCards('he',{type:'equip'})){ if(player.hp<2) return 0; if(target.hp>=player.hp) return 0; } @@ -3369,7 +3369,7 @@ character.shenhua={ trigger:{player:'phaseUseBefore'}, direct:true, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, content:function(){ "step 0" @@ -3570,7 +3570,7 @@ character.shenhua={ trigger:{player:'damageBefore'}, direct:true, filter:function(event,player){ - return player.num('he',{suit:'heart'})>0&&event.num>0&&!player.hasSkill('xintianxiang3'); + return player.countCards('he',{suit:'heart'})>0&&event.num>0&&!player.hasSkill('xintianxiang3'); }, content:function(){ "step 0" @@ -3968,7 +3968,7 @@ character.shenhua={ audio:2, trigger:{global:'judge'}, filter:function(event,player){ - return player.num('he',{color:'black'})>0; + return player.countCards('he',{color:'black'})>0; }, direct:true, content:function(){ diff --git a/character/sp.js b/character/sp.js index f457045a6..ff8dce4ca 100644 --- a/character/sp.js +++ b/character/sp.js @@ -210,7 +210,7 @@ character.sp={ zqingcheng:{ enable:'phaseUse', filter:function(event,player){ - return player.num('he',{type:'equip'}); + return player.countCards('he',{type:'equip'}); }, filterCard:{type:'equip'}, position:'he', @@ -2974,11 +2974,11 @@ character.sp={ trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, content:function(){ 'step 0' - player.chooseToDiscard(get.prompt('jiqiao'),[1,player.num('he',{type:'equip'})],'he',function(card){ + player.chooseToDiscard(get.prompt('jiqiao'),[1,player.countCards('he',{type:'equip'})],'he',function(card){ return get.type(card)=='equip'; }).set('ai',function(card){ if(card.name=='bagua') return 10; @@ -3518,7 +3518,7 @@ character.sp={ onunmark:'throw' }, filter:function(event,player){ - return player.num('he',{color:'black'})>0&&player.storage.yinling.length<4; + return player.countCards('he',{color:'black'})>0&&player.storage.yinling.length<4; }, filterTarget:function(card,player,target){ return target.countCards('he')>0&&target!=player; @@ -3578,7 +3578,7 @@ character.sp={ }, position:'he', filter:function(event,player){ - return player.num('he',{suit:'diamond'})>0; + return player.countCards('he',{suit:'diamond'})>0; }, discard:false, prepare:'give', @@ -3821,12 +3821,12 @@ character.sp={ player.storage.yinbing=[]; }, filter:function(event,player){ - return player.num('he',{type:'basic'})0; + return player.countCards('he',{type:'equip'})>0; }, content:function(){ "step 0" @@ -7052,7 +7052,7 @@ character.sp={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.hp0; + return player.hp0; }, filterTarget:function(card,player,target){ return player!=target&&get.distance(player,target,'attack')<=1; @@ -7743,7 +7743,7 @@ character.sp={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, content:function(){ "step 0" diff --git a/character/standard.js b/character/standard.js index 2014b2e49..4cb7265c1 100644 --- a/character/standard.js +++ b/character/standard.js @@ -739,7 +739,7 @@ character.standard={ if(!player.countCards('he')) return false; } else{ - if(!player.num('he',{color:'red'})) return false; + if(!player.countCards('he',{color:'red'})) return false; } }, prompt:'将一张红色牌当杀使用或打出', @@ -750,7 +750,7 @@ character.standard={ if(!player.countCards('he')) return false; } else{ - if(!player.num('he',{color:'red'})) return false; + if(!player.countCards('he',{color:'red'})) return false; } }, respondSha:true, @@ -1173,7 +1173,7 @@ character.standard={ position:'he', viewAs:{name:'guohe'}, viewAsFilter:function(player){ - if(!player.num('he',{color:'black'})) return false; + if(!player.countCards('he',{color:'black'})) return false; }, prompt:'将一张黑色牌当过河拆桥使用', check:function(card){return 4-ai.get.value(card)} @@ -1275,7 +1275,7 @@ character.standard={ guose:{ audio:1, filter:function(event,player){ - return player.num('he',{suit:'diamond'})>0; + return player.countCards('he',{suit:'diamond'})>0; }, enable:'chooseToUse', filterCard:function(card){ @@ -1520,7 +1520,7 @@ character.standard={ check:function(card){return 15-ai.get.value(card)}, ai:{ skillTagFilter:function(player){ - return player.num('he',{color:'red'})>0&&_status.currentPhase!=player; + return player.countCards('he',{color:'red'})>0&&_status.currentPhase!=player; }, threaten:1.5, save:true, diff --git a/character/swd.js b/character/swd.js index 3f9c0586e..b79a07190 100644 --- a/character/swd.js +++ b/character/swd.js @@ -731,7 +731,7 @@ character.swd={ hjifeng_old:{ trigger:{player:'phaseEnd'}, filter:function(event,player){ - if(!player.num('he',{type:'equip'})) return false; + if(!player.countCards('he',{type:'equip'})) return false; if(player.countCards('h',{type:'jiqi'})) return false; if(get.cardPile(function(card){return get.type(card)=='jiqi'})) return true; return false; @@ -1023,7 +1023,7 @@ character.swd={ usable:1, viewAs:{name:'taoyuan'}, filter:function(event,player){ - return player.num('he',{color:'black'})>0; + return player.countCards('he',{color:'black'})>0; }, audio:true, prompt:'将一张黑色牌当作桃园结义使用', @@ -1057,7 +1057,7 @@ character.swd={ position:'he', viewAs:{name:'sha'}, viewAsFilter:function(player){ - if(!player.num('he',{color:'red'})) return false; + if(!player.countCards('he',{color:'red'})) return false; }, prompt:'将一张红色牌当杀使用', check:function(card){return 5-ai.get.value(card)}, @@ -1067,7 +1067,7 @@ character.swd={ }, skillTagFilter:function(player,tag,arg){ if(arg!='use') return false; - if(!player.num('he',{color:'red'})) return false; + if(!player.countCards('he',{color:'red'})) return false; }, }, group:['huanxia_expire','huanxia_draw','huanxia_gain'], @@ -1416,7 +1416,7 @@ character.swd={ heihuo:{ enable:'phaseUse', filter:function(event,player){ - return player.countCards('h')>0&&player.num('he',{type:'equip'})>0&&!player.hasSkill('heihuo2'); + return player.countCards('h')>0&&player.countCards('he',{type:'equip'})>0&&!player.hasSkill('heihuo2'); }, filterCard:function(card){ return get.type(card)=='equip'; @@ -1429,7 +1429,7 @@ character.swd={ if(nh<2) return 0; if(nh>4) return 0; if(nh==4&&pos=='e') return 0; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card)+(pos=='e'?0.4:0); } return 5.5-ai.get.value(card)+(pos=='e'?0.4:0); @@ -1636,7 +1636,7 @@ character.swd={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('he',{color:'black',name:'sha'})>0; + return player.countCards('he',{color:'black',name:'sha'})>0; }, filterCard:function(card){ return card.name=='sha'&&get.color(card)=='black'; @@ -1671,7 +1671,7 @@ character.swd={ trigger:{global:'phaseUseBefore'}, direct:true, filter:function(event,player){ - return event.player!=player&&player.num('he',{type:'basic'})0; + return player.countCards('he',{color:'black'})>0; }, content:function(){ "step 0" @@ -2669,7 +2669,7 @@ character.swd={ filterTarget:function(card,player,target){ return player!=target; }, - selectCard:[1,player.num('he',{color:'black'})], + selectCard:[1,player.countCards('he',{color:'black'})], selectTarget:function(){ if(ui.selected.targets.length>ui.selected.cards.length){ game.uncheck('target'); @@ -3073,13 +3073,13 @@ character.swd={ filterCard:{type:'equip'}, check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 12-ai.get.equipValue(card); } return 8-ai.get.equipValue(card); }, filter:function(event,player){ - return player.num('he',{type:'equip'}); + return player.countCards('he',{type:'equip'}); }, filterTarget:function(card,player,target){ return player!=target; @@ -3181,14 +3181,14 @@ character.swd={ jianji:{ enable:'phaseUse', filter:function(event,player){ - return player.num('he',{type:'equip'})>0&&lib.filter.cardEnabled({name:'sha'},player); + return player.countCards('he',{type:'equip'})>0&&lib.filter.cardEnabled({name:'sha'},player); }, usable:1, filterCard:{type:'equip'}, position:'he', check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } return 6-ai.get.equipValue(card); @@ -3237,7 +3237,7 @@ character.swd={ enable:'phaseUse', filter:function(event,player){ if(!lib.card.chiyuxi) return false; - return !player.getStat('skill').huangyu&&player.num('he',{color:'red'})>1; + return !player.getStat('skill').huangyu&&player.countCards('he',{color:'red'})>1; }, filterCard:{color:'red'}, selectCard:2, @@ -3263,7 +3263,7 @@ character.swd={ filter:function(event,player){ var type=get.type(event.card,'trick'); if(type!='basic'&&type!='trick') return false; - return event.player!=player&&player.num('he',{type:'equip'})>0&& + return event.player!=player&&player.countCards('he',{type:'equip'})>0&& event.targets&&event.targets.length>0; }, direct:true, @@ -3531,7 +3531,7 @@ character.swd={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('he',{suit:'club'})>0; + return player.countCards('he',{suit:'club'})>0; }, position:'he', filterCard:{suit:'club'}, @@ -4281,7 +4281,7 @@ character.swd={ position:'he', usable:1, filter:function(event,player){ - return player.num('he',{suit:'spade'})>0; + return player.countCards('he',{suit:'spade'})>0; }, check:function(card){ return 10-ai.get.value(card) @@ -4314,7 +4314,7 @@ character.swd={ }, viewAs:{name:'liuxinghuoyu'}, viewAsFilter:function(player){ - if(!player.num('he',{suit:'heart'})) return false; + if(!player.countCards('he',{suit:'heart'})) return false; }, prompt:'将一张红桃手牌当作流星火羽使用', check:function(card){return 6-ai.get.value(card)}, @@ -4361,7 +4361,7 @@ character.swd={ return player.countCards('h',{color:'black'})>0; }, viewAsFilter:function(player){ - if(!player.num('he',{color:'black'})) return false; + if(!player.countCards('he',{color:'black'})) return false; }, prompt:'将一张黑色牌当作冰魄针使用', check:function(card){return 5-ai.get.value(card)}, @@ -4832,7 +4832,7 @@ character.swd={ direct:true, filter:function(event,player){ if(get.itemtype(event.cards)!='cards') return false; - return player.num('he',{suit:get.suit(event.cards)})>0; + return player.countCards('he',{suit:get.suit(event.cards)})>0; }, alter:true, content:function(){ @@ -4859,7 +4859,7 @@ character.swd={ } player.discard(result.cards); event.num++; - if(player.num('he',{suit:event.suit})>1&&!get.is.altered('liaoyuan')){ + if(player.countCards('he',{suit:event.suit})>1&&!get.is.altered('liaoyuan')){ event.goto(1); } } @@ -6749,7 +6749,7 @@ character.swd={ trigger:{player:'damageBefore'}, priority:-10, filter:function(event,player){ - return player.num('he',{type:'equip'}); + return player.countCards('he',{type:'equip'}); }, direct:true, content:function(){ @@ -6897,7 +6897,7 @@ character.swd={ filter:function(event,player){ if(!event.player.isLinked()) return false; if(event.nature=='fire') return false; - if(player.num('he',{color:'red'})) return true; + if(player.countCards('he',{color:'red'})) return true; return false; }, direct:true, @@ -6927,7 +6927,7 @@ character.swd={ if(!event.player) return false; if(event.player==player) return false; if(event.player.isLinked()&&event.player.isTurnedOver()) return false; - if(player.num('he',{color:'black'})) return true; + if(player.countCards('he',{color:'black'})) return true; return false; }, direct:true, @@ -7232,7 +7232,7 @@ character.swd={ usable:1, discard:false, filter:function(event,player){ - return player.num('he',{type:'trick'})>0; + return player.countCards('he',{type:'trick'})>0; }, prepare:'throw', position:'he', @@ -8365,7 +8365,7 @@ character.swd={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, filterCard:{type:'equip'}, position:'he', @@ -8390,7 +8390,7 @@ character.swd={ wanjun:{ enable:'chooseToUse', filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, filterCard:function(card){ return get.type(card)=='equip'; @@ -8400,7 +8400,7 @@ character.swd={ prompt:'将一张装备牌当南蛮入侵使用', check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } if(player.countCards('h')0; + return player.countCards('he',{color:'red'})>0; }, check:function(card){ return 7-ai.get.value(card); @@ -2338,12 +2338,12 @@ character.xianjian={ position:'he', viewAs:{name:'shihuifen'}, viewAsFilter:function(player){ - return player.num('he',{color:'black'})>0; + return player.countCards('he',{color:'black'})>0; }, ai:{ shihuifen:true, skillTagFilter:function(player){ - return player.num('he',{color:'black'})>0; + return player.countCards('he',{color:'black'})>0; } } }, diff --git a/character/yijiang.js b/character/yijiang.js index 8dc3b0971..3fadbae94 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -4668,7 +4668,7 @@ character.yijiang={ audio:2, trigger:{player:'damageBegin'}, filter:function(event,player){ - return player.num('he',{type:'equip'})&&event.source&&event.source.sex=='male'; + return player.countCards('he',{type:'equip'})&&event.source&&event.source.sex=='male'; }, direct:true, content:function(){ @@ -5088,7 +5088,7 @@ character.yijiang={ check:function(card){ if(get.type(card)!='equip') return 0; var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } return 6-ai.get.equipValue(card); @@ -5239,7 +5239,7 @@ character.yijiang={ return card.name=='sha'||get.type(card)=='equip'; }, filter:function(event,player){ - return player.countCards('h','sha')>0||player.num('he',{type:'equip'})>0; + return player.countCards('h','sha')>0||player.countCards('he',{type:'equip'})>0; }, check:function(card){return 8-ai.get.value(card)}, selectTarget:2, @@ -5624,7 +5624,7 @@ character.yijiang={ direct:true, audio:2, filter:function(event,player){ - return player.countCards('he')>player.num('he',{type:'basic'}); + return player.countCards('he')>player.countCards('he',{type:'basic'}); }, content:function(){ "step 0" @@ -6818,7 +6818,7 @@ character.yijiang={ audio:3, priority:6, filter:function(event,player){ - return event.player!=player&&event.player.hp==1&&player.num('he',{type:'equip'})>0; + return event.player!=player&&event.player.hp==1&&player.countCards('he',{type:'equip'})>0; }, direct:true, content:function(){ diff --git a/character/yxs.js b/character/yxs.js index 0fea3895b..bf85e7ea0 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -1759,7 +1759,7 @@ character.yxs={ prompt:'将一张装备区内的牌当南蛮入侵使用', check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } if(player.countCards('h')0; + return player.countCards('he',{color:'black'})>0; }, content:function(){ "step 0" @@ -2440,7 +2440,7 @@ character.yxs={ filter:function(event,player){ return _status.currentPhase!=player&&event.player!=player&&get.type(event.card)=='trick'&& get.position(event.card)=='d'&&!player.hasSkill('zhulu2')&& - get.itemtype(event.card)=='card'&&player.num('he',{suit:get.suit(event.card)})>0; + get.itemtype(event.card)=='card'&&player.countCards('he',{suit:get.suit(event.card)})>0; }, content:function(){ "step 0" diff --git a/mode/chess.js b/mode/chess.js index ba8558d34..d06630e16 100644 --- a/mode/chess.js +++ b/mode/chess.js @@ -5121,13 +5121,13 @@ mode.chess={ }, check:function(card){ var player=_status.currentPhase; - if(player.num('he',{subtype:get.subtype(card)})>1){ + if(player.countCards('he',{subtype:get.subtype(card)})>1){ return 12-ai.get.equipValue(card); } return 8-ai.get.equipValue(card); }, filter:function(event,player){ - return player.num('he',{type:'equip'}); + return player.countCards('he',{type:'equip'}); }, filterTarget:function(card,player,target){ return player!=target&&get.distance(player,target)<=2; diff --git a/mode/guozhan.js b/mode/guozhan.js index a9904b67f..654d3f04f 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -879,7 +879,7 @@ mode.guozhan={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, content:function(){ "step 0" @@ -1536,7 +1536,7 @@ mode.guozhan={ qingcheng:{ enable:'phaseUse', filter:function(event,player){ - return player.num('he',{type:'equip'})&&game.hasPlayer(function(current){ + return player.countCards('he',{type:'equip'})&&game.hasPlayer(function(current){ return current!=player&&!current.isUnseen(2); }); },