'use strict'; character.yijiang={ character:{ yujin:['male','wei',4,['yizhong']], caozhang:['male','wei',4,['jiangchi']], guohuai:['male','wei',4,['jingce']], zhangchunhua:['female','wei',3,['jueqing','shangshi']], caozhi:['male','wei',3,['luoying','jiushi']], caochong:['male','wei',3,['renxin','chengxiang']], xunyou:['male','wei',3,['zhiyu','qice']], xushu:['male','shu',3,['wuyan','jujian']], xin_xushu:['male','shu',3,['xinwuyan','xinjujian']], xin_masu:['male','shu',3,['sanyao','zhiman']], masu:['male','shu',3,['xinzhan','huilei']], fazheng:['male','shu',3,['enyuan','xuanhuo']], xin_fazheng:['male','shu',3,['xinenyuan','xinxuanhuo']], zhuran:['male','wu',4,['danshou']], xusheng:['male','wu',4,['xinpojun']], wuguotai:['female','wu',3,['ganlu','buyi']], lingtong:['male','wu',4,['xuanfeng']], liubiao:['male','qun',3,['zongshi','zishou']], huaxiong:['male','qun',6,['yaowu']], wangyi:['female','wei',3,['zhenlie','miji']], yufan:['male','wu',3,['zhiyan','zongxuan']], chengong:['male','qun',3,['mingce','zhichi']], bulianshi:['female','wu',3,['anxu','zhuiyi']], handang:['male','wu',4,['gongji','jiefan']], fuhuanghou:['female','qun',3,['zhuikong','qiuyuan']], zhonghui:['male','wei',4,['quanji','zili']], jianyong:['male','shu',3,['qiaoshui','jyzongshi']], madai:['male','shu',4,['mashu','qianxi']], liufeng:['male','shu',4,['xiansi']], manchong:['male','wei',3,['junxing','yuce']], liru:['male','qun',3,['juece','mieji','fencheng']], guanzhang:['male','shu',4,['fuhun']], chenqun:['male','wei',3,['dingpin','faen']], sunluban:['female','wu',3,['chanhui','jiaojin']], guyong:['male','wu',3,['shenxing','bingyi']], caifuren:['female','qun',3,['qieting','xianzhou']], yj_jushou:['male','qun',3,['jianying','shibei']], zhangsong:['male','shu',3,['qiangzhi','xiantu']], zhuhuan:['male','wu',4,['youdi']], xiahoushi:['female','shu',3,['qiaoshi','yanyu']], panzhangmazhong:['male','wu',4,['anjian','duodao']], zhoucang:['male','shu',4,['zhongyong']], guanping:['male','shu',4,['longyin']], liaohua:['male','shu',4,['dangxian','fuli']], chengpu:['male','wu',4,['lihuo','chunlao']], gaoshun:['male','qun',4,['xianzhen','jinjiu']], caozhen:['male','wei',4,['sidi']], wuyi:['male','shu',4,['benxi']], hanhaoshihuan:['male','wei',4,['shenduan','yonglve']], caorui:['male','wei',3,['huituo','mingjian','xingshuai'],['fullskin','zhu']], caoxiu:['male','wei',4,['taoxi']], zhongyao:['male','wei',3,['huomo','zuoding']], liuchen:['male','shu',4,['zhanjue','qinwang'],['fullskin','zhu']], zhangyi:['male','shu',4,['wurong','shizhi']], sunxiu:['male','wu',3,['yanzhu','xingxue','zhaofu'],['fullskin','zhu']], zhuzhi:['male','wu',4,['anguo']], quancong:['male','wu',4,['yaoming']], gongsunyuan:['male','qun',4,['huaiyi']], guotufengji:['male','qun',3,['jigong','shifei']], xin_yujin:['male','wei',4,['jieyue']], }, perfectPair:{ wuguotai:['sunjian','sunshangxiang'], zhangchunhua:['simayi'], caozhi:['zhenji'], xunyou:['xunyu'], xushu:['liubei'], lingtong:['ganning'], chengong:['lvbu'], bulianshi:['sunquan'], fuhuanghou:['liuxie'], sunluban:['quancong'], caifuren:['liubiao'], xiahoushi:['zhangfei'], zhoucang:['guanyu'], guanping:['guanyu'], }, skill:{ jieyue:{ group:'jieyue1' }, jieyue1:{ audio:2, trigger:{player:'phaseEnd'}, direct:true, content:function(){ 'step 0' player.chooseCardTarget({ filterTarget:function(card,player,target){ return target!=player&&target.num('he')>0; }, filterCard:true, ai1:function(card){ return 7-ai.get.useful(card); }, ai2:function(target){ return 1-ai.get.attitude(player,target); }, prompt:'是否发动【节钺】?' }); 'step 1' if(result.bool){ player.logSkill('jieyue1',result.targets); player.discard(result.cards); var target=result.targets[0]; event.target=target; target.chooseCard('将一张牌置于'+get.translation(player)+'的武将牌上,或令其弃置你的一张牌','he').ai=function(card){ if(ai.get.attitude(player,target)>0){ return 8-ai.get.value(card); } var nh=player.num('h'); if(nh<=2){ return 6-ai.get.value(card); } if(nh<=3){ return 2-ai.get.value(card); } return 0; } } else{ event.finish(); } 'step 2' if(result.bool&&result.cards&&result.cards.length){ event.target.$give(result.cards,player); player.storage.jieyue2=result.cards[0]; event.target.lose(result.cards[0],ui.special); player.syncStorage('jieyue2'); player.addSkill('jieyue2'); } else if(event.target.num('he')){ player.discardPlayerCard(event.target,true); } }, ai:{ expose:0.1 } }, jieyue2:{ mark:'card', intro:{ content:'card' }, audio:true, enable:'chooseToUse', filterCard:function(card){ return get.color(card)=='black'; }, viewAsFilter:function(player){ return player.num('h',{color:'black'})>0; }, viewAs:{name:'wuxie'}, prompt:'将一张黑色手牌当无懈可击使用', check:function(card){return 8-ai.get.value(card)}, threaten:1.2, group:['jieyue3','jieyue4'] }, jieyue3:{ enable:['chooseToRespond'], filterCard:function(card){ return get.color(card)=='red'; }, viewAs:{name:'shan'}, viewAsFilter:function(player){ if(!player.num('h',{color:'red'})) return false; }, audio:true, prompt:'将一张红色手牌当闪打出', check:function(){return 1}, ai:{ respondShan:true, skillTagFilter:function(player){ if(!player.num('h',{color:'red'})) return false; }, result:{ target:function(card,player,target,current){ if(get.tag(card,'respondShan')&¤t<0) return 0.8 } } } }, jieyue4:{ trigger:{player:'phaseBegin'}, forced:true, content:function(){ player.gain(player.storage.jieyue2,'gain2'); player.storage.jieyue2=null; player.removeSkill('jieyue2'); } }, jinjiu:{ mod:{ cardEnabled:function(card,player){ if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; }, cardUsable:function(card,player){ if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; }, cardRespondable:function(card,player){ if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; }, cardSavable:function(card,player){ if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false; }, }, enable:['chooseToUse','chooseToRespond'], filter:function(event,player){ return player.num('h','jiu')>0; }, filterCard:{name:'jiu'}, viewAs:{name:'sha'}, viewAsFilter:function(player){ if(!player.num('h','jiu')) return false; }, check:function(){return 1}, ai:{ skillTagFilter:function(player){ if(!player.num('h','jiu')) return false; }, respondSha:true, order:4, useful:-1, value:-1 } }, xianzhen:{ audio:2, enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ return player!=target&&target.num('h')>0; }, filter:function(event,player){ return player.num('h')>0; }, content:function(){ "step 0" player.chooseToCompare(target); "step 1" if(result.bool){ player.storage.xianzhen=target; player.addTempSkill('xianzhen2','phaseAfter'); player.addTempSkill('unequip','phaseAfter'); } else{ player.addTempSkill('xianzhen3','phaseAfter'); } }, ai:{ order:function(name,player){ var cards=player.get('h'); if(player.num('h','sha')==0){ return 1; } for(var i=0;i11&&ai.get.value(cards[i])<7){ return 9; } } return lib.card.sha.ai.order-1; }, result:{ player:function(player){ if(player.num('h','sha')>0) return 0.6; var num=player.num('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'); if(num==1) return -1; if(num==2) return -0.7; return -0.5 }, }, threaten:1.3 } }, xianzhen2:{ mod:{ targetInRange:function(card,player,target,now){ if(player.storage.xianzhen==target) return true; }, cardUsable:function(card,player,num){ if(card.name=='sha') return Infinity; } }, }, xianzhen3:{ mod:{ cardEnabled:function(card){if(card.name=='sha') return false} } }, lihuo:{ enable:'phaseUse', usable:1, filterCard:function(card){ return card.name=='sha'&&!card.nature; }, filter:function(event,player){ return player.num('h','sha')>0 }, viewAs:{name:'sha',nature:'fire'}, mod:{ selectTarget:function(card,player,range){ if(card.name=='sha'&&card.nature=='fire'&&range[1]!=-1){ range[1]++; } }, }, group:'lihuo2' }, lihuo2:{ trigger:{source:'damageEnd'}, forced:true, popup:false, filter:function(event,player){ return event.parent.skill=='lihuo'; }, content:function(){ player.addTempSkill('lihuo3','phaseAfter'); } }, lihuo3:{ trigger:{player:'useCardAfter'}, filter:function(event,player){ return event.card.name=='sha'; }, forced:true, silent:true, audio:false, content:function(){ player.loseHp(); player.removeSkill('lihuo3'); delete player.tempSkills.lihuo3; } }, chunlao:{ trigger:{player:'phaseEnd'}, direct:true, audio:2, filter:function(event,player){ return player.num('h','sha')>0&&!player.storage.chunlao.length; }, init:function(player){ player.storage.chunlao=[]; }, intro:{ content:'cards', }, content:function(){ 'step 0' player.chooseCard([1,player.num('h','sha')],'是否发动【醇醪】?',{name:'sha'}).ai=function(){ return 1; }; 'step 1' if(result.bool){ player.logSkill('chunlao'); player.storage.chunlao=player.storage.chunlao.concat(result.cards); player.syncStorage('chunlao'); player.markSkill('chunlao'); player.lose(result.cards,ui.special); player.$give(result.cards,player); } }, ai:{ effect:{ player:function(card,player){ if(_status.currentPhase!=player) return; if(card.name=='sha'&&player.num('h')<=player.hp&&!player.storage.chunlao.length){ return [0,0,0,0]; } } }, threaten:1.4 }, group:'chunlao2' }, chunlao2:{ trigger:{global:'dying'}, priority:6, filter:function(event,player){ return event.player.hp<=0&&player.storage.chunlao.length>0; }, direct:true, content:function(){ "step 0" var att=ai.get.attitude(player,trigger.player); player.chooseCardButton('是否对'+get.translation(trigger.player)+'发动【醇醪】?',player.storage.chunlao).ai=function(button){ if(att>0) return 1; return 0; }; "step 1" if(result.bool){ player.logSkill('chunlao',trigger.player); player.$throw(result.links); player.storage.chunlao.remove(result.links[0]); ui.discardPile.appendChild(result.links[0]); player.syncStorage('chunlao'); trigger.player.useCard({name:'jiu'},trigger.player); if(!player.storage.chunlao.length){ player.unmarkSkill('chunlao'); } } }, ai:{ expose:0.2 } }, shenduan:{ trigger:{player:'discardAfter'}, filter:function(event,player){ for(var i=0;i0&&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 eff=ai.get.effect(trigger.player,{name:'sha'},player,player); player.chooseCardButton('是否对'+get.translation(trigger.player)+'发动【勇略】?',trigger.player.get('j')).ai=function(button){ var name=button.link.viewAs||button.link.name; if(att>0&&eff>=0) return 1; if(att>=0&&eff>0) return 1; if(att>0&&(trigger.player.hp>=3||trigger.player.num('e','bagua')||trigger.player.num('h','shan'))){ if(name=='lebu'&&nh>trigger.player.hp) return 1; if(name=='bingliang'&&nh1){ player.removeSkill('unequip'); return; } } player.addSkill('unequip'); }, group:['benxi2','benxi3'], mod:{ globalFrom:function(from,to,distance){ if(_status.currentPhase==from){ return distance-get.cardCount(true,from); } }, selectTarget:function(card,player,range){ if(_status.currentPhase==player){ if(card.name=='sha'&&range[1]!=-1){ for(var i=0;i1) return; } range[1]++; } } }, }, }, benxi2:{ trigger:{player:'phaseBegin'}, forced:true, popup:false, silent:true, priority:5, filter:function(event,player){ return player.skills.contains('benxi'); }, content:function(){ player.storage.benxi=!player.skills.contains('unequip'); if(player.storage.benxi){ for(var i=0;i1){ return; } } player.addSkill('unequip'); } } }, benxi3:{ trigger:{player:'phaseAfter'}, forced:true, popup:false, silent:true, content:function(){ if(player.storage.benxi){ player.storage.benxi=false; player.removeSkill('unequip'); } } }, sidi:{ trigger:{global:'respondEnd'}, filter:function(event,player){ if(event.parent.parent.name!='sha') return false; if(event.player==player) return true; return _status.currentPhase==player; }, frequent:true, init:function(player){ player.storage.sidi=[]; }, intro:{ content:'cards' }, content:function(){ var card=get.cards()[0]; game.log(player,'将',card,'置于武将牌上'); player.$gain2(card); player.storage.sidi.add(card); player.markSkill('sidi'); player.syncStorage('sidi'); }, group:'sidi2' }, sidi2:{ trigger:{global:'phaseUseBegin'}, filter:function(event,player){ if(event.player==player) return false; if(!player.storage.sidi.length) return false; return true; }, check:function(event,player){ if(ai.get.attitude(player,event.player)>=0) return false; if(event.player.num('e','zhuge')) return false; if(event.player.skills.contains('paoxiao')) return false; for(var i=0;i0) break; } if(i==game.players.length) return false; var nh=event.player.num('h'); var nsha=event.player.num('h','sha'); if(nh<2) return false; switch(nh){ case 2: if(nsha) return Math.random()<0.4; return Math.random()<0.2; case 3: if(nsha) return Math.random()<0.8; return Math.random()<0.3; case 4: if(nsha>1) return true; if(nsha) return Math.random()<0.9; return Math.random()<0.5; default:return true; } }, content:function(){ 'step 0' if(player.storage.sidi.length==1){ event.directbutton=player.storage.sidi[0]; } else{ player.chooseCardButton('弃置武将牌上的一张牌',player.storage.sidi,true); } 'step 1' var button; if(event.directbutton){ button=event.directbutton; } else if(result.bool&&result.links&&result.links.length){ button=result.links[0]; } if(button){ player.$throw([button]); player.line(trigger.player,'green'); game.log(player,'将',button,'置于弃牌堆'); ui.discardPile.appendChild(button); trigger.player.addTempSkill('sidi3','phaseAfter'); player.storage.sidi.remove(button); player.syncStorage('sidi'); if(player.storage.sidi.length==0){ player.unmarkSkill('sidi'); } game.delayx(); } } }, sidi3:{ mod:{ cardUsable:function(card,player,num){ if(card.name=='sha') return num-1; } } }, zhongyong:{ trigger:{player:'shaMiss'}, direct:true, filter:function(event,player){ return event.responded&&get.itemtype(event.responded.cards)=='cards'; }, content:function(){ "step 0" var cards=trigger.responded.cards; event.cards=cards; player.chooseTarget('忠勇:将'+get.translation(trigger.responded.cards)+'交给一名角色',function(card,player,target){ return target!=trigger.target; }).ai=function(target){ var att=ai.get.attitude(player,target); if(target.num('h','shan')&&target.num('h')>=2){ att/=1.5; } return att; } "step 1" if(result.bool){ player.logSkill('zhongyong',result.targets); result.targets[0].gain(event.cards,'gain2'); if(result.targets[0]==player){ event.finish(); } } else{ event.finish(); } "step 2" if(player.skills.contains('jiu')){ game.broadcastAll(function(player){ player.removeSkill('jiu'); if(player.node.jiu){ player.node.jiu.delete(); player.node.jiu2.delete(); delete player.node.jiu; delete player.node.jiu2; } },player); event.jiu=true; } player.chooseToUse('是否对'+get.translation(trigger.target)+'再使用一张杀?', {name:'sha'},trigger.target,-1).logSkill='qinglong'; "step 3" if(event.jiu){ player.addSkill('jiu'); } } }, dangxian:{ trigger:{player:'phaseBegin'}, forced:true, content:function(){ 'step 0' player.phaseUse(); 'step 1' player.getStat().card={}; } }, longyin:{ trigger:{global:'shaBegin'}, direct:true, filter:function(event,player){ return event.target==event.targets[0]&&player.num('he')>0&&event.card.name=='sha'&& _status.currentPhase==event.player&&event.parent.parent.parent.name=='phaseUse'; }, content:function(){ 'step 0' var go=false; if(ai.get.attitude(player,trigger.player)>0){ if(get.color(trigger.card)=='red'){ go=true; } else if(!trigger.player.skills.contains('paoxiao')&& !trigger.player.skills.contains('tanlnin3')&& !trigger.player.skills.contains('zhaxiang2')&& !trigger.player.skills.contains('fengnu')&& !trigger.player.num('e','zhuge')){ var nh=trigger.player.num('h'); if(player==trigger.player){ go=(player.num('h','sha')>0); } else if(nh>=4){ go=true; } else if(player.num('h','sha')){ if(nh==3){ go=Math.random()<0.8; } else if(nh==2){ go=Math.random()<0.5; } } else if(nh>=3){ if(nh==3){ go=Math.random()<0.5; } else if(nh==2){ go=Math.random()<0.2; } } } } var next=player.chooseToDiscard('是否发动【龙吟】?','he'); next.logSkill=['longyin',trigger.player]; next.ai=function(card){ if(go){ return 6-ai.get.value(card); } return 0; } 'step 1' if(result.bool){ trigger.player.getStat().card.sha--; if(get.color(trigger.card)=='red'){ player.draw(); } player.logSkill('longyin',trigger.player); } }, ai:{ expose:0.2 } }, jigong:{ audio:2, trigger:{player:'phaseUseBegin'}, check:function(event,player){ var nh=player.num('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; if(nh<=3) return Math.random()<0.4; return false; }, content:function(){ player.draw(2); player.addTempSkill('jigong2','phaseAfter'); } }, jigong2:{ mod:{ maxHandcard:function(player,num){ var damage=player.getStat().damage; if(typeof damage=='number') return damage; return 0; } } }, shifei:{ audio:2, trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; if(!event.filterCard({name:'shan'})) return false; return true; }, check:function(event,player){ if(ai.get.attitude(player,_status.currentPhase)>0) return true; var nh=_status.currentPhase.num('h')+1; var hasshan=(player.num('h','shan')>0); for(var i=0;inh){ if(!hasshan||ai.get.attitude(player,game.players[i])<=0) return true; } } return false; }, content:function(){ 'step 0' player.line(_status.currentPhase,'green'); _status.currentPhase.draw(); 'step 1' var nh=_status.currentPhase.num('h'); var nmax=nh+1; var targets=[]; for(var i=0;inmax){ nmax=nh2; targets.length=0; targets.push(game.players[i]); } else if(nh2==nmax){ targets.push(game.players[i]); } } if(targets.length==1){ event.onlytarget=targets[0]; } else if(targets.length){ player.chooseTarget('选择一名角色弃置其一张牌',true,function(card,player,target){ return targets.contains(target); }).ai=function(target){ return -ai.get.attitude(player,target); }; } else{ event.finish(); } 'step 2' var target; if(event.onlytarget){ target=event.onlytarget; } else if(result.targets&&result.targets.length){ target=result.targets[0]; } if(target){ player.line(target,'green'); if(target==player){ player.chooseToDiscard('he',true); } else{ player.discardPlayerCard(target,'he',true); } trigger.untrigger(); trigger.responded=true; trigger.result={bool:true,card:{name:'shan'}} } }, ai:{ effect:{ target:function(card,player,target,current){ if(get.tag(card,'respondShan')&¤t<0){ var nh=player.num('h'); for(var i=0;inh) return 0.4; } } } } } }, huaiyi:{ audio:2, enable:'phaseUse', usable:1, delay:0, filter:function(event,player){ return player.num('h',{color:'red'})&&player.num('h',{color:'black'}); }, content:function(){ 'step 0' player.chooseControl('红色','黑色').ai=function(){ if(player.num('h',{color:'red'})==1&& player.num('h',{color:'black'})>1) return '红色'; return '黑色'; } 'step 1' event.control=result.control; player.showHandcards(); 'step 2' var cards; if(event.control=='红色'){ cards=player.get('h',{color:'red'}); } else{ cards=player.get('h',{color:'black'}); } player.discard(cards); event.num=cards.length; 'step 3' player.chooseTarget([1,event.num],function(card,player,target){ return target!=player&&target.num('he')>0; }).ai=function(target){ return -ai.get.attitude(player,target)+0.5; } 'step 4' if(result.targets){ event.targets=result.targets; event.gained=event.targets.length; } else{ event.finish(); } 'step 5' if(event.targets.length){ player.gainPlayerCard(event.targets.shift(),'he',true); event.redo(); } 'step 6' if(event.gained>=2){ player.loseHp(); } }, ai:{ order:function(item,player){ if(player.num('h',{color:'red'})==1) return 10; if(player.num('h',{color:'black'})==1) return 10; return 1; }, result:{ player:1 } } }, yaoming:{ audio:2, trigger:{player:'damageEnd',source:'damageEnd'}, direct:true, filter:function(event,player){ if(player.skills.contains('yaoming2')) return false; var nh=player.num('h'); for(var i=0;inh) return -att; return att; } 'step 1' if(result.bool){ player.logSkill('yaoming',result.targets); player.addTempSkill('yaoming2','phaseAfter'); var target=result.targets[0]; if(target.num('h')0; }, content:function(){ 'step 0' player.choosePlayerCard(target,'e',true); 'step 1' if(result.links){ var num=0; for(var i=0;inum2){ player.draw(); } }, ai:{ order:7, result:{ target:function(player,target){ if(target.get('e','1')||target.get('e','4')) return -1; if(target.get('e','2')) return -0.7; return -0.5; } } } }, zhaofu:{ unique:true, global:'zhaofu2' }, zhaofu2:{ mod:{ attackTo:function(from,to,distance){ if(from.group!='wu') return; var zhu; for(var i=0;i0&&target!=player; }, content:function(){ 'step 0' if(target.num('e')){ target.chooseBool('是否将装备区内的所有牌交给'+get.translation(player)+'?').ai=function(){ if(target.num('e')>=3) return false; return true; } } else{ target.chooseToDiscard(true,'he'); event.finish(); } 'step 1' if(result.bool){ var es=target.get('e'); player.gain(es); target.$give(es,player); player.removeSkill('yanzhu'); } else{ target.chooseToDiscard(true,'he'); } }, ai:{ order:6, result:{ target:function(player,target){ var ne=target.num('e'); if(!ne) return -2; if(ne>=2) return -ne; return 0; } } } }, shizhi:{ mod:{ cardRespondable:function(card,player){ if(card.name=='shan'&&player.hp==1&&_status.event.skill!='shizhi') return false; }, }, enable:['chooseToUse','chooseToRespond'], filter:function(event,player){ return player.hp==1; }, filterCard:{name:'shan'}, viewAs:{name:'sha'}, viewAsFilter:function(player){ if(!player.num('h','shan')) return false; if(player.hp!=1) return false; }, check:function(){return 1}, ai:{ skillTagFilter:function(player){ if(!player.num('h','shan')) return false; if(player.hp!=1) return false; }, respondSha:true, order:4, useful:-1, value:-1 } }, wurong:{ enable:'phaseUse', usable:1, filter:function(event,player){ return player.num('h')>0; }, filterTarget:function(card,player,target){ return target.num('h')>0; }, content:function(){ "step 0" if(target.num('h')==0||player.num('h')==0){ event.finish(); return; } player.chooseCard(true).ai=function(){ return Math.random(); }; "step 1" event.card1=result.cards[0]; var rand=Math.random()<0.4; target.chooseCard(true).ai=function(card){ if(rand) return card.name=='shan'?1:0; return card.name=='shan'?0:1; }; "step 2" event.card2=result.cards[0]; ui.arena.classList.add('thrownhighlight'); game.addVideo('thrownhighlight1'); player.$compare(event.card1,target,event.card2); game.delay(4); "step 3" game.log(player,'展示了',event.card1); game.log(target,'展示了',event.card2); var name1=event.card1.name; if(player.hp==1&&name1=='shan'){ name1='sha'; } if(name1=='sha'&&event.card2.name!='shan'){ player.discard(event.card1).animate=false; target.$gain2(event.card2); var clone=event.card1.clone; if(clone){ clone.style.transition='all 0.5s'; clone.style.transform='scale(1.2)'; clone.delete(); game.addVideo('deletenode',player,get.cardsInfo([clone])); } target.damage(); } else if(name1!='sha'&&event.card2.name=='shan'){ player.discard(event.card1).animate=false; target.$gain2(event.card2); var clone=event.card1.clone; if(clone){ clone.style.transition='all 0.5s'; clone.style.transform='scale(1.2)'; clone.delete(); game.addVideo('deletenode',player,get.cardsInfo([clone])); } player.gainPlayerCard(target,true,'he'); } else{ player.$gain2(event.card1); target.$gain2(event.card2); } ui.arena.classList.remove('thrownhighlight'); game.addVideo('thrownhighlight2'); }, ai:{ order:6, result:{ target:-1, } } }, zhanjue:{ audio:2, enable:'phaseUse', filterCard:true, selectCard:-1, filter:function(event,player){ if(!player.num('h')) return false; if(player.storage.zhanjue>=2) return false; return true; }, prepare:function(cards,player,targets){ player.$throw(cards); player.line(targets); }, discard:false, filterTarget:function(card,player,target){ return player.canUse('juedou',target); }, content:function(){ targets.sort(lib.sort.seat); player.useCard({name:'juedou'},cards,targets,'zhanjue').animate=false; }, group:['zhanjue2','zhanjue3'], ai:{ order:1, result:{ target:function(player,target){ if(player.num('h')>3) return 0; if(target.num('h','sha')) return 0; if(player.num('h','tao')) return 0; return ai.get.effect(target,{name:'juedou'},player,target); } } } }, zhanjue2:{ audio:false, trigger:{player:'phaseBefore'}, forced:true, popup:false, silent:true, content:function(){ player.storage.zhanjue=0; } }, zhanjue3:{ audio:false, trigger:{player:'damageAfter',source:'damageAfter'}, forced:true, popup:false, filter:function(event,player){ return event.parent.skill=='zhanjue'; }, content:function(){ if(player==trigger.source){ if(trigger.player.isAlive()){ game.asyncDraw([player,trigger.player]); } else{ player.draw(); } player.storage.zhanjue++; } else{ player.draw(2); player.storage.zhanjue+=2; } } }, qinwang:{ unique:true, group:['qinwang1','qinwang2'], }, qinwang1:{ audio:2, trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; if(!player.isZhu) return false; if(event.filterCard({name:'sha'})==false) return false; for(var i=0;i0&&game.players[i].num('h')>=3){ yep=true;break; } } var next=player.chooseToDiscard('是否发动【勤王】?','he'); next.ai=function(card){ if(yep) return 5-ai.get.value(card); return 0; } next.logSkill='qinwang' "step 1" if(!result.bool){ event.finish(); } "step 2" if(event.current==undefined) event.current=player.next; if(event.current==player){ event.finish(); } else if(event.current.group=='shu'){ var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张杀?',{name:'sha'}); next.ai=function(){ var event=_status.event; return (ai.get.attitude(event.player,event.source)-2); }; next.autochoose=lib.filter.autoRespondSha; next.source=player; } else{ event.current=event.current.next; event.redo(); } "step 3" if(result.bool){ event.finish(); trigger.result=result; trigger.responded=true; trigger.animate=false; event.current.draw(); if(typeof event.current.ai.shown=='number'&&event.current.ai.shown<0.95){ event.current.ai.shown+=0.3; if(event.current.ai.shown>0.95) event.current.ai.shown=0.95; } } else{ event.current=event.current.next; event.goto(2); } } }, qinwang2:{ audio:2, enable:'chooseToUse', filter:function(event,player){ if(event.filterCard&&!event.filterCard({name:'sha'},player)) return false; if(!player.isZhu) return false; if(player!=game.me&&player.skills.contains('qinwang3')) return false; for(var i=0;i0&&game.players[i].num('h')>=3){ return 5-ai.get.value(card); } } return 0; }, filterTarget:function(card,player,target){ if(_status.event._backup&& typeof _status.event._backup.filterTarget=='function'&& !_status.event._backup.filterTarget({name:'sha'},player,target)){ return false; } return player.canUse({name:'sha'},target); }, content:function(){ "step 0" if(event.current==undefined) event.current=player.next; if(event.current==player){ player.addTempSkill('qinwang3','phaseAfter'); event.parent.parent.step=0; event.finish(); } else if(event.current.group=='shu'){ var next=event.current.chooseToRespond('是否替'+get.translation(player)+'对'+get.translation(target)+'使用一张杀', function(card){return player.canUse(card,target)&&card.name=='sha';}); next.ai=function(card){ var event=_status.event; return ai.get.effect(event.target,card,event.source,event.player); }; next.autochoose=lib.filter.autoRespondSha; next.source=player; next.target=target; } else{ event.current=event.current.next; event.redo(); } "step 1" if(result.bool){ event.finish(); event.current.draw(); if(result.cards&&result.cards.length==1&&result.cards[0].name=='sha'){ player.useCard(result.cards[0],target).animate=false; } else{ player.useCard({name:'sha'},target).animate=false; } if(typeof event.current.ai.shown=='number'&&event.current.ai.shown<0.95){ event.current.ai.shown+=0.3; if(event.current.ai.shown>0.95) event.current.ai.shown=0.95; } } else{ event.current=event.current.next; event.goto(0); } }, ai:{ result:{ target:function(player,target){ if(player.skills.contains('qinwang3')) return 0; return ai.get.effect(target,{name:'sha'},player,target); } }, order:function(){ return lib.card.sha.ai.order-0.1; }, } }, qinwang3:{}, zuoding:{ trigger:{global:'useCard'}, filter:function(event,player){ return !player.skills.contains('zuoding2')&&get.suit(event.card)=='spade'&& event.targets&&event.targets.length&&event.player!=player; }, direct:true, content:function(){ 'step 0' player.chooseTarget('是否发动【佐定】?',function(card,player,target){ return trigger.targets.contains(target); }).ai=function(target){ return ai.get.attitude(player,target); } 'step 1' if(result.bool){ player.logSkill('zuoding',result.targets); result.targets[0].draw(); } }, ai:{ expose:0.2 }, group:'zuoding3' }, zuoding2:{}, zuoding3:{ trigger:{global:'damageEnd'}, forced:true, popup:false, silent:true, content:function(){ player.addTempSkill('zuoding2','phaseAfter'); } }, huomo:{ audio:2, trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; if(!event.filterCard({name:'shan'})) return false; if(player.skills.contains('huomo2')) return false; if(event.parent.name!='sha') return false; var hs=player.get('he',{color:'black'}); for(var i=0;i0&&!player.skills.contains('taoxi4')&&player!=event.target; }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; }, intro:{ content:'card' }, content:function(){ var card=trigger.target.get('h').randomGet(); player.showCards([card]); player.storage.taoxi=card; player.storage.taoxi2=trigger.target; player.syncStorage('taoxi'); player.markSkill('taoxi'); player.addTempSkill('taoxi4','phaseAfter'); }, group:['taoxi2','taoxi3'] }, taoxi2:{ audio:false, enable:'phaseUse', filter:function(event,player){ if(player.storage.taoxi&&player.storage.taoxi2&& get.owner(player.storage.taoxi)==player.storage.taoxi2&& lib.filter.filterCard(player.storage.taoxi,player,event)){ return true; } return false; }, filterTarget:function(card,player,target){ return player.canUse(player.storage.taoxi,target); }, selectTarget:function(){ return get.select(get.info(_status.event.player.storage.taoxi).selectTarget); }, multitarget:true, multiline:true, content:function(){ 'step 0' var card=player.storage.taoxi; if(!card){ event.finish(); return; } var owner=get.owner(card); if(owner){ owner.lose(card,ui.special); } event.card=card; player.$throw(card); 'step 1' player.useCard(event.card,targets).animate=false; delete player.storage.taoxi; delete player.storage.taoxi2; player.unmarkSkill('taoxi'); }, ai:{ order:8, result:{ target:function(player,target){ return ai.get.effect(target,player.storage.taoxi,player,target); }, player:1 } } }, taoxi3:{ trigger:{player:'phaseEnd'}, forced:true, popup:false, filter:function(event,player){ return player.storage.taoxi?true:false; }, content:function(){ if(get.owner(player.storage.taoxi)==player.storage.taoxi2&&player.num('he')){ game.log(player,'发动了','【讨袭】'); player.popup('taoxi'); player.chooseToDiscard('he',true); } delete player.storage.taoxi; delete player.storage.taoxi2; player.unmarkSkill('taoxi'); } }, taoxi4:{}, xingshuai:{ skillAnimation:true, audio:2, trigger:{player:'dying'}, priority:6, filter:function(event,player){ if(player.storage.xingshuai) return false; if(player.hp>0) return false; if(!player.isZhu) return false; for(var i=0;i2; } event.current=current; } else{ event.redo(); } } else{ event.goto(3); } 'step 2' if(result.bool){ event.damages.push(event.current); event.current.line(player,'green'); game.log(event.current,'令',player,'回复一点体力'); } if(event.targets.length){ event.goto(1); } 'step 3' if(event.damages.length){ player.recover(event.damages.length); } 'step 4' if(event.damages.length){ event.damages.shift().damage('nosource'); event.redo(); } } }, mingjian:{ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ return player!=target; }, filter:function(event,player){ return player.num('h')>0; }, filterCard:true, selectCard:-1, discard:false, lose:true, content:function(){ player.$give(cards.length,target); target.gain(cards); target.addTempSkill('mingjian2',{player:'phaseAfter'}); }, ai:{ order:1, result:{ target:function(player,target){ if(player.hp<=2&&player.num('h','shan')) return 0; if(target.num('h')+player.num('h')>target.hp+2) return 0; if(ai.get.attitude(player,target)>3) return 1; return 0; } } } }, mingjian2:{ mark:true, intro:{ content:'手牌上限+1,出杀次数+1' }, mod:{ maxHandcard:function(player,num){ return num+1; }, cardUsable:function(card,player,num){ if(card.name=='sha') return num+1; } }, }, mingjian_old:{ audio:2, trigger:{player:'phaseUseBefore'}, direct:true, filter:function(event,player){ return player.num('h')>0; }, content:function(){ 'step 0' var go=Math.random()<0.5; player.chooseTarget('是否发动【明鉴】?',function(card,player,target){ return player!=target }).ai=function(target){ var att=ai.get.attitude(player,target); if(att>3){ if(player.num('h')>player.hp) return att; if(go) return att; } return 0; } 'step 1' if(result.bool){ player.logSkill('mingjian',result.targets); trigger.untrigger(); trigger.finish(); var target=result.targets[0]; target.addSkill('mingjian2'); var hs=player.get('h'); target.gain(hs); player.$give(hs.length,target); } } }, mingjian2_old:{ audio:false, trigger:{global:'phaseAfter'}, forced:true, popup:false, content:function(){ if(lib.config.glow_phase){ if(_status.currentPhase){ _status.currentPhase.classList.remove('glow_phase'); } player.classList.add('glow_phase'); } game.addVideo('phaseChange',player); _status.currentPhase=player; player.ai.tempIgnore=[]; player.stat.push({card:{},skill:{}}); player.phaseUse(); player.removeSkill('mingjian2'); } }, huituo:{ audio:2, trigger:{player:'damageEnd'}, direct:true, content:function(){ 'step 0' player.chooseTarget('是否发动【恢拓】?').ai=function(target){ if(ai.get.attitude(player,target)>0){ return ai.get.recoverEffect(target,player,player)+1; } return 0; } 'step 1' if(result.bool){ player.logSkill('huituo',result.targets); var target=result.targets[0]; event.target=target; target.judge(function(card){ if(target.hp==target.maxHp){ if(get.color(card)=='red') return 0; } if(get.color(card)=='red') return 1.5; return 1; }); } else{ event.finish(); } 'step 2' if(result.color){ if(result.color=='red'){ if(event.target.hp0&&event.source&&event.source.get('e','1')!=undefined&& event.card&&event.card.name=='sha'; }, check:function(event,player){ return ai.get.attitude(player,event.source)<=0; }, direct:true, priority:5, audio:2, content:function(){ 'step 0' var next=player.chooseToDiscard('he','是否发动【夺刀】?'); next.logSkill=['duodao',trigger.source]; next.ai=function(card){ if(ai.get.attitude(player,trigger.source)<0){ return 6-ai.get.value(card); } return 0; }; 'step 1' if(result.bool){ trigger.source.$give(trigger.source.get('e','1'),player); player.gain(trigger.source.get('e','1')); } }, }, anjian:{ audio:2, trigger:{source:'damageBegin'}, check:function(event,player){ return ai.get.attitude(player,event.player)<=0; }, forced:true, filter:function(event,player){ return event.card&&event.card.name=='sha'&&get.distance(event.player,player,'attack')>1&& event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2'; }, content:function(){ trigger.num++; } }, xinpojun:{ trigger:{player:'shaBegin'}, direct:true, filter:function(event,player){ return event.target.hp>0&&event.target.num('he')>0; }, audio:2, content:function(){ 'step 0' player.choosePlayerCard(trigger.target,'he', [1,Math.min(trigger.target.num('he'),trigger.target.hp)],'是否发动【破军】?'); 'step 1' if(result.bool&&result.links.length){ player.logSkill('xinpojun'); if(trigger.target.storage.xinpojun2){ trigger.target.storage.xinpojun2=trigger.target.storage.xinpojun2.concat(result.links); } else{ trigger.target.storage.xinpojun2=result.links; } game.addVideo('storage',trigger.target,['xinpojun2',get.cardsInfo(trigger.target.storage.xinpojun2),'cards']); trigger.target.addSkill('xinpojun2'); trigger.target.lose(result.links,ui.special); } }, ai:{ expose:0.2 } }, xinpojun2:{ trigger:{global:'phaseEnd'}, forced:true, audio:false, mark:true, intro:{ content:'cardCount' }, content:function(){ if(player.storage.xinpojun2){ player.gain(player.storage.xinpojun2); delete player.storage.xinpojun2; } player.removeSkill('xinpojun2'); } }, qiaoshi:{ audio:2, trigger:{global:'phaseEnd'}, filter:function(event,player){ return event.player!=player&&event.player.num('h')==player.num('h')&&event.player.isAlive(); }, check:function(event,player){ return ai.get.attitude(player,event.player)>=0; }, priority:-5, content:function(){ game.asyncDraw([trigger.player,player]); }, ai:{ expose:0.1 } }, yanyu:{ audio:2, enable:'phaseUse', filter:function(event,player){ return player.num('h','sha')>0; }, filterCard:{name:'sha'}, prepare:function(cards,player){ player.$throw(cards,1000); }, discard:false, delay:0.5, content:function(){ "step 0" player.draw(); "step 1" for(var i=0;i=2; }, content:function(){ 'step 0' player.chooseTarget('是否发动【燕语】?',function(card,player,target){ return target.sex=='male'&&target!=player; }).ai=function(target){ return ai.get.attitude(player,target); }; 'step 1' if(result.bool){ player.logSkill('yanyu',result.targets); result.targets[0].draw(2); } } }, youdi:{ audio:true, trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ return player.num('he')>0; }, content:function(){ "step 0" player.chooseTarget('是否发动【诱敌】?',function(card,player,target){ return player!=target; }).ai=function(target){ if(target.num('he')==0) return 0; return -ai.get.attitude(player,target); } "step 1" if(result.bool){ game.delay(); player.logSkill('youdi',result.targets); event.target=result.targets[0]; event.target.discardPlayerCard(player,'he',true); } else{ event.finish(); } "step 2" if(result.links[0].name!='sha'&&event.target.num('he')){ player.gainPlayerCard('he',event.target,true); } }, ai:{ expose:0.2, threaten:1.4 } }, fuhun:{ enable:['chooseToUse','chooseToRespond'], filterCard:true, selectCard:2, position:'h', audio:2, viewAs:{name:'sha'}, prompt:'将两张手牌当杀使用或打出', check:function(card){ if(_status.event.player.num('h')<4) return 6-ai.get.useful(card); return 7-ai.get.useful(card); }, ai:{ respondSha:true, order:function(item,player){ if(player.skills.contains('wusheng')&&player.skills.contains('paoxiao')){ return 1; } if(player.num('h')<4){ return 1; } return 4; }, }, group:'fuhun2' }, fuhun2:{ trigger:{source:'damageAfter'}, forced:true, filter:function(event){ return event.parent.skill=='fuhun'; }, content:function(){ player.addTempSkill('wusheng','phaseAfter'); player.addTempSkill('paoxiao','phaseAfter'); } }, fencheng:{ skillAnimation:'epic', animationColor:'fire', audio:2, enable:'phaseUse', filter:function(event,player){ return !player.storage.fencheng; }, filterTarget:function(card,player,target){ return player!=target; }, unique:true, selectTarget:-1, mark:true, line:'fire', content:function(){ "step 0" player.storage.fencheng=true; player.unmarkSkill('fencheng'); var res=ai.get.damageEffect(target,player,target,'fire'); var num=Math.max(1,target.num('e')); target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到1点火焰伤害').ai=function(card){ if(res>=0) return -1; if(num>2&&player.hp>1) return -1; if(num>1&&player.hp>2) return -1; if(get.position(card)=='e'){ return 10-ai.get.value(card); } return 6-ai.get.value(card); } "step 1" if(!result.bool){ target.damage('fire'); } }, ai:{ order:1, result:{ player:function(player){ var num=0; for(var i=0;i0){ num-=Math.max(1,game.players[i].num('e')); } else if(att<0){ num+=Math.max(1,game.players[i].num('e')); } } } if(game.players.length<5){ return num-1; } else{ return num-2; } } } }, init:function(player){ player.storage.fencheng=false; }, intro:{ content:'limited' } }, mieji:{ trigger:{player:'useCardBegin'}, direct:true, audio:2, filter:function(event,player){ return event.targets.length==1&&get.type(event.card)=='trick'&&get.color(event.card)=='black'; }, position:'he', content:function(){ "step 0" player.chooseTarget('是否发动【灭计】?',function(card,player,target){ return lib.filter.filterTarget(trigger.card,player,target)&&target!=trigger.targets[0]; }).ai=function(target){ return ai.get.effect(target,trigger.card,player,player); }; "step 1" if(result.bool){ trigger.targets.push(result.targets[0]); player.logSkill('mieji',result.targets); } } }, junxing:{ enable:'phaseUse', audio:2, usable:1, filterCard:true, selectCard:[1,Infinity], filter:function(event,player){ return player.num('h')>0; }, check:function(card){ if(ui.selected.cards.length) return -1; var val=ai.get.value(card); if(get.type(card)=='basic') return 8-ai.get.value(card); return 5-ai.get.value(card); }, filterTarget:function(card,player,target){ return player!=target; }, content:function(){ "step 0" var types=[]; for(var i=0;i0; }, filter:function(event,player){ if(event.player.num('h')) return false; if(_status.currentPhase!=player) return false; if(event.player==player) return false; for(var i=0;i2){ if(game.phaseNumber0&&event.player.num('j')) return true; var cards=event.player.get('e'); for(var i=0;i=6) return true; } return false; }, content:function(){ if(trigger.player.num('ej')){ player.gainPlayerCard(trigger.player,'ej',true); } trigger.untrigger(); trigger.finish(); } }, sanyao:{ audio:2, enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ for(var i=0;itarget.hp) return false; } return true; }, check:function(card){return 7-ai.get.value(card);}, position:'he', filterCard:true, content:function(){ target.damage(); }, ai:{ result:{ target:function(player,target){ if(target.num('j')&&ai.get.attitude(player,target)>0){ return 1; } if(target.num('e')){ return -1; } return ai.get.damageEffect(target,player); }, }, order:7 } }, qiaoshui:{ audio:2, trigger:{player:'phaseUseBegin'}, direct:true, filter:function(event,player){ return player.num('h')>0; }, content:function(){ "step 0" player.chooseTarget('是否发动【巧说】?',function(card,player,target){ return player!=target&&target.num('h')>0; }).ai=function(target){ return -ai.get.attitude(player,target)/target.num('h'); } "step 1" if(result.bool){ player.logSkill('qiaoshui',result.targets[0]); player.chooseToCompare(result.targets[0]); } else{ event.finish(); } "step 2" if(result.bool){ player.gain(result.target,'gain2'); player.addTempSkill('jizhi','phaseAfter'); } else{ player.gain(result.player,'gain2'); player.addTempSkill('qiaoshui2','phaseAfter'); } }, ai:{ expose:0.1 } }, qiaoshui2:{ mod:{ cardEnabled:function(card){ if(get.type(card,'trick')=='trick') return false; } } }, jyzongshi:{ audio:2, trigger:{target:'useCardToBegin'}, filter:function(event,player){ if(event.targets&&event.targets.length>1) return false; return event.card&&get.type(event.card)=='trick'&&event.player!=player; }, frequent:true, content:function(){ player.draw(); }, ai:{ effect:function(card,player,target){ if(get.type(card)=='trick') return [1,1]; }, } }, shenxing:{ audio:2, enable:'phaseUse', position:'he', filterCard:true, selectCard:2, prompt:'弃置任意张牌并摸等量的牌', check:function(card){return 4-ai.get.useful(card)}, content:function(){ player.draw(); }, ai:{ order:1, result:{ player:1 }, }, }, bingyi:{ audio:2, trigger:{player:'phaseDiscardEnd'}, filter:function(event,player){ var cards=player.get('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; return true; }, content:function(){ "step 0" player.draw(2); "step 1" player.chooseCard(2,'he',true,'交给'+get.translation(trigger.player)+'两张牌').ai=function(card){ if(ui.selected.cards.length&&card.name==ui.selected.cards[0].name) return -1; if(get.tag(card,'damage')) return 1; if(get.type(card)=='equip') return 1; return 0; }; "step 2" trigger.player.gain(result.cards); if(player==game.me||trigger.player==game.me) player.$give(result.cards,trigger.player); else player.$give(2,trigger.player); game.delay(); trigger.player.addSkill('xiantu2'); trigger.player.storage.xiantu=player; }, ai:{ threaten:1.1, expose:0.3 } }, xiantu2:{ trigger:{player:'phaseUseEnd'}, forced:true, audio:false, content:function(){ if(player.storage.xiantu){ player.storage.xiantu.loseHp(); delete player.storage.xiantu; } player.removeSkill('xiantu2'); }, group:'xiantu3' }, xiantu3:{ trigger:{source:'dieAfter'}, forced:true, audio:false, content:function(){ delete player.storage.xiantu; player.removeSkill('xiantu2'); } }, qiangzhi:{ audio:2, trigger:{player:'phaseUseBegin'}, direct:true, filterTarget:function(card,player,target){ return target!=player&&target.num('h')>0; }, content:function(){ 'step 0' player.chooseTarget('是否发动【强识】?',function(card,player,target){ return target!=player&&target.num('h')>0; }).ai=function(){ return Math.random(); } 'step 1' if(result.bool){ var target=result.targets[0]; player.logSkill('qiangzhi',target); var card=target.get('h').randomGet(); player.showCards(card); player.storage.qiangzhi=get.type(card,'trick'); game.addVideo('storage',player,['qiangzhi',player.storage.qiangzhi]); player.markSkill('qiangzhi'); } }, intro:{ content:function(type){ return get.translation(type)+'牌'; } }, group:['qiangzhi2','qiangzhi3'], ai:{ order:11, result:{ player:1 } } }, qiangzhi2:{ trigger:{player:'useCard'}, frequent:true, filter:function(event,player){ // return (get.type(event.card,'trick')==player.storage.qiangzhi&&event.cards[0]&&event.cards[0]==event.card); return get.type(event.card,'trick')==player.storage.qiangzhi; }, content:function(){ player.draw(); }, ai:{ threaten:1.4 } }, qiangzhi3:{ trigger:{player:'phaseUseEnd'}, forced:true, popup:false, silent:true, content:function(){ delete player.storage.qiangzhi; player.unmarkSkill('qiangzhi'); } }, dingpin:{ enable:'phaseUse', usable:3, audio:2, filter:function(event,player){ return player.num('h')>0; }, filterTarget:function(card,player,target){ return target.hp0; }, content:function(){ player.line(trigger.player,'green'); trigger.player.draw(); }, ai:{ expose:0.2 } }, jiaojin:{ audio:2, trigger:{player:'damageBegin'}, filter:function(event,player){ return player.num('he',{type:'equip'})&&event.source&&event.source.sex=='male'; }, direct:true, content:function(){ "step 0" var next=player.chooseToDiscard('he','骄矜:是否弃置一张装备牌令伤害-1?',function(card,player){ return get.type(card)=='equip'; }); next.ai=function(card){ if(player.hp==1||trigger.num>1){ return 9-ai.get.value(card); } if(player.hp==2){ return 8-ai.get.value(card); } return 7-ai.get.value(card); }; next.logSkill='jiaojin'; "step 1" if(result.bool){ game.delay(); trigger.num--; } } }, chanhui:{ audio:2, trigger:{player:'useCard'}, filter:function(event,player){ if(_status.currentPhase!=player) return false; if(player.skills.contains('chanhui2')) return false; if(event.targets.length>1) return false; var card=event.card; if(card.name=='sha') return true; if(get.color(card)=='black'&&get.type(card)=='trick') return true; return false; }, direct:true, content:function(){ "step 0" player.chooseTarget('是否发动【谮毁】?',function(card,player,target){ return player.canUse(trigger.card,target)&&trigger.targets.contains(target)==false; }).ai=function(target){ return ai.get.effect(target,trigger.card,player,player)+1; } "step 1" if(result.bool){ game.delay(); player.addSkill('chanhui2'); event.target=result.targets[0]; setTimeout(function(){ player.logSkill('chanhui',event.target); },200); event.target.chooseCard('交给'+get.translation(player)+'一张手牌,或成为'+ get.translation(trigger.card)+'的额外目标').ai=function(card){ return 5-ai.get.value(card); } } else{ event.finish(); } "step 2" if(result.bool){ player.gain(result.cards); event.target.$give(1,player); game.delay(); trigger.untrigger(); trigger.player=event.target; trigger.trigger('useCard'); game.log(event.target,'成为了',trigger.card,'的使用者'); } else{ game.log(event.target,'成为了',trigger.card,'的额外目标'); trigger.targets.push(event.target); } } }, chanhui2:{ trigger:{player:'phaseEnd'}, forced:true, popup:false, audio:false, content:function(){ player.removeSkill('chanhui2'); } }, quanji:{ audio:2, trigger:{player:'damageEnd'}, frequent:true, locked:false, init:function(player){ player.storage.quanji=[]; }, content:function(){ "step 0" player.draw(trigger.num); "step 1" if(player.num('he')){ player.chooseCard('将'+get.cnNumber(trigger.num)+'张手牌置于武将牌上作为“权”',trigger.num,true); } else{ event.finish(); } "step 2" if(result.cards&&result.cards.length){ player.lose(result.cards,ui.special); player.storage.quanji=player.storage.quanji.concat(result.cards); game.addVideo('storage',player,['quanji',get.cardsInfo(player.storage.quanji),'cards']); game.log(player,'将',result.cards,'置于武将牌上作为“权”'); player.markSkill('quanji'); } }, intro:{ content:'cards' }, mod:{ maxHandcard:function(player,num){ return num+player.storage.quanji.length; } }, ai:{ maixie:true, threaten:0.8, effect:{ target:function(card,player,target){ if(get.tag(card,'damage')){ if(player.skills.contains('jueqing')) return [1,-2]; var hasfriend=false; for(var i=0;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(target.hp>=4) return [0.5,get.tag(card,'damage')*2]; if(!target.skills.contains('paiyi')&&target.hp>1) return [0.5,get.tag(card,'damage')*1.5]; if(target.hp==3) return [0.5,get.tag(card,'damage')*1.5]; if(target.hp==2) return [1,get.tag(card,'damage')*0.5]; } } } } }, zili:{ skillAnimation:true, audio:3, unique:true, trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ return !player.skills.contains('paiyi')&&player.storage.quanji&&player.storage.quanji.length>=3; }, content:function(){ "step 0" player.chooseControl('recover_hp','draw_card',function(event,player){ if(player.hp>=2) return 'draw_card'; return 'recover_hp'; }); "step 1" if(result.control=='draw_card'){ player.draw(2); } else{ player.recover(); } "step 2" player.loseMaxHp(); player.addSkill('paiyi'); } }, paiyi:{ enable:'phaseUse', usable:1, audio:2, filterTarget:true, filter:function(event,player){ return player.storage.quanji.length>0; }, content:function(){ "step 0" player.chooseCardButton(player.storage.quanji,true); "step 1" var card=result.buttons[0].link; player.discard(card); player.storage.quanji.remove(card); if(!player.storage.quanji.length){ player.unmarkSkill('quanji'); } game.addVideo('storage',player,['quanji',get.cardsInfo(player.storage.quanji),'cards']); "step 2" target.draw(2); "step 3" if(target.num('h')>player.num('h')){ target.damage(); } }, ai:{ order:1, result:{ target:function(player,target){ if(player!=target) return 0; if(player.num('h')+2<=player.hp+player.storage.quanji.length) return 1; return 0; } } } }, xianzhou:{ skillAnimation:true, audio:2, unique:true, enable:'phaseUse', filter:function(event,player){ return !player.storage.xianzhou&&player.num('e')>0; }, init:function(player){ player.storage.xianzhou=false; }, filterTarget:function(card,player,target){ return player!=target; }, mark:true, content:function(){ "step 0" player.unmarkSkill('xianzhou'); var cards=player.get('e'); target.gain(cards); event.num=cards.length; player.$give(cards,target); player.storage.xianzhou=true; game.delay(); "step 1" target.chooseTarget([1,event.num],'令'+get.translation(player)+'回复'+ event.num+'点体力,或对攻击范围内的'+event.num+'名角色造成一点伤害',function(card,player,target2){ return get.distance(target,target2,'attack')<=1; }).ai=function(target2){ if(ai.get.attitude(target,player)>0){ if(player.hp+event.num<=player.maxHp||player.hp==1) return -1; } return ai.get.damageEffect(target2,target,target); } "step 2" if(result.bool){ event.targets=result.targets; event.num2=0; } else{ player.recover(event.num); event.finish(); } "step 3" if(event.num22&&ai.get.attitude(game.players[i],player)>2 ){ bool=false;break; } } if(bool) return -10; if(player.hp==1) return 1; if(game.phaseNumber1||event.targets[0]!=player); }, forced:true, popup:false, content:function(){ player.addTempSkill('qieting3','phaseAfter'); } }, qieting3:{}, zhuikong:{ audio:2, trigger:{global:'phaseBegin'}, check:function(event,player){ if(ai.get.attitude(player,event.player)<-2){ var cards=player.get('h'); if(cards.length>player.hp) return true; for(var i=0;i9&&useful<7) return true; } } return false; }, prompt:function(event){ return '是否对'+get.translation(event.player)+'发动【惴恐】?'; }, filter:function(event,player){ return player.hp0&&event.player.num('h')>0; }, content:function(){ "step 0" player.chooseToCompare(trigger.player); "step 1" if(result.bool){ trigger.player.addTempSkill('zishou2','phaseAfter'); } }, }, qiuyuan:{ audio:2, trigger:{target:'shaBefore'}, direct:true, priority:11, content:function(){ "step 0" player.chooseTarget('是否发动【求援】?',function(card,player,target){ return target!=player&&trigger.player.canUse('sha',target,false); }).ai=function(target){ return ai.get.effect(target,trigger.card,trigger.player,player)+0.1; } "step 1" if(result.bool){ var target=result.targets[0]; player.logSkill('qiuyuan',target); event.target=target; target.chooseCard({name:'shan'},'交给'+get.translation(player)+ '一张闪,或成为此杀的额外目标').ai=function(card){ return ai.get.attitude(target,player)>=0?1:-1; } game.delay(); } else{ event.finish(); } "step 2" if(result.bool){ player.gain(result.cards); event.target.$give(result.cards,player); game.delay(); } else{ trigger.targets.push(event.target); game.log(event.target,'成为了额外目标'); } }, ai:{ effect:{ target:function(card,player,target){ if(card.name!='sha') return; for(var i=0;i1){ return 11-ai.get.equipValue(card); } return 6-ai.get.equipValue(card); }, content:function(){ "step 0" player.addTempSkill('gongji2','phaseAfter'); "step 1" if(get.type(cards[0])=='equip'){ player.chooseTarget('是否弃置一名角色的一张牌?',function(card,player,target){ return player!=target&&target.num('he')>0; }).ai=function(target){ if(ai.get.attitude(player,target)<0){ return Math.max(0.5,ai.get.effect(target,{name:'sha'},player,player)); } return 0; } } else{ event.finish(); } "step 2" if(result.bool){ event.target=result.targets[0]; player.discardPlayerCard(event.target,'he',true).ai=ai.get.buttonValue; } }, ai:{ order:9, result:{ player:1 } } }, gongji2:{ mod:{ attackFrom:function(){ return -Infinity; }, }, }, zhuiyi:{ audio:2, trigger:{player:'dieBegin'}, direct:true, content:function(){ "step 0" player.chooseTarget('是否发动【追忆】?',function(card,player,target){ return player!=target&&trigger.source!=target; }).ai=function(target){ var num=ai.get.attitude(player,target); if(num>0){ if(target.hp==1){ num+=2; } if(target.hpgame.players[i].num('h')) return true; } return false; }, selectTarget:2, content:function(){ 'step 0' var gainner,giver; if(targets[0].num('h')=3&&player.num('h')0) return -1; for(var i=0;i=0&&num20){ return 1; } return 0; }; "step 2" if(result.control=='draw_card'){ targets[0].draw(); } else{ targets[0].useCard({name:'sha'},targets[1]); } }, ai:{ result:{ player:function(player){ for(var i=0;i1&&ai.get.attitude(game.players[i],player)>1){ return 1; } } return 0; }, target:function(player,target){ if(ui.selected.targets.length){ return -0.1; } return 1; } }, order:8.5, expose:0.2 } }, xinxuanhuo:{ audio:2, trigger:{player:'phaseDrawBegin'}, direct:true, content:function(){ "step 0" player.chooseTarget('是否发动【眩惑】',function(card,player,target){ return player!=target; }).ai=function(target){ var att=ai.get.attitude(player,target); if(att>0){ if(target.num('h')1&&check<2) return 0; return ai.get.unuseful(card)+9; }, ai2:function(target){ return ai.get.attitude(player,target)-2; }, prompt:'将'+get.cnNumber(event.num)+'张手牌交给一名其他角色', }); "step 2" if(result.bool){ result.targets[0].gain(result.cards); event.player.$give(result.cards.length,result.targets[0]); } }, ai:{ threaten:function(player,target){ if(target.hp==1) return 3; if(target.hp==2) return 1.5; return 0.5; }, effect:{ target:function(card,player,target){ if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; } } } }, zhenlie:{ audio:2, filter:function(event,player){ return event.player!=player&&event.card&&(event.card.name=='sha'||get.type(event.card)=='trick'); }, check:function(event,player){ if(ai.get.attitude(player,event.player)>0){ return false; } if(get.tag(event.card,'respondSha')){ if(player.num('h',{name:'sha'})==0){ return true; } } else if(get.tag(event.card,'respondShan')){ if(player.num('h',{name:'shan'})==0){ return true; } } else if(get.tag(event.card,'damage')){ if(player.num('h')<2) return true; } else if(event.card.name=='shunshou'&&player.hp>2){ return true; } return false; }, priority:10, trigger:{target:'useCardToBefore'}, content:function(){ "step 0" player.loseHp(); "step 1" trigger.untrigger(); trigger.finish(); "step 2" if(trigger.player.num('he')){ player.discardPlayerCard(trigger.player,'he',true); } }, ai:{ expose:0.3 } }, wuyan:{ audio:2, trigger:{target:'useCardToBefore',player:'useCardToBefore'}, forced:true, priority:15, check:function(event,player){ return ai.get.effect(event.target,event.card,event.player,player)<0; }, filter:function(event,player){ if(!event.target) return false; if(event.player==player&&event.target==player) return false; return (get.type(event.card)=='trick'); }, content:function(){ game.log(player,'发动了无言,',trigger.card,'对',trigger.target,'失效'); trigger.untrigger(); trigger.finish(); }, ai:{ effect:{ target:function(card,player,target,current){ if(get.type(card)=='trick'&&player!=target) return 'zeroplayertarget'; }, player:function(card,player,target,current){ if(get.type(card)=='trick'&&player!=target) return 'zeroplayertarget'; } } } }, xinwuyan:{ audio:2, trigger:{source:'damageBefore',player:'damageBefore'}, forced:true, priority:15, check:function(event,player){ if(player==event.player) return true; return false; }, filter:function(event,player){ return get.type(event.card,'trick')=='trick'; }, content:function(){ trigger.untrigger(); trigger.finish(); }, ai:{ effect:{ target:function(card,player,target,current){ if(get.type(card)=='trick'&&get.tag(card,'damage')){ return 'zeroplayertarget'; } }, player:function(card,player,target,current){ if(get.type(card)=='trick'&&get.tag(card,'damage')){ return 'zeroplayertarget'; } } } } }, xinjujian:{ trigger:{player:'phaseEnd'}, direct:true, audio:2, filter:function(event,player){ return player.num('he')>player.num('he',{type:'basic'}); }, content:function(){ "step 0" player.chooseCardTarget({ filterTarget:function(card,player,target){ return player!=target; }, filterCard:function(card){ return get.type(card)!='basic'; }, ai1:function(card){ if(get.tag(card,'damage')&&get.type(card)=='trick'){ return 20; } return 9-ai.get.value(card); }, ai2:function(target){ var att=ai.get.attitude(player,target); if(att>0){ if(target.isTurnedOver()) att+=3; if(target.hp==1) att+=3; } return att; }, position:'he', prompt:'是否发动【举荐】?' }); "step 1" if(result.bool){ var target=result.targets[0]; event.target=target; player.logSkill('xinjujian',target); player.discard(result.cards); if(target.hp==target.maxHp&& !target.isTurnedOver()&& !target.isLinked()){ target.draw(2); event.finish(); } else{ var controls=['draw_card']; if(target.hp2){ return 'recover_hp'; } else if(target.hp==2&&target.maxHp>2&&target.num('h')>1){ return 'recover_hp'; } else{ return 'draw_card'; } } } } else{ event.finish(); } "step 2" event.control=result.control; switch(event.control){ case 'recover_hp':event.target.recover();event.finish();break; case 'draw_card':event.target.draw(2);event.finish();break; case 'reset_character':if(event.target.isTurnedOver()) event.target.turnOver();break; } "step 3" if(event.control=='reset_character'&&event.target.isLinked()){ event.target.link(); } }, ai:{ expose:0.2, threaten:1.4 } }, jujian:{ enable:'phaseUse', usable:1, audio:2, filterCard:true, position:'he', selectCard:[1,3], 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){ return 8-ai.get.value(card); } return 4-ai.get.value(card); }, filterTarget:function(card,player,target){ return player!=target; }, content:function(){ target.draw(cards.length); if(cards.length==3){ if(get.type(cards[0],'trick')==get.type(cards[1],'trick')&& get.type(cards[0],'trick')==get.type(cards[2],'trick')){ player.recover(); } } }, ai:{ expose:0.2, order:1, result:{ target:1 } } }, yizhong:{ trigger:{target:'shaBefore'}, forced:true, audio:2, filter:function(event,player){ if(player.get('e','2')) return false; return (event.card.name=='sha'&&get.color(event.card)=='black') }, content:function(){ trigger.untrigger(); trigger.finish(); }, ai:{ effect:{ target:function(card,player,target){ if(target.get('e','2')) return; if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget'; } } } }, jueqing:{ trigger:{source:'damageBefore'}, forced:true, audio:2, priority:16, check:function(){return false;}, content:function(){ trigger.untrigger(); trigger.finish(); var ex=0; if(trigger.card&&trigger.card.name=='sha'){ if(player.skills.contains('jiu')) ex++; if(player.skills.contains('luoyi2')) ex++; if(player.skills.contains('reluoyi2')) ex++; } trigger.player.loseHp(trigger.num+ex); } }, shangshi:{ audio:2, trigger:{player:['loseEnd','changeHp']}, forced:true, filter:function(event,player){ return (player.num('h')0) return 0; if(player.num('e','zhuge')&&player.num('h','sha')>1) return 0; if(!player.num('h','sha')) return 0; var targets=[]; var target; for(var i=0;inum){ target=targets[i]; num=num2; } } if(num<=0) return 0; var e2=target.get('e','2'); if(e2){ if(e2.name=='tengjia'){ if(!player.num('h',{name:'sha',nature:'fire'})&&!player.num('e','zhuque')) return 0; } if(e2.name=='renwang'){ if(!player.num('h',{name:'sha',color:'red'})) return 0; } if(e2.name=='baiyin') return 0; } if(player.num('e','guanshi')&&player.num('he')>2) return 1; return target.num('h')>3?0:1; } if(player==_status.event.dying||player.isTurnedOver()) return 3; } }, effect:{ target:function(card,player,target){ if(card.name=='guiyoujie') return [0,0.5]; if(target.isTurnedOver()){ if(get.tag(card,'damage')){ if(player.skills.contains('jueqing')) return [1,-2]; if(target.hp==1) return; return [1,target.num('h')/2]; } } } } }, }, jiushi2:{ trigger:{player:'damageBegin'}, forced:true, popup:false, silent:true, filter:function(event,player){ return player.classList.contains('turnedover'); }, content:function(){ player.storage.jiushi=true; } }, jiushi3:{ audio:2, trigger:{player:'damageAfter'}, check:function(event,player){ return player.isTurnedOver(); }, filter:function(event,player){ if(player.storage.jiushi){ return true; } return false; }, content:function(){ player.storage.jiushi=false; player.turnOver(); } }, zongshi:{ mod:{ maxHandcard:function(player,num){ var list=['wei','shu','wu','qun']; for(var i=0;i=num; }, check:function(card){ return 6-ai.get.value(card); }, selectCard:function(card){ var num=_status.event.player.getStat().skill.danshou; if(num) return num+1; return 1; }, filterTarget:function(card,player,target){ if(player==target) return false; var num=player.getStat().skill.danshou; if(num){ num++; } else{ num=1; } if(num<=2&&!target.num('he')) return false; return get.distance(player,target,'attack')<=1; }, content:function(){ 'step 0' var num=player.getStat().skill.danshou; switch(num){ case 1:player.discardPlayerCard(target,true);break; case 2:target.chooseCard('选择一张牌交给'+get.translation(player),'he',true);break; case 3:target.damage();break; default:game.asyncDraw([player,target],2); } if(num!=2) event.finish(); 'step 1' if(result.cards){ player.gain(result.cards); target.$give(result.cards.length,player); } }, ai:{ order:8, result:{ target:function(player,target){ var num=player.getStat().skill.danshou; if(num){ num++; } else{ num=1; } if(num>3) return 0; if(num==3) return ai.get.damageEffect(target,player,target); return -1; } } } }, qice:{ enable:'phaseUse', usable:1, audio:2, filter:function(event,player){ return player.num('h')>0 }, chooseButton:{ dialog:function(){ var list=['taoyuan','wugu','juedou','huogong','jiedao','tiesuo','guohe','shunshou','wuzhong','wanjian','nanman']; for(var i=0;i0){ if(game.players[i].hp<2){ lose--; recover+=0.5; } lose--; recover++; } else if(ai.get.attitude(player,game.players[i])<0){ if(game.players[i].hp<2){ lose++; recover-=0.5; } lose++; recover--; } } else{ if(ai.get.attitude(player,game.players[i])>0){ lose--; } else if(ai.get.attitude(player,game.players[i])<0){ lose++; } } } } if(lose>recover&&lose>0) return (button.link[2]=='nanman')?1:-1; if(lose0) return (button.link[2]=='taoyuan')?1:-1; return (button.link[2]=='wuzhong')?1:-1; }, backup:function(links,player){ return { filterCard:true, selectCard:-1, audio:2, popname:true, viewAs:{name:links[0][2]}, } }, prompt:function(links,player){ return '将全部手牌当'+get.translation(links[0][2])+'使用'; } }, ai:{ order:1, result:{ player:function(player){ var num=0; var cards=player.get('h'); if(cards.length>=3&&player.hp>=3) return 0; for(var i=0;i1 } else{ for(var i=0;i3&&player.num('h','sha')>1){ return 'jiangchi_less'; } if(player.num('h','sha')>2){ return 'jiangchi_less'; } if(player.hp-player.num('h')>1){ return 'jiangchi_more'; } return 'cancel'; }); "step 1" if(result.control=='jiangchi_less'){ trigger.num--; player.addTempSkill('jiangchi2','phaseUseEnd'); player.logSkill('jiangchi'); } else if(result.control=='jiangchi_more'){ trigger.num++; player.addTempSkill('jiangchi3','phaseUseEnd'); player.logSkill('jiangchi'); } } }, jiangchi2:{ mod:{ targetInRange:function(card,player,target,now){ if(card.name=='sha') return true; }, cardUsable:function(card,player,num){ if(card.name=='sha') return num+1; } } }, jiangchi3:{ mod:{ cardEnabled:function(card){if(card.name=='sha') return false} } }, xinzhan:{ audio:2, enable:'phaseUse', filter:function(event,player){ return true;//player.num('h')>player.maxHp; }, usable:1, content:function(){ "step 0" var cards=get.cards(3); event.cards=cards; player.chooseCardButton(cards,'选择获得的红桃牌',[1,Infinity]).filterButton=function(button){ return get.suit(button.link)=='heart'; } "step 1" if(result.bool){ player.gain(result.links); player.$gain(result.links); game.delay(2); } for(var i=event.cards.length-1;i>=0;i--){ if(!result.bool||!result.links.contains(event.cards[i])){ ui.cardPile.insertBefore(event.cards[i],ui.cardPile.firstChild); } } }, ai:{ order:11, result:{ player:1 } } }, huilei:{ audio:2, trigger:{player:'dieBegin'}, forced:true, filter:function(event){ return event.source!=undefined; }, content:function(){ trigger.source.discard(trigger.source.get('he')); }, ai:{ threaten:0.7 } }, xinenyuan:{ audio:true, trigger:{player:'damageEnd'}, check:function(event,player){ var att=ai.get.attitude(player,event.source); var num=event.source.num('h'); if(att<=0) return true; if(num>2) return true; if(num) return att<4; return false; }, filter:function(event,player){ return event.source&&event.source!=player; }, content:function(){ "step 0" trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌或流失一点体力').ai=function(card){ if(ai.get.attitude(trigger.source,player)>0){ return 11-ai.get.value(card); } else{ return 7-ai.get.value(card); } }; "step 1" if(result.bool){ player.gain(result.cards[0]); trigger.source.$give(1,player); } else{ trigger.source.loseHp(); } }, ai:{ effect:{ target:function(card,player,target){ if(player.skills.contains('jueqing')) return [1,-1.5]; var hasfriend=false; for(var i=0;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(get.tag(card,'damage')) return [1,0,0,-0.7]; } } } }, enyuan:{ locked:true, group:['enyuan1','enyuan2'], ai:{ effect:{ target:function(card,player,target){ if(player.skills.contains('jueqing')) return [1,-2]; var hasfriend=false; for(var i=0;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(get.tag(card,'damage')) return [1,0,0,-1]; } } } }, enyuan1:{ trigger:{player:'recoverEnd'}, forced:true, audio:2, filter:function(event,player){ return event.source&&event.source!=player; }, content:function(){ trigger.source.draw(); } }, enyuan2:{ trigger:{player:'damageEnd'}, forced:true, audio:true, filter:function(event,player){ return event.source&&event.source!=player; }, content:function(){ "step 0" trigger.source.chooseCard('交出一张红桃牌或流失一点体力',function(card){ return get.suit(card)=='heart'; }).ai=function(card){ return 6-ai.get.value(card); }; "step 1" if(result.bool){ player.gain(result.cards[0]); trigger.source.$give(1,player); } else{ trigger.source.loseHp(); } } }, xuanhuo:{ audio:2, enable:'phaseUse', usable:1, discard:false, prepare:function(cards,player,targets){ player.$give(1,targets[0]); }, filterCard:function(card){ return get.suit(card)=='heart'; }, filterTarget:function(card,player,target){ if(game.players.length==2) return false; return player!=target; }, check:function(card){ var player=get.owner(card); for(var i=0;i3) break; } if(i==game.players.length) return -1; return 5-ai.get.value(card); }, content:function(){ "step 0" target.gain(cards); game.delay(); "step 1" player.gainPlayerCard(target,'he',true); "step 2" var source=target; event.card=result.buttons[0].link; player.chooseTarget('选择一个目标送出'+get.translation(event.card),function(card,player,target){ return target!=source&&target!=player; }).ai=function(target){ return ai.get.attitude(player,target); } "step 3" if(result.bool){ result.targets[0].gain(card); player.$give(1,result.targets[0]); game.delay(); } }, ai:{ result:{ target:-0.5, }, basic:{ order:9, } } }, ganlu:{ enable:'phaseUse', usable:1, audio:2, selectTarget:2, 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; }, multitarget:true, content:function(){ "step 0" event.cards=[targets[0].get('e'),targets[1].get('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]); if(event.cards[1].length) targets[1].$give(event.cards[1],targets[0]); "step 1" for(var i=0;i0) list1.push(game.players[i]); else if(ai.get.attitude(player,game.players[i])<0) list2.push(game.players[i]); } list1.sort(function(a,b){ return a.num('e')-b.num('e'); }); list2.sort(function(a,b){ return b.num('e')-a.num('e'); }); var delta; for(var i=0;i0; }, check:function(event,player){ if(event.player==player){ return event.player.get('h',function(card){ return get.type(card)!='basic'; }).length>0; } return ai.get.attitude(player,event.player)>0; }, content:function(){ "step 0" if(trigger.player!=player){ event.card=trigger.player.get('h').randomGet(); } else{ player.chooseCard(true,'选择展示一张手牌').ai=function(card){ if(get.type(card)!='basic'){ return 10-ai.get.value(card); } return 0; } event.selfSelect=true; } "step 1" if(event.selfSelect){ event.card=result.cards[0]; } player.showCards([event.card],get.translation(player)+'展示的手牌'); "step 2" if(get.type(event.card)!='basic'){ trigger.player.recover(); trigger.player.discard(event.card); } }, ai:{ threaten:1.4 } }, pojun:{ audio:2, trigger:{source:'damageEnd'}, check:function(event,player){ if(event.player.isTurnedOver()) return ai.get.attitude(player,event.player)>0; if(event.player.hp<3){ return ai.get.attitude(player,event.player)<0; } return ai.get.attitude(player,event.player)>0; }, filter:function(event){ return event.card&&event.card.name=='sha'&&event.player.isAlive(); }, content:function(){ "step 0" trigger.player.draw(Math.min(5,trigger.player.hp)); "step 1" trigger.player.turnOver(); } }, jingce:{ trigger:{player:'phaseUseEnd'}, frequent:true, filter:function(event,player){ return get.cardCount(true,player)>=player.hp; }, content:function(){ player.draw(2); }, audio:2, init:function(player){player.storage.jingce=true}, intro:{ content:function(storage,player){ if(_status.currentPhase==player) return '已使用'+get.cardCount(true,player)+'张牌'; } } }, chengxiang:{ trigger:{player:'damageEnd'}, direct:true, audio:2, content:function(){ "step 0" event.cards=get.cards(4); if(event.isMine()==false){ event.dialog=ui.create.dialog('称象',event.cards); game.delay(2); } game.addVideo('showCards',player,['称象',get.cardsInfo(event.cards)]); game.addVideo('delay',null,2); "step 1" if(event.dialog) event.dialog.close(); var dialog=ui.create.dialog('称象:选择任意张点数小于13的牌',event.cards); var next=player.chooseButton([0,4],dialog); next.filterButton=function(button){ var num=0 for(var i=0;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(target.hp>=4) return [1,2]; if(target.hp==3) return [1,1.5]; if(target.hp==2) return [1,0.5]; } } } } }, renxin:{ trigger:{global:'damageBefore'}, audio:3, priority:6, filter:function(event,player){ return event.player!=player&&event.player.hp==1&&player.num('he',{type:'equip'})>0; }, direct:true, content:function(){ "step 0" var next=player.chooseToDiscard('是否发动【仁心】?',{type:'equip'},'he'); next.logSkill=['renxin',trigger.player]; next.ai=function(card){ if(ai.get.attitude(player,trigger.player)>3){ return 11-ai.get.value(card); } return -1; } "step 1" if(result.bool){ player.turnOver(); } else{ event.finish(); } "step 2" trigger.untrigger(); trigger.finish(); }, ai:{ expose:0.5 } }, yuce:{ audio:2, trigger:{player:'damageAfter'}, direct:true, filter:function(event,player){ return player.num('h')>0; }, content:function(){ "step 0" var next=player.chooseToDiscard('是否发动御策?'); next.logSkill='yuce'; next.ai=function(card){ return 7-ai.get.value(card); } "step 1" if(result.bool){ var type=get.type(result.cards[0],'trick'); if(trigger.source){ trigger.source.chooseToDiscard('弃置一张'+get.translation(type)+'牌或令'+get.translation(player)+'回复一点体力',function(card){ return get.type(card,'trick')==type; }).ai=function(card){ if(ai.get.recoverEffect(player,trigger.source)<0){ return 7-ai.get.value(card); } return 0; } } else{ event.recover=true; } } else{ event.finish(); } "step 2" if(event.recover){ player.recover(); } else if(result.bool){ player.draw(); } else{ player.recover(); } }, ai:{ effect:{ target:function(card,player,target){ if(get.tag(card,'damage'&&target.num('h'))){ return 0.8 } } } } }, xiansi:{ audio:2, trigger:{player:'phaseBegin'}, direct:true, init:function(player){ player.storage.xiansi=[]; }, unique:true, forceunique:true, content:function(){ "step 0" player.chooseTarget('是否发动陷嗣?',[1,2],function(card,player,target){ return target.num('he')>0; }, function(target){ return -ai.get.attitude(_status.event.player,target); }); "step 1" if(result.bool){ player.logSkill('xiansi',result.targets); event.targets=result.targets; } else{ event.finish(); } "step 2" if(event.targets.length){ var target=event.targets.shift(); event.current=target; player.choosePlayerCard(target,true); } else{ event.finish(); } "step 3" if(result.bool){ player.markSkill('xiansi'); player.storage.xiansi=player.storage.xiansi.concat(result.links); game.addVideo('storage',player,['xiansi',get.cardsInfo(player.storage.xiansi),'cards']); event.current.lose(result.links,ui.special); event.current.$give(result.links,player); event.goto(2); } }, intro:{ content:'cards', onunmark:function(storage,player){ if(storage&&storage.length){ for(var i=0;i1&&player.canUse('sha',game.players[i],true,true); } } if(remove){ lib.skill.global.remove('xiansi2'); } return false; }, content:function(){ "step 0" for(var i=0;i0){ player.recover(); } else if(result.judge<0){ player.loseHp(); } if(!player.skills.contains('shibei2')){ player.addTempSkill('shibei2','phaseAfter'); } } }, shibei2:{}, jianying:{ audio:2, trigger:{player:'useCard'}, frequent:true, filter:function(event,player){ if(!event.cards||event.cards.length!=1) return false; if(_status.currentPhase!=player) return false; if(!player.storage.jianying) return false; return get.suit(player.storage.jianying)==get.suit(event.cards[0])|| player.storage.jianying.number==event.cards[0].number; }, content:function(){ player.draw(); }, intro:{ content:'card' }, group:['jianying2','jianying3'] }, jianying3:{ trigger:{player:'useCard'}, priority:-1, forced:true, popup:false, silent:true, filter:function(event,player){ if(!event.cards||event.cards.length!=1) return false; if(_status.currentPhase!=player) return false; return true; }, content:function(){ player.storage.jianying=trigger.cards[0]; } }, jianying2:{ trigger:{player:'phaseAfter'}, forced:true, silent:true, popup:false, content:function(){ player.storage.jianying=null; } }, zzhenggong:{ trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ return event.source&&event.source.num('e')>0; }, content:function(){ "step 0" var att=ai.get.attitude(player,trigger.source); player.choosePlayerCard('e','是否发动【争功】?',trigger.source).ai=function(button){ if(att<=0){ return ai.get.equipValue(button.link); } return 0; } "step 1" if(result.bool){ player.logSkill('zzhenggong',trigger.source); player.equip(result.links[0]); trigger.source.$give(result.links[0],player); } } }, zquanji:{ trigger:{global:'phaseBegin'}, priority:15, 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'); return nh1<=2&&nh2>nh1+1; } if(att>0&&event.player.num('j','lebu')&&event.player.num('h')>event.player.hp+1) return true; return false; }, filter:function(event,player){ return event.player!=player&&event.player.num('h')>0&&player.num('h')>0; }, content:function(){ "step 0" player.chooseToCompare(trigger.player); "step 1" if(result.bool){ trigger.player.skip('phaseJudge'); trigger.untrigger(); } }, ai:{ expose:0.2 } }, zbaijiang:{ skillAnimation:true, trigger:{player:'phaseBegin'}, forced:true, unique:true, init:function(player){ player.storage.zbaijiang=false; }, // intro:{ // content:'limited' // }, filter:function(event,player){ return !player.storage.zbaijiang&&player.num('e')>=2; }, content:function(){ player.storage.zbaijiang=true; player.removeSkill('zzhenggong'); player.removeSkill('zquanji'); player.removeSkill('zbaijiang'); player.addSkill('zyexin'); player.addSkill('zzili'); player.gainMaxHp(); } }, zyexin:{ trigger:{player:'damageEnd',source:'damageEnd'}, frequent:true, init:function(player){ player.storage.zyexin=[]; }, intro:{ content:'cards' }, content:function(){ var card=get.cards()[0]; player.storage.zyexin.push(card); player.$draw(card); player.markSkill('zyexin'); game.addVideo('storage',player,['zyexin',get.cardsInfo(player.storage.zyexin),'cards']); }, group:'zyexin2' }, zyexin2:{ enable:'phaseUse', usable:1, lose:false, delay:false, selectCard:[1,Infinity], filterCard:true, filter:function(event,player){ return player.storage.zyexin.length>0; }, prompt:'用任意数量的手牌与等量的“权”交换', content:function(){ "step 0" player.lose(cards,ui.special)._triggered=null; player.storage.zyexin=player.storage.zyexin.concat(cards); player.chooseCardButton(player.storage.zyexin,'选择'+cards.length+'张牌作为手牌',cards.length,true).ai=function(button){ return ai.get.value(button.link); } if(player==game.me&&_status.auto){ game.delay(); } "step 1" player.gain(result.links)._triggered=null; for(var i=0;i=4&&!player.storage.zzili; }, forced:true, content:function(){ player.storage.zzili=true; player.loseMaxHp(); player.addSkill('zpaiyi'); player.removeSkill('zzili'); }, // intro:{ // content:'limited' // } }, zpaiyi:{ trigger:{player:'phaseEnd'}, filter:function(event,player){ for(var i=0;i