This commit is contained in:
libccy 2017-07-19 11:36:21 +08:00
parent 471df16268
commit e57670d1d7
3 changed files with 137 additions and 7 deletions

View File

@ -3667,6 +3667,7 @@
map.connect_enhance_zhu.hide(); map.connect_enhance_zhu.hide();
map.connect_double_nei.hide(); map.connect_double_nei.hide();
map.connect_zhong_card.show(); map.connect_zhong_card.show();
map.connect_special_identity.hide();
} }
else{ else{
map.connect_player_number.show(); map.connect_player_number.show();
@ -3678,6 +3679,13 @@
map.connect_double_nei.hide(); map.connect_double_nei.hide();
} }
map.connect_zhong_card.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:{ connect_identity_mode:{
@ -3716,7 +3724,7 @@
name:'双内奸', name:'双内奸',
init:false, init:false,
restart:true, restart:true,
frequent:true, // frequent:true,
intro:'开启后游戏中将有两个内奸内奸胜利条件仍为主内1v1时击杀主公' intro:'开启后游戏中将有两个内奸内奸胜利条件仍为主内1v1时击杀主公'
}, },
connect_double_character:{ connect_double_character:{
@ -3725,6 +3733,13 @@
frequent:true, frequent:true,
restart:true, restart:true,
}, },
connect_special_identity:{
name:'特殊身份',
init:false,
restart:true,
frequent:true,
intro:'开启后游戏中将增加军师、大将、贼首三个身份'
},
connect_ban_weak:{ connect_ban_weak:{
name:'屏蔽弱将', name:'屏蔽弱将',
init:true, init:true,
@ -3757,6 +3772,7 @@
map.ban_identity2.hide(); map.ban_identity2.hide();
map.ban_identity3.hide(); map.ban_identity3.hide();
map.zhong_card.show(); map.zhong_card.show();
map.special_identity.hide();
} }
else{ else{
map.player_number.show(); map.player_number.show();
@ -3786,6 +3802,12 @@
map.ban_identity3.show(); map.ban_identity3.show();
} }
map.zhong_card.hide(); map.zhong_card.hide();
if(config.player_number=='8'){
map.special_identity.show();
}
else{
map.special_identity.hide();
}
} }
if(config.double_character){ if(config.double_character){
map.double_hp.show(); map.double_hp.show();
@ -3833,6 +3855,13 @@
frequent:true, frequent:true,
restart:true, restart:true,
}, },
special_identity:{
name:'特殊身份',
init:false,
restart:true,
frequent:true,
intro:'开启后游戏中将增加军师、大将、贼首三个身份'
},
zhong_card:{ zhong_card:{
name:'明忠卡牌替换', name:'明忠卡牌替换',
init:true, init:true,

View File

@ -413,6 +413,9 @@
#arena[data-player_height='short'] .timerbar>div{ #arena[data-player_height='short'] .timerbar>div{
top: 165px; top: 165px;
} }
#arena .player[data-position='0']>.damage.dieidentity{
opacity: 1 !important;
}
/*--------位置(8人)------*/ /*--------位置(8人)------*/
#arena[data-number='8']>.player[data-position='1']{top:calc(30% - 128px);left:calc(-300% / 94 + 4375% / 47 - 735px + 720px);} #arena[data-number='8']>.player[data-position='1']{top:calc(30% - 128px);left:calc(-300% / 94 + 4375% / 47 - 735px + 720px);}

View File

