diff --git a/game/config.js b/game/config.js index b9d9dbbeb..e7a59437d 100644 --- a/game/config.js +++ b/game/config.js @@ -261,8 +261,8 @@ window.config={ right_sidebar:false, button_press:true, damage_shake:true, - slim_player:true, log_highlight:true, + player_border:'normal', modeconfig:false, gameconfig:false, diff --git a/game/game.js b/game/game.js index c0464c8fc..25f1fd3a5 100644 --- a/game/game.js +++ b/game/game.js @@ -810,18 +810,21 @@ click:'单击', }, }, - slim_player:{ - name:'窄边框', - init:true, + player_border:{ + name:'边框宽度', + init:'normal', unfrequent:true, - onclick:function(bool){ - game.saveConfig('slim_player',bool); - if(bool){ - ui.arena.classList.add('slim_player'); - } - else if(lib.config.layout!='long'){ - ui.arena.classList.remove('slim_player'); - } + item:{ + slim:'窄', + normal:'中', + wide:'宽' + }, + onclick:function(item){ + game.saveConfig('player_border',item); + if(item=='wide'&&lib.config.layout=='long'){ + item='normal'; + } + ui.arena.dataset.player_border=item; } }, reduce_radius:{ @@ -4898,11 +4901,11 @@ } } } - if(lib.config.slim_player||lib.config.layout=='long'){ - ui.arena.classList.add('slim_player'); + if(lib.config.player_border=='wide'&&lib.config.layout=='long'){ + ui.arena.dataset.player_border='normal'; } else{ - ui.arena.classList.remove('slim_player'); + ui.arena.dataset.player_border=lib.config.player_border; } setTimeout(function(){ ui.arena.show(); @@ -28052,9 +28055,12 @@ if(lib.config.low_performance){ ui.arena.classList.add('low_performance'); } - if(lib.config.slim_player||lib.config.layout=='long'){ - ui.arena.classList.add('slim_player'); - } + if(lib.config.player_border=='wide'&&lib.config.layout=='long'){ + ui.arena.dataset.player_border='normal'; + } + else{ + ui.arena.dataset.player_border=lib.config.player_border; + } if(lib.config.reduce_radius){ ui.window.classList.add('reduce_radius'); } diff --git a/layout/default/hearthstone.css b/layout/default/hearthstone.css deleted file mode 100644 index c666e6f30..000000000 --- a/layout/default/hearthstone.css +++ /dev/null @@ -1,392 +0,0 @@ -#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);} -#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);} -#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);} -#arena.stone>.player.minskin[data-position='6']{top:calc(100% - 305px);left:calc(100% - 260px);} -#arena.stone>.card[data-position='6']{top:calc(100% - 297px);left:calc(100% - 252px);} -#arena.stone>.popup[data-position='6']{top:calc(100% - 340px);left:calc(100% - 252px);} -#arena.stone>.player.minskin[data-position='7']{top:calc(100% - 305px);left:140px;} -#arena.stone>.card[data-position='7']{top:calc(100% - 297px);left:148px;} -#arena.stone>.popup[data-position='7']{top:calc(100% - 340px);left:148px;} -#arena.stone>.player.minskin[data-position='5']{top:calc(100% - 305px);left:0;} -#arena.stone>.card[data-position='5']{top:calc(100% - 297px);left:8px;} -#arena.stone>.popup[data-position='5']{top:calc(100% - 340px);left:8px;} - -#arena.stone>.player.minskin[data-position='9']{top:30px;left:calc(100% - 120px);} -#arena.stone>.card[data-position='9']{top:38px;left:calc(100% - 112px);} -#arena.stone>.popup[data-position='9']{top:160px;left:calc(100% - 112px);} -#arena.stone>.player.minskin[data-position='11']{top:10px;left:calc(100% - 260px);} -#arena.stone>.card[data-position='11']{top:18px;left:calc(100% - 252px);} -#arena.stone>.popup[data-position='11']{top:140px;left:calc(100% - 252px);} -#arena.stone>.player.minskin[data-position='10']{top:10px;left:140px;} -#arena.stone>.card[data-position='10']{top:18px;left:148px;} -#arena.stone>.popup[data-position='10']{top:140px;left:148px;} -#arena.stone>.player.minskin[data-position='8']{top:30px;left:0;} -#arena.stone>.card[data-position='8']{top:38px;left:8px;} -#arena.stone>.popup[data-position='8']{top:160px;left:8px;} -#arena:not(.chess).mobile>.player[data-position='0']>.name{ - top:30px; -} -#arena .player>.name{ - top:36px; -} -#arena.slim_player .player>.name{ - top:33px; -} -#arena .player.linked>.name{ - transform: rotate(90deg) translate(120px,-96px); -} -#arena .player.linked>.name.name2{ - transform: rotate(90deg) translate(98px,-31px); -} - -#arena.oldlayout .player.linked>.name{ - transform: none !important; -} -#arena.oldlayout .player.linked>.name.name2{ - transform: none !important; -} - -.player>.identity.menubutton.round{ - padding: 0; - transform: scale(1.2) translate(-2px,2px); -} -.card .wunature{ - top:74px; - left:6px; - right: auto; -} -.player .equips{ - z-index: 4; -} - -#arena:not(.chess).mobile .player[data-position='0']:not(.minskin)>.identity{ - left: 102px; - top: -7px; -} - -#deck-builder{ - overflow: hidden; -} -#deck-builder>.shadowed.list{ - width: 200px; - height: 100%; - right: 0; - top:0; - border-radius: 0px; - transform: translateX(200px); - opacity: 0; -} -#deck-builder.shown>.shadowed.list{ - transform: none; - opacity: 1; -} -#deck-builder>.shadowed.list>.menubutton.large.create{ - position: absolute; - bottom: 10px; - left: auto; - right: 10px; - margin: 0; - padding: 0; - width: 180px; - height: 50px; - font-size: 36px; - line-height: 50px; - z-index: 2; -} -#deck-builder>.shadowed.list>.list-container{ - width:100%; - left:0; - height: calc(100% - 60px); - overflow-y: scroll; - overflow-x: visible; - text-align: left; -} -#deck-builder>.shadowed.list>.list-container:not(.deck){ - z-index: 1; -} -#deck-builder>.shadowed.list>.list-container.deck{ - pointer-events: none; - opacity: 0; -} -#deck-builder>.shadowed.list>.list-container.deck.shown{ - pointer-events: auto; - opacity: 1; -} -#deck-builder>.shadowed.list>.list-container.deck>.card{ - zoom:0.8; - margin-bottom: 15px; - margin-top: 0; - transition: all 0s; -} -#deck-builder>.shadowed.list>.list-container.deck>.card:nth-child(2n+1){ - margin-left: 15px; -} -#deck-builder>.shadowed.list>.list-container.deck>.card:nth-child(2n){ - margin-left: 7px; -} -#deck-builder>.shadowed.list>.list-container.deck>.card:first-child, -#deck-builder>.shadowed.list>.list-container.deck>.card:first-child+div{ - margin-top: 15px; -} -.deckitem{ - position: relative; - width: 170px; - margin-left: 15px; - margin-right: 0; - padding-left: 0; - padding-right: 0; - padding-top: 5px; - padding-bottom: 5px; - margin-top: 15px; - margin-bottom: 0px; - text-align: left; - font-size:24px; - line-height:30px; - font-family:'xinwei'; - border-radius: 40px 4px 4px 40px; - background-size: cover; - white-space: nowrap; - transition: all 0s; -} -.deckitem.random{ - border-radius: 4px; - text-align: center; -} -.deckitem.random>span{ - margin-left: 0; -} -.deckitem:last-child{ - margin-bottom: 15px; -} -.deckitem>span{ - margin-left: 46px; -} -.deckitem>.menubutton.round{ - position: absolute; - left: -1px; - top: -2px; - width: 34px; - height: 34px; -} -#deck-builder>.shadowed.career{ - width: 240px; - height: 240px; - right: 220px; - bottom: 20px; - opacity: 0; - transform: scale(0) translateX(300px); - transform-origin: right bottom; - transition-duration: 0.3s; - z-index: 8; -} -#deck-builder>.shadowed.career.shown{ - transform: scale(1) translateX(0); - opacity: 1; -} -#deck-builder>.shadowed.career>div{ - width: 80px; - height: 80px; - margin: 0; - padding: 0; - position: relative; - display: inline-block; -} -#deck-builder>.shadowed.career>div>.menubutton.round{ - left: 15px; - top: 5px; -} -#deck-builder>.shadowed.career>div>.text{ - font-size: 12px; - width: 100%; - text-align: center; - top: 58px; -} -#deck-builder>.dialog.fixed{ - left: auto; - right: 240px; - width: calc(100% - 280px); - /*opacity: 0;*/ - animation: none; - -webkit-animation:none; - /*transform: scale(0.8);*/ - /*pointer-events: none;*/ - /*-webkit-animation:dialog_start2 0.5s;*/ - transition: all 0.5s; -} -#deck-builder:not(.shown)>.dialog.fixed{ - opacity: 0; - transform: scale(0.8); - pointer-events: none; -} -#deck-builder>.dialog.fixed.shown{ - opacity: 1; - transform: scale(1); - pointer-events: auto; -} -#deck-builder>.controls{ - opacity: 0; - height: 50px; - width: calc(100% - 200px); - bottom: 10px; - left: 0; - text-align: right; - z-index: 9; - pointer-events: none; -} -#deck-builder>.controls>div{ - position: relative; - margin-top:5px; - margin-left: 5px; - margin-right: 5px; -} -#deck-builder>.controls>.card-count{ - position: absolute; - width: 100px; - height: 100%; - left: calc(50% - 50px); - text-align: center; - font-family: 'xinwei'; - font-size: 24px; - line-height: 50px; - margin: 0; -} -#deck-builder>.controls>div:last-child{ - margin-right: 40px; - white-space: nowrap; - -webkit-user-select: text; -} -#deck-builder>.controls.shown{ - opacity: 1; - pointer-events: auto; -} -#arena>.player.stone_deck{ - transform: scale(1) translateX(100px); - opacity: 0; - transition: all 0.5s; - left: calc(5% + 50px); - top:calc(50% - 90px); -} -#arena>.player.stone_deck.shown{ - transform: scale(0.8); - opacity: 1; -} -#arena>.player.stone_deck.shown.removing{ - transform: scale(0.6) translateX(-100px); -} -#arena>.player.stone_deck>div:not(.avatar):not(.avatar2){ - display: none !important; -} - - -/*#arena>.skillbar>.skillbartext:hover{ - opacity: 1; -}*/ -@-webkit-keyframes skillbarglow{ - 0%{box-shadow: rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(255, 0, 0, 0.4) 0 0 5px} - 50%{box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(255, 0, 0, 0.4) 0 0 5px, - rgba(255, 0, 0, 0.4) 0 0 12px, rgba(255, 0, 0, 1) 0 0 30px, rgba(255, 0, 0, 0.2) 0 0 30px} - 100%{box-shadow: rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(255, 0, 0, 0.4) 0 0 5px} -} - -div[data-career='mage']{ - background-image: url('../../../image/class/mage.png'); - background-size:cover; -} -div[data-career='druid']{ - background-image: url('../../../image/class/druid.png'); - background-size:cover; -} -div[data-career='hunter']{ - background-image: url('../../../image/class/hunter.png'); - background-size:cover; -} -div[data-career='shaman']{ - background-image: url('../../../image/class/shaman.png'); - background-size:cover; -} -div[data-career='paladin']{ - background-image: url('../../../image/class/paladin.png'); - background-size:cover; -} -div[data-career='rogue']{ - background-image: url('../../../image/class/rogue.png'); - background-size:cover; -} -div[data-career='priest']{ - background-image: url('../../../image/class/priest.png'); - background-size:cover; -} -div[data-career='warrior']{ - background-image: url('../../../image/class/warrior.png'); - background-size:cover; -} -div[data-career='warlock']{ - background-image: url('../../../image/class/warlock.png'); - background-size:cover; -} -div[data-career='knight']{ - background-image: url('../../../image/class/knight.png'); - background-size:cover; -} - -div[data-careercolor='mage']{ - background-image: linear-gradient(rgba(139, 216, 245,0.8),rgba(90, 172, 204,0.8)); - box-shadow: rgb(62, 137, 167) 0 0 0 1px; -} -div[data-careercolor='druid']{ - background-image: linear-gradient(rgba(158, 87, 13,0.8),rgba(140, 77, 11,0.8)); - box-shadow: rgb(101, 54, 5) 0 0 0 1px; -} -div[data-careercolor='hunter']{ - background-image: linear-gradient(rgba(70, 162, 1,0.8),rgba(62, 138, 5,0.8)); - box-shadow: rgb(39, 86, 3) 0 0 0 1px; -} -div[data-careercolor='shaman']{ - background-image: linear-gradient(rgba(11, 99, 230,0.8),rgba(0, 85, 212,0.8)); - box-shadow: rgb(4, 60, 142) 0 0 0 1px; -} -div[data-careercolor='paladin']{ - background-image: linear-gradient(rgba(255, 236, 11,0.8),rgba(214, 182, 66,0.8)); - box-shadow: rgb(177, 138, 53) 0 0 0 1px; -} -div[data-careercolor='rogue']{ - background-image: linear-gradient(rgba(107, 120, 150,0.8),rgba(97, 109, 138,0.8)); - box-shadow: rgb(75, 85, 111) 0 0 0 1px; -} -div[data-careercolor='priest']{ - background-image: linear-gradient(rgba(255, 255, 255,0.8),rgba(224, 224, 224,0.8)); - box-shadow: rgb(200, 200, 200) 0 0 0 1px; -} -div[data-careercolor='warrior']{ - background-image: linear-gradient(rgba(187, 60, 60,0.8),rgba(165, 40, 40,0.8)); - box-shadow: rgb(123, 23, 23) 0 0 0 1px; -} -div[data-careercolor='warlock']{ - background-image: linear-gradient(rgba(132, 60, 187,0.8),rgba(114, 48, 165,0.8)); - box-shadow: rgb(90, 31, 136) 0 0 0 1px; -} - -.card>.info{ - /*display: none;*/ -} -.card>.name{ - padding: 2px; - border-radius: 4px; - top: 8px; - left: 6px; -} -.card>.name, -div:not(.handcards)>.card>.name, -.handcards>.card:last-child>.name{ - transform: scale(0.8) !important; -} -.card>.name.longlong{ - top: 5px; -} -.card>.cost{ - bottom: 6px; - right: 6px; - text-align: center; - font-family: 'xinwei'; - border: none; -} diff --git a/mode/hearthstone.js b/mode/hearthstone.js deleted file mode 100644 index 7a1fd4cf9..000000000 --- a/mode/hearthstone.js +++ /dev/null @@ -1,1396 +0,0 @@ -'use strict'; -// next: 新建卡组 -mode.hearthstone={ - start:function(){ - "step 0" - lib.init.css(lib.assetURL+'layout/default/','hearthstone'); - game.initStone(); - var playback=localStorage.getItem(lib.configprefix+'playback'); - if(!playback){ - (function(){ - ui.deckBuilder=ui.create.div('.popup-container#deck-builder',function(){ - if(careerList.classList.contains('shown')){ - careerList.classList.remove('shown'); - newDeck.classList.remove('active'); - } - else if(!cardDialog.classList.contains('shown')){ - this.classList.remove('shown'); - this.timeout=setTimeout(function(){ - ui.deckBuilder.remove(); - },500); - ui.arena.style.top=''; - ui.arena.style.transform=''; - ui.arena.style.opacity=''; - ui.system.style.opacity=''; - ui.auto.show(); - ui.pause.show(); - ui.historybar.show(); - } - }); - var clickNode=function(){ - cardDialog.classList.add('shown'); - controls.classList.add('shown'); - var name='未命名'; - for(var i=1;;i++){ - if(!lib.storage.deckList[name+i]){ - break; - } - } - cardDialog.editing={ - name:name+i, - content:{ - career:this.firstChild.dataset.career, - deck:[] - }, - } - rename.innerHTML=name+i; - newDeck.innerHTML='确认编辑'; - newDeck.classList.add('active'); - careerList.classList.remove('shown'); - listContainer.style.transform='translateX(200px)'; - deckContainer.innerHTML=''; - deckContainer.classList.add('shown'); - updateCardDialog(); - } - var careerList=ui.create.div('.shadowed.career',ui.deckBuilder); - for(var i=0;i/g,''); - }; - var observer = new MutationObserver(removeLine); - observer.observe(rename,{characterData:true,subtree:true}); - rename.addEventListener('keyup',removeLine); - - var cardDialog=ui.create.cardDialog(true,function(name){ - if(lib.card[name].hidden) return true; - },{seperate:function(list){ - var result={ - list:{} - }; - for(var i=0;i=30){ - for(var i=0;i=2){ - list.push(i); - } - } - for(var i=0;ib) return 1; - if(a'+editing.name+'', - listContainer,editDeck); - ui.create.div('.menubutton.round',deckitem).dataset.career=editing.content.career; - deckitem.name=editing.name; - } - lib.storage.deckList[editing.name]=editing.content; - } - game.save('deckList',lib.storage.deckList); - listContainer.style.transform=''; - deckContainer.classList.remove('shown'); - updateCardDialog(); - } - e.stopPropagation(); - }); - var listContainer=ui.create.div('.list-container',deckList); - for(var i in lib.storage.deckList){ - var deckitem=ui.create.div('.deckitem.shadowed',''+i+'', - listContainer,editDeck); - ui.create.div('.menubutton.round',deckitem).dataset.career=lib.storage.deckList[i].career; - deckitem.name=i; - } - var deckContainer=ui.create.div('.list-container.deck',deckList); - - ui.deckcontrol=ui.create.system('卡组管理',function(){ - ui.arena.style.opacity=0; - ui.system.style.opacity=0; - ui.window.appendChild(ui.deckBuilder); - if(ui.deckBuilder.timeout){ - clearTimeout(ui.deckBuilder.timeout); - delete ui.deckBuilder.timeout; - } - ui.refresh(ui.deckBuilder); - ui.deckBuilder.classList.add('shown'); - ui.auto.hide(); - ui.pause.hide(); - ui.historybar.hide(); - },true); - }()); - - } - - if(playback){ - ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ - game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); - game.reload(); - } - } - event.finish(); - } - else{ - game.prepareArena(2); - game.delay(); - } - ui.arena.classList.add('stone'); - "step 1" - for(var i=0;i'+game.me.deckCards.length); - uiintro.addSmall([game.me.deckCards,'card']); - return uiintro; - },220); - if(get.config('skill_bar')){ - _status.rageEnabled=true; - - ui.friendBar=ui.create.div('.skillbar.right.shadowed.playerbg',ui.arena); - ui.enemyBar=ui.create.div('.skillbar.left.shadowed.playerbg',ui.arena); - // ui.friendBar.dataset.nature='metal'; - // ui.enemyBar.dataset.nature='fire'; - ui.create.div('.skillbarshadow',ui.friendBar); - ui.create.div('.skillbarshadow',ui.enemyBar); - ui.create.div('.skillbarfill',ui.friendBar); - ui.create.div('.skillbarfill',ui.enemyBar); - ui.friendBar.fillnode=ui.create.div(ui.friendBar.lastChild); - ui.enemyBar.fillnode=ui.create.div(ui.enemyBar.lastChild); - // ui.friendBar.popnode=ui.create.div('.skillbartext',ui.friendBar); - // ui.enemyBar.popnode=ui.create.div('.skillbartext',ui.enemyBar); - _status.friendRage=0; - _status.enemyRage=0; - - if(lib.config.touchscreen){ - lib.setLongPress(ui.friendBar,ui.click.intro); - lib.setLongPress(ui.enemyBar,ui.click.intro); - } - else{ - if(lib.config.hover_all){ - lib.setHover(ui.friendBar,ui.click.hoverplayer); - lib.setHover(ui.enemyBar,ui.click.hoverplayer); - } - if(lib.config.right_info){ - ui.friendBar.oncontextmenu=ui.click.rightplayer; - ui.enemyBar.oncontextmenu=ui.click.rightplayer; - } - } - } - } - _status.friendCount=ui.create.system('',null,true); - _status.enemyCount=ui.create.system('',null,true); - game.updateStatusCount(); - lib.setPopped(_status.friendCount,function(){ - var uiintro=ui.create.dialog('hidden'); - - if(_status.deadfriend.length){ - uiintro.add('已阵亡'); - uiintro.add([_status.deadfriend,'player']); - } - - uiintro.add('未上场'); - if(_status.mylist.length){ - uiintro.add([_status.mylist,'character']); - } - else{ - uiintro.add('(无)') - } - - return uiintro; - }); - lib.setPopped(_status.enemyCount,function(){ - if(_status.deadenemy.length){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add('已阵亡'); - uiintro.add([_status.deadenemy,'player']); - return uiintro; - } - }); - - game.me.side=Math.random()<0.5; - game.enemy.side=!game.me.side; - - var players=get.players(lib.sort.position); - var info=[]; - for(var i=0;i=100){ - _status.friendRage=100; - ui.friendBar.fillnode.style.top='-50%'; - ui.friendBar.classList.add('full'); - } - else{ - ui.friendBar.fillnode.style.top=(100-_status.friendRage)+'%'; - ui.friendBar.classList.remove('full'); - } - } - else{ - if(_status.enemyRage<100){ - popup=ui.enemyBar; - } - _status.enemyRage+=num; - if(_status.enemyRage<0){ - _status.enemyRage=0; - } - if(_status.enemyRage>=100){ - _status.enemyRage=100; - ui.enemyBar.fillnode.style.top='-50%'; - ui.enemyBar.classList.add('full'); - } - else{ - ui.enemyBar.fillnode.style.top=(100-_status.enemyRage)+'%'; - ui.enemyBar.classList.remove('full'); - } - } - if(num>0&&popup){ - var node=ui.create.div('.skillbartext',num.toString(),popup); - ui.refresh(node); - node.style.opacity=1; - setTimeout(function(){ - node.delete(); - },700); - } - }, - drawDeck:function(num,log){ - if(!num){ - num=1; - } - var cards=this.getDeckCards(num); - if(log==false){ - this.directgain(cards); - } - else if(log==true){ - this.directgain(cards); - game.log(this,'从牌库中获得了'+get.cnNumber(num)+'张牌'); - } - else{ - this.gain(cards,'draw'); - game.log(this,'从牌库中获得了'+get.cnNumber(num)+'张牌'); - } - return cards; - }, - updateActCount:function(used,countx,current){ - if(_status.video){ - this.actcount=countx||2; - } - else{ - game.addVideo('updateActCount',this,[used,this.actcount,this.getActCount()]); - } - var maxcount,overflow2; - if(lib.config.layout=='default'||used=='outphase'||_status.currentPhase!=this){ - maxcount=this.actcount; - } - else{ - if(_status.video){ - maxcount=this.actcount-(current||0); - } - else{ - maxcount=this.actcount-this.getActCount(); - } - if(this.actcount>maxcount){ - maxcount=this.actcount; - } - if(maxcount>12){ - maxcount=this.actcount+1; - this.node.actcount.classList.add('overflow2'); - } - else{ - this.node.actcount.classList.remove('overflow2'); - } - } - for(var i=0;i<12;i++){ - if(maxcount>this.node.actcount.childElementCount){ - ui.create.div(this.node.actcount); - } - else if(maxcount=this.actcount){ - this.node.actcount.childNodes[i].classList.add('overflow'); - } - else{ - this.node.actcount.childNodes[i].classList.remove('overflow'); - } - } - else{ - this.node.actcount.childNodes[i].classList.add('lost'); - this.node.actcount.childNodes[i].classList.remove('overflow'); - } - } - } - }, - getAct:function(){ - return this.actcount-this.getActCount(); - }, - hasFellowSkill:function(skill,exclude){ - for(var i=0;i=0){ - this.actcharacterlist[index]=null; - } - return this; - }, - dieAfter:function(source){ - var dead=this; - if(game.me.isDead()){ - if(!_status.mylist.length){ - _status.friendCount.innerHTML='友军: '+get.cnNumber(0); - game.over(false); - } - else{ - game.pause(); - _status.deadfriend.push(this); - game.additionaldead.push(this); - setTimeout(function(){ - var player=ui.create.player(); - player.getId(); - player.classList.add('noidentity'); - player.dataset.position=dead.dataset.position; - player.side=dead.side; - player.actcharacterlist=dead.actcharacterlist; - player.animate('replaceme'); - player.actcount=game.enemy.actcount; - player.actcount=dead.actcount; - if(_status.double_character){ - player.init(_status.mylist.shift(),_status.mylist.shift()); - } - else{ - player.init(_status.mylist.shift()); - } - player.maxHp++; - player.hp++; - if(_status.mode=='deck'){ - get.deck(player,_status.deck.shift()); - } - game.players.push(player); - ui.arena.appendChild(player); - - game.addVideo('stoneSwap',null,{ - name:player.name, - name2:player.name2, - position:player.dataset.position, - actcount:player.actcount, - me:true - }); - game.swapControl(player); - game.arrangePlayers(); - if(_status.mode=='deck'){ - var nd=game.enemy.countFellow(); - if(nd){ - player.draw(3+nd,{drawDeck:nd},false); - } - else{ - player.draw(3,false); - } - } - else{ - player.draw(3+game.enemy.countFellow(),false); - } - game.resume(); - game.updateStatusCount(); - },lib.config.duration); - - } - } - else if(game.enemy.isDead()){ - if(!_status.enemylist.length){ - _status.enemyCount.innerHTML='敌军: '+get.cnNumber(0); - game.over(true); - } - else{ - game.pause(); - _status.deadenemy.push(this); - game.additionaldead.push(this); - setTimeout(function(){ - var player=ui.create.player(); - player.getId(); - player.classList.add('noidentity'); - player.dataset.position=dead.dataset.position; - player.side=dead.side; - player.actcharacterlist=dead.actcharacterlist; - player.animate('replaceenemy'); - player.actcount=dead.actcount; - if(_status.double_character){ - player.init(_status.enemylist.shift(),_status.enemylist.shift()); - } - else{ - player.init(_status.enemylist.shift()); - } - player.maxHp++; - player.hp++; - if(_status.mode=='deck'){ - get.deck(player,'random'); - } - game.players.push(player); - game.enemy=player; - ui.arena.appendChild(player); - - game.addVideo('stoneSwap',null,{ - name:player.name, - name2:player.name2, - position:player.dataset.position, - actcount:player.actcount, - }); - game.arrangePlayers(); - if(_status.mode=='deck'){ - var nd=game.me.countFellow(); - if(nd){ - player.draw(3+nd,{drawDeck:nd},false); - } - else{ - player.draw(3,false); - } - } - else{ - player.draw(3+game.me.countFellow(),false); - } - game.resume(); - game.updateStatusCount(); - },lib.config.duration); - } - } - if(source&&source.side!=this.side&&!source.isMin()){ - if(_status.mode=='deck'){ - source.drawDeck(); - } - else{ - source.draw(); - } - source.actused--; - source.updateActCount(); - } - game.dead.remove(this); - game.arrangePlayers(); - this.getLeader().removeFellow(this); - setTimeout(function(){ - dead.delete(); - },500); - } - } - }, - careerList:['mage','shaman','druid','paladin','rogue','priest','hunter','warrior','warlock'], - game:{ - reserveDead:true, - getVideoName:function(){ - var str=get.translation(game.me.name); - if(game.me.name2){ - str+='/'+get.translation(game.me.name2); - } - var name=[ - str,'炉石 - '+get.config('battle_number')+'人' - ]; - return name; - }, - updateStatusCount:function(){ - _status.friendCount.innerHTML='友军: '+get.cnNumber(1+_status.mylist.length/(_status.double_character?2:1),true); - _status.enemyCount.innerHTML='敌军: '+get.cnNumber(1+_status.enemylist.length/(_status.double_character?2:1),true); - }, - stoneLoop:function(player){ - var next=game.createEvent('phaseLoop'); - next.player=player; - next.setContent(function(){ - "step 0" - player.phase(); - event.num=0; - "step 1" - if(event.num'+i+'',buttons,clickButton); - ui.create.div('.menubutton.round',deckitem).dataset.career=lib.storage.deckList[i].career; - deckitem.name=i; - } - } - for(var i=0;i随机',buttons,clickButton); - ui.create.div('.menubutton.round',deckitem).dataset.career=lib.careerList[i]; - deckitem.name='random:'+lib.careerList[i]; - } - event.dialog.open(); - } - else{ - var bn=parseInt(get.config('battle_number')); - for(var i=0;ib) return 1; - if(a==b) return 0; - return -1; - }); - player.deck=name; - player.career=career; - if(!player.node.career){ - player.node.career=ui.create.div('.menubutton.round.identity',player); - player.node.career.dataset.career=career; - if(lib.config.touchscreen){ - lib.setLongPress(player.node.career,ui.click.intro); - } - else{ - if(lib.config.hover_all){ - lib.setHover(player.node.career,ui.click.hoverplayer); - } - if(lib.config.right_info){ - player.node.career.oncontextmenu=ui.click.rightplayer; - } - } - } - if(!player.deckCards) player.deckCards=[]; - for(var i=0;i