'use strict'; card.sp={ connect:true, card:{ yinyueqiang:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-2}, ai:{ basic:{ equipValue:4 } }, skills:['yinyueqiang'] }, muniu:{ fullskin:true, type:'equip', subtype:'equip5', nomod:true, onEquip:function(){ player.markSkill('muniu_skill6'); }, onLose:function(){ player.unmarkSkill('muniu_skill6'); if(event.parent.type!='equip'&&card&&card.cards&&card.cards.length){ player.$throw(card.cards,1000); player.popup('muniu'); game.log(card,'掉落了',card.cards); while(card.cards.length){ var card2=card.cards.shift(); if(card2.parentNode.id=='special'){ ui.discardPile.appendChild(card2); } } } }, equipDelay:false, loseDelay:false, skills:['muniu_skill','muniu_skill2','muniu_skill6','muniu_skill7'], ai:{ basic:{ equipValue:function(card){ if(card.card) return 8+card.card.length; return 8; } } } }, du:{ type:'basic', fullskin:true, ai:{ value:-5, useful:6, result:{ player:function(player,target){ if(player.hasSkillTag('usedu')) return 5; return -1; } }, order:7.5 }, enable:true, modTarget:true, filterTarget:function(card,player,target){ return target==player; }, delay:false, content:function(){}, selectTarget:-1 }, shengdong:{ fullskin:true, enable:true, chongzhu:function(){ return game.countPlayer()<=2; }, singleCard:true, type:'trick', selectTarget:2, multitarget:true, targetprompt:['交给其一张牌','得两张牌'], filterTarget:function(card,player,target){ return target!=player; }, content:function(){ 'step 0' if(!player.num('h')){ event.finish(); } else{ event.target1=target; event.target2=event.addedTarget; player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true); } 'step 1' player.$giveAuto(result.cards,event.target1); event.target1.gain(result.cards,player); 'step 2' if(!event.target1.num('h')){ event.finish(); } else{ var he=event.target1.get('he'); if(he.length<=2){ event.directresult=he; } else{ event.target1.chooseCard('he','将两张牌交给'+get.translation(event.target2),2,true); } } 'step 3' if(!event.directresult){ event.directresult=result.cards; } event.target1.$giveAuto(event.directresult,event.target2); event.target2.gain(event.directresult,event.target1); }, ai:{ order:2.5, value:[4,1], useful:1, wuxie:function(){ return 0; }, result:{ target:function(player,target){ var ok=false; var hs=player.get('h'); if(hs.length<=1) return 0; for(var i=0;i2); event.more=true; } else{ target.chooseToDiscard('he',2,true); } 'step 2' if(event.more&&!result.bool){ target.chooseToDiscard('he',2,true); } }, ai:{ order:7, useful:4, value:10, result:{ target:function(player,target){ if(target.num('j','lebu')) return 0; return Math.max(1,2-target.num('h')/10); } } } }, caomu:{ fullskin:true, enable:true, type:'delay', filterTarget:function(card,player,target){ return (lib.filter.judge(card,player,target)&&player!=target); }, judge:function(card){ if(get.suit(card)=='club') return 0; return -3; }, effect:function(){ if(result.bool==false){ player.addTempSkill('caomu_skill','phaseAfter'); } }, ai:{ basic:{ order:1, useful:1, value:4.5, }, result:{ player:function(player,target){ return game.countPlayer(function(current){ if(get.distance(target,current)<=1&¤t!=target){ var att=ai.get.attitude(player,current); if(att>3){ return 1.1; } else if(att>0){ return 1; } else if(att<-3){ return -1.1; } else if(att<0){ return -1; } } }); }, target:-1 }, } } }, skill:{ yinyueqiang:{ trigger:{player:['useCard','respondAfter']}, direct:true, filter:function(event,player){ if(_status.currentPhase==player) return false; if(!event.cards) return false; if(event.cards.length!=1) return false; if(lib.filter.autoRespondSha.call({player:player})) return false; return get.color(event.cards[0])=='black'; }, content:function(){ 'step 0' var next=player.chooseToUse(get.prompt('yinyueqiang'),{name:'sha'}).aidelay=true; next.logSkill='yinyueqiang'; next.noButton=true; 'step 1' if(result.bool){ game.delay(); } } }, muniu_skill:{ enable:'phaseUse', usable:1, filterCard:true, check:function(card){ if(card.name=='du') return 20; var player=_status.event.player; var nh=player.num('h'); if(!player.needsToDiscard()){ if(nh<3) return 0; if(nh==3) return 5-ai.get.value(card); return 7-ai.get.value(card); } return 10-ai.get.useful(card); }, discard:false, lose:true, sync:function(muniu){ if(game.online){ return; } if(!muniu.cards){ muniu.cards=[]; } for(var i=0;i0; }, prepare:function(cards,player){ player.$give(1,player,false); }, content:function(){ "step 0" for(var i=0;i=3&&ai.get.attitude(current,player)>=3){ return true; } }); players.sort(lib.sort.seat); var choice=players[0]; var next=player.chooseTarget('是否移动木牛流马?',function(card,player,target){ return !target.isMin()&&player!=target&&!target.get('e','5'); }); next.set('ai',function(target){ return target==_status.event.choice?1:-1; }); next.set('choice',choice); "step 1" if(result.bool){ var card=player.get('e','5'); result.targets[0].equip(card); player.$give(card,result.targets[0]); player.line(result.targets,'green'); game.delay(); } else{ player.updateMarks(); } }, ai:{ save:true, respondSha:true, respondShan:true, skillTagFilter:function(player,tag){ var muniu=player.get('e','5'); if(!muniu||!muniu.cards) return false; for(var i=0;i1) 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'){ var current=player.get('e',{subtype:get.subtype(button.link)})[0]; if(current&&ai.get.equipValue(current)>=ai.get.equipValue(button.link)) return -1; return 1; } if(get.tag(button.link,'multitarget')) return -1; if(button.link.name=='huoshaolianying') return -1; } if(button.link.name=='jiu'){ if(ai.get.effect(player,{name:'jiu'},player)>0){ return 1; } return -1; } return 1; }, backup:function(links,player){ return { filterCard:function(){return false}, selectCard:-1, viewAs:links[0], onuse:function(result,player){ var muniu=player.get('e','5'); if(muniu&&muniu.cards){ muniu.cards.remove(result.card); lib.skill.muniu_skill.sync(muniu); } player.updateMarks(); } } }, prompt:function(links,player){ return '选择'+get.translation(links)+'的目标'; } }, ai:{ order:4, result:{ player:function(player){ if(_status.dying) return ai.get.attitude(player,_status.dying); return 1; } }, useful:-1, value:-1 } }, muniu_skill6:{ mark:true, intro:{ content:function(storage,player){ var muniu=player.get('e','5'); if(!muniu||!muniu.cards||!muniu.cards.length) return '共有〇张牌'; if(player.isUnderControl(true)){ return get.translation(muniu.cards); } else{ return '共有'+get.cnNumber(muniu.cards.length)+'张牌'; } }, mark:function(dialog,storage,player){ var muniu=player.get('e','5'); if(!muniu||!muniu.cards||!muniu.cards.length) return '共有〇张牌'; if(player.isUnderControl(true)){ dialog.addAuto(muniu.cards); } else{ return '共有'+get.cnNumber(muniu.cards.length)+'张牌'; } }, markcount:function(storage,player){ var muniu=player.get('e','5'); if(muniu&&muniu.cards) return muniu.cards.length; return 0; } } }, muniu_skill7:{ filter:function(){return false}, hiddenCard:function(player,name){ var muniu=player.get('e','5'); if(!muniu.cards) return false; lib.skill.muniu_skill.sync(muniu); for(var i=0;i