'use strict'; character.shenhua={ connect:true, character:{ xiahouyuan:['male','wei',4,['xinshensu']], caoren:['male','wei',4,['jushou','jiewei']], huangzhong:['male','shu',4,['xinliegong']], weiyan:['male','shu',4,['xinkuanggu','qimou']], xiaoqiao:['female','wu',3,['xintianxiang','hongyan']], zhoutai:['male','wu',4,['buqu','fenji']], sp_zhangjiao:['male','qun',3,['releiji','guidao','huangtian'],['zhu']], // yuji:['male','qun',3,['guhuo']], // xin_yuji:['male','qun',3,['guhuo']], sp_zhugeliang:['male','shu',3,['huoji','bazhen','kanpo']], pangtong:['male','shu',3,['xinlianhuan','niepan']], xunyu:['male','wei',3,['quhu','jieming']], dianwei:['male','wei',4,['xinqiangxi']], taishici:['male','wu',4,['tianyi']], yanwen:['male','qun',4,['shuangxiong']], re_yuanshao:['male','qun',4,['reluanji','xueyi'],['zhu']], pangde:['male','qun',4,['mashu','jianchu']], menghuo:['male','shu',4,['huoshou','zaiqi']], zhurong:['female','shu',4,['juxiang','lieren']], caopi:['male','wei',3,['xingshang','fangzhu','songwei'],['zhu']], xuhuang:['male','wei',4,['duanliang']], re_lusu:['male','wu',3,['haoshi','redimeng']], sunjian:['male','wu',4,['yinghun']], dongzhuo:['male','qun',8,['jiuchi','roulin','benghuai','baonue'],['zhu']], jiaxu:['male','qun',3,['luanwu','wansha','weimu']], jiangwei:['male','shu',4,['tiaoxin','zhiji']], liushan:['male','shu',3,['xiangle','fangquan','ruoyu'],['zhu']], zhanghe:['male','wei',4,['qiaobian']], dengai:['male','wei',4,['tuntian','zaoxian']], sunce:['male','wu',4,['jiang','hunzi','zhiba'],['zhu']], zhangzhang:['male','wu',3,['zhijian','guzheng']], caiwenji:['female','qun',3,['beige','duanchang']], zuoci:['male','qun',3,['huashen','xinsheng']], }, perfectPair:{ yuanshao:['yanwen'], menghuo:['zhurong'], sp_zhugeliang:['pangtong'], sunce:['zhouyu','taishici','daqiao'] }, characterIntro:{ huangzhong:'字汉升,今河南南阳人。汉末三国时期蜀汉名将。本为刘表部下中郎将,后归刘备,并助刘备攻益州刘璋,在定军山一战中阵斩曹操部下名将夏侯渊。备称汉中王后改封后将军,赐关内侯。', weiyan:'字文长,义阳人。三国时期蜀汉名将,诸葛亮死后,魏延因被陷害谋反而遭杨仪一党所杀。', xiahouyuan:'字妙才,沛国谯人。东汉末年曹操部下名将,夏侯惇之族弟,八虎骑之一。群雄征讨董卓时随曹操一同起兵,后征战四方,屡立功勋。在平定马超叛乱后负责西北防线的镇守。公元219年刘备攻打汉中,被刘备部将黄忠所杀。', caoren:'字子孝,沛国谯人,曹操的从弟。三国时期曹魏名将,官至大司马。谥曰忠侯。', xiaoqiao:'庐江皖县人也。父桥国老德尊于时。小乔国色流离,资貌绝伦。建安三年,周瑜协策攻皖,拔之。娶小乔为妻。后人谓英雄美女,天作之合。', zhoutai:'字幼平,九江下蔡人,三国时期吴国武将。早年与蒋钦随孙策左右,立过数次战功。孙策讨伐六县山贼时,周泰胆气绝伦,保卫孙权,勇战退敌,身受十二处伤。有诗云:三番救主出重围,忠勇如公世所稀。遍体疮痍犹痛饮,血痕残酒满征衣。', yuji:'自号太平道人,琅琊人,在吴郡、会稽一带为百姓治病,甚得人心。孙策怒之,以惑人心为由斩之,后策常受吉咒而亡。', zhangjiao:'乱世的开始,黄巾起义军首领,太平道创始人。张角早年信奉黄老学说,对在汉代十分流行的谶纬之学也深有研究,对民间医术 、巫术也很熟悉。', dianwei:'己吾城村人。东汉末年曹魏猛将。擅使大双戟,为人壮猛任侠,曾为乡人刘氏报仇,杀人出市,人莫敢近。相貌魁梧,膂力过人。建安二年(197),张绣背叛曹操,典韦为保护曹操而独挡叛军,击杀多人,但最终因寡不敌众而战死。', xunyu:'荀彧,字文若,颍川颍阴(今河南许昌)人。东汉末年曹操帐下首席谋臣,杰出的战略家。自小被世人称作“王佐之才”。', pangtong:'庞统,字士元,襄阳(治今湖北襄阳)人。三国时刘备帐下谋士,官拜军师中郎将。才智与诸葛亮齐名,人称“凤雏”。在进围雒县时,统率众攻城,不幸被流矢击中去世,时年三十六岁。追赐统为关内侯,谥曰靖侯。庞统死后,葬于落凤庞统墓坡。', sp_zhugeliang:'字孔明,号卧龙居士,琅琊阳都人。刘备曾“三顾茅庐”得见卧龙。卧龙以一篇《隆中对》分析天下形势,提出先取荆州,再取益州成鼎足之势的说法。《三国演义》中的诸葛亮善用“火攻”,曾用火攻战术赢得多场战役,如“火烧赤壁”、“火烧博望坡”、“火烧藤甲兵”等。', taishici:'太史慈,字子义,东莱黄县(今山东龙口东黄城集)人。东汉末年武将,守言应诺,恪遵信义,始终如一,弭息诽论。官至建昌都尉。弓马熟练,箭法精良。原为刘繇部下,后被孙策收降,于赤壁之战前病逝,死时才四十一岁。', pangde:'字令明,东汉末年雍州南安郡狟道县(今甘肃天水市武山县四门镇)人。曹操部下重要将领。官至立义将军,拜关门亭侯。谥曰壮侯。有一子庞会。', yanwen:'东汉末年河北袁绍部下武将,素有威名。颜良与文丑一起作为袁绍军队的勇将而闻名。建安四年(199),袁绍以颜良、文丑为将,率精卒十万,准备攻许都;次年,兵进黎阳,遣颜良攻白马。终均亡于关羽刀下。', yuanshao:'字本初,汉族,汝南汝阳人,出身名门望族,自曾祖父起四代有五人位居三公,自己也居三公之上,其家族也因此有“四世三公”之称。曾于初平元年被推举为反董卓联合军的盟主,联军瓦解后,在汉末群雄割据的过程中,袁绍先占据冀州,又先后夺青、并二州,并于建安四年击败了割据幽州的军阀公孙瓒,势力达到顶点;但在建安五年的官渡之战中败于曹操。在平定冀州叛乱之后,于建安七年病死。', xuhuang:'字公明,河东杨人。三国时期曹魏名将,本为杨奉帐下骑都尉,杨奉被曹操击败后转投曹操,在曹操手下多立功勋,参与官渡、赤壁、关中征伐、汉中征伐等几次重大战役。', caopi:'字子桓,三国时期著名的政治家、文学家,曹魏的开国皇帝,公元220-226年在位。沛国谯人,魏武帝曹操与武宣卞皇后的长子。去世后庙号高祖,谥为文皇帝,葬于首阳陵。', sunjian:'字文台,汉族,吴郡富春人。东汉末期地方军阀,著名将领。史书说他“容貌不凡,性阔达,好奇节”,是大军事家孙武的后裔。汉末群雄之一,三国中吴国的奠基人。孙权建国后,追谥孙坚为武烈皇帝。', dongzhuo:'字仲颖,陇西临洮人。东汉末年少帝、献帝时权臣,西凉军阀。官至太师、郿侯。其为人残忍嗜杀,倒行逆施,招致群雄联合讨伐,但联合军在董卓迁都长安不久后瓦解。后被其亲信吕布所杀。', zhurong:'据传为火神祝融氏后裔,南蛮王孟获之妻。武艺超群,善使飞刀,是《三国演义》中写到的唯一真正上过战场的女性。曾与孟获一起抵抗蜀军,在诸葛亮七擒七纵孟获之后,随孟获投降蜀汉。', menghuo:'中国三国时期南中少数族首领。系东汉末益州建宁郡( 今云南晋宁东 )大姓,身材肥硕。生卒年不详。官至御史中丞。曾被诸葛亮七擒七纵,传为佳话。', jiaxu:'字文和,武威姑臧人。三国时期魏国著名谋士。曾先后担任三国军阀李傕、张绣、曹操的谋士。官至魏国太尉,谥曰肃侯。', lusu:'字子敬,汉族,临淮东城人,中国东汉末年东吴的著名军事统帅。他曾为孙权提出鼎足江东的战略规划,因此得到孙权的赏识,于周瑜死后代替周瑜领兵,守陆口。曾单刀赴会关羽于荆州。', zhanghe:'字儁乂,河间鄚人。三国时期魏国名将。官渡之战时,本为袁绍部将的张郃投降了曹操,并在曹操帐下多立功勋,于曹魏建立后加封为征西车骑将军。诸葛亮六出祁山之间,张郃多次抵御蜀军的进攻,于公元231年在木门道被诸葛亮设伏射死。后谥曰壮侯。为曹魏“五子良将”之一。', dengai:'字士载,义阳棘阳人。三国时期魏国杰出的军事家、将领。公元263年他与钟会分别率军攻打蜀汉,最后他率先进入成都,使得蜀汉灭亡。后因遭到钟会的污蔑和陷害,被司马昭猜忌而被收押,最后与其子邓忠一起被卫瓘派遣的武将田续所杀害。', jiangwei:'字伯约,天水冀人。三国时期蜀汉著名将领、军事统帅。原为曹魏天水郡的中郎将,后降蜀汉,官至凉州刺史、大将军。诸葛亮去世后继承诸葛亮的遗志,继续率领蜀汉军队北伐曹魏,与曹魏名将陈泰、郭淮、邓艾等多次交手。', liushan:'蜀汉后主,字公嗣。小名阿斗。刘备之子,母亲是昭烈皇后甘氏。三国时期蜀汉第二位皇帝,公元223-263年在位。公元263年蜀汉被曹魏所灭,刘禅投降曹魏,被封为安乐公。', sunce:'字伯符,吴郡富春人。孙坚长子,孙权长兄。东汉末年割据江东一带的军阀,汉末群雄之一,三国时期吴国的奠基者。三国演义中绰号“小霸王”,统一江东。在一次狩猎中为刺客所伤,不久后身亡,年仅二十六岁。其弟孙权接掌孙策势力,并于称帝后,追谥孙策为长沙桓王。', zhangzhang:'张昭,字子布,彭城人,三国时期吴国重臣,善丹青。拜辅吴将军,班亚三司,改封娄侯。年八十一卒,谥曰文侯。张纮,字子纲,广陵人。东吴谋士,和张昭一起合称“二张”。孙策平定江东时亲自登门邀请,张纮遂出仕为官。张纮后来建议孙权迁都秣陵,孙权正在准备时张纮病逝,其年六十岁。孙权为之流涕。', zuoci:'左慈,字元放,东汉末方士,汉族,庐江(今安徽庐江西南)人。在道教历史上,东汉时期的丹鼎派道术是从他一脉相传。', caiwenji:'名琰,原字昭姬,晋时避司马昭讳,改字文姬,东汉末年陈留圉(今河南开封杞县)人,东汉大文学家蔡邕的女儿,是中国历史上著名的才女和文学家,精于天文数理,既博学能文,又善诗赋,兼长辩才与音律。代表作有《胡笳十八拍》、《悲愤诗》等 。', }, skill:{ jianchu:{ trigger:{player:'shaBegin'}, filter:function(event){ return event.target.num('he')>0; }, check:function(event,player){ return ai.get.attitude(player,event.player)<=0; }, direct:true, content:function(){ 'step 0' player.discardPlayerCard(trigger.target,get.prompt('jianchu',trigger.target)).set('ai',function(button){ if(!_status.event.att) return 0; if(get.position(button.link)=='e') return ai.get.value(button.link); return 1; }).set('logSkill',['jianchu',trigger.target]).set('att',ai.get.attitude(player,trigger.target)<=0); 'step 1' if(result.links.length){ if(get.type(result.links[0])=='equip'){ trigger.directHit=true; } else if(trigger.cards){ trigger.target.gain(trigger.cards,'gain2','log'); } } } }, redimeng:{ audio:'dimeng', enable:'phaseUse', usable:1, position:'he', filterCard:function(){ if(ui.selected.targets.length==2) return false; return true; }, selectCard:[0,Infinity], selectTarget:2, complexCard:true, filterTarget:function(card,player,target){ if(player==target) return false; if(ui.selected.targets.length==0) return true; return (Math.abs(ui.selected.targets[0].num('h')-target.num('h'))== ui.selected.cards.length); }, multitarget:true, multiline:true, content:function(){ 'step 0' var cards=targets[0].get('h').concat(targets[1].get('h')); var dialog=ui.create.dialog('缔盟',true); if(player.isUnderControl(true)||targets[0].isUnderControl(true)||targets[1].isUnderControl(true)){ dialog.add(cards); dialog.seeing=true; } else{ dialog.add([cards,'blank']); } _status.dieClose.push(dialog); dialog.videoId=lib.status.videoId++; game.addVideo('cardDialog',null,['缔盟',get.cardsInfo(cards),dialog.videoId]); game.broadcast(function(cards,id,player,targets){ var dialog=ui.create.dialog('缔盟',true); if(player.isUnderControl(true)||targets[0].isUnderControl(true)||targets[1].isUnderControl(true)){ dialog.add(cards); dialog.seeing=true; } else{ dialog.add([cards,'blank']); } _status.dieClose.push(dialog); dialog.videoId=id; },cards,dialog.videoId,player,targets); event.current=targets[0]; event.dialog=dialog; event.num1=0; event.num2=0; game.delay(); 'step 1' if(event.dialog.buttons.length>1){ var next=event.current.chooseButton(true,function(button){ return ai.get.value(button.link,_status.event.player); }); next.set('dialog',event.dialog.videoId); next.set('closeDialog',false); next.set('dialogdisplay',true); } else{ event.directButton=event.dialog.buttons[0]; } 'step 2' var dialog=event.dialog; var card; if(event.directButton){ card=event.directButton.link; } else{ card=result.links[0]; } for(var i=0;i3; }); var player=_status.event.player; var num=player.num('he',function(card){ return ai.get.value(card)<7; }); var count=null; var from,nh; if(list.length==0) return null; list.sort(function(a,b){ return a.num('h')-b.num('h'); }); if(type==1) return list[0]; from=list[0]; nh=from.num('h'); list=game.filterPlayer(function(current){ return current!=player&&ai.get.attitude(player,current)<1; }); if(list.length==0) return null; list.sort(function(a,b){ return b.num('h')-a.num('h'); }); for(var i=0;i0; }, filterCard:{suit:'club'}, viewAs:{name:'tiesuo'}, prompt:'将一张梅花牌当铁锁连环使用', check:function(card){return 6-ai.get.value(card)}, ai:{ order:7.5, result:{ target:function(player,target){ if(ui.selected.targets.length) return 0; if(target.isLinked()) return 1; return -1; } } } }, lianhuan4:{ trigger:{player:'useCard'}, filter:function(event){ return event.skill=='lianhuan3'&&event.targets.length==1; }, forced:true, popup:false, content:function(){ player.draw(); } }, reluanji:{ audio:'luanji', enable:'phaseUse', viewAs:{name:'wanjian'}, filterCard:function(card,player){ if(!player.storage.reluanji) return true; return !player.storage.reluanji.contains(get.suit(card)); }, selectCard:2, check:function(card){ return 6-ai.get.value(card); }, ai:{ basic:{ order:10 } }, group:['reluanji_count','reluanji_reset','reluanji_respond'], subSkill:{ reset:{ trigger:{player:'phaseAfter'}, forced:true, popup:false, silent:true, filter:function(event,player){ return player.storage.reluanji?true:false; }, content:function(){ delete player.storage.reluanji; } }, count:{ trigger:{player:'useCard'}, forced:true, popup:false, silent:true, filter:function(event){ return event.skill=='reluanji'; }, content:function(){ if(!player.storage.reluanji){ player.storage.reluanji=[]; } for(var i=0;i=4&&shas.length>=3){ num=3; } else if(player.hp>=3&&shas.length>=2){ num=2; } else{ num=1 } player.awakenSkill('qimou'); player.storage.qimou=true; player.chooseControl('一','二','三','四','五','六',function(){ return get.cnNumber(_status.event.goon,true); }).set('prompt','失去任意点体力').set('goon',num); 'step 1' var num; switch(result.control){ case '一':num=1;break; case '二':num=2;break; case '三':num=3;break; case '四':num=4;break; case '五':num=5;break; case '六':num=6;break; } player.storage.qimou2=num; player.loseHp(num); player.addTempSkill('qimou2','phaseAfter'); }, ai:{ order:2, result:{ player:function(player){ if(player.hp==1) return 0; var shas=player.get('h','sha'); if(!shas.length) return 0; var card=shas[0]; if(!lib.filter.cardEnabled(card,player)) return 0; if(lib.filter.cardUsable(card,player)) return 0; var mindist; if(player.hp>=4&&shas.length>=3){ mindist=4; } else if(player.hp>=3&&shas.length>=2){ mindist=3; } else{ mindist=2; } if(game.hasPlayer(function(current){ return (current.hp<=mindist-1&& get.distance(player,current,'attack')<=mindist&& player.canUse(card,current,false)&& ai.get.effect(current,card,player,player)>0); })){ return 1; } return 0; } } } }, qimou2:{ onremove:true, mod:{ cardUsable:function(card,player,num){ if(typeof player.storage.qimou2=='number'&&card.name=='sha'){ return num+player.storage.qimou2; } }, globalFrom:function(from,to,distance){ if(typeof from.storage.qimou2=='number'){ return distance-from.storage.qimou2; } } } }, xinkuanggu:{ trigger:{source:'damageEnd'}, filter:function(event,player){ return get.distance(player,event.player)<=1&&event.num>0; }, direct:true, audio:'kuanggu', content:function(){ 'step 0' event.num=trigger.num; 'step 1' var controls=['draw_card','cancel2']; if(player.hp=3&&player.num('h')0){ event.goto(1); } } } }, xinliegong:{ mod:{ targetInRange:function(card,player,target){ if(card.name=='sha'&&card.number){ if(get.distance(player,target)<=card.number) return true; } } }, audio:'liegong', trigger:{player:'shaBegin'}, logTarget:'target', check:function(event,player){ return ai.get.attitude(player,event.target)<=0; }, filter:function(event,player){ if(event.target.num('h')<=player.num('h')) return true; if(event.target.hp<=player.hp) return true; return false; }, content:function(){ if(trigger.target.num('h')<=player.num('h')) trigger.directHit=true; if(trigger.target.hp>=player.hp) player.addTempSkill('xinliegong2','shaAfter'); }, ai:{ threaten:0.5 } }, xinliegong2:{ trigger:{source:'damageBegin'}, filter:function(event){ return event.card&&event.card.name=='sha'&&event.notLink(); }, forced:true, audio:false, content:function(){ trigger.num++; } }, tiaoxin:{ audio:4, enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ return target.canUse({name:'sha'},player)&&target.num('he'); }, content:function(){ "step 0" target.chooseToUse({name:'sha'},player,-1,'挑衅:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true); "step 1" if(result.bool==false&&target.num('he')>0){ player.discardPlayerCard(target,'he',true); } else{ event.finish(); } }, ai:{ order:4, expose:0.2, result:{ target:-1, player:function(player,target){ if(target.num('h')==0) return 0; if(target.num('h')==1) return -0.1; if(player.hp<=2) return -2; if(player.num('h','shan')==0) return -1; return -0.5; } }, threaten:1.1 } }, zhiji:{ skillAnimation:true, audio:2, unique:true, priority:-10, derivation:'guanxing', trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ if(player.storage.zhiji) return false; return player.num('h')==0; }, content:function(){ "step 0" player.awakenSkill('zhiji'); player.chooseControl('zhiji_recover','zhiji_draw',function(event,player){ if(player.hp>=2) return 'zhiji_draw'; return 'zhiji_recover'; }); "step 1" if(result.control=='zhiji_draw'){ player.draw(2); } else{ player.recover(); } "step 2" player.loseMaxHp(); player.storage.zhiji=true; if(player.hp>player.maxHp) player.hp=player.maxHp; player.update(); player.addSkill('guanxing'); game.createTrigger('phaseBegin','guanxing',player,trigger); } }, xiangle:{ audio:2, trigger:{target:'useCardToBefore'}, forced:true, filter:function(event,player){ return event.card.name=='sha'; }, content:function(){ "step 0" var eff=ai.get.effect(player,trigger.card,trigger.player,trigger.player); trigger.player.chooseToDiscard(function(card){ return get.type(card)=='basic'; }).set('ai',function(card){ if(_status.event.eff>0){ return 10-ai.get.value(card); } return 0; }).set('eff',eff); "step 1" if(result.bool==false){ trigger.finish(); trigger.untrigger(); } }, ai:{ effect:{ target:function(card,player,target,current){ if(card.name=='sha'){ if(_status.event.name=='xiangle') return; var bs=player.get('h',{type:'basic'}); if(bs.length<2) return 0; if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return; if(bs.length<=3&&player.num('h','sha')<=1){ for(var i=0;i0&&!player.hasSkill('fangquan3'); }, direct:true, content:function(){ "step 0" var fang=player.hp>=2&&player.num('h')<=player.hp+1; player.chooseTarget(get.prompt('fangquan'),function(card,player,target){ return target!=player; }).set('ai',function(target){ if(!_status.event.fang) return -1; if(target.num('j','lebu')) return -1; return ai.get.attitude(player,target)-4; }).set('fang',fang); "step 1" if(result.bool){ player.logSkill('fangquan',result.targets); trigger.untrigger(); trigger.finish(); player.addSkill('fangquan2'); player.storage.fangquan=result.targets[0]; } } }, fangquan2:{ trigger:{player:'phaseAfter'}, forced:true, popup:false, audio:false, priority:-50, content:function(){ "step 0" player.chooseToDiscard(true); "step 1" var target=player.storage.fangquan; target.markSkillCharacter('fangquan',player,'放权','进行一个额外回合'); target.phase(); target.addSkill('fangquan3'); player.removeSkill('fangquan2'); delete player.storage.fangquan; } }, fangquan3:{ trigger:{player:['phaseAfter','phaseCancelled']}, forced:true, popup:false, audio:false, content:function(){ player.unmarkSkill('fangquan'); player.removeSkill('fangquan3'); } }, ruoyu:{ skillAnimation:true, audio:2, unique:true, zhuSkill:true, keepSkill:true, derivation:'jijiang', trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ if(!player.hasZhuSkill('ruoyu'))return false; if(player.storage.ruoyu) return false; return player.isLowestHp(); }, content:function(){ player.storage.ruoyu=true; player.maxHp++; player.update(); player.recover(); if(player.hasSkill('ruoyu')){ player.addSkill('jijiang'); } else{ player.addAdditionalSkill('ruoyu','jijiang'); } if(!player.isZhu){ player.storage.zhuSkill_ruoyu=['jijiang']; } else{ event.trigger('zhuUpdate'); } player.awakenSkill('ruoyu'); } }, qiaobian:{ audio:2, group:['qiaobian1','qiaobian2','qiaobian3','qiaobian4'], ai:{ threaten:3 } }, qiaobian1:{ audio:2, trigger:{player:'phaseJudgeBefore'}, filter:function(event,player){ return player.num('h')>0; }, direct:true, frequent:true, content:function(){ "step 0" if(player.num('j')==0&&(!event.isMine()||!lib.config.autoskilllist.contains('qiaobian1'))){ event.finish(); } else{ var next=player.chooseToDiscard('是否发动巧变跳过判定阶段?'); next.set('ai',ai.get.unuseful2); next.set('logSkill','qiaobian'); } "step 1" if(result.bool){ trigger.untrigger(); trigger.finish(); } } }, qiaobian2:{ audio:2, trigger:{player:'phaseDrawBefore'}, filter:function(event,player){ return player.num('h')>0; }, direct:true, content:function(){ "step 0" var check,i,num=0,num2=0,players=game.filterPlayer(); for(i=0;i=2&&num2>0); player.chooseCardTarget({ ai1:function(card){ var evt=_status.event; if(!evt.check) return 0; return 6-ai.get.useful(card); }, ai2:function(target){ var evt=_status.event; if(!evt.check) return 0; return 1-ai.get.attitude(evt.player,target); }, filterTarget:function(card,player,target){ return target.num('h')>0; }, selectTarget:[0,2], filterCard:lib.filter.cardDiscardable, prompt:'是否发动巧变跳过摸牌阶段?', check:check, target:target }); "step 1" if(result.bool){ player.logSkill('qiaobian',result.targets); player.discard(result.cards); event.targets=result.targets; } else{ event.finish(); } "step 2" for(var i=0;i0; }, direct:true, content:function(){ "step 0" var check=game.hasPlayer(function(current){ return ai.get.attitude(player,current)>0&¤t.num('j'); }); if(!check){ if(player.num('h')>player.hp+1){ check=false; } else if(player.num('h',{name:['wuzhong']})){ check=false; } else{ check=true; } } player.chooseCardTarget({ ai1:function(card){ if(!_status.event.check) return 0; return 7-ai.get.useful(card); }, ai2:function(target){ if(!_status.event.check) return 0; var player=_status.event.player; if(ui.selected.targets.length==0){ if(target.num('j')&&ai.get.attitude(player,target)>0) return 10; if(ai.get.attitude(player,target)<0){ var players=game.filterPlayer(); for(var i=0;i0){ if((target.get('e','1')&&!players[i].get('e','1'))|| (target.get('e','2')&&!players[i].get('e','2'))|| (target.get('e','3')&&!players[i].get('e','3'))|| (target.get('e','4')&&!players[i].get('e','4'))|| (target.get('e','5')&&!players[i].get('e','5'))) return -ai.get.attitude(player,target); } } } return 0; } return -ai.get.attitude(player,target)*ai.get.attitude(player,ui.selected.targets[0]); }, multitarget:true, filterTarget:function(card,player,target){ if(ui.selected.targets.length){ var from=ui.selected.targets[0]; var judges=from.get('j'); for(var i=0;i0; } }, selectTarget:2, filterCard:lib.filter.cardDiscardable, prompt:'是否发动巧变跳过出牌阶段?', targetprompt:['被移走','移动目标'], check:check, target:target }); "step 1" if(!result.bool){ event.finish(); return; } trigger.untrigger(); trigger.finish(); player.discard(result.cards); player.logSkill('qiaobian',result.targets,false); player.line2(result.targets); event.targets=result.targets; "step 2" game.delay(); "step 3" if(targets.length==2){ player.choosePlayerCard('ej',function(button){ var player=_status.event.player; var targets0=_status.event.targets0; var targets1=_status.event.targets1; if(ai.get.attitude(player,targets0)>ai.get.attitude(player,targets1)){ return get.position(button.link)=='j'?10:0; } else{ if(get.position(button.link)=='j') return -10; return ai.get.equipValue(button.link); } },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ var targets1=_status.event.targets1; if(get.position(button.link)=='j'){ return !targets1.hasJudge(button.link.viewAs||button.link.name); } else{ return !targets1.num('e',{subtype:get.subtype(button.link)}); } }); } else{ event.finish(); } "step 4" if(result.bool&&result.links.length){ var link=result.links[0]; if(get.position(link)=='e'){ event.targets[1].equip(link); } else if(link.viewAs){ event.targets[1].addJudge({name:link.viewAs},[link]); } else{ event.targets[1].addJudge(link); } event.targets[0].$give(link,event.targets[1]) game.delay(); } }, ai:{ expose:0.2 } }, qiaobian4:{ audio:2, trigger:{player:'phaseDiscardBefore'}, direct:true, filter:function(event,player){ return player.num('h')>0; }, content:function(){ "step 0" var discard=player.num('h')>player.hp; var next=player.chooseToDiscard('是否发动巧变跳过弃牌阶段?'); next.logSkill='qiaobian'; next.ai=function(card){ if(discard){ return 100-ai.get.useful(card); } else{ return -1; } }; "step 1" if(result.bool){ trigger.untrigger(); trigger.finish(); } } }, tuntian:{ audio:2, trigger:{player:'loseEnd'}, frequent:true, filter:function(event,player){ if(player==_status.currentPhase) return false; for(var i=0;i0&&card.name=='juedou') return; if(target.num('h')==0) return 2; if(target.hasSkill('ziliang')) return 0.7; return [0.5,Math.max(target.num('h')/4,target.num('h','sha')+target.num('h','shan'))]; } } }, threaten:function(player,target){ if(target.num('h')==0) return 2; return 0.5; } } }, zaoxian:{ skillAnimation:true, audio:2, unique:true, trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ if(player.storage.tuntian) return player.storage.tuntian.length>=3&&!player.storage.zaoxian; }, derivation:'jixi', content:function(){ player.loseMaxHp(); player.addSkill('jixi'); player.storage.zaoxian=true; player.awakenSkill('zaoxian'); } }, jixi:{ audio:2, enable:'phaseUse', filter:function(event,player){ return player.storage.tuntian.length>0; }, chooseButton:{ dialog:function(event,player){ return ui.create.dialog('急袭',player.storage.tuntian,'hidden'); }, backup:function(links,player){ return { filterCard:function(){return false}, selectCard:-1, viewAs:{name:'shunshou'}, cards:links, onuse:function(result,player){ result.cards=lib.skill[result.skill].cards; var card=result.cards[0]; player.storage.tuntian.remove(card); player.syncStorage('tuntian'); if(!player.storage.tuntian.length){ player.unmarkSkill('tuntian'); } else{ player.markSkill('tuntian'); } player.logSkill('jixi',result.targets); } } }, prompt:function(links,player){ return '选择急袭的目标'; } }, ai:{ order:10, result:{ player:function(player){ return player.storage.tuntian.length-1; } } } }, jiang:{ audio:2, trigger:{player:['shaBefore','juedouBefore'],target:['shaBefore','juedouBefore']}, filter:function(event,player){ if(event.card.name=='juedou') return true; return get.color(event.card)=='red'; }, frequent:true, content:function(){ player.draw(); }, ai:{ effect:{ target:function(card,player,target){ if(card.name=='sha'&&get.color(card)=='red') return [1,0.6]; }, player:function(card,player,target){ if(card.name=='sha'&&get.color(card)=='red') return [1,1]; } } } }, hunzi:{ skillAnimation:true, audio:2, derivation:['reyingzi','yinghun'], unique:true, trigger:{player:'phaseBegin'}, filter:function(event,player){ return player.hp==1&&!player.storage.hunzi; }, forced:true, priority:3, content:function(){ player.loseMaxHp(); player.addSkill('reyingzi'); player.addSkill('yinghun'); player.awakenSkill('hunzi'); player.storage.hunzi=true; game.createTrigger('phaseBegin','yinghun',player,trigger); }, ai:{ threaten:function(player,target){ if(target.hp==1) return 2; return 0.5; }, maixie:true, effect:{ target:function(card,player,target){ if(!target.hasFriend()) return; if(get.tag(card,'damage')==1&&target.hp==2&&!target.isTurnedOver()&& _status.currentPhase!=target&&get.distance(_status.currentPhase,target,'absolute')<=3) return [0.5,1]; } } } }, zhiba:{ unique:true, global:'zhiba2', zhuSkill:true, }, zhiba2:{ audio:2, forceaudio:true, enable:'phaseUse', filter:function(event,player){ if(player.group!='wu'||player.num('h')==0) return false; return game.hasPlayer(function(target){ return target!=player&&target.hasZhuSkill('zhiba',player)&&target.num('h')>0; }); }, filterTarget:function(card,player,target){ return target!=player&&target.hasZhuSkill('zhiba',player)&&target.num('h')>0; }, usable:1, content:function(){ "step 0" if(target.storage.hunzi){ target.chooseControl('拒绝','不拒绝').set('prompt','是否拒绝制霸拼点?').set('choice',ai.get.attitude(target,player)<=0); } else{ event.forced=true; } "step 1" if(!event.forced&&result.control=='拒绝'){ game.log(target,'拒绝了拼点'); target.chat('拒绝'); event.finish(); return; } player.chooseToCompare(target,function(card){ if(card.name=='du') return 20; var player=get.owner(card); var target=_status.event.getParent().target; if(player!=target&&ai.get.attitude(player,target)>0){ return -get.number(card); } return get.number(card); }).set('preserve','lose'); "step 2" if(result.bool==false){ target.gain([result.player,result.target]); target.$gain2([result.player,result.target]); } }, ai:{ basic:{ order:1 }, expose:0.2, result:{ target:function(player,target){ if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1; if(player.num('h')<=player.hp) return 0; var maxnum=0; var cards2=target.get('h'); for(var i=0;imaxnum){ maxnum=cards2[i].number; } } if(maxnum>10) maxnum=10; if(maxnum<5&&cards2.length>1) maxnum=5; var cards=player.get('h'); for(var i=0;i0; }, filterCard:function(card){ return get.type(card)=='equip'; }, check:function(card){ var player=_status.currentPhase; if(player.num('he',{subtype:get.subtype(card)})>1){ return 11-ai.get.equipValue(card); } return 6-ai.get.value(card); }, filterTarget:function(card,player,target){ if(target.isMin()) return false; return player!=target&&!target.get('e',get.subtype(card)[5]); }, content:function(){ target.equip(cards[0]); player.draw(); }, discard:false, prepare:function(cards,player,targets){ player.$give(cards,targets[0],false); }, ai:{ basic:{ order:10 }, result:{ target:3, }, threaten:1.3 } }, guzheng:{ audio:2, unique:true, gainable:true, trigger:{global:'discardAfter'}, filter:function(event,player){ if(event.player!=player&&event.player.classList.contains('dead')==false&& event.cards&&event.cards.length&&event.getParent(2).name=='phaseDiscard'){ for(var i=0;i0){ if(du&&num<=3){ return false; } return true; } if(du) return true; return num>2; }, direct:true, content:function(){ "step 0" event.cards=trigger.cards.slice(0); for(var i=0;i0&&att2<0; }, content:function(){ "step 0" var next=player.chooseToDiscard('he',get.prompt('beige')); next.set('ai',ai.get.unuseful2); next.set('logSkill','beige'); "step 1" if(result.bool){ trigger.player.judge(); } else{ event.finish(); } "step 2" switch(get.suit(result.card)){ case 'heart':trigger.player.recover();break; case 'diamond':trigger.player.draw(2);break; case 'club':trigger.source.chooseToDiscard('he',2,true);break; case 'spade':trigger.source.turnOver();break; } }, ai:{ expose:0.3 } }, duanchang:{ audio:4, forbid:['boss'], trigger:{player:'dieBegin'}, forced:true, filter:function(event){ return event.source&&event.source.isIn(); }, content:function(){ trigger.source.clearSkills(); }, logTarget:'source', ai:{ threaten:function(player,target){ if(target.hp==1) return 0.2; return 1.5; }, effect:{ target:function(card,player,target,current){ if(!target.hasFriend()) return; if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-2]; } } } }, huashen:{ unique:true, forbid:['guozhan'], init:function(player){ player.storage.huashen={ list:[], owned:{}, player:player, } }, get:function(player,num){ if(typeof num!='number') num=1; while(num--){ var name=player.storage.huashen.list.randomRemove(); var skills=lib.character[name][3].slice(0); for(var i=0;i
【'+get.translation(skill)+ '】
'+lib.translate[skill+'_info']+'
'); } } }, mark:true }, huashen1:{ trigger:{global:['gameStart','phaseBefore']}, forced:true, popup:false, priority:10, filter:function(event,player){ return !player.storage.huasheninited; }, content:function(){ for(var i in lib.character){ if(i.indexOf('stone_')==0) continue; var add=false; for(var j=0;j0; }, content:function(){ for(var i=0;i=2; } return true; }, content:function(){ "step 0" trigger.untrigger(); trigger.finish(); event.cards=get.cards(player.maxHp-player.hp); player.showCards(event.cards); "step 1" var num=0; for(var i=0;i1; }, priority:5, content:function(){ "step 0" player.chooseToCompare(trigger.player); "step 1" if(result.bool&&trigger.player.num('he')){ player.gainPlayerCard(trigger.player,true,'he'); } } }, xingshang:{ audio:2, unique:true, gainable:true, trigger:{global:'dieEnd'}, priority:5, filter:function(event){ return event.playerCards&&event.playerCards.length>0 }, check:function(event){ for(var i=0;i0){ if(target.classList.contains('turnedover')) return 1000-target.num('h'); if(player.maxHp-player.hp<3) return -1; return 100-target.num('h'); } else{ if(target.classList.contains('turnedover')) return -1; if(player.maxHp-player.hp>=3) return -1; return 1+target.num('h'); } } "step 1" if(result.bool){ player.logSkill('fangzhu',result.targets); result.targets[0].draw(player.maxHp-player.hp); result.targets[0].turnOver(); } }, ai:{ maixie:true, effect:{ target:function(card,player,target){ if(get.tag(card,'damage')){ if(player.hasSkill('jueqing')) return [1,-2]; if(target.hp<=1) return; if(!target.hasFriend()) return; var hastarget=false; var turnfriend=false; var players=game.filterPlayer(); for(var i=0;i0&&players[i].isTurnedOver()){ hastarget=true; turnfriend=true; } } if(ai.get.attitude(player,target)>0&&!hastarget) return; if(turnfriend||target.hp==target.maxHp) return [0.5,1]; if(target.hp>1) return [1,0.5]; } } } } }, songwei:{ unique:true, global:'songwei2', zhuSkill:true, }, songwei2:{ audio:2, forceaudio:true, trigger:{player:'judgeEnd'}, filter:function(event,player){ if(player.group!='wei') return false; if(get.color(event.result.card)!='black') return false; return game.hasPlayer(function(target){ return player!=target&&target.hasZhuSkill('songwei',player); }); }, direct:true, content:function(){ 'step 0' var list=game.filterPlayer(function(current){ return current!=player&¤t.hasZhuSkill('songwei',player); }); event.list=list; 'step 1' if(event.list.length){ var current=event.list.shift(); event.current=current; player.chooseBool(get.prompt('songwei',current)).set('choice',ai.get.attitude(player,current)>0); } else{ event.finish(); } 'step 2' if(result.bool){ player.logSkill('songwei',event.current); event.current.draw(); } event.goto(1); } }, duanliang:{ group:['duanliang1','duanliang2'], ai:{ threaten:1.2 } }, duanliang1:{ audio:2, enable:'chooseToUse', filterCard:function(card){ if(get.type(card)!='basic'&&get.type(card)!='equip') return false; return get.color(card)=='black'; }, filter:function(event,player){ return player.num('he',{type:['basic','equip'],color:'black'}) }, position:'he', viewAs:{name:'bingliang'}, prompt:'将一黑色的基本牌或装备牌当兵粮寸断使用', check:function(card){return 6-ai.get.value(card)}, ai:{ order:9 } }, duanliang2:{ mod:{ targetInRange:function(card,player,target){ if(card.name=='bingliang'){ if(get.distance(player,target)<=2) return true; } } } }, haoshi:{ audio:2, trigger:{player:'phaseDrawBegin'}, threaten:1.4, check:function(event,player){ if(player.num('h')<=1) return true; var min=[]; var temp=player.next.num('h'); var players=game.filterPlayer(); for(var i=0;i0) return true; } return false; }, content:function(){ trigger.num+=2; player.addSkill('haoshi2'); }, ai:{ threaten:2, ai:{ noh:true, skillTagFilter:function(player,tag){ if(tag=='noh'){ if(player.num('h')!=2) return false; } } } } }, haoshi2:{ trigger:{player:'phaseDrawEnd'}, forced:true, popup:false, audio:false, content:function(){ "step 0" player.removeSkill('haoshi2'); if(player.num('h')<=5){ event.finish(); return; } player.chooseCardTarget({ selectCard:Math.floor(player.num('h')/2), filterTarget:function(card,player,target){ return target.isFewestHandcard(); }, forced:true, ai2:function(target){ return ai.get.attitude(_status.event.player,target); } }); "step 1" if(result.targets&&result.targets[0]){ result.targets[0].gain(result.cards,player); player.$give(result.cards.length,result.targets[0]); } } }, dimeng:{ audio:2, enable:'phaseUse', usable:1, position:'he', filterCard:function(){ if(ui.selected.targets.length==2) return false; return true; }, selectCard:[0,Infinity], selectTarget:2, complexCard:true, filterTarget:function(card,player,target){ if(player==target) return false; if(ui.selected.targets.length==0) return true; return (Math.abs(ui.selected.targets[0].num('h')-target.num('h'))== ui.selected.cards.length); }, multitarget:true, multiline:true, content:function(){ 'step 0' event.cards0=targets[0].get('h'); event.cards1=targets[1].get('h'); targets[0].lose(event.cards0,ui.special); targets[1].lose(event.cards1,ui.special); 'step 1' targets[0].gain(event.cards1,targets[1]); targets[1].gain(event.cards0,targets[0]); targets[0].$give(event.cards0.length,targets[1]); targets[1].$give(event.cards1.length,targets[0]); }, check:function(card){ var list=[],player=_status.event.player; var num=player.num('he'); var count; var players=game.filterPlayer(); for(var i=0;i3) list.push(players[i]); } list.sort(function(a,b){ return a.num('h')-b.num('h'); }); if(list.length==0) return -1; var from=list[0]; list.length=0; for(var i=0;i=list[0].num('h')) return -1; for(var i=0;i=2) return -1; if(ui.selected.cards.length3) list.push(players[i]); } list.sort(function(a,b){ return a.num('h')-b.num('h'); }); if(target==list[0]) return ai.get.attitude(player,target); return -ai.get.attitude(player,target); } else{ var from=ui.selected.targets[0]; for(var i=0;i=list[0].num('h')) return -ai.get.attitude(player,target); for(var i=0;i=2) return -ai.get.attitude(player,target); if(target==list[i]) return ai.get.attitude(player,target); return -ai.get.attitude(player,target); } } } } } } }, yinghun:{ audio:2, audioname:['sunce'], trigger:{player:'phaseBegin'}, filter:function(event,player){ return player.hp0){ return 10+ai.get.attitude(_status.event.player,target); } if(player.maxHp-player.hp==1){ return -1; } return 1; }); "step 1" if(result.bool){ event.num=player.maxHp-player.hp; if(player.num('e')>=player.hp){ event.num=player.maxHp; } player.logSkill('yinghun',result.targets); event.target=result.targets[0]; if(event.num==1){ event.directcontrol=true; } else{ var str1='摸'+get.cnNumber(event.num,true)+'弃一'; var str2='摸一弃'+get.cnNumber(event.num,true); player.chooseControl(str1,str2,function(event,player){ return _status.event.choice; }).set('choice',ai.get.attitude(player,event.target)>0?str1:str2); event.str=str1; } } else{ event.finish(); } "step 2" if(event.directcontrol||result.control==event.str){ event.target.draw(event.num); event.target.chooseToDiscard(true,'he'); } else{ event.target.draw(); event.target.chooseToDiscard(event.num,true,'he'); } }, ai:{ threaten:function(player,target){ if(target.hp==1||target.num('e')>=target.hp) return 2; if(target.hp==target.maxHp) return 0.5; if(target.hp==2) return 1.5; return 0.5; }, maixie:true, effect:{ target:function(card,player,target){ if(target.maxHp<=3) return; if(get.tag(card,'damage')){ if(target.hp==target.maxHp) return [0,1]; } if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; } } } }, gzyinghun:{ audio:'yinghun', audioname:['sunce'], trigger:{player:'phaseBegin'}, filter:function(event,player){ return player.hp0){ return 10+ai.get.attitude(_status.event.player,target); } if(player.maxHp-player.hp==1){ return -1; } return 1; }); "step 1" if(result.bool){ event.num=player.maxHp-player.hp; player.logSkill(event.name,result.targets); event.target=result.targets[0]; if(event.num==1){ event.directcontrol=true; } else{ var str1='摸'+get.cnNumber(event.num,true)+'弃一'; var str2='摸一弃'+get.cnNumber(event.num,true); player.chooseControl(str1,str2,function(event,player){ return _status.event.choice; }).set('choice',ai.get.attitude(player,event.target)>0?str1:str2); event.str=str1; } } else{ event.finish(); } "step 2" if(event.directcontrol||result.control==event.str){ event.target.draw(event.num); event.target.chooseToDiscard(true,'he'); } else{ event.target.draw(); event.target.chooseToDiscard(event.num,true,'he'); } }, ai:{ threaten:function(player,target){ if(target.hp==target.maxHp) return 0.5; if(target.hp==1) return 2; if(target.hp==2) return 1.5; return 0.5; }, maixie:true, effect:{ target:function(card,player,target){ if(target.maxHp<=3) return; if(get.tag(card,'damage')){ if(target.hp==target.maxHp) return [0,1]; } if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; } } } }, jiuchi:{ audio:2, enable:'chooseToUse', filterCard:function(card){ return get.suit(card)=='spade'; }, viewAs:{name:'jiu'}, viewAsFilter:function(player){ if(!player.num('h',{suit:'spade'})) return false; }, prompt:'将一张黑桃手牌当酒使用', check:function(card){ if(_status.event.type=='dying') return 1; return 4-ai.get.value(card); }, ai:{ skillTagFilter:function(player){ return player.num('h',{suit:'spade'})>0&&player.hp<=0; }, threaten:1.5, save:true, } }, roulin:{ audio:2, trigger:{player:'shaBegin',target:'shaBegin'}, forced:true, filter:function(event,player){ if(event.directHit) return false; if(player==event.player){ return event.target.sex=='female'; } return event.player.sex=='female'; }, check:function(event,player){ return player==event.player; }, content:function(){ "step 0" var next=trigger.target.chooseToRespond({name:'shan'}); next.autochoose=lib.filter.autoRespondShan; next.ai=function(card){ if(trigger.target.num('h','shan')>1){ return ai.get.unuseful2(card); } return -1; }; "step 1" if(result.bool==false){ trigger.untrigger(); trigger.directHit=true; } } }, benghuai:{ audio:4, trigger:{player:'phaseEnd'}, forced:true, check:function(){ return false; }, filter:function(event,player){ return !player.isLowestHp(); }, content:function(){ "step 0" player.chooseControl('baonue_hp','baonue_maxHp',function(event,player){ if(player.hp==player.maxHp) return 'baonue_hp'; if(player.hp0); } else{ event.finish(); } 'step 2' if(result.bool){ player.logSkill('baonue',event.current); player.judge(function(card){ if(get.suit(card)=='spade') return 4; return 0; }); } else{ event.goto(1); } 'step 3' if(result.suit=='spade'){ event.current.recover(); } event.goto(1); } }, luanwu:{ audio:2, unique:true, enable:'phaseUse', filter:function(event,player){ return !player.storage.luanwu; }, init:function(player){ player.storage.luanwu=false; }, mark:true, intro:{ content:'limited' }, skillAnimation:'epic', animationColor:'thunder', filterTarget:function(card,player,target){ return target!=player; }, selectTarget:-1, multitarget:true, multiline:true, content:function(){ "step 0" player.unmarkSkill('luanwu') player.storage.luanwu=true; event.current=player.next; "step 1" event.current.animate('target'); event.current.chooseToUse('乱舞:使用一张杀或流失一点体力',{name:'sha'},function(card,player,target){ if(player==target) return false; if(!player.canUse('sha',target)) return false; if(get.distance(player,target)<=1) return true; if(game.hasPlayer(function(current){ return current!=player&&get.distance(player,current)0) att=1; if(att<0) att=-1; if(players[i]!=player&&players[i].hp<=3){ if(players[i].num('h')==0) num+=att/players[i].hp; else if(players[i].num('h')==1) num+=att/2/players[i].hp; else if(players[i].num('h')==2) num+=att/4/players[i].hp; } if(players[i].hp==1) num+=att*1.5; } if(player.hp==1){ return -num; } if(player.hp==2){ return -game.players.length/4-num; } return -game.players.length/3-num; } } } }, wansha:{ locked:true, global:'wansha2' }, wansha2:{ mod:{ cardSavable:function(card,player){ if(!_status.currentPhase) return; if(_status.currentPhase.get('s').contains('wansha')&&_status.currentPhase!=player){ if(card.name=='tao'&&_status.event.dying!=player) return false; } } } }, weimu:{ mod:{ targetEnabled:function(card){ if((get.type(card)=='trick'||get.type(card)=='delay')&& get.color(card)=='black') return false; } } }, huoji:{ audio:2, enable:'chooseToUse', filterCard:function(card){ return get.color(card)=='red'; }, viewAs:{name:'huogong',nature:'fire'}, viewAsFilter:function(player){ if(!player.num('h',{color:'red'})) return false; }, prompt:'将一张红色牌当火攻使用', check:function(card){ var player=_status.currentPhase; if(player.num('h')>player.hp){ return 6-ai.get.value(card); } return 4-ai.get.value(card) } }, bazhen:{ audio:2, inherit:'bagua_skill', filter:function(event,player){ if(!event.filterCard({name:'shan'})) return false; if(event.getParent().player.num('s','unequip')) return false; if(player.get('e','2')) return false; return true; }, ai:{ effect:{ target:function(card,player,target){ if(player==target&&get.subtype(card)=='equip2'){ if(ai.get.equipValue(card)<=8) return 0; } if(target.get('e','2')) return; if(player.hasSkill('unequip')) return; if(get.tag(card,'respondShan')) return [0.5,0]; } } } }, kanpo:{ audio:2, 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 }, lianhuan:{ group:['lianhuan1','lianhuan2'] }, lianhuan1:{ audio:2, enable:'phaseUse', filter:function(event,player){ return player.num('h',{suit:'club'})>0; }, filterCard:function(card){ return get.suit(card)=='club'; }, viewAs:{name:'tiesuo'}, prompt:'将一张梅花牌当铁锁连环使用', check:function(card){return 4-ai.get.value(card)} }, lianhuan2:{ audio:2, enable:'phaseUse', filter:function(event,player){ return player.num('h',{suit:'club'})>0; }, filterCard:function(card){ return get.suit(card)=='club'; }, check:function(card){ return 5-ai.get.useful(card); }, content:function(){ player.draw(); }, discard:false, prompt:'将一张梅花牌置入弃牌堆并摸一张牌', delay:0.5, prepare:function(cards,player){ player.$throw(cards,1000); }, ai:{ basic:{ order:1 }, result:{ player:1, }, } }, niepan:{ audio:2, unique:true, enable:'chooseToUse', mark:true, skillAnimation:true, animationStr:'涅盘', animationColor:'fire', init:function(player){ player.storage.niepan=false; }, filter:function(event,player){ if(player.storage.niepan) return false; if(event.type=='dying'){ if(player!=event.dying) return false; return true; } else if(event.parent.name=='phaseUse'){ return true; } return false; }, content:function(){ 'step 0' player.hp=Math.min(3,player.maxHp); player.discard(player.get('hej')); player.draw(3); player.awakenSkill('niepan'); player.storage.niepan=true; 'step 1' player.link(false); 'step 2' player.turnOver(false); }, ai:{ order:1, skillTagFilter:function(player){ if(player.storage.niepan) return false; if(player.hp>0) return false; }, save:true, result:{ player:function(player){ if(player.hp==0) return 10; if(player.hp<=2&&player.num('he')<=1) return 10; return 0; } }, threaten:function(player,target){ if(!target.storage.niepan) return 0.6; } }, intro:{ content:'limited' } }, oldniepan:{ audio:'niepan', unique:true, enable:'chooseToUse', mark:true, skillAnimation:true, animationStr:'涅盘', animationColor:'fire', init:function(player){ player.storage.oldniepan=false; }, filter:function(event,player){ if(player.storage.oldniepan) return false; if(event.type=='dying'){ if(player!=event.dying) return false; return true; } return false; }, content:function(){ 'step 0' player.hp=Math.min(3,player.maxHp); player.discard(player.get('hej')); player.draw(3); player.awakenSkill('oldniepan'); player.storage.oldniepan=true; 'step 1' player.link(false); 'step 2' player.turnOver(false); }, ai:{ order:1, skillTagFilter:function(player){ if(player.storage.oldniepan) return false; if(player.hp>0) return false; }, save:true, result:{ player:function(player){ if(player.hp==0) return 10; if(player.hp<=2&&player.num('he')<=1) return 10; return 0; } }, threaten:function(player,target){ if(!target.storage.oldniepan) return 0.6; } }, intro:{ content:'limited' } }, quhu:{ audio:2, enable:'phaseUse', usable:1, filter:function(event,player){ if(player.num('h')==0) return false; return game.hasPlayer(function(current){ return current.hp>player.hp&¤t.num('h'); }); }, filterTarget:function(card,player,target){ return target.hp>player.hp&&target.num('h')>0; }, content:function(){ "step 0" player.chooseToCompare(target); "step 1" if(result.bool){ if(game.hasPlayer(function(player){ return player!=target&&get.distance(target,player,'attack')<=1; })){ player.chooseTarget(function(card,player,target){ var source=_status.event.source; return target!=source&&get.distance(source,target,'attack')<=1; },true).set('ai',function(target){ return ai.get.damageEffect(target,_status.event.source,player); }).set('source',target); } else{ event.finish(); } } else{ player.damage(target); event.finish(); } "step 2" if(result.bool&&result.targets&&result.targets.length){ target.line(result.targets[0],'green'); result.targets[0].damage(target); } }, ai:{ order:0.5, result:{ target:function(player,target){ var att=ai.get.attitude(player,target); var oc=(target.num('h')==1); if(att>0&&oc) return 0; var players=game.filterPlayer(); for(var i=0;i0){ return att>0?att/2:att-(oc?5:0); } } } return 0; }, player:function(player,target){ if(target.hasSkill('jueqing')) return -10; var mn=1; var hs=player.get('h'); for(var i=0;i2){ max=Math.max(Math.min(5,players[i].hp)-players[i].num('h'),max); } } switch(max){ case 0:return mn==13?0:-20; case 1:return mn>=12?0:-15; case 2:return 0; case 3:return 1; default:return max; } } }, expose:0.2 } }, jieming:{ audio:2, trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ return event.num>0 }, content:function(){ "step 0" player.chooseTarget(get.prompt('jieming'),[1,trigger.num],function(card,player,target){ return target.num('h')2){ return Math.min(5,target.maxHp)-target.num('h'); } return att/3; }); "step 1" if(result.bool){ player.logSkill('jieming',result.targets); for(var i=0;i1){ if(player.hasSkill('jueqing')) return [1,-2]; var max=0; var players=game.filterPlayer(); for(var i=0;i0){ max=Math.max(Math.min(5,players[i].hp)-players[i].num('h'),max); } } switch(max){ case 0:return 2; case 1:return 1.5; case 2:return [1,2]; default:return [0,max]; } } if((card.name=='tao'||card.name=='caoyao')&& target.hp>1&&target.num('h')<=target.hp) return [0,0]; } }, } }, qiangxi:{ audio:2, enable:'phaseUse', usable:1, filterCard:function(card){ return get.subtype(card)=='equip1'; }, selectCard:[0,1], filterTarget:function(card,player,target){ if(player==target) return false; return get.distance(player,target,'attack')<=1; }, content:function(){ "step 0" if(cards.length==0){ player.loseHp(); } "step 1" target.damage(); }, check:function(card){ return 10-ai.get.value(card); }, position:'he', ai:{ order:8, result:{ player:function(player,target){ if(player.get('e','1')) return 0; if(player.hp>=target.hp) return -0.9; if(player.hp<=2) return -10; return -2; }, target:function(player,target){ if(!player.get('e','1')){ if(player.hp<2) return 0; if(player.hp==2&&target.hp>=2) return 0; if(target.hp>player.hp) return 0; } return ai.get.damageEffect(target,player); } } }, threaten:1.3 }, xinqiangxi:{ audio:'qiangxi', enable:'phaseUse', filter:function(event,player){ if(player.hasSkill('xinqiangxi2')){ return !player.hasSkill('xinqiangxi3'); } else if(player.hasSkill('xinqiangxi3')){ return !player.hasSkill('xinqiangxi2')&&player.num('he',{type:'equip'})>0; } else{ return true; } }, filterCard:function(card){ var player=_status.event.player; if(player.hasSkill('xinqiangxi2')) return false; return get.type(card)=='equip'; }, selectCard:function(){ var player=_status.event.player; if(player.hasSkill('xinqiangxi2')) return -1; if(player.hasSkill('xinqiangxi3')) return [1,1]; return [0,1]; }, filterTarget:function(card,player,target){ if(player==target) return false; return get.distance(player,target,'attack')<=1; }, content:function(){ "step 0" if(cards.length==0){ player.loseHp(); player.addTempSkill('xinqiangxi3','phaseAfter'); } else{ player.addTempSkill('xinqiangxi2','phaseAfter'); } "step 1" target.damage(); }, check:function(card){ return 10-ai.get.value(card); }, position:'he', ai:{ order:8.5, result:{ target:function(player,target){ if(player.hasSkill('xinqiangxi2')||!player.num('he',{type:'equip'})){ if(player.hp<2) return 0; if(target.hp>=player.hp) return 0; } return ai.get.damageEffect(target,player); } } }, threaten:1.5 }, xinqiangxi2:{}, xinqiangxi3:{}, tianyi:{ 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.addTempSkill('tianyi2','phaseAfter'); } else{ player.addTempSkill('tianyi3','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 ai.get.order({name:'sha'})-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 } }, tianyi2:{ 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]++; }, cardUsable:function(card,player,num){ if(card.name=='sha') return num+1; } }, }, tianyi3:{ mod:{ cardEnabled:function(card){if(card.name=='sha') return false} } }, shuangxiong:{ audio:true, trigger:{player:'phaseDrawBefore'}, check:function(event,player){ if(player.num('h')>player.hp) return true; if(player.num('h')>3) return true; return false; }, content:function(){ "step 0" player.judge(ui.special); "step 1" player.gain(result.card); player.$gain2(result.card); player.addTempSkill('shuangxiong2','phaseAfter'); player.storage.shuangxiong=get.color(result.card); trigger.untrigger(); trigger.finish(); } }, shuangxiong2:{ audio:true, enable:'phaseUse', viewAs:{name:'juedou'}, filterCard:function(card,player){ return get.color(card)!=player.storage.shuangxiong; }, check:function(card){ return 6-ai.get.value(card); }, ai:{ basic:{ order:10 } } }, luanji:{ audio:2, enable:'phaseUse', viewAs:{name:'wanjian'}, filterCard:function(card,player){ if(ui.selected.cards.length){ return get.suit(card)==get.suit(ui.selected.cards[0]); } var cards=player.get('h'); for(var i=0;i0; }, check:function(event,player){ return ai.get.attitude(player,event.target)<0; }, content:function(){ player.discardPlayerCard('he',trigger.target,true); } }, jiewei:{ trigger:{player:'turnOverEnd'}, direct:true, audio:2, content:function(){ 'step 0' player.chooseToUse(function(card){ if(!lib.filter.cardEnabled(card,_status.event.player,_status.event)){ return false; } var type=get.type(card,'trick'); return type=='trick'||type=='equip'; },'是否使用一张锦囊牌或装备牌?').set('logSkill','jiewei'); 'step 1' if(result.bool){ var type=get.type(result.card||result.cards[0]); if(game.hasPlayer(function(current){ if(type=='equip'){ return current.num('e'); } else{ return current.num('j'); } })){ var next=player.chooseTarget('是否弃置场上的一张'+get.translation(type)+'牌?',function(card,player,target){ if(_status.event.type=='equip'){ return target.num('e')>0; } else{ return target.num('j')>0; } }); next.set('ai',function(target){ if(type=='equip'){ return -ai.get.attitude(player,target); } else{ return ai.get.attitude(player,target); } }); next.set('type',type); event.type=type; } else{ event.finish(); } } else{ event.finish(); } 'step 2' if(event.type&&result.bool&&result.targets&&result.targets.length){ player.line(result.targets,'green'); if(event.type=='equip'){ player.discardPlayerCard(result.targets[0],'e',true); } else{ player.discardPlayerCard(result.targets[0],'j',true); } } } }, releiji:{ audio:2, trigger:{player:'respond'}, filter:function(event,player){ return event.card.name=='shan'; }, direct:true, content:function(){ "step 0"; player.chooseTarget(get.prompt('releiji')).ai=function(target){ if(target.hasSkill('hongyan')) return 0; return ai.get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); }; "step 1" if(result.bool){ player.logSkill('releiji',result.targets,'thunder'); event.target=result.targets[0]; event.target.judge(function(card){ var suit=get.suit(card); if(suit=='spade') return -4; if(suit=='club') return -2; return 0; }); } else{ event.finish(); } "step 2" if(result.suit=='club'){ event.target.damage('thunder'); player.recover(); } else if(result.suit=='spade'){ event.target.damage(2,'thunder'); } }, ai:{ effect:{ target:function(card,player,target,current){ if(get.tag(card,'respondShan')){ var hastarget=game.hasPlayer(function(current){ return ai.get.attitude(target,current)<0; }); var be=target.num('e',{color:'black'}); if(target.num('h','shan')&&be){ if(!target.hasSkill('guidao')) return 0; return [0,hastarget?target.num('he')/2:0]; } if(target.num('h','shan')&&target.num('h')>2){ if(!target.hasSkill('guidao')) return 0; return [0,hastarget?target.num('h')/4:0]; } if(target.num('h')>3||(be&&target.num('h')>=2)){ return [0,0]; } if(target.num('h')==0){ return [1.5,0]; } if(target.num('h')==1&&!be){ return [1.2,0]; } if(!target.hasSkill('guidao')) return [1,0.05]; return [1,Math.min(0.5,(target.num('h')+be)/4)]; } } } } }, shensu:{ group:['shensu1','shensu2'] }, xinshensu:{ group:['shensu1','shensu2','shensu4'] }, shensu1:{ audio:2, trigger:{player:'phaseBegin'}, direct:true, content:function(){ "step 0" var check= player.num('h')>2; player.chooseTarget(get.prompt('shensu'),function(card,player,target){ if(player==target) return false; return player.canUse({name:'sha'},target,false); }).set('check',check).set('ai',function(target){ if(!_status.event.check) return 0; return ai.get.effect(target,{name:'sha'},_status.event.player); }); "step 1" if(result.bool){ player.logSkill('shensu1',result.targets); player.useCard({name:'sha'},result.targets[0],false); player.skip('phaseJudge'); player.skip('phaseDraw'); } } }, shensu2:{ audio:2, trigger:{player:'phaseUseBefore'}, direct:true, filter:function(event,player){ return player.num('he',{type:'equip'})>0; }, content:function(){ "step 0" var check=player.needsToDiscard(); player.chooseCardTarget({ prompt:get.prompt('shensu'), filterCard:function(card,player){ return get.type(card)=='equip'&&lib.filter.cardDiscardable(card,player) }, position:'he', filterTarget:function(card,player,target){ if(player==target) return false; return player.canUse({name:'sha'},target,false); }, ai1:function(card){ if(_status.event.check) return 0; return 6-ai.get.value(card); }, ai2:function(target){ if(_status.event.check) return 0; return ai.get.effect(target,{name:'sha'},_status.event.player); }, check:check }); "step 1" if(result.bool){ player.logSkill('shensu2',result.targets); player.discard(result.cards[0]); player.useCard({name:'sha'},result.targets[0]); trigger.untrigger(); trigger.finish(); } } }, shensu4:{ audio:'shensu1', trigger:{player:'phaseDiscardBefore'}, direct:true, content:function(){ "step 0" var check=player.needsToDiscard()||player.isTurnedOver(); player.chooseTarget(get.prompt('shensu'),function(card,player,target){ if(player==target) return false; return player.canUse({name:'sha'},target,false); }).set('check',check).set('ai',function(target){ if(!_status.event.check) return 0; return ai.get.effect(target,{name:'sha'},_status.event.player); }); "step 1" if(result.bool){ player.logSkill('shensu4',result.targets); player.turnOver(); player.useCard({name:'sha'},result.targets[0],false); trigger.untrigger(); trigger.finish(); } } }, jushou:{ audio:true, trigger:{player:'phaseEnd'}, content:function(){ player.draw(3); player.turnOver(); }, ai:{ effect:{ target:function(card,player,target){ if(card.name=='guiyoujie') return [0,1]; } } }, }, liegong:{ audio:2, trigger:{player:'shaBegin'}, check:function(event,player){ return ai.get.attitude(player,event.target)<=0; }, logTarget:'target', filter:function(event,player){ var length=event.target.num('h'); return (length>=player.hp||length<=player.getAttackRange()); }, content:function(){ trigger.directHit=true; }, mod:{ attackFrom:function(from,to,distance){ if(get.zhu(from,'shouyue')) return distance-1; } } }, kuanggu:{ audio:2, trigger:{source:'damageEnd'}, forced:true, filter:function(event,player){ return get.distance(player,event.player)<=1&&player.isDamaged(); }, content:function(){ player.recover(trigger.num); } }, tianxiang:{ audio:2, trigger:{player:'damageBefore'}, direct:true, filter:function(event,player){ return player.num('h',{suit:'heart'})>0&&event.num>0; }, content:function(){ "step 0" player.chooseCardTarget({ filterCard:function(card,player){ return get.suit(card)=='heart'&&lib.filter.cardDiscardable(card,player); }, filterTarget:function(card,player,target){ return player!=target; }, ai1:function(card){ return 10-ai.get.value(card); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); var trigger=_status.event.getTrigger(); var da=0; if(_status.event.player.hp==1){ da=10; } if(trigger.num>1){ if(target.maxHp>5&&target.hp>1) return -att/10+da; return -att+da; } var eff=ai.get.damageEffect(target,trigger.source,target,trigger.nature); if(att==0) return 0.1+da; if(eff>=0&&trigger.num==1){ return att+da; } if(target.hp==target.maxHp) return -att+da; if(target.hp==1){ if(target.maxHp<=4&&!target.hasSkillTag('maixie')){ if(target.maxHp<=3){ return -att+da; } return -att/2+da; } return da; } if(target.hp==target.maxHp-1){ if(target.hp>2||target.hasSkillTag('maixie')) return att/5+da; if(att>0) return 0.02+da; return 0.05+da; } return att/2+da; }, prompt:get.prompt('tianxiang') }); "step 1" if(result.bool){ player.logSkill(event.name,result.targets); trigger.untrigger(); trigger.player=result.targets[0]; trigger.player.addSkill('tianxiang2'); player.discard(result.cards[0]); } else{ event.finish(); } "step 2" trigger.trigger('damageBefore'); }, ai:{ effect:{ target:function(card,player,target){ if(player.hasSkill('jueqing')) return; if(get.tag(card,'damage')&&target.num('h')>1) return 0.7; } }, threaten:function(player,target){ if(target.num('h')==0) return 2; } } }, tianxiang2:{ trigger:{player:['damageAfter','damageCancelled']}, forced:true, popup:false, audio:false, content:function(){ if(player.hp0&&event.num>0&&!player.hasSkill('xintianxiang3'); }, content:function(){ "step 0" player.chooseCardTarget({ filterCard:function(card,player){ return get.suit(card)=='heart'&&lib.filter.cardDiscardable(card,player); }, filterTarget:function(card,player,target){ return player!=target; }, position:'he', ai1:function(card){ return 10-ai.get.value(card); }, ai2:function(target){ var att=ai.get.attitude(_status.event.player,target); var trigger=_status.event.getTrigger(); var da=0; if(_status.event.player.hp==1){ da=10; } if(trigger.num>1){ if(target.maxHp>5&&target.hp>1) return -att/10+da; return -att+da; } var eff=ai.get.damageEffect(target,trigger.source,target,trigger.nature); if(att==0) return 0.1+da; if(eff>=0&&trigger.num==1){ return att+da; } if(target.hp==target.maxHp) return -att+da; if(target.hp==1){ if(target.maxHp<=4&&!target.hasSkillTag('maixie')){ if(target.maxHp<=3){ return -att+da; } return -att/2+da; } return da; } if(target.hp==target.maxHp-1){ if(target.hp>2||target.hasSkillTag('maixie')) return att/5+da; if(att>0) return 0.02+da; return 0.05+da; } return att/2+da; }, prompt:get.prompt('tianxiang') }); "step 1" if(result.bool){ player.logSkill(event.name,result.targets); trigger.untrigger(); trigger.player=result.targets[0]; trigger.player.addSkill('xintianxiang2'); trigger.player.storage.xintianxiang=player; player.discard(result.cards[0]); } else{ event.finish(); } "step 2" trigger.trigger('damageBefore'); }, ai:{ effect:{ target:function(card,player,target){ if(player.hasSkill('jueqing')) return; if(get.tag(card,'damage')&&target.num('he')>1) return 0.7; } }, } }, xintianxiang2:{ trigger:{player:['damageAfter','damageCancelled']}, forced:true, popup:false, audio:false, content:function(){ 'step 0' var source=player.storage.xintianxiang; if(source.isDead()){ event.finish(); return; } var num=player.maxHp-player.hp; var str1='令'+get.translation(player)+'摸'+get.cnNumber(num)+'张牌'; var str2='令'+get.translation(player)+'防止造成和受到的所有伤害且天香失效直到你下一回合开始'; var att=ai.get.attitude(source,player); var choice='选项一'; if(att<0){ if(num>=2){ choice='选项二'; } } else if(att>0){ if(num<2&&!player.hasSkillTag('maixie')){ choice='选项二'; } } source.chooseControl(function(){ return _status.event.choice; }).set('choiceList',[str1,str2]).set('choice',choice); 'step 1' if(result.control=='选项一'){ if(player.isDamaged()){ player.draw(player.maxHp-player.hp); } } else{ player.storage.xintianxiang.addSkill('xintianxiang3'); player.storage.xintianxiang.storage.xintianxiang3=player; player.addSkill('xintianxiang4'); } player.removeSkill('xintianxiang2'); delete player.storage.xintianxiang; } }, xintianxiang3:{ trigger:{player:['phaseBegin','dieBegin']}, forced:true, popup:false, silent:true, content:function(){ if(player.storage.xintianxiang3){ player.storage.xintianxiang3.removeSkill('xintianxiang4'); delete player.storage.xintianxiang3; } player.removeSkill('xintianxiang3'); } }, xintianxiang4:{ trigger:{source:'damageBefore',player:'damageBefore'}, forced:true, mark:true, intro:{ content:'防止造成和受到的一切伤害' }, priority:15, content:function(){ trigger.untrigger(); trigger.finish(); }, ai:{ nofire:true, nothunder:true, nodamage:true, notrick:true, notricksource:true, effect:{ target:function(card,player,target,current){ if(get.tag(card,'damage')){ return 'zeroplayertarget'; } }, player:function(card,player,target,current){ if(get.tag(card,'damage')){ return 'zeroplayertarget'; } } } } }, hongyan:{ mod:{ suit:function(card,suit){ if(suit=='spade') return 'heart'; } } }, gzbuqu:{ audio:'buqu', trigger:{player:'changeHp'}, filter:function(event,player){ return player.hp<=0&&event.num<0; }, init:function(player){ player.storage.gzbuqu=[]; }, priority:-15, intro:{ content:'cards' }, group:'gzbuqu_recover', locked:true, frequent:true, ondisable:true, onremove:function(player){ if(player.storage.gzbuqu.length){ delete player.nodying; player.hp=1-player.storage.gzbuqu.length; game.log(player,'移去了不屈牌',player.storage.gzbuqu); while(player.storage.gzbuqu.length){ ui.discardPile.appendChild(player.storage.gzbuqu.shift()); } player.unmarkSkill('gzbuqu'); player.dying({}); } }, process:function(player){ delete player.nodying; player.markSkill('gzbuqu'); player.syncStorage('gzbuqu'); var nums=[]; var cards=player.storage.gzbuqu; for(var i=0;i0&&event.num>0; }, forced:true, popup:false, content:function(){ 'step 0' if(player.hp>=player.storage.gzbuqu.length){ player.hp-=player.storage.gzbuqu.length-1; player.update(); while(player.storage.gzbuqu.length){ ui.discardPile.appendChild(player.storage.gzbuqu.shift()); } player.unmarkSkill('gzbuqu'); delete player.nodying; event.finish(); } else{ player.chooseCardButton('移去'+get.cnNumber(player.hp)+'张不屈牌',true,player.hp,player.storage.gzbuqu).set('ai',function(button){ var buttons=get.selectableButtons(); for(var i=0;i0&&player.hp<=0}, content:function(){ "step 0" event.card=get.cards()[0]; if(player.storage.buqu==undefined) player.storage.buqu=[]; player.storage.buqu.push(event.card); player.syncStorage('buqu'); player.showCards(player.storage.buqu,'不屈') player.markSkill('buqu'); "step 1" for(var i=0;i2; }, content:function(){ "step 0" player.line(trigger.player,'green'); player.loseHp(); "step 1" trigger.player.draw(2); }, }, leiji:{ audio:2, trigger:{player:'respond'}, filter:function(event,player){ return event.card.name=='shan'; }, direct:true, content:function(){ "step 0"; player.chooseTarget(get.prompt('leiji')).ai=function(target){ if(target.hasSkill('hongyan')) return 0; return ai.get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); }; "step 1" if(result.bool){ player.logSkill('leiji',result.targets,'thunder'); event.target=result.targets[0]; event.target.judge(function(card){ if(get.suit(card)=='spade') return -4; return 0; }); } else{ event.finish(); } "step 2" if(result.bool==false){ event.target.damage(2,'thunder'); } }, ai:{ mingzhi:false, effect:{ target:function(card,player,target,current){ if(get.tag(card,'respondShan')){ var hastarget=game.hasPlayer(function(current){ return ai.get.attitude(target,current)<0; }); if(target.num('h','shan')&&target.num('e',{suit:'spade'})){ return [0,hastarget?target.num('he')/2:0]; } if(target.num('h','shan')){ return [1,hastarget?target.num('he')/2:0]; } return [1,target.num('h')/4]; } } } } }, guidao:{ audio:2, trigger:{global:'judge'}, filter:function(event,player){ return player.num('he',{color:'black'})>0; }, direct:true, content:function(){ "step 0" player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+ get.translation(trigger.player.judging[0])+','+get.prompt('guidao'),'he',function(card){ return get.color(card)=='black'; }).set('ai',function(card){ var trigger=_status.event.getTrigger(); var player=_status.event.player; var judging=_status.event.judging; var result=trigger.judge(card)-trigger.judge(judging); var attitude=ai.get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ return result; } else{ return -result; } }).set('judging',trigger.player.judging[0]); "step 1" if(result.bool){ player.respond(result.cards,'highlight'); } else{ event.finish(); } "step 2" if(result.bool){ player.logSkill('guidao'); player.$gain2(trigger.player.judging[0]); player.gain(trigger.player.judging[0]); trigger.player.judging[0]=result.cards[0]; if(!get.owner(result.cards[0],'judge')){ trigger.position.appendChild(result.cards[0]); } game.log(trigger.player,'的判定牌改为',result.cards[0]); } "step 3" game.delay(2); }, ai:{ tag:{ rejudge:1 } } }, guhuo:{ enable:'phaseUse', usable:1, audio:2, filter:function(event,player){ return player.num('h')>0 }, chooseButton:{ dialog:function(){ var list=['sha','tao','jiu','taoyuan','wugu','juedou','huogong','jiedao','tiesuo','guohe','shunshou','wuzhong','wanjian','nanman']; for(var i=0;i=3&&player.hp>=3) return 0; for(var i=0;i