From 5327d6136fe07894ecb33db9b17b5a96a2a19dca Mon Sep 17 00:00:00 2001 From: libccy Date: Thu, 18 Aug 2016 18:51:06 +0800 Subject: [PATCH] b --- card/sp.js | 4 +- card/swd.js | 14 +- character/hearth.js | 20 +- character/sp.js | 10 +- character/xianjian.js | 18 +- game/game.js | 82 +++++++- mode/brawl.js | 443 ++++++++++++++++++++++++++++++++++++++++-- mode/chess.js | 2 +- mode/versus.js | 16 +- 9 files changed, 558 insertions(+), 51 deletions(-) diff --git a/card/sp.js b/card/sp.js index f60df3d21..913af643a 100644 --- a/card/sp.js +++ b/card/sp.js @@ -216,7 +216,9 @@ card.sp={ }, content:function(){ 'step 0' - player.chooseToUse('是否发动【银月枪】?',{name:'sha'}).logSkill='yinyueqiang'; + var next=player.chooseToUse('是否发动【银月枪】?',{name:'sha'}); + next.logSkill='yinyueqiang'; + next.noButton=true; 'step 1' if(result.bool){ game.delay(); diff --git a/card/swd.js b/card/swd.js index cc04e8df6..c5ad23066 100755 --- a/card/swd.js +++ b/card/swd.js @@ -1517,11 +1517,11 @@ card.swd={ trigger:{player:'phaseEnd'}, direct:true, filter:function(event,player){ - return player.num('he',{suit:'spade'})>0&&player.hp0&&player.hp=3) return false; if(!event.cards) return false; return true; }, + usable:2, content:function(){ var cards=[]; for(var i=0;i0){ @@ -186,15 +187,30 @@ character.xianjian={ return num>0&&num2>=2; }, prompt:function(event,player){ + for(var i=0;i0; + if(player.storage.leiyu){ + for(var i=0;i=info.usable) enable=false; + if(info.chooseButton&&_status.event.noButton) enable=false; } if(enable){ skills.add(skills2[i]); @@ -19778,6 +19795,43 @@ if(listen) node.listen(listen); return node; }, + node:function(){ + var tagName,innerHTML,position,position2,style,divposition,listen; + for(var i=0;iposition2){ + position.insertBefore(node,position.childNodes[position2]); + } + else{ + position.appendChild(node); + } + } + if(style) HTMLDivElement.prototype.css.call(node,style); + if(divposition) HTMLDivElement.prototype.setPosition.call(node,divposition); + if(innerHTML) node.innerHTML=innerHTML; + if(listen) node.onclick=listen; + return node; + }, chat:function(){ var chat=ui.create.system('聊天',null,true); ui.chatButton=chat; @@ -29425,6 +29479,11 @@ } if(game.online){ game.send('auto'); + } + else if(_status.connectMode){ + game.broadcastAll(function(player){ + player.setNickname(player.nickname+' - 托管'); + },game.me); } } else{ @@ -29435,6 +29494,11 @@ if(game.online){ game.send('unauto'); + } + else if(_status.connectMode){ + game.broadcastAll(function(player){ + player.setNickname(player.nickname); + },game.me); } } }, diff --git a/mode/brawl.js b/mode/brawl.js index 7f5d3dee2..e31d704ce 100644 --- a/mode/brawl.js +++ b/mode/brawl.js @@ -18,6 +18,7 @@ mode.brawl={ var clickCapt=function(){ var active=this.parentNode.querySelector('.active'); if(active){ + if(active==this) return; for(var i=0;i=5){ num=0; @@ -594,6 +598,8 @@ mode.brawl={ card.node.hp.remove(); node.nodes.push(card); card.style.position='absolute'; + card.style.zIndex=2; + card.style.transition='all 2s'; var rand1=Math.round(Math.random()*100); var rand2=Math.round(Math.random()*100); var rand3=Math.round(Math.random()*40)-20; @@ -601,7 +607,26 @@ mode.brawl={ card.style.top='calc('+rand2+'% - '+(rand2*1.8)+'px)'; card.style.transform='scale(0.8) rotate('+rand3+'deg)'; node.appendChild(card); + ui.refresh(card); }; + + var list2=['qilin','dawan','zhuahuang']; + var func2=function(){ + var card=game.createCard(list2.shift()); + node.nodes.push(card); + card.style.position='absolute'; + card.style.zIndex=2; + card.style.transition='all 2s'; + 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='rotate('+rand3+'deg)'; + node.appendChild(card); + ui.refresh(card); + }; + if(init){ node.nodes=[]; } @@ -610,9 +635,36 @@ mode.brawl={ node.nodes.shift().remove(); } } - for(var i=0;i<8;i++){ + for(var i=0;i<5;i++){ func(); } + for(var i=0;i<3;i++){ + func2(); + func(); + } + var func3=function(){ + for(var i=0;i
场景说明:', + 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