From cd554129cd3f4561cb960a6f481790adcc5b24e2 Mon Sep 17 00:00:00 2001 From: libccy Date: Fri, 10 Feb 2017 14:05:14 +0800 Subject: [PATCH] cc --- card/standard.js | 1 + card/swd.js | 1 + character/extra.js | 1 + character/gujian.js | 2 +- character/hearth.js | 1 + character/ow.js | 2 + character/refresh.js | 10 +-- character/shenhua.js | 4 ++ character/sp.js | 2 + character/standard.js | 1 + character/swd.js | 36 +--------- character/yijiang.js | 5 +- character/yxs.js | 4 ++ character/zhuogui.js | 1 + game/game.js | 151 ++++++++++++++++++++++++++++++++---------- mode/chess.js | 1 + mode/stone.js | 1 + 17 files changed, 149 insertions(+), 75 deletions(-) diff --git a/card/standard.js b/card/standard.js index 85df7d7a9..547096bf6 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1032,6 +1032,7 @@ card.standard={ singleCard:true, multitarget:true, targetprompt:['被借刀','出杀目标'], + complexTarget:true, filterTarget:function(card,player,target){ if(ui.selected.targets.length==0){ return (player!=target&&target.get('e',{subtype:'equip1'}).length); diff --git a/card/swd.js b/card/swd.js index 3aaf70eda..65be4706e 100644 --- a/card/swd.js +++ b/card/swd.js @@ -4074,6 +4074,7 @@ card.swd={ return name; }, selectCard:2, + complexCard:true, filter:function(event,player){ if(!player.num('h',{type:['hslingjian','jiqi']})) return false; var es=player.get('he',{type:'equip'}); diff --git a/character/extra.js b/character/extra.js index dd8ef7c47..deaa58456 100644 --- a/character/extra.js +++ b/character/extra.js @@ -855,6 +855,7 @@ character.extra={ } return true; }, + complexCard:true, mark:true, selectCard:[0,4], line:'fire', diff --git a/character/gujian.js b/character/gujian.js index 4f90fd5a7..0af9e70e5 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -781,7 +781,7 @@ character.gujian={ return get.color(card)==get.color(ui.selected.cards[0]); } return player.num('h',{color:get.color(card)})>1; - }).ai=function(card){ + }).set('complexCard',true).ai=function(card){ if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){ return 8-ai.get.value(card); } diff --git a/character/hearth.js b/character/hearth.js index 9b67fd976..c51d93ad3 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -1903,6 +1903,7 @@ character.hearth={ } return true; }, + complexCard:true, position:'he', check:function(card){ return 8-ai.get.value(card); diff --git a/character/ow.js b/character/ow.js index c011799f7..8fc62cfd3 100644 --- a/character/ow.js +++ b/character/ow.js @@ -953,6 +953,7 @@ character.ow={ } return true; }, + complexCard:true, filterTarget:function(card,player,target){ return target!=player&&target.num('h')>0; }, @@ -1195,6 +1196,7 @@ character.ow={ return true; }, selectCard:[1,Infinity], + complexCard:true, filterTarget:function(card,player,target){ return !target.hasSkill('bingqiang2')&&!target.hasSkill('bingqiang5')&& !target.next.hasSkill('bingqiang2')&&!target.next.hasSkill('bingqiang5')&& diff --git a/character/refresh.js b/character/refresh.js index 11bef6e17..2ba71457f 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -1358,6 +1358,7 @@ character.refresh={ } return target.num('he')>0; }, + complexTarget:true, filter:function(event,player){ return player.num('he')>0; }, @@ -1389,16 +1390,17 @@ character.refresh={ xunxun:{ audio:2, trigger:{player:'phaseDrawBefore'}, - direct:true, + check:function(event,player){ + return !player.hasSkill('reyiji2'); + }, content:function(){ "step 0" + trigger.untrigger(); + trigger.finish(); event.cards=get.cards(4); player.chooseCardButton(event.cards,2,'选择获得两张牌').set('ai',ai.get.buttonValue); "step 1" if(result.bool){ - player.logSkill('xunxun'); - trigger.untrigger(); - trigger.finish(); var choice=[]; for(var i=0;i0; } }, + complexTarget:true, selectTarget:2, filterCard:lib.filter.cardDiscardable, prompt:'是否发动巧变跳过出牌阶段?', @@ -2077,6 +2079,7 @@ character.shenhua={ }, selectCard:[0,Infinity], selectTarget:2, + complexTarget:true, filterTarget:function(card,player,target){ if(player==target) return false; if(ui.selected.targets.length==0) return true; @@ -3070,6 +3073,7 @@ character.shenhua={ return false; }, selectCard:2, + complexCard:true, check:function(card){ return 6-ai.get.value(card); }, diff --git a/character/sp.js b/character/sp.js index 28026ba9a..af130e902 100644 --- a/character/sp.js +++ b/character/sp.js @@ -897,6 +897,7 @@ character.sp={ } return get.number(card)+num<=13; }, + complexCard:true, selectCard:function(){ var num=0; for(var i=0;i0&&target.distanceTo(ui.selected.targets[0])<=1; diff --git a/character/standard.js b/character/standard.js index 753952fa5..f3bdf8861 100644 --- a/character/standard.js +++ b/character/standard.js @@ -1536,6 +1536,7 @@ character.standard={ check:function(card){return 10-ai.get.value(card)}, filterCard:true, position:'he', + complexTarget:true, filterTarget:function(card,player,target){ if(player==target) return false; if(target.sex!='male') return false; diff --git a/character/swd.js b/character/swd.js index 32ac68175..cb767b452 100644 --- a/character/swd.js +++ b/character/swd.js @@ -4435,6 +4435,7 @@ character.swd={ } return true; }, + complexCard:true, selectCard:[1,4], check:function(card){ return 7-ai.get.value(card) @@ -6984,6 +6985,8 @@ character.swd={ } return true; }, + complexCard:true, + complexTarget:true, selectCard:[1,Infinity], filterTarget:function(card,player,target){ if(player==target) return false; @@ -7126,39 +7129,6 @@ character.swd={ order:5 } }, - swd_xiuluo:{ - audio:2, - trigger:{player:'phaseBegin'}, - direct:true, - filter:function(event,player){ - return player.num('j')>0; - }, - content:function(){ - "step 0" - player.chooseToDiscard(2,'hj',function(card){ - if(ui.selected.cards.length==0) return true; - if(get.position(ui.selected.cards[0])=='h'){ - if(get.position(card)!='j') return false; - } - if(get.position(ui.selected.cards[0])=='j'){ - if(get.position(card)!='h') return false; - } - return get.suit(card)==get.suit(ui.selected.cards[0]) - },'是否一张手牌来弃置一张花色相同的判定牌?').ai=function(card){ - if(get.position(card)=='h'){ - return 11-ai.get.value(card); - } - if(card.name=='lebu') return 5; - if(card.name=='bingliang') return 4; - if(card.name=='guiyoujie') return 3; - return 2; - } - "step 1" - if(result.bool){ - player.logSkill('swd_xiuluo'); - } - } - }, guxing:{ group:['guxing1','guxing3'] }, diff --git a/character/yijiang.js b/character/yijiang.js index e02e16e3c..3e84d3b94 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -1398,7 +1398,7 @@ character.yijiang={ return 1; } return 2; - }).set('nontrick',n2.length>=2); + }).set('nontrick',n2.length>=2).set('complexCard',true); } else{ if(n1.length){ @@ -5337,6 +5337,7 @@ character.yijiang={ return false; }, selectTarget:2, + complexTarget:true, content:function(){ 'step 0' var gainner,giver; @@ -5418,6 +5419,7 @@ character.yijiang={ selectTarget:2, multitarget:true, discard:false, + complexTarget:true, targetprompt:['得到牌','出杀目标'], prepare:'give', filterTarget:function(card,player,target){ @@ -6750,6 +6752,7 @@ character.yijiang={ return Math.abs(ui.selected.targets[0].num('e')-target.num('e'))<=player.maxHp-player.hp; }, multitarget:true, + complexTarget:true, content:function(){ "step 0" event.cards=[targets[0].get('e'),targets[1].get('e')]; diff --git a/character/yxs.js b/character/yxs.js index f272ba688..fb8658d42 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -515,6 +515,7 @@ character.yxs={ } return true; }, + complexCard:true, usable:1, selectCard:2, check:function(card){ @@ -794,6 +795,7 @@ character.yxs={ } return true; }, + complexCard:true, selectCard:2, check:function(card){ return 8-ai.get.value(card); @@ -1339,6 +1341,7 @@ character.yxs={ } return get.color(card)=='black'||card.name=='jiu'; }; + next.complexCard=true, next.logSkill=['zhensha',trigger.player]; next.selectCard=function(){ if(ui.selected.cards.length){ @@ -2333,6 +2336,7 @@ character.yxs={ return 7-ai.get.value(card); }, multitarget:true, + complexTarget:true, targetprompt:['被移走','移动目标'], filterTarget:function(card,player,target){ if(ui.selected.targets.length){ diff --git a/character/zhuogui.js b/character/zhuogui.js index 82592e5c0..eede11cbb 100644 --- a/character/zhuogui.js +++ b/character/zhuogui.js @@ -285,6 +285,7 @@ character.zhuogui={ } return true; }, + complexCard:true, selectCard:3, position:'he', filterTarget:function(card,player,target){ diff --git a/game/game.js b/game/game.js index cb9c62292..b5b156f23 100644 --- a/game/game.js +++ b/game/game.js @@ -5771,6 +5771,9 @@ game.me.actused=-99; } ui.updatehl(); + delete _status.event._cardChoice; + delete _status.event._targetChoice; + delete _status.event._skillChoice; setTimeout(game.check,300); }, gc:function(name,act){ @@ -5780,6 +5783,9 @@ game.me.actused=-99; } ui.updatehl(); + delete _status.event._cardChoice; + delete _status.event._targetChoice; + delete _status.event._skillChoice; setTimeout(game.check,300); }, aa:function(){ @@ -5857,6 +5863,9 @@ target=target||game.me; var card=cheat.gn(name); target.node.handcards1.appendChild(card); + delete _status.event._cardChoice; + delete _status.event._targetChoice; + delete _status.event._skillChoice; game.check(); target.update(); ui.updatehl(); @@ -5930,6 +5939,9 @@ for(var i=0;i1) auto=false; for(i=0;i=range[1]|| + !event._cardChoice.contains(cards[i])|| + !lib.filter.cardAiIncluded(cards[i])){ + cards[i].classList.remove('selectable'); } else{ - cards[i].classList.remove('selectable'); + cards[i].classList.add('selectable'); } } else{ - cards[i].classList.remove('selectable'); - if(range[1]==-1){ - cards[i].classList.remove('selected'); - ui.selected.cards.remove(cards[i]); + if(event.filterCard(cards[i],player)&& + lib.filter.cardAiIncluded(cards[i])&& + (player.isOut()==false||event.includeOutCard)&& + lib.filter.cardRespondable(cards[i],player)&& + !cards[i].classList.contains('uncheck')){ + if(ui.selected.cards.length=info.usable) enable=false; - if(info.chooseButton&&_status.event.noButton) enable=false; + var skills2; + if(event._skillChoice){ + skills2=event._skillChoice; + for(var i=0;i=info.usable) enable=false; + if(info.chooseButton&&_status.event.noButton) enable=false; + } + if(enable){ + if(event.isMine()||!event.aiexclude.contains(skills2[i])){ + skills.add(skills2[i]); + } + event._skillChoice.add(skills2[i]); + } } } @@ -32276,6 +32352,9 @@ if(game.onresume){ game.onresume(); } + delete _status.event._cardChoice; + delete _status.event._targetChoice; + delete _status.event._skillChoice; return false; }, config:function(){ diff --git a/mode/chess.js b/mode/chess.js index 70abaf4a7..8f1a3e72c 100644 --- a/mode/chess.js +++ b/mode/chess.js @@ -4430,6 +4430,7 @@ mode.chess={ } return true; }, + complexCard:true, selectCard:4, check:function(card){ return 10-ai.get.value(card); diff --git a/mode/stone.js b/mode/stone.js index 9db15f1c4..b275ad11d 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -4170,6 +4170,7 @@ mode.stone={ } return true; }, + complexTarget:true, selectTarget:2, multitarget:true, multiline:true,