From ab713a8101310dd87e20c5dc6bc632d8309b20d4 Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 27 Mar 2017 16:48:22 +0800 Subject: [PATCH] num --- card/extra.js | 18 +- card/gujian.js | 72 +++--- card/guozhan.js | 32 +-- card/hearth.js | 58 ++--- card/sp.js | 20 +- card/standard.js | 58 ++--- card/swd.js | 156 ++++++------- card/yunchou.js | 60 ++--- card/zhenfa.js | 4 +- character/diy.js | 36 +-- character/extra.js | 26 +-- character/gujian.js | 64 +++--- character/gwent.js | 34 +-- character/hearth.js | 216 +++++++++--------- character/jiange.js | 18 +- character/old.js | 22 +- character/ow.js | 94 ++++---- character/refresh.js | 76 +++---- character/shenhua.js | 254 ++++++++++----------- character/sp.js | 366 +++++++++++++++--------------- character/standard.js | 64 +++--- character/swd.js | 404 +++++++++++++++++----------------- character/xiake.js | 2 +- character/xianjian.js | 82 +++---- character/yijiang.js | 376 +++++++++++++++---------------- character/yxs.js | 110 ++++----- character/zhuogui.js | 12 +- extension/wuxing/extension.js | 10 +- game/game.js | 166 +++++++------- mode/boss.js | 104 ++++----- mode/chess.js | 40 ++-- mode/guozhan.js | 38 ++-- mode/identity.js | 10 +- mode/stone.js | 134 +++++------ mode/tafang.js | 6 +- mode/versus.js | 48 ++-- 36 files changed, 1645 insertions(+), 1645 deletions(-) diff --git a/card/extra.js b/card/extra.js index f0bda800c..f3979b8ee 100644 --- a/card/extra.js +++ b/card/extra.js @@ -116,12 +116,12 @@ card.extra={ type:'trick', enable:true, filterTarget:function(card,player,target){ - if(player!=game.me&&player.num('h')<2) return false; - return target.num('h')>0; + if(player!=game.me&&player.countCards('h')<2) return false; + return target.countCards('h')>0; }, content:function(){ "step 0" - if(target.get('h').length==0){ + if(target.countCards('h')==0){ event.finish(); return; } @@ -168,7 +168,7 @@ card.extra={ }, result:{ player:function(player){ - var nh=player.num('h'); + var nh=player.countCards('h'); if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& _status.event.filterCard({name:'huogong'})){ @@ -183,8 +183,8 @@ card.extra={ return 0; }, target:function(player,target){ - if(target.hasSkill('huogong2')||target.num('h')==0) return 0; - if(player.num('h')<=1) return 0; + if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0; + if(player.countCards('h')<=1) return 0; if(target==player){ if(typeof _status.event.filterCard=='function'&& _status.event.filterCard({name:'huogong'})){ @@ -273,7 +273,7 @@ card.extra={ }, result:{ target:function(player,target){ - return -1-target.get('h').length; + return -1-target.countCards('h'); } }, tag:{ @@ -402,7 +402,7 @@ card.extra={ filter:function(event){ if(event.parent.name=='_lianhuan'||event.parent.name=='_lianhuan2') return false; if(event.card&&event.card.name=='sha'){ - if(event.player.get('h').length==0) return true; + if(event.player.countCards('h')==0) return true; } return false; }, @@ -413,7 +413,7 @@ card.extra={ ai:{ effect:{ target:function(card,player,target,current){ - if(card.name=='sha'&&target.get('h').length==0) return [1,-2]; + if(card.name=='sha'&&target.countCards('h')==0) return [1,-2]; } } } diff --git a/card/gujian.js b/card/gujian.js index 58ddecfb8..9f5cf0ba0 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -265,7 +265,7 @@ card.gujian={ if(target.hasSha()) return 2; } else{ - var nh=target.num('h'); + var nh=target.countCards('h'); if(nh>=3) return 1; if(target.hasSha()) return 1; if(nh&&Math.random()<0.5) return 1; @@ -312,7 +312,7 @@ card.gujian={ range:{global:1}, content:function(){ target.$gain2(cards); - target.discard(target.get('j')); + target.discard(target.getCards('j')); target.storage.molicha=card; target.storage.molicha_markcount=5; target.addSkill('molicha'); @@ -322,7 +322,7 @@ card.gujian={ value:4, result:{ target:function(player,target){ - if(target.num('j')) return 2; + if(target.countCards('j')) return 2; return 1; } } @@ -351,7 +351,7 @@ card.gujian={ if(target.hasSha()) return 2; } else{ - var nh=target.num('h'); + var nh=target.countCards('h'); if(nh>=3) return 1; if(target.hasSha()) return 1; if(nh&&Math.random()<0.5) return 1; @@ -452,11 +452,11 @@ card.gujian={ type:'basic', enable:true, filterTarget:function(card,player,target){ - return target.num('he')>0; + return target.countCards('he')>0; }, content:function(){ 'step 0' - target.chooseToDiscard('he',[1,target.num('he')],'弃置任意张牌并摸等量的牌').ai=function(card){ + target.chooseToDiscard('he',[1,target.countCards('he')],'弃置任意张牌并摸等量的牌').ai=function(card){ return 6-ai.get.value(card); } 'step 1' @@ -470,7 +470,7 @@ card.gujian={ result:{ target:function(player,target){ if(target==player){ - var cards=player.get('he'); + var cards=player.getCards('he'); var num=-1; for(var i=0;i0&&!target.hasSkill('bingpotong'); + return target.countCards('h')>0&&!target.hasSkill('bingpotong'); }, content:function(){ "step 0" - if(target.num('h')==0||player.num('h')==0){ + if(target.countCards('h')==0||player.countCards('h')==0){ event.finish(); return; } @@ -604,7 +604,7 @@ card.gujian={ }, result:{ player:function(player,target){ - if(player.num('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ + if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& _status.event.filterCard({name:'dujian'})){ return -10; @@ -618,7 +618,7 @@ card.gujian={ return 0; }, target:function(player,target){ - if(player.num('h')<=1) return 0; + if(player.countCards('h')<=1) return 0; return -1.5; } }, @@ -672,15 +672,15 @@ card.gujian={ fullskin:true, wuxieable:true, filterTarget:function(card,player,target){ - return target!=player&&target.num('he')>0; + return target!=player&&target.countCards('he')>0; }, changeTarget:function(player,targets){ game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1&¤t.num('he'); + return get.distance(targets[0],current,'pure')==1&¤t.countCards('he'); },targets); }, content:function(){ - var he=target.get('he'); + var he=target.getCards('he'); if(he.length){ target.discard(he.randomGet()).delay=false; } @@ -700,7 +700,7 @@ card.gujian={ result:{ player:function(player,target){ return game.countPlayer(function(current){ - if(current==target||(get.distance(target,current,'pure')==1&¤t.num('he'))){ + if(current==target||(get.distance(target,current,'pure')==1&¤t.countCards('he'))){ var att=ai.get.attitude(player,current); if(att>0){ return -1; @@ -773,7 +773,7 @@ card.gujian={ content:function(){ var list=[1,2,3,4,5,6]; if(player.getEnemies().contains(target)){ - if(target.num('he')==0){ + if(target.countCards('he')==0){ list.remove(1); } if(target.isLinked()){ @@ -783,7 +783,7 @@ card.gujian={ list.remove(5); } switch(list.randomGet()){ - case 1:target.discard(target.get('he').randomGet());break; + case 1:target.discard(target.getCards('he').randomGet());break; case 2:target.loseHp();break; case 3:target.damage();break; case 4:if(!target.isLinked()) target.link();break; @@ -810,7 +810,7 @@ card.gujian={ if(target.isHealthy()){ list.remove(2); } - if(!target.num('j')){ + if(!target.countCards('j')){ list.remove(5); } if(!target.isLinked()&&!target.isTurnedOver()){ @@ -824,7 +824,7 @@ card.gujian={ case 2:target.recover();break; case 3:target.changeHujia();break; case 4:target.addTempSkill('qianxing',{player:'phaseBegin'});break; - case 5:target.discard(target.get('j'));break; + case 5:target.discard(target.getCards('j'));break; case 6:{ if(target.isLinked()) target.link(); if(target.isTurnedOver()) target.turnOver(); @@ -868,7 +868,7 @@ card.gujian={ return 0.5; } else{ - switch(target.num('h')){ + switch(target.countCards('h')){ case 0:return 2; case 1:return 1.5; case 2:return 1; @@ -901,7 +901,7 @@ card.gujian={ }, result:{ target:function(player,target){ - if(target.num('h')>=3||target.needsToDiscard()) return -1.5; + if(target.countCards('h')>=3||target.needsToDiscard()) return -1.5; return 0; } } @@ -1305,14 +1305,14 @@ card.gujian={ if(Math.random()<0.65){ var list=player.getEnemies(); for(var i=0;i0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' player.loseHp(); 'step 1' - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ var card=hs.randomGet(); player.gain(card,target); @@ -1418,7 +1418,7 @@ card.gujian={ result:{ target:function(player,target){ if(ai.get.attitude(player,target)>=0) return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); var num=-1/Math.sqrt(1+nh); if(player.hp>=4) return num; if(player.hp>=3&&nh<=2) return num; @@ -1436,13 +1436,13 @@ card.gujian={ return !player.hasSkill('yuheng_plus_temp'); }, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' player.loseHp(); 'step 1' - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ var card=hs.randomGet(); player.gain(card,target); @@ -1473,7 +1473,7 @@ card.gujian={ result:{ target:function(player,target){ if(ai.get.attitude(player,target)>=0) return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); var num=-1/Math.sqrt(1+nh); if(player.hp>=4) return num; if(player.hp>=3&&nh<=2) return num; @@ -1486,13 +1486,13 @@ card.gujian={ yuheng_pro_skill:{ enable:'phaseUse', filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' player.loseHp(); 'step 1' - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ var card=hs.randomGet(); player.gain(card,target); @@ -1511,7 +1511,7 @@ card.gujian={ result:{ target:function(player,target){ if(ai.get.attitude(player,target)>=0) return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); var num=-1/Math.sqrt(1+nh); if(player.hp>=4) return num; if(player.hp>=3&&nh<=2) return num; diff --git a/card/guozhan.js b/card/guozhan.js index a15082402..eeb21fef3 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -87,7 +87,7 @@ card.guozhan={ useful:2, result:{ target:function(player,target){ - if(target.num('he')>=2) return 1; + if(target.countCards('he')>=2) return 1; return 0; } } @@ -97,7 +97,7 @@ card.guozhan={ fullskin:true, type:'trick', filterTarget:function(card,player,target){ - return target!=player&&target.num('e')>0; + return target!=player&&target.countCards('e')>0; }, enable:true, content:function(){ @@ -106,14 +106,14 @@ card.guozhan={ if(ai.get.damageEffect(player,event.player,player,'thunder')>=0){ return 'take_damage'; } - if(player.hp>=3&&player.num('e')>=2){ + if(player.hp>=3&&player.countCards('e')>=2){ return 'take_damage'; } return 'discard_card'; }); 'step 1' if(result.control=='discard_card'){ - target.discard(target.get('e')); + target.discard(target.getCards('e')); } else{ target.damage('thunder'); @@ -130,7 +130,7 @@ card.guozhan={ }, result:{ target:function(player,target){ - return -target.num('e'); + return -target.countCards('e'); } } } @@ -378,7 +378,7 @@ card.guozhan={ result:{ target:function(player,target){ if(target.hasSkillTag('nofire')||target.hasSkillTag('nodamage')) return 0; - if(target.hasSkill('xuying')&&target.num('h')==0) return 0; + if(target.hasSkill('xuying')&&target.countCards('h')==0) return 0; if(!target.isLinked()){ return ai.get.damageEffect(target,player,target,'fire'); } @@ -429,7 +429,7 @@ card.guozhan={ chongzhu:true, filterTarget:function(card,player,target){ if(player==target) return false; - return (target.get('h').length||target.isUnseen(2)); + return (target.countCards('h')||target.isUnseen(2)); }, content:function(){ "step 0" @@ -438,7 +438,7 @@ card.guozhan={ } player.storage.zhibi.add(target); var controls=[]; - if(target.get('h').length) controls.push('手牌'); + if(target.countCards('h')) controls.push('手牌'); if(target.isUnseen(0)) controls.push('主将'); if(target.isUnseen(1)) controls.push('副将'); if(controls.length>1){ @@ -450,7 +450,7 @@ card.guozhan={ var str=get.translation(target)+'的'; if(result.control){ if(result.control=='手牌'){ - content=[str+'手牌',target.get('h')]; + content=[str+'手牌',target.getCards('h')]; game.log(player,'观看了',target,'的手牌'); } else if(result.control=='主将'){ @@ -462,8 +462,8 @@ card.guozhan={ game.log(player,'观看了',target,'的副将'); } } - else if(target.get('h').length){ - content=[str+'手牌',target.get('h')]; + else if(target.countCards('h')){ + content=[str+'手牌',target.getCards('h')]; game.log(player,'观看了',target,'的手牌'); } else if(target.isUnseen(0)){ @@ -484,7 +484,7 @@ card.guozhan={ }, result:{ player:function(player,target){ - if(player.num('h')<=player.hp) return 0; + if(player.countCards('h')<=player.hp) return 0; if(player.storage.zhibi&&player.storage.zhibi.contains(target)) return 0; return target.isUnseen()?1:0; } @@ -527,7 +527,7 @@ card.guozhan={ }, result:{ target:function(player,target){ - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length<=1){ if(target==player&&hs[0].name=='yiyi'){ return 0; @@ -615,7 +615,7 @@ card.guozhan={ priority:5, logTarget:'target', filter:function(event,player){ - return event.target.num('he'); + return event.target.countCards('he'); }, content:function(){ trigger.target.chooseToDiscard('he',true); @@ -836,7 +836,7 @@ card.guozhan={ content:function(){ "step 0" player.removeSkill('xietianzi'); - if(player.num('he')>0){ + if(player.countCards('he')>0){ player.chooseToDiscard('he','是否弃置一张牌并获得一个额外回合?').set('ai',function(card){ return 10-ai.get.value(card); }); @@ -1069,7 +1069,7 @@ card.guozhan={ trigger:{source:'damageAfter'}, direct:true, filter:function(event,player){ - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; if(!event.card) return false; if(event.card.name!='sha') return false; return game.hasPlayer(function(current){ diff --git a/card/hearth.js b/card/hearth.js index 307dec6c2..54f677833 100644 --- a/card/hearth.js +++ b/card/hearth.js @@ -10,7 +10,7 @@ card.hearth={ 'step 0' target.damage('fire'); 'step 1' - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length){ player.discard(hs.randomGet()); } @@ -24,8 +24,8 @@ card.hearth={ result:{ player:function(player,target){ if(player==target) return -1; - if(player.num('h')>=player.hp) return -0.1; - if(player.num('h')>1) return -0.5; + if(player.countCards('h')>=player.hp) return -0.1; + if(player.countCards('h')>1) return -0.5; return 0; }, target:-1 @@ -64,11 +64,11 @@ card.hearth={ type:'trick', enable:true, filterTarget:function(card,player,target){ - return player!=target&&target.num('hej')>0; + return player!=target&&target.countCards('hej')>0; }, content:function(){ 'step 0' - if(target.num('hej')){ + if(target.countCards('hej')){ var next=player.discardPlayerCard('hej',target,true); next.visible=true; next.delay=false; @@ -93,15 +93,15 @@ card.hearth={ useful:3, result:{ target:function(player,target){ - var es=target.get('e'); - var nh=target.num('h'); + var es=target.getCards('e'); + var nh=target.countCards('h'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp0; + if(player!=game.me&&player.countCards('h')<2) return false; + return target.countCards('h')>0; }, content:function(){ "step 0" - if(target.get('h').length==0){ + if(target.countCards('h')==0){ event.finish(); return; } @@ -234,7 +234,7 @@ card.hearth={ }, result:{ player:function(player){ - var nh=player.num('h'); + var nh=player.countCards('h'); if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& _status.event.filterCard({name:'shandianjian'})){ @@ -249,8 +249,8 @@ card.hearth={ return 0; }, target:function(player,target){ - if(target.hasSkill('huogong2')||target.num('h')==0) return 0; - if(player.num('h')<=1) return 0; + if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0; + if(player.countCards('h')<=1) return 0; if(target==player){ if(typeof _status.event.filterCard=='function'&& _status.event.filterCard({name:'shandianjian'})){ @@ -307,17 +307,17 @@ card.hearth={ enable:true, type:'trick', filterTarget:function(card,player,target){ - return player!=target&&target.num('h')>0; + return player!=target&&target.countCards('h')>0; }, selectTarget:1, content:function(){ 'step 0' - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ target.discard(hs.randomGet()); } 'step 1' - if(!target.num('h')){ + if(!target.countCards('h')){ player.draw(); } }, @@ -328,7 +328,7 @@ card.hearth={ result:{ target:-1, player:function(player,target){ - if(target.num('h')==1) return 1; + if(target.countCards('h')==1) return 1; } } } @@ -438,14 +438,14 @@ card.hearth={ if(event.num){ var enemies=event.current.getEnemies(); for(var i=0;i2) return 1; return 0; @@ -506,7 +506,7 @@ card.hearth={ }, type:'trick', content:function(){ - var num=player.num('h')-target.num('h'); + var num=player.countCards('h')-target.countCards('h'); if(num<-3) num=-3; if(num>3) num=3; if(num>0){ @@ -525,7 +525,7 @@ card.hearth={ useful:2, result:{ target:function(player,target){ - var nh=player.num('h')-target.num('h'); + var nh=player.countCards('h')-target.countCards('h'); if(!player.hasSkill('jizhi')){ nh--; } @@ -534,7 +534,7 @@ card.hearth={ return 0; }, player:function(player,target){ - var nh=target.num('h')-player.num('h'); + var nh=target.countCards('h')-player.countCards('h'); if(!player.hasSkill('jizhi')){ nh++; } @@ -627,7 +627,7 @@ card.hearth={ target:function(player,target){ if(target.hasSkillTag('nothunder')) return 0; if(player.hasUnknown(2)) return 0; - var nh=target.num('he'); + var nh=target.countCards('he'); if(target==player) nh--; if(nh==2) return -2.5; if(nh==1) return -3; diff --git a/card/sp.js b/card/sp.js index 435145916..f77dca9b9 100644 --- a/card/sp.js +++ b/card/sp.js @@ -87,7 +87,7 @@ card.sp={ }, content:function(){ 'step 0' - if(!player.num('h')){ + if(!player.countCards('h')){ event.finish(); } else{ @@ -99,11 +99,11 @@ card.sp={ player.$giveAuto(result.cards,event.target1); event.target1.gain(result.cards,player); 'step 2' - if(!event.target1.num('h')){ + if(!event.target1.countCards('h')){ event.finish(); } else{ - var he=event.target1.get('he'); + var he=event.target1.getCards('he'); if(he.length<=2){ event.directresult=he; } @@ -128,7 +128,7 @@ card.sp={ result:{ target:function(player,target){ var ok=false; - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length<=1) return 0; for(var i=0;i0; + return player.countCards('h')>0; }, prepare:function(cards,player){ player.$give(1,player,false); @@ -445,7 +445,7 @@ card.sp={ check:function(button){ if(button.link.name=='du') return -2; var player=_status.event.player; - if(button.link.name=='xingjiegoutong'&&player.num('h')>1) return -2; + if(button.link.name=='xingjiegoutong'&&player.countCards('h')>1) return -2; if(get.select(get.info(button.link).selectTarget)[1]==-1){ if(get.type(button.link)=='delay') return -1; if(get.type(button.link)=='equip'){ diff --git a/card/standard.js b/card/standard.js index 747384d92..f99b8d99f 100644 --- a/card/standard.js +++ b/card/standard.js @@ -396,7 +396,7 @@ card.standard={ ai:{ basic:{ equipValue:function(card,player){ - var num=2.5+player.num('h')/3; + var num=2.5+player.countCards('h')/3; return Math.min(num,4); } } @@ -411,7 +411,7 @@ card.standard={ ai:{ basic:{ equipValue:function(card,player){ - var num=2.5+(player.num('h')+player.num('e'))/2.5; + var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5; return Math.min(num,5); } } @@ -660,7 +660,7 @@ card.standard={ ai:{ wuxie:function(target,card,player,viewer){ if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){ - if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, basic:{ @@ -671,7 +671,7 @@ card.standard={ result:{ target:function(player,target){ if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } @@ -718,7 +718,7 @@ card.standard={ ai:{ wuxie:function(target,card,player,viewer){ if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){ - if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, basic:{ @@ -729,7 +729,7 @@ card.standard={ result:{ target:function(player,target){ if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } @@ -873,7 +873,7 @@ card.standard={ if(hs1.length>hs2.length+1){ return -2; } - var hsx=target.get('h'); + var hsx=target.getCards('h'); if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){ return -2; } @@ -901,14 +901,14 @@ card.standard={ range:{global:1}, selectTarget:1, postAi:function(targets){ - return targets.length==1&&targets[0].num('j'); + return targets.length==1&&targets[0].countCards('j'); }, filterTarget:function(card,player,target){ if(player==target) return false; - return (target.num('hej')>0); + return (target.countCards('hej')>0); }, content:function(){ - if(target.num('hej')){ + if(target.countCards('hej')){ player.gainPlayerCard('hej',target,true); } }, @@ -925,8 +925,8 @@ card.standard={ }, result:{ target:function(player,target){ - if(ai.get.attitude(player,target)<=0) return (target.num('he')>0)?-1.5:1.5; - var js=target.get('j'); + if(ai.get.attitude(player,target)<=0) return (target.countCards('he')>0)?-1.5:1.5; + var js=target.getCards('j'); if(js.length){ var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; if(jj.name=='shunshou') return 3; @@ -938,11 +938,11 @@ card.standard={ return -1.5; }, player:function(player,target){ - if(ai.get.attitude(player,target)<0&&!target.num('he')){ + if(ai.get.attitude(player,target)<0&&!target.countCards('he')){ return 0; } if(ai.get.attitude(player,target)>1){ - var js=target.get('j'); + var js=target.getCards('j'); if(js.length){ var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; if(jj.name=='shunshou') return 1; @@ -969,14 +969,14 @@ card.standard={ enable:true, selectTarget:1, postAi:function(targets){ - return targets.length==1&&targets[0].num('j'); + return targets.length==1&&targets[0].countCards('j'); }, filterTarget:function(card,player,target){ if(player==target) return false; - return (target.num('hej')>0); + return (target.countCards('hej')>0); }, content:function(){ - if(target.num('hej')){ + if(target.countCards('hej')){ player.discardPlayerCard('hej',target,true); } }, @@ -988,15 +988,15 @@ card.standard={ }, result:{ target:function(player,target){ - var es=target.get('e'); - var nh=target.num('h'); + var es=target.getCards('e'); + var nh=target.countCards('h'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp-1) return -0.01; if(target.hp<3) num--; if(target.isTurnedOver()) num/=2; @@ -1262,7 +1262,7 @@ card.standard={ if(get.population(target.identity)==1){ if(target.maxHp>2&&target.hp<2) return 1; if(game.countPlayer()<3) return -1; - if(target.hp<=2&&target.num('he')<=3) return 1; + if(target.hp<=2&&target.countCards('he')<=3) return 1; } } } @@ -1306,11 +1306,11 @@ card.standard={ direct:true, audio:true, filter:function(event){ - return event.target.get('he').length>0; + return event.target.getCards('he').length>0; }, content:function(){ "step 0" - player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.num('he')),function(button){ + player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.countCards('he')),function(button){ var trigger=_status.event.getTrigger(); var player=_status.event.player; var eff=ai.get.damageEffect(trigger.target,player,player); @@ -1434,7 +1434,7 @@ card.standard={ position:'h', viewAs:{name:'sha'}, filter:function(event,player){ - return player.num('h')>=2; + return player.countCards('h')>=2; }, audio:true, prompt:'将两张手牌当杀使用或打出', @@ -1445,7 +1445,7 @@ card.standard={ ai:{ respondSha:true, skillTagFilter:function(player){ - return player.num('h')>=2; + return player.countCards('h')>=2; }, } }, @@ -1454,7 +1454,7 @@ card.standard={ direct:true, audio:true, filter:function(event,player){ - return player.num('he')>2; + return player.countCards('he')>2; }, content:function(){ "step 0" @@ -1487,7 +1487,7 @@ card.standard={ selectTarget:function(card,player,range){ if(card.name!='sha') return; if(range[1]==-1) return; - var cards=player.get('h'); + var cards=player.getCards('h'); for(var i=0;i0; + return target.countCards('h')>0; }, content:function(){ "step 0" - if(target.num('h')==0||player.num('h')==0){ + if(target.countCards('h')==0||player.countCards('h')==0){ event.finish(); return; } @@ -58,7 +58,7 @@ card.swd={ }, result:{ player:function(player,target){ - if(player.num('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ + if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& _status.event.filterCard({name:'dujian'})){ return -10; @@ -72,8 +72,8 @@ card.swd={ return 0; }, target:function(player,target){ - if(target.hasSkill('dujian2')||target.num('h')==0) return 0; - if(player.num('h')<=1) return 0; + if(target.hasSkill('dujian2')||target.countCards('h')==0) return 0; + if(player.countCards('h')<=1) return 0; return -1.5; } }, @@ -425,7 +425,7 @@ card.swd={ target:function(player,target){ var num=1; if(target.hp<2) num=0.5; - return num/Math.sqrt(Math.max(1,target.num('h'))); + return num/Math.sqrt(Math.max(1,target.countCards('h'))); } } } @@ -513,7 +513,7 @@ card.swd={ }, content:function(){ "step 0" - if(target.num('h')){ + if(target.countCards('h')){ var next=target.chooseToDiscard('机关火筒:弃置一张手牌或受到一点火焰伤害'); next.set('ai',function(card){ var evt=_status.event.getParent(); @@ -538,7 +538,7 @@ card.swd={ ai:{ wuxie:function(target,card,player,viewer){ if(ai.get.attitude(viewer,target)>0){ - if(target.num('h')>0||target.hp>1) return 0; + if(target.countCards('h')>0||target.hp>1) return 0; } }, basic:{ @@ -548,7 +548,7 @@ card.swd={ result:{ target:function(player,target){ if(player.hasUnknown(2)) return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=1&&target.hp<=1) return -100; } @@ -780,7 +780,7 @@ card.swd={ type:'jiguan', wuxieable:true, enable:function(card,player){ - var hs=player.get('he'); + var hs=player.getCards('he'); return hs.length>1||(hs.length==1&&hs[0]!=card); }, filterTarget:function(card,player,target){ @@ -788,7 +788,7 @@ card.swd={ }, content:function(){ 'step 0' - if(player.num('he')){ + if(player.countCards('he')){ player.chooseCard(true,'he'); } else{ @@ -934,7 +934,7 @@ card.swd={ wuxieable:true, modTarget:true, enable:function(card,player){ - var es=player.get('e'); + var es=player.getCards('e'); for(var i=0;i0; + return target.countCards('he')>0; }, content:function(){ - target.discard(target.get('he').randomGet()); + target.discard(target.getCards('he').randomGet()); }, ai:{ order:9, @@ -1108,7 +1108,7 @@ card.swd={ target.equip(card); } 'step 1' - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ target.discard(hs.randomGet()); } @@ -1118,11 +1118,11 @@ card.swd={ result:{ target:function(player,target){ if(target.get('e','2')){ - if(target.num('h')&&!target.hasSkillTag('noe')) return -0.6; + if(target.countCards('h')&&!target.hasSkillTag('noe')) return -0.6; return 0; } else{ - var hs=target.get('h'); + var hs=target.getCards('h'); var num=0; if(target.hasSkillTag('noe')){ num=1; @@ -1192,10 +1192,10 @@ card.swd={ derivation:true, derivationpack:'swd', filterTarget:function(card,player,target){ - return target!=player&&target.num('e')>0; + return target!=player&&target.countCards('e')>0; }, content:function(){ - var es=target.get('e'); + var es=target.getCards('e'); target.gain(es); target.$gain2(es); }, @@ -1203,11 +1203,11 @@ card.swd={ order:5, result:{ target:function(player,target){ - if(target.hasSkillTag('noe')) return target.num('e')*2; + if(target.hasSkillTag('noe')) return target.countCards('e')*2; if(target.getEquip('baiyin')&&target.isDamaged()) return 2; if(target.getEquip('xuanyuanjian')||target.getEquip('qiankundai')) return 1; var num=0; - var es=target.get('e'); + var es=target.getCards('e'); for(var i=0;i0&&target.num('h','sha')){ - if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, basic:{ @@ -1801,7 +1801,7 @@ card.swd={ target:function(player,target){ if(target.hasSkillTag('nothunder')) return 0; if(target.hasUnknown(2)) return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); if(lib.config.mode=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } @@ -1848,7 +1848,7 @@ card.swd={ ai:{ wuxie:function(target,card,player,viewer){ if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){ - if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; + if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, basic:{ @@ -1860,7 +1860,7 @@ card.swd={ target:function(player,target){ if(target.hasSkillTag('nofire')) return 0; if(player.hasUnknown(2)) return 0; - var nh=target.num('h'); + var nh=target.countCards('h'); if(lib.config.mode=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } @@ -2030,7 +2030,7 @@ card.swd={ 'step 0' trigger.untrigger(); trigger.finish(); - player.discard(player.get('he')); + player.discard(player.getCards('he')); player.removeSkill('huanpodan_skill'); 'step 1' player.changeHp(1-player.hp); @@ -2046,7 +2046,7 @@ card.swd={ silent:true, priority:-1, content:function(){ - var hs=player.get('h'); + var hs=player.getCards('h'); var list=['yuchanqian','yuchankun','yuchanzhen','yuchanxun','yuchangen','yuchanli','yuchankan','yuchandui']; for(var i=0;i0; + return target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); }; @@ -2656,7 +2656,7 @@ card.swd={ "step 0" player.chooseTarget([1,1],get.prompt('baishouzhihu_duanzao'),function(card,player,target){ if(player==target) return false; - return target.num('he')>0; + return target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); }; @@ -2705,7 +2705,7 @@ card.swd={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, delay:false, content:function(){ @@ -2792,7 +2792,7 @@ card.swd={ shouna:{ enable:'phaseUse', filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, usable:1, filterCard:true, @@ -2800,10 +2800,10 @@ card.swd={ return 6-ai.get.value(card); }, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); var hu=player.getEquip('lianyaohu'); if(card&&hu){ if(!hu.storage.shouna){ @@ -2819,7 +2819,7 @@ card.swd={ order:5, result:{ target:function(player,target){ - return -1/Math.sqrt(1+target.num('h')); + return -1/Math.sqrt(1+target.countCards('h')); } } } @@ -2865,7 +2865,7 @@ card.swd={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ 'step 0' @@ -3004,7 +3004,7 @@ card.swd={ forced:true, priority:55, filter:function(event){ - return event.player.num('he')>0; + return event.player.countCards('he')>0; }, content:function(){ trigger.player.chooseToDiscard(true,'he'); @@ -3161,7 +3161,7 @@ card.swd={ return 7-ai.get.value(card); }, filter:function(event,player){ - return player.hp=2; + return player.hp=2; }, content:function(){ player.recover(); @@ -3216,10 +3216,10 @@ card.swd={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('h'); + return target!=player&&target.countCards('h'); }, filter:function(event,player){ - return player.num('h')?true:false; + return player.countCards('h')?true:false; }, content:function(){ "step 0" @@ -3245,7 +3245,7 @@ card.swd={ order:7, result:{ target:function(player,target){ - if(player.num('h')<=1) return 0; + if(player.countCards('h')<=1) return 0; if(ai.get.attitude(player,target)>=0) return 0; if(game.hasPlayer(function(current){ return (player!=current&&target.canUse('sha',current)&& @@ -3395,7 +3395,7 @@ card.swd={ order:10, result:{ target:function(player,target){ - return -target.num('h'); + return -target.countCards('h'); } } } @@ -3404,20 +3404,20 @@ card.swd={ trigger:{source:'damageEnd'}, forced:true, filter:function(event){ - return event.card&&event.card.name=='sha'&&event.player.num('he'); + return event.card&&event.card.name=='sha'&&event.player.countCards('he'); }, content:function(){ - trigger.player.discard(trigger.player.get('he').randomGet()); + trigger.player.discard(trigger.player.getCards('he').randomGet()); } }, hslingjian_xuanfengzhiren_equip2:{ trigger:{player:'damageEnd'}, forced:true, filter:function(event){ - return event.card&&event.card.name=='sha'&&event.source&&event.source.num('he'); + return event.card&&event.card.name=='sha'&&event.source&&event.source.countCards('he'); }, content:function(){ - trigger.source.discard(trigger.source.get('he').randomGet()); + trigger.source.discard(trigger.source.getCards('he').randomGet()); } }, hslingjian_xuanfengzhiren_equip3:{ @@ -3460,22 +3460,22 @@ card.swd={ filterCard:true, position:'he', filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, filterTarget:function(card,player,target){ - return target.num('he')>0; + return target.countCards('he')>0; }, check:function(card){ return 5-ai.get.value(card); }, content:function(){ - target.discard(target.get('he').randomGet()); + target.discard(target.getCards('he').randomGet()); }, ai:{ order:5, result:{ target:function(player,target){ - var dh=player.num('he')-target.num('he'); + var dh=player.countCards('he')-target.countCards('he'); if(dh>0){ return -Math.sqrt(dh); } @@ -3534,7 +3534,7 @@ card.swd={ filterTarget:true, selectCard:2, filter:function(event,player){ - return player.num('he')>=2; + return player.countCards('he')>=2; }, check:function(card){ return 5-ai.get.value(card); @@ -3640,7 +3640,7 @@ card.swd={ var att=ai.get.attitude(player,target); if(get.distance(player,target,'absolute')<=1) return 0; if(target.hp==1) return 2*att; - if(target.hp==2&&target.num('h')<=2) return 1.2*att; + if(target.hp==2&&target.countCards('h')<=2) return 1.2*att; return att; } 'step 1' @@ -3677,7 +3677,7 @@ card.swd={ hslingjian_yinmilichang_equip5:{ mod:{ targetEnabled:function(card,player,target,now){ - if(target.num('h')==0){ + if(target.countCards('h')==0){ if(card.name=='sha'||card.name=='juedou') return false; } } @@ -3686,7 +3686,7 @@ card.swd={ noh:true, skillTagFilter:function(player,tag){ if(tag=='noh'){ - if(player.num('h')!=1) return false; + if(player.countCards('h')!=1) return false; } } } @@ -3763,14 +3763,14 @@ card.swd={ hslingjian_shengxiuhaojiao_equip3:{ mod:{ globalTo:function(from,to,distance){ - if(to.hp0; + return player!=target&&target.countCards('he')>0; }, position:'he', content:function(){ - var es=target.get('e'); + var es=target.getCards('e'); target.gain(es); target.$gain2(es); }, @@ -3859,8 +3859,8 @@ card.swd={ order:5, result:{ target:function(player,target){ - if(target.hasSkillTag('noe')) return target.num('e')*2; - return -target.num('e'); + if(target.hasSkillTag('noe')) return target.countCards('e')*2; + return -target.countCards('e'); } }, } @@ -3912,7 +3912,7 @@ card.swd={ longprompt:true, prompt:function(event){ var lingjians=[],types=[]; - var hs=event.player.get('he'); + var hs=event.player.getCards('he'); for(var i=0;inh; + return current!=player&¤t.countCards('h')>nh; }); }, check:function(card){ return 8-ai.get.value(card); }, filterTarget:function(card,player,target){ - if(target.get('h').length==0) return false; + if(target.countCards('h')==0) return false; if(target==player) return false; - if(target.num('h')<=player.num('h')) return false; + if(target.countCards('h')<=player.countCards('h')) return false; return true; }, content:function(){ @@ -4293,7 +4293,7 @@ card.swd={ }); "step 1" if(result.bool){ - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); if(card){ player.gain(card,target); target.$giveAuto(card,player); @@ -4391,7 +4391,7 @@ card.swd={ case '5555':target.link();break; case '6666':target.draw();break; case '7777':target.recover();break; - case '8888':target.discard(target.get('j'));break; + case '8888':target.discard(target.getCards('j'));break; case '9999':target.draw(2);target.chooseToDiscard(2,true);break; default: for(var i=1;i<4;i++){ @@ -4431,7 +4431,7 @@ card.swd={ case 'diamond':player.draw();break; case 'club':{ player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); }; diff --git a/card/yunchou.js b/card/yunchou.js index 4a5802348..b72d50211 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -46,12 +46,12 @@ card.yunchou={ event.dialog=ui.dialogs[i];break; } } - if(!event.dialog||!target.num('h')){ + if(!event.dialog||!target.countCards('h')){ event.finish(); return; } var minValue=20; - var hs=target.get('h'); + var hs=target.getCards('h'); for(var i=0;i0&&target!=player; + return target.countCards('h')>0&&target!=player; }, content:function(){ 'step 0' @@ -180,12 +180,12 @@ card.yunchou={ } 'step 1' if(event.directfalse||result.control=='选项二'){ - if(target.num('h')){ + if(target.countCards('h')){ if(!player.isUnderControl(true)){ target.showHandcards(); } else{ - game.log(target,'展示了',target.get('h')); + game.log(target,'展示了',target.getCards('h')); } player.discardPlayerCard(target,'h',true,'visible'); } @@ -227,7 +227,7 @@ card.yunchou={ } } 'step 1' - event.card2=target.get('h').randomGet(); + event.card2=target.getCards('h').randomGet(); if(event.card2){ target.discard(event.card2); } @@ -244,7 +244,7 @@ card.yunchou={ value:[3,1], result:{ target:function(player,target){ - return -2/Math.sqrt(1+target.num('h')); + return -2/Math.sqrt(1+target.countCards('h')); }, }, tag:{ @@ -259,7 +259,7 @@ card.yunchou={ type:'trick', enable:true, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, chongzhu:function(){ return game.countPlayer()<=2; @@ -308,7 +308,7 @@ card.yunchou={ content:function(){ 'step 0' var list=game.filterPlayer(function(current){ - return current!=target&¤t.num('h'); + return current!=target&¤t.countCards('h'); }); if(!list.length){ target.draw(3); @@ -324,7 +324,7 @@ card.yunchou={ event.current=event.list.shift(); event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){ if(ai.get.attitude(player,_status.event.source)>=0) return false; - var hs=player.get('h'); + var hs=player.getCards('h'); var dutag=player.hasSkillTag('nodu'); for(var i=0;i=7&&value<=6) return 1; @@ -505,7 +505,7 @@ card.yunchou={ type:'trick', filterTarget:true, content:function(){ - if(target.num('he')){ + if(target.countCards('he')){ player.gainPlayerCard('he',target,true); } }, @@ -568,7 +568,7 @@ card.yunchou={ type:'trick', enable:true, filterTarget:function(card,player,target){ - return player!=target&&target.get('h').length; + return player!=target&&target.countCards('h'); }, content:function(){ "step 0" @@ -590,11 +590,11 @@ card.yunchou={ order:4, result:{ target:function(player){ - if(player.get('h').length<=1) return 0; + if(player.countCards('h')<=1) return 0; return -1; }, player:function(player){ - if(player.get('h').length<=1) return 0; + if(player.countCards('h')<=1) return 0; return 0.5; } }, @@ -608,18 +608,18 @@ card.yunchou={ type:'trick', enable:true, filterTarget:function(card,player,target){ - return target.num('e'); + return target.countCards('e'); }, selectTarget:-1, content:function(){ - if(target.num('e')) target.chooseToDiscard('e',true); + if(target.countCards('e')) target.chooseToDiscard('e',true); }, reverseOrder:true, ai:{ order:9, result:{ target:function(player,target){ - if(target.num('e')) return -1; + if(target.countCards('e')) return -1; return 0; } }, @@ -634,7 +634,7 @@ card.yunchou={ type:'trick', enable:true, filterTarget:function(card,player,target){ - return target.num('h')>0; + return target.countCards('h')>0; }, selectTarget:2, multitarget:true, @@ -643,7 +643,7 @@ card.yunchou={ content:function(){ "step 0" target.addTempSkill('toulianghuanzhu2','phaseAfter'); - var hs=target.get('h'); + var hs=target.getCards('h'); event.num=Math.min(2,hs.length); if(event.num){ var gived=hs.randomGets(event.num); @@ -655,7 +655,7 @@ card.yunchou={ event.finish(); } "step 1" - if(event.addedTarget.num('h')){ + if(event.addedTarget.countCards('h')){ if(_status.auto&&event.addedTarget==game.me){ game.delay(); } @@ -679,7 +679,7 @@ card.yunchou={ result:{ target:function(player,target){ if(ui.selected.targets.length){ - if(target==player&&target.num('h')<=1) return 0; + if(target==player&&target.countCards('h')<=1) return 0; return 0.5; } if(target.hasSkill('toulianghuanzhu2')) return 0; @@ -824,15 +824,15 @@ card.yunchou={ fullskin:true, effect:function(){ if(result.judge){ - if(player.num('he')==0) player.loseHp(); + if(player.countCards('he')==0) player.loseHp(); else{ - player.discard(player.get('he').randomGets(3)); + player.discard(player.getCards('he').randomGets(3)); } var players=get.players(); for(var i=0;i0){ return -2; } - var nh=target.num('he'); + var nh=target.countCards('he'); if(target==player) nh--; switch(nh){ case 0:case 1:return -2; @@ -1047,7 +1047,7 @@ card.yunchou={ direct:true, filter:function(event,player){ if(event.player==player) return false; - if(!event.player.num('he')) return false; + if(!event.player.countCards('he')) return false; if(!lib.filter.targetEnabled({name:'chenhuodajie'},player,event.player)) return false; return player.hasCard('chenhuodajie'); }, diff --git a/card/zhenfa.js b/card/zhenfa.js index 9321746e5..aa4568dd8 100644 --- a/card/zhenfa.js +++ b/card/zhenfa.js @@ -73,7 +73,7 @@ card.zhenfa={ }); }, filterTarget:function(card,player,target){ - return target.isMajor()&&target.num('he')>0; + return target.isMajor()&&target.countCards('he')>0; }, selectTarget:-1, content:function(){ @@ -237,7 +237,7 @@ card.zhenfa={ return player.next.siege(player); }, filterTarget:function(card,player,target){ - if(target.get('he').length==0) return false; + if(target.getCards('he').length==0) return false; return target==player.next||target==player.previous; }, selectTarget:-1, diff --git a/character/diy.js b/character/diy.js index a1070affc..e69665dc1 100644 --- a/character/diy.js +++ b/character/diy.js @@ -146,7 +146,7 @@ character.diy={ filterCard:{type:'equip'}, check:function(card){ var player=_status.event.player; - var he=player.get('he'); + var he=player.getCards('he'); var subtype=get.subtype(card); var value=ai.get.equipValue(card); for(var i=0;i0){ - if(event.player.num('h')>=player.num('h')+2) return true; + if(event.player.countCards('h')>=player.countCards('h')+2) return true; return event.player.num('e',{subtype:subtype})==0; } else{ @@ -306,7 +306,7 @@ character.diy={ fuchou:{ trigger:{target:'shaBefore'}, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, direct:true, content:function(){ @@ -382,10 +382,10 @@ character.diy={ chezhen:{ mod:{ globalFrom:function(from,to,distance){ - if(from.num('e')) return distance-1; + if(from.countCards('e')) return distance-1; }, globalTo:function(from,to,distance){ - if(!to.num('e')) return distance+1; + if(!to.countCards('e')) return distance+1; } } }, @@ -420,7 +420,7 @@ character.diy={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('he')>0; + return target!=player&&target.countCards('he')>0; }, content:function(){ 'step 0' @@ -551,11 +551,11 @@ character.diy={ target:function(card,player,target,current){ if(card.name=='sha'&&player.storage.zhucheng&&player.storage.zhucheng.length){ if(player.storage.zhucheng.length>=2){ - if(!player.hasFriend()&&player.num('he')-2=2; + return player.countCards('h')>=2; } return true; }, @@ -679,7 +679,7 @@ character.diy={ num++; } } - return player.num('h')0; + return player.countCards('hej')>0; }, content:function(){ "step 0" @@ -1085,10 +1085,10 @@ character.diy={ var att=ai.get.attitude(trigger.player,player); var bool=0; if(att<0){ - if(trigger.player.num('e')==0&&trigger.player.num('h')>2) bool=1; - else if(trigger.player.num('he')==0) bool=1; + if(trigger.player.countCards('e')==0&&trigger.player.countCards('h')>2) bool=1; + else if(trigger.player.countCards('he')==0) bool=1; } - else if(att==0&&trigger.player.num('he')==0){ + else if(att==0&&trigger.player.countCards('he')==0){ bool=1; } trigger.player.chooseControl(function(){ @@ -1099,7 +1099,7 @@ character.diy={ player.draw(); event.finish(); } - else if(trigger.player.num('he')){ + else if(trigger.player.countCards('he')){ player.discardPlayerCard(trigger.player,true,'he'); } else{ @@ -1258,7 +1258,7 @@ character.diy={ "step 1" target.damage(); "step 2" - if(target.isAlive()&&target.num('he')){ + if(target.isAlive()&&target.countCards('he')){ player.discardPlayerCard(target); } }, diff --git a/character/extra.js b/character/extra.js index 786c54ba1..c0bb08361 100644 --- a/character/extra.js +++ b/character/extra.js @@ -168,7 +168,7 @@ character.extra={ "step 2" if(event.targets2.length){ var cur=event.targets2.shift(); - if(cur&&cur.num('he')){ + if(cur&&cur.countCards('he')){ cur.chooseToDiscard('he',true,4); } event.redo(); @@ -304,7 +304,7 @@ character.extra={ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.num('h')>0&&player.storage.renjie>0; + return player.countCards('h')>0&&player.storage.renjie>0; }, content:function(){ "step 0" @@ -418,7 +418,7 @@ character.extra={ result:{ player:function(player){ var num=0; - var cards=player.get('he'); + var cards=player.getCards('he'); for(var i=0;i0){ + if(current.countCards('j')&¤t!=player&&ai.get.attitude(player,current)>0){ return true; } }); @@ -544,7 +544,7 @@ character.extra={ player.line(targets,'green'); "step 1" if(num0){ + if(current.countCards('j')&¤t!=player&&ai.get.attitude(player,current)>0){ return true; } }); @@ -646,7 +646,7 @@ character.extra={ }, content:function(){ "step 0" - player.chooseCard('选择任意张手牌与星交换',[1,player.num('h')]).ai=function(card){ + player.chooseCard('选择任意张手牌与星交换',[1,player.countCards('h')]).ai=function(card){ return 1; }; "step 1" @@ -699,7 +699,7 @@ character.extra={ var att=ai.get.attitude(player,target); if(att>=4){ if(target.hp==1&&target.maxHp>2) return att; - if(target.hp==2&&target.maxHp>3&&target.num('he')==0) return att*0.7; + if(target.hp==2&&target.maxHp>3&&target.countCards('he')==0) return att*0.7; return 0; } return -1; @@ -1071,12 +1071,12 @@ character.extra={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('h'); + return target!=player&&target.countCards('h'); }, content:function(){ "step 0" event.videoId=lib.status.videoId++; - var cards=target.get('h'); + var cards=target.getCards('h'); if(player.isOnline2()){ player.send(function(cards,id){ ui.create.dialog('攻心',cards).videoId=id; @@ -1144,7 +1144,7 @@ character.extra={ threaten:1.5, result:{ target:function(player,target){ - return -target.num('h'); + return -target.countCards('h'); } }, order:10, diff --git a/character/gujian.js b/character/gujian.js index b7f14559c..2e3aefa38 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -38,7 +38,7 @@ character.gujian={ position:'he', viewAs:{name:'jiu'}, viewAsFilter:function(player){ - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; }, prompt:'将一张手牌或装备牌当酒使用', check:function(card){ @@ -88,12 +88,12 @@ character.gujian={ if(event.type!='dying') return false; if(player!=event.dying) return false; if(player.maxHp<=1) return false; - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; return true; }, alter:true, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0&&target.hp>0&&target.hp<=player.maxHp; + return target!=player&&target.countCards('h')>0&&target.hp>0&&target.hp<=player.maxHp; }, content:function(){ 'step 0' @@ -124,7 +124,7 @@ character.gujian={ skillTagFilter:function(player){ if(player.maxHp<=1) return false; if(player.hp>0) return false; - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; }, save:true, result:{ @@ -168,7 +168,7 @@ character.gujian={ }, filter:function(event,player){ if(!player.storage.yunyin) return true; - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;inanman) return name=='taoyuan'?1:0; return name=='nanman'?1:0; } - if(player.num('h')=2){ + if(player.countCards('h')=2){ return name=='wuzhong'?1:0; } if(player.hpplayer.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); + ((player.countCards('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); }, logTarget:'player', content:function(){ @@ -679,11 +679,11 @@ character.gujian={ trigger:{player:'phaseBegin'}, direct:true, filter:function(event,player){ - return player.num('h')>player.hp; + return player.countCards('h')>player.hp; }, content:function(){ "step 0" - var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.num('h')-player.hp)]); + var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.countCards('h')-player.hp)]); next.ai=function(card){ return 6-ai.get.value(card); } @@ -712,7 +712,7 @@ character.gujian={ return ai.get.attitude(player,event.source)<4; }, filter:function(event,player){ - return event.source&&event.source!=player&&event.source.num('h')>0; + return event.source&&event.source!=player&&event.source.countCards('h')>0; }, logTarget:'source', content:function(){ @@ -802,7 +802,7 @@ character.gujian={ if(player==target) return false; if(target.isLinked()) return true; if(target.isTurnedOver()) return true; - if(target.num('j')) return true; + if(target.countCards('j')) return true; if(target.hp==target.maxHp) return false; return target.isLowestHp(); }).ai=function(target){ @@ -815,7 +815,7 @@ character.gujian={ if(target.isTurnedOver()){ num+=5; } - if(target.num('j')){ + if(target.countCards('j')){ num+=2; } if(target.isLinked()){ @@ -844,7 +844,7 @@ character.gujian={ event.target.turnOver(); } "step 4" - var cards=event.target.get('j'); + var cards=event.target.getCards('j'); if(cards.length){ event.target.discard(cards); } @@ -862,7 +862,7 @@ character.gujian={ trigger:{player:'damageBegin'}, forced:true, filter:function(event,player){ - return player.num('h')==0&&event.num>=1; + return player.countCards('h')==0&&event.num>=1; }, content:function(){ if(trigger.num>=1){ @@ -876,7 +876,7 @@ character.gujian={ ai:{ effect:{ target:function(card,player,target){ - if(get.tag(card,'damage')&&target.num('h')==0){ + if(get.tag(card,'damage')&&target.countCards('h')==0){ if(player.hasSkillTag('jueqing')) return; return 0.1; } @@ -921,7 +921,7 @@ character.gujian={ qinglan:{ trigger:{global:'damageBefore'}, filter:function(event,player){ - return event.nature&&player.num('he')>0; + return event.nature&&player.countCards('he')>0; }, direct:true, priority:-5, @@ -1072,7 +1072,7 @@ character.gujian={ }, content:function(){ "step 0" - var cards=player.get('hej'); + var cards=player.getCards('hej'); player.discard(cards); "step 1" if(player.isLinked()) player.link(); @@ -1140,7 +1140,7 @@ character.gujian={ if(player.num('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } - if(player.num('h')player.hp+1) return 1; if(player.storage.xuanning>=2) return 0; if(num>player.hp) return 1 @@ -1256,13 +1256,13 @@ character.gujian={ forced:true, filter:function(event,player){ if(player.storage.xuanning){ - return (event.source&&event.source.num('he')>0); + return (event.source&&event.source.countCards('he')>0); } return false; }, logTarget:'source', content:function(){ - var he=trigger.source.get('he'); + var he=trigger.source.getCards('he'); if(he.length){ trigger.source.discard(he.randomGet()); } @@ -1311,7 +1311,7 @@ character.gujian={ return 8-ai.get.value(card); }; next.autochoose=function(){ - return this.player.num('he')==0; + return this.player.countCards('he')==0; }; event.current=target; } @@ -1351,7 +1351,7 @@ character.gujian={ ai:{ result:{ player:function(player){ - if(player.num('h')<=player.hp&&player.hp==player.maxHp){ + if(player.countCards('h')<=player.hp&&player.hp==player.maxHp){ return 0; } return 1; @@ -1513,7 +1513,7 @@ character.gujian={ if(card.name=='bingliang') return 0; if(card.name=='lebu') return 1.5; if(card.name=='guohe'){ - if(!target.num('e')) return 0; + if(!target.countCards('e')) return 0; return 0.5; } if(card.name=='liuxinghuoyu') return 0; @@ -1537,15 +1537,15 @@ character.gujian={ yuling2:{ trigger:{player:['loseEnd','drawEnd'],global:'gameDrawAfter'}, check:function(event,player){ - return player.num('h')<2; + return player.countCards('h')<2; }, priority:10, forced:true, filter:function(event,player){ - return player.num('h')<5; + return player.countCards('h')<5; }, content:function(){ - player.draw(5-player.num('h')); + player.draw(5-player.countCards('h')); } }, yuling3:{ @@ -1553,13 +1553,13 @@ character.gujian={ priority:10, forced:true, filter:function(event,player){ - return player.num('h')>5; + return player.countCards('h')>5; }, check:function(event,player){ - return player.num('h')<2; + return player.countCards('h')<2; }, content:function(){ - player.chooseToDiscard(true,player.num('h')-5); + player.chooseToDiscard(true,player.countCards('h')-5); } }, yuling4:{ diff --git a/character/gwent.js b/character/gwent.js index 09ab3ae40..3899b5a47 100644 --- a/character/gwent.js +++ b/character/gwent.js @@ -139,7 +139,7 @@ character.gwent={ kuanglie:{ trigger:{player:'useCardToBegin'}, filter:function(event,player){ - return event.target&&event.target!=player&&event.target.num('he')&&get.color(event.card)=='black'; + return event.target&&event.target!=player&&event.target.countCards('he')&&get.color(event.card)=='black'; }, init:function(player){ player.storage.kuanglie=0; @@ -158,7 +158,7 @@ character.gwent={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('he'); + return target!=player&&target.countCards('he'); }, selectTarget:[1,Infinity], content:function(){ @@ -208,7 +208,7 @@ character.gwent={ 'step 1' if(event.list.length){ var current=event.list.shift(); - var he=current.get('he'); + var he=current.getCards('he'); player.line(current,'green'); if(he.length){ current.discard(he.randomGet()); @@ -236,7 +236,7 @@ character.gwent={ } var player=_status.event.player; if(player.isDamaged()){ - var hs=player.get('h'); + var hs=player.getCards('h'); var num=0; for(var i=0;icurrent.hp; + return current.countCards('h')>current.hp; }); }, logTarget:function(){ return game.filterPlayer(function(current){ - return current.num('h')>current.hp; + return current.countCards('h')>current.hp; }).sortBySeat(); }, content:function(){ 'step 0' var list=game.filterPlayer(function(current){ - return current.num('h')>current.hp; + return current.countCards('h')>current.hp; }).sortBySeat(); event.list=list; 'step 1' @@ -540,7 +540,7 @@ character.gwent={ trigger:{player:'shaBegin'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ 'step 0' @@ -573,11 +573,11 @@ character.gwent={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' - var hs=target.get('h'); + var hs=target.getCards('h'); player.gain(hs,target); target.$giveAuto(hs,player); event.hs=hs; @@ -618,7 +618,7 @@ character.gwent={ order:11, result:{ target:function(player,target){ - return -Math.sqrt(target.num('h')); + return -Math.sqrt(target.countCards('h')); } } } @@ -627,11 +627,11 @@ character.gwent={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target.num('h')!=Math.min(3,player.hp); + return target.countCards('h')!=Math.min(3,player.hp); }, selectTarget:[1,3], content:function(){ - var dh=Math.min(3,player.hp)-target.num('h'); + var dh=Math.min(3,player.hp)-target.countCards('h'); if(dh>0){ target.draw(dh,false); target.$draw(dh); @@ -646,7 +646,7 @@ character.gwent={ order:11, result:{ target:function(player,target){ - var dh=Math.min(3,player.hp)-target.num('h'); + var dh=Math.min(3,player.hp)-target.countCards('h'); if(dh<0){ dh+=get.sgn(ai.get.effect(target,{name:'sha'},player,target)); } @@ -661,9 +661,9 @@ character.gwent={ content:function(){ 'step 0' player.chooseTarget(get.prompt('hunmo'),[1,game.countPlayer()],function(card,player,target){ - return target.num('h')!=Math.min(3,target.hp); + return target.countCards('h')!=Math.min(3,target.hp); }).ai=function(target){ - return ai.get.attitude(player,target)*(Math.min(3,target.hp)-target.num('h')); + return ai.get.attitude(player,target)*(Math.min(3,target.hp)-target.countCards('h')); } 'step 1' if(result.bool){ @@ -677,7 +677,7 @@ character.gwent={ 'step 2' if(event.targets.length){ var target=event.targets.shift(); - var dh=Math.min(3,target.hp)-target.num('h'); + var dh=Math.min(3,target.hp)-target.countCards('h'); if(dh>0){ target.draw(dh,false); target.$draw(dh); diff --git a/character/hearth.js b/character/hearth.js index ad8dd0cfd..56cc14cf6 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -176,16 +176,16 @@ character.hearth={ filter:function(event,player){ return game.hasPlayer(function(current){ if(current==player) return false; - var nh=current.num('h'); - return nh&&nh>=player.num('h'); + var nh=current.countCards('h'); + return nh&&nh>=player.countCards('h'); }); }, content:function(){ 'step 0' player.chooseTarget(get.prompt('kuixin'),function(card,player,target){ if(target==player) return false; - var nh=target.num('h'); - return nh&&nh>=player.num('h'); + var nh=target.countCards('h'); + return nh&&nh>=player.countCards('h'); }).ai=function(target){ var att=ai.get.attitude(player,target); if(target.hasSkillTag('noe')){ @@ -196,7 +196,7 @@ character.hearth={ 'step 1' if(result.bool){ var target=result.targets[0]; - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); if(card){ player.logSkill('kuixin',target); player.gain(card,target); @@ -256,7 +256,7 @@ character.hearth={ trigger:{player:'phaseUseBegin'}, forced:true, filter:function(event,player){ - return player.storage.fuhua2.isIn()&&player.num('he')>0; + return player.storage.fuhua2.isIn()&&player.countCards('he')>0; }, mark:'character', intro:{ @@ -319,10 +319,10 @@ character.hearth={ trigger:{player:'phaseEnd'}, forced:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i0&&!player.isTurnedOver(); + return player.countCards('h')>0&&!player.isTurnedOver(); }, content:function(){ 'step 0' player.chooseTarget(get.prompt('gfuhun'),function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }).ai=function(target){ return -ai.get.attitude(player,target); } @@ -469,7 +469,7 @@ character.hearth={ longyi:{ mod:{ maxHandcard:function(player,num){ - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;inh; + return current.countCards('h')>nh; }); player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){ - return target.num('h')>nh; + return target.countCards('h')>nh; }).ai=function(target){ return 0.5-ai.get.attitude(player,target); } @@ -1053,7 +1053,7 @@ character.hearth={ if(!info) return 0; if(!Array.isArray(info.names)) return 0; var names=info.names; - if(names.contains('xingjiegoutong')&&target.num('h')>=3) return -1; + if(names.contains('xingjiegoutong')&&target.countCards('h')>=3) return -1; var num=0; for(var i=0;i0; + return event.target.countCards('h')>0; }, content:function(){ - player.gain(game.createCard(trigger.target.get('h').randomGet()),'draw'); + player.gain(game.createCard(trigger.target.getCards('h').randomGet()),'draw'); } }, miss:{ @@ -1156,10 +1156,10 @@ character.hearth={ return ai.get.attitude(player,event.source)<=0; }, filter:function(event,player){ - return event.source&&event.source.isAlive()&&event.source!=player&&event.source.num('h')>0; + return event.source&&event.source.isAlive()&&event.source!=player&&event.source.countCards('h')>0; }, content:function(){ - var card=trigger.source.get('h').randomGet(); + var card=trigger.source.getCards('h').randomGet(); if(card){ player.gain(card,trigger.source); if(get.color(card)=='black'){ @@ -1179,7 +1179,7 @@ character.hearth={ target:function(card,player,target){ if(player.hasSkillTag('jueqing')) return [1,-2]; if(!target.hasFriend()) return false; - if(get.tag(card,'damage')&&player.num('h')>1) return [1,0,0,-1]; + if(get.tag(card,'damage')&&player.countCards('h')>1) return [1,0,0,-1]; } } } @@ -1369,7 +1369,7 @@ character.hearth={ wzhanyi:{ trigger:{player:'phaseUseBefore'}, check:function(event,player){ - return player.num('h')+2<=player.hp; + return player.countCards('h')+2<=player.hp; }, content:function(){ 'step 0' @@ -1975,7 +1975,7 @@ character.hearth={ tanmi:{ trigger:{global:'phaseEnd'}, filter:function(event,player){ - return player.num('h')==0&&event.player!=player; + return player.countCards('h')==0&&event.player!=player; }, frequent:true, content:function(){ @@ -1992,7 +1992,7 @@ character.hearth={ noh:true, skillTagFilter:function(player,tag){ if(tag=='noh'){ - if(player.num('h')!=1) return false; + if(player.countCards('h')!=1) return false; } } } @@ -2205,7 +2205,7 @@ character.hearth={ usable:1, filter:function(event,player){ if(player.hp==player.maxHp) return false; - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length==0) return false; var types=[]; for(var i=0;i=3; + return player.countCards('he')>=3; }, content:function(){ 'step 0' @@ -2403,7 +2403,7 @@ character.hearth={ direct:true, trigger:{player:'phaseBegin'}, filter:function(event,player){ - var hs=player.get('he'); + var hs=player.getCards('he'); for(var i=0;i=3) return false; for(var i=0;i0; + return player.countCards('he')>0; }, filterTarget:function(card,player,target){ if(get.color(card)=='red'){ @@ -2645,7 +2645,7 @@ character.hearth={ trigger:{player:'useCardToBegin'}, direct:true, filter:function(event,player){ - return event.target&&event.target!=player&&get.distance(player,event.target)>1&&event.target.num('he')>0; + return event.target&&event.target!=player&&get.distance(player,event.target)>1&&event.target.countCards('he')>0; }, content:function(){ player.discardPlayerCard(trigger.target,get.prompt('yuanzheng',trigger.target),'hej').logSkill=['yuanzheng',trigger.target]; @@ -2738,7 +2738,7 @@ character.hearth={ player.unmarkSkill('byuhuo'); 'step 1' if(num0; + return player.countCards('h')>0; }, content:function(){ 'step 0' - var nh=player.num('h'); + var nh=player.countCards('h'); if(nh){ player.draw(nh); } @@ -2840,7 +2840,7 @@ character.hearth={ event.finish(); } 'step 1' - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length>10&&hs.length>player.hp){ player.discard(hs.randomGets(hs.length-player.hp)); } @@ -2853,7 +2853,7 @@ character.hearth={ if(get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-2]; if(!target.hasFriend()) return; - var nh=target.num('h'); + var nh=target.countCards('h'); if(nh>5) return [1,-1]; if(nh<=1) return [1,-0.1]; if(nh==2){ @@ -2924,15 +2924,15 @@ character.hearth={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('e')>0; + return player!=target&&target.countCards('e')>0; }, filter:function(event,player){ return game.hasPlayer(function(target){ - return target!=player&&target.num('e'); + return target!=player&&target.countCards('e'); }); }, content:function(){ - var es=target.get('e'); + var es=target.getCards('e'); if(es.length>1){ es=es.randomGets(Math.ceil(Math.random()*2)); } @@ -2942,7 +2942,7 @@ character.hearth={ order:9.5, result:{ target:function(player,target){ - var ne=target.num('e'); + var ne=target.countCards('e'); if(ne>1) return -1.5; return -1; } @@ -2982,7 +2982,7 @@ character.hearth={ }, filter:function(event,player){ return typeof event.player.storage.shixu=='number'&& - event.player.storage.shixu>3000&&event.player.num('he')>0&&event.player.isAlive(); + event.player.storage.shixu>3000&&event.player.countCards('he')>0&&event.player.isAlive(); }, content:function(){ player.line(trigger.player,'green'); @@ -3108,7 +3108,7 @@ character.hearth={ 'step 1' if(event.targets.length){ var target=event.targets.shift(); - if(!target.isTurnedOver()&&target.num('he')){ + if(!target.isTurnedOver()&&target.countCards('he')){ target.chooseToDiscard(true); } event.redo(); @@ -3151,17 +3151,17 @@ character.hearth={ trigger:{player:'damageEnd'}, forced:true, filter:function(event,player){ - return player.num('he')>0||(event.source&&event.source.num('he')>0); + return player.countCards('he')>0||(event.source&&event.source.countCards('he')>0); }, content:function(){ 'step 0' - var hs=player.get('he'); + var hs=player.getCards('he'); if(hs.length){ player.discard(hs.randomGet()) } 'step 1' if(trigger.source){ - var hs=trigger.source.get('he'); + var hs=trigger.source.getCards('he'); if(hs.length){ trigger.source.discard(hs.randomGet()) } @@ -3279,7 +3279,7 @@ character.hearth={ }); }, content:function(){ - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i0){ if(num>3){ num=3; @@ -3472,7 +3472,7 @@ character.hearth={ for(var i=0;inum){ if(att>0){ max=true; @@ -3488,7 +3488,7 @@ character.hearth={ }, result:{ player:function(player,target){ - return (player.num('h')-target.num('h'))*ai.get.attitude(player,target); + return (player.countCards('h')-target.countCards('h'))*ai.get.attitude(player,target); } }, expose:0.2 @@ -3511,7 +3511,7 @@ character.hearth={ content:function(){ 'step 0' player.hp=Math.min(player.storage.chongsheng,player.maxHp); - player.discard(player.get('hej')); + player.discard(player.getCards('hej')); player.draw(player.storage.chongsheng); player.storage.chongsheng--; if(player.storage.chongsheng<=0){ @@ -3545,13 +3545,13 @@ character.hearth={ usable:1, alter:true, filter:function(event,player){ - return player.num('h')<(get.is.altered('guozai')?3:4); + return player.countCards('h')<(get.is.altered('guozai')?3:4); }, init:function(player){ player.storage.guozai2=0; }, content:function(){ - var num=(get.is.altered('guozai')?3:4)-player.num('h'); + var num=(get.is.altered('guozai')?3:4)-player.countCards('h'); player.draw(num); player.addSkill('guozai2'); player.storage.guozai2+=num; @@ -3581,13 +3581,13 @@ character.hearth={ enable:'phaseUse', usable:2, filter:function(event,player){ - return player.num('h')<4; + return player.countCards('h')<4; }, init:function(player){ player.storage.guozaix2=0; }, content:function(){ - var num=4-player.num('h'); + var num=4-player.countCards('h'); player.draw(num); player.addSkill('guozaix2'); player.storage.guozaix2+=num; @@ -3780,17 +3780,17 @@ character.hearth={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - var nh=player.num('h'); + var nh=player.countCards('h'); var nm=1; return game.hasPlayer(function(current){ - if(current!=player&&Math.abs(current.num('h')-nh)<=nm){ + if(current!=player&&Math.abs(current.countCards('h')-nh)<=nm){ return true; } }); }, content:function(){ 'step 0' - var nh=player.num('h'); + var nh=player.countCards('h'); var nm=1; var check=true; if(player.num('h','tao')){ @@ -3800,11 +3800,11 @@ character.hearth={ check=false; } player.chooseTarget(get.prompt('kuixin'),function(card,player,target){ - return target!=player&&Math.abs(target.num('h')-nh)<=nm; + return target!=player&&Math.abs(target.countCards('h')-nh)<=nm; }).ai=function(target){ if(!check) return 0; if(ai.get.attitude(player,target)<0){ - return target.num('h')-nh; + return target.countCards('h')-nh; } return 0; }; @@ -3812,8 +3812,8 @@ character.hearth={ if(result.bool){ var target=result.targets[0]; player.logSkill('kuixin',result.targets); - var cards0=target.get('h'); - var cards1=player.get('h'); + var cards0=target.getCards('h'); + var cards1=player.getCards('h'); target.gain(cards1,player); player.gain(cards0,target); target.$give(cards0.length,player); @@ -3875,7 +3875,7 @@ character.hearth={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h',{type:'basic'})player.num('h'); + return player.hp>player.countCards('h'); }, threaten:function(player,target){ if(!target.hujia) return 0.8; @@ -4015,7 +4015,7 @@ character.hearth={ trigger:{player:'loseEnd'}, direct:true, filter:function(event,player){ - return _status.currentPhase!=player&&!player.hasSkill('fengxing2')&&player.num('he')>0; + return _status.currentPhase!=player&&!player.hasSkill('fengxing2')&&player.countCards('he')>0; }, content:function(){ 'step 0' @@ -4039,7 +4039,7 @@ character.hearth={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target.num('h')>0; + return target.countCards('h')>0; }, selectTarget:-1, content:function(){ @@ -4049,7 +4049,7 @@ character.hearth={ order:8, result:{ target:function(player,target){ - var nh=target.num('h'); + var nh=target.countCards('h'); switch(nh){ case 0:return 0; case 1:return -1.5; @@ -4083,10 +4083,10 @@ character.hearth={ forced:true, priority:-1, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ - player.discard(player.get('he')); + player.discard(player.getCards('he')); player.removeSkill('hsmengjing_mengye'); }, mark:'image', @@ -4124,13 +4124,13 @@ character.hearth={ direct:true, filter:function(event,player){ return game.hasPlayer(function(current){ - return current!=player&¤t.num('h'); + return current!=player&¤t.countCards('h'); }); }, content:function(){ 'step 0' player.chooseTarget(get.prompt('shijie'),function(card,player,target){ - return player!=target&&target.num('h')>0; + return player!=target&&target.countCards('h')>0; }).ai=function(target){ return 11-ai.get.attitude(player,target); }; @@ -4138,7 +4138,7 @@ character.hearth={ if(result.bool){ player.logSkill('shijie',result.targets); var target=result.targets[0]; - var card=target.get('h').randomGet() + var card=target.getCards('h').randomGet() player.gain(card,target); event.target=target; target.$giveAuto(card,player); @@ -4179,7 +4179,7 @@ character.hearth={ target:function(player,target){ if(player.storage.anying) return -1; if(target.hp==1) return 5; - if(player==target&&player.num('h')>player.hp) return 5; + if(player==target&&player.countCards('h')>player.hp) return 5; return 2; } }, @@ -4252,7 +4252,7 @@ character.hearth={ if(!event.targets) return false; if(event.targets.length!=1) return false; if(event.targets[0]==event.player) return false; - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i0; + return !player.storage.jihuo&&player.countCards('h')>0; }, direct:true, priority:-50, @@ -4783,7 +4783,7 @@ character.hearth={ game.delay(0.5); var target=result.targets[0]; player.logSkill('tzhenji',target,'thunder'); - var cs=target.get('he'); + var cs=target.getCards('he'); if(cs.length){ target.discard(cs.randomGet()); } @@ -4796,7 +4796,7 @@ character.hearth={ expose:0.3, effect:{ target:function(card,player,target){ - if(get.tag(card,'loseCard')&&target.num('he')){ + if(get.tag(card,'loseCard')&&target.countCards('he')){ return 0.7; } } @@ -4830,11 +4830,11 @@ character.hearth={ } else{ event.target.damage('thunder'); - var cs=event.target.get('he'); + var cs=event.target.getCards('he'); if(cs.length){ event.target.discard(cs.randomGet()); } - cs=player.get('he'); + cs=player.getCards('he'); if(cs.length){ player.discard(cs.randomGet()); } @@ -4850,7 +4850,7 @@ character.hearth={ return ai.get.attitude(player,current)<0; }); var ns=target.num('h','shan'); - var nh=target.num('h'); + var nh=target.countCards('h'); if(ns>1){ return [0,hastarget?1:0]; } @@ -5254,7 +5254,7 @@ character.hearth={ order:4, result:{ player:function(player){ - var nh=player.num('h'); + var nh=player.countCards('h'); if(nh>=player.hp) return -1; if(player.hp<=2){ if(player.hp==2&&nh==0) return 1; @@ -5310,12 +5310,12 @@ character.hearth={ enable:true, derivation:'hs_aya', filterTarget:function(card,player,target){ - return target.num('he')>0; + return target.countCards('he')>0; }, content:function(){ var cards=[]; - var hs=target.get('h'); - var es=target.get('e'); + var hs=target.getCards('h'); + var es=target.getCards('e'); if(hs.length) cards.push(hs.randomGet()); if(es.length) cards.push(es.randomGet()); target.discard(cards); @@ -5327,8 +5327,8 @@ character.hearth={ result:{ target:function(player,target){ var num=0; - if(target.num('h')) num--; - if(target.num('e')) num--; + if(target.countCards('h')) num--; + if(target.countCards('e')) num--; return num; }, }, @@ -5429,17 +5429,17 @@ character.hearth={ enable:true, derivation:'hs_xialikeer', filterTarget:function(card,player,target){ - return target.num('e')>0; + return target.countCards('e')>0; }, content:function(){ - target.discard(target.get('e').randomGets(2)); + target.discard(target.getCards('e').randomGets(2)); }, ai:{ order:5, result:{ target:function(player,target){ if(target.hasSkillTag('noe')) return 0; - if(target.num('e')>1) return -1.5; + if(target.countCards('e')>1) return -1.5; return -1; }, }, @@ -5468,7 +5468,7 @@ character.hearth={ num=1.5; } if(target.hp==1) return 2*num; - if(target.hp==2&&target.num('h')<=2) return 1.2*num; + if(target.hp==2&&target.countCards('h')<=2) return 1.2*num; return num; } }, @@ -5539,7 +5539,7 @@ character.hearth={ result:{ target:function(player,target){ if(target.hp>1){ - if(target.num('h')>2) return 1; + if(target.countCards('h')>2) return 1; return 0.5; } return 0.2; @@ -5584,7 +5584,7 @@ character.hearth={ content:function(){ player.recover(); player.draw(3); - // var hs=target.get('h'); + // var hs=target.getCards('h'); // target.discard(hs); // var cs=[]; // for(var i=0;i1) return 1; + if(player.countCards('h')>1) return 1; if(player.hp==1) return 1; return 0; } @@ -5631,7 +5631,7 @@ character.hearth={ result:{ target:function(player,target){ if(target.hp<=1) return 2; - if(target.num('h')0; + return target!=player&&target.countCards('hej')>0; }, selectTarget:-1, content:function(){ - if(target.num('hej')) player.gainPlayerCard(target,'hej',true,Math.ceil(Math.random()*2)); + if(target.countCards('hej')) player.gainPlayerCard(target,'hej',true,Math.ceil(Math.random()*2)); }, contentAfter:function(){ if(!player.isTurnedOver()){ @@ -5740,7 +5740,7 @@ character.hearth={ selectTarget:-1, content:function(){ target.loseHp(); - var he=target.get('he'); + var he=target.getCards('he'); if(he.length){ target.discard(he.randomGets(2)); } @@ -5772,7 +5772,7 @@ character.hearth={ result:{ target:function(player,target){ if(target.hasSkill('hsmengjing_mengye')) return 0.5; - return -target.num('he'); + return -target.countCards('he'); } } } @@ -5784,11 +5784,11 @@ character.hearth={ enable:true, derivation:'hs_ysera', filterTarget:function(card,player,target){ - return !target.num('j','lebu')||target.num('e')>0; + return !target.num('j','lebu')||target.countCards('e')>0; }, content:function(){ 'step 0' - var es=target.get('e'); + var es=target.getCards('e'); if(es.length){ target.gain(es,'gain2'); } @@ -5803,7 +5803,7 @@ character.hearth={ value:10, result:{ target:function(player,target){ - var num=target.hp-target.num('he')-2; + var num=target.hp-target.countCards('he')-2; if(num>-1) return -1; if(target.hp<3) num--; if(target.hp<2) num--; diff --git a/character/jiange.js b/character/jiange.js index cf1b02176..3f900a4d4 100644 --- a/character/jiange.js +++ b/character/jiange.js @@ -62,7 +62,7 @@ character.jiange={ forced:true, filter:function(event,player){ for(var i=0;i0&&event.player!=player&&event.player.hp0&&event.player!=player&&event.player.hp0){ player.draw(num); @@ -235,7 +235,7 @@ character.jiange={ "step 0" game.delay(0.5); player.chooseTarget(get.prompt('juechen'),function(card,player,target){ - return player!=target&&!trigger.targets.contains(target)&&target.num('he')>0; + return player!=target&&!trigger.targets.contains(target)&&target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); } @@ -265,7 +265,7 @@ character.jiange={ "step 1" if(get.color(event.cards[0])!=get.color(event.cards[1])){ player.chooseTarget('是否弃置一名角色一张牌?',function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); } @@ -383,7 +383,7 @@ character.jiange={ trigger:{global:'useCardAfter'}, direct:true, filter:function(event,player){ - return event.player!=player&&event.card.name=='wuxie'&&event.player.num('he')>0; + return event.player!=player&&event.card.name=='wuxie'&&event.player.countCards('he')>0; }, content:function(){ "step 0" @@ -435,7 +435,7 @@ character.jiange={ if(target==player) return 0.1; } var att=ai.get.attitude(player,target); - if(player.num('h')>player.hp){ + if(player.countCards('h')>player.hp){ if(target==player) return Math.max(1,att-2); } if(target==player) return att+5; diff --git a/character/old.js b/character/old.js index ddfef3adb..4339c5a84 100644 --- a/character/old.js +++ b/character/old.js @@ -27,16 +27,16 @@ character.old={ if(event.responded) return false; if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false; if(player.hasSkill('zhenshan2')) return false; - var nh=player.num('h'); + var nh=player.countCards('h'); return game.hasPlayer(function(current){ - return current!=player&¤t.num('h')0&¤t.num('h')0&¤t.countCards('h')=2; + return player.countCards('he')>=2; }, content:function(){ player.changeHujia(2); @@ -252,7 +252,7 @@ character.ow={ dianji:{ enable:'phaseUse', filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterCard:true, usable:1, @@ -275,7 +275,7 @@ character.ow={ trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ 'step 0' @@ -289,7 +289,7 @@ character.ow={ ai2:function(target){ var att=ai.get.attitude(player,target); if(att>=0) return 0; - if(!target.num('he')) return -0.01; + if(!target.countCards('he')) return -0.01; var dist=get.distance(player,target); if(dist>2){ att-=2; @@ -690,7 +690,7 @@ character.ow={ filter:function(event,player){ if(player.storage.qinru){ for(var i=0;i0; + return target.countCards('he')>0; }); if(targets.length){ event.targets=targets.randomGets(3); @@ -971,7 +971,7 @@ character.ow={ 'step 1' if(event.targets.length){ var target=event.targets.shift(); - var he=target.get('he'); + var he=target.getCards('he'); if(he.length){ target.discard(he.randomGet()); } @@ -991,7 +991,7 @@ character.ow={ usable:1, alter:true, filter:function(event,player){ - return player.num('h')>=1; + return player.countCards('h')>=1; }, filterTarget:function(card,player,target){ return target!=player; @@ -1045,7 +1045,7 @@ character.ow={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterCard:true, check:function(card){ @@ -1175,15 +1175,15 @@ character.ow={ tiandan:{ trigger:{player:'phaseDrawBegin'}, filter:function(event,player){ - return Math.min(5,player.hp)>player.num('h')&&!player.skipList.contains('phaseUse')&&!player.skipList.contains('phaseDiscard'); + return Math.min(5,player.hp)>player.countCards('h')&&!player.skipList.contains('phaseUse')&&!player.skipList.contains('phaseDiscard'); }, check:function(event,player){ - var nh=player.num('h'); + var nh=player.countCards('h'); if(Math.min(5,player.hp)-nh>=2) return true; return false; }, content:function(){ - var num=Math.min(5,player.hp)-player.num('h'); + var num=Math.min(5,player.hp)-player.countCards('h'); var cards=[]; while(num--){ cards.push(game.createCard('sha')); @@ -1214,7 +1214,7 @@ character.ow={ order:7.9, result:{ target:function(player,target){ - var nh=target.num('h'); + var nh=target.countCards('h'); if(ai.get.attitude(player,target)<0&&nh>=3&& player.canUse('sha',target)&&player.num('h','sha')&& ai.get.effect(target,{name:'sha'},player,player)>0){ @@ -1283,7 +1283,7 @@ character.ow={ } 'step 1' if(!get.is.altered('baoxue')){ - var he=target.get('he'); + var he=target.getCards('he'); if(he.length){ target.discard(he.randomGet()); } @@ -1317,7 +1317,7 @@ character.ow={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, filterTarget:function(card,player,target){ return target!=player&&!target.hasSkill('mianzhen2'); @@ -1337,7 +1337,7 @@ character.ow={ order:2.2, result:{ target:function(player,target){ - return Math.min(-0.1,-1-target.num('h')+Math.sqrt(target.hp)/2); + return Math.min(-0.1,-1-target.countCards('h')+Math.sqrt(target.hp)/2); } } } @@ -1418,7 +1418,7 @@ character.ow={ }, forced:true, filter:function(event,player){ - return player.num('h')==event.player.num('h')&&event.notLink(); + return player.countCards('h')==event.player.countCards('h')&&event.notLink(); }, content:function(){ trigger.num++; @@ -1442,7 +1442,7 @@ character.ow={ usable:1, position:'he', filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, filterCard:function(card){ var suit=get.suit(card); @@ -1453,7 +1453,7 @@ character.ow={ }, complexCard:true, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, check:function(card){ if(ui.selected.cards.length>1) return 0; @@ -1486,7 +1486,7 @@ character.ow={ result:{ target:function(player,target){ if(!player.num('h','sha')) return 0; - if(target.num('h')<=1&&get.distance(player,target,'attack')<=1) return 0; + if(target.countCards('h')<=1&&get.distance(player,target,'attack')<=1) return 0; var min=[]; var num=0; var players=game.filterPlayer(); @@ -1502,7 +1502,7 @@ character.ow={ } for(var i=0;i0) return 0; - if(min[i].num('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0; + if(min[i].countCards('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0; } if(min.contains(target)) return -1; return 0; @@ -1585,7 +1585,7 @@ character.ow={ game.addVideo('storage',player,['dulei',null]); trigger.player.loseHp(); 'step 2' - var he=trigger.player.get('he'); + var he=trigger.player.getCards('he'); if(he.length){ trigger.player.discard(he.randomGet()); } @@ -1796,7 +1796,7 @@ character.ow={ trigger:{global:'phaseBegin'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ 'step 0' @@ -1810,7 +1810,7 @@ character.ow={ if(Math.random()<0.5) goon=true; } if(Math.random()<0.3) goon2=true; - player.chooseToDiscard([1,player.num('h')],'he',get.prompt('bingqiang',trigger.player)).set('logSkill',['bingqiang',trigger.player]).ai=function(card){ + player.chooseToDiscard([1,player.countCards('h')],'he',get.prompt('bingqiang',trigger.player)).set('logSkill',['bingqiang',trigger.player]).ai=function(card){ if(ui.selected.cards.length) return 0; if(goon) return 6-ai.get.value(card); if(goon2) return 4-ai.get.value(card); @@ -2096,7 +2096,7 @@ character.ow={ 'step 0' var num=player.storage.jijia; if(get.is.altered('zihui')){ - num=Math.max(1,Math.min(num,target.num('he'))); + num=Math.max(1,Math.min(num,target.countCards('he'))); } target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌,或受到2点火焰伤害').ai=function(card){ if(target.hasSkillTag('nofire')) return 0; @@ -2124,7 +2124,7 @@ character.ow={ var players=game.filterPlayer(); for(var i=0;i2) continue; - var nh=players[i].num('h'); + var nh=players[i].countCards('h'); var att=ai.get.attitude(player,players[i]); if(nh2; + var dis=trigger.target.num('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); @@ -2296,7 +2296,7 @@ character.ow={ 'step 0' player.discardPlayerCard(get.prompt('mujing'),trigger.target).logSkill=['mujing']; 'step 1' - if(result.bool&&player.num('h')<=trigger.target.num('h')){ + if(result.bool&&player.countCards('h')<=trigger.target.countCards('h')){ player.draw(); } } @@ -2315,13 +2315,13 @@ character.ow={ }, filter:function(event,player){ if(player.storage.zhanlong) return false; - if(player.num('he')==0) return false; + if(player.countCards('he')==0) return false; if(player.hp!=1) return false; return true; }, content:function(){ 'step 0' - player.discard(player.get('he')); + player.discard(player.getCards('he')); 'step 1' player.addTempSkill('zhanlong2','phaseAfter'); player.awakenSkill('zhanlong'); @@ -2340,7 +2340,7 @@ character.ow={ effect:{ target:function(card,player,target){ if(!target.hasFriend()) return; - if(get.tag(card,'damage')==1&&target.hp==2&&target.num('he')&& + if(get.tag(card,'damage')==1&&target.hp==2&&target.countCards('he')&& !target.isTurnedOver()&&_status.currentPhase!=target){ if(get.distance(_status.currentPhase,target,'absolute')<=2) return [0.5,1]; return 0.8; @@ -2831,7 +2831,7 @@ character.ow={ trigger:{source:'damageAfter'}, direct:true, filter:function(event,player){ - if(player.num('he')==0) return false; + if(player.countCards('he')==0) return false; if(!event.card) return false; if(event.card.name!='sha') return false; return game.hasPlayer(function(current){ @@ -2889,7 +2889,7 @@ character.ow={ if(player.storage.yuedong_recover){ return ai.get.recoverEffect(target,player,player); } - var att=ai.get.attitude(player,target)/Math.sqrt(2+target.num('h')); + var att=ai.get.attitude(player,target)/Math.sqrt(2+target.countCards('h')); if(player==target){ var num2=player.needsToDiscard(num); if(num2>1) return att/5; @@ -2927,7 +2927,7 @@ character.ow={ selectCard:2, position:'he', filter:function(event,player){ - return player.num('he')>1&&!player.storage.yuedong_recover; + return player.countCards('he')>1&&!player.storage.yuedong_recover; }, check:function(card){ return 6-ai.get.value(card); @@ -2973,7 +2973,7 @@ character.ow={ filter:function(event,player){ if(get.is.altered('kuoyin')&&player.storage.yuedong_num) return false; if(player.storage.yuedong_eff&&player.storage.yuedong_num) return false; - return player.num('he')>0; + return player.countCards('he')>0; }, check:function(card){ var player=_status.event.player; @@ -3048,7 +3048,7 @@ character.ow={ return 6-ai.get.value(card); }, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, filterTarget:function(card,player,target){ return !target.hasSkill('guangshu_heart')&& @@ -3070,8 +3070,8 @@ character.ow={ if(!ui.selected.cards.length) return 0; 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.num('h')); - case 'club':return -target.num('h')-Math.sqrt(target.num('h','sha')); + case 'diamond':return 1+Math.sqrt(target.countCards('h')); + case 'club':return -target.countCards('h')-Math.sqrt(target.num('h','sha')); case 'spade':return ai.get.damageEffect(target,player,target,'thunder'); default:return 0; } @@ -3179,7 +3179,7 @@ character.ow={ }, check:function(event,player){ return ai.get.attitude(player,event.player)<0&& - ((player.num('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); + ((player.countCards('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); }, alter:true, intro:{ @@ -3233,8 +3233,8 @@ character.ow={ player.$draw(); } "step 1" - player.storage.shanxian_h=player.get('h'); - player.storage.shanxian_e=player.get('e'); + player.storage.shanxian_h=player.getCards('h'); + player.storage.shanxian_e=player.getCards('e'); player.storage.shanxian_n=1; player.syncStorage('shanxian_e'); player.phase(); @@ -3275,7 +3275,7 @@ character.ow={ player.storage.shanxian_n>0&&!player.hasSkill('shanxian2'); }, check:function(event,player){ - var n1=player.num('he'); + var n1=player.countCards('he'); var n2=player.storage.shanxian_h.length+player.storage.shanxian_e.length; if(n1=Math.max(2,player.num('h')-player.hp)) return 0; - if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){ + if(ui.selected.cards.length>=Math.max(2,player.countCards('h')-player.hp)) return 0; + if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){ var players=game.filterPlayer(); for(var i=0;iplayer.hp) return 10-ai.get.value(card); - if(player.num('h')>2) return 6-ai.get.value(card); + if(player.countCards('h')>player.hp) return 10-ai.get.value(card); + if(player.countCards('h')>2) return 6-ai.get.value(card); return -1; } return 10-ai.get.value(card); @@ -159,7 +159,7 @@ character.refresh={ }, ai:{ order:function(skill,player){ - if(player.hp1){ + if(player.hp1){ return 10; } return 4; @@ -171,9 +171,9 @@ character.refresh={ return -10; } if(target.num('j','lebu')) return 0; - var nh=target.num('h'); - var np=player.num('h'); - if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){ + var nh=target.countCards('h'); + var np=player.countCards('h'); + if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){ if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0; } return Math.max(1,5-nh); @@ -210,7 +210,7 @@ character.refresh={ trigger:{source:'damageEnd'}, forced:true, filter:function(event,player){ - return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.num('he')>0; + return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.countCards('he')>0; }, check:function(){ return false; @@ -282,7 +282,7 @@ character.refresh={ content:function(){ "step 0" player.chooseTarget(get.prompt('retuxi'),[1,2],function(card,player,target){ - return target.num('h')>0&&player!=target&&target.num('h')>=player.num('h'); + return target.countCards('h')>0&&player!=target&&target.countCards('h')>=player.countCards('h'); },function(target){ var att=ai.get.attitude(_status.event.player,target); if(target.hasSkill('tuntian')) return att/10; @@ -310,7 +310,7 @@ character.refresh={ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ "step 0" @@ -368,7 +368,7 @@ character.refresh={ trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ - return (event.source&&event.source.num('he')&&event.num>0&&event.source!=player); + return (event.source&&event.source.countCards('he')&&event.num>0&&event.source!=player); }, content:function(){ player.gainPlayerCard([1,trigger.num],get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['refankui',trigger.source]); @@ -376,7 +376,7 @@ character.refresh={ ai:{ effect:{ target:function(card,player,target){ - if(player.num('he')>1&&get.tag(card,'damage')){ + if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1.5]; if(ai.get.attitude(target,player)<0) return [1,1]; } @@ -439,7 +439,7 @@ character.refresh={ return 1; }) "step 2" - if(result.judge==1&&trigger.source.num('he')){ + if(result.judge==1&&trigger.source.countCards('he')){ player.discardPlayerCard(trigger.source,'he',true); } else{ @@ -472,8 +472,8 @@ character.refresh={ forced:true, filter:function(event,player){ if(player.storage.qinxue) return false; - if(player.num('h')>=player.hp+3) return true; - if(player.num('h')>=player.hp+2&&game.players.length+game.dead.length>=7) return true; + if(player.countCards('h')>=player.hp+3) return true; + if(player.countCards('h')>=player.hp+2&&game.players.length+game.dead.length>=7) return true; return false; }, content:function(){ @@ -508,7 +508,7 @@ character.refresh={ ai1:function(card){ if(ui.selected.cards.length>0) return -1; if(card.name=='du') return 20; - return (_status.event.player.num('h')-_status.event.player.hp); + return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); @@ -516,7 +516,7 @@ character.refresh={ if(target.hasSkillTag('nodu')) return 0; return 1-att; } - if(target.num('h')>_status.event.player.num('h')) return 0; + if(target.countCards('h')>_status.event.player.countCards('h')) return 0; return att-4; }, prompt:'请选择要送人的卡牌' @@ -562,7 +562,7 @@ character.refresh={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ return player!=target; @@ -610,7 +610,7 @@ character.refresh={ order:9, result:{ target:function(player,target){ - return -target.num('he')-(player.num('h','du')?1:0); + return -target.countCards('he')-(player.num('h','du')?1:0); } }, threaten:2, @@ -623,7 +623,7 @@ character.refresh={ audio:2, trigger:{target:'useCardToBegin',player:'judgeBefore'}, filter:function(event,player){ - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; if(event.parent.name=='phaseJudge'){ if(lib.skill.reqianxun.trigger.player=='judgeBefore'){ return true; @@ -635,9 +635,9 @@ character.refresh={ if(event.card&&get.type(event.card)=='trick'&&event.player!=player) return true; }, content:function(){ - player.storage.reqianxun2=player.storage.reqianxun2.concat(player.get('h')); + player.storage.reqianxun2=player.storage.reqianxun2.concat(player.getCards('h')); game.addVideo('storage',player,['reqianxun2',get.cardsInfo(player.storage.reqianxun2),'cards']); - player.lose(player.get('h'),ui.special); + player.lose(player.getCards('h'),ui.special); player.addSkill('reqianxun2'); }, ai:{ @@ -667,7 +667,7 @@ character.refresh={ trigger:{player:'loseEnd'}, direct:true, filter:function(event,player){ - if(player.num('h')) return false; + if(player.countCards('h')) return false; for(var i=0;i0){ - return att+Math.max(0,5-target.num('h')); + return att+Math.max(0,5-target.countCards('h')); } return att; }).set('du',event.card.name=='du'); @@ -843,7 +843,7 @@ character.refresh={ ai:{ effect:{ target:function(card,player){ - if(get.tag(card,'respond')&&player.num('h')>1) return [1,0.2]; + if(get.tag(card,'respond')&&player.countCards('h')>1) return [1,0.2]; } } } @@ -910,7 +910,7 @@ character.refresh={ ai1:function(card){ if(ui.selected.cards.length>0) return -1; if(card.name=='du') return 20; - return (_status.event.player.num('h')-_status.event.player.hp); + return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); @@ -992,10 +992,10 @@ character.refresh={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" @@ -1024,7 +1024,7 @@ character.refresh={ ai:{ result:{ target:function(player,target){ - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length<3) return 0; var bool=false; for(var i=0;itarget.hp+1&&ai.get.recoverEffect(target)>0){ + 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'}))){ @@ -1116,7 +1116,7 @@ character.refresh={ direct:true, filter:function(event){ return event.card&&event.card.name=='sha'&&event.cards&& - get.color(event.cards)=='black'&&event.player.num('e'); + get.color(event.cards)=='black'&&event.player.countCards('e'); }, content:function(){ "step 0" @@ -1155,9 +1155,9 @@ character.refresh={ order:8, result:{ player:function(player){ - if(player.hp<=2) return player.num('h')==0?1:0; + if(player.hp<=2) return player.countCards('h')==0?1:0; if(player.num('h',{name:'sha',color:'red'})) return 1; - return player.num('h')<=player.hp?1:0; + return player.countCards('h')<=player.hp?1:0; } }, effect:function(card,player){ @@ -1246,8 +1246,8 @@ character.refresh={ player.chooseControl(['red','black','basic','trick','equip']).set('ai',function(){ var player=_status.event.player; if(player.num('shan')==0) return 'basic'; - if(player.num('e')<=1) return 'equip'; - if(player.num('h')>2) return 'trick'; + if(player.countCards('e')<=1) return 'equip'; + if(player.countCards('h')>2) return 'trick'; return 'red'; }); "step 1" @@ -1379,10 +1379,10 @@ character.refresh={ for(var i=0;i0; + return target.countCards('he')>0; }, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, filterCard:true, position:'he', diff --git a/character/shenhua.js b/character/shenhua.js index 2746a3ded..f54dd9f2a 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -83,7 +83,7 @@ character.shenhua={ jianchu:{ trigger:{player:'shaBegin'}, filter:function(event){ - return event.target.num('he')>0; + return event.target.countCards('he')>0; }, check:function(event,player){ return ai.get.attitude(player,event.player)<=0; @@ -122,14 +122,14 @@ character.shenhua={ filterTarget:function(card,player,target){ if(player==target) return false; if(ui.selected.targets.length==0) return true; - return (Math.abs(ui.selected.targets[0].num('h')-target.num('h'))== + return (Math.abs(ui.selected.targets[0].countCards('h')-target.countCards('h'))== ui.selected.cards.length); }, multitarget:true, multiline:true, content:function(){ 'step 0' - var cards=targets[0].get('h').concat(targets[1].get('h')); + var cards=targets[0].getCards('h').concat(targets[1].getCards('h')); var dialog=ui.create.dialog('缔盟',true); if(player.isUnderControl(true)||targets[0].isUnderControl(true)||targets[1].isUnderControl(true)){ dialog.add(cards); @@ -260,21 +260,21 @@ character.shenhua={ var from,nh; if(list.length==0) return null; list.sort(function(a,b){ - return a.num('h')-b.num('h'); + return a.countCards('h')-b.countCards('h'); }); if(type==1) return list[0]; from=list[0]; - nh=from.num('h'); + nh=from.countCards('h'); list=game.filterPlayer(function(current){ return current!=player&&ai.get.attitude(player,current)<1; }); if(list.length==0) return null; list.sort(function(a,b){ - return b.num('h')-a.num('h'); + return b.countCards('h')-a.countCards('h'); }); for(var i=0;i=player.hp) player.addTempSkill('xinliegong2','shaAfter'); }, ai:{ @@ -562,13 +562,13 @@ character.shenhua={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target.canUse({name:'sha'},player)&&target.num('he'); + return target.canUse({name:'sha'},player)&&target.countCards('he'); }, content:function(){ "step 0" target.chooseToUse({name:'sha'},player,-1,'挑衅:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true); "step 1" - if(result.bool==false&&target.num('he')>0){ + if(result.bool==false&&target.countCards('he')>0){ player.discardPlayerCard(target,'he',true); } else{ @@ -581,8 +581,8 @@ character.shenhua={ result:{ target:-1, player:function(player,target){ - if(target.num('h')==0) return 0; - if(target.num('h')==1) return -0.1; + 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; return -0.5; @@ -601,7 +601,7 @@ character.shenhua={ forced:true, filter:function(event,player){ if(player.storage.zhiji) return false; - return player.num('h')==0; + return player.countCards('h')==0; }, content:function(){ "step 0" @@ -676,12 +676,12 @@ character.shenhua={ audio:2, trigger:{player:'phaseUseBefore'}, filter:function(event,player){ - return player.num('h')>0&&!player.hasSkill('fangquan3'); + return player.countCards('h')>0&&!player.hasSkill('fangquan3'); }, direct:true, content:function(){ "step 0" - var fang=player.hp>=2&&player.num('h')<=player.hp+1; + var fang=player.hp>=2&&player.countCards('h')<=player.hp+1; player.chooseTarget(get.prompt('fangquan'),function(card,player,target){ return target!=player; }).set('ai',function(target){ @@ -772,13 +772,13 @@ character.shenhua={ audio:2, trigger:{player:'phaseJudgeBefore'}, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, direct:true, frequent:true, content:function(){ "step 0" - if(player.num('j')==0&&(!event.isMine()||!lib.config.autoskilllist.contains('qiaobian1'))){ + if(player.countCards('j')==0&&(!event.isMine()||!lib.config.autoskilllist.contains('qiaobian1'))){ event.finish(); } else{ @@ -797,14 +797,14 @@ character.shenhua={ audio:2, trigger:{player:'phaseDrawBefore'}, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, direct:true, content:function(){ "step 0" var check,i,num=0,num2=0,players=game.filterPlayer(); for(i=0;i0; + return target.countCards('h')>0; }, selectTarget:[0,2], filterCard:lib.filter.cardDiscardable, @@ -860,16 +860,16 @@ character.shenhua={ audio:2, trigger:{player:'phaseUseBefore'}, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, direct:true, content:function(){ "step 0" var check=game.hasPlayer(function(current){ - return ai.get.attitude(player,current)>0&¤t.num('j'); + return ai.get.attitude(player,current)>0&¤t.countCards('j'); }); if(!check){ - if(player.num('h')>player.hp+1){ + if(player.countCards('h')>player.hp+1){ check=false; } else if(player.num('h',{name:['wuzhong']})){ @@ -888,7 +888,7 @@ character.shenhua={ if(!_status.event.check) return 0; var player=_status.event.player; if(ui.selected.targets.length==0){ - if(target.num('j')&&ai.get.attitude(player,target)>0) return 10; + if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 10; if(ai.get.attitude(player,target)<0){ var players=game.filterPlayer(); for(var i=0;i0; + return target.countCards('ej')>0; } }, selectTarget:2, @@ -996,11 +996,11 @@ character.shenhua={ trigger:{player:'phaseDiscardBefore'}, direct:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" - var discard=player.num('h')>player.hp; + var discard=player.countCards('h')>player.hp; var next=player.chooseToDiscard('是否发动巧变跳过弃牌阶段?'); next.logSkill='qiaobian'; next.ai=function(card){ @@ -1075,9 +1075,9 @@ character.shenhua={ target:function(card,player,target,current){ if(!target.hasFriend()&&!player.hasUnknown()) return; if(_status.currentPhase==target) return; - if(get.tag(card,'loseCard')&&target.num('he')){ + if(get.tag(card,'loseCard')&&target.countCards('he')){ if(target.hasSkill('ziliang')) return 0.7; - return [0.5,Math.max(2,target.num('h'))]; + return [0.5,Math.max(2,target.countCards('h'))]; } if(target.isUnderControl(true,player)){ if((get.tag(card,'respondSha')&&target.num('h','sha'))|| @@ -1089,15 +1089,15 @@ character.shenhua={ else if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ if(ai.get.attitude(player,target)>0&&card.name=='juedou') return; if(get.tag(card,'damage')&&target.hasSkillTag('maixie')) return; - if(target.num('h')==0) return 2; + 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.num('h')/4,target.num('h','sha')+target.num('h','shan'))]; + return [0.5,Math.max(target.countCards('h')/4,target.num('h','sha')+target.num('h','shan'))]; } } }, threaten:function(player,target){ - if(target.num('h')==0) return 2; + if(target.countCards('h')==0) return 2; return 0.5; } } @@ -1229,13 +1229,13 @@ character.shenhua={ forceaudio:true, enable:'phaseUse', filter:function(event,player){ - if(player.group!='wu'||player.num('h')==0) return false; + if(player.group!='wu'||player.countCards('h')==0) return false; return game.hasPlayer(function(target){ - return target!=player&&target.hasZhuSkill('zhiba',player)&&target.num('h')>0; + return target!=player&&target.hasZhuSkill('zhiba',player)&&target.countCards('h')>0; }); }, filterTarget:function(card,player,target){ - return target!=player&&target.hasZhuSkill('zhiba',player)&&target.num('h')>0; + return target!=player&&target.hasZhuSkill('zhiba',player)&&target.countCards('h')>0; }, usable:1, content:function(){ @@ -1276,9 +1276,9 @@ character.shenhua={ result:{ target:function(player,target){ if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1; - if(player.num('h')<=player.hp) return 0; + if(player.countCards('h')<=player.hp) return 0; var maxnum=0; - var cards2=target.get('h'); + var cards2=target.getCards('h'); for(var i=0;imaxnum){ maxnum=cards2[i].number; @@ -1286,7 +1286,7 @@ character.shenhua={ } if(maxnum>10) maxnum=10; if(maxnum<5&&cards2.length>1) maxnum=5; - var cards=player.get('h'); + var cards=player.getCards('h'); for(var i=0;i=2; + return player.countCards('h')>=2; } return true; }, @@ -1871,17 +1871,17 @@ character.shenhua={ filter:function(event,player){ return (event.card&&event.card.name=='sha'&& event.player.classList.contains('dead')==false&& - event.player.num('h')&&player.num('h'))&&event.player!=player; + event.player.countCards('h')&&player.countCards('h'))&&event.player!=player; }, check:function(event,player){ - return ai.get.attitude(player,event.player)<0&&player.num('h')>1; + return ai.get.attitude(player,event.player)<0&&player.countCards('h')>1; }, priority:5, content:function(){ "step 0" player.chooseToCompare(trigger.player); "step 1" - if(result.bool&&trigger.player.num('he')){ + if(result.bool&&trigger.player.countCards('he')){ player.gainPlayerCard(trigger.player,true,'he'); } } @@ -1925,14 +1925,14 @@ character.shenhua={ var player=_status.event.player; if(ai.get.attitude(_status.event.player,target)==0) return 0; if(ai.get.attitude(_status.event.player,target)>0){ - if(target.classList.contains('turnedover')) return 1000-target.num('h'); + if(target.classList.contains('turnedover')) return 1000-target.countCards('h'); if(player.maxHp-player.hp<3) return -1; - return 100-target.num('h'); + return 100-target.countCards('h'); } else{ if(target.classList.contains('turnedover')) return -1; if(player.maxHp-player.hp>=3) return -1; - return 1+target.num('h'); + return 1+target.countCards('h'); } } "step 1" @@ -2049,17 +2049,17 @@ character.shenhua={ trigger:{player:'phaseDrawBegin'}, threaten:1.4, check:function(event,player){ - if(player.num('h')<=1) return true; + if(player.countCards('h')<=1) return true; var min=[]; - var temp=player.next.num('h'); + var temp=player.next.countCards('h'); var players=game.filterPlayer(); for(var i=0;i3) list.push(players[i]); } list.sort(function(a,b){ - return a.num('h')-b.num('h'); + return a.countCards('h')-b.countCards('h'); }); if(list.length==0) return -1; var from=list[0]; @@ -2156,15 +2156,15 @@ character.shenhua={ } if(list.length==0) return -1; list.sort(function(a,b){ - return b.num('h')-a.num('h'); + return b.countCards('h')-a.countCards('h'); }); - if(from.num('h')>=list[0].num('h')) return -1; - for(var i=0;i=list[0].countCards('h')) return -1; + for(var i=0;i=2) return -1; + if(count<2&&from.countCards('h')>=2) return -1; if(ui.selected.cards.length3) list.push(players[i]); } list.sort(function(a,b){ - return a.num('h')-b.num('h'); + return a.countCards('h')-b.countCards('h'); }); if(target==list[0]) return ai.get.attitude(player,target); return -ai.get.attitude(player,target); @@ -2193,13 +2193,13 @@ character.shenhua={ if(players[i]!=player&&ai.get.attitude(player,players[i])<1) list.push(players[i]); } list.sort(function(a,b){ - return b.num('h')-a.num('h'); + return b.countCards('h')-a.countCards('h'); }); - if(from.num('h')>=list[0].num('h')) return -ai.get.attitude(player,target); - for(var i=0;i=2) return -ai.get.attitude(player,target); + if(from.countCards('h')>=list[0].countCards('h')) return -ai.get.attitude(player,target); + for(var i=0;i=2) return -ai.get.attitude(player,target); if(target==list[i]) return ai.get.attitude(player,target); return -ai.get.attitude(player,target); } @@ -2223,7 +2223,7 @@ character.shenhua={ return player!=target; }).set('ai',function(target){ var player=_status.event.player; - if(player.maxHp-player.hp==1&&target.num('he')==0){ + if(player.maxHp-player.hp==1&&target.countCards('he')==0){ return 0; } if(ai.get.attitude(_status.event.player,target)>0){ @@ -2237,7 +2237,7 @@ character.shenhua={ "step 1" if(result.bool){ event.num=player.maxHp-player.hp; - if(player.num('e')>=player.hp){ + if(player.countCards('e')>=player.hp){ event.num=player.maxHp; } player.logSkill('yinghun',result.targets); @@ -2269,7 +2269,7 @@ character.shenhua={ }, ai:{ threaten:function(player,target){ - if(target.hp==1||target.num('e')>=target.hp) return 2; + if(target.hp==1||target.countCards('e')>=target.hp) return 2; if(target.hp==target.maxHp) return 0.5; if(target.hp==2) return 1.5; return 0.5; @@ -2300,7 +2300,7 @@ character.shenhua={ return player!=target; }).set('ai',function(target){ var player=_status.event.player; - if(player.maxHp-player.hp==1&&target.num('he')==0){ + if(player.maxHp-player.hp==1&&target.countCards('he')==0){ return 0; } if(ai.get.attitude(_status.event.player,target)>0){ @@ -2545,7 +2545,7 @@ character.shenhua={ result:{ player:function(player){ if(lib.config.mode=='identity'&&game.zhu.isZhu&&player.identity=='fan'){ - if(game.zhu.hp==1&&game.zhu.num('h')<=2) return 1; + if(game.zhu.hp==1&&game.zhu.countCards('h')<=2) return 1; } var num=0; var players=game.filterPlayer(); @@ -2554,9 +2554,9 @@ character.shenhua={ if(att>0) att=1; if(att<0) att=-1; if(players[i]!=player&&players[i].hp<=3){ - if(players[i].num('h')==0) num+=att/players[i].hp; - else if(players[i].num('h')==1) num+=att/2/players[i].hp; - else if(players[i].num('h')==2) num+=att/4/players[i].hp; + if(players[i].countCards('h')==0) num+=att/players[i].hp; + else if(players[i].countCards('h')==1) num+=att/2/players[i].hp; + else if(players[i].countCards('h')==2) num+=att/4/players[i].hp; } if(players[i].hp==1) num+=att*1.5; } @@ -2606,7 +2606,7 @@ character.shenhua={ prompt:'将一张红色牌当火攻使用', check:function(card){ var player=_status.currentPhase; - if(player.num('h')>player.hp){ + if(player.countCards('h')>player.hp){ return 6-ai.get.value(card); } return 4-ai.get.value(card) @@ -2717,7 +2717,7 @@ character.shenhua={ content:function(){ 'step 0' player.hp=Math.min(3,player.maxHp); - player.discard(player.get('hej')); + player.discard(player.getCards('hej')); player.draw(3); player.awakenSkill('niepan'); player.storage.niepan=true; @@ -2736,7 +2736,7 @@ character.shenhua={ result:{ player:function(player){ if(player.hp==0) return 10; - if(player.hp<=2&&player.num('he')<=1) return 10; + if(player.hp<=2&&player.countCards('he')<=1) return 10; return 0; } }, @@ -2770,7 +2770,7 @@ character.shenhua={ content:function(){ 'step 0' player.hp=Math.min(3,player.maxHp); - player.discard(player.get('hej')); + player.discard(player.getCards('hej')); player.draw(3); player.awakenSkill('oldniepan'); player.storage.oldniepan=true; @@ -2789,7 +2789,7 @@ character.shenhua={ result:{ player:function(player){ if(player.hp==0) return 10; - if(player.hp<=2&&player.num('he')<=1) return 10; + if(player.hp<=2&&player.countCards('he')<=1) return 10; return 0; } }, @@ -2806,13 +2806,13 @@ character.shenhua={ enable:'phaseUse', usable:1, filter:function(event,player){ - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; return game.hasPlayer(function(current){ - return current.hp>player.hp&¤t.num('h'); + return current.hp>player.hp&¤t.countCards('h'); }); }, filterTarget:function(card,player,target){ - return target.hp>player.hp&&target.num('h')>0; + return target.hp>player.hp&&target.countCards('h')>0; }, content:function(){ "step 0" @@ -2848,7 +2848,7 @@ character.shenhua={ result:{ target:function(player,target){ var att=ai.get.attitude(player,target); - var oc=(target.num('h')==1); + var oc=(target.countCards('h')==1); if(att>0&&oc) return 0; var players=game.filterPlayer(); for(var i=0;i2){ - max=Math.max(Math.min(5,players[i].hp)-players[i].num('h'),max); + max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); } } switch(max){ @@ -2895,11 +2895,11 @@ character.shenhua={ content:function(){ "step 0" player.chooseTarget(get.prompt('jieming'),[1,trigger.num],function(card,player,target){ - return target.num('h')2){ - return Math.min(5,target.maxHp)-target.num('h'); + return Math.min(5,target.maxHp)-target.countCards('h'); } return att/3; }); @@ -2907,7 +2907,7 @@ character.shenhua={ if(result.bool){ player.logSkill('jieming',result.targets); for(var i=0;i0){ - max=Math.max(Math.min(5,players[i].hp)-players[i].num('h'),max); + max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); } } switch(max){ @@ -2933,7 +2933,7 @@ character.shenhua={ } } if((card.name=='tao'||card.name=='caoyao')&& - target.hp>1&&target.num('h')<=target.hp) return [0,0]; + target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; } }, } @@ -3049,10 +3049,10 @@ character.shenhua={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h')>0; + return player!=target&&target.countCards('h')>0; }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" @@ -3067,7 +3067,7 @@ character.shenhua={ }, ai:{ order:function(name,player){ - var cards=player.get('h'); + var cards=player.getCards('h'); if(player.num('h','sha')==0){ return 1; } @@ -3081,14 +3081,14 @@ character.shenhua={ result:{ player:function(player){ if(player.num('h','sha')>0) return 0.6; - var num=player.num('h'); + var num=player.countCards('h'); if(num>player.hp) return 0; if(num==1) return -2; if(num==2) return -1; return -0.7; }, target:function(player,target){ - var num=target.num('h'); + var num=target.countCards('h'); if(num==1) return -1; if(num==2) return -0.7; return -0.5 @@ -3119,8 +3119,8 @@ character.shenhua={ audio:true, trigger:{player:'phaseDrawBefore'}, check:function(event,player){ - if(player.num('h')>player.hp) return true; - if(player.num('h')>3) return true; + if(player.countCards('h')>player.hp) return true; + if(player.countCards('h')>3) return true; return false; }, content:function(){ @@ -3159,7 +3159,7 @@ character.shenhua={ if(ui.selected.cards.length){ return get.suit(card)==get.suit(ui.selected.cards[0]); } - var cards=player.get('h'); + var cards=player.getCards('h'); for(var i=0;i0; + return event.target.countCards('he')>0; }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; @@ -3223,18 +3223,18 @@ character.shenhua={ var type=get.type(result.card||result.cards[0]); if(game.hasPlayer(function(current){ if(type=='equip'){ - return current.num('e'); + return current.countCards('e'); } else{ - return current.num('j'); + return current.countCards('j'); } })){ var next=player.chooseTarget('是否弃置场上的一张'+get.translation(type)+'牌?',function(card,player,target){ if(_status.event.type=='equip'){ - return target.num('e')>0; + return target.countCards('e')>0; } else{ - return target.num('j')>0; + return target.countCards('j')>0; } }); next.set('ai',function(target){ @@ -3313,23 +3313,23 @@ character.shenhua={ var be=target.num('e',{color:'black'}); if(target.num('h','shan')&&be){ if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.num('he')/2:0]; + return [0,hastarget?target.countCards('he')/2:0]; } - if(target.num('h','shan')&&target.num('h')>2){ + if(target.num('h','shan')&&target.countCards('h')>2){ if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.num('h')/4:0]; + return [0,hastarget?target.countCards('h')/4:0]; } - if(target.num('h')>3||(be&&target.num('h')>=2)){ + if(target.countCards('h')>3||(be&&target.countCards('h')>=2)){ return [0,0]; } - if(target.num('h')==0){ + if(target.countCards('h')==0){ return [1.5,0]; } - if(target.num('h')==1&&!be){ + if(target.countCards('h')==1&&!be){ return [1.2,0]; } if(!target.hasSkill('guidao')) return [1,0.05]; - return [1,Math.min(0.5,(target.num('h')+be)/4)]; + return [1,Math.min(0.5,(target.countCards('h')+be)/4)]; } } } @@ -3347,7 +3347,7 @@ character.shenhua={ direct:true, content:function(){ "step 0" - var check= player.num('h')>2; + var check= player.countCards('h')>2; player.chooseTarget(get.prompt('shensu'),function(card,player,target){ if(player==target) return false; return player.canUse({name:'sha'},target,false); @@ -3451,7 +3451,7 @@ character.shenhua={ }, logTarget:'target', filter:function(event,player){ - var length=event.target.num('h'); + var length=event.target.countCards('h'); return (length>=player.hp||length<=player.getAttackRange()); }, content:function(){ @@ -3546,11 +3546,11 @@ character.shenhua={ effect:{ target:function(card,player,target){ if(player.hasSkillTag('jueqing')) return; - if(get.tag(card,'damage')&&target.num('h')>1) return 0.7; + if(get.tag(card,'damage')&&target.countCards('h')>1) return 0.7; } }, threaten:function(player,target){ - if(target.num('h')==0) return 2; + if(target.countCards('h')==0) return 2; } } }, @@ -3639,7 +3639,7 @@ character.shenhua={ effect:{ target:function(card,player,target){ if(player.hasSkillTag('jueqing')) return; - if(get.tag(card,'damage')&&target.num('he')>1) return 0.7; + if(get.tag(card,'damage')&&target.countCards('he')>1) return 0.7; } }, } @@ -3953,12 +3953,12 @@ character.shenhua={ return ai.get.attitude(target,current)<0; }); if(target.num('h','shan')&&target.num('e',{suit:'spade'})){ - return [0,hastarget?target.num('he')/2:0]; + return [0,hastarget?target.countCards('he')/2:0]; } if(target.num('h','shan')){ - return [1,hastarget?target.num('he')/2:0]; + return [1,hastarget?target.countCards('he')/2:0]; } - return [1,target.num('h')/4]; + return [1,target.countCards('h')/4]; } } } @@ -4022,7 +4022,7 @@ character.shenhua={ usable:1, audio:2, filter:function(event,player){ - return player.num('h')>0 + return player.countCards('h')>0 }, chooseButton:{ dialog:function(){ @@ -4072,7 +4072,7 @@ character.shenhua={ result:{ player:function(player){ var num=0; - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length>=3&&player.hp>=3) return 0; for(var i=0;i=2) return 1; + if(player.hp==2&&player.countCards('e')>=2) return 1; return 0; }).set('choiceList',['弃置装备区内的所有牌并失去一点体力',get.mode()=='guozhan'?'移除副将牌':'随机移除武将牌上的一个技能']); } @@ -320,7 +320,7 @@ character.sp={ } } else{ - trigger.player.discard(trigger.player.get('e')); + trigger.player.discard(trigger.player.getCards('e')); trigger.player.loseHp(); } } @@ -389,7 +389,7 @@ character.sp={ }); } player.chooseTarget(get.prompt('shuangren'),function(card,player,target){ - return target!=player&&target.num('h'); + return target!=player&&target.countCards('h'); }).set('ai',function(target){ var player=_status.event.player; if(_status.event.goon&&ai.get.attitude(player,target)<0){ @@ -506,19 +506,19 @@ character.sp={ trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ 'step 0' var maxval=0; - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i0){ if(nh==target.hp-1){ if(player==target) return att+1; @@ -682,11 +682,11 @@ character.sp={ if(result.bool){ player.logSkill('bingzheng',result.targets); event.target=result.targets[0]; - if(event.target.num('h')){ + if(event.target.countCards('h')){ player.chooseControl(function(event,player){ var target=event.target; if(ai.get.attitude(player,target)<0) return 1; - if(target.num('h')==target.hp+1) return 1; + if(target.countCards('h')==target.hp+1) return 1; return 0; }).set('choiceList',['令'+get.translation(event.target)+'摸一张牌', '令'+get.translation(event.target)+'弃置一张手牌']); @@ -706,7 +706,7 @@ character.sp={ event.target.chooseToDiscard('h',true); } 'step 3' - if(event.target.num('h')==event.target.hp){ + if(event.target.countCards('h')==event.target.hp){ player.draw(); if(event.target==player){ event.finish(); @@ -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.num('h')>event.target.num('h')){ + player.num('h','shan')>1&&player.countCards('h')>event.target.countCards('h')){ next.set('shan',true); } if(ai.get.attitude(player,event.target)>0&&player.needsToDiscard()){ @@ -817,7 +817,7 @@ character.sp={ filter:function(event,player){ if(player.equiping) return false; var suits=[]; - var es=player.get('e'); + var es=player.getCards('e'); for(var i=0;i0; + return event.target.countCards('he')>0; }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; @@ -1603,7 +1603,7 @@ character.sp={ zhuSkill:true, filter:function(event,player){ if(!player.hasZhuSkill('shichou'))return false; - if(player.num('he')<2) return false; + if(player.countCards('he')<2) return false; return !player.storage.shichou; }, selectCard:2, @@ -1864,7 +1864,7 @@ character.sp={ return true; }, filterTarget:function(card,player,target){ - return target.num('e')>0; + return target.countCards('e')>0; }, content:function(){ 'step 0' @@ -1872,7 +1872,7 @@ character.sp={ 'step 1' var goon=ai.get.damageEffect(target,player,target)>=0; if(!goon&&target.hp>=4&&ai.get.attitude(player,target)<0){ - var es=target.get('e'); + var es=target.getCards('e'); for(var i=0;i=8){ goon=true;break; @@ -1889,7 +1889,7 @@ character.sp={ event.finish(); } else{ - target.gain(target.get('e'),'gain2'); + target.gain(target.getCards('e'),'gain2'); } 'step 3' game.delay(0.5); @@ -1902,7 +1902,7 @@ character.sp={ if(ai.get.damageEffect(target,player,target)>=0) return 2; var att=ai.get.attitude(player,target); if(att==0) return 0; - var es=target.get('e'); + var es=target.getCards('e'); for(var i=0;i0; + return player.countCards('h')>0; }, init:function(player){ player.storage.tuifeng=[]; @@ -2132,7 +2132,7 @@ character.sp={ }, filterTarget:function(card,player,target){ if(ui.selected.targets.length){ - return target.num('h')>0&&target.distanceTo(ui.selected.targets[0])<=1; + return target.countCards('h')>0&&target.distanceTo(ui.selected.targets[0])<=1; } return true; }, @@ -2246,11 +2246,11 @@ character.sp={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, selectTarget:[1,3], filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, multitarget:true, multiline:true, @@ -2296,10 +2296,10 @@ character.sp={ result:{ target:function(player,target){ var num=game.countPlayer(function(current){ - return ai.get.attitude(player,current)<0&¤t!=player&¤t.num('h'); + return ai.get.attitude(player,current)<0&¤t!=player&¤t.countCards('h'); }); if(num>3) num=3; - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i0; }, filterTarget:function(card,player,target){ - return target!=player&&target.num('he')>0; + return target!=player&&target.countCards('he')>0; }, filterCard:{name:'sha'}, content:function(){ @@ -2354,7 +2354,7 @@ character.sp={ return 0; } if(target.hpplayer.hp) return -0.1; + if(player.countCards('h')>player.hp) return -0.1; return 0; } var hs1=target.get('h','sha'); @@ -2362,7 +2362,7 @@ character.sp={ if(hs1.length>hs2.length){ return 0; } - var hsx=target.get('h'); + var hsx=target.getCards('h'); if(hsx.length>2&&hs2.length<=1&&hsx[0].number<6){ return 0; } @@ -2386,7 +2386,7 @@ character.sp={ player.storage.shefu2=[]; }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, intro:{ content:'cards', @@ -2506,7 +2506,7 @@ character.sp={ return !player.num('h','shan'); } else{ - return target.hp==1||(target.num('h')<=2&&target.hp<=2); + return target.hp==1||(target.countCards('h')<=2&&target.hp<=2); } } else{ @@ -2566,8 +2566,8 @@ character.sp={ trigger:{player:'damageEnd'}, filter:function(event,player){ if(!event.source) return false; - var nh1=player.num('h'); - var nh2=event.source.num('h'); + var nh1=player.countCards('h'); + var nh2=event.source.countCards('h'); if(nh1==nh2) return false; if(nh2=5) return false; if(nh2>nh2&&event.source.isDead()) return false; @@ -2576,8 +2576,8 @@ character.sp={ direct:true, content:function(){ "step 0" - var num1=player.num('h'); - var num2=trigger.source.num('h'); + var num1=player.countCards('h'); + var num2=trigger.source.countCards('h'); if(num1>num2){ var next=player.chooseToDiscard([num2+1,num1],'贲育:是否弃置至少'+(num2+1)+'张手牌,并对'+get.translation(trigger.source)+'造成一点伤害?'); next.logSkill=['benyu',trigger.source]; @@ -2644,14 +2644,14 @@ character.sp={ trigger:{source:'damageEnd'}, filter:function(event,player){ return _status.currentPhase==player&&event.player.isAlive()&& - event.player.num('hej')>0&&event.player!=player&&!player.hasSkill('zhidao2'); + event.player.countCards('hej')>0&&event.player!=player&&!player.hasSkill('zhidao2'); }, forced:true, content:function(){ var num=0; - if(trigger.player.num('h')) num++; - if(trigger.player.num('e')) num++; - if(trigger.player.num('j')) num++; + if(trigger.player.countCards('h')) num++; + if(trigger.player.countCards('e')) num++; + if(trigger.player.countCards('j')) num++; if(num){ player.gainPlayerCard(trigger.player,num,'hej',true).set('filterButton',function(button){ for(var i=0;i0; + return !event.targets.contains(target)&&target.countCards('he')>0; }); }, content:function(){ 'step 0' player.chooseTarget(get.prompt('qizhi'),function(card,player,target){ - return !_status.event.getTrigger().targets.contains(target)&&target.num('he')>0; + return !_status.event.getTrigger().targets.contains(target)&&target.countCards('he')>0; }).set('ai',function(target){ var player=_status.event.player; if(target==player) return 2; @@ -2831,7 +2831,7 @@ character.sp={ jinqu:{ trigger:{player:'phaseEnd'}, check:function(event,player){ - return player.storage.qizhi>=player.num('h'); + return player.storage.qizhi>=player.countCards('h'); }, prompt:function(event,player){ if(typeof player.storage.qizhi!='number'){ @@ -2846,7 +2846,7 @@ character.sp={ if(typeof player.storage.qizhi!='number'){ player.storage.qizhi=0; } - var dh=player.num('h')-player.storage.qizhi; + var dh=player.countCards('h')-player.storage.qizhi; if(dh>0){ player.chooseToDiscard(dh,true); } @@ -2873,7 +2873,7 @@ character.sp={ trigger:{player:'loseEnd'}, forced:true, filter:function(event,player){ - return player._mouduan_mark&&player._mouduan_mark.name=='武'&&player.num('h')<=2; + return player._mouduan_mark&&player._mouduan_mark.name=='武'&&player.countCards('h')<=2; }, content:function(){ game.broadcastAll(function(player){ @@ -2891,7 +2891,7 @@ character.sp={ trigger:{global:'phaseBegin'}, priority:5, filter:function(event,player){ - return player._mouduan_mark&&player._mouduan_mark.name=='文'&&player.num('h')>2; + return player._mouduan_mark&&player._mouduan_mark.name=='文'&&player.countCards('h')>2; }, direct:true, content:function(){ @@ -2900,7 +2900,7 @@ character.sp={ return -1; } 'step 1' - if(result.bool&&player.num('h')>2){ + if(result.bool&&player.countCards('h')>2){ game.broadcastAll(function(player){ if(!player._mouduan_mark) return; player._mouduan_mark.name='武'; @@ -2916,10 +2916,10 @@ character.sp={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ 'step 0' @@ -2932,7 +2932,7 @@ character.sp={ ai:{ result:{ target:function(player,target){ - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length<3) return 0; var bool=false; for(var i=0;i=2&&he<=3){ return '弃牌'; @@ -3098,7 +3098,7 @@ character.sp={ 'step 1' if(result.control=='弃牌'){ player.line(trigger.player,'green'); - if(player.hp1) return false; if(!event.target) return false; if(event.target.hp>=player.hp) return false; @@ -3139,7 +3139,7 @@ character.sp={ if(trigger.card.name=='sha'){ if(player.num('h','shan')||player.get('e','2')|| trigger.target.hp==1||player.hp>trigger.target.hp+1){ - if(!trigger.target.num('h','shan')||trigger.target.num('h')0; + return player.countCards('h')>0; }, content:function(){ 'step 0' @@ -3263,7 +3263,7 @@ character.sp={ } else{ event.type=false; - if(player.num('h')){ + if(player.countCards('h')){ player.showHandcards(); player.chooseToDiscard('h',true); } @@ -3279,7 +3279,7 @@ character.sp={ ai:{ result:{ target:function(player,target){ - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length<3) return 0; var bool=false; for(var i=0;i=3&&player.num('h')>player.hp+1+player.storage.xunzhi; + return player.hp>=3&&player.countCards('h')>player.hp+1+player.storage.xunzhi; }, content:function(){ player.loseHp(); @@ -3351,7 +3351,7 @@ character.sp={ return target.hp==player.hp; }); if(!player.hasSkill('xunzhi2')){ - var nh=player.num('h'); + var nh=player.countCards('h'); if(nh>5) return false; if(num==3&&nh>3) return false; } @@ -3467,7 +3467,7 @@ character.sp={ event.finish(); } else{ - if(event.target.num('e')){ + if(event.target.countCards('e')){ player.choosePlayerCard('e','将'+get.translation(event.target)+'的一张装备牌移出游戏',true,event.target); } else{ @@ -3521,7 +3521,7 @@ character.sp={ return player.num('he',{color:'black'})>0&&player.storage.yinling.length<4; }, filterTarget:function(card,player,target){ - return target.num('he')>0&&target!=player; + return target.countCards('he')>0&&target!=player; }, init:function(player){ player.storage.yinling=[]; @@ -3547,15 +3547,15 @@ character.sp={ result:{ target:function(player,target){ if(target.hasSkill('tuntian')) return 0; - var es=target.get('e'); - var nh=target.num('h'); + var es=target.getCards('e'); + var nh=target.countCards('h'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp0) return -1; - return ai.get.damageEffect(target,player,player)+target.num('e')/2; + return ai.get.damageEffect(target,player,player)+target.countCards('e')/2; }); } else{ @@ -3803,7 +3803,7 @@ character.sp={ } 'step 4' if(event.target&&event.target.isAlive()){ - var es=event.target.get('e'); + var es=event.target.getCards('e'); if(es.length){ event.target.discard(es); } @@ -3821,12 +3821,12 @@ character.sp={ player.storage.yinbing=[]; }, filter:function(event,player){ - return player.num('he',{type:'basic'})=player.maxHp) return 0; + if(player.countCards('h')>=player.maxHp) return 0; return 0.5; } var att=ai.get.attitude(player,target); @@ -3920,7 +3920,7 @@ character.sp={ return att-1; } if(target.hp==target.maxHp) return 0; - if(player.num('h')0) player.draw(num); while(player.storage.yinbing.length){ ui.discardPile.appendChild(player.storage.yinbing.shift()); @@ -4112,9 +4112,9 @@ character.sp={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - if(player.num('h')>=player.hp) return false; + if(player.countCards('h')>=player.hp) return false; return game.hasPlayer(function(current){ - return player!=current&&get.distance(player,current,'attack')<=1&¤t.num('he'); + return player!=current&&get.distance(player,current,'attack')<=1&¤t.countCards('he'); }); }, intro:{ @@ -4126,7 +4126,7 @@ character.sp={ content:function(){ 'step 0' player.chooseTarget('焚天:选择一名攻击范围内的角色,将其一张牌置于你的武将牌上',true,function(card,player,target){ - return player!=target&&get.distance(player,target,'attack')<=1&&target.num('he')>0; + return player!=target&&get.distance(player,target,'attack')<=1&&target.countCards('he')>0; }).set('ai',function(target){ return -ai.get.attitude(_status.event.player,target) }); @@ -4210,7 +4210,7 @@ character.sp={ trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ - return !player.storage.danji&&player.num('h')>player.hp; + return !player.storage.danji&&player.countCards('h')>player.hp; }, content:function(){ player.storage.danji=true; @@ -4249,7 +4249,7 @@ character.sp={ audio:2, trigger:{player:'phaseDrawBegin'}, check:function(event,player){ - return player.num('h')-player.num('h',{type:'equip'})+2<=player.hp; + return player.countCards('h')-player.num('h',{type:'equip'})+2<=player.hp; }, content:function(){ trigger.num+=2; @@ -4270,7 +4270,7 @@ character.sp={ content:function(){ 'step 0' player.removeSkill('tunchu_choose'); - if(player.num('h')){ + if(player.countCards('h')){ player.chooseCard('h',true); } else{ @@ -4306,7 +4306,7 @@ character.sp={ trigger:{global:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.storage.tunchu&&player.storage.tunchu.length>0&&event.player.num('h')==0&&event.player.isAlive(); + return player.storage.tunchu&&player.storage.tunchu.length>0&&event.player.countCards('h')==0&&event.player.isAlive(); }, content:function(){ 'step 0' @@ -4456,7 +4456,7 @@ character.sp={ content:function(){ "step 0" player.addSkill('qingyi3'); - var check= player.num('h')>2; + var check= player.countCards('h')>2; player.chooseTarget(get.prompt('qingyi'),function(card,player,target){ if(player==target) return false; return player.canUse({name:'sha'},target); @@ -4484,7 +4484,7 @@ character.sp={ content:function(){ "step 0" player.addSkill('qingyi3'); - var check=player.num('h')<=player.hp; + var check=player.countCards('h')<=player.hp; player.chooseCardTarget({ prompt:get.prompt('qingyi'), filterCard:function(card,player){ @@ -4592,7 +4592,7 @@ character.sp={ trigger:{player:'phaseDrawBegin'}, frequent:true, content:function(){ - trigger.num+=1+Math.floor(player.num('e')/2); + trigger.num+=1+Math.floor(player.countCards('e')/2); } }, qirang:{ @@ -4618,12 +4618,12 @@ character.sp={ forced:true, audio:2, filter:function(event,player){ - return event.parent.name=='phaseDiscard'&&player.num('h',{type:'basic'})0&&player.num('h')>0; + return player.storage.mozhi.length>0&&player.countCards('h')>0; }, content:function(){ - if(player.storage.mozhi.length&&player.num('h')){ + if(player.storage.mozhi.length&&player.countCards('h')){ var card=player.storage.mozhi.shift(); card={name:card.name,nature:card.nature,suit:card.suit,number:card.number}; if(lib.filter.cardEnabled(card)){ @@ -5043,7 +5043,7 @@ character.sp={ player.storage.biluan=0; }, check:function(event,player){ - if(player.num('h')>player.hp) return true; + if(player.countCards('h')>player.hp) return true; if(player.num('j','lebu')) return true; var ng=[]; var players=game.filterPlayer(); @@ -5191,7 +5191,7 @@ character.sp={ trigger:{player:'useCard'}, forced:true, filter:function(event,player){ - if(player.num('he')==0) return false; + if(player.countCards('he')==0) return false; var type=get.type(event.card,'trick'); return type=='basic'||type=='trick'; }, @@ -5208,7 +5208,7 @@ character.sp={ return false; }, filter:function(event,player){ - return player.num('h')==0; + return player.countCards('h')==0; }, content:function(){ trigger.num++; @@ -5216,7 +5216,7 @@ character.sp={ ai:{ effect:{ target:function(card,player,target,current){ - if(get.tag(card,'damage')&&target.num('h')==0) return [1,-2]; + if(get.tag(card,'damage')&&target.countCards('h')==0) return [1,-2]; } } } @@ -5235,8 +5235,8 @@ character.sp={ player.chooseBool(get.prompt('kunfen')).set('ai',function(){ var player=_status.event.player; if(player.hp>3) return true; - if(player.hp==3&&player.num('h')<3) return true; - if(player.hp==2&&player.num('h')==0) return true; + if(player.hp==3&&player.countCards('h')<3) return true; + if(player.hp==2&&player.countCards('h')==0) return true; return false; }); } @@ -5328,7 +5328,7 @@ character.sp={ var source=_status.event.source; if(ai.get.attitude(_status.event.player,source)>0) return 'cancel2'; if(_status.currentPhase!=source) return 'trick'; - if(lib.filter.cardUsable({name:'sha'},source)&&source.num('h')>=2) return 'basic'; + if(lib.filter.cardUsable({name:'sha'},source)&&source.countCards('h')>=2) return 'basic'; return 'trick'; }).set('prompt',get.prompt('jilei',trigger.source)).set('source',trigger.source); 'step 1' @@ -5412,7 +5412,7 @@ character.sp={ order:1, result:{ target:function(player,target){ - if(player.hp>2&&player.hp>target.hp&&target.num('he')<4){ + if(player.hp>2&&player.hp>target.hp&&target.countCards('he')<4){ return ai.get.effect(target,{name:'sha'},player,target); } return 0; @@ -5425,7 +5425,7 @@ character.sp={ trigger:{global:'discardAfter'}, filter:function(event,player){ if(event.player==player) return false; - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; for(var i=0;i0){ + if(get.color(card)=='black'&&target.countCards('h')>0){ return [1,0.5]; } } @@ -5648,7 +5648,7 @@ character.sp={ spmengjin:{ trigger:{player:'shaBegin'}, filter:function(event,player){ - return event.target.num('he')>0; + return event.target.countCards('he')>0; }, direct:true, content:function(){ @@ -5832,8 +5832,8 @@ character.sp={ var num=game.countPlayer(function(current){ return current.get('e','1'); }); - if(num>=player.num('he')){ - player.discard(player.get('he')); + if(num>=player.countCards('he')){ + player.discard(player.getCards('he')); } else if(num){ player.chooseToDiscard('he',num,true); @@ -5845,10 +5845,10 @@ character.sp={ enable:'chooseToUse', audio:2, filter:function(event,player){ - return player.hp0; + return player.hp0; }, viewAsFilter:function(player){ - return player.hp0; + return player.hp0; }, filterCard:true, position:'e', @@ -5869,7 +5869,7 @@ character.sp={ if(card.name=='sha'){ if(target.hasSkill('tongji')) return; if(game.hasPlayer(function(current){ - return current.hasSkill('tongji')&¤t.hp2) return att/Math.sqrt(1+target.num('h')); - return att/Math.sqrt(1+target.num('h'))/5; + if(att>2) return att/Math.sqrt(1+target.countCards('h')); + return att/Math.sqrt(1+target.countCards('h'))/5; } }).set('enemy',ai.get.value(event.togive[0])<0); } @@ -6183,13 +6183,13 @@ character.sp={ content:function(){ "step 0" var controls=['draw_card']; - if(trigger.target.num('he')){ + if(trigger.target.countCards('he')){ controls.push('discard_card'); } controls.push('cancel'); player.chooseControl(controls).set('ai',function(){ var trigger=_status.event.getTrigger(); - if(trigger.target.num('he')&&ai.get.attitude(_status.event.player,trigger.target)<0){ + if(trigger.target.countCards('he')&&ai.get.attitude(_status.event.player,trigger.target)<0){ return 'discard_card'; } else{ @@ -6201,7 +6201,7 @@ character.sp={ player.draw(); player.logSkill('moukui'); } - else if(result.control=='discard_card'&&trigger.target.num('he')){ + else if(result.control=='discard_card'&&trigger.target.countCards('he')){ player.discardPlayerCard(trigger.target,'he',true).logSkill=['moukui',trigger.target]; } else event.finish(); @@ -6217,7 +6217,7 @@ character.sp={ trigger:{player:'shaMiss'}, forced:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ trigger.target.discardPlayerCard(player,true); @@ -6303,7 +6303,7 @@ character.sp={ audio:2, trigger:{global:'phaseUseBegin'}, filter:function(event,player){ - return event.player!=player&&player.num('h')>0; + return event.player!=player&&player.countCards('h')>0; }, direct:true, content:function(){ @@ -6315,10 +6315,10 @@ character.sp={ else if(trigger.player.hp>2){ nono=true; } - else if(trigger.player.hp>1&&player.num('h')<3){ + 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.num('h')>=3){ + else if(trigger.player.canUse('sha',player)&&!player.num('h','shan')&&trigger.player.countCards('h')>=3){ nono=true; } var next=player.chooseToDiscard(get.prompt('zhendu',trigger.player)); @@ -6400,11 +6400,11 @@ character.sp={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, content:function(){ "step 0" - player.chooseCardButton(target,target.get('h')).set('filterButton',function(button){ + player.chooseCardButton(target,target.getCards('h')).set('filterButton',function(button){ return get.color(button.link)=='black'; }); "step 1" @@ -6416,7 +6416,7 @@ character.sp={ order:11, result:{ target:function(player,target){ - return -target.num('h'); + return -target.countCards('h'); } }, threaten:1.1 @@ -6441,7 +6441,7 @@ character.sp={ return ai.get.attitude(player,event.player)>0; }, filter:function(event,player){ - if(event.player.num('h')) return false; + if(event.player.countCards('h')) return false; if(_status.currentPhase==event.player) return false; for(var i=0;i0){ + if(current.countCards('j')&¤t!=player&&ai.get.attitude(player,current)>0){ return true; } }); @@ -6487,7 +6487,7 @@ character.sp={ player.line(targets,'green'); "step 1" if(num0; + return player!=target&&target.countCards('he')>0; }).set('ai',function(target){ return -ai.get.attitude(_status.event.player,target); }); @@ -6856,7 +6856,7 @@ character.sp={ junbing2:{ trigger:{player:'phaseEnd'}, filter:function(event,player){ - if(player.num('h')>1) return false; + if(player.countCards('h')>1) return false; return game.hasPlayer(function(current){ return current.hasSkill('junbing'); }); @@ -6866,7 +6866,7 @@ character.sp={ return current.hasSkill('junbing'); }); if(target){ - var num=target.num('h'); + var num=target.countCards('h'); var att=ai.get.attitude(player,target); if(num==0) return true; if(num==1) return att>-1; @@ -6887,7 +6887,7 @@ character.sp={ }); } "step 1" - var cards=player.get('h'); + var cards=player.getCards('h'); target.gain(cards,player); event.num=cards.length; player.$give(event.num,target); @@ -6969,7 +6969,7 @@ character.sp={ order:1, result:{ target:function(player){ - var num=player.num('h'); + var num=player.countCards('h'); if(player.hp==1) return 1; if(player.hp==2&&num<=2) return 1; if(player.hp==3&&num<=1) return 1; @@ -7007,7 +7007,7 @@ character.sp={ trigger:{player:'phaseBegin'}, check:function(event,player){ if(player.hp>2) return false; - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length3) return false; for(var i=0;i0; + return player.countCards('h')>0; }, content:function(){ "step 0" - var cards=player.get('h'); + var cards=player.getCards('h'); event.bool=cards.length>=player.hp; player.discard(cards); "step 1" @@ -7228,7 +7228,7 @@ character.sp={ content:function(){ "step 0" var check; - if(player.num('h')==0){ + if(player.countCards('h')==0){ check=false; } else{ @@ -7269,12 +7269,12 @@ character.sp={ audio:2, trigger:{global:'judge'}, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, logTarget:'player', check:function(event,player){ if(ai.get.attitude(player,event.player)<=0) return false; - var cards=player.get('he'); + var cards=player.getCards('he'); var judge=event.judge(event.player.judging[0]); for(var i=0;i0; + return player.countCards('h')>0; }, content:function(){ "step 0" @@ -7523,7 +7523,7 @@ character.sp={ audio:false, content:function(){ "step 0" - if(player.storage.bifa[1].isAlive()&&player.num('h')){ + if(player.storage.bifa[1].isAlive()&&player.countCards('h')){ player.chooseCard(get.translation(player.storage.bifa[1])+ '的笔伐牌为'+get.translation(player.storage.bifa[0]),function(card){ return get.type(card,'trick')==_status.event.type; @@ -7566,10 +7566,10 @@ character.sp={ player.storage.songci=false; }, filterTarget:function(card,player,target){ - return (!target.storage.songci&&target.num('h')!=target.hp); + return (!target.storage.songci&&target.countCards('h')!=target.hp); }, content:function(){ - if(target.num('h')>target.hp){ + if(target.countCards('h')>target.hp){ target.chooseToDiscard(2,'he',true); } else{ @@ -7587,11 +7587,11 @@ character.sp={ expose:0.2, result:{ target:function(player,target){ - if(target.num('h')target.hp){ - if(target.num('h')<=3) return -1; + else if(target.countCards('h')>target.hp){ + if(target.countCards('h')<=3) return -1; } } } @@ -7641,9 +7641,9 @@ character.sp={ if(get.tag(card,'respondShan')||get.tag(card,'respondSha')){ if(ai.get.attitude(target,player)<=0){ if(current>0) return; - if(target.num('h')==0) return 1.6; - if(target.num('h')==1) return 1.2; - if(target.num('h')==2) return [0.8,0.2,0,-0.2]; + if(target.countCards('h')==0) return 1.6; + if(target.countCards('h')==1) return 1.2; + if(target.countCards('h')==2) return [0.8,0.2,0,-0.2]; return [0.4,0.7,0,-0.7]; } } @@ -7656,11 +7656,11 @@ character.sp={ trigger:{player:'shaBefore'}, filter:function(event,player){ if(event.skill!='longdan_sha'&&event.skill!='fanghun_sha') return false; - return event.target.num('h')>0; + return event.target.countCards('h')>0; }, logTarget:'target', content:function(){ - var card=trigger.target.get('h').randomGet(); + var card=trigger.target.getCards('h').randomGet(); player.gain(card,trigger.target); trigger.target.$giveAuto(card,player); game.delay(); @@ -7672,11 +7672,11 @@ character.sp={ filter:function(event,player){ if(event.skill!='longdan_shan'&&event.skill!='longdan_sha'&& event.skill!='fanghun_shan'&&event.skill!='fanghun_sha') return false; - return event.source&&event.source.num('h')>0; + return event.source&&event.source.countCards('h')>0; }, logTarget:'source', content:function(){ - var card=trigger.source.get('h').randomGet(); + var card=trigger.source.getCards('h').randomGet(); player.gain(card,trigger.source); trigger.source.$giveAuto(card,player); game.delay(); @@ -7692,8 +7692,8 @@ character.sp={ filterCard:true, position:'he', content:function(){ - player.gain(target.get('h'),target); - target.$give(target.num('h'),player); + player.gain(target.getCards('h'),target); + target.$give(target.countCards('h'),player); player.turnOver(); player.addSkill('lihun2'); player.storage.lihun=target; @@ -7707,7 +7707,7 @@ character.sp={ return 0; }, target:function(player,target){ - if(target.num('h')>target.hp) return target.hp-target.num('h'); + if(target.countCards('h')>target.hp) return target.hp-target.countCards('h'); return 0; } }, @@ -7783,10 +7783,10 @@ character.sp={ } game.delay(); player.chooseTarget(true,function(card,player,target){ - return get.distance(_status.event.thisTarget,target)<=1&&target.num('hej'); + return get.distance(_status.event.thisTarget,target)<=1&&target.countCards('hej'); }).set('ai',function(target){ var attitude=ai.get.attitude(_status.event.player,target); - if(attitude>0&&target.num('j')){ + if(attitude>0&&target.countCards('j')){ return attitude*1.5; } return -attitude; @@ -7817,7 +7817,7 @@ character.sp={ audio:2, trigger:{target:'shaBegin'}, check:function(event,player){ - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length<=2){ for(var i=0;i0; + return player.countCards('h')>0; }, filterCard:true, selectCard:-1, @@ -7873,19 +7873,19 @@ character.sp={ result:{ player:0, target:function(player,target){ - if(player.num('h')>1){ + if(player.countCards('h')>1){ return 1; } var players=game.filterPlayer(); for(var i=0;i0){ player.draw(num); } @@ -8051,7 +8051,7 @@ character.sp={ trigger:{player:'phaseBegin'}, skillAnimation:true, check:function(event,player){ - return player.hp==1||(player.hp==2&&player.num('h')<=1); + return player.hp==1||(player.hp==2&&player.countCards('h')<=1); }, filter:function(event,player){ return !player.storage.suiren; @@ -8064,7 +8064,7 @@ character.sp={ unique:true, content:function(){ "step 0" - var check=(player.hp==1||(player.hp==2&&player.num('h')<=1)); + var check=(player.hp==1||(player.hp==2&&player.countCards('h')<=1)); player.chooseTarget(get.prompt('suiren')).set('ai',function(target){ if(!_status.event.check) return 0; return ai.get.attitude(_status.event.player,target); @@ -8086,7 +8086,7 @@ character.sp={ direct:true, audio:2, filter:function(event){ - return event.card&&event.card.name=='sha'&&event.player.num('e'); + return event.card&&event.card.name=='sha'&&event.player.countCards('e'); }, content:function(){ "step 0" diff --git a/character/standard.js b/character/standard.js index fa8346af1..ac67736dd 100644 --- a/character/standard.js +++ b/character/standard.js @@ -154,7 +154,7 @@ character.standard={ trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ - return (event.source&&event.source.num('he')&&event.source!=player); + return (event.source&&event.source.countCards('he')&&event.source!=player); }, content:function(){ player.gainPlayerCard(get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['fankui',trigger.source]); @@ -162,7 +162,7 @@ character.standard={ ai:{ effect:{ target:function(card,player,target){ - if(player.num('he')>1&&get.tag(card,'damage')){ + if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1.5]; if(ai.get.attitude(target,player)<0) return [1,1]; } @@ -175,7 +175,7 @@ character.standard={ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" @@ -274,11 +274,11 @@ character.standard={ "step 0" var check; var i,num=game.countPlayer(function(current){ - return current!=player&¤t.num('h')&&ai.get.attitude(player,current)<=0; + return current!=player&¤t.countCards('h')&&ai.get.attitude(player,current)<=0; }); check=(num>=2); player.chooseTarget(get.prompt('tuxi'),[1,2],function(card,player,target){ - return target.num('h')>0&&player!=target; + return target.countCards('h')>0&&player!=target; },function(target){ if(!_status.event.aicheck) return 0; var att=ai.get.attitude(_status.event.player,target); @@ -307,7 +307,7 @@ character.standard={ audio:2, trigger:{player:'phaseDrawBegin'}, check:function(event,player){ - if(player.num('h')<3) return false; + if(player.countCards('h')<3) return false; if(!player.hasSha()) return false; return game.hasPlayer(function(current){ return ai.get.attitude(player,current)<0&&player.canUse('sha',current); @@ -374,7 +374,7 @@ character.standard={ ai1:function(card){ if(ui.selected.cards.length>0) return -1; if(card.name=='du') return 20; - return (_status.event.player.num('h')-_status.event.player.hp); + return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); @@ -498,7 +498,7 @@ character.standard={ if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(!ui.selected.cards.length&&card.name=='du') return 20; var player=get.owner(card); - if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ + if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){ if(ui.selected.cards.length){ return -1; } @@ -512,8 +512,8 @@ character.standard={ return 11-ai.get.value(card); } } - if(player.num('h')>player.hp) return 10-ai.get.value(card); - if(player.num('h')>2) return 6-ai.get.value(card); + if(player.countCards('h')>player.hp) return 10-ai.get.value(card); + if(player.countCards('h')>2) return 6-ai.get.value(card); return -1; } return 10-ai.get.value(card); @@ -533,7 +533,7 @@ character.standard={ }, ai:{ order:function(skill,player){ - if(player.hp1){ + if(player.hp1){ return 10; } return 1; @@ -545,9 +545,9 @@ character.standard={ return -10; } if(target.num('j','lebu')) return 0; - var nh=target.num('h'); - var np=player.num('h'); - if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ + var nh=target.countCards('h'); + var np=player.countCards('h'); + if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){ if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0; } return Math.max(1,5-nh); @@ -736,7 +736,7 @@ character.standard={ viewAs:{name:'sha'}, viewAsFilter:function(player){ if(get.zhu(player,'shouyue')){ - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; } else{ if(!player.num('he',{color:'red'})) return false; @@ -747,7 +747,7 @@ character.standard={ ai:{ skillTagFilter:function(player){ if(get.zhu(player,'shouyue')){ - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; } else{ if(!player.num('he',{color:'red'})) return false; @@ -966,7 +966,7 @@ character.standard={ kongcheng:{ mod:{ targetEnabled:function(card,player,target,now){ - if(target.num('h')==0){ + if(target.countCards('h')==0){ if(card.name=='sha'||card.name=='juedou') return false; } } @@ -976,7 +976,7 @@ character.standard={ noh:true, skillTagFilter:function(player,tag){ if(tag=='noh'){ - if(player.num('h')!=1) return false; + if(player.countCards('h')!=1) return false; } } } @@ -986,7 +986,7 @@ character.standard={ trigger:{player:'loseEnd'}, forced:true, filter:function(event,player){ - if(player.num('h')) return false; + if(player.countCards('h')) return false; for(var i=0;i=player.hp-1) return -1; + if(player.countCards('h')>=player.hp-1) return -1; if(player.hp<3) return -1; return 1; } @@ -1228,7 +1228,7 @@ character.standard={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ return player!=target; @@ -1247,7 +1247,7 @@ character.standard={ game.log(target,'选择了'+get.translation(result.control)); event.choice=result.control; target.popup(event.choice); - event.card=player.get('h').randomGet(); + event.card=player.getCards('h').randomGet(); target.gain(event.card,player); player.$give(event.card,target); game.delay(); @@ -1261,11 +1261,11 @@ character.standard={ var eff=ai.get.damageEffect(target,player); if(eff>=0) return 1+eff; var value=0,i; - var cards=player.get('h'); + var cards=player.getCards('h'); for(i=0;i0; @@ -1390,7 +1390,7 @@ character.standard={ trigger:{player:'loseEnd'}, frequent:true, filter:function(event,player){ - if(player.num('h')) return false; + if(player.countCards('h')) return false; for(var i=0;iplayer.hp) + if(player.countCards('h')>player.hp) return 8-ai.get.value(card) if(player.hpplayer.hp) return 0 + if(player.countCards('h')>player.hp) return 0 return -1; }, target:4 @@ -1498,7 +1498,7 @@ character.standard={ result:{ target:function(player,target){ if(target.hp==1) return 5; - if(player==target&&player.num('h')>player.hp) return 5; + if(player==target&&player.countCards('h')>player.hp) return 5; return 2; } }, @@ -1579,7 +1579,7 @@ character.standard={ ai:{ result:{ target:function(card,player,target){ - if(card.name=='juedou'&&target.num('h')>0) return [1,0,0,-1]; + if(card.name=='juedou'&&target.countCards('h')>0) return [1,0,0,-1]; } } } diff --git a/character/swd.js b/character/swd.js index e43b74871..601b02d23 100644 --- a/character/swd.js +++ b/character/swd.js @@ -240,7 +240,7 @@ character.swd={ gaizao:{ trigger:{player:'useCardToBegin'}, filter:function(event,player){ - if(player.num('e')==5) return false; + if(player.countCards('e')==5) return false; return lib.skill.gaizao.filterx(event.card,player)&&event.target==player; }, direct:true, @@ -285,7 +285,7 @@ character.swd={ ai:{ effect:{ target:function(card,player,target,current){ - if(target==player&&lib.skill.gaizao.filterx(card,target)&&target.num('e')<5){ + if(target==player&&lib.skill.gaizao.filterx(card,target)&&target.countCards('e')<5){ return [1,3]; } } @@ -295,7 +295,7 @@ character.swd={ lingshi:{ mod:{ attackFrom:function(from,to,distance){ - return distance-from.num('e')*2; + return distance-from.countCards('e')*2; }, cardUsable:function(card,player,num){ if(card.name=='sha'&&player.get('e','5')) return num+1; @@ -428,7 +428,7 @@ character.swd={ return player.isFewestHandcard(); }, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' @@ -500,8 +500,8 @@ character.swd={ target:function(card,player,target,current){ if(!player.isLinked()&¤t<0) return 1.5; if(!target.hasFriend()) return; - if(get.tag(card,'loseCard')&&_status.currentPhase!=target&&target.num('he')){ - return [0.5,Math.max(2,target.num('h'))]; + if(get.tag(card,'loseCard')&&_status.currentPhase!=target&&target.countCards('he')){ + return [0.5,Math.max(2,target.countCards('h'))]; } if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ if(ai.get.attitude(player,target)>0&&card.name=='juedou') return; @@ -568,7 +568,7 @@ character.swd={ }, filter:function(event,player){ if(player==_status.currentPhase) return false; - if(!_status.currentPhase.num('he')) return false; + if(!_status.currentPhase.countCards('he')) return false; return event.cards&&event.cards.length==1; }, content:function(){ @@ -699,7 +699,7 @@ character.swd={ hjifeng:{ enable:'phaseUse', filter:function(event,player){ - if(!player.num('h')) return false; + if(!player.countCards('h')) return false; if(player.num('h',{type:'jiqi'})) return false; return true; }, @@ -828,7 +828,7 @@ character.swd={ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); - var hs=target.num('h'); + var hs=target.countCards('h'); if(shans>1) return [1,1]; if(shans&&hs>2) return [1,1]; if(shans) return [1,0.5]; @@ -878,7 +878,7 @@ character.swd={ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); - var hs=target.num('h'); + var hs=target.countCards('h'); if(shans>1) return [0,1]; if(shans&&hs>2) return [0,1]; if(shans) return [0,0]; @@ -896,7 +896,7 @@ character.swd={ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ "step 0" @@ -1009,7 +1009,7 @@ character.swd={ }, logTarget:'target', filter:function(event,player){ - return event.target.num('he')>0; + return event.target.countCards('he')>0; }, content:function(){ trigger.target.chooseToDiscard('he',true); @@ -1332,14 +1332,14 @@ character.swd={ alter:true, check:function(event,player){ return game.hasPlayer(function(current){ - return ai.get.attitude(player,current)>2&¤t.num('h')==1 + return ai.get.attitude(player,current)>2&¤t.countCards('h')==1 }); }, filter:function(event,player){ if(event.source==player) return false; if(get.distance(player,event.player)>1) return false; return game.hasPlayer(function(current){ - return current.num('h'); + return current.countCards('h'); }); }, content:function(){ @@ -1362,10 +1362,10 @@ character.swd={ dist=1; } var next=player.chooseTarget(true,dialog,function(card,player,target){ - return target.num('h')>0&&get.distance(player,target)<=dist; + return target.countCards('h')>0&&get.distance(player,target)<=dist; }).ai=function(target){ var att=ai.get.attitude(player,target); - var hs=target.get('h'); + var hs=target.getCards('h'); var num=hs.length; if(num<=1) return att*2; if(num==2){ @@ -1398,7 +1398,7 @@ character.swd={ var target=result.targets[0]; player.line(target,'green'); // player.logSkill('guozao',target,'green',true); - var cards=target.get('h'); + var cards=target.getCards('h'); target.lose(cards)._triggered=null; game.log(target,'弃置了',cards,',并获得三张牌'); // target.$draw(3); @@ -1416,7 +1416,7 @@ character.swd={ heihuo:{ enable:'phaseUse', filter:function(event,player){ - return player.num('h')>0&&player.num('he',{type:'equip'})>0&&!player.hasSkill('heihuo2'); + return player.countCards('h')>0&&player.num('he',{type:'equip'})>0&&!player.hasSkill('heihuo2'); }, filterCard:function(card){ return get.type(card)=='equip'; @@ -1424,7 +1424,7 @@ character.swd={ position:'he', check:function(card){ var player=_status.currentPhase; - var nh=player.num('h'); + var nh=player.countCards('h'); var pos=get.position(card); if(nh<2) return 0; if(nh>4) return 0; @@ -1436,9 +1436,9 @@ character.swd={ }, content:function(){ "step 0" - player.draw(player.num('h')); + player.draw(player.countCards('h')); "step 1" - if(player.num('h')>=8){ + if(player.countCards('h')>=8){ player.damage(3,'fire'); player.addTempSkill('heihuo2','phaseAfter'); } @@ -1460,7 +1460,7 @@ character.swd={ respondShan:true, skillTagFilter:function(player,tag){ if(tag=='respondShan'&&get.is.altered('yaotong')) return false; - if(player.num('h')%2==0) return false; + if(player.countCards('h')%2==0) return false; }, }, threaten:1.3 @@ -1470,7 +1470,7 @@ character.swd={ filterCard:true, viewAs:{name:'sha'}, filter:function(event,player){ - var num=player.num('h'); + var num=player.countCards('h'); if(num==0) return false; return num%2==1; }, @@ -1483,7 +1483,7 @@ character.swd={ viewAs:{name:'shan'}, filter:function(event,player){ if(get.is.altered('yaotong')) return false; - var num=player.num('h'); + var num=player.countCards('h'); if(num==0) return false; return num%2==1; }, @@ -1495,12 +1495,12 @@ character.swd={ filterCard:true, viewAs:{name:'wuxie'}, filter:function(event,player){ - var num=player.num('h'); + var num=player.countCards('h'); if(num==0) return false; return num%2==0; }, viewAsFilter:function(player){ - var num=player.num('h'); + var num=player.countCards('h'); if(num==0) return false; return num%2==0; }, @@ -1512,12 +1512,12 @@ character.swd={ filterCard:true, viewAs:{name:'tao'}, filter:function(event,player){ - var num=player.num('h'); + var num=player.countCards('h'); if(num==0) return false; return num%2==0; }, viewAsFilter:function(player){ - var num=player.num('h'); + var num=player.countCards('h'); if(num==0) return false; return num%2==0; }, @@ -1527,7 +1527,7 @@ character.swd={ pojian:{ trigger:{player:'loseEnd'}, filter:function(event,player){ - if(player.num('h')) return false; + if(player.countCards('h')) return false; for(var i=0;i0; + return player.countCards('he')>0; }, filterCard:true, position:'he', @@ -1618,7 +1618,7 @@ character.swd={ "step 0" game.delay(0.5); player.chooseTarget(get.prompt('yuchen'),function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); }; @@ -1642,7 +1642,7 @@ character.swd={ return card.name=='sha'&&get.color(card)=='black'; }, filterTarget:function(card,player,target){ - return player!=target&&target.num('h')>0; + return player!=target&&target.countCards('h')>0; }, line:'thunder', content:function(){ @@ -1671,12 +1671,12 @@ character.swd={ trigger:{global:'phaseUseBefore'}, direct:true, filter:function(event,player){ - return event.player!=player&&player.num('he',{type:'basic'})2; + trigger.player.countCards('h')>2; var next=player.chooseToDiscard(function(card){ return get.type(card)!='basic'; },get.prompt('rumeng',trigger.player),'he'); @@ -1711,7 +1711,7 @@ character.swd={ trigger:{player:'shaAfter'}, direct:true, filter:function(event,player){ - return event.target.isAlive()&&player.num('he')>0&&!player.hasSkill('lianda2'); + return event.target.isAlive()&&player.countCards('he')>0&&!player.hasSkill('lianda2'); }, content:function(){ "step 0" @@ -1748,12 +1748,12 @@ character.swd={ return 1; } if(att>3){ - return att+Math.max(0,5-target.num('h')); + return att+Math.max(0,5-target.countCards('h')); } return att/4; } if(att>3){ - return att+Math.max(0,5-target.num('h')); + return att+Math.max(0,5-target.countCards('h')); } return att; } @@ -1841,7 +1841,7 @@ character.swd={ priority:5, filter:function(event,player){ if(player==event.target||player==event.player) return false; - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; return get.distance(event.player,player,'attack')<=1; }, content:function(){ @@ -1850,7 +1850,7 @@ character.swd={ if(ai.get.attitude(player,trigger.target)>2){ if(player.num('h','shan')||player.get('e','2')|| trigger.target.hp==1||player.hp>trigger.target.hp+1){ - if(!trigger.target.num('h','shan')||trigger.target.num('h')3){ - return 100-target.num('h'); + return 100-target.countCards('h'); } return att; } @@ -1938,7 +1938,7 @@ character.swd={ trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ - if(player.num('he')==0) return false; + if(player.countCards('he')==0) return false; return game.hasPlayer(function(current){ return (current!=player&&get.distance(player,current,'attack')<=1&&player.hp<=current.hp); }); @@ -2053,8 +2053,8 @@ character.swd={ content:function(){ player.storage.pingshen2=true; player.unmarkSkill('pingshen2'); - player.gain(target.get('h'),target); - target.$give(target.num('h'),player); + player.gain(target.getCards('h'),target); + target.$give(target.countCards('h'),player); player.turnOver(); player.addSkill('pingshen3'); }, @@ -2070,7 +2070,7 @@ character.swd={ if(ai.get.attitude(player,player.storage.pingshen)>=0){ return 0; } - if(player.storage.pingshen.num('h')>player.storage.pingshen.hp) return 1; + if(player.storage.pingshen.countCards('h')>player.storage.pingshen.hp) return 1; return 0; } }, @@ -2127,7 +2127,7 @@ character.swd={ filterCard:true, position:'he', filterTarget:function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }, check:function(card){ if(get.type(card)=='equip'){ @@ -2184,7 +2184,7 @@ character.swd={ var att=ai.get.attitude(player,target); if(att<=-0.5) return 0; if(att<=3) return att+0.5; - return att+Math.min(0.5,5-target.num('h')); + return att+Math.min(0.5,5-target.countCards('h')); } "step 1" if(result.bool){ @@ -2209,7 +2209,7 @@ character.swd={ } else{ if(!target.hasFriend()) return; - var hs=target.num('h'); + var hs=target.countCards('h'); if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); if(shans>1) return [0,1]; @@ -2320,7 +2320,7 @@ character.swd={ viewAs:{name:'sha'}, prompt:'将两张牌当杀使用', check:function(card){ - if(_status.event.player.num('h')<4) return 6-ai.get.useful(card); + if(_status.event.player.countCards('h')<4) return 6-ai.get.useful(card); return 7-ai.get.useful(card); }, ai:{ @@ -2411,7 +2411,7 @@ character.swd={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('h')>0&&!player.storage.hutian; + return player.countCards('h')>0&&!player.storage.hutian; }, content:function(){ "step 0" @@ -2420,7 +2420,7 @@ character.swd={ return target.maxHp>=ui.selected.cards.length; }, filterCard:true, - selectCard:[1,player.num('he')], + selectCard:[1,player.countCards('he')], ai1:function(card){ var useful=ai.get.useful(card); if(card.name=='du'){ @@ -2531,7 +2531,7 @@ character.swd={ direct:true, content:function(){ "step 0" - if(player.num('he')){ + if(player.countCards('he')){ player.chooseCardTarget({ prompt:get.prompt('huanxing'), filterCard:lib.filter.cardDiscardable, @@ -2620,7 +2620,7 @@ character.swd={ viewAs:{name:'toulianghuanzhu'}, prompt:'将一张黑色牌当作偷梁换柱使用', check:function(card){ - if(_status.event.player.num('h')>_status.event.player.hp){ + if(_status.event.player.countCards('h')>_status.event.player.hp){ return 5-ai.get.value(card) } return 0; @@ -2633,7 +2633,7 @@ character.swd={ }, direct:true, filter:function(event,player){ - return event.player.num('e'); + return event.player.countCards('e'); }, content:function(){ "step 0" @@ -2646,7 +2646,7 @@ character.swd={ next.logSkill=['suiyan',trigger.player]; "step 1" if(result.bool){ - trigger.player.discard(trigger.player.get('e')); + trigger.player.discard(trigger.player.getCards('e')); } }, ai:{ @@ -2718,7 +2718,7 @@ character.swd={ return; } } - if(target.num('h')>2||target.num('e',{color:'black'})){ + if(target.countCards('h')>2||target.num('e',{color:'black'})){ return [1,0,0,-1]; } return [1,-0.5]; @@ -3293,7 +3293,7 @@ character.swd={ if(nme=='chiyuxi') return val; 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].num('h')>trigger.targets[0].hp) 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=='jiedao'&&trigger.targets[0]==player) return val; if(nme=='yihuajiemu'&&trigger.targets[0]==player) return val; @@ -3318,7 +3318,7 @@ character.swd={ effect:{ player:function(card,player,target){ if(player!=target) return; - if(get.type(card)=='equip'&&player.num('h')<=player.hp){ + if(get.type(card)=='equip'&&player.countCards('h')<=player.hp){ return [0,0,0,0]; } } @@ -3368,7 +3368,7 @@ character.swd={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, selectCard:2, filterCard:true, @@ -3415,7 +3415,7 @@ character.swd={ trigger:{source:'damageAfter'}, direct:true, filter:function(event,player){ - return event.parent.name!='dangping'&&!player.hasSkill('dangping2')&&player.num('he')>0; + return event.parent.name!='dangping'&&!player.hasSkill('dangping2')&&player.countCards('he')>0; }, content:function(){ "step 0" @@ -3449,10 +3449,10 @@ character.swd={ duishi:{ enable:'phaseUse', filter:function(event,player){ - return player.num('h')>0&&!player.hasSkill('duishi2'); + return player.countCards('h')>0&&!player.hasSkill('duishi2'); }, filterTarget:function(card,player,target){ - return player!=target&&target.num('h')>0&&!target.hasSkill('duishi3'); + return player!=target&&target.countCards('h')>0&&!target.hasSkill('duishi3'); }, filterCard:true, check:function(card){return 8-ai.get.value(card)}, @@ -3491,7 +3491,7 @@ character.swd={ popup:false, direct:true, filter:function(event,player){ - return player.num('h'); + return player.countCards('h'); }, content:function(){ "step 0" @@ -3616,18 +3616,18 @@ character.swd={ alter:true, filter:function(event,player){ if(get.is.altered('mufeng')){ - return player.num('h')player.num('h'); + Math.min(5,event.player.countCards('h'))>player.countCards('h'); }, content:function(){ - player.draw(Math.min(5,trigger.player.num('h'))-player.num('h')); + player.draw(Math.min(5,trigger.player.countCards('h'))-player.countCards('h')); player.addTempSkill('mufeng2',{player:'phaseBegin'}); }, }, @@ -3701,7 +3701,7 @@ character.swd={ player.damage(trigger.player); } else{ - if(player.num('he')){ + if(player.countCards('he')){ var att=ai.get.attitude(trigger.player,player); trigger.player.discardPlayerCard(player,'he',function(button){ if(att>0) return 0; @@ -3730,13 +3730,13 @@ character.swd={ usable:1, filterTarget:function(card,player,target){ if(player==target) return false; - return target.num('h')>0; + return target.countCards('h')>0; }, selectTarget:2, multitarget:true, multiline:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, prepare:'throw', discard:false, @@ -3746,7 +3746,7 @@ character.swd={ }, content:function(){ "step 0" - if(targets[0].num('h')&&targets[1].num('h')){ + if(targets[0].countCards('h')&&targets[1].countCards('h')){ targets[0].chooseToCompare(targets[1]); } else{ @@ -3840,7 +3840,7 @@ character.swd={ "step 1" if(event.num=2; + return event.targets.length==1&&event.player!=player&&player.countCards('h')>=2; }, content:function(){ "step 0" @@ -4120,10 +4120,10 @@ character.swd={ }, ai:{ threaten:function(player,target){ - if(target.num('h')<=2){ + if(target.countCards('h')<=2){ return 2; } - return 2/(target.num('h')-1); + return 2/(target.countCards('h')-1); } } }, @@ -4131,7 +4131,7 @@ character.swd={ trigger:{global:'discardAfter'}, filter:function(event,player){ if(event.player==player) return false; - if(player.num('h')>=5) return false; + if(player.countCards('h')>=5) return false; for(var i=0;iplayer.hp) return 20; + if(player==target&&player.countCards('h')>player.hp) return 20; return ai.get.recoverEffect(target,player,target); } }, @@ -4418,12 +4418,12 @@ character.swd={ }, filter:function(event,player){ if(get.is.altered('susheng')&&!player.num('h',{color:'red'})) return false; - return player.num('h')>0&&!player.hasSkill('susheng2'); + return player.countCards('h')>0&&!player.hasSkill('susheng2'); }, content:function(){ "step 0" var att=ai.get.attitude(player,trigger.player); - var nh=player.num('h'); + var nh=player.countCards('h'); var next; if(get.is.altered('susheng')){ next=player.chooseToDiscard(get.prompt('susheng',trigger.player),{color:'red'}); @@ -4511,7 +4511,7 @@ character.swd={ for(var i=0;i0){ num+=num2; } @@ -4537,7 +4537,7 @@ character.swd={ for(var i=0;i0 + return player.countCards('h')>0 }, filterTarget:function(card,player,target){ return player!=target @@ -4674,7 +4674,7 @@ character.swd={ if(ui.selected.cards.length){ return get.suit(card)==get.suit(ui.selected.cards[0]); } - var cards=player.get('h'); + var cards=player.getCards('h'); for(var i=0;i0 + return player.countCards('h')>0 }, filterTarget:function(card,player,target){ return player!=target @@ -4718,7 +4718,7 @@ character.swd={ if(ui.selected.cards.length){ return get.suit(card)==get.suit(ui.selected.cards[0]); } - var cards=player.get('h'); + var cards=player.getCards('h'); for(var i=0;i0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }, filterCard:function(card){ var suit=get.suit(card); @@ -4774,7 +4774,7 @@ character.swd={ for(var i=0;ilength) return -1.5+eff; @@ -4908,7 +4908,7 @@ character.swd={ direct:true, filter:function(event,player){ if(event.player==player) return false; - return player.num('he')>0; + return player.countCards('he')>0; }, trigger:{target:'useCardToBefore'}, content:function(){ @@ -5010,7 +5010,7 @@ character.swd={ game.delay(0.5); player.chooseTarget([1,1],'请选择巧械的目标',function(card,player,target){ if(player==target) return false; - return target.num('he')>0; + return target.countCards('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target); }; @@ -5044,7 +5044,7 @@ character.swd={ direct:true, filter:function(event,player){ if(player.equiping) return false; - if(player.num('e')) return false; + if(player.countCards('e')) return false; for(var i=0;i0; + return target.countCards('he')>0; }).ai=function(target){ var att=ai.get.attitude(player,target); if(att<=0){ - return 1-att+(target.num('e')?2:0); + return 1-att+(target.countCards('e')?2:0); } return 0; }; @@ -5184,14 +5184,14 @@ character.swd={ trigger:{source:'damageEnd'}, direct:true, filter:function(event){ - return event.card&&event.card.name=='sha'&&event.player.num('he'); + return event.card&&event.card.name=='sha'&&event.player.countCards('he'); }, check:function(event,player){ return ai.get.attitude(player,event.player)<0; }, content:function(){ var num=1; - if(trigger.player.num('e')&&trigger.player.num('h')){ + if(trigger.player.countCards('e')&&trigger.player.countCards('h')){ num=2; } var next=player.discardPlayerCard(trigger.player,[1,num],get.prompt('guanhu',trigger.player)); @@ -5233,17 +5233,17 @@ character.swd={ trigger:{source:'damageEnd'}, forced:true, filter:function(event,player){ - return event.player.num('hej'); + return event.player.countCards('hej'); }, content:function(){ - trigger.player.discard(trigger.player.get('hej').randomGet()); + trigger.player.discard(trigger.player.getCards('hej').randomGet()); } }, huanhun:{ trigger:{global:'dying'}, priority:6, filter:function(event,player){ - return event.player.hp<=0&&player.num('he')>0; + return event.player.hp<=0&&player.countCards('he')>0; }, direct:true, content:function(){ @@ -5343,7 +5343,7 @@ character.swd={ trigger.player.draw(); event.finish(); } - else if(trigger.player!=player&&trigger.player.num('h')>=player.num('h')){ + else if(trigger.player!=player&&trigger.player.countCards('h')>=player.countCards('h')){ game.asyncDraw([trigger.player,player]); } else{ @@ -5363,7 +5363,7 @@ character.swd={ return event.source&&ai.get.attitude(player,event.source)<0; }, filter:function(event,player){ - return event.source&&event.source!=player&&event.source.num('he'); + return event.source&&event.source!=player&&event.source.countCards('he'); }, logTarget:'source', content:function(){ @@ -5380,12 +5380,12 @@ character.swd={ direct:true, content:function(){ "step 0" - var next=player.chooseToDiscard('请选择发动代形的卡牌','he',[1,player.num('he')]); + var next=player.chooseToDiscard('请选择发动代形的卡牌','he',[1,player.countCards('he')]); next.logSkill='daixing'; next.ai=function(card){ if(ui.selected.cards.length>=2) return 0; if(ui.selected.cards.length==1){ - if(player.num('h')>player.hp){ + if(player.countCards('h')>player.hp){ return 3-ai.get.value(card); } return 0; @@ -5595,7 +5595,7 @@ character.swd={ }, usable:1, filter:function(event,player){ - if(get.is.altered('xianjiang')&&player.num('e')) return false; + if(get.is.altered('xianjiang')&&player.countCards('e')) return false; if(player.num('h',{type:'trick'})) return true; if(player.num('h',{type:'delay'})) return true; return false; @@ -5621,7 +5621,7 @@ character.swd={ trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; if(event.filterCard({name:'shan'})){ if(game.hasPlayer(function(current){ return current!=player&¤t.get('e','2'); @@ -5677,14 +5677,14 @@ character.swd={ var target=get.owner(result.buttons[0].link); target.discard(result.buttons[0].link); target.draw(); - if(player.num('he')) player.chooseToDiscard(true,'he'); + if(player.countCards('he')) player.chooseToDiscard(true,'he'); player.logSkill('shengong',target); } }, ai:{ effect:{ target:function(card,player,target,current){ - var he=target.num('he'); + var he=target.countCards('he'); if(!he) return 1.5; if(he<=1) return; if(get.tag(card,'respondShan')){ @@ -5709,7 +5709,7 @@ character.swd={ trigger:{player:'phaseUseEnd'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ "step 0" @@ -5743,7 +5743,7 @@ character.swd={ return ai.get.attitude(player,event.player)<0; }, filter:function(event,player){ - return event.player.num('e'); + return event.player.countCards('e'); }, direct:true, content:function(){ @@ -5761,7 +5761,7 @@ character.swd={ filter:function(event,player){ if(event.name=='phase') return true; if(get.is.altered('jikong')) return false; - if(player.num('h')) return false; + if(player.countCards('h')) return false; for(var i=0;i0){ - num-=players[i].num('he')-2; + num-=players[i].countCards('he')-2; } else if(att<0){ - num+=players[i].num('he')-2; + num+=players[i].countCards('he')-2; } } if(player.hp==1) return num-1; @@ -5884,7 +5884,7 @@ character.swd={ ai:{ effect:{ target:function(card,player,target){ - if(target.num('he')&&(get.tag(card,'respondShan')||get.tag(card,'respondSha'))) return 0.6 + if(target.countCards('he')&&(get.tag(card,'respondShan')||get.tag(card,'respondSha'))) return 0.6 } }, respondSha:true, @@ -5923,14 +5923,14 @@ character.swd={ ai:{ effect:{ target:function(card,player,target,current){ - if(card.name=='sha'&&target.num('h')>1&&player.get('e','1')){ + if(card.name=='sha'&&target.countCards('h')>1&&player.get('e','1')){ return [1,0.5,0,-0.5]; } } } } // filter:function(event){ - // return event.player.num('e')>0; + // return event.player.countCards('e')>0; // }, // content:function(){ // "step 0" @@ -5947,13 +5947,13 @@ character.swd={ taixu:{ enable:'phaseUse', filter:function(event,player){ - return (!player.storage.taixu)&&player.num('hej'); + return (!player.storage.taixu)&&player.countCards('hej'); }, filterTarget:function(card,player,target){ return player!=target&&target.hp>1; }, content:function(){ - player.discard(player.get('hej')); + player.discard(player.getCards('hej')); player.storage.taixu=true; target.damage(player.maxHp-player.hp); }, @@ -5967,7 +5967,7 @@ character.swd={ return -2; }, player:function(player,target){ - return -0.5*player.num('he'); + return -0.5*player.countCards('he'); } } } @@ -5977,9 +5977,9 @@ character.swd={ filter:function(event,player){ if(!event.source) return false; if(get.is.altered('pozhen')){ - return event.source.num('h')>player.num('h'); + return event.source.countCards('h')>player.countCards('h'); } - return event.source.num('h')!=player.num('h'); + return event.source.countCards('h')!=player.countCards('h'); }, alter:true, // check:function(event,player){ @@ -5988,7 +5988,7 @@ character.swd={ direct:true, content:function(){ "step 0" - var num=player.num('h')-trigger.source.num('h'); + var num=player.countCards('h')-trigger.source.countCards('h'); event.num=num; if(num>0){ var next=player.chooseToDiscard(num,'是否弃置'+num+'张手牌,并对'+get.translation(trigger.source)+'造成一点伤害?'); @@ -6015,7 +6015,7 @@ character.swd={ } else{ player.logSkill('pozhen',trigger.source); - var cards=trigger.source.get('h'); + var cards=trigger.source.getCards('h'); cards.sort(lib.sort.random); trigger.source.discard(cards.slice(0,-event.num)); } @@ -6026,7 +6026,7 @@ character.swd={ target:function(card,player,target){ if(get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1]; - var num=player.num('h')-target.num('h'); + var num=player.countCards('h')-target.countCards('h'); if(num>0){ return [1,0,0,-num/2]; } @@ -6041,13 +6041,13 @@ character.swd={ tanlin_defence:{ trigger:{player:'damageEnd'}, filter:function(event,player){ - return player.num('h')&&event.source&&event.source.num('h'); + return player.countCards('h')&&event.source&&event.source.countCards('h'); }, direct:true, content:function(){ "step 0" - player.chooseToDiscard([1,trigger.source.num('h')],'弃置任意张手牌并令伤害来源弃置等量手牌').ai=function(card){ - if(ui.selected.cards.length>=trigger.source.num('h')) return -1; + player.chooseToDiscard([1,trigger.source.countCards('h')],'弃置任意张手牌并令伤害来源弃置等量手牌').ai=function(card){ + if(ui.selected.cards.length>=trigger.source.countCards('h')) return -1; if(ui.selected.cards.length==0) return 8-ai.get.value(card); return 4-ai.get.value(card); } @@ -6065,7 +6065,7 @@ character.swd={ ai:{ effect:{ target:function(card,player,target){ - if(get.tag(card,'damage')&&target.num('h')&&target.hp>1&&player!=target) return [1,0.2,0,-0.2]; + if(get.tag(card,'damage')&&target.countCards('h')&&target.hp>1&&player!=target) return [1,0.2,0,-0.2]; } } } @@ -6075,10 +6075,10 @@ character.swd={ usable:1, group:'tanlin4', filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" @@ -6099,8 +6099,8 @@ character.swd={ ai:{ result:{ target:function(player,target){ - var cards=player.get('h'); - var num=target.num('h'); + var cards=player.getCards('h'); + var num=target.countCards('h'); if(num>cards.length+3&&player.hp>1) return -2; if(num>cards.length+1&&player.hp>1) return -1; if(num==cards.length-1&&player.hp>1&&!get.is.altered('pozhen')) return -1; @@ -6158,13 +6158,13 @@ character.swd={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, filterCard:true, selectCard:[1,Infinity], content:function(){ "step 0" - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); if(!card){ event.finish(); return; @@ -6201,7 +6201,7 @@ character.swd={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, filterCard:function(card){ if(get.is.altered('yunchou')){ @@ -6220,7 +6220,7 @@ character.swd={ alter:true, content:function(){ "step 0" - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); if(!card){ event.finish(); return; @@ -6233,7 +6233,7 @@ character.swd={ if(event.bool){ player.draw(); } - else if(player.num('he')){ + else if(player.countCards('he')){ target.draw(); } }, @@ -6332,7 +6332,7 @@ character.swd={ }, mark:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ 'step 0' @@ -6596,7 +6596,7 @@ character.swd={ order:1, result:{ player:function(player,target){ - if(player.num('h')>player.hp) return 1; + if(player.countCards('h')>player.hp) return 1; return 0; } } @@ -6723,10 +6723,10 @@ character.swd={ usable:1, filterCard:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }, check:function(card){ return 7-ai.get.value(card); @@ -6739,7 +6739,7 @@ character.swd={ order:9, result:{ target:function(player,target){ - if(target.num('he')==1) return -1.5; + if(target.countCards('he')==1) return -1.5; return -1; } }, @@ -6784,7 +6784,7 @@ character.swd={ return true; }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterCard:true, check:function(card){ @@ -6814,14 +6814,14 @@ character.swd={ prepare:'give2', filterTarget:function(card,player,target){ if(player==target) return false; - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; if(target.storage.funiao) return false; return true; }, filterCard:true, check:function(card){ if(card.name=='du') return 20; - if(get.owner(card).num('h')0){ - return [1,0.1,0,-target.num('h')/4]; + if(get.color(card)=='black'&&ai.get.attitude(target,player)<0&&target.countCards('h')>0){ + return [1,0.1,0,-target.countCards('h')/4]; } } } @@ -7015,7 +7015,7 @@ character.swd={ xielv:{ trigger:{player:'phaseDiscardEnd'}, filter:function(event,player){ - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length<2) return false; var color=get.color(cards[0]); for(var i=1;i0; }, content:function(){ @@ -7038,13 +7038,13 @@ character.swd={ 'step 1' player.recover(); event.targets=game.filterPlayer(function(current){ - return current.num('j'); + return current.countCards('j'); }); event.targets.sortBySeat(); 'step 2' if(event.targets.length){ var current=event.targets.shift(); - var js=current.get('j'); + var js=current.getCards('j'); if(js.length){ current.discard(js); player.line(current,'green'); @@ -7096,7 +7096,7 @@ character.swd={ xielv_old:{ trigger:{player:'phaseDiscardEnd'}, filter:function(event,player){ - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length<2) return false; var color=get.color(cards[0]); for(var i=1;i0; + return target.countCards('j')>0; }, usable:1, selectTarget:-1, filter:function(){ return game.hasPlayer(function(current){ - return current.num('j'); + return current.countCards('j'); }); }, line:'fire', content:function(){ "step 0" - event.num=target.num('j'); - target.discard(target.get('j')); + event.num=target.countCards('j'); + target.discard(target.getCards('j')); "step 1" target.damage(event.num,'fire','nosource') }, @@ -7178,7 +7178,7 @@ character.swd={ target:function(player,target){ var eff=ai.get.damageEffect(target,player,target,'fire'); if(eff>=0) return eff+1; - var judges=target.get('j'); + var judges=target.getCards('j'); if(!judges.length) return 0; if(target.hp==1||judges.length>1) return -judges.length; var name=judges[0].viewAs||judges[0].name; @@ -7251,7 +7251,7 @@ character.swd={ if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); } var dialog=ui.create.dialog([list,'vcard']); - var bing=target.num('h')<=1; + var bing=target.countCards('h')<=1; player.chooseButton(dialog,true,function(button){ if(bing&&button.link[2]=='bingliang'){ return 2; @@ -7284,7 +7284,7 @@ character.swd={ filter:function(event){ if(event.card) return true; return game.hasPlayer(function(current){ - return current.num('j'); + return current.countCards('j'); }); }, content:function(){ @@ -7293,7 +7293,7 @@ character.swd={ if(trigger.card) list.push(trigger.card); var players=game.filterPlayer(); for(var i=0;i0&& + return player.countCards('h')<=min&&player.countCards('h')>0&& lib.filter.filterCard({name:'sha'},player); }, filterCard:true, @@ -7469,7 +7469,7 @@ character.swd={ selectTarget:[1,3], ai:{ order:function(){ - if(_status.event.player.num('h')==1) return 10; + if(_status.event.player.countCards('h')==1) return 10; return ai.get.order({name:'sha'})+0.1; }, result:{ @@ -7790,7 +7790,7 @@ character.swd={ result:{ target:function(player,target){ if(target.hp==1&&player.hp>=3) return -1; - if(target.hp0){ return [0,0,0,-1]; } @@ -8014,11 +8014,11 @@ character.swd={ }, mark:true, filterTarget:function(card,player,target){ - return player!=target&&target.num('h'); + return player!=target&&target.countCards('h'); }, content:function(){ "step 0" - player.chooseCardButton(target,target.get('h')).filterButton=function(button){ + player.chooseCardButton(target,target.getCards('h')).filterButton=function(button){ return get.suit(button.link)=='club'; } "step 1" @@ -8064,7 +8064,7 @@ character.swd={ return get.type(card)=='basic'; }, filterTarget:function(card,player,target){ - return player!=target&&target.num('e'); + return player!=target&&target.countCards('e'); }, content:function(){ var num=Math.floor(Math.random()*3); @@ -8072,7 +8072,7 @@ character.swd={ player.draw(); } else{ - target.discard(target.get('e').sort(lib.sort.random).splice(0,num)); + target.discard(target.getCards('e').sort(lib.sort.random).splice(0,num)); } }, ai:{ @@ -8087,25 +8087,25 @@ character.swd={ enable:'phaseUse', filter:function(event,player){ return game.hasPlayer(function(current){ - return current.num('j')&¤t!=player; + return current.countCards('j')&¤t!=player; }); }, content:function(){ "step 0" event.targets=game.filterPlayer(function(current){ - return current.num('j')&¤t!=player; + return current.countCards('j')&¤t!=player; }); event.targets.sort(lib.sort.seat); "step 1" if(event.targets.length){ event.target=event.targets.shift(); - event.target.discard(event.target.get('j')); + event.target.discard(event.target.getCards('j')); } else{ event.finish(); } "step 2" - if(event.target.num('h')){ + if(event.target.countCards('h')){ event.target.chooseCard('选择一张手牌交给'+get.translation(player),true).ai=function(card){ return -ai.get.value(card); } @@ -8126,7 +8126,7 @@ character.swd={ player:function(player){ var num=0,players=game.filterPlayer(); for(var i=0;i=0&& ai.get.attitude(players[i],player)>=0){ num++; @@ -8210,17 +8210,17 @@ character.swd={ if(player.maxHp>4){ ctrl=2; } - else if(player.num('h')==0){ + else if(player.countCards('h')==0){ ctrl=6; } else{ ctrl=3; } } - else if(player.num('h')player.hp+1){ + else if(player.countCards('h')>player.hp+1){ ctrl=5; } event.choice=ctrl; @@ -8403,7 +8403,7 @@ character.swd={ if(player.num('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } - if(player.num('h')0; + return player.countCards('h')>0; }, content:function(){ "step 0" - var check=player.num('h')<=player.hp+(player.hp>2?2:1); + var check=player.countCards('h')<=player.hp+(player.hp>2?2:1); player.chooseCardTarget({ prompt:get.prompt('ljifeng'), filterCard:lib.filter.cardDiscardable, @@ -8534,7 +8534,7 @@ character.swd={ ai:{ effect:{ target:function(card,player,target){ - if(card.name=='sha'&&target.num('h')) return 0.7; + if(card.name=='sha'&&target.countCards('h')) return 0.7; } } } @@ -8562,7 +8562,7 @@ character.swd={ if(target.hpplayer.hp) return 0.5; + if(player.countCards('h')>player.hp) return 0.5; return 0; } }, @@ -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.num('h')>2; + var dis=trigger.target.num('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); @@ -8639,7 +8639,7 @@ character.swd={ "step 1" if(event.targets.length){ var current=event.targets.shift(); - if(current.num('he')){ + if(current.countCards('he')){ current.chooseToDiscard('he',true); } event.redo(); diff --git a/character/xiake.js b/character/xiake.js index 0045f5ecc..b100ecb1f 100644 --- a/character/xiake.js +++ b/character/xiake.js @@ -32,7 +32,7 @@ character.xiake={ enable:'phaseUse', position:'e', filter:function(event,player){ - return player.num('e')>0; + return player.countCards('e')>0; }, filterCard:true, prompt:'将要重铸的牌置入弃牌堆并摸一张牌', diff --git a/character/xianjian.js b/character/xianjian.js index 8ad8fd063..cfd82ada0 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -171,17 +171,17 @@ character.xianjian={ usable:2, filter:function(event,player){ for(var i=0;i2||nh==0)){ return false; } @@ -217,9 +217,9 @@ character.xianjian={ lueying:{ trigger:{player:'shaBegin'}, filter:function(event,player){ - if(event.target.num('he')>0){ + if(event.target.countCards('he')>0){ return game.hasPlayer(function(current){ - return current!=player&¤t!=event.target&¤t.num('he'); + return current!=player&¤t!=event.target&¤t.countCards('he'); }); } return false; @@ -228,7 +228,7 @@ character.xianjian={ usable:1, content:function(){ 'step 0' - var card=trigger.target.get('he').randomGet(); + var card=trigger.target.getCards('he').randomGet(); player.gain(card,trigger.target); if(get.position(card)=='e'){ trigger.target.$give(card,player); @@ -238,10 +238,10 @@ character.xianjian={ } 'step 1' if(game.hasPlayer(function(current){ - return current!=player&¤t!=trigger.target&¤t.num('he'); + return current!=player&¤t!=trigger.target&¤t.countCards('he'); })){ trigger.target.chooseTarget(function(card,player,target){ - return target!=player&&target!=_status.event.parent.player&&target.num('he')>0; + return target!=player&&target!=_status.event.parent.player&&target.countCards('he')>0; },'选择一名角色并令'+get.translation(player)+'弃置其一张牌').ai=function(target){ return -ai.get.attitude(_status.event.player,target); }; @@ -276,11 +276,11 @@ character.xianjian={ forced:true, filter:function(event){ if(get.is.altered('tianjian')) return false; - return event.parent.skill=='tianjian'&&event.player.num('he'); + return event.parent.skill=='tianjian'&&event.player.countCards('he'); }, popup:false, content:function(){ - trigger.player.discard(trigger.player.get('he').randomGet()); + trigger.player.discard(trigger.player.getCards('he').randomGet()); } } } @@ -364,15 +364,15 @@ character.xianjian={ longxiang:{ trigger:{player:'shaBegin'}, filter:function(event,player){ - return event.target.num('h')>player.num('h'); + return event.target.countCards('h')>player.countCards('h'); }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; }, logTarget:'target', content:function(){ - var hs=trigger.target.get('h'); - trigger.target.discard(hs.randomGets(hs.length-player.num('h'))); + var hs=trigger.target.getCards('h'); + trigger.target.discard(hs.randomGets(hs.length-player.countCards('h'))); } }, huxi:{ @@ -410,7 +410,7 @@ character.xianjian={ return 8-ai.get.value(card); }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, discard:false, prepare:'throw', @@ -522,7 +522,7 @@ character.xianjian={ }).ai=function(target){ var att=ai.get.attitude(player,target); if(att>0){ - return att+1/Math.sqrt(1+target.num('h')); + return att+1/Math.sqrt(1+target.countCards('h')); } return 0; }; @@ -645,13 +645,13 @@ character.xianjian={ zhaoyao:{ trigger:{global:'phaseDrawBegin'}, filter:function(event,player){ - return event.player!=player&&event.player.num('h')>0&&player.num('h')>0; + return event.player!=player&&event.player.countCards('h')>0&&player.countCards('h')>0; }, check:function(event,player){ if(player.isUnseen()) return false; if(ai.get.attitude(player,event.player)>=0) return false; - var hs=player.get('h'); - if(hs.length=10&&val<=6) return true; @@ -738,7 +738,7 @@ character.xianjian={ target:function(card,player,target,effect){ if(get.tag(card,'respondShan')&&effect<0){ if(target.hasSkill('zhangmu_ai')) return 0; - if(target.num('h')>=2) return 0.5; + if(target.countCards('h')>=2) return 0.5; } } } @@ -1063,17 +1063,17 @@ character.xianjian={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('h'); + return target!=player&&target.countCards('h'); }, content:function(){ 'step 0' - if(player.num('h')){ - player.chooseCardButton('读心',target.get('h')).ai=function(button){ + if(player.countCards('h')){ + player.chooseCardButton('读心',target.getCards('h')).ai=function(button){ return ai.get.value(button.link)-5; } } else{ - player.viewCards('读心',target.get('h')); + player.viewCards('读心',target.getCards('h')); event.finish(); } 'step 1' @@ -1099,7 +1099,7 @@ character.xianjian={ threaten:1.3, result:{ target:function(player,target){ - return -target.num('h'); + return -target.countCards('h'); } }, order:10, @@ -1326,7 +1326,7 @@ character.xianjian={ player.damage('nosource'); } "step 1" - var he=player.get('he'); + var he=player.getCards('he'); if(he.length){ player.discard(he.randomGet()); } @@ -1367,7 +1367,7 @@ character.xianjian={ for(var i=0;iplayer.hp){ + if(player.countCards('h')>player.hp){ return 7-ai.get.value(card); } return 4-ai.get.value(card); @@ -1840,7 +1840,7 @@ character.xianjian={ trigger:{player:'phaseBegin'}, direct:true, filter:function(event,player){ - return player.storage.xuanning&&player.num('he')+player.storage.xuanning>=3; + return player.storage.xuanning&&player.countCards('he')+player.storage.xuanning>=3; }, alter:true, content:function(){ @@ -1906,11 +1906,11 @@ character.xianjian={ poyun:{ trigger:{source:'damageEnd'}, check:function(event,player){ - return ai.get.attitude(player,event.player)<0&&event.player.num('he')>1; + return ai.get.attitude(player,event.player)<0&&event.player.countCards('he')>1; }, alter:true, filter:function(event,player){ - return player.storage.xuanning>0&&event.player.num('he')>0; + return player.storage.xuanning>0&&event.player.countCards('he')>0; }, direct:true, content:function(){ @@ -1952,7 +1952,7 @@ character.xianjian={ return get.color(card)=='black'&&get.type(card)!='basic'; }); } - return player.num('h',{type:'basic'})0; + return player!=target&&target.countCards('he')>0; }, usable:1, locked:false, @@ -1980,7 +1980,7 @@ character.xianjian={ 'step 0' targets.sort(lib.sort.seat); var target=targets[0]; - var cs=target.get('he'); + var cs=target.getCards('he'); if(cs.length){ target.discard(cs.randomGet()); } @@ -1990,7 +1990,7 @@ character.xianjian={ } 'step 1' var target=targets[1]; - var cs=target.get('he'); + var cs=target.getCards('he'); if(cs.length){ target.discard(cs.randomGet()); } @@ -1999,7 +1999,7 @@ character.xianjian={ ai:{ result:{ target:function(player,target){ - if(!target.num('he')) return -0.2; + if(!target.countCards('he')) return -0.2; return -1; } }, @@ -2109,7 +2109,7 @@ character.xianjian={ target.damage(2,'fire'); "step 2" if(target.isAlive()){ - target.discard(target.get('e')); + target.discard(target.getCards('e')); } }, ai:{ @@ -2317,7 +2317,7 @@ character.xianjian={ if(player.num('h',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } - if(player.num('h')0; + return player.countCards('e')>0; }, content:function(){ 'step 0' var goon=true; if(ai.get.attitude(player,trigger.player)>=-0.8) goon=false; - else if(trigger.player.num('h')<=3) goon=false; + else if(trigger.player.countCards('h')<=3) goon=false; else if(player.num('h','shan')==0) goon=false; - var es=player.get('e'); + var es=player.getCards('e'); var color=[]; for(var i=0;i0){ + if(players[i]!=player&&players[i].countCards('h')&&ai.get.attitude(player,players[i])>0){ return 1; } } @@ -438,9 +438,9 @@ character.yijiang={ var player=_status.event.player; if(ai.get.attitude(player,target)>0){ if(ai.get.attitude(target,player)>0){ - return target.num('h'); + return target.countCards('h'); } - return target.num('h')/2; + return target.countCards('h')/2; } return 0; }); @@ -481,7 +481,7 @@ character.yijiang={ check:function(event,player){ var allshown=true,players=game.filterPlayer(); for(var i=0;i1&&ai.get.attitude(player,players[i])>0){ + if(players[i]!=player&&players[i].countCards('h')>1&&ai.get.attitude(player,players[i])>0){ return 1; } } @@ -533,7 +533,7 @@ character.yijiang={ order:10, result:{ player:function(player){ - if(player.num('h')0; + return get.distance(target,get.zhu(player),'attack')<=1&&target.countCards('he')>0; }).set('ai',function(target){ var player=_status.event.player; var zhu=_status.event.zhu; if(ai.get.attitude(player,target)>0) return 0; - var nh=target.num('h'); - var nh2=zhu.num('h'); + var nh=target.countCards('h'); + var nh2=zhu.countCards('h'); if(nh>nh2) return 2; - if(nh==nh2&&target.num('e')) return 1.5; + if(nh==nh2&&target.countCards('e')) return 1.5; return 1; }).set('zhu',get.zhu(player)); 'step 1' @@ -733,7 +733,7 @@ character.yijiang={ 'step 2' event.target.draw(); 'step 3' - if(event.target.num('h')>get.zhu(player).num('h')){ + if(event.target.countCards('h')>get.zhu(player).countCards('h')){ player.draw(); } }, @@ -768,7 +768,7 @@ character.yijiang={ enable:'phaseUse', locked:false, filter:function(event,player){ - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i=5){ choice='jiu'; } @@ -987,7 +987,7 @@ character.yijiang={ if(!player.storage.jiaozhao) return false; var name=player.storage.jiaozhao_card; if(name=='tao'||name=='shan'||name=='wuzhong'||name=='jiu') return false; - return player.get('h').contains(player.storage.jiaozhao); + return player.getCards('h').contains(player.storage.jiaozhao); }, filterCard:function(card,player){ return card==player.storage.jiaozhao; @@ -1106,16 +1106,16 @@ character.yijiang={ usable:1, audio:2, filter:function(event,player){ - return player.num('h')>player.hp; + return player.countCards('h')>player.hp; }, filterTarget:function(card,player,target){ - return get.distance(target,player,'attack')<=1&&target.num('e')>0; + return get.distance(target,player,'attack')<=1&&target.countCards('e')>0; }, content:function(){ 'step 0' target.chooseToUse({name:'sha'},'止戈:使用一张杀,或将其装备区里的一张牌交给'+get.translation(player)); 'step 1' - if(!result.bool&&target.num('e')){ + if(!result.bool&&target.countCards('e')){ target.chooseCard('e',true,'将其装备区里的一张牌交给'+get.translation(player)); } else{ @@ -1133,8 +1133,8 @@ character.yijiang={ result:{ target:-1, player:function(player,target){ - if(target.num('h')==0) return 0; - if(target.num('h')==1) return -0.1; + 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; return -0.5; @@ -1147,7 +1147,7 @@ character.yijiang={ usable:1, audio:2, filterTarget:function(card,player,target){ - return target!=player&&target.num('he')>0; + return target!=player&&target.countCards('he')>0; }, content:function(){ 'step 0' @@ -1172,7 +1172,7 @@ character.yijiang={ result:{ target:function(player,target){ if(ai.get.attitude(player,target)>0){ - return Math.sqrt(target.num('he')); + return Math.sqrt(target.countCards('he')); } return 0; }, @@ -1246,7 +1246,7 @@ character.yijiang={ mod:{ maxHandcard:function(player,num){ if(player.storage.fulin&&player.storage.fulin.length){ - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i0; + return player!=target&&target.countCards('h')>0; }, audio:2, content:function(){ 'step 0' - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); player.gain(card,target); target.$giveAuto(card,player); 'step 1' @@ -1410,13 +1410,13 @@ character.yijiang={ direct:true, filter:function(event,player){ return game.hasPlayer(function(player){ - return player.num('h')==0; + return player.countCards('h')==0; }); }, content:function(){ 'step 0' player.chooseTarget(get.prompt('xinjuece'),function(card,player,target){ - return target.num('h')==0; + return target.countCards('h')==0; }).set('ai',function(target){ var player=_status.event.player; return ai.get.damageEffect(target,player,player); @@ -1436,7 +1436,7 @@ character.yijiang={ return get.color(card)=='black'&&get.type(card,'trick')=='trick'; }, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, discard:false, delay:false, @@ -1516,7 +1516,7 @@ character.yijiang={ if(info&&info.distance&&info.distance.attackFrom){ num-=info.distance.attackFrom; } - if(trigger.player.num('h')0; + return target!=player&&target.countCards('he')>0; }, filterCard:lib.filter.cardDiscardable, ai1:function(card){ @@ -1584,7 +1584,7 @@ character.yijiang={ if(ai.get.attitude(player,_status.event.getParent().player)>0){ return 8-ai.get.value(card); } - var nh=player.num('h'); + var nh=player.countCards('h'); if(nh<=2){ return 6-ai.get.value(card); } @@ -1605,7 +1605,7 @@ character.yijiang={ player.syncStorage('jieyue2'); player.addSkill('jieyue2'); } - else if(event.target.num('he')){ + else if(event.target.countCards('he')){ player.discardPlayerCard(event.target,true); } }, @@ -1705,10 +1705,10 @@ character.yijiang={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('h')>0; + return player!=target&&target.countCards('h')>0; }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" @@ -1724,7 +1724,7 @@ character.yijiang={ }, ai:{ order:function(name,player){ - var cards=player.get('h'); + var cards=player.getCards('h'); if(player.num('h','sha')==0){ return 1; } @@ -1738,14 +1738,14 @@ character.yijiang={ result:{ player:function(player){ if(player.num('h','sha')>0) return 0; - var num=player.num('h'); + var num=player.countCards('h'); if(num>player.hp) return 0; if(num==1) return -2; if(num==2) return -1; return -0.7; }, target:function(player,target){ - var num=target.num('h'); + var num=target.countCards('h'); if(num==1) return -1; if(num==2) return -0.7; return -0.5 @@ -1848,7 +1848,7 @@ character.yijiang={ effect:{ player:function(card,player){ if(_status.currentPhase!=player) return; - if(card.name=='sha'&&player.num('h')<=player.hp&&!player.storage.chunlao.length){ + if(card.name=='sha'&&player.countCards('h')<=player.hp&&!player.storage.chunlao.length){ return [0,0,0,0]; } } @@ -1965,14 +1965,14 @@ character.yijiang={ trigger:{global:'phaseJudgeBegin'}, direct:true, filter:function(event,player){ - return event.player!=player&&event.player.num('j')>0&&get.distance(player,event.player,'attack')<=1; + return event.player!=player&&event.player.countCards('j')>0&&get.distance(player,event.player,'attack')<=1; }, content:function(){ 'step 0' var att=ai.get.attitude(player,trigger.player); - var nh=trigger.player.num('h'); + var nh=trigger.player.countCards('h'); var eff=ai.get.effect(trigger.player,{name:'sha'},player,player); - player.chooseCardButton(get.prompt('yonglve',trigger.player),trigger.player.get('j')).set('ai',function(button){ + player.chooseCardButton(get.prompt('yonglve',trigger.player),trigger.player.getCards('j')).set('ai',function(button){ var name=button.link.viewAs||button.link.name; var att=_status.event.att; var nh=_status.event.nh; @@ -2087,7 +2087,7 @@ character.yijiang={ ai.get.attitude(player,players[i])>0) break; } if(i==players.length) return false; - var nh=event.player.num('h'); + var nh=event.player.countCards('h'); var nsha=event.player.num('h','sha'); if(nh<2) return false; switch(nh){ @@ -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.num('h')>=2){ + if(target.num('h','shan')&&target.countCards('h')>=2){ att/=1.5; } return att; @@ -2264,7 +2264,7 @@ character.yijiang={ trigger:{global:'shaBegin'}, direct:true, filter:function(event,player){ - return event.target==event.targets[0]&&player.num('he')>0&&event.card.name=='sha'&& + return event.target==event.targets[0]&&player.countCards('he')>0&&event.card.name=='sha'&& _status.currentPhase==event.player&&event.parent.parent.parent.name=='phaseUse'; }, content:function(){ @@ -2279,7 +2279,7 @@ character.yijiang={ !trigger.player.hasSkill('zhaxiang2')&& !trigger.player.hasSkill('fengnu')&& !trigger.player.num('e','zhuge')){ - var nh=trigger.player.num('h'); + var nh=trigger.player.countCards('h'); if(player==trigger.player){ go=(player.num('h','sha')>0); } @@ -2330,7 +2330,7 @@ character.yijiang={ audio:2, trigger:{player:'phaseUseBegin'}, check:function(event,player){ - var nh=player.num('h')-player.num('h',{type:'equip'}); + var nh=player.countCards('h')-player.num('h',{type:'equip'}); if(nh<=1) return true; if(player.num('h','tao')) return false; if(nh<=2) return Math.random()<0.7; @@ -2361,10 +2361,10 @@ character.yijiang={ }, check:function(event,player){ if(ai.get.attitude(player,_status.currentPhase)>0) return true; - var nh=_status.currentPhase.num('h')+1; + var nh=_status.currentPhase.countCards('h')+1; var players=game.filterPlayer(); for(var i=0;inh){ + if(players[i].countCards('h')>nh){ if(!player.hasShan()||ai.get.attitude(player,players[i])<=0) return true; } } @@ -2375,12 +2375,12 @@ character.yijiang={ player.line(_status.currentPhase,'green'); _status.currentPhase.draw(); 'step 1' - var nh=_status.currentPhase.num('h'); + var nh=_status.currentPhase.countCards('h'); var nmax=nh+1; var targets=[]; var players=game.filterPlayer(); for(var i=0;inmax){ nmax=nh2; targets.length=0; @@ -2423,10 +2423,10 @@ character.yijiang={ effect:{ target:function(card,player,target,current){ if(get.tag(card,'respondShan')&¤t<0){ - var nh=player.num('h'); + var nh=player.countCards('h'); var players=game.filterPlayer(); for(var i=0;inh) return 0.4; + if(players[i].countCards('h')>nh) return 0.4; } } } @@ -2464,7 +2464,7 @@ character.yijiang={ event.num=cards.length; 'step 3' player.chooseTarget([1,event.num],function(card,player,target){ - return target!=player&&target.num('he')>0; + return target!=player&&target.countCards('he')>0; }).set('ai',function(target){ return -ai.get.attitude(_status.event.player,target)+0.5; }); @@ -2505,19 +2505,19 @@ character.yijiang={ direct:true, filter:function(event,player){ if(player.hasSkill('yaoming2')) return false; - var nh=player.num('h'); + var nh=player.countCards('h'); return game.hasPlayer(function(current){ - return current.num('h')!=nh; + return current.countCards('h')!=nh; }); }, content:function(){ 'step 0' - var nh=player.num('h'); + var nh=player.countCards('h'); player.chooseTarget(get.prompt('yaoming'),function(card,player,target){ - return _status.event.nh!=target.num('h'); + return _status.event.nh!=target.countCards('h'); }).set('ai',function(target){ var att=ai.get.attitude(_status.event.player,target); - if(target.num('h')>_status.event.nh) return -att; + if(target.countCards('h')>_status.event.nh) return -att; return att; }).set('nh',nh); 'step 1' @@ -2525,11 +2525,11 @@ character.yijiang={ player.logSkill('yaoming',result.targets); player.addTempSkill('yaoming2','phaseAfter'); var target=result.targets[0]; - if(target.num('h')0; + return player!=target&&target.countCards('e')>0; }, content:function(){ 'step 0' @@ -2616,7 +2616,7 @@ character.yijiang={ } player.chooseTarget([1,num],get.prompt('xingxue')).set('ai',function(target){ var att=ai.get.attitude(_status.event.player,target); - if(target.num('he')) return att; + if(target.countCards('he')) return att; return att/10; }); 'step 1' @@ -2638,7 +2638,7 @@ character.yijiang={ event.finish(); } 'step 3' - if(event.current&&event.current.num('he')){ + if(event.current&&event.current.countCards('he')){ event.current.chooseCard('选择一张牌置于牌堆顶','he',true); } else{ @@ -2673,13 +2673,13 @@ character.yijiang={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target.num('he')>0&&target!=player; + return target.countCards('he')>0&&target!=player; }, content:function(){ 'step 0' - if(target.num('e')){ + if(target.countCards('e')){ target.chooseBool('是否将装备区内的所有牌交给'+get.translation(player)+'?').set('ai',function(){ - if(_status.event.player.num('e')>=3) return false; + if(_status.event.player.countCards('e')>=3) return false; return true; }); } @@ -2689,7 +2689,7 @@ character.yijiang={ } 'step 1' if(result.bool){ - var es=target.get('e'); + var es=target.getCards('e'); player.gain(es,target); target.$give(es,player); player.removeSkill('yanzhu'); @@ -2702,7 +2702,7 @@ character.yijiang={ order:6, result:{ target:function(player,target){ - var ne=target.num('e'); + var ne=target.countCards('e'); if(!ne) return -2; if(ne>=2) return -ne; return 0; @@ -2742,14 +2742,14 @@ character.yijiang={ enable:'phaseUse', usable:1, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ - return target.num('h')>0&&target!=player; + return target.countCards('h')>0&&target!=player; }, content:function(){ "step 0" - if(target.num('h')==0||player.num('h')==0){ + if(target.countCards('h')==0||player.countCards('h')==0){ event.finish(); return; } @@ -2824,7 +2824,7 @@ character.yijiang={ return; } if(event.card2.number>=10||event.card2.number<=4){ - if(target.num('h')>2){ + if(target.countCards('h')>2){ event.addToAI=true; } } @@ -2908,7 +2908,7 @@ character.yijiang={ filterCard:true, selectCard:-1, filter:function(event,player){ - if(!player.num('h')) return false; + if(!player.countCards('h')) return false; if(player.storage.zhanjue>=2) return false; return true; }, @@ -2918,7 +2918,7 @@ character.yijiang={ order:1, result:{ target:function(player,target){ - if(player.num('h')>=3||target.num('h')>=3) return 0; + 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; return -1.5; @@ -2988,7 +2988,7 @@ character.yijiang={ filter:function(event,player){ if(event.responded) return false; if(!player.hasZhuSkill('qinwang')) return false; - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; if(event.filterCard({name:'sha'},player,event)==false) return false; return game.hasPlayer(function(current){ return current!=player&¤t.group=='shu'; @@ -3001,7 +3001,7 @@ character.yijiang={ if(!player.storage.jijianging){ var players=game.filterPlayer(); for(var i=0;i1&&(nh>=4||(nh>=3&&players[i].num('h','sha')))){ yep=true;break; } @@ -3072,7 +3072,7 @@ character.yijiang={ check:function(card){ var player=_status.event.player,players=game.filterPlayer(); for(var i=0;i1&&(nh>=4||(nh>=3&&players[i].num('h','sha')))){ return 5-ai.get.value(card); } @@ -3369,7 +3369,7 @@ character.yijiang={ trigger:{player:'useCardToBegin'}, filter:function(event,player){ return _status.currentPhase==player&&event.targets.length==1&& - event.target.num('h')>0&&!player.hasSkill('taoxi4')&&player!=event.target; + event.target.countCards('h')>0&&!player.hasSkill('taoxi4')&&player!=event.target; }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; @@ -3378,7 +3378,7 @@ character.yijiang={ content:'card' }, content:function(){ - var card=trigger.target.get('h').randomGet(); + var card=trigger.target.getCards('h').randomGet(); player.showCards([card]); player.storage.taoxi=card; player.storage.taoxi2=trigger.target; @@ -3530,7 +3530,7 @@ character.yijiang={ return player!=target; }, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterCard:true, selectCard:-1, @@ -3545,9 +3545,9 @@ character.yijiang={ order:1, result:{ target:function(player,target){ - if(player.num('h')==1&&player.num('h','du')) return -1; + if(player.countCards('h')==1&&player.num('h','du')) return -1; if(player.hp<=2&&player.num('h','shan')) return 0; - if(target.num('h')+player.num('h')>target.hp+2) 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; } @@ -3573,7 +3573,7 @@ character.yijiang={ trigger:{player:'phaseUseBefore'}, direct:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ 'step 0' @@ -3583,7 +3583,7 @@ character.yijiang={ }).ai=function(target){ var att=ai.get.attitude(player,target); if(att>3){ - if(player.num('h')>player.hp) return att; + if(player.countCards('h')>player.hp) return att; if(go) return att; } return 0; @@ -3595,7 +3595,7 @@ character.yijiang={ trigger.finish(); var target=result.targets[0]; target.addSkill('mingjian2'); - var hs=player.get('h'); + var hs=player.getCards('h'); target.gain(hs,player); player.$give(hs.length,target); } @@ -3664,7 +3664,7 @@ character.yijiang={ duodao:{ trigger:{player:'damageEnd'}, filter:function(event,player){ - return player.num('he')>0&&event.source&&event.source.get('e','1')!=undefined&& + return player.countCards('he')>0&&event.source&&event.source.get('e','1')!=undefined&& event.card&&event.card.name=='sha'; }, check:function(event,player){ @@ -3709,14 +3709,14 @@ character.yijiang={ trigger:{player:'shaBegin'}, direct:true, filter:function(event,player){ - return event.target.hp>0&&event.target.num('he')>0; + return event.target.hp>0&&event.target.countCards('he')>0; }, audio:2, logTarget:'target', content:function(){ 'step 0' player.choosePlayerCard(trigger.target,'he', - [1,Math.min(trigger.target.num('he'),trigger.target.hp)],get.prompt('pojun',trigger.target)); + [1,Math.min(trigger.target.countCards('he'),trigger.target.hp)],get.prompt('pojun',trigger.target)); 'step 1' if(result.bool&&result.links.length){ player.logSkill('xinpojun'); @@ -3770,7 +3770,7 @@ character.yijiang={ audio:2, trigger:{global:'phaseEnd'}, filter:function(event,player){ - return event.player!=player&&event.player.num('h')==player.num('h')&&event.player.isAlive(); + return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isAlive(); }, check:function(event,player){ return ai.get.attitude(player,event.player)>=0; @@ -3839,17 +3839,17 @@ character.yijiang={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, check:function(event,player){ - return player.num('h','sha')<=player.num('h')/3; + return player.num('h','sha')<=player.countCards('h')/3; }, content:function(){ "step 0" player.chooseTarget(get.prompt('youdi'),function(card,player,target){ return player!=target; }).set('ai',function(target){ - if(target.num('he')==0) return 0; + if(target.countCards('he')==0) return 0; return -ai.get.attitude(_status.event.player,target); }); "step 1" @@ -3863,7 +3863,7 @@ character.yijiang={ event.finish(); } "step 2" - if(result.links[0].name!='sha'&&event.target.num('he')){ + if(result.links[0].name!='sha'&&event.target.countCards('he')){ player.gainPlayerCard('he',event.target,true); } }, @@ -3882,7 +3882,7 @@ character.yijiang={ viewAs:{name:'sha'}, prompt:'将两张手牌当杀使用或打出', check:function(card){ - if(_status.event.player.num('h')<4) return 6-ai.get.useful(card); + if(_status.event.player.countCards('h')<4) return 6-ai.get.useful(card); return 7-ai.get.useful(card); }, ai:{ @@ -3891,7 +3891,7 @@ character.yijiang={ if(player.hasSkill('wusheng')&&player.hasSkill('paoxiao')){ return 1; } - if(player.num('h')<4){ + if(player.countCards('h')<4){ return 1; } return 4; @@ -3930,7 +3930,7 @@ character.yijiang={ player.storage.fencheng=true; player.awakenSkill('fencheng'); var res=ai.get.damageEffect(target,player,target,'fire'); - var num=Math.max(1,target.num('e')); + var num=Math.max(1,target.countCards('e')); target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到1点火焰伤害').set('ai',function(card){ var res=_status.event.res; var num=_status.event.num; @@ -3957,10 +3957,10 @@ character.yijiang={ if(player!=players[i]&&ai.get.damageEffect(players[i],player,players[i],'fire')<0){ var att=ai.get.attitude(player,players[i]); if(att>0){ - num-=Math.max(1,players[i].num('e')); + num-=Math.max(1,players[i].countCards('e')); } else if(att<0){ - num+=Math.max(1,players[i].num('e')); + num+=Math.max(1,players[i].countCards('e')); } } } @@ -4012,7 +4012,7 @@ character.yijiang={ filterCard:true, selectCard:[1,Infinity], filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, check:function(card){ if(ui.selected.cards.length) return -1; @@ -4048,7 +4048,7 @@ character.yijiang={ result:{ target:function(player,target){ if(target.isTurnedOver()) return 2; - return -1/(target.num('h')+1); + return -1/(target.countCards('h')+1); } } } @@ -4060,7 +4060,7 @@ character.yijiang={ return ai.get.damageEffect(event.player,player,player)>0; }, filter:function(event,player){ - if(event.player.num('h')) return false; + if(event.player.countCards('h')) return false; if(_status.currentPhase!=player) return false; if(event.player==player) return false; for(var i=0;i0&&event.player.num('j')) return true; + if(att>0&&event.player.countCards('j')) return true; if(event.num>1){ if(att<0) return false; if(att>0) return true; } - var cards=event.player.get('e'); + var cards=event.player.getCards('e'); for(var i=0;i=6) return true; } return false; }, content:function(){ - if(trigger.player.num('ej')){ + if(trigger.player.countCards('ej')){ player.gainPlayerCard(trigger.player,'ej',true); } trigger.untrigger(); @@ -4276,10 +4276,10 @@ character.yijiang={ ai:{ result:{ target:function(player,target){ - if(target.num('j')&&ai.get.attitude(player,target)>0){ + if(target.countCards('j')&&ai.get.attitude(player,target)>0){ return 1; } - if(target.num('e')){ + if(target.countCards('e')){ return -1; } return ai.get.damageEffect(target,player); @@ -4293,14 +4293,14 @@ character.yijiang={ trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, content:function(){ "step 0" player.chooseTarget(get.prompt('qiaoshui'),function(card,player,target){ - return player!=target&&target.num('h')>0; + return player!=target&&target.countCards('h')>0; }).set('ai',function(target){ - return -ai.get.attitude(_status.event.player,target)/target.num('h'); + return -ai.get.attitude(_status.event.player,target)/target.countCards('h'); }); "step 1" if(result.bool){ @@ -4444,7 +4444,7 @@ character.yijiang={ audio:2, trigger:{player:'phaseDiscardEnd'}, filter:function(event,player){ - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length<1) return false; var color=get.color(cards[0]); for(var i=1;i=2) return false; if(player.hp==1) return false; - if(player.hp==2&&player.num('h')<2) return false; - if(event.player.num('h')>=event.player.hp) return false; + if(player.hp==2&&player.countCards('h')<2) return false; + if(event.player.countCards('h')>=event.player.hp) return false; return true; }, content:function(){ @@ -4549,12 +4549,12 @@ character.yijiang={ trigger:{player:'phaseUseBegin'}, direct:true, filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' player.chooseTarget(get.prompt('qiangzhi'),function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }).set('ai',function(){ return Math.random(); }); @@ -4562,7 +4562,7 @@ character.yijiang={ if(result.bool){ var target=result.targets[0]; player.logSkill('qiangzhi',target); - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); player.showCards(card); player.storage.qiangzhi=get.type(card,'trick'); game.addVideo('storage',player,['qiangzhi',player.storage.qiangzhi]); @@ -4611,7 +4611,7 @@ character.yijiang={ usable:3, audio:2, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ return target.hpplayer.num('h')){ + if(target.countCards('h')>player.countCards('h')){ target.damage(); } }, @@ -4870,7 +4870,7 @@ character.yijiang={ result:{ target:function(player,target){ if(player!=target) return 0; - if(player.num('h')+2<=player.hp+player.storage.quanji.length) return 1; + if(player.countCards('h')+2<=player.hp+player.storage.quanji.length) return 1; return 0; } } @@ -4882,7 +4882,7 @@ character.yijiang={ unique:true, enable:'phaseUse', filter:function(event,player){ - return !player.storage.xianzhou&&player.num('e')>0; + return !player.storage.xianzhou&&player.countCards('e')>0; }, init:function(player){ player.storage.xianzhou=false; @@ -4894,7 +4894,7 @@ character.yijiang={ content:function(){ "step 0" player.awakenSkill('xianzhou'); - var cards=player.get('e'); + var cards=player.getCards('e'); target.gain(cards,player); event.num=cards.length; player.$give(cards,target); @@ -4946,7 +4946,7 @@ character.yijiang={ if(bool) return -10; if(player.hp==1) return 1; if(game.phaseNumberplayer.hp) return true; for(var i=0;i0&&event.player.num('h')>0; + player.countCards('h')>0&&event.player.countCards('h')>0; }, content:function(){ "step 0" @@ -5099,7 +5099,7 @@ character.yijiang={ "step 1" if(get.type(cards[0])=='equip'){ player.chooseTarget('是否弃置一名角色的一张牌?',function(card,player,target){ - return player!=target&&target.num('he')>0; + return player!=target&&target.countCards('he')>0; }).set('ai',function(target){ var player=_status.event.player; if(ai.get.attitude(player,target)<0){ @@ -5171,13 +5171,13 @@ character.yijiang={ audio:2, filterTarget:function(card,player,target){ if(player==target) return false; - var num=target.num('h'); + var num=target.countCards('h'); if(ui.selected.targets.length){ - return numplayers[i].num('h')) return true; + if(num>players[i].countCards('h')) return true; } return false; }, @@ -5185,7 +5185,7 @@ character.yijiang={ content:function(){ 'step 0' var gainner,giver; - if(targets[0].num('h')0) return -1; var players=game.filterPlayer(); for(var i=0;i=0&&num20){ - if(target.num('h')2){ return true; @@ -5550,7 +5550,7 @@ character.yijiang={ trigger.untrigger(); trigger.finish(); "step 2" - if(trigger.player.num('he')){ + if(trigger.player.countCards('he')){ player.discardPlayerCard(trigger.player,'he',true); } }, @@ -5624,7 +5624,7 @@ character.yijiang={ direct:true, audio:2, filter:function(event,player){ - return player.num('he')>player.num('he',{type:'basic'}); + return player.countCards('he')>player.num('he',{type:'basic'}); }, content:function(){ "step 0" @@ -5679,7 +5679,7 @@ character.yijiang={ else if(target.hp==1&&target.maxHp>2){ return 'recover_hp'; } - else if(target.hp==2&&target.maxHp>2&&target.num('h')>1){ + else if(target.hp==2&&target.maxHp>2&&target.countCards('h')>1){ return 'recover_hp'; } else{ @@ -5718,7 +5718,7 @@ character.yijiang={ check:function(card){ var player=get.owner(card); if(get.type(card)=='trick') return 10; - if(player.num('h')-player.hp-ui.selected.cards.length>0){ + if(player.countCards('h')-player.hp-ui.selected.cards.length>0){ return 8-ai.get.value(card); } return 4-ai.get.value(card); @@ -5793,15 +5793,15 @@ character.yijiang={ trigger:{player:['loseEnd','changeHp']}, forced:true, filter:function(event,player){ - return (player.num('h')2) return 1; - return target.num('h')>3?0:1; + if(player.num('e','guanshi')&&player.countCards('he')>2) return 1; + return target.countCards('h')>3?0:1; } if(player==_status.event.dying||player.isTurnedOver()) return 3; } @@ -5948,7 +5948,7 @@ character.yijiang={ if(get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-2]; if(target.hp==1) return; - return [1,target.num('h')/2]; + return [1,target.countCards('h')/2]; } } } @@ -6002,7 +6002,7 @@ character.yijiang={ audio:2, trigger:{player:'phaseDrawBegin'}, check:function(event,player){ - return player.num('h')<=player.maxHp||player.skipList.contains('phaseUse'); + return player.countCards('h')<=player.maxHp||player.skipList.contains('phaseUse'); }, content:function(){ var list=['wei','shu','wu','qun']; @@ -6084,7 +6084,7 @@ character.yijiang={ else{ num=1; } - return player.num('he')>=num; + return player.countCards('he')>=num; }, check:function(card){ return 6-ai.get.value(card); @@ -6103,7 +6103,7 @@ character.yijiang={ else{ num=1; } - if(num<=2&&!target.num('he')) return false; + if(num<=2&&!target.countCards('he')) return false; return get.distance(player,target,'attack')<=1; }, content:function(){ @@ -6145,7 +6145,7 @@ character.yijiang={ usable:1, audio:2, filter:function(event,player){ - return player.num('h')>0 + return player.countCards('h')>0 }, chooseButton:{ dialog:function(){ @@ -6213,7 +6213,7 @@ character.yijiang={ result:{ player:function(player){ var num=0; - var cards=player.get('h'); + var cards=player.getCards('h'); if(cards.length>=3&&player.hp>=3) return 0; for(var i=0;i3&&player.num('h','sha')>1){ + if(player.countCards('h')>3&&player.num('h','sha')>1){ return 'jiangchi_less'; } if(player.num('h','sha')>2){ return 'jiangchi_less'; } - if(player.hp-player.num('h')>1){ + if(player.hp-player.countCards('h')>1){ return 'jiangchi_more'; } return 'cancel2'; @@ -6348,7 +6348,7 @@ character.yijiang={ audio:2, enable:'phaseUse', filter:function(event,player){ - return true;//player.num('h')>player.maxHp; + return true;//player.countCards('h')>player.maxHp; }, usable:1, content:function(){ @@ -6385,7 +6385,7 @@ character.yijiang={ return event.source!=undefined; }, content:function(){ - trigger.source.discard(trigger.source.get('he')); + trigger.source.discard(trigger.source.getCards('he')); }, ai:{ threaten:0.7 @@ -6396,7 +6396,7 @@ character.yijiang={ trigger:{player:'damageEnd'}, check:function(event,player){ var att=ai.get.attitude(player,event.source); - var num=event.source.num('h'); + var num=event.source.countCards('h'); if(att<=0) return true; if(num>2) return true; if(num) return att<4; @@ -6567,13 +6567,13 @@ character.yijiang={ filterTarget:function(card,player,target){ if(target.isMin()) return false; if(ui.selected.targets.length==0) return true; - if(ui.selected.targets[0].num('e')==0&&target.num('e')==0) return false; - return Math.abs(ui.selected.targets[0].num('e')-target.num('e'))<=player.maxHp-player.hp; + if(ui.selected.targets[0].countCards('e')==0&&target.countCards('e')==0) return false; + return Math.abs(ui.selected.targets[0].countCards('e')-target.countCards('e'))<=player.maxHp-player.hp; }, multitarget:true, content:function(){ "step 0" - event.cards=[targets[0].get('e'),targets[1].get('e')]; + event.cards=[targets[0].getCards('e'),targets[1].getCards('e')]; targets[0].lose(event.cards[0],ui.special); targets[1].lose(event.cards[1],ui.special); if(event.cards[0].length) targets[0].$give(event.cards[0],targets[1]); @@ -6602,15 +6602,15 @@ character.yijiang={ else if(ai.get.attitude(player,players[i])<0) list2.push(players[i]); } list1.sort(function(a,b){ - return a.num('e')-b.num('e'); + return a.countCards('e')-b.countCards('e'); }); list2.sort(function(a,b){ - return b.num('e')-a.num('e'); + return b.countCards('e')-a.countCards('e'); }); var delta; for(var i=0;i0; + return event.player.hp<=0&&event.player.countCards('h')>0; }, check:function(event,player){ if(event.player.isUnderControl(true,player)){ @@ -6852,7 +6852,7 @@ character.yijiang={ trigger:{player:'damageAfter'}, direct:true, filter:function(event,player){ - return player.num('h')>0&&player.isDamaged(); + return player.countCards('h')>0&&player.isDamaged(); }, content:function(){ "step 0" @@ -6895,7 +6895,7 @@ character.yijiang={ ai:{ effect:{ target:function(card,player,target){ - if(get.tag(card,'damage'&&target.num('h'))){ + if(get.tag(card,'damage'&&target.countCards('h'))){ return 0.8 } } @@ -6914,7 +6914,7 @@ character.yijiang={ content:function(){ "step 0" player.chooseTarget(get.prompt('xiansi'),[1,2],function(card,player,target){ - return target.num('he')>0; + return target.countCards('he')>0; },function(target){ return -ai.get.attitude(_status.event.player,target); }); @@ -7098,7 +7098,7 @@ character.yijiang={ trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ - return event.source&&event.source.num('e')>0; + return event.source&&event.source.countCards('e')>0; }, content:function(){ "step 0" @@ -7123,16 +7123,16 @@ character.yijiang={ check:function(event,player){ var att=ai.get.attitude(player,event.player); if(att<0){ - var nh1=event.player.num('h'); - var nh2=player.num('h'); + var nh1=event.player.countCards('h'); + var nh2=player.countCards('h'); return nh1<=2&&nh2>nh1+1; } - if(att>0&&event.player.num('j','lebu')&&event.player.num('h')>event.player.hp+1) return true; + if(att>0&&event.player.num('j','lebu')&&event.player.countCards('h')>event.player.hp+1) return true; return false; }, logTarget:'player', filter:function(event,player){ - return event.player!=player&&event.player.num('h')>0&&player.num('h')>0; + return event.player!=player&&event.player.countCards('h')>0&&player.countCards('h')>0; }, content:function(){ "step 0" @@ -7160,7 +7160,7 @@ character.yijiang={ // content:'limited' // }, filter:function(event,player){ - return !player.storage.zbaijiang&&player.num('e')>=2; + return !player.storage.zbaijiang&&player.countCards('e')>=2; }, content:function(){ player.storage.zbaijiang=true; diff --git a/character/yxs.js b/character/yxs.js index 1d765c62b..d31764e6a 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -168,7 +168,7 @@ character.yxs={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return Math.abs(target.num('h')-player.num('h'))<=1; + return Math.abs(target.countCards('h')-player.countCards('h'))<=1; }, content:function(){ player.swapHandcards(target); @@ -181,9 +181,9 @@ character.yxs={ })){ return 0; } - var nh=player.num('h'); + var nh=player.countCards('h'); if(game.hasPlayer(function(current){ - return ai.get.attitude(player,current)<=0&¤t.num('h')==nh+1; + return ai.get.attitude(player,current)<=0&¤t.countCards('h')==nh+1; })){ return 9; } @@ -198,7 +198,7 @@ character.yxs={ })){ return 0; } - var n1=target.num('h'),n2=player.num('h'); + var n1=target.countCards('h'),n2=player.countCards('h'); var num=0; if(n1-n2==1){ num=1; @@ -219,10 +219,10 @@ character.yxs={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.num('h'); + return target!=player&&target.countCards('h'); }, filter:function(event,player){ - return player.num('h'); + return player.countCards('h'); }, content:function(){ 'step 0' @@ -244,7 +244,7 @@ character.yxs={ wlianhuan:{ trigger:{source:'damageBegin'}, filter:function(event,player){ - return event.card&&event.card.name=='sha'&&player.num('e'); + return event.card&&event.card.name=='sha'&&player.countCards('e'); }, direct:true, content:function(){ @@ -302,7 +302,7 @@ character.yxs={ }, enable:'phaseUse', filter:function(event,player){ - return !player.storage.yixin&&player.num('he')>2; + return !player.storage.yixin&&player.countCards('he')>2; }, intro:{ content:'limited' @@ -379,7 +379,7 @@ character.yxs={ ai1:function(card){ if(ui.selected.cards.length>0) return -1; if(card.name=='du') return 20; - return (_status.event.player.num('h')-_status.event.player.hp); + return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); @@ -460,7 +460,7 @@ character.yxs={ ai1:function(card){ if(ui.selected.cards.length>0) return -1; if(card.name=='du') return 20; - return (_status.event.player.num('h')-_status.event.player.hp); + return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); @@ -497,7 +497,7 @@ character.yxs={ content:function(){ 'step 0' player.chooseTarget(get.prompt('yaoyi'),[1,2],function(card,player,target){ - return target.num('h')&&target.group!='qun'&&target!=player; + return target.countCards('h')&&target.group!='qun'&&target!=player; }).set('ai',function(target){ return 0.5-ai.get.attitude(_status.event.player,target); }); @@ -652,7 +652,7 @@ character.yxs={ forceunique:true, enable:'phaseUse', filter:function(event,player){ - return player.num('he')>0&&!player.hasSkill('tongyu_guiyin'); + return player.countCards('he')>0&&!player.hasSkill('tongyu_guiyin'); }, filterCard:true, position:'he', @@ -783,7 +783,7 @@ character.yxs={ event.finish(); } 'step 1' - if(target.num('h')){ + if(target.countCards('h')){ target.chooseToDiscard('h',true); } }, @@ -873,7 +873,7 @@ character.yxs={ }, ai1:function(card){ if(ui.selected.cards.length>0) return -1; - return (_status.event.player.num('h')-_status.event.player.hp); + return (_status.event.player.countCards('h')-_status.event.player.hp); }, ai2:function(target){ return ai.get.attitude(_status.event.player,target)-4; @@ -910,7 +910,7 @@ character.yxs={ filterCard:{color:'black'}, position:'he', filterTarget:function(card,player,target){ - return target!=player&&target.num('h')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ "step 0" @@ -972,7 +972,7 @@ character.yxs={ check:function(event,player){ if(ai.get.attitude(player,event.target)>=0) return false; if(event.target.num('e','bagua')) return false; - if(event.target.hasSkillTag('respondShan')&&event.target.num('h')>=3) return false; + if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false; return true; }, logTarget:'target', @@ -1080,7 +1080,7 @@ character.yxs={ usable:1, filterCard:true, filterTarget:function(card,player,target){ - return target.num('h')>0&&get.distance(player,target)<=2; + return target.countCards('h')>0&&get.distance(player,target)<=2; }, check:function(card){ return 7-ai.get.value(card); @@ -1088,7 +1088,7 @@ character.yxs={ position:'he', content:function(){ "step 0" - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ event.card=hs.randomGet(); player.gain(event.card,target); @@ -1103,7 +1103,7 @@ character.yxs={ return target!=player; }).ai=function(target){ var att=ai.get.attitude(player,target); - if(att>3&&player.num('h')>target.num('h')){ + if(att>3&&player.countCards('h')>target.countCards('h')){ return att; } return 0; @@ -1299,7 +1299,7 @@ character.yxs={ trigger:{player:'shaMiss'}, priority:-1, filter:function(event){ - return event.target.num('he')>0; + return event.target.countCards('he')>0; }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; @@ -1320,20 +1320,20 @@ character.yxs={ filterCard:true, viewAs:{name:'shan'}, viewAsFilter:function(player){ - if(!player.num('h')) return false; - if(player.num('e')) return false; + if(!player.countCards('h')) return false; + if(player.countCards('e')) return false; }, prompt:'将一张手牌当闪打出', check:function(){return 1}, ai:{ respondShan:true, skillTagFilter:function(player){ - if(!player.num('h')) return false; - if(player.num('e')) return false; + if(!player.countCards('h')) return false; + if(player.countCards('e')) return false; }, effect:{ target:function(card,player,target,current){ - if(get.tag(card,'respondShan')&¤t<0&&!target.num('e')) return 0.6 + if(get.tag(card,'respondShan')&¤t<0&&!target.countCards('e')) return 0.6 } } } @@ -1343,11 +1343,11 @@ character.yxs={ direct:true, filter:function(event,player){ if(event.player.isDead()) return false; - var nh=event.player.num('h'); + var nh=event.player.countCards('h'); if(nh==0) return false; var players=game.filterPlayer(); for(var i=0;i0) return 0; return ai.get.attitude(player,target); @@ -1366,7 +1366,7 @@ character.yxs={ 'step 1' if(result.bool){ player.logSkill('xiadao',result.targets); - var card=trigger.player.get('h').randomGet(); + var card=trigger.player.getCards('h').randomGet(); result.targets[0].gain(card,trigger.player); trigger.player.$giveAuto(card,result.targets[0]); } @@ -1427,7 +1427,7 @@ character.yxs={ direct:true, content:function(){ "step 0" - if(player.num('he')){ + if(player.countCards('he')){ player.chooseCardTarget({ prompt:get.prompt('yizhuang'), filterCard:lib.filter.cardDiscardable, @@ -1515,10 +1515,10 @@ character.yxs={ if(player.hptarget.maxHp){ + else if(target.countCards('h')>target.maxHp){ if(card.name=='lebu') return false; } } @@ -1608,7 +1608,7 @@ character.yxs={ unique:true, forceunique:true, check:function(card){ - if(_status.event.player.num('h')>=3){ + if(_status.event.player.countCards('h')>=3){ return 5-ai.get.value(card); } return 0; @@ -1751,7 +1751,7 @@ character.yxs={ fenghuo:{ enable:'chooseToUse', filter:function(event,player){ - return player.num('e')>0; + return player.countCards('e')>0; }, filterCard:true, position:'e', @@ -1762,7 +1762,7 @@ character.yxs={ if(player.num('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } - if(player.num('h')0; + return event.player!=player&&event.target!=player&&event.target.countCards('h')>0; }, group:['bolehuiyan2','bolehuiyan3'], content:function(){ @@ -2051,7 +2051,7 @@ character.yxs={ var equip=trigger.target.get('e','2'); if(equip&&equip.name=='bagua') return 1; - return trigger.target.num('h')<2?0:1; + return trigger.target.countCards('h')<2?0:1; }; "step 1" if(event.dialog){ @@ -2164,7 +2164,7 @@ character.yxs={ weiyi:{ trigger:{player:'damageEnd'}, filter:function(event,player){ - return (event.source&&event.source.num('he')); + return (event.source&&event.source.countCards('he')); }, check:function(event,player){ return ai.get.attitude(player,event.source)<0; @@ -2177,7 +2177,7 @@ character.yxs={ expose:0.3, result:{ target:function(card,player,target){ - if(player.num('he')>1&&get.tag(card,'damage')){ + if(player.countCards('he')>1&&get.tag(card,'damage')){ if(player.hasSkillTag('jueqing')) return [1,-1]; if(ai.get.attitude(target,player)<0) return [1,0,0,-1.5]; } @@ -2263,7 +2263,7 @@ character.yxs={ ai:{ result:{ target:function(card,player,target){ - if(card.name=='juedou'&&target.num('h')>0) return [1,0,0,-1]; + if(card.name=='juedou'&&target.countCards('h')>0) return [1,0,0,-1]; } } } @@ -2476,7 +2476,7 @@ character.yxs={ filterTarget:function(card,player,target){ if(ui.selected.targets.length){ var from=ui.selected.targets[0]; - var judges=from.get('j'); + var judges=from.getCards('j'); for(var i=0;i0; + return target.countCards('ej')>0; } }, selectTarget:2, @@ -2529,7 +2529,7 @@ character.yxs={ result:{ target:function(player,target){ if(ui.selected.targets.length==0){ - if(target.num('j')&&ai.get.attitude(player,target)>0) return 1; + if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 1; if(ai.get.attitude(player,target)<0){ var players=game.filterPlayer(); for(var i=0;i0; + return target!=player&&target.countCards('he')>0; }, content:function(){ 'step 0' @@ -2663,7 +2663,7 @@ character.yxs={ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return player!=target&&target.num('e')>0; + return player!=target&&target.countCards('e')>0; }, content:function(){ 'step 0' @@ -2740,7 +2740,7 @@ character.yxs={ threaten:1.5, result:{ player:function(player){ - if(player.num('e')<3) return 1; + if(player.countCards('e')<3) return 1; return 0; } } diff --git a/character/zhuogui.js b/character/zhuogui.js index eede11cbb..34299f6fb 100644 --- a/character/zhuogui.js +++ b/character/zhuogui.js @@ -204,15 +204,15 @@ character.zhuogui={ trigger:{player:'phaseJudgeBegin'}, forced:true, content:function(){ - player.discard(player.get('j').randomGet()); + player.discard(player.getCards('j').randomGet()); }, filter:function(event ,player){ - return player.num('j')>0; + return player.countCards('j')>0; }, ai:{ effect:{ target:function(card,player,target,current){ - if(get.type(card)=='delay'&&target.num('j')==0) return 0.1; + if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1; } } } @@ -224,21 +224,21 @@ character.zhuogui={ forced:true, filter:function(event,player){ for(var i=0;i0; + return player!=target&&target.countCards('h')>0; }).ai=function(target){ return -ai.get.attitude(player,target); }; "step 1" if(result.targets&&result.targets.length){ player.logSkill('qiangzheng',result.targets); - player.gain(result.targets[0].get('h').randomGet(),result.targets[0]); + player.gain(result.targets[0].getCards('h').randomGet(),result.targets[0]); result.targets[0].$give(1,player); game.delay(); } diff --git a/extension/wuxing/extension.js b/extension/wuxing/extension.js index 6ea106e7b..75b1d08f5 100644 --- a/extension/wuxing/extension.js +++ b/extension/wuxing/extension.js @@ -69,7 +69,7 @@ play.wuxing={ case 'metal': switch(player.wunature){ case 'wood': - if(player.num('he')){ + if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); player.chooseToDiscard('你被金属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('金克木')};return; case 'water': @@ -81,7 +81,7 @@ play.wuxing={ case 'wood': switch(player.wunature){ case 'soil': - if(player.num('he')){ + if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); player.chooseToDiscard('你被木属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('木克土')};return; case 'fire': @@ -93,7 +93,7 @@ play.wuxing={ case 'water': switch(player.wunature){ case 'fire': - if(player.num('he')){ + if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); player.chooseToDiscard('你被水属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('水克火')};return; case 'wood': @@ -105,7 +105,7 @@ play.wuxing={ case 'fire': switch(player.wunature){ case 'metal': - if(player.num('he')){ + if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); player.chooseToDiscard('你被火属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('火克金')};return; case 'soil': @@ -117,7 +117,7 @@ play.wuxing={ case 'soil': switch(player.wunature){ case 'water': - if(player.num('he')){ + if(player.countCards('he')){ game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); player.chooseToDiscard('你被土属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('土克水')};return; case 'metal': diff --git a/game/game.js b/game/game.js index ec0f303f4..2fc45198c 100644 --- a/game/game.js +++ b/game/game.js @@ -7840,7 +7840,7 @@ } }, h:function(player){ - console.log(get.translation(player.get('h'))); + console.log(get.translation(player.getCards('h'))); }, g:function(){ for(var i=0;i=10||event.card2.number<=4){ - if(target.num('h')>2){ + if(target.countCards('h')>2){ event.addToAI=true; } } @@ -9975,9 +9975,9 @@ } var directh=true; for(var i=0;i=nh) return false; + if(game.players[i].countCards('h')>=nh) return false; } else{ - if(game.players[i].num('h')>nh) return false; + if(game.players[i].countCards('h')>nh) return false; } } return true; }, isFewestHandcard:function(equal){ - var nh=this.num('h'); + var nh=this.countCards('h'); for(var i=0;i'+get.translation(game.players[i])+''); dialog.addSmall(hs); @@ -23739,7 +23739,7 @@ selected[0].classList.remove('selected'); } if(_status.event.player){ - var cards=_status.event.player.get('hej'); + var cards=_status.event.player.getCards('hej'); for(j=0;j手牌'); - uiintro.addSmall(node.get('h')); + uiintro.addSmall(node.getCards('h')); } } @@ -39537,7 +39537,7 @@ } tr.appendChild(td); td=document.createElement('td'); - td.innerHTML=node.num('h'); + td.innerHTML=node.countCards('h'); tr.appendChild(td); td=document.createElement('td'); td.innerHTML=node.stat.length-1; @@ -39551,12 +39551,12 @@ } } if(!simple||get.is.phoneLayout()){ - var es=node.get('e'); + var es=node.getCards('e'); for(var i=0;i
'+es[i].outerHTML+'
'+lib.translate[es[i].name+'_info']+'
'); uiintro.content.lastChild.querySelector('.skill>.card').style.transform=''; } - var js=node.get('j'); + var js=node.getCards('j'); for(var i=0;i
'+js[i].outerHTML+'
'+lib.translate[js[i].viewAs]+':'+lib.translate[js[i].viewAs+'_info']+'
'); @@ -40397,7 +40397,7 @@ if(get.objtype(value)=='array'){ if(method=='raw') return value[0]; var num=0,i; - var cards=player.get('h'); + var cards=player.getCards('h'); for(i=0;i3) result2*=0.9; + if(target.countCards('h')==1) result2*=1.05; + if(target.countCards('h')==2) result2*=1.02; + if(target.countCards('h')>3) result2*=0.9; if(target.hp==4) result2*=0.9; if(target.hp==5) result2*=0.8; if(target.hp>5) result2*=0.6; @@ -40651,13 +40651,13 @@ var card=button.link; var player=get.owner(card); if(!player) player=_status.event.player; - if(player.get('j').contains(card)){ + if(player.getCards('j').contains(card)){ var efff=ai.get.effect(player,card,player,player); if(efff>0) return 0.5; if(efff==0) return 0; return -1.5; } - if(player.get('e').contains(card)){ + if(player.getCards('e').contains(card)){ var evalue=ai.get.equipValue(card); if(player.hasSkillTag('noe')){ if(evalue>=7){ @@ -40668,7 +40668,7 @@ return evalue/3; } if(player.hasSkillTag('noh')) return 0.1; - var nh=player.num('h'); + var nh=player.countCards('h'); switch(nh){ case 1:return 2; case 2:return 1.6; diff --git a/mode/boss.js b/mode/boss.js index f28e6ad61..c38050550 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -250,7 +250,7 @@ mode.boss={ for(var i=0;i0?player.node.handcards1:player.node.handcards2; @@ -1085,14 +1085,14 @@ mode.boss={ content:function(){ 'step 0' var target=trigger.source; - if(target.num('h')==0){ + if(target.countCards('h')==0){ target.damage(2); event.finish(); } else{ target.chooseControl('discard_card','get_damage',function(){ if(ai.get.damageEffect(target,player,target)>=0) return 'get_damage'; - var nh=target.num('h'); + var nh=target.countCards('h'); if(nh<=3||target.hp<=3||target.hasSkillTag('noh')) return 'discard_card'; return 'get_damage'; }) @@ -1100,7 +1100,7 @@ mode.boss={ 'step 1' var target=trigger.source; if(result.control=='discard_card'){ - target.discard(target.get('h')); + target.discard(target.getCards('h')); } else{ target.damage(2); @@ -1141,7 +1141,7 @@ mode.boss={ }, skipDamage:{ x7:function(player){ - return player.num('h')==0; + return player.countCards('h')==0; }, x6:function(player,event){ return event.nature=='fire'; @@ -1154,11 +1154,11 @@ mode.boss={ }, x3:function(player,event){ return game.hasPlayer(function(current){ - return current!=player&¤t.num('e')>=4; + return current!=player&¤t.countCards('e')>=4; }); }, x2:function(player){ - return player.num('j')>=2; + return player.countCards('j')>=2; }, x1:function(){ return game.players.length==2; @@ -1270,7 +1270,7 @@ mode.boss={ default:return 0; } } - if(rand4&&player.num('h')<=1){ + if(rand4&&player.countCards('h')<=1){ switch(name){ case 'zengbin':return 1; case 'wuzhong':return 0.8; @@ -1420,7 +1420,7 @@ mode.boss={ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.num('he')>0; + return player.countCards('he')>0; }, content:function(){ "step 0" @@ -1470,13 +1470,13 @@ mode.boss={ usable:1, filterTarget:function(card,player,target){ if(player==target) return false; - return target.num('h')>0; + return target.countCards('h')>0; }, selectTarget:2, multitarget:true, multiline:true, filter:function(event,player){ - return player.num('h')>0; + return player.countCards('h')>0; }, prepare:'throw', discard:false, @@ -1486,7 +1486,7 @@ mode.boss={ }, content:function(){ "step 0" - if(targets[0].num('h')&&targets[1].num('h')){ + if(targets[0].countCards('h')&&targets[1].countCards('h')){ targets[0].chooseToCompare(targets[1]); } else{ @@ -1587,7 +1587,7 @@ mode.boss={ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); - var hs=target.num('h'); + var hs=target.countCards('h'); if(shans>1) return [1,1]; if(shans&&hs>2) return [1,1]; if(shans) return [1,0.5]; @@ -1637,7 +1637,7 @@ mode.boss={ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); - var hs=target.num('h'); + var hs=target.countCards('h'); if(shans>1) return [0,1]; if(shans&&hs>2) return [0,1]; if(shans) return [0,0]; @@ -1684,7 +1684,7 @@ mode.boss={ trigger:{global:'phaseBegin'}, forced:true, filter:function(event,player){ - return event.player!=player&&event.player.num('he')>1; + return event.player!=player&&event.player.countCards('he')>1; }, content:function(){ 'step 0' @@ -1696,7 +1696,7 @@ mode.boss={ return get.position(ui.selected.cards[0])=='e'; } else{ - return trigger.player.num('h')>1; + return trigger.player.countCards('h')>1; } break; } @@ -1705,17 +1705,17 @@ mode.boss={ return get.position(ui.selected.cards[0])=='h'; } else{ - return trigger.player.num('e')>1; + return trigger.player.countCards('e')>1; } break; } } }); var num=0; - if(trigger.player.num('h')>1){ + if(trigger.player.countCards('h')>1){ num++; } - if(trigger.player.num('e')>1){ + if(trigger.player.countCards('e')>1){ num++; } next.selectCard=[num,num]; @@ -1725,8 +1725,8 @@ mode.boss={ 'step 1' if(result.bool){ var he=[]; - var hs=trigger.player.get('h'); - var es=trigger.player.get('e'); + var hs=trigger.player.getCards('h'); + var es=trigger.player.getCards('e'); if(hs.length>1){ he=he.concat(hs); } @@ -2282,15 +2282,15 @@ mode.boss={ trigger:{player:'phaseJudgeBegin'}, forced:true, content:function(){ - player.discard(player.get('j').randomGet()); + player.discard(player.getCards('j').randomGet()); }, filter:function(event ,player){ - return player.num('j')>0; + return player.countCards('j')>0; }, ai:{ effect:{ target:function(card,player,target,current){ - if(get.type(card)=='delay'&&target.num('j')==0) return 0.1; + if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1; } } } @@ -2359,7 +2359,7 @@ mode.boss={ return event.source!=undefined; }, content:function(){ - trigger.source.discard(trigger.source.get('h')); + trigger.source.discard(trigger.source.getCards('h')); }, ai:{ threaten:0.7 @@ -2372,7 +2372,7 @@ mode.boss={ logv:false, content:function(){ var targets=game.filterPlayer(function(current){ - return current.num('e'); + return current.countCards('e'); }); player.line(targets,'green'); game.delay(); @@ -2384,10 +2384,10 @@ mode.boss={ forced:true, globalFixed:true, filter:function(event,player){ - return player.num('e')>0&&event.player.hasSkill('boss_shanbeng')&&event.player.isDead(); + return player.countCards('e')>0&&event.player.hasSkill('boss_shanbeng')&&event.player.isDead(); }, content:function(){ - player.discard(player.get('e')); + player.discard(player.getCards('e')); } }, boss_didong:{ @@ -2478,10 +2478,10 @@ mode.boss={ trigger:{player:'loseEnd'}, forced:true, filter:function(event,player){ - return player.num('h')<4; + return player.countCards('h')<4; }, content:function(){ - player.draw(4-player.num('h')); + player.draw(4-player.countCards('h')); } }, boss_leiji:{ @@ -2530,23 +2530,23 @@ mode.boss={ var be=target.num('e',{color:'black'}); if(target.num('h','shan')&&be){ if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.num('he')/2:0]; + return [0,hastarget?target.countCards('he')/2:0]; } - if(target.num('h','shan')&&target.num('h')>2){ + if(target.num('h','shan')&&target.countCards('h')>2){ if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.num('h')/4:0]; + return [0,hastarget?target.countCards('h')/4:0]; } - if(target.num('h')>3||(be&&target.num('h')>=2)){ + if(target.countCards('h')>3||(be&&target.countCards('h')>=2)){ return [0,0]; } - if(target.num('h')==0){ + if(target.countCards('h')==0){ return [1.5,0]; } - if(target.num('h')==1&&!be){ + if(target.countCards('h')==1&&!be){ return [1.2,0]; } if(!target.hasSkill('guidao')) return [1,0.05]; - return [1,Math.min(0.5,(target.num('h')+be)/4)]; + return [1,Math.min(0.5,(target.countCards('h')+be)/4)]; } } } @@ -2556,7 +2556,7 @@ mode.boss={ audio:2, trigger:{player:'phaseEnd'}, filter:function(event,player){ - return player.num('h')==0; + return player.countCards('h')==0; }, content:function(){ player.draw(3) @@ -2573,7 +2573,7 @@ mode.boss={ unique:true, filter:function(event,player){ return game.hasPlayer(function(current){ - return current!=player&¤t.num('h'); + return current!=player&¤t.countCards('h'); }); }, content:function(){ @@ -2585,7 +2585,7 @@ mode.boss={ "step 1" if(event.players.length){ var current=event.players.shift(); - var hs=current.get('h') + var hs=current.getCards('h') if(hs.length){ var card=hs.randomGet(); player.gain(card,current); @@ -2600,7 +2600,7 @@ mode.boss={ trigger:{player:'loseEnd'}, frequent:true, filter:function(event,player){ - if(player.num('h')) return false; + if(player.countCards('h')) return false; for(var i=0;i1){ + if(players[i].canUse('sha',player)&&players[i].countCards('h')>1){ num--; } else{ @@ -2825,7 +2825,7 @@ mode.boss={ unique:true, filter:function(event,player){ if(player.hp==player.maxHp) return false; - if(!player.num('he')) return false; + if(!player.countCards('he')) return false; return true; }, content:function(){ @@ -3188,10 +3188,10 @@ mode.boss={ unique:true, audio:2, filter:function(event,player){ - return player.num('h')<4; + return player.countCards('h')<4; }, content:function(){ - player.draw(4-player.num('h')); + player.draw(4-player.countCards('h')); }, group:'shangshix2', ai:{ @@ -3199,7 +3199,7 @@ mode.boss={ target:function(card,player,target){ if(card.name=='shunshou') return; if(card.name=='guohe'){ - if(!target.num('e')) return [0,1]; + if(!target.countCards('e')) return [0,1]; } else if(get.tag(card,'loseCard')){ return [0,1]; @@ -3214,7 +3214,7 @@ mode.boss={ trigger:{player:'phaseBegin'}, direct:true, filter:function(event,player){ - return player.num('j')>0; + return player.countCards('j')>0; }, content:function(){ "step 0" @@ -3369,7 +3369,7 @@ mode.boss={ ui.clear(); if(player.isLinked()) player.link(); if(player.isTurnedOver()) player.turnOver(); - player.discard(player.get('ej')); + player.discard(player.getCards('ej')); 'step 3' while(_status.event.name!='phaseLoop'){ _status.event=_status.event.parent; @@ -3462,7 +3462,7 @@ mode.boss={ group:'shenqu2', trigger:{global:'phaseBegin'}, filter:function(event,player){ - return player.num('h')<=player.maxHp; + return player.countCards('h')<=player.maxHp; }, frequent:true, content:function(){ @@ -3482,7 +3482,7 @@ mode.boss={ jiwu:{ enable:'phaseUse', filter:function(event,player){ - if(player.num('h')==0) return false; + if(player.countCards('h')==0) return false; if(!player.hasSkill('qiangxi')) return true; if(!player.hasSkill('lieren')) return true; if(!player.hasSkill('xuanfeng')) return true; diff --git a/mode/chess.js b/mode/chess.js index 004041060..90bbf87ab 100644 --- a/mode/chess.js +++ b/mode/chess.js @@ -333,7 +333,7 @@ mode.chess={ if(game.players[i].side==game.me.side&&game.players[i]!=game.me){ added=true; uiintro.add(get.translation(game.players[i])); - var cards=game.players[i].get('h'); + var cards=game.players[i].getCards('h'); if(cards.length){ uiintro.addSmall(cards,true); } @@ -909,7 +909,7 @@ mode.chess={ else{ switch(get.config('punish')){ case '弃牌': - var he=source.get('he'); + var he=source.getCards('he'); if(he.length){ source.discard(he); } @@ -1726,13 +1726,13 @@ mode.chess={ next.includeOut=true; next.ai=function(target2){ var num=0; - if(target2.num('j')){ + if(target2.countCards('j')){ num-=5; } if(target2!=game.friendZhu&&target2!=game.enemyZhu){ for(var i=0;inh) return false; + if(game.players[j].countCards('h')>nh) return false; } return true; } @@ -4082,7 +4082,7 @@ mode.chess={ } 'step 1' game.log('审判之刃发动'); - var hs=player.get('h'); + var hs=player.getCards('h'); if(hs.length){ player.discard(hs.randomGet()); } @@ -4256,7 +4256,7 @@ mode.chess={ case 2:chance=0.4;break; default:chance=0.2;break; } - switch(target.num('he')){ + switch(target.countCards('he')){ case 0:break; case 1:chance/=1.2;break; case 2:chance/=1.4;break; @@ -4575,7 +4575,7 @@ mode.chess={ filter:function(event,player){ if(player.isTurnedOver()) return false; var suits=[]; - var hs=player.get('h'); + var hs=player.getCards('h'); for(var i=0;i=4) return true; @@ -4617,7 +4617,7 @@ mode.chess={ } } if(num<=1) return; - if(_status.currentPhase==player&&player.num('h')=6){ + if(_status.currentPhase==player&&player.countCards('h')=6){ if(typeof card=='string') return; if(card.name=='wuzhong') return; if(card.name=='shunshou') return; @@ -4676,7 +4676,7 @@ mode.chess={ unique:true, filter:function(event,player){ for(var i=0;i0){ player.draw(num); } @@ -808,7 +808,7 @@ mode.guozhan={ gzshoucheng:{ inherit:'shoucheng', filter:function(event,player){ - if(event.player.num('h')) return false; + if(event.player.countCards('h')) return false; if(!event.player.isFriendOf(player)) return false; if(_status.currentPhase==event.player) return false; for(var i=0;i0; + return player.countCards('h')>0; }, filterTarget:function(card,player,target){ - return player!=target&&(target.num('h')||target.isUnseen(2)); + return player!=target&&(target.countCards('h')||target.isUnseen(2)); }, content:function(){ "step 0" - target.viewCards(get.translation(player)+'的手牌',player.get('h')); + target.viewCards(get.translation(player)+'的手牌',player.getCards('h')); "step 1" - if(!target.num('h')){ + if(!target.countCards('h')){ event._result={index:1}; } else if(!target.isUnseen(2)){ @@ -1001,7 +1001,7 @@ mode.guozhan={ order:11, result:{ target:function(player,target){ - return -target.num('h'); + return -target.countCards('h'); } }, threaten:1.1 @@ -1046,7 +1046,7 @@ mode.guozhan={ if(game.countPlayer()<4) return false; return player.siege(event.target)&&game.hasPlayer(function(current){ return current.hasSkill('fengshi')&¤t.siege(event.target); - })&&event.target.num('e'); + })&&event.target.countCards('e'); }, logTarget:'target', content:function(){ @@ -1389,7 +1389,7 @@ mode.guozhan={ return ai.get.effect(event.target,event.card,event.player,player)<0; }, filter:function(event,player){ - return player.num('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); + return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); }, content:function(){ trigger.untrigger(); @@ -1398,7 +1398,7 @@ mode.guozhan={ ai:{ effect:{ target:function(card,player,target,current){ - if(target.num('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget'; + if(target.countCards('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget'; }, } } @@ -1425,7 +1425,7 @@ mode.guozhan={ if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(!ui.selected.cards.length&&card.name=='du') return 20; var player=get.owner(card); - if(player.hp==player.maxHp||player.storage.gzrende<0||player.num('h')+player.storage.gzrende<=2){ + if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ if(ui.selected.cards.length){ return -1; } @@ -1439,8 +1439,8 @@ mode.guozhan={ return 11-ai.get.value(card); } } - if(player.num('h')>player.hp) return 10-ai.get.value(card); - if(player.num('h')>2) return 6-ai.get.value(card); + if(player.countCards('h')>player.hp) return 10-ai.get.value(card); + if(player.countCards('h')>2) return 6-ai.get.value(card); return -1; } return 10-ai.get.value(card); @@ -1460,7 +1460,7 @@ mode.guozhan={ }, ai:{ order:function(skill,player){ - if(player.hp==player.maxHp||player.storage.gzrende<0||player.num('h')+player.storage.gzrende<=2){ + if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ return 1; } return 10; @@ -1471,9 +1471,9 @@ mode.guozhan={ return -10; } if(target.num('j','lebu')) return 0; - var nh=target.num('h'); - var np=player.num('h'); - if(player.hp==player.maxHp||player.storage.gzrende<0||player.num('h')+player.storage.gzrende<=2){ + var nh=target.countCards('h'); + var np=player.countCards('h'); + if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0; } return Math.max(1,5-nh); @@ -3092,7 +3092,7 @@ mode.guozhan={ if(source&&source.identity!='unknown'){ if(this.identity=='ye') source.draw(1); else if(this.identity!=source.identity) source.draw(get.population(this.identity)+1); - else source.discard(source.get('he')); + else source.discard(source.getCards('he')); } game.tryResult(); }, diff --git a/mode/identity.js b/mode/identity.js index 293a4739a..e4ca6fb31 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -1339,7 +1339,7 @@ mode.identity={ } if(this.identity=='fan'&&source) source.draw(3); else if(this.identity=='zhong'&&source&&source.identity=='zhu'&&source.isZhu){ - source.discard(source.get('he')); + source.discard(source.getCards('he')); } if(game.zhu&&game.zhu.storage.enhance_zhu&&get.population('fan')<3){ game.zhu.removeSkill(game.zhu.storage.enhance_zhu); @@ -1608,7 +1608,7 @@ mode.identity={ } } if(fan){ - if(to.hp>1&&to.hp>fan.hp&&to.num('he')>fan.num('he')){ + if(to.hp>1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ return -3; } } @@ -1625,7 +1625,7 @@ mode.identity={ } } if(nei){ - if(nei.hp>1&&nei.hp>to.hp&&nei.num('he')>to.num('he')){ + if(nei.hp>1&&nei.hp>to.hp&&nei.countCards('he')>to.countCards('he')){ return 0; } } @@ -1666,7 +1666,7 @@ mode.identity={ } } if(fan){ - if(to.hp>1&&to.hp>fan.hp&&to.num('he')>fan.num('he')){ + if(to.hp>1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ return -3; } } @@ -1762,7 +1762,7 @@ mode.identity={ else if(php>6){ php=6; } - j=player.get('h').length+player.get('e').length*1.5+php*2; + j=player.countCards('h')+player.countCards('e')*1.5+php*2; if(player.identity=='zhu'){ zhuzhong+=j*1.2+5; total+=j*1.2+5; diff --git a/mode/stone.js b/mode/stone.js index 3f666b4a6..dc3e436a8 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -531,7 +531,7 @@ mode.stone={ game.me.chooseBool('是否置换手牌?'); "step 4" if(result.bool){ - var hs=game.me.get('h'); + var hs=game.me.getCards('h'); for(var i=0;i0; + return target.isMin()&&target.countCards('h')>0; }, content:function(){ - target.draw(target.num('h')); + target.draw(target.countCards('h')); }, ai:{ order:4, @@ -2248,7 +2248,7 @@ mode.stone={ useful:2, result:{ target:function(player,target){ - return Math.max(0,target.num('h')-1); + return Math.max(0,target.countCards('h')-1); } } } @@ -2619,7 +2619,7 @@ mode.stone={ target.damage(); 'step 1' if(target.isAlive()){ - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ target.discard(hs.randomGets(2)); } @@ -2631,7 +2631,7 @@ mode.stone={ useful:5, result:{ target:function(player,target){ - if(target.num('h')) return -2; + if(target.countCards('h')) return -2; return -1.5; } }, @@ -2742,7 +2742,7 @@ mode.stone={ order:5, result:{ target:function(player,target){ - return Math.max(1,target.hp-target.num('h')); + return Math.max(1,target.hp-target.countCards('h')); }, } } @@ -2767,7 +2767,7 @@ mode.stone={ } else{ player.chooseControl('获得行动值','摸牌').ai=function(){ - if(player.num('h')<=1) return '摸牌'; + if(player.countCards('h')<=1) return '摸牌'; return '获得行动值'; }; } @@ -2902,7 +2902,7 @@ mode.stone={ useful:5, result:{ target:function(player,target){ - return -target.hp-target.num('h')/2; + return -target.hp-target.countCards('h')/2; } } } @@ -2930,7 +2930,7 @@ mode.stone={ useful:5, result:{ target:function(player,target){ - return -target.hp-target.num('h')/2; + return -target.hp-target.countCards('h')/2; } } } @@ -3038,7 +3038,7 @@ mode.stone={ list.randomGet().die({source:player}); } 'step 1' - var es=target.get('e'); + var es=target.getCards('e'); if(es.length){ target.discard(es.randomGet()); } @@ -3403,7 +3403,7 @@ mode.stone={ }); if(hs.length==0) return 0; var enemy=player.getEnemy(); - if(enemy.num('h')<=1) return 1; + if(enemy.countCards('h')<=1) return 1; var num=0; for(var i=0;i0; + return target.isMin()&&target.countCards('h')>0; }, selectTarget:-1, content:function(){ @@ -3550,7 +3550,7 @@ mode.stone={ // if(player.hasFellowSkill('stone_shenyou')){ // num=2; // } - target.damage(target.num('h')*num); + target.damage(target.countCards('h')*num); }, ai:{ order:7, @@ -3558,7 +3558,7 @@ mode.stone={ useful:5, result:{ target:function(player,target){ - return -Math.min(target.num('h'),target.hp); + return -Math.min(target.countCards('h'),target.hp); } }, tag:{ @@ -3591,7 +3591,7 @@ mode.stone={ useful:5, result:{ target:function(player,target){ - return -target.hp-target.num('h')/2; + return -target.hp-target.countCards('h')/2; } } } @@ -3601,7 +3601,7 @@ mode.stone={ stoneact:0, career:'priest', enable:function(event,player){ - return player.getEnemy().num('h')>0; + return player.getEnemy().countCards('h')>0; }, fullimage:true, filterTarget:function(card,player,target){ @@ -3609,7 +3609,7 @@ mode.stone={ }, selectTarget:-1, content:function(){ - var card=target.get('h').randomGet(); + var card=target.getCards('h').randomGet(); if(card){ player.gain(game.createCard(card.name,card.suit,card.number,card.nature),'draw'); } @@ -3777,7 +3777,7 @@ mode.stone={ useful:5, result:{ target:function(player,target){ - return -target.hp-target.num('h')/2; + return -target.hp-target.countCards('h')/2; } } } @@ -3807,7 +3807,7 @@ mode.stone={ target:function(player,target){ if(target.hp==1) return -1; if(target.hp>=4) return 1.5; - if(target.hp>=3&&target.num('h')=3&&target.countCards('h')1||target.num('he')>0); + return target.isMin()&&(target.maxHp>1||target.countCards('he')>0); }, content:function(){ "step 0" - target.discard(target.get('he')); + target.discard(target.getCards('he')); "step 1" if(target.maxHp>2){ target.loseMaxHp(target.maxHp-2); @@ -5186,7 +5186,7 @@ mode.stone={ ai:{ result:{ target:function(player,target){ - return Math.min(0,2-target.hp)-target.num('h')/2; + return Math.min(0,2-target.hp)-target.countCards('h')/2; } }, order:7 @@ -5439,7 +5439,7 @@ mode.stone={ content:function(){ "step 0" var targets=[player,target]; - event.cards=[targets[0].get('e'),targets[1].get('e')]; + event.cards=[targets[0].getCards('e'),targets[1].getCards('e')]; targets[0].lose(event.cards[0],ui.special); targets[1].lose(event.cards[1],ui.special); if(event.cards[0].length) targets[0].$give(event.cards[0],targets[1]); @@ -5453,7 +5453,7 @@ mode.stone={ targets[1].equip(event.cards[0][i]); } "step 2" - var dh=target.num('h')-player.num('h'); + var dh=target.countCards('h')-player.countCards('h'); if(dh>0){ player.draw(dh); } @@ -5464,8 +5464,8 @@ mode.stone={ useful:1, result:{ target:function(player,target){ - var ne1=target.num('e'),ne2=player.num('e'); - var nh1=target.num('h'),nh2=player.num('h'); + var ne1=target.countCards('e'),ne2=player.countCards('e'); + var nh1=target.countCards('h'),nh2=player.countCards('h'); if(nh10){ - target.discard(target.get('h').randomGets(dh)); + target.discard(target.getCards('h').randomGets(dh)); } }, ai:{ @@ -5497,7 +5497,7 @@ mode.stone={ useful:1, result:{ target:function(player,target){ - if(target.num('he')>=player.num('h')) return -1; + if(target.countCards('he')>=player.countCards('h')) return -1; return 0; } } @@ -5536,7 +5536,7 @@ mode.stone={ } "step 2" var target=player.getLeader(); - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ target.discard(hs); } @@ -5844,7 +5844,7 @@ mode.stone={ unique:true, content:function(){ var target=player.getLeader(); - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ target.discard(hs.randomGets(1)); } @@ -5883,7 +5883,7 @@ mode.stone={ event.chooser.chooseTarget('吞噬:令一名友方随从死亡',function(card,playerx,target){ return player!=target&&target.isMin()&&target.side==player.side; },true).ai=function(target){ - return -target.hp-target.num('h')/4; + return -target.hp-target.countCards('h')/4; }; player.line(event.chooser); "step 1" @@ -5891,7 +5891,7 @@ mode.stone={ event.chooser.line(result.targets[0]); game.delay(); var target=result.targets[0]; - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ player.gain(hs); } @@ -6272,7 +6272,7 @@ mode.stone={ unique:true, filter:function(event,player){ var target=player.getLeader(); - return target.num('e')>0; + return target.countCards('e')>0; }, content:function(){ "step 0" @@ -6413,7 +6413,7 @@ mode.stone={ unique:true, filter:function(event,player){ for(var i=0;i1){ + if(game.players[i].isMin()&&game.players[i]!=player&&game.players[i].countCards('h')>1){ return true; } } @@ -6423,7 +6423,7 @@ mode.stone={ "step 0" var list=[]; for(var i=0;i1){ + if(game.players[i].isMin()&&game.players[i]!=player&&game.players[i].countCards('h')>1){ list.push(game.players[i]); } } @@ -6619,11 +6619,11 @@ mode.stone={ forced:true, unique:true, filter:function(event,player){ - return player.getLeader().num('e')>0&&player.getEnemy().hasFellow(); + return player.getLeader().countCards('e')>0&&player.getEnemy().hasFellow(); }, content:function(){ 'step 0' - var num=player.getLeader().num('e'); + var num=player.getLeader().countCards('e'); var map=[]; var targets=player.getEnemy().getFellow(); event.targets=targets; @@ -7357,7 +7357,7 @@ mode.stone={ unique:true, filter:function(event,player){ var target=player.getLeader(); - return target.num('e')>0; + return target.countCards('e')>0; }, content:function(){ "step 0" @@ -7483,7 +7483,7 @@ mode.stone={ forced:true, unique:true, filter:function(event,player){ - return event.source.side==player.side&&event.source!=player&&event.source.num('h')<=2; + return event.source.side==player.side&&event.source!=player&&event.source.countCards('h')<=2; }, content:function(){ trigger.source.classList.remove('turnedover'); @@ -7576,7 +7576,7 @@ mode.stone={ unique:true, content:function(){ var target=player.getLeader(); - var hs=target.get('h'); + var hs=target.getCards('h'); if(hs.length){ target.discard(hs.randomGets(2)); } @@ -7673,7 +7673,7 @@ mode.stone={ for(var i=0;i0; + return player.side!=target.side&&target.isMin()&&target.countCards('he')>0; }).ai=function(target){ - return target.num('he'); + return target.countCards('he'); }; player.line(event.chooser); "step 1" if(result.bool){ event.chooser.line(result.targets[0]); game.delay(); - result.targets[0].discard(result.targets[0].get('he')); + result.targets[0].discard(result.targets[0].getCards('he')); } } }, @@ -7999,7 +7999,7 @@ mode.stone={ event.target.damage(event.chooser); } else{ - event.target.discard(event.target.get('h')); + event.target.discard(event.target.getCards('h')); if(event.target.maxHp>2){ event.target.loseMaxHp(event.target.maxHp-2); } @@ -8059,7 +8059,7 @@ mode.stone={ return event.player.hasSkill('druid_chengzhang'); }, content:function(){ - if(player.num('h')){ + if(player.countCards('h')){ game.delay(); player.chooseToDiscard('h',true); } @@ -8412,7 +8412,7 @@ mode.stone={ }, ai:{ order:function(skill,player){ - if(!player.get('e','1')&&player.num('e')<2){ + if(!player.get('e','1')&&player.countCards('e')<2){ if(player.num('h','sha')&&player.getActCount()+3<=player.actcount){ return 4; } @@ -8422,7 +8422,7 @@ mode.stone={ }, result:{ player:function(player){ - if(player.num('e')<=2) return 1; + if(player.countCards('e')<=2) return 1; return 0; } } @@ -8513,7 +8513,7 @@ mode.stone={ var players=get.players(); var targets=[]; for(var i=0;i0; + return player.side!=target.side&&target.isMin()&&target.countCards('he')>0; }).ai=function(target){ - return target.num('he'); + return target.countCards('he'); }; player.line(event.chooser); "step 1" if(result.bool){ event.chooser.line(result.targets[0]); game.delay(); - result.targets[0].discard(result.targets[0].get('he')); + result.targets[0].discard(result.targets[0].getCards('he')); } } }, @@ -8866,11 +8866,11 @@ mode.stone={ forced:true, unique:true, filter:function(event,player){ - return player.getEnemy().num('e')>0; + return player.getEnemy().countCards('e')>0; }, content:function(){ var enemy=player.getEnemy(); - var es=enemy.get('e'); + var es=enemy.getCards('e'); if(es.length){ player.getLeader().line(enemy); game.delay(); @@ -8946,7 +8946,7 @@ mode.stone={ } targets.sort(lib.sort.seat); for(var i=0;ib.num('j')) return 1; + if(a.countCards('j')>b.countCards('j')) return 1; return a.hp-b.hp; }) event.player=list[0]; @@ -2520,7 +2520,7 @@ mode.versus={ for(var i=0;i0; + return player.countCards('h')>0; }, content:function(){ player.chooseToDiscard('h',true); @@ -3524,16 +3524,16 @@ mode.versus={ trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ - var nh=player.num('h'); + var nh=player.countCards('h'); return game.hasPlayer(function(current){ - return current.isEnemyOf(player)&¤t.num('h')>nh; + return current.isEnemyOf(player)&¤t.countCards('h')>nh; }); }, content:function(){ 'step 0' - var nh=player.num('h'); + var nh=player.countCards('h'); var targets=game.filterPlayer(function(current){ - return current.isEnemyOf(player)&¤t.num('h')>nh; + return current.isEnemyOf(player)&¤t.countCards('h')>nh; }); targets.sort(lib.sort.seat); event.targets=targets; @@ -3649,7 +3649,7 @@ mode.versus={ if(att>0&&target.num('j','lebu')){ return 0.1; } - if(player.num('h')>player.hp){ + if(player.countCards('h')>player.hp){ if(target==player) return Math.max(1,att-2); } if(target==player) return att+5; @@ -3873,7 +3873,7 @@ mode.versus={ if(ai.get.attitude(player,target)>-3) return 0; var eff=ai.get.damageEffect(target,player,player,'fire'); if(eff>0){ - return eff+target.num('e')/2; + return eff+target.countCards('e')/2; } return 0; } @@ -3892,7 +3892,7 @@ mode.versus={ } "step 3" if(event.target){ - var es=event.target.get('e'); + var es=event.target.getCards('e'); if(es.length){ event.target.discard(es); } @@ -4281,7 +4281,7 @@ mode.versus={ else if(source){ if(source.side==this.side){ if(source.identity=='zhu'){ - source.discard(source.get('he')); + source.discard(source.getCards('he')); } } else{ @@ -4308,7 +4308,7 @@ mode.versus={ else if(source){ if(source.side==this.side){ if(source.identity=='zhu'){ - source.discard(source.get('he')); + source.discard(source.getCards('he')); } } else{ @@ -4337,7 +4337,7 @@ mode.versus={ if(this.replacetwo){ if(source){ if(source.side==this.side){ - var he=source.get('he'); + var he=source.getCards('he'); if(he.length){ source.discard(he); } @@ -4352,7 +4352,7 @@ mode.versus={ else if(friend&&friend.replacetwo){ if(source){ if(source.side==this.side){ - var he=source.get('he'); + var he=source.getCards('he'); if(he.length){ source.discard(he); } @@ -4451,7 +4451,7 @@ mode.versus={ } else{ if(lib.storage.versus_punish=='弃牌'){ - source.discard(source.get('he')); + source.discard(source.getCards('he')); } else if(lib.storage.versus_punish=='摸牌'&&lib.storage.versus_reward){ source.draw(lib.storage.versus_reward);