'use strict'; character.yijiang={ character:{ yujin:['male','wei',4,['yizhong'],['fullskin']], caozhang:['male','wei',4,['jiangchi'],['fullskin']], guohuai:['male','wei',4,['jingce'],['fullskin']], zhangchunhua:['female','wei',3,['jueqing','shangshi'],['fullskin']], caozhi:['male','wei',3,['luoying','jiushi'],['fullskin']], caochong:['male','wei',3,['renxin','chengxiang'],['fullskin']], xunyou:['male','wei',3,['zhiyu','qice'],['fullskin']], xushu:['male','shu',3,['wuyan','jujian'],['fullskin']], xin_xushu:['male','shu',3,['xinwuyan','xinjujian'],['fullskin']], xin_masu:['male','shu',3,['sanyao','zhiman'],['fullskin']], masu:['male','shu',3,['xinzhan','huilei'],['fullskin']], fazheng:['male','shu',3,['enyuan','xuanhuo'],['fullskin']], xin_fazheng:['male','shu',3,['xinenyuan','xinxuanhuo'],['fullskin']], // zhuran:['male','wu',4,['danshou']], xusheng:['male','wu',4,['pojun'],['fullskin']], wuguotai:['female','wu',3,['ganlu','buyi'],['fullskin']], lingtong:['male','wu',4,['xuanfeng'],['fullskin']], liubiao:['male','qun',3,['zongshi','zishou'],['fullskin']], huaxiong:['male','qun',6,['yaowu'],['fullskin']], wangyi:['female','wei',3,['zhenlie','miji'],['fullskin']], yufan:['male','wu',3,['zhiyan','zongxuan'],['fullskin']], chengong:['male','qun',3,['mingce','zhichi'],['fullskin']], bulianshi:['female','wu',3,['anxu','zhuiyi'],['fullskin']], handang:['male','wu',4,['gongji','jiefan'],['fullskin']], fuhuanghou:['female','qun',3,['zhuikong','qiuyuan'],['fullskin']], zhonghui:['male','wei',4,['quanji','zili'],['fullskin']], jianyong:['male','shu',3,['qiaoshui','jyzongshi'],['fullskin']], madai:['male','shu',4,['mashu','qianxi'],['fullskin']], liufeng:['male','shu',4,['xiansi'],['fullskin']], manchong:['male','wei',3,['junxing','yuce'],['fullskin']], liru:['male','qun',3,['juece','mieji','fencheng'],['fullskin']], guanzhang:['male','shu',4,['fuhun'],['fullskin']], chenqun:['male','wei',3,['dingpin','faen'],['fullskin']], sunluban:['female','wu',3,['chanhui','jiaojin'],['fullskin']], guyong:['male','wu',3,['shenxing','bingyi'],['fullskin']], caifuren:['female','qun',3,['qieting','xianzhou'],['fullskin']], yj_jushou:['male','qun',3,['jianying','shibei'],['fullskin']], zhangsong:['male','shu',3,['qiangzhi','xiantu'],['fullskin']], zhuhuan:['male','wu',4,['youdi'],['fullskin'],['fullskin']], // zhoucang:['male','shu',4,['zhongyong'],['fullskin']], }, skill:{ youdi:{ 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', 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:{ 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, 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', 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.phaseNumber=6) return true; } return false; }, content:function(){ if(trigger.player.num('ej')){ player.gainPlayerCard(trigger.player,'ej',true); } trigger.untrigger(); trigger.finish(); } }, sanyao:{ 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:{ 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:{ 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:{ 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:{ 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;i0; }, prompt:function(event,player){ return '是否对'+get.translation(event.player)+'发动【献图】?' }, check:function(event,player){ if(ai.get.attitude(player,event.player)<5) return false; if(player.maxHp-player.hp>=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,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, 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, content:function(){ delete player.storage.xiantu; player.removeSkill('xiantu2'); } }, qiangzhi:{ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ return target!=player&&target.num('h')>0; }, content:function(){ var card=target.get('h').randomGet(); player.showCards(card); player.storage.qiangzhi=get.type(card,'trick'); 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); }, 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, filter:function(event,player){ return player.num('h')>0; }, filterTarget:function(card,player,target){ return target.hp0; }, content:function(){ trigger.player.draw(); }, ai:{ expose:0.2 } }, jiaojin:{ 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" player.chooseToDiscard('he','是否弃置一张装备牌令伤害-1?',function(card,player){ return get.type(card)=='equip'; }).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); }; "step 1" if(result.bool){ player.logSkill('jiaojin'); game.delay(); trigger.num--; } } }, chanhui:{ 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(get.translation(event.target)+'成为了'+get.translation(trigger.card)+'的使用者'); } else{ game.log(get.translation(event.target)+'成为了'+get.translation(trigger.card)+'的额外目标'); trigger.targets.push(event.target); } } }, chanhui2:{ trigger:{player:'phaseEnd'}, forced:true, popup:false, content:function(){ player.removeSkill('chanhui2'); } }, quanji:{ 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.log(get.translation(player)+'将'+get.translation(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.hp==3) return [0.5,get.tag(card,'damage')*1.5]; if(target.hp==2) return [1,get.tag(card,'damage')*0.5]; } } } } }, zili:{ 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, 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'); } "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:{ 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:{ 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:{ 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(get.translation(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:{ 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(){ var gainner,giver; if(targets[0].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:{ 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')0){ return true; } } return false; }, filter:function(event,player){ return player.hp1&&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:{ 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:{ 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(get.translation(player)+'发动了无言,'+get.translation(trigger.card)+'对'+get.translation(trigger.target)+'失效') trigger.untrigger(); trigger.finish(); }, ai:{ effect:{ target:function(card,player,target,current){ if(get.type(card)=='trick'&&player!=target) return [0,0,0,0]; }, player:function(card,player,target,current){ if(get.type(card)=='trick'&&player!=target) return [0,0,0,0]; } } } }, xinwuyan:{ trigger:{target:'useCardToBefore',player:'useCardToBefore'}, forced:true, priority:15, filter:function(event,player){ if(event.player==player&&event.target==player) return false; return (get.type(event.card,'trick')=='trick'&&get.tag(event.card,'damage')); }, check:function(event,player){ return ai.get.effect(event.target,event.card,event.player,player)<0; }, content:function(){ game.log(get.translation(player)+'发动了无言,'+get.translation(trigger.card)+'对'+get.translation(trigger.target)+'失效') trigger.untrigger(); trigger.finish(); }, ai:{ effect:{ target:function(card,player,target,current){ if(get.type(card)=='trick'&&player!=target&&get.tag(card,'damage')) return [0,0,0,0]; }, player:function(card,player,target,current){ if(get.type(card)=='trick'&&player!=target&&get.tag(card,'damage')) return [0,0,0,0]; } } } }, xinjujian:{ trigger:{player:'phaseEnd'}, direct:true, 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, 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, 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 0; } } } }, jueqing:{ trigger:{source:'damageBefore'}, forced:true, priority:10, 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:{ trigger:{player:['loseEnd','changeHp']}, forced:true, filter:function(event,player){ return (player.num('h')0 }, delay:0, content:function(){ "step 0" var list=[]; player.getStat('skill').qice--; for(var i in lib.card){ if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; if(lib.card[i].type=='trick') list.push(['锦囊','',i]); } var dialog=ui.create.dialog([list,'vcard']); player.chooseButton(dialog,function(button){ var recover=0,lose=1; 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; }); "step 1" if(result.bool){ lib.skill.qice2.viewAs={name:result.buttons[0].link[2]}; // player.popup(result.buttons[0].link[2]); event.parent.parent.backup('qice2'); event.parent.parent.step=0; if(event.isMine()){ event.parent.parent.openskilldialog='将全部手牌当'+get.translation(result.buttons[0].link[2])+'使用'; } } else{ if(player.skills.contains('qice4')){ player.addTempSkill('qice5','phaseAfter') } else{ player.addTempSkill('qice4','phaseAfter') } event.finish(); } }, ai:{ order:1, result:{ player:function(player){ if(player.skills.contains('qice5')) return 0; var num=0; var cards=player.get('h'); 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:{ enable:'phaseUse', filter:function(event,player){ return true;//player.num('h')>player.maxHp; }, usable:1, content:function(){ "step 0" var cards=get.cards(3+player.maxHp-player.hp); 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:{ 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:{ 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(get.tag(card,'recover')&&player!=target) return [1,0,0,0.1]; 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, filter:function(event,player){ return event.source&&event.source!=player; }, content:function(){ trigger.source.draw(); } }, enyuan2:{ trigger:{player:'damageEnd'}, forced: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:{ 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(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, 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{ event.card=trigger.player.get('h',function(card){ return get.type(card)!='basic'; }).randomGet(); } event.dialog=ui.create.dialog(get.translation(player)+'展示的手牌',[event.card]); game.delay(2); "step 1" if(get.type(event.card)!='basic'){ trigger.player.recover(); trigger.player.discard(event.card); } event.dialog.close(); }, ai:{ threaten:1.4 } }, pojun:{ 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); }, 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, content:function(){ "step 0" event.cards=get.cards(4); if(event.isMine()==false){ event.dialog=ui.create.dialog('称象',event.cards); game.delay(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'}, 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" player.chooseToDiscard('是否发动【仁心】?',{type:'equip'},'he').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.logSkill('renxin',trigger.player); player.turnOver(); } else{ event.finish(); } "step 2" trigger.untrigger(); trigger.finish(); }, ai:{ expose:0.5 } }, yuce:{ trigger:{player:'damageAfter'}, direct:true, filter:function(event,player){ return player.num('h')>0; }, content:function(){ "step 0" player.chooseToDiscard('是否发动御策?').ai=function(card){ return 7-ai.get.value(card); } "step 1" if(result.bool){ player.logSkill('yuce'); 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:{ 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&&player!=target; }, 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); 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:{ 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:{ 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')>=3; }, content:function(){ player.storage.zbaijiang=true; player.removeSkill('zzhenggong'); player.removeSkill('zquanji'); 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'); }, 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'); }, intro:{ content:'limited' } }, zpaiyi:{ trigger:{player:'phaseEnd'}, filter:function(event,player){ for(var i=0;i