'use strict'; game.import('character',function(lib,game,ui,get,ai,_status){ return { name:'old', character:{ zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu']], masu:['male','shu',3,['xinzhan','huilei']], xushu:['male','shu',3,['wuyan','jujian']], fazheng:['male','shu',3,['enyuan','xuanhuo']], liru:['male','qun',3,['juece','mieji','fencheng']], yujin:['male','wei',4,['yizhong']], xin_yujin:['male','wei',4,['jieyue']], lusu:['male','wu',3,['haoshi','dimeng']], yuanshao:['male','qun',4,['luanji','xueyi'],['zhu']], old_zhonghui:['male','wei',3,['zzhenggong','zquanji','zbaijiang']], old_xusheng:['male','wu',4,['pojun']], old_zhuran:['male','wu',4,['olddanshou']], old_lingtong:['male','wu',4,['oldxuanfeng']], old_madai:['male','shu',4,['mashu','oldqianxi']], old_caoxiu:['male','wei',4,['taoxi']], old_wangyi:['female','wei',3,['oldzhenlie','oldmiji']], old_caozhen:['male','wei',4,['sidi']], old_quancong:['male','wu',4,['zhenshan']], old_yuanshu:['male','qun',4,['yongsi','weidi']], old_lingju:['female','qun',3,['jieyuan','fenxin_old']], old_maliang:['male','shu',3,['xiemu','naman']], old_chenqun:['male','wei',3,['dingpin','oldfaen']], old_zhuhuan:['male','wu',4,['youdi']], old_zhuzhi:['male','wu',4,['anguo']], old_machao:['male','qun',4,['zhuiji','cihuai']], old_bulianshi:['female','wu',3,['old_anxu','zhuiyi']], old_zhugezhan:["male","shu",3,["old_zuilun","old_fuyin"]], zhangliang:["male","qun",3,["old_jijun","old_fangtong"]], }, characterFilter:{ old_lingju:function(mode){ return mode=='identity'; } }, skill:{ old_zuilun:{ audio:'xinfu_zuilun', subSkill:{ e:{}, h:{}, }, enable:"phaseUse", usable:2, filterTarget:function (card,player,target){ if(player==target) return false; var pos='he'; if(player.hasSkill('old_zuilun_h')) pos='e'; if(player.hasSkill('old_zuilun_e')) pos='h'; return target.countGainableCards(player,pos)>0; }, content:function (){ 'step 0' var pos='he'; if(player.hasSkill('old_zuilun_h')) pos='e'; if(player.hasSkill('old_zuilun_e')) pos='h'; player.gainPlayerCard(target,pos,true); 'step 1' if(result.bool&&result.cards&&result.cards.length){ target.draw(); var pos=result.cards[0].original; if(pos=='h'||pos=='e') player.addTempSkill('old_zuilun_'+pos,'phaseUseAfter'); } }, ai:{ order:7, result:{ target:-1, }, }, }, old_fuyin:{ mod:{ targetEnabled:function(card,player,target){ if((card.name=='juedou'||card.name=='sha'||card.name=='huogong')&&player!=target&&player.countCards('h')>=target.countCards('h')&&!target.isEmpty(2)) return false; }, }, }, "old_jijun":{ marktext:"方", audio:"xinfu_jijun", intro:{ content:"cards", }, enable:"phaseUse", filterCard:true, selectCard:[1,Infinity], filter:function (event,player){ return player.countCards('h')>0; }, check:function (card){ var player=_status.event.player; if(player.storage.old_jijun&&(36-player.storage.old_jijun.length)<=player.countCards('h')) return 1; return 5-get.value(card); }, discard:false, lose:false, content:function (){ player.lose(cards,ui.special,'toStorage'); player.$give(cards,player); if(!player.storage.old_jijun) player.storage.old_jijun=[]; player.storage.old_jijun.addArray(cards); player.markSkill('old_jijun'); }, ai:{order:1,result:{player:1}}, }, "old_fangtong":{ trigger:{ player:"phaseEnd", }, audio:"xinfu_fangtong", forced:true, skillAnimation:true, filter:function (event,player){ return (player.storage.old_jijun&&player.storage.old_jijun.length>35); }, content:function (){ var bool=false; if(player==game.me) bool=true; else switch(get.mode()){ case 'identity':{ game.showIdentity(); var id1=player.identity; var id2=game.me.identity; if(['zhu','zhong','mingzhong'].contains(id1)){ if(['zhu','zhong','mingzhong'].contains(id2)) bool=true; break; } else if(id1=='fan'){ if(id2=='fan') bool=true; break; } break; } case 'guozhan':{ if(game.me.isFriendOf(player)) bool=true; break; } case 'versus':{ if(player.side==game.me.side) bool=true; break; } case 'boss':{ if(player.side==game.me.side) bool=true; break; } default:{} } game.over(bool); }, }, oldanxu:{ enable:'phaseUse', usable:1, multitarget:true, audio:2, filterTarget:function(card,player,target){ if(player==target) return false; var num=target.countCards('h'); if(ui.selected.targets.length){ return numplayers[i].countCards('h')) return true; } return false; }, selectTarget:2, content:function(){ 'step 0' var gainner,giver; if(targets[0].countCards('h')0) return -1; var players=game.filterPlayer(); for(var i=0;i=0&&num20; }, logTarget:'player', content:function(){ trigger.player.draw(); }, ai:{ expose:0.2 } }, zhenshan:{ trigger:{player:'chooseToRespondBegin'}, filter:function(event,player){ if(event.responded) return false; if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false; if(player.hasSkill('zhenshan2')) return false; var nh=player.countCards('h'); return game.hasPlayer(function(current){ return current!=player&¤t.countCards('h')0; })){ if(card.name=='sha'){ if(card.nature=='fire') return 2.95; else if(card.nature=='fire') return 2.92; else return 2.9; } else if(card.name=='tao'){ return 4; } } return 0; }, backup:function(links,player){ return { filterCard:function(){return false}, viewAs:{name:links[0][2],nature:links[0][3]}, selectCard:-1, popname:true, log:false, precontent:function(){ 'step 0' player.chooseTarget('选择交换手牌的目标',function(card,player,target){ return target.countCards('h')0&¤t.countCards('h')player.hp){ var cards=get.cards(player.maxHp-player.hp); event.cards=cards; var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden'); dialog.classList.add('noselect'); player.chooseTarget(true,dialog).ai=function(target){ return get.attitude(player,target)/Math.sqrt(1+target.countCards('h')); } } else{ event.finish(); } 'step 2' player.line(result.targets); result.targets[0].gain(event.cards,'draw'); }, ai:{ effect:{ target:function(card,player,target){ if(get.tag(card,'recover')&&target.hp==target.maxHp-1) return [0,0]; if(target.hasFriend()){ if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp==target.maxHp) return [0,1]; } } }, threaten:function(player,target){ if(target.hp==1) return 3; if(target.hp==2) return 2; return 1; }, } }, shiyong:{ audio:2, trigger:{player:'damageEnd'}, forced:true, check:function(){ return false; }, filter:function(event,player){ return event.card&&event.card.name=='sha'&&(get.color(event.card)=='red'||event.source.hasSkill('jiu')); }, content:function(){ player.loseMaxHp(); } }, oldqianxi:{ trigger:{source:'damageBefore'}, check:function(event,player){ var att=get.attitude(player,event.player); if(event.player.hp==event.player.maxHp) return att<0; if(event.player.hp==event.player.maxHp-1&& (event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0; return att>0; }, filter:function(event,player){ return event.card&&event.card.name=='sha'&&get.distance(player,event.player)<=1; }, logTarget:'player', content:function(){ 'step 0' player.judge(function(card){ return get.suit(card)!='heart'?1:-1; }); 'step 1' if(result.bool){ trigger.cancel(); trigger.player.loseMaxHp(true); } } }, oldxuanfeng:{ audio:'xuanfeng', trigger:{player:'loseEnd'}, direct:true, filter:function(event,player){ for(var i=0;i