'use strict'; mode.brawl={ start:function(){ var dialog=ui.create.dialog(); dialog.classList.add('fixed'); dialog.classList.add('scroll1'); dialog.classList.add('scroll2'); dialog.classList.add('fullwidth'); dialog.classList.add('fullheight'); dialog.classList.add('noupdate'); dialog.classList.add('character'); dialog.contentContainer.style.overflow='visible'; dialog.style.overflow='hidden'; dialog.content.style.height='100%'; dialog.contentContainer.style.transition='all 0s'; var packnode=ui.create.div('.packnode',dialog); lib.setScroll(packnode); var clickCapt=function(){ var active=this.parentNode.querySelector('.active'); if(active){ if(active==this) return; for(var i=0;i'+active.nodes[1].innerHTML+''); var ul=uiintro.querySelector('ul'); if(ul){ ul.style.width='180px'; } uiintro.add(ui.create.div('.placeholder')); return uiintro; },250); _status.brawl=info.content; game.switchMode(info.mode); if(info.init){ info.init(); } } }); start.style.position='absolute'; start.style.left='auto'; start.style.right='10px'; start.style.top='auto'; start.style.bottom='10px'; start.style.width='80px'; start.style.height='80px'; start.style.lineHeight='80px'; start.style.margin='0'; start.style.padding='5px'; start.style.fontSize='72px'; start.style.zIndex=3; start.style.transition='all 0s'; for(var i in lib.brawl){ createNode(i); } if(!lib.storage.currentBrawl){ clickCapt.call(packnode.firstChild); } }, brawl:{ duzhansanguo:{ name:'毒战三国', mode:'identity', intro:'牌堆中额外添加10%的毒', showcase:function(init){ var node=this; var func=function(){ var card=game.createCard('du'); node.nodes.push(card); card.style.position='absolute'; var rand1=Math.round(Math.random()*100); var rand2=Math.round(Math.random()*100); var rand3=Math.round(Math.random()*40)-20; card.style.left='calc('+rand1+'% - '+rand1+'px)'; card.style.top='calc('+rand2+'% - '+rand2+'px)'; card.style.transform='scale(0.8) rotate('+rand3+'deg)'; card.style.opacity=0; node.appendChild(card); ui.refresh(card); card.style.opacity=1; card.style.transform='scale(1) rotate('+rand3+'deg)'; if(node.nodes.length>7){ setTimeout(function(){ while(node.nodes.length>5){ node.nodes.shift().delete(); } },500); } }; if(init){ node.nodes=[]; for(var i=0;i<5;i++){ func(); } } node.showcaseinterval=setInterval(func,1000); }, content:{ cardPile:function(list){ var num=Math.ceil(list.length/10); while(num--){ list.push([['heart','diamond','club','spade'].randomGet(),Math.ceil(Math.random()*13),'du']); } return list; } }, }, daozhiyueying:{ name:'导师月英', mode:'identity', intro:'牌堆中所有非延时锦囊牌数量翻倍;移除拥有集智技能的角色', showcase:function(init){ var node=this; var player1,player2; if(init){ player1=ui.create.player().init('huangyueying'); player2=ui.create.player().init('re_huangyueying'); player1.style.left='20px'; player1.style.top='20px'; player1.style.transform='scale(0.9)'; player1.node.count.innerHTML='2'; player1.node.count.dataset.condition='mid'; player2.style.left='auto'; player2.style.right='20px'; player2.style.top='20px'; player2.style.transform='scale(0.9)'; player2.node.count.innerHTML='2'; player2.node.count.dataset.condition='mid'; this.appendChild(player1); this.appendChild(player2); this.player1=player1; this.player2=player2; } else{ player1=this.player1; player2=this.player2; } var rect1=player1.getBoundingClientRect(); var rect2=player2.getBoundingClientRect(); var left1=rect1.left+rect1.width/2-ui.arena.offsetLeft; var left2=rect2.left+rect2.width/2-ui.arena.offsetLeft; var top1=rect1.top+rect1.height/2-ui.arena.offsetTop; var top2=rect2.top+rect2.height/2-ui.arena.offsetTop; var createCard=function(wuxie){ var card; if(wuxie){ card=game.createCard('wuxie'); card.style.transform='scale(0.9)'; } else{ card=ui.create.card(null,null,true); } card.style.opacity=0; card.style.position='absolute'; card.style.zIndex=2; card.style.margin=0; return card; } var func=function(){ game.linexy([left1,top1,left2,top2]); var card=createCard(true); card.style.left='43px'; card.style.top='58px'; node.appendChild(card); ui.refresh(card); card.style.opacity=1; card.style.transform='scale(0.9) translate(137px,152px)'; setTimeout(function(){ card.delete(); },1000); player1.node.count.innerHTML='1'; setTimeout(function(){ if(!node.showcaseinterval) return; player1.node.count.innerHTML='2'; var card=createCard(); card.style.left='43px'; card.style.top='58px'; card.style.transform='scale(0.9) translate(137px,152px)'; node.appendChild(card); ui.refresh(card); card.style.opacity=1; card.style.transform='scale(0.9)'; setTimeout(function(){ card.delete(); },1000); },300); setTimeout(function(){ if(!node.showcaseinterval) return; player2.node.count.innerHTML='1'; game.linexy([left2,top2,left1,top1]); var card=createCard(true); card.style.left='auto'; card.style.right='43px'; card.style.top='58px'; node.appendChild(card); ui.refresh(card); card.style.opacity=1; card.style.transform='scale(0.9) translate(-137px,152px)'; setTimeout(function(){ card.delete(); },700); setTimeout(function(){ if(!node.showcaseinterval) return; player2.node.count.innerHTML='2'; var card=createCard(); card.style.left='auto'; card.style.right='43px'; card.style.top='58px'; card.style.transform='scale(0.9) translate(-137px,152px)'; node.appendChild(card); ui.refresh(card); card.style.opacity=1; card.style.transform='scale(0.9)'; setTimeout(function(){ card.delete(); },700); },300); },1000); }; node.showcaseinterval=setInterval(func,2200); func(); }, init:function(){ for(var i in lib.character){ var skills=lib.character[i][3] if(skills.contains('jizhi')||skills.contains('rejizhi')||skills.contains('lingzhou')){ delete lib.character[i]; } } }, content:{ cardPile:function(list){ var list2=[]; for(var i=0;i=5){ num=0; } var card=game.createCard('sha'); card.style.left='calc(50% - 52px)'; card.style.top='68px'; card.style.position='absolute'; card.style.margin=0; card.style.zIndex=2; card.style.opacity=0; node.appendChild(card); ui.refresh(card); card.style.opacity=1; card.style.transform='translate('+dx+'px,'+dy+'px)'; setTimeout(function(){ card.delete(); },700); },700); }, init:function(){ lib.skill.weiwoduzun={ mark:true, intro:{ content:'杀造成的伤害+1' }, group:['weiwoduzun_damage','weiwoduzun_lose'], subSkill:{ damage:{ trigger:{source:'damageBegin'}, forced:true, filter:function(event){ return event.card&&event.card.name=='sha'&&event.notLink(); }, content:function(){ trigger.num++; } }, lose:{ trigger:{player:'damageEnd'}, forced:true, filter:function(event){ return event.source&&event.source.isAlive(); }, content:function(){ player.removeSkill('weiwoduzun'); trigger.source.addSkill('weiwoduzun'); } } } }; lib.translate.weiwoduzun='战神'; lib.translate.weiwoduzun_bg='尊'; }, content:{ cardPile:function(list){ var num=0; for(var i=0;i4){ setTimeout(function(){ while(node.nodes.length>3){ node.nodes.shift().delete(); } },500); } }; node.list=[]; if(init){ node.nodes=[]; for(var i=0;i<3;i++){ func(); } } node.showcaseinterval=setInterval(func,1000); }, init:function(){ var map={}; var map3=[]; var list1=['司','夏','诸']; var list2=['马','侯','葛']; var exclude=['界','新','大']; for(var i in lib.character){ if(lib.filter.characterDisabled(i)) continue; var surname=lib.translate[i]; for(var j=0;j7){ nodes[i].index=0; } setPos(nodes[i]); } },1000); }, content:{ gameStart:function(){ var target=(_status.mode=='zhong')?game.zhong:game.zhu; if(get.config('double_character')){ target.init(game.me.name,game.me.name2); } else{ target.init(game.me.name); } target.hp++; target.maxHp++; target.update(); }, chooseCharacterAi:function(player,list,list2,back){ if(player==game.zhu){ return; } else{ if(get.config('double_character')){ player.init(game.me.name,game.me.name2); } else{ player.init(game.me.name); } } }, chooseCharacter:function(list,list2,num){ if(game.me!=game.zhu){ return list.slice(0,list2); } else{ if(_status.event.zhongmode){ return list.slice(0,6); } else{ return list.concat(list2.slice(0,num)); } } } } }, // baiyudujiang:{ // name:'白衣渡江', // mode:'versus', // submode:'2v2', // intro:[ // '玩家在选将时可从6-8张的武将牌里选择两张武将牌,一张面向大家可见(加入游戏),另一张是隐藏面孔(暗置)', // '选择的两张武将牌需满足以下至少两个条件:1.性别相同;2.体力上限相同;3.技能数量相同', // '每名玩家在其回合开始或回合结束时,可以选择将自己的武将牌弃置,然后使用暗置的武将牌进行剩余的游戏' // ], // content:{ // submode:'two', // chooseCharacterNum:2, // chooseCharacterAfter:function(){ // // } // } // } scene:{ name:'自创场景', mode:'identity', intro:'场景名称:
场景说明:', content:{ submode:'normal' }, nostart:true, showcase:function(init){ if(init){ this.style.transition='all 0s'; this.style.height=(this.offsetHeight-10)+'px'; this.style.overflow='scroll'; lib.setScroll(this); this.style.paddingTop='10px'; var style={marginLeft:'3px',marginRight:'3px'}; var style2={position:'relative',display:'block',left:0,top:0,marginBottom:'6px',padding:0,width:'100%'}; var line1=ui.create.div(style2,this); var current=null; var addCharacter=ui.create.node('button','添加角色',line1,function(){ line1.style.display='none'; line7.style.display='none'; line2.style.display='block'; line2_t.style.display='block'; line3.style.display='block'; line4.style.display='block'; line5.style.display='block'; line6_h.style.display='block'; line6_e.style.display='block'; line6_j.style.display='block'; capt1.style.display='block'; capt2.style.display='block'; if(line6_h.childElementCount) capt_h.style.display='block'; if(line6_e.childElementCount) capt_e.style.display='block'; if(line6_j.childElementCount) capt_j.style.display='block'; },style); var editPile=ui.create.node('button','编辑牌堆',line1,function(){ console.log(1); },style); var saveButton=ui.create.node('button','保存',line1,function(){ console.log(1); },style); var capt1=ui.create.div(style2,'','角色信息',this); var line2=ui.create.div(style2,this); line2.style.display='none'; var identity=ui.create.selectlist([['zhu','主公'],['zhong','忠臣'],['nei','内奸'],['fan','反贼']],'zhu',line2); identity.style.marginLeft='3px'; identity.style.marginRight='3px'; var position=ui.create.selectlist([['1','一号位'],['2','二号位'],['3','三号位'],['4','四号位'],['5','五号位'],['6','六号位'],['7','七号位'],['8','八号位']],'1',line2); position.style.marginLeft='3px'; position.style.marginRight='3px'; var line2_t=ui.create.div(style2,this); line2_t.style.display='none'; ui.create.node('span','体力:',line2_t); var hp=ui.create.node('input',line2_t,{width:'40px'}); hp.type='text'; ui.create.node('span','体力上限:',line2_t,{marginLeft:'20px'}); var maxHp=ui.create.node('input',line2_t,{width:'40px'}); maxHp.type='text'; var list=[]; for(var i in lib.character){ list.push([i,lib.translate[i]]); } list.sort(function(a,b){ a=a[0];b=b[0]; var aa=a,bb=b; if(aa.indexOf('_')!=-1){ aa=aa.slice(aa.indexOf('_')+1); } if(bb.indexOf('_')!=-1){ bb=bb.slice(bb.indexOf('_')+1); } if(aa!=bb){ return aa>bb?1:-1; } return a>b?1:-1; }); list.unshift(['random','随机主将']); var name1=ui.create.selectlist(list,list[0],line2); name1.style.marginLeft='3px'; name1.style.marginRight='3px'; name1.style.maxWidth='80px'; list[0][1]='随机副将'; list.unshift(['none','无副将']); var name2=ui.create.selectlist(list,list[0],line2); name2.style.marginLeft='3px'; name2.style.marginRight='3px'; name2.style.maxWidth='80px'; var capt2=ui.create.div(style2,'','添加卡牌',this); var line3=ui.create.div(style2,this); line3.style.display='none'; capt1.style.display='none'; capt2.style.display='none'; var line5=ui.create.div(style2,this); line5.style.display='none'; var pileaddlist=[]; for(var i=0;i