'use strict'; character.mountain={ character:{ 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','fullskin']], zhangzhang:['male','wu',3,['zhijian','guzheng']], caiwenji:['female','qun',3,['beige','duanchang']], zuoci:['male','qun',3,['huashen','xinsheng']], }, skill:{ 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); "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:{ audio:2, unique:true, 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.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') } }, 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'; }).ai=function(card){ if(eff>0){ return 10-ai.get.value(card); } return 0; }; "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.skills.contains('jiu')||player.skills.contains('tianxianjiu')) return; if(bs.length<=3&&player.num('h','sha')<=1){ for(var i=0;i0; }, direct:true, content:function(){ "step 0" var fang=player.hp>=2&&player.num('h')<=player.hp+1; player.chooseTarget('是否发动放权?',function(card,player,target){ return target!=player; }).ai=function(target){ if(!fang) return -1; return ai.get.attitude(player,target)-4; }; "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:'phaseEnd'}, forced:true, popup:false, audio:false, content:function(){ "step 0" player.chooseToDiscard(true); "step 1" var target=player.storage.fangquan; target.marks.fangquan=target.markCharacter(player,{ name:'放权', content:'进行一个额外的回合' }); game.addVideo('markCharacter',target,{ name:'放权', content:'进行一个额外的回合', id:'fangquan', target:player.dataset.position }); target.phase(); target.addSkill('fangquan3'); player.removeSkill('fangquan2'); delete player.storage.fangquan; } }, fangquan3:{ trigger:{player:'phaseAfter'}, forced:true, popup:false, audio:false, content:function(){ if(player.marks.fangquan){ player.marks.fangquan.delete(); delete player.marks.fangquan; game.addVideo('unmark',player,'fangquan'); } player.removeSkill('fangquan3'); } }, ruoyu:{ audio:2, unique:true, trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ if(!player.isZhu)return false; if(player.storage.ruoyu) return false; for(var i=0;i0; }, 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.ai=ai.get.unuseful2; next.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; for(i=0;i=2&&num2>0); player.chooseCardTarget({ ai1:function(card){ if(!check) return 0; return 6-ai.get.useful(card); }, ai2:function(target){ if(!check) return 0; return 1-ai.get.attitude(player,target); }, filterTarget:function(card,player,target){ return target.num('h')>0; }, selectTarget:[0,2], filterCard:true, prompt:'是否发动巧变跳过摸牌阶段?' }); "step 1" if(result.bool){ player.logSkill('qiaobian',result.targets); player.discard(result.cards); } "step 2" game.delay(); "step 3" if(result.bool){ for(var i=0;i0; }, direct:true, check:function(event,player){ }, content:function(){ "step 0" var check; for(var i=0;i0&&game.players[i].num('j')){ check=true;break; } } 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(!check) return 0; return 7-ai.get.useful(card); }, ai2:function(target){ if(!check) return 0; 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){ for(var i=0;i0){ if((target.get('e','1')&&!game.players[i].get('e','1'))|| (target.get('e','2')&&!game.players[i].get('e','2'))|| (target.get('e','3')&&!game.players[i].get('e','3'))|| (target.get('e','4')&&!game.players[i].get('e','4'))|| (target.get('e','5')&&!game.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:true, prompt:'是否发动巧变跳过出牌阶段?', targetprompt:['被移走','移动目标'] }); "step 1" if(result.bool==false){ 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){ if(ai.get.attitude(player,targets[0])>ai.get.attitude(player,targets[1])){ 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]); } else{ event.finish(); } "step 4" if(result.bool){ if(get.position(result.buttons[0].link)=='e'){ event.targets[1].equip(result.buttons[0].link); } else if(result.buttons[0].link.viewAs){ event.targets[1].addJudge({name:result.buttons[0].link.viewAs},[result.buttons[0].link]); } else{ event.targets[1].addJudge(result.buttons[0].link); } event.targets[0].$give(result.buttons[0].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;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ if(target.num('h')==0) return 2; return [0.5,target.num('h','sha')+target.num('h','shan')]; } } }, threaten:function(player,target){ if(target.num('h')==0) return 2; return 0.5; } } }, zaoxian:{ 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; }, content:function(){ player.loseMaxHp(); player.addSkill('jixi'); player.storage.zaoxian=true; } }, jixi:{ audio:2, enable:'phaseUse', filter:function(event,player){ return player.storage.tuntian.length>0; }, delay:false, direct:true, content:function(){ "step 0" player.chooseCardButton('急袭',player.storage.tuntian); "step 1" if(result.bool){ var card=result.buttons[0].link; event.card=card; player.chooseTarget(function(noname,player,target){ var temp=card.name; card.name='shunshou'; var result=player.canUse(card,target); card.name=temp; return result; }).ai=function(target){ return -ai.get.attitude(player,target); }; } else{ player.addTempSkill('jixi2','phaseAfter'); event.finish(); } "step 2" if(result.bool&&result.targets&&result.targets.length){ var card=event.card; player.storage.tuntian.remove(card); game.addVideo('storage',player,['tuntian',get.cardsInfo(player.storage.tuntian),'cards']); if(!player.storage.tuntian.length){ player.unmarkSkill('tuntian'); } player.logSkill('jixi',result.targets); player.useCard({name:'shunshou'},[event.card],result.targets[0]); } }, ai:{ order:10, result:{ player:function(player){ if(player.skills.contains('jixi2')) return 0; return player.storage.tuntian.length-1; } } } }, jixi2:{}, 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:{ audio:2, unique:true, trigger:{player:'phaseBegin'}, filter:function(event,player){ return player.hp==1; }, forced:true, priority:3, group:'hunzi2', content:function(){ player.loseMaxHp(); if(player.hp>player.maxHp) player.loseHp(); player.addSkill('reyingzi'); delete player.tempSkills.yinghun; player.removeSkill('hunzi'); }, ai:{ threaten:function(player,target){ if(target.hp==1) return 2; return 0.5; }, maixie:true, effect:{ target:function(card,player,target){ var hasfriend=false; for(var i=0;i=0){ hasfriend=true;break; } } if(!hasfriend) return; if(get.tag(card,'damage')==1&&target.hp==2&&_status.currentPhase!=target) return [0.5,1]; } } } }, hunzi2:{ unique:true, trigger:{player:'phaseBefore'}, filter:function(event,player){ return player.hp==1; }, forced:true, popup:false, content:function(){ player.addTempSkill('yinghun','phaseAfter'); }, }, zhiba:{ unique:true, global:'zhiba2', }, zhiba2:{ audio:2, forceaudio:true, enable:'phaseUse', filter:function(event,player){ if(!game.zhu) return false; if(!game.zhu.isZhu) return false; return (player!=game.zhu&&game.zhu.skills.contains('zhiba')&& player.group=='wu'&&player.num('h')>0&&game.zhu.num('h')>0); }, filterTarget:function(card,player,target){ return target==game.zhu; }, usable:1, content:function(){ "step 0" player.chooseToCompare(target,function(card){ var player=get.owner(card); if(player!=game.zhu&&ai.get.attitude(player,game.zhu)>0){ return -get.number(card); } return get.number(card); }); "step 1" 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){ if(player.num('h')<=player.hp) return false; var maxnum=0; var cards2=game.zhu.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:'phaseDiscardEnd'}, filter:function(event,player){ if(event.player!=player&&event.player.classList.contains('dead')==false&& event.cards&&event.cards.length){ for(var i=0;i0) return true; var num=0; for(var i=0;i2; }, direct:true, content:function(){ "step 0" game.delay(); "step 1" event.cards=trigger.cards.slice(0); for(var i=0;iatt2&&att1>=0; }, content:function(){ "step 0" var next=player.chooseToDiscard('he','是否发动悲歌?'); next.ai=ai.get.unuseful2; next.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, trigger:{player:'dieBegin'}, forced:true, filter:function(event){ return event.source!=undefined; }, content:function(){ trigger.source.clearSkills(); }, ai:{ threaten:function(player,target){ if(target.hp==1) return 0.2; return 1.5; }, effect:{ target:function(card,player,target,current){ var hasfriend=false; for(var i=0;i=0){ hasfriend=true;break; } } if(!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(num){ if(typeof num!='number') num=1; var player=this.player; while(num--){ var name=player.storage.huashen.unowned.shift(); 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