From eae6e90d42f1614b6ca7868e0db8a15df257a6ea Mon Sep 17 00:00:00 2001 From: libccy Date: Fri, 1 May 2015 14:16:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E7=94=B1=E9=80=89=E6=8B=A9=E5=BA=A7?= =?UTF-8?q?=E4=BD=8D=E3=80=81=E6=9A=82=E5=81=9C=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=83=E7=89=8C=E5=A0=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/extra.js | 5 ++- game/config.js | 2 +- game/game.js | 61 +++++++++++++++++++--------- layout/default/layout.css | 13 +++--- layout/newlayout/layout.css | 26 +++++++++++- mode/guozhan.js | 79 ++++++++++++++++++++++++++++++++++--- mode/identity.js | 60 +++++++++++++++++++++++++++- theme/woodden/style.css | 3 ++ 8 files changed, 214 insertions(+), 35 deletions(-) diff --git a/card/extra.js b/card/extra.js index bf90a270b..b4609bcc9 100644 --- a/card/extra.js +++ b/card/extra.js @@ -134,6 +134,9 @@ card.extra={ }, chongzhu:true, ai:{ + wuxie:function(){ + if(Math.random()<0.5) return 0; + }, basic:{ useful:4, value:4, @@ -144,7 +147,7 @@ card.extra={ if(target.classList.contains('linked')) return 1; if(ai.get.attitude(player,target)>=0) return -1; for(var i=0;i
  • 长按/鼠标悬停/右键单击(需在设置中开启)显示信息
  • 触屏模式中双指点击切换暂停
  • 键盘快捷键
    '+ '
    a切换托管
    c打开设置
    w切换不询问无懈
    暂停' }, - setPopped:function(node,func,width){ + setPopped:function(node,func,width,height){ node._poppedfunc=func; node._poppedwidth=width; + node._poppedheight=height; node.addEventListener(lib.config.touchscreen?'touchstart':'mouseenter',ui.click.hoverpopped); }, placePoppedDialog:function(dialog,e){ @@ -6538,15 +6539,14 @@ window.play={}; ui.sidebar=ui.create.div('#sidebar'); + ui.sidebar3=ui.create.div('#sidebar3'); ui.canvas=document.createElement('canvas'); ui.arena.appendChild(ui.canvas); ui.canvas.id='canvas'; ui.ctx=ui.canvas.getContext('2d'); - lib.config.hide_history=false; - if(lib.config.right_sidebar) ui.sidebar.classList.add('right'); ui.config=ui.create.div('#sidebar2.content'); ui.config.listen(function(e){ - e.stopPropagation() + e.stopPropagation(); if(_status.choosing){ if(_status.choosing.expand) _status.choosing.expand=false; else{ @@ -6556,6 +6556,7 @@ window.play={}; delete _status.choosing; } } + return false; }); ui.config.oncontextmenu=function(e){ e.stopPropagation(); @@ -6569,6 +6570,8 @@ window.play={}; ui.sidebar.style.WebkitOverflowScrolling='touch'; ui.config.style.WebkitOverflowScrolling='touch'; if(lib.config.right_sidebar){ + ui.sidebar.classList.add('right'); + ui.sidebar3.classList.add('left'); ui.config.classList.add('right'); } var folditems=[]; @@ -7261,14 +7264,14 @@ window.play={}; ui.replay=ui.create.system('重来',game.reload,true); ui.pause=ui.create.system('历史',ui.click.pause); if(!lib.config.touchscreen){ - lib.setPopped(ui.pause,ui.click.pausehistory,220); + lib.setPopped(ui.pause,ui.click.pausehistory,220,400); } if(!lib.config.show_pause){ ui.pause.style.display='none'; } ui.config2=ui.create.system('选项',ui.click.config); if(!lib.config.touchscreen){ - lib.setPopped(ui.config2,ui.click.pauseconfig,220); + lib.setPopped(ui.config2,ui.click.pauseconfig,170); } ui.wuxie=ui.create.system('不询问无懈',ui.click.wuxie,true); ui.auto=ui.create.system('托管',ui.click.auto); @@ -7349,9 +7352,14 @@ window.play={}; node2.innerHTML='已暂停'; node2.listen(function(){ _status.clicked=true; - lib.config.hide_history=!lib.config.hide_history; - if(lib.config.hide_history) ui.sidebar.hide(); - else ui.sidebar.show(); + if(ui.sidebar.classList.contains('hidden')){ + ui.sidebar.show(); + ui.sidebar3.show(); + } + else{ + ui.sidebar.hide(); + ui.sidebar3.hide(); + } }); return node; }, @@ -7591,6 +7599,7 @@ window.play={}; if(!lib.config.auto_popped) return; if(!ui.sidebar.childNodes.length) return; var uiintro=ui.create.dialog('hidden'); + uiintro.style.maxHeight='400px'; uiintro.add(ui.sidebar); return uiintro; }, @@ -7598,7 +7607,18 @@ window.play={}; if(!lib.config.auto_popped) return; if(!ui.config.childNodes.length) return; var uiintro=ui.create.dialog('hidden'); - uiintro.add(ui.config); + var node=ui.create.div('.newgame'); + var list=[['identity','身份'],['guozhan','国战'],['versus','对决']]; + for(var i=0;idiv>div{position: relative;padding-top: 6px;padding-bottom: 6px;padding-left: 8px;padding-right: 8px;text-align: center;margin:4px} #paused,#click{left: 0;top:0;width: 100%;height: 100%;z-index: 5;} #paused2{font-size: 30px;top:calc(50% - 17px);left:calc(50% - 45px);} -#sidebar,#sidebar2{left: 0;top: 0;width: 200px;height: calc(100% - 40px);text-align: left;padding: 20px;overflow-y: scroll;z-index: 6;} -#sidebar.right{left:calc(100% - 220px);} -#sidebar.right,#sidebar2.right{left: calc(100% - 240px);} +#sidebar,#sidebar2,#sidebar3{ + left: 0;top: 0;width: 200px;height: calc(100% - 40px);text-align: left;padding: 20px;overflow-y: scroll;z-index: 6; +} +#sidebar3{text-align:right} +#paused>#sidebar.right,#sidebar2.right,#sidebar3{left: calc(100% - 240px);} +#sidebar3.left{left:0;text-align:left;} .dialog.popped #sidebar, .dialog.popped #sidebar2{padding:0;} -#sidebar>div{margin: 10px;position: relative;display: block;min-height: 5px;} +#sidebar>div,#sidebar3>div{margin: 10px;position: relative;display: block;min-height: 5px;} #scrollzone1{left: 0;} #scrollzone2{left: calc(50% - 140px);} #scrollzone3{right: calc(50% - 140px);} @@ -142,7 +145,7 @@ margin-bottom: 5px; .content>.placeholder.slim{margin:1px;} .content>.placeholder.removing{margin-top: -13px;} .content{display: block;width: 100%;} -.dialog:not('.popped') .content>.config{ +.dialog:not(.popped) .content>.config{ width:200px; left:0; margin-left: 20px; diff --git a/layout/newlayout/layout.css b/layout/newlayout/layout.css index 4163e900e..31cb09308 100644 --- a/layout/newlayout/layout.css +++ b/layout/newlayout/layout.css @@ -362,7 +362,6 @@ .card[data-position='0']{top:calc(100% - 130px);left:calc(50% - 52px);} .popup[data-position='0']{top:calc(100% - 206px);left:calc(50% - 61px);} #me,#mebg{top:calc(100% - 150px);} -#control{top: calc(200% / 3 - 10px);} #handcards1,#handcards2{width: calc(50% - 95px);height: 127px;padding: 10px;} #handcards2{left: calc(50% + 75px);} .dialog{ @@ -378,7 +377,13 @@ .dialog.removing{ top:auto; } -#control{z-index:5} +#control{ + z-index:5; + top:auto; + bottom:190px; + width: calc(100% - 300px); + left:150px; +} .popup{z-index:6} .dialog.scroll1, .dialog.scroll2{ @@ -394,6 +399,23 @@ height:100%; top:0; } +.newgame{ + width:150px; + display:flex; +} +.newgame>div{ + padding-left:5px; + padding-right:5px; + padding-top:3px; + padding-bottom:3px; + position:relative; + margin:auto; + border-radius:4px; +} +.bordered{ + border:1px solid white; + box-shadow:black 0 0 2px; +} @media screen and (min-width: 1150px) { .dialog{width: 630px;left: calc(50% - 315px);} diff --git a/mode/guozhan.js b/mode/guozhan.js index edf176f69..571848d24 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -9,7 +9,6 @@ mode.guozhan={ "step 1" if(lib.storage.test){ _status.auto=true; - // ui.auto.innerHTML='手动'; ui.auto.classList.add('glow'); } game.chooseCharacter(); @@ -21,7 +20,21 @@ mode.guozhan={ } console.log(str); } - var player=game.players[Math.floor(Math.random()*game.players.length)]; + var player; + if(_status.cheat_seat){ + var seat=_status.cheat_seat.link; + if(seat==0){ + player=game.me; + } + else{ + player=game.players[game.players.length-seat]; + } + if(!player) player=game.me; + delete _status.cheat_seat; + } + else{ + player=game.players[Math.floor(Math.random()*game.players.length)]; + } event.trigger('gameStart'); game.gameDraw(player); if(get.config('ai_identity')){ @@ -32,6 +45,12 @@ mode.guozhan={ game.players[i].ai.shown=0; } } + for(var i=0;i