'use strict'; game.import('card',function(lib,game,ui,get,ai,_status){ return { name:'yunchou', card:{ diaobingqianjiang:{ fullskin:true, type:'trick', enable:true, selectTarget:-1, filterTarget:function(card,player,target){ return player==target||target.countCards('h'); }, contentBefore:function(){ "step 0" game.delay(); player.draw(); "step 1" if(get.is.versus()){ player.chooseControl('顺时针','逆时针',function(event,player){ if(player.next.side==player.side) return '逆时针'; return '顺时针'; }).set('prompt','选择'+get.translation(card)+'的结算方向'); } else{ event.goto(3); } "step 2" if(result&&result.control=='顺时针'){ var evt=event.getParent(); evt.fixedSeat=true; evt.targets.sortBySeat(); evt.targets.reverse(); if(evt.targets[evt.targets.length-1]==player){ evt.targets.unshift(evt.targets.pop()); } } "step 3" ui.clear(); var cards=get.cards(Math.ceil(game.countPlayer()/2)); var dialog=ui.create.dialog('调兵遣将',cards,true); _status.dieClose.push(dialog); dialog.videoId=lib.status.videoId++; game.addVideo('cardDialog',null,['调兵遣将',get.cardsInfo(cards),dialog.videoId]); event.getParent().preResult=dialog.videoId; }, content:function(){ "step 0" for(var i=0;i0){ return get.value(button.link,nextSeat)-5; } else{ return 5-get.value(button.link,nextSeat); } } next.set('closeDialog',false); next.set('dialogdisplay',true); 'step 1' if(result&&result.bool&&result.links&&result.links.length){ for(var i=0;i0&&target!=player; }, content:function(){ 'step 0' if(target.countCards('h','sha')){ var name=get.translation(player.name); target.chooseControl().set('prompt',get.translation('caochuanjiejian')).set('choiceList',[ '将手牌中的所有杀交给'+name+',并视为对'+name+'使用一张杀','展示手牌并令'+name+'弃置任意一张' ],function(){ if(get.effect(player,{name:'sha'},target,target)<0) return 1; if(target.countCards('h','sha')>=3) return 1; return 0; }); } else{ event.directfalse=true; } 'step 1' if(event.directfalse||result.control=='选项二'){ if(target.countCards('h')){ if(!player.isUnderControl(true)){ target.showHandcards(); } else{ game.log(target,'展示了',target.getCards('h')); } player.discardPlayerCard(target,'h',true,'visible'); } event.finish(); } else{ var hs=target.getCards('h','sha'); player.gain(hs,target); target.$give(hs,player); } 'step 2' target.useCard({name:'sha'},player); }, ai:{ order:4, value:[5,1], result:{ target:function(player,target){ if(player.hasShan()) return -1; return 0; } } } }, // xiaolicangdao:{ // fullskin:true, // type:'trick', // enable:true, // filterTarget:function(card,player,target){ // return target!=player; // }, // multitarget:true, // content:function(){ // 'step 0' // if(cards&&cards.length){ // target.gain(cards,player); // target.$gain2(cards); // if(cards.length==1){ // event.card1=cards[0]; // } // } // 'step 1' // event.card2=target.getCards('h').randomGet(); // if(event.card2){ // target.discard(event.card2); // } // else{ // event.finish(); // } // 'step 2' // if(event.card1&&event.card1.name==event.card2.name){ // target.damage(); // } // }, // ai:{ // order:6, // value:[3,1], // result:{ // target:function(player,target){ // return -2/Math.sqrt(1+target.countCards('h')); // }, // }, // tag:{ // damage:1, // discard:1, // loseCard:1, // } // } // }, geanguanhuo:{ fullskin:true, type:'trick', filterTarget:function(card,player,target){ if(target==player) return false; if(!ui.selected.targets.length) return target.countCards('h')>0&&game.hasPlayer(function(current){ return target.canCompare(current); }); return ui.selected.targets[0].canCompare(target); }, enable:function(){ return game.countPlayer()>2; }, chongzhu:function(){ return game.countPlayer()<=2; }, multicheck:function(card,player){ return game.countPlayer(function(current){ return current!=player&¤t.countCards('h'); })>1; }, multitarget:true, multiline:true, singleCard:true, complexSelect:true, content:function(){ 'step 0' target.chooseToCompare(event.addedTarget); 'step 1' if(!result.tie){ if(result.bool){ if(event.addedTarget.countCards('he')){ target.line(event.addedTarget); target.gainPlayerCard(event.addedTarget,true); } } else{ if(target.countCards('he')){ event.addedTarget.line(target); event.addedTarget.gainPlayerCard(target,true); } } event.finish(); } 'step 2' target.discardPlayerCard(player); target.line(player); }, selectTarget:2, ai:{ order:5, value:[7,1], useful:[4,1], result:{ target:-1, } } }, shezhanqunru:{ fullskin:true, type:'trick', enable:true, toself:true, filterTarget:function(card,player,target){ return target==player; }, selectTarget:-1, modTarget:true, content:function(){ 'step 0' var list=game.filterPlayer(function(current){ return current!=target&&target.canCompare(current); }); if(!list.length){ target.draw(3); event.finish(); } else{ list.sortBySeat(target); event.list=list; event.torespond=[]; } 'step 1' if(event.list.length){ event.current=event.list.shift(); event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){ if(get.attitude(player,_status.event.source)>=0) return false; var hs=player.getCards('h'); var dutag=player.hasSkillTag('nodu'); for(var i=0;i=8&&value<=7) return true; if(value<=3) return true; } else if(_status.event.hasTarget%2==1){ if(hs[i].number>=11&&value<=6) return true; } } return false; }).set('source',target).set('hasTarget',event.torespond.length); } else{ event.goto(3); } 'step 2' if(result.bool){ event.torespond.push(event.current); event.current.line(target,'green'); event.current.popup('响应'); game.log(event.current,'响应了舌战群儒'); game.delayx(0.5); } event.goto(1); 'step 3' if(event.torespond.length==0){ event.num=1; } else{ event.num=0; target.chooseToCompare(event.torespond).callback=lib.card.shezhanqunru.callback; } 'step 4' if(event.num>0){ target.draw(3); } }, callback:function(){ if(event.card1.number>event.card2.number){ event.parent.parent.num++; } else{ event.parent.parent.num--; } }, ai:{ order:8.5, value:[6,1], useful:[3,1], tag:{ draw:1 }, result:{ target:function(player,target){ var hs=target.getCards('h'); for(var i=0;i=7&&value<=6) return 1; if(value<=3) return 1; } return 0; } } } }, youdishenru:{ fullskin:true, type:'trick', notarget:true, wuxieable:true, global:'g_youdishenru', content:function(){ 'step 0' var info=event.getParent(2).youdiinfo||event.getParent(3).youdiinfo; if(!info){ event.finish(); return; } info.evt.cancel(); event.source=info.source; event.source.storage.youdishenru=player; event.source.addSkill('youdishenru'); 'step 1' var next=event.source.chooseToUse({name:'sha'},player,-1,'对'+get.translation(player)+'使用一张杀,或受到一点伤害').set('addCount',false); next.ai2=function(){ return 1; }; 'step 2' if(result.bool){ if(event.source.storage.youdishenru){ event.goto(1); } else{ event.source.removeSkill('youdishenru'); } } else{ event.source.damage(player); event.source.removeSkill('youdishenru'); } }, ai:{ value:[5,1], useful:[5,1], order:1, wuxie:function(target,card,player,current,state){ return -state*get.attitude(player,current); }, result:{ player:function(player){ if(_status.event.parent.youdiinfo&& get.attitude(player,_status.event.parent.youdiinfo.source)<=0){ return 1; } return 0; } } } }, wangmeizhike:{ fullskin:true, type:'trick', enable:true, filterTarget:function(card,player,target){ return (target.isMinHp()&&target.isDamaged())||target.isMinHandcard(); }, content:function(){ 'step 0' if(target.isMinHp()&&target.isDamaged()){ target.recover(); event.rec=true; } 'step 1' if(target.isMinHandcard()){ target.draw(event.rec?1:2); } }, ai:{ order:2.5, value:7, result:{ target:function(player,target){ var num=0; if(target.isMinHp()&&get.recoverEffect(target)>0){ if(target.hp==1){ num+=3; } else{ num+=2; } } if(target.isMinHandcard()){ num+=2; } return num; } } } }, suolianjia:{ fullskin:true, type:"equip", subtype:"equip2", skills:['suolianjia'], onEquip:function(){ if(player.isLinked()==false) player.link(); }, onLose:function(){ if(player.isLinked()) player.link(); }, ai:{ basic:{ equipValue:5 }, }, }, chenhuodajie:{ fullskin:true, type:'trick', filterTarget:true, global:'g_chenhuodajie', content:function(){ if(target.countCards('he')){ player.gainPlayerCard('he',target,true); } }, ai:{ order:1, useful:6, value:6, result:{ target:-1 }, tag:{ loseCard:1 } } }, fudichouxin:{ fullskin:true, type:'trick', enable:true, filterTarget:function(card,player,target){ return player.canCompare(target); }, content:function(){ "step 0" player.chooseToCompare(target).set('preserve','win').clear=false; "step 1" if(result.bool){ player.gain([result.player,result.target]); result.player.clone.moveDelete(player); result.target.clone.moveDelete(player); game.addVideo('gain2',player,get.cardsInfo([result.player,result.target])); } else if(!result.cancelled){ result.player.clone.delete(); result.target.clone.delete(); game.addVideo('deletenode',player,get.cardsInfo([result.player,result.target])); } }, ai:{ order:4, value:[4,1], result:{ target:function(player){ if(player.countCards('h')<=1) return 0; return -1; }, player:function(player){ if(player.countCards('h')<=1) return 0; return 0.5; } }, tag:{ loseCard:1 } } }, shuiyanqijun:{ fullskin:true, type:'trick', enable:true, filterTarget:function(card,player,target){ return target.countCards('e'); }, selectTarget:-1, content:function(){ if(target.countCards('e')) target.chooseToDiscard('e',true); }, reverseOrder:true, ai:{ order:9, result:{ target:function(player,target){ if(target.countCards('e')) return -1; return 0; } }, tag:{ multitarget:1, multineg:1 } } }, toulianghuanzhu:{ fullskin:true, type:'trick', enable:true, filterTarget:function(card,player,target){ return target.countCards('h')>0; }, content:function(){ 'step 0' if(!target.countCards('h')){ event.finish(); return; } var hs=player.getCards('h'); if(hs.length){ var minval=get.value(hs[0]); var colors=[get.color(hs[0])]; for(var i=1;i=0){ if(colors.contains(get.color(button.link))){ val+=3; } } return val; } } else{ player.viewHandcards(target); event.finish(); } 'step 1' if(result.bool){ event.card=result.links[[0]]; player.chooseCard('h',true,'用一张手牌替换'+get.translation(event.card)).ai=function(card){ return -get.value(card); }; } else{ event.finish(); } 'step 2' if(result.bool){ player.gain(event.card,target); target.gain(result.cards,player); player.$giveAuto(result.cards,target); target.$giveAuto(event.card,player); game.log(player,'与',target,'交换了一张手牌'); if(get.color(event.card)==get.color(result.cards[0])){ player.draw(); } target.addTempSkill('toulianghuanzhu_ai1'); } else{ target.addTempSkill('toulianghuanzhu_ai2'); } }, ai:{ order:8, tag:{ loseCard:1, norepeat:1, }, result:{ target:function(player,target){ if(player.countCards('h')<=1) return 0; if(target.hasSkill('toulianghuanzhu_ai2')) return 0; if(target.hasSkill('toulianghuanzhu_ai1')) return 0.5; return -1; } }, useful:[4,1], value:[6,1] } }, huoshan:{ fullskin:true, type:'delay', cardcolor:'red', cardnature:'fire', modTarget:function(card,player,target){ return lib.filter.judge(card,player,target); }, enable:function(card,player){ return player.canAddJudge(card); }, filterTarget:function(card,player,target){ return (lib.filter.judge(card,player,target)&&player==target); }, selectTarget:[-1,-1], judge:function(card){ if(get.suit(card)=='heart'&&get.number(card)>1&&get.number(card)<10) return -6; return 0; }, effect:function(){ if(result.bool==false){ player.damage(2,'fire','nosource'); var players=game.filterPlayer(function(current){ return get.distance(player,current)<=1&&player!=current; }); players.sort(lib.sort.seat); for(var i=0;i1&&get.number(card)<10) return -3; return 0; }, fullskin:true, effect:function(){ if(result.bool==false){ if(player.countCards('he')==0) player.loseHp(); else{ player.discard(player.getCards('he').randomGets(3)); } var players=get.players(); for(var i=0;i