'use strict'; mode.brawl={ start:function(){ if(!lib.storage.scene){ lib.storage.scene={}; } 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'; game.addScene=function(name){ var scene=lib.storage.scene[name]; var brawl={ name:name, intro:scene.intro, mode:'identity', }; for(var i in lib.brawl.scene.template){ brawl[i]=lib.brawl.scene.template[i]; } brawl.content.scene=scene; lib.brawl['scene_'+name]=brawl; createNode('scene_'+name); }; game.removeScene=function(name){ delete lib.storage.scene[name]; game.save('scene',lib.storage.scene); for(var i=0;i7){ 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(null,true).init('huangyueying'); player2=ui.create.player(null,true).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','noclick'); card.style.transform='scale(0.9)'; } else{ card=ui.create.card(null,'noclick',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','noclick'); 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, fullshow:true, template:{ init:function(){ game.saveConfig('player_number',_status.brawl.scene.players.length,'identity'); }, content:{ submode:'normal', chooseCharacterFixed:true, chooseCharacterBefore:function(){ var scene=_status.brawl.scene; var playercontrol=[]; var withseat=[],withoutseat=[]; for(var i=0;ibb?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 capt9=ui.create.div(style2,'','编辑牌堆',this); capt9.style.display='none'; 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