'use strict'; mode.chess={ canvasUpdates2:[], hiddenCharacters:[], element:{ card:{ moveTo:function(player,method){ this.fixed=true; if(this.parentNode==ui.arena){ var rect=player.getBoundingClientRect(); this.style.left=(rect.left+8)+'px'; this.style.top=(rect.top+8)+'px'; } else{ this.style.left=''; this.style.top=''; this.dataset.position=player.dataset.position; } if(method=='flip'){ this.style.transition='all 0.5s'; this.style.webkitTransform='rotate'+(Math.random()<0.5?'X':'Y')+'(180deg) perspective(1000px)'; } else if(method=='rotate'){ this.style.transition='all 0.5s'; this.style.webkitTransform='rotate(180deg)'; } else{ this.style.transition='all 0.5s'; this.style.webkitTransform=''; } return this; }, }, player:{ createRangeShadow:function(num,move){ num++; var shadows=this.parentNode.getElementsByClassName('playergrid'); while(shadows.length){ shadows[0].remove(); } for(var i=1-num;i=ui.chesswidth){ x=ui.chesswidth-1; } if(y>=ui.chessheight){ y=ui.chessheight-1; } var pos=y*ui.chesswidth+x; if(!lib.posmap[pos]){ delete lib.posmap[this.dataset.position]; this.dataset.position=pos; lib.posmap[pos]=this; this.chessFocus(); } return this; }, chessFocus:function(){ game.addVideo('chessFocus',this); if(ui.chess._chessdrag) return; if(_status.chessscrolling) return; var player=this; var dx=0,dy=0; if(player.offsetLeft-ui.chessContainer.scrollLeft<14){ dx=player.offsetLeft-ui.chessContainer.scrollLeft-14; } else if(player.offsetLeft-ui.chessContainer.scrollLeft>ui.chessContainer.offsetWidth-134){ dx=player.offsetLeft-ui.chessContainer.scrollLeft-ui.chessContainer.offsetWidth+134; } if(player.offsetTop-ui.chessContainer.scrollTop<14){ dy=player.offsetTop-ui.chessContainer.scrollTop-14; } else if(player.offsetTop+ui.chess.offsetTop-ui.chessContainer.scrollTop>ui.chessContainer.offsetHeight-134){ dy=player.offsetTop+ui.chess.offsetTop-ui.chessContainer.scrollTop-ui.chessContainer.offsetHeight+134; } if(_status.currentChessFocus){ clearInterval(_status.currentChessFocus); } var count=12; var ddx=Math.floor(dx/12); var ddy=Math.floor(dy/12); if(dx||dy){ _status.currentChessFocus=setInterval(function(){ if(count--){ ui.chessContainer.scrollLeft+=ddx; ui.chessContainer.scrollTop+=ddy; } else{ ui.chessContainer.scrollLeft+=dx%12; ui.chessContainer.scrollTop+=dy%12; clearInterval(_status.currentChessFocus); delete _status.currentChessFocus; } },16); } }, getXY:function(){ var pos=parseInt(this.dataset.position); var x=pos%ui.chesswidth; var y=Math.floor(pos/ui.chesswidth); return [x,y]; }, getDataPos:function(x,y){ var xy=this.getXY(); if(typeof x!='number') x=0; if(typeof y!='number') y=0; x+=xy[0]; y+=xy[1]; return x+y*ui.chesswidth; }, getNeighbour:function(x,y){ return lib.posmap[this.getDataPos(x,y)]||null; }, movable:function(x,y){ var xy=this.getXY(); if(xy[0]+x<0) return false; if(xy[1]+y<0) return false; if(xy[0]+x>=ui.chesswidth) return false; if(xy[1]+y>=ui.chessheight) return false; return !this.getNeighbour(x,y); }, moveRight:function(){ if(this.movable(1,0)){ this.move(1,0); return true; } return false; }, moveLeft:function(){ if(this.movable(-1,0)){ this.move(-1,0); return true; } return false; }, moveUp:function(){ if(this.movable(0,-1)){ this.move(0,-1); return true; } return false; }, moveDown:function(){ if(this.movable(0,1)){ this.move(0,1); return true; } return false; }, dieAfter:function(source){ var player=this; delete lib.posmap[player.dataset.position]; setTimeout(function(){ player.delete(); },500); for(var i=0;i1){ if(cards){ that.$draw(cards) } else{ that.$draw(num-1) } } }, $gainmod:function(num){ var cards,node; if(get.itemtype(num)=='cards'){ cards=num; num=cards.length; } else if(get.itemtype(num)=='card'){ cards=[num]; num=1; } if(cards){ cards=cards.slice(0); node=cards.shift().copy('thrown','hidden'); } else{ node=ui.create.div('.card.thrown.hidden'); } node.fixed=true; game.$randomMove(this,node,100,30); var ot=node.style.webkitTransform; node.style.webkitTransform+='scale(0.6)'; node.dataset.position=this.dataset.position; this.parentNode.appendChild(node); ui.refresh(node); node.show(); node.style.webkitTransform=ot; setTimeout(function(){ node.style.webkitTransform=''; node.delete(); },500); var that=this; if(num&&num>1){ if(cards){ that.$gain(cards,null,false) } else{ that.$gain(num-1,null,false) } } }, $throw:function(card,time,init){ if(init!==false){ if(get.itemtype(card)!='cards'){ if(get.itemtype(card)=='card'){ card=[card]; } else{ return; } } game.addVideo('throw',this,[get.cardsInfo(card),time]); } this.chessFocus(); if(get.itemtype(card)=='cards'){ for(var i=0;i=0){ for(var i=0;ipxy[0]&&randomMove.contains('moveRight')){ if(player.moveRight()){ event.moved=true;break; } } else if(txy[0]pxy[1]&&randomMove.contains('moveDown')){ if(player.moveDown()){ event.moved=true;break; } } else if(txy[1]pxy[1]&&randomMove.contains('moveDown')){ if(player.moveDown()){ event.moved=true;break; } } else if(txy[1]pxy[0]&&randomMove.contains('moveRight')){ if(player.moveRight()){ event.moved=true;break; } } else if(txy[0]=money){ ui.create.control('招降'+get.translation(_status.challenge),function(){ game.data.character.add(_status.challenge); game.data.challenge=game.getLeaderList(); game.changeDust(-money); game.reload(); }); } } } }, phaseLoopOrdered:function(player){ var next=game.createEvent('phaseLoop'); next.player=player; next.content=function(){ "step 0" var passed=false; for(var i=0;inum1){ if(next.side==game.me.side){ next=game.me; } var str; if(num2-num1>1){ str='选择至多'+get.cnNumber(num2-num1)+'个已方角色各摸一张牌' } else{ str='选择一个已方角色摸一张牌' } var nevt=next.chooseTarget(str,function(card,player,target){ return target.side==next.side; },[1,num2-num1]); nevt.ai=function(target){ return Math.max(1,10-target.num('h')); }; nevt.chessForceAll=true; } else{ event.goto(2); } } else{ event.goto(2); } "step 1" if(result.bool){ game.asyncDraw(result.targets); } "step 2" var players=[]; if(player.side==game.me.side){ player=game.me; } if(player.isDead()){ for(var i=0;i1){ var nevt=player.chooseTarget('选择下一个行动的角色',function(card,player,target){ return target.side==player.side&&!target.classList.contains('acted'); },true); nevt.chessForceAll=true; nevt.ai=function(target){ var nj=target.num('j'); if(nj){ return -nj; } return Math.max(0,10-target.hp); } } else{ event.decided=players[0]; } "step 3" if(event.decided){ event.decided.phase(); event.justacted=event.decided; delete event.decided; } else{ var current=result.targets[0]; current.phase(); event.justacted=current; } "step 4" event.justacted.classList.add('acted'); event.goto(0); for(var i=0;i=ui.chessContainer.offsetWidth){ tx=-Math.abs(tx); } if(rect.top<=80){ ty=Math.abs(ty); } else if(rect.top+rect.height+80>=ui.chessContainer.offsetHeight){ ty=-Math.abs(ty); } node.style.webkitTransform='translate('+tx+'px,'+ty+'px)'; }, draw2:function(func){ lib.canvasUpdates2.push(func); if(!lib.status.canvas2){ lib.status.canvas2=true; game.update(game.updateCanvas2); } }, updateCanvas2:function(time){ if(lib.canvasUpdates2.length===0){ lib.status.canvas2=false; return false; } ui.canvas2.width=ui.chess.offsetWidth; ui.canvas2.height=ui.chess.offsetHeight; ui.canvas2.style.left=0; ui.canvas2.style.top=0; var ctx=ui.ctx2; ctx.shadowBlur=5; ctx.shadowColor='rgba(0,0,0,0.3)'; ctx.fillStyle='white'; ctx.strokeStyle='white'; ctx.lineWidth=3; ctx.save(); for(var i=0;i.player'+pos+ '{left:'+(14+i*148)+'px;top:'+(14+j*148)+'px}',0); ui.chesssheet.sheet.insertRule('#arena.chess #chess>.card'+pos+ '{left:'+(22+i*148)+'px;top:'+(22+j*148)+'px}',0); ui.chesssheet.sheet.insertRule('#arena.chess #chess>.popup'+pos+ '{left:'+(19+i*148)+'px;top:'+(142+j*148)+'px}',0); } } var grids=[]; var gridnum=ui.chessheight*ui.chesswidth; for(var i=0;i7?'thunder':''; game.players[i].popup('距离:'+dist2+'/'+dist,nature); } } },true); ui.create.me(); ui.create.fakeme(); ui.chessinfo=ui.create.div('.fakeme.player',ui.me); ui.chessinfo.ontouchmove = ui.click.touchScroll; ui.chessinfo.style.WebkitOverflowScrolling='touch'; game.arrangePlayers(); "step 2" ui.control.style.display=''; if(event.video){ game.playVideoContent(event.video); game.setChessInfo(game.me); return; } var p; for(var i=0;i'+ ''+game.data.money+''; ui.money.style.top='auto'; ui.money.style.left='auto'; ui.money.style.right='20px'; ui.money.style.bottom='15px'; ui.money.childNodes[0].style.color='rgb(111, 198, 255)'; ui.money.childNodes[1].style.fontFamily='huangcao'; ui.money.childNodes[1].style.marginRight='10px'; ui.money.childNodes[2].style.color='#FFE600'; ui.money.childNodes[3].style.fontFamily='huangcao'; ui.money.style.letterSpacing='4px'; 'step 1' lib.rank.all=lib.rank.s. concat(lib.rank.ap). concat(lib.rank.a). concat(lib.rank.am). concat(lib.rank.bp). concat(lib.rank.b). concat(lib.rank.bm). concat(lib.rank.c). concat(lib.rank.d); lib.rank.common=[]; for(var i=0;ib?1:-1; } return aa>bb?1:-1; }); if(game.data.character.length==0||!game.data.challenge){ game.data.character=lib.rank.common.randomGets(3); game.data.challenge=game.getLeaderList(); game.saveData(); } var fixButton=function(button){ var rarity=game.getRarity(button.link); if(rarity!='common'){ var intro=button.node.intro; intro.classList.add('showintro'); intro.style.fontFamily='huangcao'; intro.style.fontSize='20px'; intro.style.top='67px'; intro.style.left='1px'; switch(rarity){ case 'rare':intro.dataset.nature='waterm';break; case 'epic':intro.dataset.nature='thunderm';break; case 'legend':intro.dataset.nature='metalm';break; } intro.innerHTML=get.translation(rarity); } } game.leaderLord=['leader_caocao','leader_liubei','leader_sunquan']; var dialog1=ui.create.dialog('选择君主'); event.dialog1=dialog1; dialog1.classList.add('fixed'); dialog1.classList.add('fullheight'); dialog1.classList.add('halfleft'); dialog1.add([game.leaderLord,'character']); var i; for(i=0;ib?1:-1; }); captnode.innerHTML=''; for(i=0;i3){ event.removeCharacter.style.opacity=1; } if(game.data.money<150&&!game.data._arena){ event.enterArena.style.opacity=0.5; } else{ event.enterArena.style.opacity=1; } if(game.data.money<100){ event.addCharacter.style.opacity=0.5; } else{ event.addCharacter.style.opacity=1; } initcapt(); },200); },200); },500); }; var zhaomu=function(){ if(_status.qianfan||_status.kaibao) return; if(game.data.money<100) return; _status.chessclicked=true; _status.zhaomu=true; event.removeCharacter.style.opacity=0.5; event.fight.style.opacity=0.5; clearSelected(); for(var i=0;i=100){ event.addCharacter.style.opacity=1; } if(game.data.money>=150){ event.enterArena.style.opacity=1; } node.delete(); dialog1.buttons.remove(node); } initcapt(); }); }; event.removeCharacter=ui.create.control('遣返','nozoom',qianfan); if(game.data.character.length<=3){ event.removeCharacter.style.opacity=0.5; } event.fight=ui.create.control('开始战斗','nozoom',function(){ if(_status.kaibao||_status.zhaomu||_status.qianfan) return; _status.enemylist=[]; _status.mylist=[]; if(selected.lord.length){ _status.mylist.push(selected.lord[0].link); _status.lord=selected.lord[0].link; } if(selected.character.length){ for(var i=0;i0){ switch(difficulty){ case 'leader_easy':reward+=10*numdel;break; case 'leader_medium':reward+=20*numdel;break; case 'leader_hard':reward+=40*numdel;break; } } var punish=0; for(var i=0;i<_status.mylist.length;i++){ switch(game.getRank(_status.mylist[i])){ case 's':punish+=25;break; case 'ap':punish+=20;break; case 'a':punish+=16;break; case 'am':punish+=12;break; case 'bp':punish+=9;break; case 'b':punish+=7;break; case 'bm':punish+=5;break; case 'c':punish+=3;break; case 'd':punish+=2;break; } } if(numdel<0){ switch(difficulty){ case 'leader_easy':punish-=5*numdel;break; case 'leader_medium':punish-=10*numdel;break; case 'leader_hard':punish-=20*numdel;break; } } game.reward=Math.max(3*_status.enemylist.length,reward-punish); if(!_status.lord){ switch(difficulty){ case 'leader_easy':game.reward+=10;break; case 'leader_medium':game.reward+=20;break; case 'leader_hard':game.reward+=40;break; } } game.resume(); }); event.custom.replace.button=function(button){ if(_status.kaibao) return; if(button.classList.contains('unselectable')&& !button.classList.contains('selected')) return; _status.chessclicked=true; button.classList.toggle('selected'); if(button.classList.contains('selected')){ selected[button.area].add(button); } else{ selected[button.area].remove(button); } switch(button.area){ case 'lord':{ for(var i=0;i5)|| (_status.qianfan&&selected.character.length>=maxq)){ dialog1.buttons[i].classList.add('unselectable'); } else{ dialog1.buttons[i].classList.remove('unselectable'); } } } break; } case 'difficulty':case 'number':{ for(var i=0;i=100){ event.addCharacter.style.opacity=1; } else{ event.addCharacter.style.opacity=0.5; } if(game.data.money>=150||game.data._arena){ event.enterArena.style.opacity=1; } else{ event.enterArena.style.opacity=0.5; } event.fight.style.opacity=1; } else if(_status.zhaomu){ _status.zhaomu=false; event.addCharacter.replace('招募',zhaomu); if(game.data.character.length>3){ event.removeCharacter.style.opacity=1; } else{ event.removeCharacter.style.opacity=0.5; } event.fight.style.opacity=1; } clearSelected(); }; game.pause(); 'step 2' if(!game.data.arena){ event.dialog1.close(); event.dialog2.close(); event.fight.close(); event.enterArena.close(); event.addCharacter.close(); event.removeCharacter.close(); } ui.arena.classList.add('leaderhide'); ui.money.hide(); game.delay(); 'step 3' ui.arena.classList.remove('leaderhide'); if(!_status.enterArena){ ui.wuxie.show(); ui.auto.show(); ui.control.style.display='none'; ui.control.style.top=''; ui.control.style.transition=''; event.finish(); } else{ game.minskin=false; event.arenanodes=[]; event.arenachoice=[]; event.arenachoicenodes=[]; event.arrangeNodes=function(){ var num=event.arenachoicenodes.length; var width=num*75+(num-1)*8; for(var i=0;i=3){ for(var i=0;i胜'; victory.style.top='auto'; victory.style.left='auto'; victory.style.right='20px'; victory.style.bottom='15px'; victory.style.fontSize='30px' victory.style.fontFamily='huangcao'; victory.firstChild.style.marginRight='5px'; ui.window.appendChild(victory); ui.refresh(victory); victory.show(); event.checkPrize=function(){ // event.kaibao=true; event.prize=[]; event.turnCard2=function(){ if(this.turned) return; _status.chessclicked=true; this.turned=true; var node=this; setTimeout(function(){ node.turned2=true; },1000); if(node.name=='chess_coin'||node.name=='chess_dust'){ node.style.transition='all 0s'; node.style.webkitTransform='none'; node.style.overflow='visible'; node.style.background='none'; node.style.boxShadow='none'; var div=ui.create.div(node); div.style.transition='all 0s'; if(node.name=='chess_coin'){ div.innerHTML=''+node.num+''; div.firstChild.style.color='rgb(255, 230, 0)'; node.$coin(); } else{ div.innerHTML=''+node.num+''; div.firstChild.style.color='rgb(111, 198, 255)'; div.firstChild.style.marginRight='3px'; node.$dust(); } div.style.fontFamily='huangcao'; div.style.fontSize='50px'; div.style.top='40px'; div.style.letterSpacing='8px'; div.style.whiteSpace='nowrap'; // div.dataset.nature='metal'; return; } node.style.transition='all ease-in 0.3s'; node.style.webkitTransform='perspective(1200px) rotateY(270deg) translateX(150px)'; node.addEventListener('webkitTransitionEnd',function(){ node.init(node.name); node.node.avatar.style.display=''; if(node.rarity){ node.node.intro.innerHTML=get.translation(node.rarity); node.node.intro.classList.add('showintro'); } node.classList.add('playerflip'); node.style.webkitTransform='none'; node.style.transition=''; if(lib.config.animation){ setTimeout(function(){ switch(game.getRarity(node.name)){ case 'rare':node.$rare();break; case 'epic':node.$epic();break; case 'legend':node.$legend();break; } },150); } }); }; setTimeout(function(){ nodes[0].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[1].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[2].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[3].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[4].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[5].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[6].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[7].delete(); },400+Math.random()*300); setTimeout(function(){ nodes[8].delete(); },400+Math.random()*300); setTimeout(function(){ var prize=new Array(6); var map=[1,2,3,4,5]; var ccount=3; var win=game.data.arena.win; var prizeValue; switch(win){ case 0:prizeValue=100;break; case 1:prizeValue=120;break; case 2:prizeValue=150;break; case 3:prizeValue=190;break; case 4:prizeValue=240;break; case 5:prizeValue=300;break; case 6:prizeValue=370;break; case 7:prizeValue=450;break; case 8:prizeValue=540;break; case 9:prizeValue=640;break; case 10:prizeValue=750;break; case 11:prizeValue=870;break; case 12:prizeValue=1000;break; } if(Math.random()<0.4){ if(win>=3&&Math.random()<0.5){ ccount=4; prizeValue-=33; } else{ ccount=2; prizeValue+=33; } } prizeValue-=100; while(ccount--){ prize[map.randomRemove()]=game.getLeaderCharacter(); } if(map.length){ prizeValue/=map.length; } while(map.length){ var val=Math.round((Math.random()*0.4+0.8)*prizeValue); if(Math.random()<0.7){ prize[map.shift()]=['chess_coin',Math.max(Math.ceil(Math.random()*5),val)]; } else{ val=Math.round(val/3); prize[map.shift()]=['chess_dust',Math.max(Math.ceil(Math.random()*3),val)]; } } for(var i=1;i=4&&!bosses.childNodes[i].classList.contains('glow')){ bosses.childNodes[i].classList.add('forbidden'); } else{ bosses.childNodes[i].classList.remove('forbidden'); } } if(num){ if(!event.asboss){ event.asboss=ui.create.control('应战',function(){ _status.boss=true; ui.click.ok(); }); } } else{ if(event.asboss){ event.asboss.close(); delete event.asboss; } } addToButton(); }; for(var i=0;igame.data.arena.dead.length; }, direct:true, delay:0, preservecancel:true, content:function(){ "step 0" var list=game.data.arena.arenachoice.slice(0); for(var i=0;i

' for(var i=0;i'+ (skill.chance(targets[i],player)*100).toFixed(2)+'%
'; } str+='

' } return str; }, chance:function(target,player){ var chance; var renyi=player.skills.contains('leader_renyi'); switch(target.hp){ case 1:chance=0.7;break; case 2:chance=0.4;break; default:chance=0.2;break; } switch(target.num('he')){ case 0:break; case 1:chance/=1.2;break; case 2:chance/=1.4;break; case 3:chance/=1.7;break; default:chance/=2;break; } switch(game.getRarity(target.name)){ case 'common':{ if(renyi) chance*=2; break; } case 'rare':{ chance/=2; if(renyi) chance*=2; break; } case 'epic':{ chance/=5; if(renyi) chance*=1.5; break; } case 'legend':{ chance/=15; if(renyi) chance*=1.2; break; } } return Math.min(1,chance); }, filter:function(){ return game.data.dust>=10; }, filterTarget:function(card,player,target){ return game.isChessNeighbour(player,target)&&!game.data.character.contains(target.name); }, content:function(){ var chance=lib.skill.leader_zhaoxiang.chance(target,player); game.changeDust(-10); if(Math.random()0; }, content:function(){ switch(_status.difficulty){ case 'leader_easy':game.reward+=2*trigger.num;break; case 'leader_medium':game.reward+=4*trigger.num;break; case 'leader_hard':game.reward+=6*trigger.num;break; } } }, leader_renyi:{ unique:true, }, leader_mouduan:{ unique:true, global:'leader_mouduan2' }, leader_mouduan2:{ mod:{ chessMove:function(player,current){ if(player.side&&player.name!=_status.lord) return current+1; } } }, tongshuai:{ unique:true, forbid:['guozhan'], init:function(player){ player.storage.tongshuai={ list:[], owned:{}, player:player, get:function(num){ if(typeof num!='number') num=1; var player=this.player; while(num--){ var name=player.storage.tongshuai.unowned.shift(); if(!name) return; var skills=lib.character[name][3].slice(0); for(var i=0;i
【'+get.translation(skill)+ '】
'+lib.translate[skill+'_info']+'
'); } } }, mark:true }, tongshuai1:{ trigger:{global:'gameStart'}, forced:true, popup:false, priority:10, content:function(){ for(var i=0;i1){ player.storage.tongshuai.get(2); } else if(player.storage.tongshuai.unowned.length==1){ player.storage.tongshuai.get(); } else{ player.removeSkill('tongshuai'); } } }, tongshuai2:{ audio:2, trigger:{player:['phaseBegin','phaseEnd'],global:'gameStart'}, filter:function(event,player,name){ if(!player.skills.contains('tongshuai')) return false; if(name=='phaseBegin'&&game.phaseNumber==1) return false; return true; }, priority:-9, forced:true, popup:false, content:function(){ var slist=player.storage.tongshuai.owned; var list=[]; for(var i in slist){ list.push(i); } if(event.isMine()){ event.dialog=ui.create.dialog('选择获得一项技能',[list,'character']); if(trigger.name=='game'){ event.control=ui.create.control(); } else{ event.control=ui.create.control(['cancel']); } event.clickControl=function(link){ if(link!='cancel'){ var currentname=event.dialog.querySelector('.selected.button').link; var mark=player.marks.tongshuai; if(trigger.name=='game'){ mark.hide(); mark.style.webkitTransform='scale(0.8)'; mark.style.transition='all 0.3s'; setTimeout(function(){ mark.style.transition='all 0s'; ui.refresh(mark); mark.setBackground(currentname,'character'); if(mark.firstChild){ mark.firstChild.remove(); } setTimeout(function(){ mark.style.transition=''; mark.show(); mark.style.webkitTransform=''; },50); },500); } else{ mark.setBackground(currentname,'character'); } player.additionalSkills.tongshuai=link; player.logSkill('tongshuai2'); game.log(get.translation(player)+'获得技能'+get.translation(link)); player.popup(link); for(var i=0;i0; }, content:function(){ player.storage.tongshuai.get(); } }, cangming:{ enable:'phaseUse', usable:1, unique:true, filter:function(event,player){ if(player.isTurnedOver()) return false; var suits=[]; var hs=player.get('h'); for(var i=0;i=4) return true; } return false; }, filterCard:function(card){ var suit=get.suit(card); for(var i=0;i1) break; } } if(num<=1) return; if(_status.currentPhase==player&&player.num('h')=6){ if(typeof card=='string') return; if(card.name=='wuzhong') return; if(card.name=='shunshou') return; if(card.name=='yuanjiao') return; if(card.name=='yiyi') return; if(!player.skills.contains('cangming2')) return [0,0,0,0]; } } }, result:{ target:function(player){ var num=0; for(var i=0;i1) break; } } if(num<=1) return 0; return -10; } } }, }, cangming2:{ trigger:{player:'phaseBegin'}, forced:true, popup:false, content:function(){ for(var i=0;i0; }, check:function(event,player){ var targets=lib.skill.guanchuan.getTargets(player,event.targets[0]); var eff=0; for(var i=0;i0; }, content:function(){ var targets=lib.skill.guanchuan.getTargets(player,trigger.targets[0]); for(var i=0;i1&&lib.filter.filterCard({name:'sha'},player); }, filterCard:{name:'sha'}, selectCard:2, check:function(card){ var num=0; var player=_status.event.player; for(var i=0;i0){ num++; if(num>1) return 8-ai.get.value(card); } } return 0; }, selectTarget:[1,Infinity], discard:false, prepare:function(cards,player,targets){ player.$throw(cards); player.line(targets); }, filterTarget:function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target)&& get.distance(player,target,'pure')<=5; }, content:function(){ targets.sort(lib.sort.seat); player.useCard({name:'sha'},cards,targets,'luanjian').animate=false; }, multitarget:true, ai:{ order:function(){ return lib.card.sha.ai.order+0.1; }, result:{ target:function(player,target){ var added=false; if(!player.skills.contains('unequip')){ added=true; player.skills.push('unequip'); } var eff=ai.get.effect(target,{name:'sha'},player,target); if(added){ player.skills.remove('unequip'); } return eff; } }, effect:{ player:function(card,player){ if(_status.currentPhase!=player) return; if(card.name=='sha'&&player.num('h','sha')<2&&player.num('h')<=player.hp){ var num=0; var player=_status.event.player; for(var i=0;i1) return [0,0,0,0]; } } } } }, } }, zhiming:{ trigger:{source:'damageBegin'}, filter:function(event,player){ return get.distance(event.player,player,'attack')>1&&event.card&&event.card.name=='sha'; }, forced:true, content:function(){ trigger.num++; } }, lianshe:{ mod:{ cardUsable:function(card,player,num){ if(card.name=='sha'){ return num+get.cardCount(true,player)-get.cardCount('sha',player); } }, attackFrom:function(from,to,distance){ return distance-1; } }, }, pianyi:{ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ return !player.getStat('damage'); }, content:function(){ "step 0" player.chooseToMove(2,'是否发动【翩仪】?'); "step 1" if(result.bool){ player.logSkill('pianyi'); } } }, lingdong:{ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ return get.cardCount('sha',player)>0; }, content:function(){ "step 0" player.chooseToMove(get.cardCount('sha',player),'是否发动【移动射击】?'); "step 1" if(result.bool){ player.logSkill('lingdong'); } } }, _noactpunish:{ trigger:{player:'useCard'}, filter:function(event,player){ return _status.currentPhase==player&&event.targets&&(event.targets.length>1||event.targets[0]!=player); }, forced:true, popup:false, content:function(){ player.addTempSkill('noactpunish','phaseAfter'); } }, noactpunish:{}, _phasequeue:{ trigger:{player:'phaseBegin'}, forced:true, popup:false, content:function(){ var current=ui.chessinfo.querySelector('.glow2'); if(current){ current.classList.remove('glow2'); } for(var i=0;i0; }, content:function(){ "step 0" var move=player.skills.contains('noactpunish')?2:1; move=game.checkMod(player,move,'chessMove',player.get('s')); player.chooseToMove(move).phasing=true; "step 1" if(!result.bool){ var skill=player.getStat().skill; skill._chessmove--; if(typeof skill._chessmovetried=='number'){ skill._chessmovetried++; } else{ skill._chessmovetried=1; } } }, ai:{ order:5, result:{ playerx:function(player){ var nh=player.num('h'); if(!player.num('h','sha')&& !player.num('h','shunshou')&& !player.num('h','bingliang')){ if(nh<=Math.min(3,player.hp)) return Math.random()-0.3; else if(nh<=Math.min(2,player.hp)) return Math.random()-0.4; return Math.random()-0.5; } var neighbour; neighbour=player.getNeighbour(0,1); if(neighbour&&neighbour.side!=player.side){ if(get.distance(player,neighbour,'attack')<1) return 1; return 0; } neighbour=player.getNeighbour(0,-1); if(neighbour&&neighbour.side!=player.side){ if(get.distance(player,neighbour,'attack')<1) return 1; return 0; } neighbour=player.getNeighbour(1,0); if(neighbour&&neighbour.side!=player.side){ if(get.distance(player,neighbour,'attack')<1) return 1; return 0; } neighbour=player.getNeighbour(-1,0); if(neighbour&&neighbour.side!=player.side){ if(get.distance(player,neighbour,'attack')<1) return 1; return 0; } return 1; }, player:function(player){ if(player.getStat().skill._chessmovetried>=10){ return 0; } var x=lib.skill._chessmove.ai.result.playerx(player); if(player.isMad()) return -x; return x; } } } }, _chessswap:{ trigger:{player:['phaseBegin','chooseToUseBegin','chooseToRespondBegin','chooseToDiscardBegin','chooseToCompareBegin', 'chooseButtonBegin','chooseCardBegin','chooseTargetBegin','chooseCardTargetBegin','chooseControlBegin', 'chooseBoolBegin','choosePlayerCardBegin','discardPlayerCardBegin','gainPlayerCardBegin']}, forced:true, priority:100, popup:false, filter:function(event,player){ if(event.autochoose&&event.autochoose()) return false; return player.isUnderControl(); }, content:function(){ game.modeSwapPlayer(player); }, }, _chesscenter:{ trigger:{player:['phaseBegin','useCardBegin','useSkillBegin','respondBegin','damageBegin','loseHpBegin'], target:'useCardToBegin'}, forced:true, priority:100, popup:false, content:function(){ player.chessFocus(); }, }, boss_fengxing:{ mod:{ chessMove:function(player,current){ return current+2; }, attackFrom:function(from,to,current){ return current-2; }, }, trigger:{player:'phaseDrawBegin'}, forced:true, content:function(){ trigger.num+=2; } }, boss_chiyu:{ enable:'phaseUse', usable:1, filterCard:{color:'red'}, nodelay:true, check:function(card){return 8-ai.get.value(card);}, filterTarget:function(card,player,target){ return get.distance(player,target)<=5&&player!=target; }, filter:function(event,player){ return player.num('h',{color:'red'})>0; }, selectTarget:-1, content:function(){ target.damage('fire'); }, line:'fire', ai:{ order:1, result:{ target:function(player,target){ return ai.get.damageEffect(target,player,target,'fire'); } } } }, boss_tenglong:{ enable:'phaseUse', usable:1, position:'he', filterCard:{type:'equip'}, init:function(player){ player.forcemin=true; }, check:function(card){ var player=_status.currentPhase; if(player.num('he',{subtype:get.subtype(card)})>1){ return 12-ai.get.equipValue(card); } return 8-ai.get.equipValue(card); }, filter:function(event,player){ return player.num('he',{type:'equip'}); }, filterTarget:function(card,player,target){ return player!=target&&get.distance(player,target)<=2; }, content:function(){ target.damage(3,'fire'); }, ai:{ order:9, result:{ target:function(player,target){ return ai.get.damageEffect(target,player,target,'fire'); } } } }, boss_wuying:{ mod:{ globalTo:function(from,to,distance){ return distance+2; }, chessMove:function(player,current){ return current-1; } } }, boss_wushang:{ trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ for(var i=0;i对阵
  • n人对战n人的模式,由单人控制,开始游戏后随机分配位置与出牌顺序
  • '+ '每人在出牌阶段有一次移动的机会,若一名角色在移动之前使用过指定其他角色为目标的牌,该回合可移动的最大距离为2,否则最大距离为1
  • '+ '任何卡牌或技能无法指定位置相隔8个格以上的角色为目标
  • '+ '杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚
  • '+ '开启交替行动后,在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差
'+ '
对阵
  • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
  • '+ '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令
  • '+ '战斗中有君主出场时可招降敌将,成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降,无论成功还是失败,都会扣除10招募令
  • '+ '挑战武将会与该武将以及与其强度相近的武将进行战斗,敌方人数与我方出场人数相同,但不少于3。胜利后可通过招募令招募该武将
  • '+ '竞技场:
    随机选择9名武将,每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。

    战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。

    战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场

    当取得12场胜利或所有武将全部阵亡后结束,并根据胜场数获得随机奖励' }, config:[ function(game,lib,get,ui){ var current=get.config('chess_mode'); if(typeof current!=='string'){ game.saveConfig('chess_mode','combat',true); current='combat'; } return ui.create.switcher('chess_mode',['combat','leader'],current,function(){ ui.click.sidebar.local.apply(this,arguments); window.location.reload(); }); }, function(game,lib,get,ui){ if(get.config('chess_mode')!='leader') return; var current=get.config('chess_leader_save'); if(typeof current!=='string'){ current='save1'; game.saveConfig('chess_leader_save',current,true); } return ui.create.switcher('chess_leader_save',['save1','save2','save3','save4','save5'],current,function(){ ui.click.sidebar.local.apply(this,arguments); window.location.reload(); }); }, function(game,lib,get,ui){ if(get.config('chess_mode')!='leader') return; var switcher=ui.create.line('清除进度',function(){ var node=this; if(node._clearing){ game.save(get.config('chess_leader_save'),null); window.location.reload(); return; } node._clearing=true; node.innerHTML='单击以确认 (3)'; setTimeout(function(){ node.innerHTML='单击以确认 (2)'; setTimeout(function(){ node.innerHTML='单击以确认 (1)'; setTimeout(function(){ node.innerHTML='清除进度'; delete node._clearing; },1000); },1000); },1000); }); return switcher; }, function(game,lib,get,ui){ if(get.config('chess_mode')!='leader'){ return 'battle_number'; } }, function(game,lib,get,ui){ if(get.config('chess_mode')!='leader'){ return 'ban_weak'; } }, function(game,lib,get,ui){ if(get.config('chess_mode')!='leader'){ return 'free_choose'; } }, function(game,lib,get,ui){ if(get.config('chess_mode')!='leader'){ return 'change_choice'; } }, function(game,lib,get,ui){ if(get.config('chess_mode')=='leader'){ return; } var current=get.config('chess_ordered'); if(typeof current!=='boolean'){ game.saveConfig('chess_ordered',true,true); current=true; } return ui.create.switcher('chess_ordered',current,ui.click.sidebar.local2); }, function(game,lib,get,ui){ if(get.config('chess_mode')=='leader'){ return; } var current=get.config('chess_character'); if(typeof current!=='boolean'){ game.saveConfig('chess_character',true,true); current=true; } return ui.create.switcher('chess_character',current,ui.click.sidebar.local2); },function(game,lib,get,ui){ var current=get.config('chessscroll_speed'); if(typeof current!=='number'){ game.saveConfig('chessscroll_speed',20,true); current=20; } return ui.create.switcher('chessscroll_speed',[0,10,20,30],current,ui.click.sidebar.local); } ], }