'use strict'; game.import('character',function(lib,game,ui,get,ai,_status){ return { name:'tw', connect:true, characterSort:{ tw:{ tw_mobile:['tw_beimihu','nashime','tw_gexuan','tw_dongzhao','jiachong','duosidawang','wuban','yuejiu','tw_fuwan','tw_yujin','tw_zhaoxiang','tw_hucheer','tw_hejin','tw_mayunlu','tw_re_caohong'], tw_yijiang:['tw_caoang','tw_caohong','tw_zumao','tw_dingfeng','tw_maliang','tw_xiahouba'], tw_english:['kaisa'], }, }, character:{ tw_re_caohong:['male','wei',4,['twyuanhu','twjuezhu']], tw_mayunlu:['female','shu',4,['mashu','twfengpo']], tw_hejin:['male','qun',4,['twmouzhu','twyanhuo']], tw_hucheer:['male','qun',4,['twshenxing','twdaoji']], tw_yujin:['male','qun',4,['xinzhenjun']], tw_fuwan:['male','qun',4,['twmoukui']], tw_zhaoxiang:['female','shu',4,['refanghun','twfuhan','twqueshi']], yuejiu:['male','qun',4,['cuijin']], wuban:['male','shu',4,['jintao']], duosidawang:['male','qun','4/5',['equan','manji']], jiachong:['male','qun',3,['beini','dingfa']], tw_dongzhao:['male','wei',3,['twmiaolve','twyingjia']], tw_gexuan:['male','qun',3,['twdanfa','twlingbao','twsidao']], tw_beimihu:['female','qun',3,['zongkui','guju','baijia','bingzhao'],['zhu']], nashime:['male','qun',3,['chijie','waishi','renshe']], tw_xiahouba:['male','shu',4,['twyanqin','twbaobian']], tw_zumao:['male','wu',4,['twtijin']], tw_caoang:['male','wei',4,['twxiaolian']], tw_dingfeng:['male','wu',4,['twqijia','twzhuchen']], tw_caohong:['male','wei',4,['twhuzhu','twliancai']], tw_maliang:['male','shu',3,['twrangyi','twbaimei']], kaisa:["male","western",4,["zhengfu"]], }, characterIntro:{ nashime:'难升米(なしめ,或なんしょうまい)是倭国大夫。景初二年六月,受女王卑弥呼之命,与都市牛利出使魏国,被魏国拜为率善中郎将。', jiachong:'贾充(217年—282年),字公闾,平阳襄陵(今山西襄汾)人,三国曹魏至西晋时期大臣,曹魏豫州刺史贾逵之子。西晋王朝的开国元勋。出身平阳贾氏。曾参与镇压淮南二叛和弑杀魏帝曹髦,因此深得司马氏信任,其女儿贾褒(一名荃)及贾南风分别嫁予司马炎弟司马攸及次子司马衷,与司马氏结为姻亲,地位显赫。晋朝建立后,转任车骑将军、散骑常侍、尚书仆射,后升任司空、太尉等要职。更封鲁郡公。咸宁末,为使持节、假黄钺、大都督征讨吴国。吴国平定后,增邑八千户。太康三年(282年),贾充去世。西晋朝廷追赠他为太宰,礼官议谥曰荒,司马炎不采纳,改谥为武。有集五卷。', duosidawang:'朵思大王是《三国演义》中人物,南蛮秃龙洞的元帅,孟获弟弟孟优的朋友,据说是南蛮第一智者。', wuban:'吴班,字元雄,生卒年不详,兖州陈留郡(治今河南省开封市)人。三国时期蜀汉将领。为领军,随刘备参加伐吴之战,后又随蜀汉丞相诸葛亮参加北伐曹魏的战争,并于公元231年(建兴九年)的北伐中大破司马懿。官至骠骑将军,封绵竹侯。吴班以豪爽侠义著称于当时,又因族妹吴氏是蜀汉穆皇后,在蜀汉将领中有较高的地位。', yuejiu:'乐就(?-197),在袁术为攻徐州而大兴七军之际,以督战官之身份担任联络之役。但是,袁术军不幸战败,其也在寿春被曹操军逮捕并遭到斩首。', }, card:{ dz_mantianguohai:{ fullskin:true, type:'trick', enable:true, derivation:'tw_dongzhao', global:['dz_mantianguohai'], selectTarget:[1,2], filterTarget:function(card,player,target){ return target!=player&&target.countCards('hej')>0; }, content:function(){ player.gainPlayerCard(target,'hej',true); }, contentAfter:function(){ 'step 0' var evtx=event.getParent(); event.targets=targets.filter(function(target){ return target.getHistory('lose',function(evt){ return evt.getParent(3).name==''&&evt.getParent(4)==evtx; }) }); if(!event.targets.length||!player.countCards('he')) event.finish(); 'step 1' var target=targets.shift(); event.target=target; var next=player.chooseCard('he',true,'交给'+get.translation(target)+'一张牌'); if(player.hasSkill('twyingjia')&&player.countUsed('dz_mantianguohai')==1) next.set('ai',function(card){ if(card.name=='dz_mantianguohai') return -10; return -get.value(card,_status.event.getParent().target); }); 'step 2' if(result.bool){ target.gain(result.cards,player,'giveAuto'); } 'step 3' if(targets.length&&player.countCards('h')>0) event.goto(1); }, ai:{ order:6, tag:{ lose:1, loseCard:1, }, result:{ target:-0.1, }, }, }, gx_lingbaoxianhu:{ fullskin:true, type:'equip', subtype:'equip1', derivation:'tw_gexuan', distance:{attackFrom:-2}, ai:{ basic:{ equipValue:4.5, } }, skills:['gx_lingbaoxianhu'] }, gx_taijifuchen:{ fullskin:true, type:'equip', subtype:'equip1', derivation:'tw_gexuan', distance:{attackFrom:-4}, ai:{ basic:{ equipValue:4.5, } }, skills:['gx_taijifuchen'] }, gx_chongyingshenfu:{ fullskin:true, type:'equip', subtype:'equip2', derivation:'tw_gexuan', ai:{ basic:{ equipValue:7, } }, skills:['gx_chongyingshenfu'], loseDelay:false, }, meiyingqiang:{ fullskin:true, type:'equip', subtype:'equip1', cardimage:'yinyueqiang', derivation:'tw_zhaoxiang', distance:{attackFrom:-2}, ai:{ basic:{ equipValue:4.5, } }, skills:['meiyingqiang'], }, }, characterFilter:{ nashime:function(mode){ return mode!='guozhan'; }, tw_xiahouba:function(mode){ return mode!='guozhan'; }, }, skill:{ twyuanhu:{ audio:'yuanhu', enable:'phaseUse', usable:1, filter:function(event,player){ return player.hasCard({type:'equip'},'eh'); }, filterCard:{type:'equip'}, filterTarget:function(card,player,target){ var card=ui.selected.cards[0]; return target.isEmpty(get.subtype(card)); }, discard:false, lose:false, prepare:'give', position:'he', check:function(card){ if(get.position(card)=='h') return 9-get.value(card); return 7-get.value(card); }, content:function(){ 'step 0' target.equip(cards[0]); 'step 1' event.goto(3); switch(get.subtype(cards[0])){ case 'equip1': if(game.hasPlayer(function(current){ return current!=target&&get.distance(target,current)==1&¤t.countCards('hej')>0; })){ player.chooseTarget(true,'弃置一名距离'+get.translation(target)+'为1的角色区域内的一张牌',function(card,player,target){ var current=_status.event.current; return current!=target&&get.distance(current,target)==1&¤t.countCards('hej')>0; }).set('current',target).set('ai',function(target){ var player=_status.event.player; return get.effect(target,{name:'guohe_copy'},player,player); }); event.goto(2); } break; case 'equip2': target.draw(); break; case 'equip3': case 'equip4': case 'equip6': target.recover(); break; } 'step 2' var target=result.targets[0]; player.line(target); player.discardPlayerCard(target,true,'hej'); 'step 3' if(target.hp<=player.hp||target.countCards('h')<=player.countCards('h')){ player.draw(); player.addTempSkill('twyuanhu_end'); } }, ai:{ order:10, result:{ player:function(player,target){ if(get.attitude(player,target)==0) return 0; if(!ui.selected.cards.length) return; var eff=get.effect(target,ui.selected.cards[0],player,player),sub=get.subtype(ui.selected.cards[0],false); if(target==player) eff+=4; else{ var hp=player.hp,hs=player.countCards('h',(card)=>card!=ui.selected.cards[0]); var tp=target.hp,ts=target.countCards('h'); if(sub=='equip2') ts++; if(tpb-a); if(list.length) eff+=list[0]; } return eff; }, target:function(player,target){ if(!ui.selected.cards.length) return 0; var sub=get.subtype(ui.selected.cards[0],false); var eff=get.effect(target,ui.selected.cards[0],player,target); if(sub=='equip2') eff+=(get.effect(target,{name:'wuzhong'},target,target)/2); if(target.isDamaged()&&(sub=='equip3'||sub=='equip4')) eff+=get.recoverEffect(target,player,player); return eff; }, }, }, subSkill:{ end:{ trigger:{player:'phaseJieshuBegin'}, direct:true, charlotte:true, filter:function(event,player){ return player.hasSkill('twyuanhu')&&player.hasCard({type:'equip'},'eh'); }, content:function(){ 'step 0' player.chooseCardTarget({ prompt:get.prompt('twyuanhu'), prompt2:'将一张装备牌置入一名角色的装备区内。若此牌为:武器牌,你弃置与其距离为1的另一名角色区域的一张牌;防具牌,其摸一张牌;坐骑牌,其回复1点体力。若其的体力值或手牌数不大于你,则你可摸一张牌。', filterCard:lib.skill.twyuanhu.filterCard, filterTarget:lib.skill.twyuanhu.filterTarget, position:'he', ai1:lib.skill.twyuanhu.check, ai2:function(target){ var player=_status.event.player; return get.effect(target,'twyuanhu',player,player); }, }); 'step 1' if(result.bool){ result.skill='twyuanhu'; player.useResult(result,event); } }, }, }, }, twjuezhu:{ audio:2, trigger:{player:'phaseZhunbeiBegin'}, direct:true, filter:function(event,player){ return !player.isDisabled('equip3')||!player.isDisabled('equip4'); }, skillAnimation:true, animationColor:'water', content:function(){ 'step 0' player.chooseTarget(get.prompt2('twjuezhu'),[1,2],function(card,player,target){ return !ui.selected.targets.length&&!target.hasSkill('feiying'); }).set('promptbar','none').set('ai',function(target){ if(player.hasUnknown()) return false; return get.attitude(player,target); }); 'step 1' if(result.bool){ event.target=result.targets[0]; var list=[]; if(!player.isDisabled(3)) list.push('equip3'); if(!player.isDisabled(4)) list.push('equip4'); if(list.length==1) event._result={control:list[0]}; else player.chooseControl(list).set('prompt','选择废除一个坐骑栏'); } else event.finish(); 'step 2' player.logSkill('twjuezhu',target); player.awakenSkill('twjuezhu'); player.disableEquip(result.control); target.disableJudge(); player.markAuto('twjuezhu_restore',[[target,result.control]]); player.addSkill('twjuezhu_restore'); target.addSkill('feiying'); }, subSkill:{ restore:{ trigger:{global:'die'}, forced:true, charlotte:true, filter:function(event,player){ for(var i of player.getStorage('twjuezhu_restore')){ if(i[0]==event.player&&player.isDisabled(i[1])) return true; } return false; }, content:function(){ var list=[]; for(var i of player.getStorage('twjuezhu_restore')){ if(i[0]==trigger.player&&player.isDisabled(i[1])) list.add(i[1]); } for(var i of list) player.enableEquip(i); }, }, }, derivation:'feiying', }, twfengpo:{ audio:'fengpo', trigger:{player:'useCardToPlayered'}, logTarget:'target', filter:function(event,player){ return (event.card.name=='sha'||event.card.name=='juedou')&&event.targets.length==1&&event.target.countCards('h')>0; }, onremove:true, content:function(){ 'step 0' event.target=trigger.target; player.viewHandcards(trigger.target); 'step 1' var num=target.countCards('h',player.storage.twfengpo?{color:'red'}:{suit:'diamond'}); if(!num){ event.finish(); return; } event.num=num; player.chooseControl().set('choiceList',[ '摸'+num+'张牌', '令'+get.translation(trigger.card)+'的伤害值基数+'+num, ]); 'step 2' if(result.index==0) player.draw(num); else trigger.getParent().baseDamage+=num; }, group:'twfengpo_kill', subSkill:{ kill:{ trigger:{source:'die'}, forced:true, filter:(event,player)=>!player.storage.twfengpo, skillAnimation:true, animationColor:'fire', content:function(){ player.storage.twfengpo=true; }, }, }, }, twmouzhu:{ audio:'mouzhu', enable:'phaseUse', usable:1, filterTarget:lib.filter.notMe, contentBefore:function(){ var target=targets[0],evt=event.getParent(); evt._target=target; var list=game.filterPlayer(function(current){ return current!=player&¤t!=target&¤t.hp<=player.hp; }); if(!list.length){ player.loseHp(); evt.finish(); } else{ evt.targets=list.sortBySeat(); player.line(list); } }, content:function(){ 'step 0' target.chooseCard('he','是否交给'+get.translation(player)+'一张牌?').set('ai',function(card){ if(_status.event.goon) return 7-get.value(card); return 0; }).set('goon',get.attitude(target,player)>0); 'step 1' if(result.bool){ player.gain(result.cards,target,'giveAuto'); } else{ game.log(target,'拒绝给牌'); } }, contentAfter:function(){ 'step 0' var num=0,par=event.getParent(); player.getHistory('gain',function(evt){ if(evt.getParent(2)==par) num+=evt.cards.length; }); if(!num){ player.loseHp(); for(var i of targets) i.loseHp(); event.finish(); } else{ var target=event.getParent()._target; event.target=target; event.num=num; var bool1=player.canUse('sha',target,false),bool2=player.canUse('juedou',target,false); if(bool1&&bool2) target.chooseControl('sha','juedou').set('prompt','谋诛:视为被'+get.translation(player)+'使用一张…').set('prompt2','(伤害值基数:'+num+')').set('ai',function(){ var target=_status.event.player,player=_status.event.getParent().player; if(target.hasShan()||get.effect(target,{name:'sha'},player,target)>0) return 'sha'; if(get.effect(target,{name:'juedou'},player,target)>0) return 'juedou'; return 'sha'; }); else if(bool1) event._result={control:'sha'}; else if(bool2) event._result={control:'juedou'}; else event.finish(); } 'step 1' if(result.control&&lib.card[result.control]) player.useCard({ name:result.control, isCard:true, },false,target).baseDamage=num; }, }, twyanhuo:{ audio:'yanhuo', trigger:{player:'die'}, direct:true, forceDie:true, skillAnimation:true, animationColor:'thunder', filter:function(event,player){ return player.countCards('he')>0&&game.hasPlayer(function(current){ return current!=player&¤t.countCards('h')>0; }); }, content:function(){ 'step 0' var num=player.countCards('he'),str=get.cnNumber(num); event.num1=num; event.num2=1; var list=['令一名其他角色弃置'+str+'张牌']; if(num>1){ list.push('令至多'+str+'名其他角色各弃置一张牌'); } player.chooseControl('cancel2').set('choiceList',list).set('prompt',get.prompt('twyanhuo')).set('forceDie',true); 'step 1' if(result.control!='cancel2'){ if(result.index==0){ event.num2=event.num1; event.num1=1; } player.chooseTarget([1,event.num1],true,'请选择【延祸】的目标',function(card,player,target){ return target!=player&&target.countCards('he')>0; }).set('forceDie',true).set('ai',function(target){ return -get.attitude(_status.event.player,target) }); } else event.finish(); 'step 2' if(result.bool){ var targets=result.targets.sortBySeat(); player.logSkill('twyanhuo',targets); for(var i of targets) i.chooseToDiscard(true,'he',event.num2); } }, }, twshenxing:{ mod:{ globalFrom:function(player,target,distance){ var es=player.getCards('e',function(card){ return !ui.selected.cards.contains(card); }); for(var i of es){ var type=get.subtype(i); if(type=='equip3'||type=='equip4'||type=='equip6') return distance; } return distance-1; }, maxHandcard:function(player,distance){ var es=player.getCards('e',function(card){ return !ui.selected.cards.contains(card); }); for(var i of es){ var type=get.subtype(i); if(type=='equip3'||type=='equip4'||type=='equip6') return distance; } return distance+1; }, }, }, twdaoji:{ audio:2, enable:'phaseUse', usable:1, filter:function(event,player){ return player.hasCard(lib.skill.twdaoji.filterCard,'he'); }, filterCard:function(card){ return get.type(card)!='basic'; }, position:'he', filterTarget:function(card,player,target){ return target!=player&&player.inRange(target)&&target.hasCard((card)=>lib.filter.canBeGained(card,target,player),'he'); }, check:function(card){ return 8-get.value(card); }, content:function(){ 'step 0' player.gainPlayerCard(target,'he',true); 'step 1' if(result.bool&&result.cards&&result.cards.length==1){ var card=result.cards[0]; if(player.getCards('h').contains(card)){ var type=get.type(card); if(type=='basic') player.draw(); else if(type=='equip'){ if(player.hasUseTarget(card)) player.chooseUseTarget(card,'nopopup',true); target.damage('nocard'); } } } }, ai:{ order:6, result:{ target:function(player,target){ var eff=get.effect(target,{name:'shunshou_copy2'},player,target); if(target.countCards('e')>0) eff+=get.damageEffect(target,player,target); return eff; }, }, }, }, xinzhenjun:{ audio:2, trigger:{ player:'phaseUseBegin' }, direct:true, filter:function(event,player){ return player.countCards('he')>0; }, content:function(){ 'step 0' player.chooseCardTarget({ filterCard:true, filterTarget:lib.filter.notMe, position:'he', prompt:get.prompt2('xinzhenjun'), ai1:function(card){ var player=_status.event.player; if(card.name=='sha'&&get.color(card)=='red'){ for(var i=0;i0&¤t.hasValueTarget(card)) return 7; } return 0; } return 7-get.value(card); }, ai2:function(target){ var player=_status.event.player; var card=ui.selected.cards[0]; var att=get.attitude(player,target); if(get.value(card)<0) return -att*2; if(target.countCards('h',{name:'sha',color:'red'})||target.hasSkill('wusheng')||target.hasSkill('new_rewusheng')||target.hasSkill('wushen')||(card.name=='sha'&&get.color(card)=='red'&&target.hasValueTarget(card))) return att*2; var eff=0; game.countPlayer(function(current){ if(target!=current&&get.distance(target,current,'attack')>1) return; var eff2=get.damageEffect(current,player,player); if(eff2>eff) eff=eff2; }); if(att>0&&eff>0) eff+=2*att; return eff; }, }); 'step 1' if(result.bool){ var target=result.targets[0]; event.target=target; player.logSkill('xinzhenjun',target); target.gain(result.cards,player,'giveAuto') } else event.finish(); 'step 2' target.chooseToUse({ filterCard:function(card){ return get.name(card)=='sha'&&get.color(card)!='black'&&lib.filter.cardEnabled.apply(this,arguments); }, prompt:'请使用一张不为黑色的【杀】,否则'+get.translation(player)+'可以对你或你攻击范围内的一名其他角色造成1点伤害', }); 'step 3' if(result.bool){ var num=1; game.countPlayer2(function(current){ current.getHistory('damage',function(evt){ if(evt.getParent(evt.notLink()?4:8)==event) num+=evt.num; }); }); player.draw(num); event.finish(); } else{ player.chooseTarget('是否对'+get.translation(target)+'或其攻击范围内的一名角色造成1点伤害?',function(card,player,target){ return target==_status.event.targetx||_status.event.targetx.inRange(target); }).set('targetx',event.target).ai=function(target){ var player=_status.event.player; return get.damageEffect(target,player,player) }; } 'step 4' if(result.bool){ player.line(result.targets); result.targets[0].damage('nocard'); } }, }, twmoukui:{ trigger:{player:'useCardToPlayered'}, direct:true, filter:function(event,player){ return event.card&&event.card.name=='sha'; }, content:function(){ 'step 0' var list=['选项一']; if(trigger.target.countDiscardableCards(player,'he')>0) list.push('选项二'); list.push('背水!'); list.push('cancel2'); player.chooseControl(list).set('choiceList',[ '摸一张牌', '弃置'+get.translation(trigger.target)+'的一张牌', '背水!依次执行以上两项。然后若此【杀】未令其进入濒死状态,则其弃置你的一张牌。', ]).set('prompt',get.prompt('twmoukui',trigger.target)); 'step 1' if(result.control!='cancel2'){ var target=trigger.target; player.logSkill('twmoukui',target); if(result.control=='选项一'||result.control=='背水!') player.draw(); if(result.control=='选项二'||result.control=='背水!') player.discardPlayerCard(target,true,'he'); if(result.control=='背水!'){ player.addTempSkill('twmoukui_effect'); var evt=trigger.getParent(); if(!evt.twmoukui_effect) evt.twmoukui_effect=[]; evt.twmoukui_effect.add(target); } } }, subSkill:{ effect:{ trigger:{player:'useCardAfter'}, charlotte:true, forced:true, filter:function(event,player){ return event.twmoukui_effect&&event.twmoukui_effect.filter(function(current){ return current.isIn()&&!current.hasHistory('damage',function(evt){ return evt._dyinged&&evt.card==event.card; }); }).length>0; }, content:function(){ var list=trigger.twmoukui_effect.filter(function(current){ return current.isIn()&&!current.hasHistory('damage',function(evt){ return evt._dyinged&&evt.card==event.card; }); }).sortBySeat(); for(var i of list){ i.discardPlayerCard(player,true,'he').boolline=true; } }, }, }, }, twfuhan:{ audio:'fuhan', trigger:{player:'phaseZhunbeiBegin'}, unique:true, limited:true, skillAnimation:true, animationColor:'orange', forceunique:true, filter:function(event,player){ return player.countMark('fanghun')>0; }, prompt:function(event,player){ var num=Math.max(2,player.storage.fanghun); num=Math.min(num,8); return get.prompt('twfuhan')+'(体力上限:'+num+')'; }, check:function(event,player){ if(player.storage.fanghun>=Math.min(4,player.maxHp)) return true; if(player.hp<=2&&player.storage.fanghun>=3) return true; return false; }, content:function(){ 'step 0' event.num=player.storage.fanghun; player.removeMark('fanghun',player.storage.fanghun); player.awakenSkill('twfuhan'); if(_status.characterlist){ list=[]; for(var i=0;i<_status.characterlist.length;i++){ var name=_status.characterlist[i]; if(lib.character[name][1]=='shu') list.push(name); } } else if(_status.connectMode){ list=get.charactersOL(function(i){ return lib.character[i][1]!='shu'; }); } else{ list=get.gainableCharacters(function(info){ return info[1]=='shu'; }); } var players=game.players.concat(game.dead); for(var i=0;i0) player.gainMaxHp(num); else player.loseMaxHp(-num); player.recover(); 'step 3' var card=get.cardPile('meiyingqiang','field'); if(card){ player.gain(card,'gain2','log'); } }, }, twqueshi:{ trigger:{ global:'gameDrawAfter', player:'enterGame', }, forced:true, locked:false, filter:function(event,player){ return !player.isDisabled(1); }, content:function(){ if(!lib.inpile.contains('meiyingqiang')){ lib.inpile.push('meiyingqiang'); player.equip(game.createCard('meiyingqiang','diamond',12)); } else{ var card=get.cardPile(function(card){ return card.name=='meiyingqiang'&&card!=player.getEquip(1); },'field'); if(card) player.equip(card); } }, }, meiyingqiang:{ equipSkill:true, trigger:{ player:['loseAfter','gainAfter'], global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], }, filter:function(event,player){ if(player==_status.currentPhase) return false; var evt=event.getl(player); if(!evt||!evt.cards2||!evt.cards2.length) return false; var list=player.getHistory('lose',function(evt){ return evt.cards2&&evt.cards2.length; }); if(event.name=='lose'){ if(list.indexOf(event)!=0) return false; } else{ if(!player.hasHistory('lose',function(evt){ return evt.getParent()==event&&list.indexOf(evt)==0; })) return false; } return _status.connectMode||!lib.config.skip_shan||player.hasSha(); }, direct:true, content:function(){ if(trigger.delay===false) game.delayx(); player.chooseToUse('梅影枪:是否使用一张【杀】?',function(card){ if(get.name(card)!='sha') return false; return lib.filter.cardEnabled.apply(this,arguments); }).set('addCount',false).logSkill='meiyingqiang'; }, }, cuijin:{ trigger:{global:'useCard'}, direct:true, filter:function(event,player){ return event.card.name=='sha'&&(event.player==player||player.inRange(event.player))&&player.countCards('h')>0; }, content:function(){ 'step 0' if(player!=game.me&&!player.isOnline()) game.delayx(); var target=trigger.player; event.target=target; player.chooseToDiscard('he',get.prompt('cuijin',target),'弃置一张牌并令'+get.translation(trigger.player)+'使用的【杀】伤害+1,但若其未造成伤害,则你对其造成1点伤害。').set('ai',function(card){ if(_status.event.goon) return 7-get.value(card); return 0; }).set('goon',function(){ var d1=true; if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false for(var target of trigger.targets){ if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ if(!target.hasSkill('gangzhi')) d1=false; if(!target.hasSkillTag('filterDamage',null,{ player:trigger.player, card:trigger.card, })&&get.attitude(player,target)<0) return true; } } if(d1) return get.damageEffect(trigger.player,player,player)>0; return false; }()).logSkill=['cuijin',target]; 'step 1' if(result.bool){ if(typeof trigger.baseDamage!='number') trigger.baseDamage=1; trigger.baseDamage++; player.addTempSkill('cuijin_damage'); player.markAuto('cuijin_damage',[trigger.card]); } }, subSkill:{ damage:{ trigger:{global:'useCardAfter'}, forced:true, popup:false, charlotte:true, onremove:true, filter:function(event,player){ return player.storage.cuijin_damage.contains(event.card); }, content:function(){ player.storage.cuijin_damage.remove(trigger.card); if(!player.storage.cuijin_damage.length) player.removeSkill('cuijin_damage'); if(trigger.player.isIn()&&!game.hasPlayer2(function(current){ return current.hasHistory('damage',function(evt){ return evt.card==trigger.card; }); })){ player.line(trigger.player,'green'); trigger.player.damage(); } }, }, }, }, jintao:{ mod:{ cardUsable:function(card,player,num){ if(card.name=='sha') return num+1; }, targetInRange:function(card){ if(card.name=='sha') return true; }, }, audio:2, trigger:{player:'useCard'}, forced:true, filter:function(event,player){ if(event.card.name!='sha') return false; var evt=event.getParent('phaseUse'); if(!evt||evt.player!=player) return false; var index=player.getHistory('useCard',function(evtx){ return evtx.card.name=='sha'&&evtx.getParent('phaseUse')==evt; }).indexOf(event); return index==0||index==1; }, content:function(){ var evt=trigger.getParent('phaseUse'); var index=player.getHistory('useCard',function(evtx){ return evtx.card.name=='sha'&&evtx.getParent('phaseUse')==evt; }).indexOf(trigger); if(index==0){ game.log(trigger.card,'伤害+1'); if(typeof trigger.baseDamage!='number') trigger.baseDamage=1; trigger.baseDamage++; } else{ game.log(trigger.card,'不可被响应'); trigger.directHit.addArray(game.players); } }, }, equan:{ audio:2, trigger:{global:'damageEnd'}, forced:true, filter:function(event,player){ return player==_status.currentPhase&&event.player.isIn(); }, logTarget:'player', content:function(){ trigger.player.addMark('equan',trigger.num,false); }, group:['equan_block','equan_lose'], marktext:'毒', intro:{ name:'恶泉(毒)', name2:'毒', }, subSkill:{ lose:{ audio:'equan', trigger:{player:'phaseZhunbeiBegin'}, forced:true, filter:function(){ return game.hasPlayer(function(current){ return current.hasMark('equan'); }); }, logTarget:function(){ return game.filterPlayer(function(current){ return current.hasMark('equan'); }); }, content:function(){ game.countPlayer(function(current){ var num=current.countMark('equan'); if(num){ current.removeMark('equan',num); current.loseHp(num); } }); }, }, block:{ trigger:{global:'dyingBegin'}, forced:true, logTarget:'player', filter:function(event,player){ var evt=event.getParent(2); return evt.name=='equan_lose'&&evt.player==player; }, content:function(){ trigger.player.addTempSkill('baiban'); }, }, }, }, manji:{ audio:2, trigger:{global:'loseHpAfter'}, forced:true, filter:function(event,player){ return player!=event.player&&player.hp>=event.player.hp||player.isDamaged(); }, logTarget:'player', content:function(){ if(player.hp<=trigger.player.hp) player.recover(); if(player.hp>=trigger.player.hp) player.draw(); }, }, beini:{ audio:2, enable:'phaseUse', usable:1, filterTarget:lib.filter.notMe, content:function(){ 'step 0' var str=get.translation(target); player.chooseControl().set('choiceList',[ '摸两张牌,然后令'+str+'视为对自己使用【杀】', '令'+str+'摸两张牌,然后视为对其使用【杀】', ]).set('ai',function(){ var evt=_status.event.getParent(),player=evt.player,target=evt.target; var card={name:'sha',isCard:true},att=get.attitude(player,target)>0; if(!target.canUse(card,player,false)||get.effect(player,card,target,player)>=0) return 0; if(att&&(!player.canUse(card,target,false)||get.effect(target,card,player,player)>=0)) return 1; if(target.hasSkill('nogain')&&player.canUse(card,target,false)&&get.effect(target,card,player,player)>0) return 1; if(player.hasShan()) return 0; if(att&&target.hasShan()) return 1; return 0; }); 'step 1' var list=[player,target]; if(result.index==1) list.reverse(); event.list=list; list[0].draw(2); 'step 2' var list=event.list; if(list[1].isIn()&&list[0].isIn()&&list[1].canUse('sha',list[0],false)) list[1].useCard({name:'sha',isCard:true},list[0],false,'noai'); }, ai:{ order:5, expose:0, result:{ player:function(player,target){ var card={name:'sha',isCard:true},att=get.attitude(player,target)>0; if(!target.canUse(card,player,false)||get.effect(player,card,target,player)>=0) return 2; if(att&&(!player.canUse(card,target,false)||get.effect(target,card,player,player)>=0)) return 2; if(target.hasSkill('nogain')&&player.canUse(card,target,false)) return get.effect(target,card,player,player) if(player.hasShan()) return 1; if(att&&target.hasShan()) return 1; return 0; }, }, }, }, dingfa:{ audio:2, trigger:{player:'phaseDiscardAfter'}, direct:true, filter:function(event,player){ var num=0; player.getHistory('lose',function(evt){ num+=evt.cards2.length; }); return num>=player.hp; }, content:function(){ 'step 0' player.chooseTarget(get.prompt('dingfa'),'操作提示:选择自己以回复体力,或选择其他角色以造成伤害',function(card,player,target){ return target==player?player.isDamaged():true; }).set('ai',function(target){ return target!=player?get.damageEffect(target,player,player):get.recoverEffect(player,player,player) }); 'step 1' if(result.bool){ var target=result.targets[0]; player.logSkill('dingfa',target); if(target==player) player.recover(); else target.damage(); } }, }, dz_mantianguohai:{ mod:{ ignoredHandcard:function(card,player){ if(get.name(card)=='dz_mantianguohai') return true; }, cardDiscardable:function(card,player,name){ if(name=='cardsDiscard'&&get.name(card)=='dz_mantianguohai') return false; }, }, }, twmiaolve:{ audio:2, trigger:{ global:'gameDrawAfter', player:'enterGame', }, forced:true, locked:false, content:function(){ if(!lib.inpile.contains('dz_mantianguohai')) lib.inpile.add('dz_mantianguohai'); if(!_status.dz_mantianguohai_suits) _status.dz_mantianguohai_suits=lib.suit.slice(0); var list=_status.dz_mantianguohai_suits.randomRemove(2).map(function(i){ return game.createCard2('dz_mantianguohai',i,get.rand(1,13)); }); if(list.length) player.gain(list,'gain2','log'); }, group:'twmiaolve_damage', subSkill:{ damage:{ trigger:{player:'damageEnd'}, direct:true, content:function(){ 'step 0' event.count=trigger.num; 'step 1' event.count--; var list=['dz_mantianguohai']; list.addArray(get.zhinangs()); player.chooseButton([get.prompt('twmiaolve'),[list,'vcard']]).set('ai',function(button){ if(button.link[2]=='dz_mantianguohai'&&player.countCards('hs','dz_mantianguohai')<2) return 10; return get.value({name:button.link[2]}); }); 'step 2' if(result.bool){ player.logSkill('twmiaolve'); var name=result.links[0][2]; if(name=='dz_mantianguohai'){ if(!lib.inpile.contains('dz_mantianguohai')) lib.inpile.add('dz_mantianguohai'); if(!_status.dz_mantianguohai_suits) _status.dz_mantianguohai_suits=lib.suit.slice(0); if(_status.dz_mantianguohai_suits.length) player.gain(game.createCard2('dz_mantianguohai',_status.dz_mantianguohai_suits.randomRemove(),get.rand(1,13)),'gain2'); else{ var card=get.cardPile(function(card){ return card.name==name; }); if(card) player.gain(card,'gain2'); } player.draw(); } else{ var card=get.cardPile(function(card){ return card.name==name; }); if(card) player.gain(card,'gain2'); } if(event.count>0) event.goto(1); } }, }, }, }, twyingjia:{ audio:2, trigger:{global:'phaseEnd'}, direct:true, filter:function(event,player){ if(!player.countCards('he')) return false; var history=player.getHistory('useCard'),map={}; for(var i of history){ if(get.type2(i.card)=='trick'){ if(!map[i.card.name]) map[i.card.name]=true; else return true; } } return false; }, content:function(){ 'step 0' player.chooseCardTarget({ prompt:get.prompt('twyingjia'), prompt2:'弃置一张牌并令一名角色进行一个额外回合', filterCard:lib.filter.cardDiscardable, filterTarget:true, ai1:function(card){ return 8-get.value(card); }, ai2:function(target){ if(target.hasJudge('lebu')) return -1; var player=_status.event.player; if(get.attitude(player,target)>4){ return get.threaten(target)/Math.sqrt(target.hp+1)/Math.sqrt(target.countCards('h')+1); } return -1; }, }); 'step 1' if(result.bool){ var target=result.targets[0]; player.logSkill('twyingjia',target); player.discard(result.cards); target.insertPhase(); } }, }, gx_lingbaoxianhu:{ trigger:{ source:'damageSource', global:'dieAfter', }, forced:true, equipSkill:true, filter:function(event,player){ if(event.name=='damage') return event.num>1; return true; }, content:function(){ player.gainMaxHp(); player.recover(); }, }, gx_taijifuchen:{ trigger:{player:'useCardToPlayered'}, forced:true, equipSkill:true, filter:function(event,player){ return event.card&&event.card.name=='sha'; }, logTarget:'target', content:function(){ 'step 0' var suit=get.suit(trigger.card); var num=trigger.target.countCards('h','shan'); var next=trigger.target.chooseToDiscard('弃置一张牌,或不能响应'+get.translation(trigger.card),'he').set('ai',function(card){ var num=_status.event.num; if(num==0) return 0; if(card.name=='shan') return num>1?2:0; return (get.suit(card)!=_status.event.suit?9:6)-get.value(card); }).set('num',num); if(lib.suit.contains(suit)){ next.set('prompt2','若弃置的是'+get.suit(suit)+'牌,则改为'+get.translation(player)+'获得之'); next.set('suit',suit); } 'step 1' if(result.bool){ var card=result.cards[0]; if(get.suit(card,trigger.target)==get.suit(trigger.card,false)&&get.position(card)=='d') player.gain(card,'gain2'); } else trigger.directHit.add(trigger.target); }, }, gx_chongyingshenfu:{ trigger:{player:'damageEnd'}, forced:true, equipSkill:true, filter:function(event,player){ if(!event.card||!event.card.name||player.getStorage('gx_chongyingshenfu_effect').contains(event.card.name)) return false; if(player.hasSkillTag('unequip2')) return false; if(event.source.hasSkillTag('unequip',false,{ name:event.card.name, target:player, card:event.card, })) return false; return true; }, content:function(){ player.markAuto('gx_chongyingshenfu_effect',[trigger.card.name]); }, group:'gx_chongyingshenfu_effect', subSkill:{ effect:{ trigger:{player:'damageBegin4'}, forced:true, equipSkill:true, filter:function(event,player){ if(!event.card||!event.card.name||!player.storage.gx_chongyingshenfu_effect||!player.getStorage('gx_chongyingshenfu_effect').contains(event.card.name)) return false; if(player.hasSkillTag('unequip2')) return false; if(event.source.hasSkillTag('unequip',false,{ name:event.card.name, target:player, card:event.card, })) return false; return true; }, content:function(){ trigger.num--; }, onremove:true, intro:{ content:'受到$造成的伤害-1', }, }, }, }, twdanfa:{ audio:2, trigger:{player:['phaseZhunbeiBegin','phaseJieshuBegin']}, filter:function(event,player){ return player.countCards('he')>0; }, direct:true, content:function(){ 'step 0' player.chooseCard('he',get.prompt('twdanfa'),'将一张牌作为“丹”置于武将牌上').set('ai',function(card){ if(player.storage.twdanfa){ var suit=get.suit(card); for(var i of player.storage.twdanfa){ if(get.suit(i,false)==suit) return 4-get.value(card); } } return 5.5-get.value(card); }); 'step 1' if(result.bool){ var card=result.cards[0]; player.logSkill('twdanfa'); game.log(player,'将',card,'放在了武将牌上'); player.$give(card,player,false); player.lose(card,ui.special,'toStorage'); player.markAuto('twdanfa',result.cards); } else event.finish(); 'step 2' game.delayx(); }, mark:true, intro:{ content:'cards', onunmark:'throw', }, group:'twdanfa_draw', subSkill:{ draw:{ audio:'twdanfa', trigger:{player:'useCard'}, forced:true, locked:false, filter:function(event,player){ if(!player.storage.twdanfa||!player.storage.twdanfa.length) return false; var suit=get.suit(event.card,false); if(suit=='none'||player.storage.twdanfa_count&&player.storage.twdanfa_count.contains(suit)) return false; for(var i of player.storage.twdanfa){ if(get.suit(i,false)==suit) return true; } return false; }, content:function(){ player.draw(); player.addTempSkill('twdanfa_count'); if(!player.storage.twdanfa_count) player.storage.twdanfa_count=[]; player.storage.twdanfa_count.push(get.suit(trigger.card,false)); }, }, count:{onremove:true}, }, }, twlingbao:{ enable:'phaseUse', usable:1, filter:function(event,player){ var list=player.getStorage('twdanfa'); if(list.length<2) return false; var suit=get.suit(list[0],false); for(var i=1;ifalse; obj.selectCard=-1; return obj; }, prompt:function(links){ return lib.skill['twlingbao_'+get.color(links)].prompt; }, check:function(button){ var storage=_status.event.player.storage.twdanfa.slice(0); storage.remove(button.link); if(storage.filter(function(card){ return card.suit==button.link.suit; }).length) return 1+Math.random(); return 0; }, }, subSkill:{ red:{ filterTarget:function(card,player,target){ return target.isDamaged(); }, delay:false, prompt:'令一名角色回复1点体力', content:function(){ 'step 0' var cards=lib.skill.twlingbao_backup.cards; player.$throw(cards,1000); player.unmarkAuto('twdanfa',cards); game.log(player,'将',cards,'置入了弃牌堆'); game.delayx(); game.cardsDiscard(cards); 'step 1' target.recover(); }, ai:{ tag:{ recover:1, }, result:{ target:1.5, }, }, }, black:{ filterTarget:function(card,player,target){ return target.countDiscardableCards(player,'hej')>0; }, delay:false, prompt:'弃置一名角色区域内至多两张区域不同的牌', content:function(){ 'step 0' var cards=lib.skill.twlingbao_backup.cards; player.$throw(cards,1000); player.unmarkAuto('twdanfa',cards); game.log(player,'将',cards,'置入了弃牌堆'); game.delayx(); game.cardsDiscard(cards); 'step 1' var num=0; if(target.countDiscardableCards(player,'h')) num++; if(target.countDiscardableCards(player,'e')) num++; if(target.countDiscardableCards(player,'j')) num++; if(num){ player.discardPlayerCard(target,[1,Math.max(2,num)],'hej',true).set('filterButton',function(button){ for(var i=0;i0&&target.countCards('e',function(card){ return get.value(card,target)<=0; })>0&&target.countCards('j',function(card){ return get.effect(target,card,target,target)<0; })>8) return 3; if(target.countCards('h')>0&&target.countCards('e',function(card){ return get.value(card,target)>0; })>0) return -2; return 0; }, }, }, }, none:{ selectTarget:2, filterTarget:function(card,player,target){ if(!ui.selected.targets.length) return true; return target.countCards('he')>0; }, complexSelect:true, targetprompt:['摸牌','弃牌'], delay:false, prompt:'令一名角色摸一张牌并令另一名角色弃置一张牌', multitarget:true, multiline:true, content:function(){ 'step 0' var cards=lib.skill.twlingbao_backup.cards; player.$throw(cards,1000); player.unmarkAuto('twdanfa',cards); game.log(player,'将',cards,'置入了弃牌堆'); game.delayx(); game.cardsDiscard(cards); 'step 1' targets[0].draw(); targets[1].chooseToDiscard('he',true); }, ai:{ result:{ target:function(player,target){ if(!ui.selected.targets.length) return 1; if(target.countCards('e',function(card){ return get.value(card,target)<=0; })>0) return 1; return -1; }, }, }, }, backup:{audio:'twlingbao'}, }, ai:{ order:1, result:{player:1}, }, }, twsidao:{ audio:2, trigger:{ global:'gameDrawAfter', player:'enterGame', }, forced:true, locked:false, filter:function(event,player){ return !player.storage.twsidao; }, content:function(){ 'step 0' player.chooseButton(['请选择你的初始法宝',[['gx_lingbaoxianhu','gx_taijifuchen','gx_chongyingshenfu'],'vcard']],true).set('ai',function(button){ return button.link[2]=='gx_chongyingshenfu'?2:1; }); 'step 1' if(result.bool){ var card=game.createCard2(result.links[0][2]); lib.inpile.add(result.links[0][2]); player.storage.twsidao=card; player.chooseUseTarget(card,'nopopup',true); } }, group:'twsidao_equip', subSkill:{ equip:{ audio:'twsidao', trigger:{player:'phaseZhunbeiBegin'}, forced:true, filter:function(event,player){ var card=player.storage.twsidao; return card&&card.isInPile()&&player.hasUseTarget(card); }, content:function(){ player.chooseUseTarget(player.storage.twsidao,'nopopup',true); }, }, }, }, twrangyi:{ audio:2, enable:'phaseUse', usable:1, filter:function(event,player){ return player.countCards('h')>0; }, filterTarget:lib.filter.notMe, delay:0, content:function(){ 'step 0' event.cards=player.getCards('h'); target.gain(event.cards,player,'giveAuto').gaintag.add('twrangyi'); target.addTempSkill('twrangyi2'); 'step 1' target.chooseToUse({ prompt:'请使用得到的一张牌,或者受到来自'+get.translation(player)+'的一点伤害', filterCard:function(card,player){ if(get.itemtype(card)!='card'||!card.hasGaintag('twrangyi')) return false; return lib.filter.filterCard(card,player,event); }, cards:cards, }); 'step 2' target.removeSkill('twrangyi2'); if(!result.bool) target.damage('nocard'); }, ai:{ order:1, result:{ target:function(player,target){ var hs=player.getCards('h'); for(var i=0;i0; }, content:function(){ var cards=player.getCards('h',function(card){ return card.hasGaintag('twrangyi'); }); game.delayx(); trigger.getParent(2).player.gain(cards,player,'giveAuto'); }, onremove:function(player){ player.removeGaintag('twrangyi'); }, }, twbaimei:{ audio:2, trigger:{ player:"damageBegin4", }, forced:true, filter:function(event,player){ if(player.countCards('h')) return false; if(event.nature) return true; return get.type(event.card,'trick')=='trick'; }, content:function(){ trigger.cancel(); }, ai:{ effect:{ target:function(card,player,target,current){ if(target.countCards('h')) return; if(get.tag(card,'natureDamage')) return 'zerotarget'; if(get.type(card)=='trick'&&get.tag(card,'damage')){ return 'zeroplayertarget'; } }, }, }, }, twhuzhu:{ audio:2, enable:'phaseUse', usable:1, filter:function(e,player){ return player.countCards('e')>0; }, filterTarget:function(card,player,target){ return target!=player&&target.countCards('h')>0 }, content:function(){ 'step 0' target.chooseCard('交给'+get.translation(player)+'一张手牌','h',true); 'step 1' target.give(result.cards,player); 'step 2' if(player.countGainableCards(player,'e')) target.gainPlayerCard(player,'e',true); 'step 3' if(target.isDamaged()&&target.hp<=player.hp){ player.chooseBool('是否令'+get.translation(target)+'回复1点体力?').set('ai',function(){ return get.recoverEffect(target,player,player); }); } 'step 4' if(result.bool) target.recover(); }, ai:{ order:8, result:{ target:function(player,target){ var eff=(target.isDamaged()&&target.hp<=player.hp)?get.recoverEffect(target,player,target):0; if(eff<=0&&!player.countGainableCards(target,'e')) return -1; return eff; }, }, }, }, twliancai:{ audio:2, trigger:{player:['turnOverEnd','phaseJieshuBegin']}, filter:function(card,player,target){ return target=='phaseJieshuBegin'||player.countCards('h')0; }, check:function(card,player){ if(card.name=='turnOver') return true; if(player.isTurnedOver()) return true; if(player.hp-player.countCards('h')>1) return true; return game.hasPlayer(function(current){ return lib.skill.twliancai.filterTarget(null,player,current)&&lib.skill.twliancai.filterAI(current); }); }, filterAI:function(target){ var player=_status.event.player; var att=get.attitude(player,target); if(target.isDamaged()&&target.countCards('e','baiyin')&&att>0) return 2*att; return -att; }, prompt2:function(card,player,target){ return card.name=='phaseJieshu'?'将武将牌翻面,然后获得一名其他角色装备区内的一张牌':'将手牌摸至与体力值相同'; }, content:function(){ 'step 0' if(event.triggername=='phaseJieshuBegin') player.turnOver(); else{ player.draw(player.hp-player.countCards('h')); event.finish(); } 'step 1' player.chooseTarget('获得一名角色装备区内的一张牌',lib.skill.twliancai.filterTarget).ai=lib.skill.twliancai.filterAI; 'step 2' if(result.bool){ player.line(result.targets,'thunder'); player.gainPlayerCard('e',true,result.targets[0]); } }, }, twqijia:{ //group:'twqijia_alka', audio:2, enable:'phaseUse', filter:function(event,player){ return player.countCards('e',function(card){ return !player.getStorage('twqijia_alka').contains(get.subtype(card)); }); }, filterTarget:function(card,player,target){ return target!=player&&player.canUse({name:'sha'},target); }, position:'e', filterCard:function(card,player){ return !player.getStorage('twqijia_alka').contains(get.subtype(card)); }, content:function(){ 'step 0' player.addTempSkill('twqijia_alka'); player.storage.twqijia_alka.push(get.subtype(cards[0])); player.useCard({name:'sha'},target,false); }, subSkill:{ alka:{ charlotte:true, onremove:function(player){ delete player.storage.twqijia_alka; delete player.storage.twzhuchen; player.unmarkSkill('twzhuchen'); }, init:function(player,skill){ if(!player.storage[skill]) player.storage[skill]=[]; if(!player.storage.twzhuchen) player.storage.twzhuchen=[]; }, mod:{ globalFrom:function(from,to,distance){ if(from.storage.twzhuchen&&from.storage.twzhuchen.contains(to)) return -Infinity; } }, }, }, check:function(card){ return 7-get.value(card); }, ai:{ order:function(){ return get.order({name:'sha'})-0.2; }, result:{ target:function(player,target){ return get.effect(target,{name:'sha'},player,player); }, }, }, }, twzhuchen:{ enable:'phaseUse', filter:function(event,player){ return player.countCards('h',lib.skill.twzhuchen.filterCard)>0; }, filterCard:function(card,player){ var name=get.name(card,player); return name=='tao'||name=='jiu'; }, filterTarget:lib.filter.notMe, content:function(){ player.addTempSkill('twqijia_alka'); player.storage.twzhuchen.add(target); player.markSkill('twzhuchen'); }, intro:{ content:function(content,player){ return '至'+get.translation(content)+'的距离视为1'; }, }, }, twxiaolian:{ audio:2, trigger:{global:'useCardToTarget'}, logTarget:'target', filter:function(event,player){ return event.card&&event.card.name=='sha'&&event.player!=player&& event.targets.length==1&&event.targets[0]!=player; }, check:function(event,player){ return get.effect(event.targets[0],event.card,event.player,player)<=get.effect(player,event.card,event.player,player); }, content:function(){ trigger.getParent().twxiaolian=trigger.targets[0]; trigger.targets.length=0; trigger.getParent().triggeredTargets2.length=0; trigger.targets.push(player); }, group:'twxiaolian_damage', subSkill:{ distance:{ sub:true, charlotte:true, init:function(player,skill){ if(!player.storage[skill]) player.storage[skill]=[]; }, mark:true, marktext:'马', intro:{ content:'cards', onunmark:'throw', }, mod:{ globalTo:function(from,to,distance){ if(from!=to&&to.storage.twxiaolian_distance) return distance+to.storage.twxiaolian_distance.length; }, }, }, damage:{ sub:true, trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ return event.getParent(2).twxiaolian!=undefined; }, content:function(){ 'step 0' var target=trigger.getParent(2).twxiaolian; event.target=target; player.chooseCard('是否将一张牌当做【马】置于'+get.translation(target)+'的武将牌旁?','he').ai=function(card){ if(get.attitude(_status.event.player,_status.event.getParent('twxiaolian_damage').target)>2) return 7-get.value(card); return 0; }; 'step 1' if(result.bool){ player.logSkill('twxiaolian',target); player.lose(result.cards,ui.special,'toStorage'); target.addSkill('twxiaolian_distance'); target.storage.twxiaolian_distance.addArray(result.cards); target.markSkill('twxiaolian_distance'); } }, }, }, }, twtijin:{ audio:2, trigger:{global:'useCardToPlayer'}, filter:function(event,player){ return event.card&&event.card.name=='sha'&&event.player!=player&&event.target!=player&& event.targets.length==1&&event.player.inRange(player); }, logTarget:'target', check:function(event,player){ return get.effect(event.targets[0],event.card,event.player,player)<=get.effect(player,event.card,event.player,player); }, content:function(){ 'step 0' trigger.targets.length=0; trigger.getParent().triggeredTargets1.length=0; trigger.targets.push(player); var next=game.createEvent('twtijin_discard',null,trigger.getParent(2)); next.player=player; next.target=trigger.player; next.setContent(function(){ if(target.isDead()||!target.countCards('he')) return; player.line(target,'green'); player.discardPlayerCard(target,true,'he'); }); }, }, twyanqin:{ forbid:['guozhan'], audio:2, trigger:{player:'phaseBegin'}, direct:true, content:function(){ 'step 0' var list=[]; if(player.group!='wei') list.push('wei2'); if(player.group!='shu') list.push('shu2'); list.push('cancel2'); player.chooseControl(list).set('ai',function(){ return list.randomGet(); }).set('prompt',get.prompt2('twyanqin')); 'step 1' if(result.control!='cancel2'){ player.logSkill('twyanqin'); var group=result.control.slice(0,3); player.changeGroup(group); } }, }, twbaobian:{ audio:2, trigger:{source:'damageBegin2'}, filter:function(event,player){ var card=event.card; if(!card||(card.name!='sha'&&card.name!='juedou')) return false; return event.player.group==player.group||event.player.countCards('h')>event.player.hp }, check:function(event,player){ var att=get.attitude(player,event.player); if(event.player.group==player.group) return att>0; return att<0; }, logTarget:'player', content:function(){ var target=trigger.player; if(target.group==player.group){ trigger.cancel(); var num=target.maxHp-target.countCards('h'); if(num) target.draw(num); } else{ player.discardPlayerCard(target,'h',true,target.countCards('h')-target.hp) } }, }, renshe:{ audio:2, trigger:{player:'damageEnd'}, direct:true, content:function(){ 'step 0' var choiceList=['令一名其他角色与你各摸一张牌','令自己下个出牌阶段可以多发动一次【外使】']; if(lib.skill.chijie.filter&&lib.skill.chijie.filter({},player)) choiceList.push('将自己的势力变更为场上存在的一个其他势力'); player.chooseControl('cancel2').set('prompt',get.prompt('renshe')).set('choiceList',choiceList).set('ai',function(){ if(game.hasPlayer(function(current){ return get.attitude(player,current)>0||current.hasSkillTag('nogain'); })) return 0; return 1; }); 'step 1' if(result.control=='cancel2') event.finish(); else{ event.index=result.index; player.logSkill('renshe'); if(event.index==0){ player.chooseTarget('请选择一名角色,与其各摸一张牌',lib.filter.notMe,true).ai=function(target){ if(target.hasSkillTag('nogain')) return 0.1; return get.attitude(_status.event.player,target); }; } else if(result.index==1){ player.storage.waishi++; event.finish(); } else{ var next=game.createEvent('renshe_changeGroup'); next.player=player; next.renshe=true; next.setContent(lib.skill.chijie.content); event.finish(); } } 'step 2' if(result.bool){ player.line(result.targets[0],'green'); game.asyncDraw([player,result.targets[0]].sortBySeat()); } else event.finish(); 'step 3' game.delay(); }, }, waishi:{ audio:2, group:'waishi_afterstory', subSkill:{ afterstory:{ trigger:{player:'phaseUseEnd'}, forced:true, silent:true, popup:false, content:function(){player.storage.waishi=1}, }, }, init:function(player,skill){ player.storage[skill]=1; }, enable:'phaseUse', filter:function(event,player){ return typeof player.storage.waishi!='number'||player.storage.waishi>0; }, filterTarget:function(card,player,target){ return target!=player&&target.countCards('h')>=ui.selected.cards.length; }, filterCard:true, position:'he', check:function(card){ if(!game.hasPlayer(function(current){ return current!=_status.event.player&¤t.countCards('h')>ui.selected.cards.length; })) return 0; return 6-get.value(card); }, selectCard:function(){ if(!ui.selected.targets.length) return [1,game.countGroup()]; return [1,Math.min(ui.selected.targets[0].countCards('h'),game.countGroup())]; }, discard:false, lose:false, delay:0, content:function(){ 'step 0' if(typeof player.storage.waishi!='number') player.storage.waishi=1; player.storage.waishi--; player.lose(cards,ui.special); player.choosePlayerCard(target,true,'h',cards.length).chooseonly=true; 'step 1' event.cards2=result.cards; target.lose(event.cards2,ui.special); 'step 2' player.gain(event.cards2); target.gain(cards); player.$give(cards.length,target); target.$give(event.cards2.length,player); 'step 3' game.delay(1.2); 'step 4' if(target.countCards('h')>player.countCards('h')||player.group==target.group) player.draw(); }, ai:{ result:{ player:function(player,target){ if(player.countCards('h')