@ -251,7 +251,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
var enhance_zhu=false; var enhance_zhu=false;
if(_status.connectMode){ 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{ else{
enhance_zhu=(_status.mode!='zhong'&&get.config('enhance_zhu')&&get.population('fan')>=3); 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){ if(player==game.zhong){
state[i].zhong=true; state[i].zhong=true;
} }
if(player.special_identity){
state[i].special_identity=player.special_identity;
}
state[i].shown=player.ai.shown; state[i].shown=player.ai.shown;
} }
return state; return state;
@ -316,6 +319,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var player=lib.playerOL[i]; var player=lib.playerOL[i];
if(player){ if(player){
player.identity=state[i].identity; 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'){ if(typeof state[i].zhu=='boolean'){
game.zhu=player; game.zhu=player;
player.isZhu=state[i].zhu; player.isZhu=state[i].zhu;
@ -1185,12 +1195,46 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
game.players[i].identityShown=false; 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.setIdentity();
game.zhu.identityShown=true; game.zhu.identityShown=true;
game.zhu.isZhu=(game.zhu.identity=='zhu'); game.zhu.isZhu=(game.zhu.identity=='zhu');
game.zhu.node.identity.classList.remove('guessing'); game.zhu.node.identity.classList.remove('guessing');
game.me.setIdentity(); game.me.setIdentity();
game.me.node.identity.classList.remove('guessing'); 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<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
game.players[i].send(function(zhu,zhuid,me,identity){ game.players[i].send(function(zhu,zhuid,me,identity){
@ -1204,6 +1248,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
zhu.node.identity.classList.remove('guessing'); zhu.node.identity.classList.remove('guessing');
me.setIdentity(identity); me.setIdentity(identity);
me.node.identity.classList.remove('guessing'); me.node.identity.classList.remove('guessing');
if(me.special_identity){
me.node.identity.firstChild.innerHTML=get.translation(me.special_identity+'_bg');
}
ui.arena.classList.add('choose-character'); ui.arena.classList.add('choose-character');
},game.zhu,game.zhu.identity,game.players[i],game.players[i].identity); },game.zhu,game.zhu.identity,game.players[i],game.players[i].identity);
} }
@ -1306,7 +1353,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
num3=num2; num3=num2;
} }
} }
list.push([game.players[i],['选择角色',[event.list.randomRemove(num+num3),'character']],selectButton,true]); var str='选择角色';
if(game.players[i].special_identity){
str+=''+get.translation(game.players[i].special_identity)+'';
}
list.push([game.players[i],[str,[event.list.randomRemove(num+num3),'character']],selectButton,true]);
} }
} }
game.me.chooseButtonOL(list,function(player,result){ game.me.chooseButtonOL(list,function(player,result){
@ -1331,6 +1382,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.playerOL[i].init(result[i][0],result[i][1]); lib.playerOL[i].init(result[i][0],result[i][1]);
} }
} }
if(event.special_identity){
for(var i in event.special_identity){
game.zhu.addSkill(i);
}
}
game.broadcast(function(result){ game.broadcast(function(result){
for(var i in result){ for(var i in result){
if(!lib.playerOL[i].name){ if(!lib.playerOL[i].name){
@ -1360,6 +1416,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
nei2:"内奸", nei2:"内奸",
fan2:"反贼", fan2:"反贼",
random2:"随机", random2:"随机",
identity_junshi_bg:'师',
identity_dajiang_bg:'将',
identity_zeishou_bg:'首',
identity_junshi:'军师',
identity_dajiang:'大将',
identity_zeishou:'贼首',
ai_strategy_1:'均衡', ai_strategy_1:'均衡',
ai_strategy_2:'偏反', ai_strategy_2:'偏反',
ai_strategy_3:'偏主', ai_strategy_3:'偏主',
@ -1376,7 +1438,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
$dieAfter:function(){ $dieAfter:function(){
if(_status.video) return; if(_status.video) return;
if(!this.node.dieidentity){ if(!this.node.dieidentity){
var node=ui.create.div('.damage.dieidentity',get.translation(this.identity+'2'),this); var str;
if(this.special_identity){
str=get.translation(this.special_identity);
}
else{
str=get.translation(this.identity+'2');
}
var node=ui.create.div('.damage.dieidentity',str,this);
ui.refresh(node); ui.refresh(node);
node.style.opacity=1; node.style.opacity=1;
this.node.dieidentity=node; this.node.dieidentity=node;
@ -1399,11 +1468,19 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
dieAfter:function(source){ dieAfter:function(source){
if(!this.identityShown){ if(!this.identityShown){
game.broadcastAll(function(player){ game.broadcastAll(function(player,identity,identity2,zhu){
player.setIdentity(player.identity); player.setIdentity(player.identity);
player.identityShown=true; player.identityShown=true;
player.node.identity.classList.remove('guessing'); player.node.identity.classList.remove('guessing');
},this); if(identity){
zhu.removeSkill(identity);
player.node.identity.firstChild.innerHTML=get.translation(identity+'_bg');
game.log(player,'的身份是','#g'+get.translation(identity));
}
else{
game.log(player,'的身份是','#g'+get.translation(identity2+'2'));
}
},this,this.special_identity,this.identity,game.zhu);
} }
game.checkResult(); game.checkResult();
if(game.zhu&&game.zhu.isZhu){ if(game.zhu&&game.zhu.isZhu){
@ -1872,6 +1949,27 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
}, },
skill:{ skill:{
identity_junshi:{
name:'军师',
mark:true,
intro:{
content:'准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底'
}
},
identity_dajiang:{
name:'大将',
mark:true,
intro:{
content:'手牌上限+1'
}
},
identity_zeishou:{
name:'贼首',
mark:true,
intro:{
content:'手牌上限-1'
}
},
dongcha:{ dongcha:{
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
direct:true, direct:true,
@ -2000,7 +2098,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
}, },
help:{ help:{
'身份模式':'<div style="margin:10px">选项</div><ul style="margin-top:0"><li>加强主公<br>反贼人数多于2时主公会额外增加一个技能每个主公的额外技能固定非常备主公增加天命</ul>'+ '身份模式':'<div style="margin:10px">选项</div><ul style="margin-top:0"><li>加强主公<br>反贼人数多于2时主公会额外增加一个技能每个主公的额外技能固定非常备主公增加天命<li>特殊身份<br><ul style="padding-left:20px;padding-top:5px"><li>军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底<li>大将:忠臣身份。只要大将存活,主公手牌上限+1<li>贼首:反贼身份,只要贼首存活,主公手牌上限-1</ul></ul>'+
'<div style="margin:10px">明忠</div><ul style="margin-top:0"><li>本模式需要8名玩家进行游戏使用的身份牌为1主公、2忠臣、4反贼和1内奸。游戏开始时每名玩家随机获得一个身份由系统随机选择一名忠臣身份的玩家亮出身份将忠臣牌正面朝上放在面前其他身份包括主公的玩家不亮出身份。<li>'+ '<div style="margin:10px">明忠</div><ul style="margin-top:0"><li>本模式需要8名玩家进行游戏使用的身份牌为1主公、2忠臣、4反贼和1内奸。游戏开始时每名玩家随机获得一个身份由系统随机选择一名忠臣身份的玩家亮出身份将忠臣牌正面朝上放在面前其他身份包括主公的玩家不亮出身份。<li>'+
'首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出<li>'+ '首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出<li>'+
'亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。', '亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。',