'use strict'; game.import('card',function(lib,game,ui,get,ai,_status){ return { name:'standard', connect:true, card:{ damage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1 } } }, recover:{ ai:{ result:{ target:1.5 }, tag:{ recover:1 } } }, firedamage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1, fireDamage:1, natureDamage:1, } } }, thunderdamage:{ ai:{ result:{ target:-1.5 }, tag:{ damage:1, thunderDamage:1, natureDamage:1, } } }, respondShan:{ ai:{ result:{ target:-1.5, }, tag:{ respond:1, respondShan:1, damage:1 } } }, sha:{ audio:true, fullskin:true, nature:['thunder','fire'], type:'basic', enable:true, usable:1, range:{attack:1}, selectTarget:1, filterTarget:function(card,player,target){return player!=target}, content:function(){ "step 0" if(typeof event.shanRequired!='number'||!event.shanRequired||event.shanRequired<0){ event.shanRequired=1; } var evt=event.getParent('useCard') if(evt&&(typeof evt.baseDamage=='number'&&evt.baseDamage>0)){ event.baseDamage=evt.baseDamage; } else event.baseDamage=1; if(typeof event.extraDamage!='number'){ event.extraDamage=0; } "step 1" if(event.directHit){ event._result={bool:false}; } else if(event.skipShan){ event._result={bool:true}; } else{ var next=target.chooseToRespond({name:'shan'}); if(event.shanRequired>1){ next.set('prompt2','(共需打出'+event.shanRequired+'张闪)'); } next.set('ai',function(card){ var target=_status.event.player; var evt=_status.event.getParent(); if(_status.event.shanRequired>1&&target.countCards('h','shan')<_status.event.shanRequired){ return -1 } if(target.hasSkillTag('useShan')){ return 11-get.value(card); } if(target.hasSkillTag('noShan')){ return -1; } if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) return -1; return 11-get.value(card); }).set('shanRequired',event.shanRequired); next.autochoose=lib.filter.autoRespondShan; } "step 2" if(result.bool==false){ event.trigger('shaHit'); } else{ event.shanRequired--; if(event.shanRequired>0){ event.goto(1); } else{ event.trigger('shaMiss'); event.responded=result; } } "step 3" if(result.bool==false&&!event.unhurt){ target.damage(get.nature(event.card),event.baseDamage+event.extraDamage); event.result={bool:true} event.trigger('shaDamage'); } else{ event.result={bool:false} event.trigger('shaUnhirt'); } }, ai:{ basic:{ useful:[5,1], value:[5,1], }, order:function(){ if(_status.event.player.hasSkillTag('presha',true,null,true)) return 10; return 3; }, result:{ target:function(player,target){ if(player.hasSkill('jiu')&&!target.getEquip('baiyin')){ if(get.attitude(player,target)>0){ return -6; } else{ return -3; } } return -1.5; }, }, tag:{ respond:1, respondShan:1, damage:function(card){ if(card.nature=='poison') return; return 1; }, natureDamage:function(card){ if(card.nature) return 1; }, fireDamage:function(card,nature){ if(card.nature=='fire') return 1; }, thunderDamage:function(card,nature){ if(card.nature=='thunder') return 1; }, poisonDamage:function(card,nature){ if(card.nature=='poison') return 1; } } } }, shacopy:{ ai:{ basic:{ useful:[5,1], value:[5,1], }, order:3, result:{ target:-1.5, }, tag:{ respond:1, respondShan:1, damage:function(card){ if(card.nature=='poison') return; return 1; }, natureDamage:function(card){ if(card.nature) return 1; }, fireDamage:function(card,nature){ if(card.nature=='fire') return 1; }, thunderDamage:function(card,nature){ if(card.nature=='thunder') return 1; }, poisonDamage:function(card,nature){ if(card.nature=='poison') return 1; } } } }, shan:{ audio:true, fullskin:true, type:'basic', cardcolor:'red', ai:{ basic:{ useful:[7,2], value:[7,2] } } }, tao:{ fullskin:true, type:'basic', cardcolor:'red', toself:true, enable:function(card,player){ return player.hp=2&&target.countCards('h','tao')<=1){ keep=true; } var mode=get.mode(); if(target.hp>=2&&keep&&target.hasFriend()){ if(target.hp>2||nd==0) return 0; if(target.hp==2){ if(game.hasPlayer(function(current){ if(target!=current&&get.attitude(target,current)>=3){ if(current.hp<=1) return true; if((mode=='identity'||mode=='versus'||mode=='chess')&¤t.identity=='zhu'&¤t.hp<=2) return true; } })){ return 0; } } } if(target.hp<0&&target!=player&&target.identity!='zhu') return 0; var att=get.attitude(player,target); if(att<3&&att>=0&&player!=target) return 0; var tri=_status.event.getTrigger(); if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){ if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){ var num=game.countPlayer(function(current){ if(current.identity=='fan'){ return current.countCards('h','tao'); } }); if(num>1&&player==target) return 2; return 0; } } if(mode=='identity'&&player.identity=='zhu'&&target.identity=='nei'){ if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='zhong'){ return 0; } } if(mode=='stone'&&target.isMin()&& player!=target&&tri&&tri.name=='dying'&&player.side==target.side&& tri.source!=target.getEnemy()){ return 0; } return 2; }, }, tag:{ recover:1, save:1, } } }, bagua:{ fullskin:true, type:'equip', subtype:'equip2', ai:{ basic:{ equipValue:7.5 } }, skills:['bagua_skill'] }, jueying:{ fullskin:true, type:'equip', subtype:'equip3', distance:{globalTo:1}, }, dilu:{ fullskin:true, type:'equip', subtype:'equip3', distance:{globalTo:1}, }, zhuahuang:{ fullskin:true, type:'equip', subtype:'equip3', distance:{globalTo:1}, }, chitu:{ fullskin:true, type:'equip', subtype:'equip4', distance:{globalFrom:-1}, }, dawan:{ fullskin:true, type:'equip', subtype:'equip4', distance:{globalFrom:-1}, }, zixin:{ fullskin:true, type:'equip', subtype:'equip4', distance:{globalFrom:-1}, }, zhuge:{ fullskin:true, type:'equip', subtype:'equip1', ai:{ equipValue:function(card,player){ if(!game.hasPlayer(function(current){ return player.canUse('sha',current)&&get.distance(player,current)<=1&&get.effect(current,{name:'sha'},player,player)>0; })){ return 1; } if(player.hasSha()&&_status.currentPhase==player){ if(player.getEquip('zhuge')&&player.countUsed('sha')||player.getCardUsable('sha')==0){ return 10; } } var num=player.countCards('h','sha'); if(num>1) return 6+num; return 3+num; }, basic:{ equipValue:5 }, tag:{ valueswap:1 } }, skills:['zhuge_skill'] }, cixiong:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-1}, ai:{ basic:{ equipValue:2 } }, skills:['cixiong_skill'] }, qinggang:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-1}, ai:{ basic:{ equipValue:2 } }, skills:['qinggang_skill'] }, qinglong:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-2}, ai:{ equipValue:function(card,player){ return Math.min(2.5+player.countCards('h','sha'),4); }, basic:{ equipValue:3.5 } }, skills:['qinglong_skill','qinglong_guozhan'] }, zhangba:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-2}, ai:{ equipValue:function(card,player){ var num=2.5+player.countCards('h')/3; return Math.min(num,4); }, basic:{ equipValue:3.5 } }, skills:['zhangba_skill'] }, guanshi:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-2}, ai:{ equipValue:function(card,player){ var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5; return Math.min(num,5); }, basic:{ equipValue:4.5, } }, skills:['guanshi_skill'] }, fangtian:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-3}, ai:{ basic:{ equipValue:2.5 } }, skills:['fangtian_skill','fangtian_guozhan'] }, qilin:{ fullskin:true, type:'equip', subtype:'equip1', distance:{attackFrom:-4}, ai:{ basic:{ equipValue:3 } }, skills:['qilin_skill'] }, wugu:{ audio:true, fullskin:true, type:'trick', enable:true, cardcolor:'red', selectTarget:-1, filterTarget:true, contentBefore:function(){ "step 0" game.delay(); "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 num; if(event.getParent().stocktargets){ num=event.getParent().stocktargets.length; } else{ num=game.countPlayer(); } var cards=get.cards(num); 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; game.broadcast(function(cards,id){ var dialog=ui.create.dialog('五谷丰登',cards,true); _status.dieClose.push(dialog); dialog.videoId=id; },cards,dialog.videoId); game.log(event.card,'亮出了',cards); }, content:function(){ "step 0" for(var i=0;i1){ var next=target.chooseButton(true,function(button){ return get.value(button.link,_status.event.player); }); next.set('dialog',event.preResult); next.set('closeDialog',false); next.set('dialogdisplay',true); } else{ event.directButton=event.dialog.buttons[0]; } "step 1" var dialog=event.dialog; var card; if(event.directButton){ card=event.directButton.link; } else{ card=result.links[0]; } var button; for(var i=0;i=0) return 0; if(evt.player.hasSkillTag('notricksource')) return 0; if(evt.target.hasSkillTag('notrick')) return 0; return 11-get.value(card); }); next.autochoose=lib.filter.autoRespondSha; "step 1" if(result.bool==false){ target.damage(); } }, ai:{ wuxie:function(target,card,player,viewer){ if(get.attitude(viewer,target)>0&&target.countCards('h','sha')){ if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, basic:{ order:9, useful:[5,1], value:5 }, result:{ target:function(player,target){ if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } if(nh==0) return -2; if(nh==1) return -1.7 return -1.5; }, }, tag:{ respond:1, respondSha:1, damage:1, multitarget:1, multineg:1, } } }, wanjian:{ audio:true, fullskin:true, type:'trick', enable:true, selectTarget:-1, reverseOrder:true, filterTarget:function(card,player,target){ return target!=player; }, content:function(){ "step 0" var next=target.chooseToRespond({name:'shan'}); next.set('ai',function(card){ var evt=_status.event.getParent(); if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; if(evt.player.hasSkillTag('notricksource')) return 0; if(evt.target.hasSkillTag('notrick')) return 0; if(evt.target.hasSkillTag('noShan')){ return -1; } return 11-get.value(card); }); next.autochoose=lib.filter.autoRespondShan; "step 1" if(result.bool==false){ target.damage(); } }, ai:{ wuxie:function(target,card,player,viewer){ if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){ if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; } }, basic:{ order:9, useful:1, value:5 }, result:{ target:function(player,target){ if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; var nh=target.countCards('h'); if(get.mode()=='identity'){ if(target.isZhu&&nh<=2&&target.hp<=1) return -100; } if(nh==0) return -2; if(nh==1) return -1.7 return -1.5; }, }, tag:{ respond:1, respondShan:1, damage:1, multitarget:1, multineg:1, } } }, wuzhong:{ audio:true, fullskin:true, type:'trick', enable:true, selectTarget:-1, cardcolor:'red', toself:true, filterTarget:function(card,player,target){ return target==player; }, modTarget:true, content:function(){ if(get.is.versus()){ if(game.friend.contains(target)){ if(game.friend.lengthgame.enemy.length){ target.draw(3);return; } } } target.draw(2); }, ai:{ basic:{ order:7.2, useful:4.5, value:9.2 }, result:{ target:2, }, tag:{ draw:2 } } }, juedou:{ audio:true, fullskin:true, type:'trick', enable:true, filterTarget:function(card,player,target){ return target!=player; }, content:function(){ "step 0" if(event.turn==undefined) event.turn=target; var evt=event.getParent('useCard') if(evt&&(typeof evt.baseDamage=='number'&&evt.baseDamage>0)){ event.baseDamage=evt.baseDamage; } else event.baseDamage=1; if(typeof event.extraDamage!='number'){ event.extraDamage=0; } event.playerCards=[]; event.targetCards=[]; "step 1" event.trigger('juedou'); "step 2" if(event.directHit){ event._result={bool:false}; } else{ var next=event.turn.chooseToRespond({name:'sha'}); next.set('ai',function(card){ var event=_status.event; var player=event.splayer; var target=event.starget; if(player.hasSkillTag('notricksource')) return 0; if(target.hasSkillTag('notrick')) return 0; if(event.player==target){ if(player.hasSkill('naman')) return -1; if(get.attitude(target,player)<0||event.player.hp<=1){ return get.unuseful2(card) } return -1; } else{ if(target.hasSkill('naman')) return -1; if(get.attitude(player,target)<0||event.player.hp<=1){ return get.unuseful2(card) } return -1; } }); next.set('splayer',player); next.set('starget',target); next.autochoose=lib.filter.autoRespondSha; if(event.turn==target){ next.source=player; } else{ next.source=target; } } "step 3" if(event.target.isDead()||event.player.isDead()){ event.finish(); } else{ if(result.bool){ if(event.turn==target){ if(result.cards) event.targetCards.addArray(result.cards); event.turn=player; } else{ if(result.cards) event.playerCards.addArray(result.cards); event.turn=target; } event.goto(1); } else{ if(event.turn==target){ target.damage(event.baseDamage+event.extraDamage); } else{ player.damage(target,event.baseDamage+event.extraDamage); } } } }, ai:{ basic:{ order:5, useful:1, value:5.5 }, result:{ target:-1.5, player:function(player,target){ if(get.damageEffect(target,player,target)>0&&get.attitude(player,target)>0&&get.attitude(target,player)>0){ return 0; } var hs1=target.getCards('h','sha'); var hs2=player.getCards('h','sha'); if(hs1.length>hs2.length+1){ return -2; } var hsx=target.getCards('h'); if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){ return -2; } if(hsx.length>3&&hs2.length==0){ return -2; } if(hs1.length>hs2.length&&(!hs2.length||hs1[0].number>hs2[0].number)){ return -2; } return -0.5; } }, tag:{ respond:2, respondSha:2, damage:1, } } }, shunshou:{ audio:true, fullskin:true, type:'trick', enable:true, range:{global:1}, selectTarget:1, postAi:function(targets){ return targets.length==1&&targets[0].countCards('j'); }, filterTarget:function(card,player,target){ if(player==target) return false; return target.countGainableCards(player,'hej')>0; }, content:function(){ if(target.countGainableCards(player,'hej')){ player.gainPlayerCard('hej',target,true); } }, ai:{ wuxie:function(target,card,player,viewer){ if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){ return 0; } }, basic:{ order:7.5, useful:4, value:9 }, result:{ target:function(player,target){ if(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; if(js.length==1&&get.effect(target,jj,target,player)>=0){ return -1.5; } return 3; } return -1.5; }, player:function(player,target){ if(get.attitude(player,target)<0&&!target.countCards('he')){ return 0; } if(get.attitude(player,target)>1){ 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; if(js.length==1&&get.effect(target,jj,target,player)>=0){ return 0; } return 1; } return 0; } return 1; } }, tag:{ loseCard:1, gain:1, } } }, guohe:{ audio:true, fullskin:true, type:'trick', enable:true, selectTarget:1, postAi:function(targets){ return targets.length==1&&targets[0].countCards('j'); }, filterTarget:function(card,player,target){ if(player==target) return false; return target.countDiscardableCards(player,'hej'); }, content:function(){ if(target.countDiscardableCards(player,'hej')){ player.discardPlayerCard('hej',target,true); } }, ai:{ basic:{ order:9, useful:1, value:5, }, result:{ target:function(player,target){ var att=get.attitude(player,target); var nh=target.countCards('h'); if(att>0){ var js=target.getCards('j'); if(js.length){ var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; if(jj.name=='guohe'||js.length>1||get.effect(target,jj,target,player)<0){ return 3; } } if(target.getEquip('baiyin')&&target.isDamaged()&& get.recoverEffect(target,player,player)>0){ if(target.hp==1&&!target.hujia) return 1.6; if(target.hp==2) return 0.01; return 0; } } var es=target.getCards('e'); var noe=(es.length==0||target.hasSkillTag('noe')); var noe2=(es.length==1&&es[0].name=='baiyin'&&target.isDamaged()); var noh=(nh==0||target.hasSkillTag('noh')); if(noh&&(noe||noe2)) return 0; if(att<=0&&!target.countCards('he')) return 1.5; return -1.5; }, }, tag:{ loseCard:1, discard:1 } } }, jiedao:{ audio:true, fullskin:true, type:'trick', enable:true, selectTarget:2, singleCard:true, multitarget:true, targetprompt:['被借刀','出杀目标'], complexTarget:true, multicheck:function(){ return game.hasPlayer(function(current){ if(current.getEquip(1)){ return game.hasPlayer(function(current2){ return lib.filter.targetInRange({name:'sha'},current,current2); }) } }); }, filterTarget:function(card,player,target){ if(ui.selected.targets.length==0){ return (player!=target&&target.getCards('e',{subtype:'equip1'}).length); } else{ return lib.filter.targetInRange({name:'sha'},ui.selected.targets[0],target); } }, content:function(){ "step 0" if(!target.hasSha()){ event.directfalse=true; } else{ target.chooseToUse('对'+get.translation(event.addedTarget)+'使用一张杀,或令'+get.translation(player)+'获得你的武器牌', {name:'sha'},event.addedTarget,-1).set('targetRequired',true); } "step 1" if(event.directfalse||result.bool==false){ player.gain(targets[0].getCards('e',{subtype:'equip1'}),targets[0]); targets[0].$give(targets[0].getCards('e',{subtype:'equip1'}),player); } }, ai:{ basic:{ order:8, value:2, useful:1, }, result:{ target:-1.5, player:function(player){ if(player.getCards('he',{subtype:'equip1'}).length) return 0; return 1.5; }, }, tag:{ gain:1, use:1, useSha:1, loseCard:1, } } }, wuxie:{ audio:true, fullskin:true, type:'trick', ai:{ basic:{ useful:[6,4], value:[6,4], }, result:{player:1}, expose:0.2 }, notarget:true, contentBefore:function(){ 'step 0' if(get.mode()=='guozhan'&&get.itemtype(card)=='card'&&card.hasTag('guo')){ var trigger=event.getParent(2); if(trigger.triggername!='phaseJudge'&&!trigger.statecard&&trigger.target.identity!='ye'&&trigger.target.identity!='unknown'){ player.chooseControl('对单体使用','对势力使用').set('prompt','请选择'+get.translation(card)+'的使用方式').set('ai',function(){ return '对势力使用' }); } else event.finish(); } else event.finish(); 'step 1' if(result.control=='对势力使用'){ player.chat('对势力使用'); event.getParent(2).guowuxie=true; } }, content:function(){ event.result='wuxied'; if(player.isOnline()){ player.send(function(player){ if(ui.tempnowuxie&&!player.hasWuxie()){ ui.tempnowuxie.close(); delete ui.tempnowuxie; } },player); } else if(player==game.me){ if(ui.tempnowuxie&&!player.hasWuxie()){ ui.tempnowuxie.close(); delete ui.tempnowuxie; } } }, }, lebu:{ audio:true, fullskin:true, type:'delay', filterTarget:function(card,player,target){ return (lib.filter.judge(card,player,target)&&player!=target); }, judge:function(card){ if(get.suit(card)=='heart') return 0; return -3; }, effect:function(){ if(result.bool==false){ player.skip('phaseUse'); } }, ai:{ basic:{ order:1, useful:1, value:8, }, result:{ target:function(player,target){ var num=target.hp-target.countCards('h')-2; if(num>-1) return -0.01; if(target.hp<3) num--; if(target.isTurnedOver()) num/=2; var dist=get.distance(player,target,'absolute'); if(dist<1) dist=1; return num/Math.sqrt(dist); } }, tag:{ skip:'phaseUse' } } }, shandian:{ audio:true, fullskin:true, type:'delay', cardnature:'thunder', 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)=='spade'&&get.number(card)>1&&get.number(card)<10) return -6; return 0; }, effect:function(){ if(result.bool==false){ player.damage(3,'thunder','nosource'); } else{ player.addJudgeNext(card); } }, cancel:function(){ player.addJudgeNext(card); }, ai:{ basic:{ order:1, useful:0, value:0, }, result:{ target:function(player,target){ var num=game.countPlayer(function(current){ var skills=current.getSkills(); for(var j=0;j0&& get.attitude(current,target)>0){ return rejudge; } else{ return -rejudge; } } } }); if(num>0) return num; if(num==0){ var mode=get.mode(); if(mode=='identity'){ if(target.identity=='nei') return 1; var situ=get.situation(); if(target.identity=='fan'){ if(situ>1) return 1; } else{ if(situ<-1) return 1; } } else if(mode=='guozhan'){ if(target.identity=='ye') return 1; if(game.hasPlayer(function(current){ return current.identity=='unknown'; })){ return -1; } 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.countCards('he')<=3) return 1; } } } return -1; } }, tag:{ // damage:1, // natureDamage:1, // thunderDamage:1, } } }, hanbing:{ fullskin:true, type:"equip", subtype:"equip1", distance:{attackFrom:-1}, skills:['hanbing_skill'], ai:{ basic:{ equipValue:2 } }, }, renwang:{ fullskin:true, type:"equip", subtype:"equip2", skills:['renwang_skill'], ai:{ basic:{ equipValue:7.5 }, }, }, }, skill:{ qinglong_guozhan:{ trigger:{player:'useCard'}, forced:true, filter:function(event,player){ return get.mode()=='guozhan'&&event.card.name=='sha'; }, content:function(){ var players=trigger.targets; for(var i=0;i0; }, priority:1, check:function(event,player){ var target=event.player; var eff=get.damageEffect(target,player,player); if(get.attitude(player,target)>0){ if(eff>=0) return false; return true; } if(eff<=0) return true; if(target.hp==1) return false; if(event.num>1||player.hasSkill('tianxianjiu')|| player.hasSkill('luoyi2')||player.hasSkill('reluoyi2')) return false; if(target.countCards('he')<2) return -1; var num=0; var cards=target.getCards('he'); for(var i=0;i6) num++; } if(num>=2) return true; return false; }, logTarget:"player", content:function(){ "step 0" trigger.cancel(); "step 1" if(trigger.player.countDiscardableCards(player,'he')){ player.line(trigger.player); player.discardPlayerCard('he',trigger.player,true); } "step 2" if(trigger.player.countDiscardableCards(player,'he')){ player.line(trigger.player); player.discardPlayerCard('he',trigger.player,true); } } }, renwang_skill:{ trigger:{target:'shaBegin'}, forced:true, priority:6, audio:true, filter:function(event,player){ if(event.player.hasSkillTag('unequip',false,{ name:event.card?event.card.name:null, target:player, card:event.card })) return false; return (event.card.name=='sha'&&get.color(event.card)=='black') }, content:function(){ trigger.cancel(); }, ai:{ effect:{ target:function(card,player){ if(player.hasSkillTag('unequip',false,{ name:card?card.name:null, target:player, card:card })) return; if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget'; } } } }, zhuge_skill:{ mod:{ cardUsable:function(card,player,num){ if(card.name=='sha'){ if(get.is.versus()){ return num+3; } return Infinity; } } }, }, cixiong_skill:{ trigger:{player:'shaBegin'}, priority:7, audio:true, logTarget:'target', filter:function(event,player){ if(player.sex=='male'&&event.target.sex=='female') return true; if(player.sex=='female'&&event.target.sex=='male') return true; return false; }, content:function(){ "step 0" trigger.target.chooseToDiscard('弃置一张手牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){ var trigger=_status.event.getTrigger(); return -get.attitude(trigger.target,trigger.player)-get.value(card); }); "step 1" if(result.bool==false) player.draw(); } }, qinggang_skill:{ ai:{ unequip:true, skillTagFilter:function(player,tag,arg){ if(arg&&arg.name=='sha') return true; return false; } } }, qinglong_skill:{ trigger:{player:'shaMiss'}, direct:true, filter:function(event,player){ if(get.mode()=='guozhan') return false; return player.canUse('sha',event.target)&&player.hasSha(); }, content:function(){ "step 0" if(player.hasSkill('jiu')){ game.broadcastAll(function(player){ player.removeSkill('jiu'); },player); event.jiu=true; } player.chooseToUse(get.prompt('qinglong'),{name:'sha'},trigger.target,-1).set('addCount',false).logSkill='qinglong_skill'; "step 1" if(result.bool); else if(event.jiu){ player.addSkill('jiu'); } } }, zhangba_skill:{ enable:['chooseToUse','chooseToRespond'], filterCard:true, selectCard:2, position:'h', viewAs:{name:'sha'}, filter:function(event,player){ return player.countCards('h')>=2; }, audio:true, prompt:'将两张手牌当杀使用或打出', check:function(card){ if(card.name=='sha') return 0; return 6-get.useful(card) }, ai:{ respondSha:true, skillTagFilter:function(player){ return player.countCards('h')>=2; }, } }, guanshi_skill:{ trigger:{player:'shaMiss'}, direct:true, audio:true, filter:function(event,player){ return player.countCards('he')>2&&event.target.isAlive(); }, content:function(){ "step 0" var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card){ return _status.event.player.getCards('e',{subtype:'equip1'}).contains(card)==false; }); next.logSkill='guanshi_skill'; next.set('ai',function(card){ var evt=_status.event.getParent(); if(get.attitude(evt.player,evt._trigger.target)<0){ if(evt.player.hasSkill('jiu')|| evt.player.hasSkill('tianxianjiu')|| evt._trigger.target.hp==1){ return 8-get.value(card) } return 5-get.value(card) } return -1; }); "step 1" if(result.bool){ trigger.untrigger(); trigger.trigger('shaHit'); trigger._result.bool=false; } } }, fangtian_skill:{ mod:{ selectTarget:function(card,player,range){ if(card.name!='sha') return; if(get.mode()=='guozhan') return; if(range[1]==-1) return; var cards=player.getCards('h'); for(var i=0;i1; }, content:function(){ player.addTempSkill('fangtian_guozhan_trigger'); }, mod:{ selectTarget:function(card,player,range){ if(card.name!='sha') return; if(get.mode()!='guozhan') return; if(range[1]==-1) return; range[1]=Infinity; }, playerEnabled:function(card,player,target){ if(card.name!='sha') return; if(get.mode()!='guozhan') return; if(!ui.selected.targets.length) return; if(target.identity=='ye'||target.identity=='unknown') return; var targets=ui.selected.targets.slice(0); for(var i=0;i0 }, direct:true, audio:true, content:function(){ "step 0" var att=(get.attitude(player,trigger.player)<=0); var next=player.chooseButton(); next.set('att',att); next.set('createDialog',['是否发动【麒麟弓】,弃置'+get.translation(trigger.player)+'的一张坐骑牌?',trigger.player.getCards('e',{subtype:['equip3','equip4','equip6']})]); next.set('ai',function(button){ if(_status.event.att) return get.buttonValue(button); return 0; }); "step 1" if(result.bool){ player.logSkill('qilin_skill',trigger.player); trigger.player.discard(result.links[0]); } } }, bagua_skill:{ trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; if(!event.filterCard({name:'shan'})) return false; if(!lib.filter.cardRespondable({name:'shan'},player,event)) return false; var evt=event.getParent(); if(evt.player&&evt.player.hasSkillTag('unequip',false,{ name:evt.card?evt.card.name:null, target:player, card:evt.card })) return false; return true; }, audio:true, check:function(event,player){ if(get.damageEffect(player,event.player,player)>=0) return false; return true; }, content:function(){ "step 0" player.judge('bagua',function(card){return (get.color(card)=='red')?1.5:-0.5}); "step 1" if(result.judge>0){ trigger.untrigger(); trigger.responded=true; trigger.result={bool:true,card:{name:'shan'}} } }, ai:{ effect:{ target:function(card,player,target,effect){ if(player.hasSkillTag('unequip',false,{ name:card?card.name:null, target:player, card:card })) return; if(get.tag(card,'respondShan')) return 0.5; } } } }, _wuxie:{ trigger:{player:['useCardToBefore','phaseJudge']}, priority:5, popup:false, forced:true, filter:function(event,player){ if(event.card.storage&&event.card.storage.nowuxie) return false; if(event.name!='phaseJudge'){ var info=get.info(event.card); if(!event.target){ if(info.wuxieable) return true; return false; } if(event.player.hasSkillTag('playernowuxie',false,event.card)) return false; if(get.type(event.card)!='trick'&&!info.wuxieable) return false; } return true; }, content:function(){ 'step 0' if(trigger.multitarget){ event.targets=trigger.targets; } event.target=trigger.target; if(event.triggername=='phaseJudge'){ event.target=trigger.player; } event.sourcex=event.targets||event.target; if(!event.targets&&trigger.targets&&trigger.targets.length==1){ event.sourcex2=trigger.player; } event.source=trigger.player; event.state=true; event.card=trigger.card; event._global_waiting=true; event.tempnowuxie=(trigger.targets&&trigger.targets.length>1&&!trigger.multitarget); event.filterCard=function(card,player){ if(card.name!='wuxie') return false; return lib.filter.cardEnabled(card,player,'forceEnable'); }; event.send=function(player,state,isJudge,card,source,target,targets,id,id2,tempnowuxie,skillState){ if(skillState){ player.applySkills(skillState); } state=state?1:-1; var str=''; if(isJudge){ str+=get.translation(source)+'的'; } if(isJudge){ str+=get.translation(card,'viewAs'); } else{ str+=get.translation(card); } if((targets||target)&&!isJudge){ str+='对'+get.translation(targets||target); } str+='将'+(state>0?'生效':'失效')+',是否无懈?'; if(player.isUnderControl(true)&&!_status.auto&&!ui.tempnowuxie&&tempnowuxie){ var translation=get.translation(card.name); if(translation.length>=4){ translation=lib.translate[card.name+'_ab']||translation.slice(0,2); } ui.tempnowuxie=ui.create.control('不无懈'+translation,ui.click.tempnowuxie,'stayleft'); ui.tempnowuxie._origin=id2; } var next=player.chooseToUse({ filterCard:function(card,player){ if(card.name!='wuxie') return false; return lib.filter.cardEnabled(card,player,'forceEnable'); }, prompt:str, type:'wuxie', state:state, _global_waiting:true, ai1:function(){ if(isJudge){ var name=card.viewAs||card.name; var info=lib.card[name]; if(info&&info.ai&&info.ai.wuxie){ var aiii=info.ai.wuxie(source,card,source,_status.event.player,state); if(typeof aiii=='number') return aiii; } if(Math.abs(get.attitude(_status.event.player,source))<3) return 0; if(source.hasSkillTag('guanxing')&&(source!=player||!source.hasSkill('guanxing_fail'))) return 0; if(name!='lebu'&&name!='bingliang'){ if(source!=_status.event.player){ return 0; } } var card2; if(name!=card.name){ card2={name:name}; } else{ card2=card; } var eff=get.effect(source,card2,source,source); if(eff>=0) return 0; return state*get.attitude(_status.event.player,source); } else{ var triggerevent=_status.event.getTrigger(); if(triggerevent&&triggerevent.parent&& triggerevent.parent.postAi&& triggerevent.player.isUnknown(_status.event.player)){ return 0; } var info=get.info(card); if(info.ai&&info.ai.wuxie){ var aiii=info.ai.wuxie(target,card,source,_status.event.player,state); if(typeof aiii=='number') return aiii; } if(info.multitarget&&targets){ var eff=0; for(var i=0;i