From bc5f3d334a3e3e171c932e2007b8cb4e9aa5aa96 Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 1 Feb 2017 23:42:44 +0800 Subject: [PATCH] b --- card/guozhan.js | 18 +++++++++-- game/game.js | 72 ++++++++++++++++++++++------------------- game/update.js | 40 +++++++++++------------ layout/long2/layout.css | 42 ++++++++++++++++-------- mode/boss.js | 11 ++++++- 5 files changed, 111 insertions(+), 72 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index a65d06057..8c771484a 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -436,18 +436,30 @@ card.guozhan={ var content; var str=get.translation(target)+'的'; if(result.control){ - if(result.control=='手牌') content=[str+'手牌',target.get('h')]; - else if(result.control=='主将') content=[str+'主将',[[target.name1],'character']]; - else content=[str+'副将',[[target.name2],'character']]; + if(result.control=='手牌'){ + content=[str+'手牌',target.get('h')]; + game.log(player,'观看了',target,'的手牌'); + } + else if(result.control=='主将'){ + content=[str+'主将',[[target.name1],'character']]; + game.log(player,'观看了',target,'的主将'); + } + else{ + content=[str+'副将',[[target.name2],'character']]; + game.log(player,'观看了',target,'的副将'); + } } else if(target.get('h').length){ content=[str+'手牌',target.get('h')]; + game.log(player,'观看了',target,'的手牌'); } else if(target.classList.contains('unseen')){ content=[str+'主将',[[target.name1],'character']]; + game.log(player,'观看了',target,'的主将'); } else{ content=[str+'副将',[[target.name2],'character']]; + game.log(player,'观看了',target,'的副将'); } player.chooseControl('ok').set('dialog',content); }, diff --git a/game/game.js b/game/game.js index baabe18d8..0c9139027 100644 --- a/game/game.js +++ b/game/game.js @@ -1501,6 +1501,7 @@ name:'音效音量', init:8, item:{ + '0':'〇', '1':'一', '2':'二', '3':'三', @@ -1518,6 +1519,7 @@ name:'音乐音量', init:8, item:{ + '0':'〇', '1':'一', '2':'二', '3':'三', @@ -4353,9 +4355,6 @@ get[i]=lib.init.eval(mode[lib.config.mode].get[i]); } lib.init.start=mode[lib.config.mode].start; - if(typeof mode[lib.config.mode].init=='function'){ - mode[lib.config.mode].init(); - } if(game.onwash){ lib.onwash.push(game.onwash); delete game.onwash; @@ -4383,6 +4382,9 @@ lib[i][j]=lib.init.eval(mode[lib.config.mode][i][j]); } } + if(typeof mode[lib.config.mode].init=='function'){ + (lib.init.eval(mode[lib.config.mode].init))(); + } var connectCharacterPack=[]; var connectCardPack=[]; @@ -5094,6 +5096,9 @@ window.lib=lib; window._status=_status; }, + o:function(){ + ui.arena.classList.remove('observe'); + }, p:function(name,i){ var list=['swd','hs','pal','gjqt','ow']; if(!lib.character[name]){ @@ -9178,7 +9183,7 @@ this.node.hp.innerHTML=''; this.roomfull=false; this.roomgaming=false; - this.versionOL=null; + this.version=null; if(info=='server'){ this.serving=true; this.node.serving.show(); @@ -9206,6 +9211,7 @@ this.maxHp=parseInt(config.number); this.hp=info[3]; this.update(); + this.version=config.version; if(this.hp==this.maxHp&&!config.gameStarted){ this.roomfull=true; } @@ -19217,7 +19223,7 @@ dialog.add(ui.create.div('.placeholder')); for(var i=0;i'+get.translation(game.players[i])+''); @@ -20162,6 +20168,7 @@ } lib.configOL.banned=lib.config['connect_'+name+'_banned']; lib.configOL.bannedcards=lib.config['connect_'+name+'_bannedcards']; + lib.configOL.version=lib.versionOL; } for(var i in lib.cardPackList){ if(lib.configOL.cardPack.contains(i)){ @@ -22565,7 +22572,9 @@ var banned=lib.config[lib.config.all.mode[i]+'_banned']; if(banned){ for(var j=0;jlib.versionOL){ + alert('加入失败:你的游戏版本过低'); + } + else{ + alert('加入失败:房主的游戏版本过低'); + } } else if(this.hasOwnProperty('roomindex')){ if(!_status.enteringroom){ @@ -31207,36 +31221,26 @@ } return parseInt(num)||2; }, - benchmark:function(func1,func2,arg,iteration){ + benchmark:function(func1,func2,iteration,arg){ var tic,toc; + if(!arg) arg=[]; if(Array.isArray(func2)){ - tic=get.utc(); - for(var i=0;i.player.fullskin2:not(.minskin)>.avatar2{ border-radius: 16px !important; } -#arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#arena>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ border-radius: 8px 8px 0 0 !important; height: calc(50% + 14px) !important; -webkit-clip-path: polygon(-10px -10px, 116px -10px, 116px 92px, 106px 92px, 0px 114px, -10px 114px); } -#arena[data-player_height='default']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#arena[data-player_height='default']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#arena[data-player_height='default']>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ -webkit-clip-path: polygon(-10px -10px, 116px -10px, 116px 82px, 106px 82px, 0px 104px, -10px 104px); } -#arena[data-player_height='short']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#arena[data-player_height='short']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#arena[data-player_height='short']>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ -webkit-clip-path: polygon(-10px -10px, 116px -10px, 116px 72px, 106px 72px, 0px 94px, -10px 94px); } -#arena.uslim_player>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#arena.uslim_player>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#arena.uslim_player>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ height: calc(50% + 18px) !important; -webkit-clip-path: polygon(-10px -10px, 124px -10px, 124px 96px, 114px 96px, 0px 118px, -10px 118px); } -#arena.uslim_player[data-player_height='default']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#arena.uslim_player[data-player_height='default']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#arena.uslim_player[data-player_height='default']>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ -webkit-clip-path: polygon(-10px -10px, 124px -10px, 124px 86px, 114px 86px, 0px 108px, -10px 108px); } -#arena.uslim_player[data-player_height='short']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#arena.uslim_player[data-player_height='short']>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#arena.uslim_player[data-player_height='short']>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ -webkit-clip-path: polygon(-10px -10px, 124px -10px, 124px 76px, 114px 76px, 0px 98px, -10px 98px); } -#window[data-radius_size='reduce'] #arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#window[data-radius_size='reduce'] #arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#window[data-radius_size='reduce'] #arena>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ border-radius: 4px 4px 0 0 !important; } -#window[data-radius_size='off'] #arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#window[data-radius_size='off'] #arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#window[data-radius_size='off'] #arena>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ border-radius: 0 0 0 0 !important; } -#window[data-radius_size='increase'] #arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar{ +#window[data-radius_size='increase'] #arena>.player.fullskin2:not(.minskin):not(.unseen2)>.avatar, +#window[data-radius_size='increase'] #arena>.player.fullskin2:not(.minskin).unseen2[data-position='0']>.avatar{ border-radius: 16px 16px 0 0 !important; } -#arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2{ +#arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2, +#arena>.player.fullskin2:not(.minskin).unseen[data-position='0']>.avatar2{ border-radius: 0 0 8px 8px !important; top: calc(50% - 21px) !important; height: calc(50% + 14px) !important; background-position: 0 10px !important; -webkit-clip-path: polygon(-10px 32px, 0 32px, 106px 10px, 116px 10px, 116px 134px, -10px 134px); } -#arena.uslim_player>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2{ +#arena.uslim_player>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2, +#arena.uslim_player>.player.fullskin2:not(.minskin).unseen[data-position='0']>.avatar2{ top: calc(50% - 21px) !important; height: calc(50% + 18px) !important; -webkit-clip-path: polygon(-10px 32px, 0 32px, 114px 10px, 124px 10px, 124px 138px, -10px 138px); } -#window[data-radius_size='reduce'] #arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2{ +#window[data-radius_size='reduce'] #arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2, +#window[data-radius_size='reduce'] #arena>.player.fullskin2:not(.minskin).unseen[data-position='0']>.avatar2{ border-radius: 0 0 4px 4px !important; } -#window[data-radius_size='off'] #arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2{ +#window[data-radius_size='off'] #arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2, +#window[data-radius_size='off'] #arena>.player.fullskin2:not(.minskin).unseen[data-position='0']>.avatar2{ border-radius: 0 0 0 0 !important; } -#window[data-radius_size='increase'] #arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2{ +#window[data-radius_size='increase'] #arena>.player.fullskin2:not(.minskin):not(.unseen)>.avatar2, +#window[data-radius_size='increase'] #arena>.player.fullskin2:not(.minskin).unseen[data-position='0']>.avatar2{ border-radius: 0 0 16px 16px !important; } #arena>.player.fullskin2:not(.minskin)>.avatar2{ diff --git a/mode/boss.js b/mode/boss.js index 35715a208..2971bd853 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -78,7 +78,7 @@ mode.boss={ var list=[]; for(var i in lib.character){ var info=lib.character[i]; - if(info[4].contains('boss')&&!lib.config.banned.contains(i)){ + if(info[4].contains('boss')&&get.config(i+'_boss_config')){ var cfg=i+'_bossconfig'; if(get.config(cfg)==undefined){ game.saveConfig(cfg,true,true); @@ -424,6 +424,15 @@ mode.boss={ // boss_shuijing:['male','qun',8,[],['boss','bossallowed'],'wei'], } }, + init:function(){ + for(var i in lib.characterPack.mode_boss){ + lib.mode.boss.config[i+'_boss_config']={ + name:get.translation(i), + init:true, + unfrequent:true, + } + } + }, game:{ reserveDead:true, changeBoss:function(name){