'use strict'; character.xianjian={ character:{ pal_lixiaoyao:['male','qun',4,['xiaoyao','yujian']], pal_zhaoliner:['female','wei',3,['huimeng','tianshe']], pal_linyueru:['female','wei',3,['guiyuan','qijian']], // pal_wangxiaohu:['male','qun',4,[]], // pal_sumei:['female','shu',3,[]], // pal_shenqishuang:['female','wei',3,[]], pal_jingtian:['male','wu',3,['sajin','jubao']], pal_xuejian:['female','shu',3,['shuangren','shenmu','duci']], pal_longkui:['female','qun',3,['fenxing','diewu','lingyu']], pal_zixuan:['female','wei',3,['shuiyun','wangyou','changnian']], pal_changqing:['male','wei',4,['luanjian','tianfu']], pal_nangonghuang:['male','wei',3,['zhaoyao','sheling','zhangmu']], pal_wenhui:['female','shu',4,['huxi','longxiang']], pal_wangpengxu:['female','shu',3,['duxinshu','feixu']], pal_xingxuan:['male','wei',3,['feizhua','leiyu','lingxue']], pal_leiyuange:['male','shu',4,['feng','ya','song']], pal_yuntianhe:['male','wu',4,['longxi','zhuyue','guanri']], pal_hanlingsha:['female','shu',3,['tannang','tuoqiao']], pal_liumengli:['female','wei',3,['tianxian','runxin','zhimeng']], pal_murongziying:['male','wei',4,['xuanning','poyun','qianfang']], pal_xuanxiao:['male','wei',4,['xuanyan','ningbin','xfenxin']], // pal_jiangyunfan:['male','wei',4,[]], // pal_tangyurou:['male','wei',4,[]], // pal_longyou:['male','wei',4,[]], // pal_xiaoman:['male','wei',4,[]], pal_xiahoujinxuan:['male','shu',3,['xuanmo','danqing']], // pal_muchanglan:['male','wei',4,[]], // pal_xia:['male','wei',4,[]], // pal_jiangcheng:['male','wei',4,[]], }, skill:{ yujian:{ enable:'phaseUse', viewAs:{name:'wanjian'}, filterCard:{name:'sha'}, filter:function(event,player){ return player.num('h','sha')>0; }, usable:1 }, feng:{ unique:true, init:function(player){ player.storage.feng=0; }, mark:true, intro:{ content:function(storage){ return '已累计摸'+storage+'次牌'; } }, trigger:{player:'drawBegin'}, forced:true, popup:false, content:function(){ if(player.storage.feng<2){ player.storage.feng++; } else{ trigger.num++; player.storage.feng=0; player.logSkill('feng'); } player.updateMarks(); } }, ya:{ unique:true, init:function(player){ player.storage.ya=0; }, mark:true, intro:{ content:function(storage){ return '已累计受到'+storage+'次伤害'; } }, trigger:{player:'damageBegin'}, filter:function(event,player){ if(player.storage.ya==2) return event.num>0; return true; }, forced:true, popup:false, content:function(){ if(player.storage.ya<2){ player.storage.ya++; } else if(trigger.num>0){ trigger.num--; player.storage.ya=0; player.logSkill('ya'); } player.updateMarks(); } }, song:{ unique:true, init:function(player){ player.storage.song=0; }, mark:true, intro:{ content:function(storage){ return '已累计造成'+storage+'次伤害'; } }, trigger:{source:'damageBegin'}, forced:true, popup:false, content:function(){ if(player.storage.song<2){ player.storage.song++; } else{ trigger.num++; player.storage.song=0; player.logSkill('song'); } player.updateMarks(); } }, longxiang:{ trigger:{player:'shaBegin'}, filter:function(event,player){ return event.target.num('h')>player.num('h'); }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; }, logTarget:'target', content:function(){ var hs=trigger.target.get('h'); trigger.target.discard(hs.randomGets(hs.length-player.num('h'))); } }, huxi:{ enable:'chooseToUse', viewAs:{name:'sha'}, precontent:function(){ 'step 0' player.loseHp(); 'step 1' player.changeHujia(); }, filterCard:function(){return false}, selectCard:-1, prompt:'失去一点体力并获得一点护甲,视为使用一张杀', ai:{ order:function(){ var player=_status.event.player; if(player.hp<=2) return 0; return 2; }, skillTagFilter:function(player,tag,arg){ if(arg!='use') return false; }, respondSha:true, } }, xuanmo:{ enable:'phaseUse', usable:1, filterCard:function(card){ var type=get.type(card,'trick'); return type=='basic'||type=='equip'||type=='trick'; }, check:function(card){ return 8-ai.get.value(card); }, filter:function(event,player){ return player.num('h')>0; }, discard:false, prepare:'throw', content:function(){ game.log(player,'将',cards,'置于牌堆顶'); ui.cardPile.insertBefore(cards[0],ui.cardPile.firstChild); var list=get.inpile(get.type(cards[0],'trick'),'trick').randomGets(2); for(var i=0;i0){ return att+1/Math.sqrt(1+target.num('h')); } return 0; }; 'step 2' if(result.bool){ player.line(result.targets[0],'green'); result.targets[0].draw(); event.targets.push(result.targets[0]); if(event.targets.length==game.players.length){ event.finish(); } else{ player.chooseTarget('令一名角色获得一点护甲',function(card,player,target){ return !event.targets.contains(target); }).ai=function(target){ var att=ai.get.attitude(player,target); if(att>0){ return att+1/Math.sqrt(1+target.hp); } return 0; }; } } else{ event.finish(); } 'step 3' if(result.bool){ player.line(result.targets[0],'green'); result.targets[0].changeHujia(); game.delay(); event.targets.push(result.targets[0]); if(event.targets.length==game.players.length){ event.finish(); } else{ player.chooseTarget('令一名角色装备一件随机装备',function(card,player,target){ return !event.targets.contains(target); }).ai=function(target){ var att=ai.get.attitude(player,target); if(att>0&&!target.get('e','5')){ return att; } return 0; }; } } else{ event.finish(); } 'step 4' if(result.bool){ player.line(result.targets[0],'green'); game.delay(); var list=[]; for(var i=0;i0){ return att+1/Math.sqrt(1+target.hp); } return 0; }; } } else{ event.finish(); } 'step 5' if(result.bool){ player.line(result.targets[0],'green'); game.delay(); result.targets[0].addTempSkill('qianxing',{player:'phaseBegin'}); } } }, lingyan:{ trigger:{player:'useCardToBegin'}, filter:function(event,player){ if(player.num('e')==5) return false; return lib.skill.lingyan.filterx(event.card,player)&&event.target==player; }, direct:true, filterx:function(card,player){ if(!lib.inpile.contains(card.name)) return false; var info=get.info(card); if(info.type!='equip') return false; if(info.nomod) return false; if(!info.subtype) return false; if(!player.get('e',info.subtype[5])) return false; return true; }, content:function(){ 'step 0' var list=['equip1','equip2','equip3','equip4','equip5']; for(var i=0;i0&&player.num('h')>0; }, check:function(event,player){ if(ai.get.attitude(player,event.player)>=0) return false; var hs=player.get('h'); if(hs.length=10&&val<=6) return true; if(hs[i].number>=8&&val<=3) return true; } return false; }, logTarget:'player', content:function(){ 'step 0' player.chooseToCompare(trigger.player); 'step 1' if(result.bool){ player.draw(2); } else{ event.finish(); } 'step 2' player.chooseCard('将两张牌置于牌堆顶(先选择的在上)',2,true); 'step 3' if(result.bool){ player.lose(result.cards,ui.special); event.cards=result.cards; } else{ event.finish(); } 'step 4' game.delay(); var nodes=[]; for(var i=0;i=0;i--){ ui.cardPile.insertBefore(event.cards[i],ui.cardPile.firstChild); } }, ai:{ expose:0.2 } }, zhangmu:{ trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; if(!event.filterCard({name:'shan'})) return false; return player.num('h','shan')>0; }, direct:true, check:function(event,player){ if(ai.get.damageEffect(player,event.player,player)>=0) return false; return true; }, usable:1, content:function(){ "step 0" var goon=(ai.get.damageEffect(player,trigger.player,player)<=0); player.chooseCard(get.prompt('zhangmu'),{name:'shan'}).ai=function(){ return goon?1:0; } "step 1" if(result.bool){ player.showCards(result.cards); trigger.untrigger(); trigger.responded=true; trigger.result={bool:true,card:{name:'shan'}} player.addSkill('zhangmu_ai'); } }, ai:{ effect:{ target:function(card,player,target,effect){ if(get.tag(card,'respondShan')&&effect<0){ if(target.hasSkill('zhangmu_ai')) return 0; if(target.num('h')>=2) return 0.5; } } } } }, zhangmu_ai:{ trigger:{player:'loseAfter'}, forced:true, popup:false, silent:true, filter:function(event,player){ return player.num('h','shan')==0; }, content:function(){ player.removeSkill('zhangmu_ai'); } }, leiyu:{ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ if(player.storage.leiyu){ for(var i=0;i0){ num2++; } else if(eff<0){ num2--; } } var next=player.chooseToDiscard(get.prompt('leiyu',player.storage.leiyu),{color:'black'}); next.ai=function(){ if(num>0&&num2>=2){ return 7-ai.get.value(card); } return 0; }; next.logSkill=['leiyu',player.storage.leiyu]; 'step 1' if(result.bool){ player.storage.leiyu.sort(lib.sort.seat); player.useCard({name:'jingleishan',nature:'thunder'},player.storage.leiyu).animate=false; } }, group:['leiyu2','leiyu4'], ai:{ threaten:1.3 } }, leiyu2:{ trigger:{player:'phaseUseBegin'}, forced:true, popup:false, silent:true, content:function(){ player.storage.leiyu=[]; } }, leiyu3:{ trigger:{source:'dieAfter'}, forced:true, popup:false, filter:function(event,player){ return player.storage.leiyu2?true:false; }, content:function(){ player.recover(); delete player.storage.leiyu2; } }, leiyu4:{ trigger:{player:'useCardToBegin'}, forced:true, popup:false, silent:true, filter:function(event,player){ return _status.currentPhase==player&&Array.isArray(player.storage.leiyu)&&event.target&&event.target!=player; }, content:function(){ player.storage.leiyu.add(trigger.target); } }, feizhua:{ trigger:{player:'useCard'}, filter:function(event,player){ if(event.card.name!='sha') return false; if(event.targets.length!=1) return false; var target=event.targets[0]; var players; if(get.mode()=='chess'){ players=target.getNeighbours(); } else{ players=[target.next,target.previous]; } for(var i=0;i0; }, content:function(){ "step 0" var target=trigger.targets[0]; var players; if(get.mode()=='chess'){ players=target.getNeighbours(); } else{ players=[target.next,target.previous]; } for(var i=0;i0; }, filterCard:{name:'sha'}, filterTarget:function(card,player,target){ return target!=player; }, prepare:'give', discard:false, content:function(){ target.gain(cards,player); if(!player.hasSkill('diewu2')){ player.draw(); player.addTempSkill('diewu2','phaseAfter'); } }, ai:{ order:2, expose:0.2, result:{ target:function(player,target){ if(!player.hasSkill('diewu2')) return 1; return 0; } } } }, diewu2:{}, lingyu:{ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ for(var i=0;i0; }, logTarget:'player', content:function(){ trigger.player.draw(); }, ai:{ mingzhi:false, threaten:2, expose:0.2, } }, xuanyan:{ // trigger:{source:'damageBefore'}, // forced:true, // priority:5, // check:function(event,player){ // return player.hp>3; // }, // filter:function(event){ // return event.card&&get.color(event.card)=='red'; // }, // content:function(){ // trigger.nature='fire'; // }, group:['xuanyan2','xuanyan3'] }, xuanyan2:{ trigger:{source:'damageBegin'}, forced:true, filter:function(event){ return event.nature=='fire'&&event.notLink(); }, content:function(){ trigger.num++; } }, xuanyan3:{ trigger:{source:'damageEnd'}, forced:true, popup:false, filter:function(event){ return event.nature=='fire'; }, content:function(){ player.loseHp(); } }, ningbin:{ trigger:{player:'damageEnd'}, forced:true, filter:function(event){ return event.nature=='thunder'; }, content:function(){ player.recover(); }, ai:{ effect:{ target:function(card,player,target){ if(get.tag(card,'thunderDamage')){ if(target.hp<=1||!target.hasSkill('xfenxin')) return [0,0]; return [0,1.5]; } } } }, }, xfenxin:{ trigger:{player:'changeHp'}, forced:true, filter:function(event){ return event.num!=0; }, content:function(){ player.draw(Math.abs(trigger.num)); }, ai:{ effect:{ target:function(card){ if(get.tag(card,'thunderDamage')) return; if(get.tag(card,'damage')||get.tag(card,'recover')){ return [1,0.2]; } } } }, group:'xfenxin2' }, xfenxin2:{ trigger:{source:'dieAfter'}, forced:true, content:function(){ player.gainMaxHp(); player.recover(); } }, luanjian:{ enable:'phaseUse', filter:function(event,player){ return player.num('h','sha')>1&&lib.filter.filterCard({name:'sha'},player); }, filterCard:{name:'sha'}, selectCard:2, check:function(card){ var num=0; var player=_status.event.player; for(var i=0;i0){ num++; if(num>1) return 8-ai.get.value(card); } } return 0; }, selectTarget:[1,Infinity], discard:false, line:false, multiline:true, prepare:'throw', filterTarget:function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }, content:function(){ "step 0" if(!player.hasSkill('unequip')){ event.added=true; player.skills.push('unequip'); } targets.sort(lib.sort.seat); player.useCard({name:'sha'},cards,targets,'luanjian').animate=false; "step 1" if(event.added){ player.skills.remove('unequip'); } }, multitarget:true, ai:{ order:function(){ return lib.card.sha.ai.order+0.1; }, result:{ target:function(player,target){ var added=false; if(!player.hasSkill('unequip')){ added=true; player.skills.push('unequip'); } var eff=ai.get.effect(target,{name:'sha'},player,target); if(added){ player.skills.remove('unequip'); } return eff; } }, effect:{ player:function(card,player){ if(_status.currentPhase!=player) return; if(card.name=='sha'&&player.num('h','sha')<2&&player.num('h')<=player.hp){ var num=0; var player=_status.event.player; for(var i=0;i1) return [0,0,0,0]; } } } } }, } }, tianfu:{ enable:'phaseUse', filter:function(event,player){ return player.num('h','shan')>0; }, usable:1, filterCard:{name:'shan'}, discard:false, prepare:'give', filterTarget:function(card,player,target){ return target!=player&&!target.hasSkill('tianfu2'); }, check:function(card){ if(_status.event.player.hp>=3) return 8-ai.get.value(card); return 7-ai.get.value(card); }, content:function(){ target.storage.tianfu2=cards[0]; target.storage.tianfu3=player; game.addVideo('storage',target,['tianfu2',get.cardInfo(cards[0]),'card']); target.addSkill('tianfu2'); }, ai:{ order:2, result:{ target:function(player,target){ var att=ai.get.attitude(player,target); if(att>=0) return 0; return ai.get.damageEffect(target,player,target,'thunder'); } }, expose:0.2 } }, tianfu2:{ trigger:{source:'damageAfter'}, forced:true, mark:'card', filter:function(event,player){ return player.storage.tianfu2&&player.storage.tianfu3; }, content:function(){ "step 0" if(player.storage.tianfu3&&player.storage.tianfu3.isAlive()){ player.damage(player.storage.tianfu3); player.storage.tianfu3.line(player,'thunder'); } else{ player.damage('nosource'); } "step 1" var he=player.get('he'); if(he.length){ player.discard(he.randomGet()); } "step 2" player.$throw(player.storage.tianfu2); ui.discardPile.appendChild(player.storage.tianfu2); delete player.storage.tianfu2; delete player.storage.tianfu3; player.removeSkill('tianfu2'); }, group:'tianfu3', intro:{ content:'card' } }, tianfu3:{ trigger:{player:'dieBegin'}, forced:true, popup:false, content:function(){ ui.discardPile.appendChild(player.storage.tianfu2); delete player.storage.tianfu2; delete player.storage.tianfu3; player.removeSkill('tianfu2'); } }, shuiyun:{ trigger:{player:'phaseEnd'}, direct:true, init:function(player){ player.storage.shuiyun=[]; }, filter:function(event,player){ if(player.storage.shuiyun.length>=3) return false; var types=[]; for(var i=0;i2?1:0; } "step 1" if(result.bool){ player.storage.shuiyun.remove(result.links[0]); if(!player.storage.shuiyun.length){ player.unmarkSkill('shuiyun'); } player.$throw(result.links); ui.discardPile.appendChild(result.links[0]); trigger.player.recover(); // if(trigger.player!=player){ // trigger.player.draw(); // } player.logSkill('shuiyun5',trigger.player,'thunder'); game.addVideo('storage',player,['shuiyun',get.cardsInfo(player.storage.shuiyun),'cards']); } else{ event.finish(); } "step 2" if(trigger.player!=player){ game.delay(); } }, ai:{ expose:0.3 } }, wangyou:{ trigger:{global:'phaseEnd'}, unique:true, gainable:true, direct:true, filter:function(event,player){ if(!player.num('he')) return false; if(player==event.player) return false; for(var i=0;i0) num++; else if(att<0) num--; targets.push(game.players[i]); } } event.targets=targets; var next=player.chooseToDiscard(get.prompt('wangyou',targets),'he'); next.logSkill=['wangyou',event.targets]; next.ai=function(card){ if(num<=0) return 0; switch(num){ case 1:return 5-ai.get.value(card); case 2:return 7-ai.get.value(card); default:return 8-ai.get.value(card); } } "step 1" if(result.bool){ event.targets.sort(lib.sort.seat); game.asyncDraw(event.targets); } else{ event.finish(); } }, ai:{ expose:0.1, threaten:1.2 }, group:'wangyou2' }, wangyou2:{ trigger:{global:'damageEnd'}, forced:true, popup:false, silent:true, filter:function(event){ return event.player.isAlive(); }, content:function(){ trigger.player.addTempSkill('wangyou3','phaseAfter'); } }, wangyou3:{}, changnian:{ forbid:['boss'], trigger:{player:'dieBegin'}, direct:true, unique:true, content:function(){ "step 0" player.chooseTarget(get.prompt('changnian'),function(card,player,target){ return player!=target; }).ai=function(target){ return ai.get.attitude(player,target); }; "step 1" if(result.bool){ var cards=player.get('hej'); var target=result.targets[0]; // if(player.storage.shuiyun&&player.storage.shuiyun.length){ // target.gainMaxHp(); // target.recover(player.storage.shuiyun.length); // cards=cards.concat(player.storage.shuiyun); // player.storage.shuiyun.length=0; // } player.$give(cards,target); target.gain(cards); target.addSkill('changnian2'); player.logSkill('changnian',target); target.marks.changnian=target.markCharacter(player,{ name:'长念', content:'$
【追思】
锁定技,回合结束阶段,你摸一张牌
' }); game.addVideo('markCharacter',target,{ name:'长念', content:'$
【追思】
锁定技,回合结束阶段,你摸一张牌
', id:'changnian', target:player.dataset.position }); } }, ai:{ threaten:0.8 } }, changnian2:{ trigger:{player:'phaseEnd'}, forced:true, content:function(){ player.draw(); }, }, sajin:{ enable:'phaseUse', filterTarget:function(card,player,target){ return target.hpplayer.hp){ return 7-ai.get.value(card); } return 4-ai.get.value(card); }, content:function(){ "step 0" var color=get.color(cards[0]); target.judge(function(card){ return get.color(card)==color?1:0; }); "step 1" if(result.bool){ target.recover(); } }, ai:{ order:3, result:{ target:function(player,target){ return ai.get.recoverEffect(target); } }, threaten:1.5 } }, jubao:{ trigger:{global:'discardAfter'}, filter:function(event,player){ if(player.hasSkill('jubao2')) return false; if(event.player==player) return false; if(_status.currentPhase==player) return false; for(var i=0;i0){ return [1,3]; } } } } } } }, shuangren:{ trigger:{player:['loseEnd']}, filter:function(event,player){ if(!player.equiping) return false; for(var i=0;i0; }, content:function(){ "step 0" player.chooseTarget([1,trigger.cards.length],get.prompt('qijian'),function(card,player,target){ return player.canUse({name:'sha'},target,false); }).ai=function(target){ return ai.get.effect(target,{name:'sha'},player); }; "step 1" if(result.bool){ player.logSkill('qijian'); player.useCard({name:'sha'},result.targets); } }, }, shenmu:{ trigger:{global:'dying'}, priority:6, filter:function(event,player){ return event.player.hp<=0&&player.num('h',{color:'red'}); }, check:function(event,player){ if(ai.get.attitude(player,event.player)<=0) return false; var cards=player.get('h',{color:'red'}); for(var i=0;i7&&cards.length>2) return false; } }, content:function(){ "step 0" player.showHandcards(); "step 1" var cards=player.get('h',{color:'red'}); event.num=cards.length; player.discard(cards); "step 2" trigger.player.recover(); trigger.player.draw(event.num); }, ai:{ threaten:1.6, expose:0.2 } }, qianfang:{ trigger:{player:'phaseBegin'}, direct:true, filter:function(event,player){ return player.storage.xuanning&&player.num('he')+player.storage.xuanning>=3; }, content:function(){ "step 0" var ainum=0; var num=3-player.storage.xuanning; event.targets=[]; for(var i=0;i=0){ switch(num){ case 1:return 8-ai.get.value(card); case 2:return 6-ai.get.value(card); case 3:return 4-ai.get.value(card); } } return -1; } next.logSkill='qianfang'; event.logged=true; } else{ player.chooseBool(get.prompt('qianfang')).ai=function(){ return ainum>=0; } } "step 1" if(result.bool){ player.storage.xuanning=0; player.unmarkSkill('xuanning'); player.addTempSkill('qianfang2','phaseAfter'); if(!event.logged) player.logSkill('qianfang'); player.useCard({name:'wanjian'},event.targets); } else{ event.finish(); } }, ai:{ expose:0.1, threaten:1.5 } }, qianfang2:{ trigger:{player:'phaseDrawBegin'}, forced:true, popup:false, content:function(){ trigger.num++; } }, poyun:{ trigger:{source:'damageEnd'}, check:function(event,player){ return ai.get.attitude(player,event.player)<0&&event.player.num('he')>1; }, filter:function(event,player){ return player.storage.xuanning>0&&event.player.num('he')>0; }, direct:true, content:function(){ "step 0" player.discardPlayerCard(trigger.player,'he',get.prompt('poyun'),[1,2]).logSkill=['poyun',trigger.player]; "step 1" if(result.bool){ player.storage.xuanning--; if(!player.storage.xuanning){ player.unmarkSkill('xuanning'); } player.syncStorage('xuanning'); } }, ai:{ threaten:1.3 } }, poyun2:{ trigger:{source:'damageEnd'}, forced:true, popup:false, filter:function(event,player){ return player.storage.poyun?true:false; }, content:function(){ player.draw(); player.storage.poyun=false; player.removeSkill('poyun2'); } }, poyun3:{}, zhuyue:{ enable:'phaseUse', filter:function(event,player){ return player.num('he',{type:'basic'})0; }, usable:1, locked:false, check:function(card){ return 7-ai.get.value(card); }, multitarget:true, multiline:true, content:function(){ 'step 0' targets.sort(lib.sort.seat); var target=targets[0]; var cs=target.get('he'); if(cs.length){ target.discard(cs.randomGet()); } player.storage.zhuyue.add(target); if(targets.length<2){ event.finish(); } 'step 1' var target=targets[1]; var cs=target.get('he'); if(cs.length){ target.discard(cs.randomGet()); } player.storage.zhuyue.add(target); }, ai:{ result:{ target:function(player,target){ if(!target.num('he')) return -0.2; return -1; } }, order:10, threaten:1.2, exoise:0.2 }, mod:{ targetInRange:function(card,player,target){ if(card.name=='sha'&&player.storage.zhuyue&&player.storage.zhuyue.contains(target)){ return true; } }, selectTarget:function(card,player,range){ if(card.name=='sha'&&player.storage.zhuyue&&player.storage.zhuyue.length){ range[1]=-1; range[0]=-1; } }, playerEnabled:function(card,player,target){ if(card.name=='sha'&&player.storage.zhuyue&&player.storage.zhuyue.length&&!player.storage.zhuyue.contains(target)){ return false; } } }, intro:{ content:'players' }, group:'zhuyue2' }, zhuyue2:{ trigger:{player:'phaseUseEnd'}, forced:true, popup:false, silent:true, content:function(){ player.storage.zhuyue.length=0; } }, longxi:{ trigger:{player:['chooseToRespondBegin','chooseToUseBegin']}, forced:true, popup:false, max:2, filter:function(event,player){ return _status.currentPhase!=player; }, priority:101, content:function(){ var cards=[]; var max=Math.min(ui.cardPile.childNodes.length,lib.skill.longxi.max); for(var i=0;i=2; }, check:function(card){ return 8-ai.get.value(card); }, filterCard:function(card){ return get.color(card)=='red'; }, selectCard:2, filterTarget:function(card,player,target){ return player!=target&&target.hp>=player.hp; }, intro:{ content:'limited' }, line:'fire', content:function(){ "step 0" player.storage.guanri=true; player.loseHp(); "step 1" target.damage(2,'fire'); "step 2" if(target.isAlive()){ target.discard(target.get('e')); } }, ai:{ order:1, result:{ target:function(player,target){ var eff=ai.get.damageEffect(target,player,target,'fire'); if(player.hp>2) return eff; if(player.hp==2&&target.hp==2) return eff; return 0; } }, expose:0.5 } }, tianxian:{ mod:{ targetInRange:function(card,player,target,now){ if(card.name=='sha') return true; }, selectTarget:function(card,player,range){ if(card.name=='sha'&&range[1]!=-1) range[1]=Infinity; } }, priority:5.5, trigger:{player:'useCardToBefore'}, filter:function(event){ return event.card.name=='sha'; }, forced:true, check:function(){ return false; }, content:function(){ "step 0" trigger.target.judge(function(card){ return get.color(card)=='black'?1:0; }); "step 1" if(result.bool){ trigger.untrigger(); trigger.finish(); } } }, runxin:{ trigger:{player:['useCard','respondEnd']}, direct:true, filter:function(event){ if(get.suit(event.card)=='heart'){ for(var i=0;i0){ if(noneed&&player==target){ num=0.5; } else if(target.hp==1){ num+=3; } else if(target.hp==2){ num+=1; } } return num; } "step 1" if(result.bool){ player.logSkill('runxin',result.targets); result.targets[0].recover(); } }, ai:{ expose:0.3, threaten:1.5 } }, zhimeng:{ trigger:{player:'phaseEnd'}, direct:true, locked:true, unique:true, gainable:true, group:'zhimeng3', content:function(){ "step 0" player.chooseTarget(get.prompt('zhimeng'),function(card,player,target){ return player!=target; }).ai=function(target){ var num=ai.get.attitude(player,target); if(num>0){ if(player==target){ num++; } if(target.hp==1){ num+=3; } if(target.hp==2){ num+=1; } } return num; } "step 1" if(result.bool){ var target=result.targets[0]; var card=get.cards()[0]; target.$draw(card); target.storage.zhimeng2=card; game.addVideo('storage',target,['zhimeng2',get.cardInfo(card),'card']); target.addSkill('zhimeng2'); event.finish(); player.logSkill('zhimeng',target); } }, ai:{ expose:0.2 } }, zhimeng2:{ intro:{ content:'card', onunmark:function(storage,player){ delete player.storage.zhimeng2; } }, mark:'card', trigger:{target:'useCardToBegin'}, frequent:true, filter:function(event,player){ return player.storage.zhimeng2&&get.type(event.card,'trick')==get.type(player.storage.zhimeng2,'trick'); }, content:function(){ player.draw(); }, ai:{ effect:{ target:function(card,player,target){ if(target.storage.zhimeng2&&get.type(card,'trick')==get.type(target.storage.zhimeng2,'trick')){ return [1,0.5]; } } } } }, zhimeng3:{ trigger:{player:['phaseBegin','dieBegin']}, forced:true, popup:false, silent:true, content:function(){ "step 0" event.players=game.players.slice(0); event.num=0; "step 1" if(event.num1){ return 11-ai.get.equipValue(card); } if(player.num('h')1; }, trigger:{target:'useCardToBefore'}, content:function(){ "step 0" var next=player.chooseToDiscard('是否弃置两张牌使'+get.translation(trigger.card)+'失效?','he',2); next.logSkill='xiaoyao'; next.ai=function(card){ if(ai.get.effect(player,trigger.card,trigger.player,player)<0){ if(get.tag(trigger.card,'respondSha')&&player.num('h','sha')) return 0; if(get.tag(trigger.card,'respondShan')&&player.num('h','shan')) return 0; if(card.name=='guohe') return 0; return 4-ai.get.value(card); } return 0; } "step 1" if(result.bool){ trigger.untrigger(); trigger.finish(); } } }, xiaoyao:{ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ return player.num('he',{type:'equip'})>0; }, content:function(){ "step 0" var next=player.chooseToDiscard(get.prompt('xiaoyao'),'he',{type:'equip'}); next.logSkill='xiaoyao'; next.ai=function(card){ if(player.hp==1) return 8-ai.get.value(card); if(player.isZhu) return 7-ai.get.value(card); if(player.hp==2) return 6-ai.get.value(card); return 5-ai.get.value(card); }; "step 1" if(result.bool){ player.addTempSkill('qianxing',{player:'phaseBegin'}); } }, }, tuoqiao:{ filter:function(event,player){ return game.players.length>3&&(event.player==player.next||event.player==player.previous); }, check:function(event,player){ return ai.get.effect(player,event.card,event.player,player)<0 }, changeSeat:true, trigger:{target:'useCardToBefore'}, content:function(){ if(trigger.player==player.next){ game.swapSeat(player,player.previous); } else if(trigger.player==player.previous){ game.swapSeat(player,player.next); } else{ return; } trigger.untrigger(); trigger.finish(); // player.popup('xiaoyao'); }, ai:{ effect:{ target:function(card,player,target,current){ if(target==player.next||target==player.previous) return 0.1; } } } }, yujian_old:{ enable:'phaseUse', usable:1, changeSeat:true, filterTarget:function(card,player,target){ return player!=target&&player.next!=target; }, filterCard:true, check:function(card){ return 4-ai.get.value(card); }, content:function(){ while(player.next!=target){ game.swapSeat(player,player.next); } }, ai:{ order:5, result:{ player:function(player,target){ var att=ai.get.attitude(player,target); if(target==player.previous&&att>0) return 1; if(target==player.next.next&&ai.get.attitude(player,player.next)<0) return 1; return 0; } } } }, huimeng:{ trigger:{player:'recoverAfter'}, frequent:true, content:function(){ player.draw(2); }, ai:{ threaten:0.8 } }, tianshe:{ group:['tianshe2'], trigger:{player:'damageBefore'}, filter:function(event){ if(event.nature) return true; }, forced:true, content:function(){ trigger.untrigger(); trigger.finish(); }, ai:{ nofire:true, nothunder:true, effect:{ target:function(card,player,target,current){ if(card.name=='tiesuo') return 0; if(get.tag(card,'fireDamage')) return 0; if(get.tag(card,'thunderDamage')) return 0; } } } }, tianshe2:{ trigger:{source:'damageAfter'}, filter:function(event,player){ if(event.nature&&player.hp