'use strict'; game.import('character',function(lib,game,ui,get,ai,_status){ return { name:'extra', character:{ shen_guanyu:['male','shen',6,['wuhun','wushen'],['shu']], shen_zhaoyun:['male','shen',2,['juejing','longhun'],['shu']], shen_zhugeliang:['male','shen',3,['qixing','kuangfeng','dawu'],['shu']], shen_lvmeng:['male','shen',3,['shelie','gongxin'],['wu']], shen_zhouyu:['male','shen',4,['yeyan','qinyin'],['wu']], shen_simayi:['male','shen',4,['renjie','sbaiyin','lianpo'],['wei']], shen_caocao:['male','shen',3,['guixin','feiying'],['wei']], shen_lvbu:['male','shen',5,['baonu','wumou','ol_wuqian','ol_shenfen'],['qun']], }, characterIntro:{ shen_guanyu:'关羽,字云长。曾水淹七军、擒于禁、斩庞德、威震华夏,吓得曹操差点迁都躲避,但是东吴偷袭荆州,关羽兵败被害。后传说吕蒙因关羽之魂索命而死。', shen_lvmeng:'吕蒙,字子明,汝南富陂人,东吴名将,原有“吴下阿蒙”之贬称,后受孙权劝说,奋发读书,最终成就一代名将。', shen_zhouyu:'字公瑾,庐江舒县人。东汉末年名将。有姿貌、精音律,江东有“曲有误,周郎顾”之语。周瑜少与孙策交好,后孙策遇刺身亡,孙权继任。周瑜将兵赴丧,以中护军的身份与长史张昭共掌众事,建安十三年(208年),周瑜率东吴军与刘备军联合,在赤壁击败曹操。此战也奠定了三分天下的基础。', shen_zhugeliang:'字孔明、号卧龙,汉族,琅琊阳都人,三国时期蜀汉丞相、杰出的政治家、军事家、发明家、文学家。在世时被封为武乡侯,死后追谥忠武侯,后来东晋政权推崇诸葛亮军事才能,特追封他为武兴王。诸葛亮为匡扶蜀汉政权,呕心沥血、鞠躬尽瘁、死而后已。其代表作有《前出师表》、《后出师表》、《诫子书》等。曾发明木牛流马等,并改造连弩,可一弩十矢俱发。于234年在宝鸡五丈原逝世。', }, skill:{ ol_shenfen:{ audio:2, enable:'phaseUse', filter:function(event,player){ return player.storage.baonu>=6; }, skillAnimation:true, animationColor:'metal', content:function(){ "step 0" player.storage.baonu-=6; player.syncStorage('baonu'); player.updateMarks('baonu'); event.targets=game.filterPlayer(); event.targets.remove(player); event.targets.sort(lib.sort.seat); event.targets2=event.targets.slice(0); player.line(event.targets,'green'); "step 1" if(event.targets.length){ event.targets.shift().damage(); event.redo(); } "step 2" if(event.targets2.length){ var cur=event.targets2.shift(); if(cur&&cur.countCards('he')){ cur.chooseToDiscard('he',true,4); } event.redo(); } }, ai:{ combo:'baonu', order:10, result:{ player:function(player){ return game.countPlayer(function(current){ if(current!=player){ return get.sgn(get.damageEffect(current,player,player)); } }); } } } }, ol_wuqian:{ audio:2, enable:'phaseUse', derivation:'wushuang', filter:function(event,player){ return player.storage.baonu>=2; }, filterTarget:function(card,player,target){ return target!=player; }, content:function(){ player.storage.baonu-=2; player.syncStorage('baonu'); player.updateMarks('baonu'); player.addTempSkill('wushuang'); player.storage.ol_wuqian_target=target; player.addTempSkill('ol_wuqian_target'); target.addTempSkill('ol_wuqian_targeted'); var list=game.filterPlayer(); for(var i=0;i0){ player.chooseControlList([ '移去一枚【暴怒】标记', '失去一点体力' ]).set('ai',function(event,player){ if(player.storage.baonu>6) return 0; if(player.hp+player.num('h','tao')>3) return 1; return 0; }); } else{ player.loseHp(); event.finish(); } 'step 1' if(result.index==0){ player.storage.baonu--; player.syncStorage('baonu'); player.updateMarks('baonu'); } else{ player.loseHp(); } }, ai:{ effect:{ player:function(card,player){ if (get.type(card)=='trick'&&get.value(card)<6){ return [0,-2]; } } } } }, qinyin:{ audio:2, trigger:{player:'phaseDiscardEnd'}, direct:true, filter:function(event,player){ return event.cards&&event.cards.length>1 }, content:function(){ "step 0" if(typeof event.count!='number'){ // event.count=trigger.cards.length-1; event.count=1; } var recover=0,lose=0,players=game.filterPlayer(); for(var i=0;i0){ if(players[i].hp<2){ lose--; recover+=0.5; } lose--; recover++; } else if(get.attitude(player,players[i])<0){ if(players[i].hp<2){ lose++; recover-=0.5; } lose++; recover--; } } else{ if(get.attitude(player,players[i])>0){ lose--; } else if(get.attitude(player,players[i])<0){ lose++; } } } var prompt=get.prompt('qinyin')+'(剩余'+get.cnNumber(event.count)+'次)'; player.chooseControl('失去体力','回复体力','cancel2', ui.create.dialog(get.prompt('qinyin'),'hidden')).ai=function(){ if(lose>recover&&lose>0) return 0; if(lose0) return 1; return 2; } "step 1" if(result.control=='cancel2'){ event.finish(); } else{ player.logSkill('qinyin'); event.bool=(result.control=='回复体力'); event.num=0; event.players=game.filterPlayer(); } "step 2" if(event.num1){ event.count--; event.goto(0); } }, ai:{ expose:0.1, threaten:2 } }, lianpo:{ audio:true, trigger:{source:'dieAfter'}, forced:true, filter:function(event,player){ return !player.hasSkill('lianpo2'); }, content:function(){ player.insertPhase(); } }, baonu:{ audio:2, mark:true, init:function(player){ player.storage.baonu=2; player.markSkill('baonu'); player.syncStorage('baonu'); }, trigger:{source:'damageEnd',player:'damageEnd'}, forced:true, filter:function(event){ return event.num>0; }, content:function(){ player.storage.baonu+=trigger.num; player.markSkill('baonu'); player.syncStorage('baonu'); }, intro:{ content:'mark' }, ai:{ combo:'shenfen', maixie:true, maixie_hp:true } }, shenfen:{ audio:2, unique:true, enable:'phaseUse', filter:function(event,player){ return player.storage.baonu>=6; }, skillAnimation:true, animationColor:'metal', limited:true, content:function(){ "step 0" player.awakenSkill('shenfen'); player.storage.baonu-=6; player.markSkill('baonu'); player.syncStorage('baonu'); event.targets=game.filterPlayer(); event.targets.remove(player); event.targets.sort(lib.sort.seat); event.targets2=event.targets.slice(0); player.line(event.targets,'green'); "step 1" if(event.targets.length){ event.targets.shift().damage(); event.redo(); } "step 2" if(event.targets2.length){ var cur=event.targets2.shift(); if(cur&&cur.countCards('he')){ cur.chooseToDiscard('he',true,4); } event.redo(); } }, ai:{ order:10, result:{ player:function(player){ return game.countPlayer(function(current){ if(current!=player){ return get.sgn(get.damageEffect(current,player,player)); } }); } } } }, wuqian:{ audio:2, enable:'phaseUse', derivation:'wushuang', filter:function(event,player){ return player.storage.baonu>=2&&!player.hasSkill('wushuang'); }, content:function(){ player.storage.baonu-=2; player.addTempSkill('wushuang'); }, ai:{ order:5, result:{ player:function(player){ if(!player.storage.shenfen) return 0; var cards=player.getCards('h','sha'); if(cards.length){ if(game.hasPlayer(function(current){ return (player.canUse('sha',current)&& get.effect(current,cards[0],player,player)>0&¤t.hasShan()); })){ return 1; } } return 0; } } } }, renjie:{ audio:true, trigger:{player:'damageEnd'}, forced:true, unique:true, group:'renjie2', notemp:true, mark:true, filter:function(event){ return event.num>0; }, init:function(player){ player.storage.renjie=0; game.addVideo('storage',player,['renjie',player.storage.renjie]); }, content:function(){ player.storage.renjie+=trigger.num; game.addVideo('storage',player,['renjie',player.storage.renjie]); }, intro:{ content:'mark' }, ai:{ maixie:true, maixie_hp:true, effect:{ target:function(card,player,target){ if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; if(get.tag(card,'damage')){ if(target.hp==target.maxHp){ if(!target.hasSkill('jilue')){ return [0,1]; } return [0.7,1]; } return 0.7; } }, player:function(card,player){ if(_status.currentPhase!=player) return; if(_status.event.name!='chooseToUse'||_status.event.player!=player) return; if(get.type(card)=='basic') return; if(get.tag(card,'gain')) return; if(get.value(card,player,'raw')>=7) return; if(player.hp<=2) return; if(!player.hasSkill('jilue')||player.storage.renjie==0){ return 'zeroplayertarget'; } } } } }, renjie2:{ audio:true, trigger:{player:'phaseDiscardEnd'}, forced:true, filter:function(event){ return event.cards&&event.cards.length>0; }, content:function(){ player.storage.renjie+=trigger.cards.length; game.addVideo('storage',player,['renjie',player.storage.renjie]); } }, sbaiyin:{ skillAnimation:'epic', trigger:{player:'phaseBegin'}, forced:true, unique:true, audio:true, filter:function(event,player){ return player.storage.renjie>=4; }, content:function(){ player.loseMaxHp(); player.addSkill('jilue'); player.awakenSkill('sbaiyin'); } }, jilue:{ unique:true, group:['jilue_guicai','jilue_fangzhu','jilue_wansha','jilue_zhiheng','jilue_jizhi'] }, jilue_guicai:{ audio:true, trigger:{global:'judge'}, direct:true, filter:function(event,player){ return player.countCards('h')>0&&player.storage.renjie>0; }, content:function(){ "step 0" player.chooseCard('是否弃置一枚“忍”,并发动【鬼才】?').ai=function(card){ var trigger=_status.event.parent._trigger; var player=_status.event.player; var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); var attitude=get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ return result-get.value(card)/2; } else{ return -result-get.value(card)/2; } }; "step 1" if(result.bool){ player.respond(result.cards,'highlight'); } else{ event.finish(); } "step 2" if(result.bool){ player.logSkill('jilue_guicai'); player.storage.renjie--; player.updateMarks(); if(trigger.player.judging[0].clone){ trigger.player.judging[0].clone.delete(); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); } trigger.player.judging[0].discard(); trigger.player.judging[0]=result.cards[0]; trigger.position.appendChild(result.cards[0]); game.log(trigger.player,'的判定牌改为',result.cards[0]); game.delay(2); } }, ai:{ tag:{ rejudge:1, } } }, jilue_fangzhu:{ audio:true, trigger:{player:'damageEnd'}, direct:true, priority:-1, filter:function(event,player){ return player.storage.renjie>0; }, content:function(){ "step 0" player.chooseTarget('是否弃置一枚“忍”,并发动【放逐】?',function(card,player,target){ return player!=target }).ai=function(target){ if(target.hasSkillTag('noturn')) return 0; if(target.isTurnedOver()){ return get.attitude(player,target)-1; } else{ if(player.maxHp-player.hp==1){ return -get.attitude(player,target)-1; } } return 0; } "step 1" if(result.bool){ player.storage.renjie--; player.updateMarks(); player.logSkill('jilue_fangzhu',result.targets); result.targets[0].draw(player.maxHp-player.hp); result.targets[0].turnOver(); } }, }, jilue_wansha:{ audio:true, enable:'phaseUse', usable:1, filter:function(event,player){ return player.storage.renjie>0; }, content:function(){ player.storage.renjie--; player.updateMarks(); player.addTempSkill('wansha'); } }, jilue_zhiheng:{ audio:true, enable:'phaseUse', usable:1, filter:function(event,player){ return player.storage.renjie>0; }, position:'he', filterCard:true, selectCard:[1,Infinity], prompt:'弃置一枚“忍”,然后弃置任意张牌并摸等量的牌', check:function(card){return 6-get.value(card)}, content:function(){ player.storage.renjie--; player.updateMarks(); player.draw(cards.length); }, ai:{ order:1, result:{ player:function(player){ var num=0; var cards=player.getCards('he'); for(var i=0;i2) return 1; if(cards.length==2&&player.storage.jilue>1); return 0; } }, threaten:1.5 }, }, jilue_jizhi:{ audio:true, trigger:{player:'useCard'}, filter:function(event,player){ return (get.type(event.card)=='trick'&&event.cards[0]&&event.cards[0]==event.card)&&player.storage.renjie>0; }, content:function(){ player.storage.renjie--; player.updateMarks(); player.draw(); }, ai:{ threaten:1.4 } }, wushen:{ mod:{ cardEnabled:function(card,player){ if(_status.event.skill!='wushen'&&card.name!='sha'&&get.suit(card)=='heart') return false; }, cardUsable:function(card,player){ if(_status.event.skill!='wushen'&&card.name!='sha'&&get.suit(card)=='heart') return false; }, cardRespondable:function(card,player){ if(_status.event.skill!='wushen'&&card.name!='sha'&&get.suit(card)=='heart') return false; }, cardSavable:function(card,player){ if(_status.event.skill!='wushen'&&card.name!='sha'&&get.suit(card)=='heart') return false; }, targetInRange:function(card){ if(get.suit(card)=='heart'||_status.event.skill=='wushen') return true; } }, audio:2, enable:['chooseToUse','chooseToRespond'], filterCard:{suit:'heart'}, viewAs:{name:'sha'}, check:function(){return 1}, ai:{ effect:{ target:function(card,player,target,current){ if(get.tag(card,'respondSha')&¤t<0) return 0.6 } }, respondSha:true, order:4, useful:-1, value:-1 } }, wuhun:{ trigger:{ player:'damageEnd', }, alter:true, filter:function (event,player){ if(event.source==undefined) return false if(!get.is.altered('wuhun')) return false return true; }, forced:true, init:function (player){ for(var i=0;itarget.storage.wuhun_mark){ return false; } } return true; }).set('ai',function(target){ return -ai.get.attitude(_status.event.player,target); }); "step 1" player.line(result.targets[0],'fire'); result.targets[0].addSkill('wuhun3') }, ai:{ threaten:0.5, effect:{ target:function (card,player,target,current){ if(get.tag(card,'damage')){ if(player.hasSkill('jueqing')) return [1,-5]; var hasfriend=false; for(var i=0;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(player.hp>2&&ai.get.attitude(player,target)<=0) return [0,2]; return [1,0,0,-player.hp]; } }, }, }, }, wuhun3:{ audio:3, trigger:{ global:'dieAfter', }, forced:true, content:function (){ "step 0" player.judge(function(card){ if(card.name=='tao'||card.name=='taoyuan') return 2; return -2; }) "step 1" if(result.judge==-2){ player.die(); } player.removeSkill('wuhun3'); }, }, wuhun4:{ trigger:{ player:'dieAfter', }, forced:true, popup:false, content:function (){ for(var i=0;i2&&get.attitude(player,target)<=0) return [0,2]; return [1,0,0,-player.hp]; } } } } }, wuhun6:{ audio:3, trigger:{global:'dieAfter'}, forced:true, content:function(){ if(player.hp1) return true; var num=game.countPlayer(function(current){ if(current.countCards('he')&¤t!=player&&get.attitude(player,current)<=0){ return true; } if(current.countCards('j')&¤t!=player&&get.attitude(player,current)>0){ return true; } }); return num>=2; }, content:function(){ "step 0" var targets=game.filterPlayer(); targets.remove(player); targets.sort(lib.sort.seat); event.targets=targets; event.count=trigger.num; "step 1" event.num=0; player.line(targets,'green'); "step 2" if(num0){ return true; } }); if(num>2) return [0,1]; if(num==2) return [0.5,1]; } } } } }, qixing:{ audio:2, unique:true, trigger:{global:'gameDrawAfter',player:'phaseBegin'}, forced:true, check:function(event,player){ return player.hp<=1; }, filter:function(event,player){ return !player.storage.qixing; }, content:function(){ "step 0" player.gain(get.cards(7))._triggered=null; "step 1" if(player==game.me){ game.addVideo('delay',null); } player.chooseCard('选择七张牌作为星',7,true).ai=function(card){ return get.value(card); }; "step 2" player.lose(result.cards,ui.special)._triggered=null; player.storage.qixing=result.cards; game.addVideo('storage',player,['qixing',get.cardsInfo(player.storage.qixing),'cards']); }, mark:true, intro:{ mark:function(dialog,content,player){ if(content&&content.length){ if(player==game.me||player.isUnderControl()){ dialog.addAuto(content); } else{ return '共有'+get.cnNumber(content.length)+'张星'; } } }, content:function(content,player){ if(content&&content.length){ if(player==game.me||player.isUnderControl()){ return get.translation(content); } return '共有'+get.cnNumber(content.length)+'张星'; } } }, group:['qixing2'], }, qixing2:{ trigger:{player:'phaseDrawAfter'}, direct:true, filter:function(event,player){ return player.storage.qixing&&player.storage.qixing.length; }, content:function(){ "step 0" player.chooseCard('选择任意张手牌与“星”交换',[1,Math.min(player.countCards('h'),player.storage.qixing.length)]).ai=function(card){ var val=get.value(card); if(val<0) return 10; if(player.skipList.contains('phaseUse')){ return val; } return -val; }; "step 1" if(result.bool){ player.logSkill('qixing'); player.lose(result.cards,ui.special)._triggered=null; player.storage.qixing=player.storage.qixing.concat(result.cards); player.syncStorage('qixing'); event.num=result.cards.length; } else{ event.finish(); } "step 2" player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){ var val=get.value(button.link); if(val<0) return -10; if(player.skipList.contains('phaseUse')){ return -val; } return val; } if(player==game.me&&!event.isMine()){ game.delay(0.5); } "step 3" player.gain(result.links)._triggered=null; for(var i=0;i=4){ if(target.hp==1&&target.maxHp>2) return att; if(target.hp==2&&target.maxHp>3&&target.countCards('he')==0) return att*0.7; return 0; } return -1; } "step 1" if(result.bool){ var length=result.targets.length; for(var i=0;i=1) return [0,0]; if(!target.hasFriend()) return; if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp>1) return [0,1]; } }, threaten:function(player,target){ if(target.hp==1) return 2; return 0.5; }, } }, longhun1:{ audio:true, enable:['chooseToUse','chooseToRespond'], prompt:function(){ return '将'+get.cnNumber(Math.max(1,_status.event.player.hp))+'张红桃牌当作桃使用'; }, position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; return 10-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); }, viewAs:{name:'tao'}, filter:function(event,player){ return player.countCards('he',{suit:'heart'})>=player.hp; }, filterCard:function(card){ return get.suit(card)=='heart'; } }, longhun2:{ audio:true, enable:['chooseToUse','chooseToRespond'], prompt:function(){ return '将'+get.cnNumber(Math.max(1,_status.event.player.hp))+'张方片当作火杀使用或打出'; }, position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; return 10-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); }, viewAs:{name:'sha',nature:'fire'}, filter:function(event,player){ return player.countCards('he',{suit:'diamond'})>=player.hp; }, filterCard:function(card){ return get.suit(card)=='diamond'; } }, longhun3:{ audio:true, enable:['chooseToUse','chooseToRespond'], prompt:function(){ return '将'+get.cnNumber(Math.max(1,_status.event.player.hp))+'张黑桃牌当作无懈可击使用'; }, position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; return 7-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); }, viewAs:{name:'wuxie'}, viewAsFilter:function(player){ return player.countCards('he',{suit:'spade'})>=player.hp; }, filterCard:function(card){ return get.suit(card)=='spade'; } }, longhun4:{ audio:true, enable:['chooseToUse','chooseToRespond'], prompt:function(){ return '将'+get.cnNumber(Math.max(1,_status.event.player.hp))+'张梅花牌当作闪打出'; }, position:'he', check:function(card,event){ if(_status.event.player.hp>1) return 0; return 10-get.value(card); }, selectCard:function(){ return Math.max(1,_status.event.player.hp); }, viewAs:{name:'shan'}, filterCard:function(card){ return get.suit(card)=='club'; } }, juejing:{ mod:{ maxHandcard:function(player,num){ return 2+num; } }, audio:true, trigger:{player:'phaseDrawBegin'}, priority:-5, filter:function(event,player){ return player.hp