'use strict'; game.import('character',function(lib,game,ui,get,ai,_status){ return { name:'old', characterSort:{ old:{ old_shenhua:["yuji","zhangjiao","old_zhugezhan","old_zhoutai","old_caoren","xiahouyuan","xiaoqiao","huangzhong","weiyan","xuhuang","pangde"], old_refresh:["old_zhangfei","old_huatuo"], old_yijiang1:["masu","xushu","fazheng","yujin","xin_yujin","old_xusheng","old_lingtong","ol_yujin"], old_yijiang2:["old_madai","old_zhonghui","old_wangyi","old_guanzhang","ol_liaohua"], old_yijiang3:["liru","old_zhuran","ol_zhuran","ol_manchong","ol_guohuai","old_fuhuanghou","old_caochong"], old_yijiang4:["old_caozhen","old_chenqun","old_zhuhuan","ol_wuyi"], old_yijiang5:["old_caoxiu","old_quancong","old_zhuzhi"], old_yijiang67:["ol_xinxianying","ol_zhangrang","ol_liuyu"], old_sp:["old_caochun","old_lingju","old_maliang","old_machao","zhangliang","jsp_caoren","ol_guansuo"], }, }, character:{ old_fuhuanghou:['female','qun',3,['oldzhuikong','oldqiuyuan']], old_caochong:['male','wei',3,['oldrenxin','oldchengxiang']], xuhuang:['male','wei',4,['gzduanliang']], pangde:['male','qun',4,['mashu','mengjin']], xiahouyuan:['male','wei',4,['shensu']], huangzhong:['male','shu',4,['liegong']], weiyan:['male','shu',4,['kuanggu']], xiaoqiao:['female','wu',3,['tianxiang','hongyan']], yuji:['male','qun',3,['old_guhuo'],['forbidai']], zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu']], old_zhoutai:['male','wu',4,['gzbuqu']], old_caoren:['male','wei',4,['moon_jushou','jiewei']], old_zhangfei:['male','shu',4,['paoxiao','retishen']], old_huatuo:['male','qun',3,['jijiu','chulao']], jsp_caoren:['male','wei',4,['kuiwei','yanzheng']], old_caochun:['male','wei',4,['shanjia']], 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_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_zhugezhan:["male","shu",3,["old_zuilun","old_fuyin"]], zhangliang:["male","qun",4,["old_jijun","old_fangtong"]], old_guanzhang:['male','shu',4,['old_fuhun']], ol_xinxianying:['female','wei',3,['caishi','zhongjian']], ol_zhangrang:['male','qun',3,['taoluan']], ol_yujin:['male','wei',4,['rezhenjun']], ol_zhuran:['male','wu',4,['danshou']], ol_liaohua:['male','shu',4,['dangxian','fuli']], ol_guansuo:['male','shu',4,['zhengnan','xiefang']], ol_manchong:['male','wei',3,['yuce','junxing']], ol_guohuai:['male','wei',4,['jingce']], ol_wuyi:['male','shu',4,['benxi']], ol_liuyu:['male','qun',2,['zongzuo','zhige']], }, characterFilter:{ old_lingju:function(mode){ return mode=='identity'; } }, skill:{ old_fuhun:{ audio:'fuhun', trigger:{player:'phaseDrawBefore'}, content:function(){ 'step 0' trigger.cancel(); 'step 1' var cards=get.cards(2); event.cards=cards; player.showCards(cards); 'step 2' player.gain(cards,'gain2'); if(get.color(cards[0])!=get.color(cards[1])){ player.addTempSkill('wusheng'); player.addTempSkill('paoxiao'); } }, }, "old_guhuo":{ group:["old_guhuo_guess","old_guhuo_respond","old_guhuo_wuxie"], enable:"chooseToUse", filter:function (event,player){ if(!player.countCards('h')) return false; var list=['sha','tao','jiu','taoyuan','wugu','juedou','huogong','jiedao','tiesuo','guohe','shunshou','wuzhong','wanjian','nanman']; if(get.mode()=='guozhan'){ list=list.concat(['xietianzi','shuiyanqijunx','lulitongxin','lianjunshengyan','chiling','diaohulishan','yuanjiao','huoshaolianying']); } for(var i=0;i0) return '不质疑'; return Math.random()<0.5?'不质疑':'质疑'; }); } 'step 2' if(!result.control) result.control='不质疑'; event.guessers[0].chat(result.control); game.delay(); if(result.control=='不质疑'){ game.log(event.guessers[0],'#g不质疑'); event.ally.push(event.guessers[0]); }else{ game.log(event.guessers[0],'#y质疑'); event.betray.push(event.guessers[0]); } event.guessers.remove(event.guessers[0]); if(event.guessers.length) event.goto(1); 'step 3' player.showCards(trigger.cards); if(event.betray.length){ if(trigger.card.name==trigger.cards[0].name){ if(get.suit(trigger.cards[0])!='heart'){ game.log(player,'使用的','#y'+get.translation(trigger.card.name),'作废了'); game.cardsDiscard(trigger.cards); trigger.cancel(); } for(var i=0;i0) return '不质疑'; return Math.random()<0.5?'不质疑':'质疑'; }); } 'step 3' if(!result.control) result.control='不质疑'; event.guessers[0].chat(result.control); game.delay(); if(result.control=='不质疑'){ game.log(event.guessers[0],'#g不质疑'); event.ally.push(event.guessers[0]); }else{ game.log(event.guessers[0],'#y质疑'); event.betray.push(event.guessers[0]); } event.guessers.remove(event.guessers[0]); if(event.guessers.length) event.goto(2); 'step 4' var bool=true; player.showCards(event.card); if(event.betray.length){ if(event.name==event.card.name){ if(get.suit(event.card)!='heart'){ game.log(player,'使用的','#y'+get.translation(event.name),'作废了'); game.cardsDiscard(event.card); bool=false; } for(var i=0;i0; }, viewAs:{ name:"wuxie", }, check:function(card){ if(card.name=='wuxie') return 1000; return 0; }, prompt:"将一张手牌当无懈可击使用", threaten:1.2, }, 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, animationColor:'metal', 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:'damageBegin2'}, 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