From e57670d1d7275e269367aeb1bae5b32deaf14d92 Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 19 Jul 2017 11:36:21 +0800 Subject: [PATCH] t --- game/game.js | 31 ++++++++++- layout/long2/layout.css | 3 ++ mode/identity.js | 110 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 137 insertions(+), 7 deletions(-) diff --git a/game/game.js b/game/game.js index 0a7759c1a..b47776e60 100644 --- a/game/game.js +++ b/game/game.js @@ -3667,6 +3667,7 @@ map.connect_enhance_zhu.hide(); map.connect_double_nei.hide(); map.connect_zhong_card.show(); + map.connect_special_identity.hide(); } else{ map.connect_player_number.show(); @@ -3678,6 +3679,13 @@ map.connect_double_nei.hide(); } map.connect_zhong_card.hide(); + + if(config.connect_player_number=='8'){ + map.connect_special_identity.show(); + } + else{ + map.connect_special_identity.hide(); + } } }, connect_identity_mode:{ @@ -3716,7 +3724,7 @@ name:'双内奸', init:false, restart:true, - frequent:true, + // frequent:true, intro:'开启后游戏中将有两个内奸(内奸胜利条件仍为主内1v1时击杀主公)' }, connect_double_character:{ @@ -3725,6 +3733,13 @@ frequent:true, restart:true, }, + connect_special_identity:{ + name:'特殊身份', + init:false, + restart:true, + frequent:true, + intro:'开启后游戏中将增加军师、大将、贼首三个身份' + }, connect_ban_weak:{ name:'屏蔽弱将', init:true, @@ -3757,6 +3772,7 @@ map.ban_identity2.hide(); map.ban_identity3.hide(); map.zhong_card.show(); + map.special_identity.hide(); } else{ map.player_number.show(); @@ -3786,6 +3802,12 @@ map.ban_identity3.show(); } map.zhong_card.hide(); + if(config.player_number=='8'){ + map.special_identity.show(); + } + else{ + map.special_identity.hide(); + } } if(config.double_character){ map.double_hp.show(); @@ -3833,6 +3855,13 @@ frequent:true, restart:true, }, + special_identity:{ + name:'特殊身份', + init:false, + restart:true, + frequent:true, + intro:'开启后游戏中将增加军师、大将、贼首三个身份' + }, zhong_card:{ name:'明忠卡牌替换', init:true, diff --git a/layout/long2/layout.css b/layout/long2/layout.css index 8739104f6..9ccd832bd 100644 --- a/layout/long2/layout.css +++ b/layout/long2/layout.css @@ -413,6 +413,9 @@ #arena[data-player_height='short'] .timerbar>div{ top: 165px; } +#arena .player[data-position='0']>.damage.dieidentity{ + opacity: 1 !important; +} /*--------位置(8人)------*/ #arena[data-number='8']>.player[data-position='1']{top:calc(30% - 128px);left:calc(-300% / 94 + 4375% / 47 - 735px + 720px);} diff --git a/mode/identity.js b/mode/identity.js index fcfcd5aa5..b1eae9e55 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -251,7 +251,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } var enhance_zhu=false; if(_status.connectMode){ - enhance_zhu=(_status.mode!='zhong'&&lib.configOL.enhance_zhu&&get.population('fan')>=3) + enhance_zhu=(_status.mode!='zhong'&&lib.configOL.enhance_zhu&&get.population('fan')>=3); } else{ enhance_zhu=(_status.mode!='zhong'&&get.config('enhance_zhu')&&get.population('fan')>=3); @@ -307,6 +307,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(player==game.zhong){ state[i].zhong=true; } + if(player.special_identity){ + state[i].special_identity=player.special_identity; + } state[i].shown=player.ai.shown; } return state; @@ -316,6 +319,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ var player=lib.playerOL[i]; if(player){ player.identity=state[i].identity; + if(state[i].special_identity){ + player.special_identity=state[i].special_identity; + if(player.node.dieidentity){ + player.node.dieidentity.innerHTML=get.translation(state[i].special_identity); + player.node.identity.firstChild.innerHTML=get.translation(state[i].special_identity+'_bg'); + } + } if(typeof state[i].zhu=='boolean'){ game.zhu=player; player.isZhu=state[i].zhu; @@ -1185,12 +1195,46 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } game.players[i].identityShown=false; } + if(lib.configOL.special_identity&&!event.zhongmode&&game.players.length==8){ + var map={}; + var zhongs=game.filterPlayer(function(current){ + return current.identity=='zhong'; + }); + var fans=game.filterPlayer(function(current){ + return current.identity=='fan'; + }); + if(fans.length>=1){ + map.identity_zeishou=fans.randomRemove(); + } + if(zhongs.length>1){ + map.identity_dajiang=zhongs.randomRemove(); + map.identity_junshi=zhongs.randomRemove(); + } + else if(zhongs.length==1){ + if(Math.random()<0.5){ + map.identity_dajiang=zhongs.randomRemove(); + } + else{ + map.identity_junshi=zhongs.randomRemove(); + } + } + game.broadcastAll(function(zhu,map){ + for(var i in map){ + map[i].special_identity=i; + } + },game.zhu,map); + event.special_identity=map; + } + game.zhu.setIdentity(); game.zhu.identityShown=true; game.zhu.isZhu=(game.zhu.identity=='zhu'); game.zhu.node.identity.classList.remove('guessing'); game.me.setIdentity(); game.me.node.identity.classList.remove('guessing'); + if(game.me.special_identity){ + game.me.node.identity.firstChild.innerHTML=get.translation(game.me.special_identity+'_bg'); + } for(var i=0;i选项'+ + '身份模式':'
选项
'+ '
明忠