Make Kingdom War: Separatism online ready.
This commit is contained in:
parent
9d8bf314b4
commit
9e9283ecaf
56
game/game.js
56
game/game.js
|
@ -5589,6 +5589,9 @@
|
||||||
frequent:true,
|
frequent:true,
|
||||||
restart:true,
|
restart:true,
|
||||||
},
|
},
|
||||||
|
get connect_separatism(){
|
||||||
|
return lib.mode.guozhan.config.separatism;
|
||||||
|
},
|
||||||
connect_initshow_draw:{
|
connect_initshow_draw:{
|
||||||
name:'首亮奖励',
|
name:'首亮奖励',
|
||||||
item:{
|
item:{
|
||||||
|
@ -5679,6 +5682,13 @@
|
||||||
frequent:true,
|
frequent:true,
|
||||||
restart:true,
|
restart:true,
|
||||||
},
|
},
|
||||||
|
separatism:{
|
||||||
|
name:'群雄割据',
|
||||||
|
init:false,
|
||||||
|
frequent:true,
|
||||||
|
restart:true,
|
||||||
|
intro:'开放不同势力组合,以优先亮出的武将牌作为自己的势力,双势力武将则使用列表的第一个势力'
|
||||||
|
},
|
||||||
initshow_draw:{
|
initshow_draw:{
|
||||||
name:'首亮奖励',
|
name:'首亮奖励',
|
||||||
item:{
|
item:{
|
||||||
|
@ -7258,11 +7268,6 @@
|
||||||
init:true,
|
init:true,
|
||||||
frequent:true
|
frequent:true
|
||||||
},
|
},
|
||||||
qunxionggeju:{
|
|
||||||
name:'群雄割据',
|
|
||||||
init:true,
|
|
||||||
frequent:true
|
|
||||||
},
|
|
||||||
duzhansanguo:{
|
duzhansanguo:{
|
||||||
name:'毒战三国',
|
name:'毒战三国',
|
||||||
init:true,
|
init:true,
|
||||||
|
@ -7577,8 +7582,6 @@
|
||||||
}else if(newMessage.includes("has already been declared")){
|
}else if(newMessage.includes("has already been declared")){
|
||||||
messageName=newMessage.replace('SyntaxError: Identifier ', '').replace(' has already been declared', '');
|
messageName=newMessage.replace('SyntaxError: Identifier ', '').replace(' has already been declared', '');
|
||||||
newMessage=messageName +"变量已经被声明过,不能被重新声明";
|
newMessage=messageName +"变量已经被声明过,不能被重新声明";
|
||||||
}else if(newMessage.includes("Invalid or unexpected token")){
|
|
||||||
newMessage="查询无效或意外的标记,可能是字符串的引号不成对,错误使用了转义序列,字符串在多行中解析异常";
|
|
||||||
}else if(newMessage.includes("Duplicate parameter name not allowed in this context")) {
|
}else if(newMessage.includes("Duplicate parameter name not allowed in this context")) {
|
||||||
newMessage="参数名不允许重复";
|
newMessage="参数名不允许重复";
|
||||||
}else if(newMessage.includes("Unexpected reserved word")||newMessage.includes(
|
}else if(newMessage.includes("Unexpected reserved word")||newMessage.includes(
|
||||||
|
@ -11112,10 +11115,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
layout:function(layout,nosave){
|
layout:function(layout,nosave){
|
||||||
const previousTransitionDuration=document.body.style.transitionDuration;
|
const previousTransitionDuration=document.documentElement.style.transitionDuration;
|
||||||
document.body.style.transitionDuration='1s';
|
document.documentElement.style.transitionDuration='1s';
|
||||||
const previousFilter=document.body.style.filter,previousWebkitFilter=document.body.style.webkitFilter;
|
const previousFilter=document.documentElement.style.filter,previousWebkitFilter=document.documentElement.style.webkitFilter;
|
||||||
document.body.style.filter=document.body.style.webkitFilter='brightness(0)';
|
document.documentElement.style.filter=document.documentElement.style.webkitFilter='brightness(0)';
|
||||||
if(layout=='default') layout='mobile';
|
if(layout=='default') layout='mobile';
|
||||||
if(!nosave) game.saveConfig('layout',layout);
|
if(!nosave) game.saveConfig('layout',layout);
|
||||||
game.layout=layout;
|
game.layout=layout;
|
||||||
|
@ -11226,14 +11229,14 @@
|
||||||
return new Promise(resolve=>setTimeout(resolve,500));
|
return new Promise(resolve=>setTimeout(resolve,500));
|
||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
ui.updatec();
|
ui.updatec();
|
||||||
if(previousFilter) document.body.style.filter=previousFilter;
|
if(previousFilter) document.documentElement.style.filter=previousFilter;
|
||||||
else document.body.style.removeProperty('filter');
|
else document.documentElement.style.removeProperty('filter');
|
||||||
if(previousWebkitFilter) document.body.style.webkitFilter=previousWebkitFilter;
|
if(previousWebkitFilter) document.documentElement.style.webkitFilter=previousWebkitFilter;
|
||||||
else document.body.style.removeProperty('-webkit-filter');
|
else document.documentElement.style.removeProperty('-webkit-filter');
|
||||||
return new Promise(resolve=>setTimeout(resolve,1000));
|
return new Promise(resolve=>setTimeout(resolve,1000));
|
||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
if(previousTransitionDuration) document.body.style.transitionDuration=previousTransitionDuration;
|
if(previousTransitionDuration) document.documentElement.style.transitionDuration=previousTransitionDuration;
|
||||||
else document.body.style.removeProperty('transition-duration');
|
else document.documentElement.style.removeProperty('transition-duration');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
background:function(){
|
background:function(){
|
||||||
|
@ -42906,13 +42909,13 @@
|
||||||
player2.previousSeat=player.previousSeat;
|
player2.previousSeat=player.previousSeat;
|
||||||
player2.nextSeat.previousSeat=player2;
|
player2.nextSeat.previousSeat=player2;
|
||||||
player2.previousSeat.nextSeat=player2;
|
player2.previousSeat.nextSeat=player2;
|
||||||
const player3=player2.nextSeat;
|
let player3=player2.nextSeat;
|
||||||
while(player3.isDead()){
|
while(player3.isDead()){
|
||||||
player3=player3.nextSeat;
|
player3=player3.nextSeat;
|
||||||
}
|
}
|
||||||
player3.previous=player2;
|
player3.previous=player2;
|
||||||
player2.next=player3;
|
player2.next=player3;
|
||||||
const player4=player2.previousSeat;
|
let player4=player2.previousSeat;
|
||||||
while(player4.isDead()){
|
while(player4.isDead()){
|
||||||
player4=player4.previousSeat;
|
player4=player4.previousSeat;
|
||||||
}
|
}
|
||||||
|
@ -52936,22 +52939,22 @@
|
||||||
//单个人物的宽度。这里要设置玩家的实际的宽度
|
//单个人物的宽度。这里要设置玩家的实际的宽度
|
||||||
const temporaryPlayer=ui.create.div('.player',ui.arena).hide();
|
const temporaryPlayer=ui.create.div('.player',ui.arena).hide();
|
||||||
const computedStyle=getComputedStyle(temporaryPlayer);
|
const computedStyle=getComputedStyle(temporaryPlayer);
|
||||||
const scale=8/numberOfPlayers;
|
const scale=6/numberOfPlayers;
|
||||||
//玩家顶部距离父容器上边缘的距离偏移的单位距离
|
//玩家顶部距离父容器上边缘的距离偏移的单位距离
|
||||||
const oneThirdHeight=parseFloat(computedStyle.height)/3*scale;
|
const quarterHeight=parseFloat(computedStyle.height)/4*scale;
|
||||||
const halfWidth=parseFloat(computedStyle.width)/2;
|
const halfWidth=parseFloat(computedStyle.width)/2;
|
||||||
temporaryPlayer.remove();
|
temporaryPlayer.remove();
|
||||||
//列数,即假如8人场,除去自己后,上面7个人占7列
|
//列数,即假如8人场,除去自己后,上面7个人占7列
|
||||||
const columnCount=numberOfPlayers-1;
|
const columnCount=numberOfPlayers-1;
|
||||||
const percentage=100/numberOfPlayers;
|
const percentage=90/(columnCount-1);
|
||||||
//仅当游戏人数大于8人,且玩家的座位号大于0时,设置玩家的位置。因为0号位是game.me在最下方,无需设置。
|
//仅当游戏人数大于8人,且玩家的座位号大于0时,设置玩家的位置。因为0号位是game.me在最下方,无需设置。
|
||||||
for(let ordinal=1;ordinal<numberOfPlayers;ordinal++){
|
for(let ordinal=1;ordinal<numberOfPlayers;ordinal++){
|
||||||
const reversedOrdinal=columnCount-ordinal;
|
const reversedOrdinal=columnCount-ordinal;
|
||||||
//动态计算玩家的top属性,实现拱桥的效果。只让两边的各两个人向下偏移一些
|
//动态计算玩家的top属性,实现拱桥的效果。只让两边的各两个人向下偏移一些
|
||||||
const top=Math.max(0,Math.round(numberOfPlayers/5)-Math.min(Math.abs(ordinal-1),Math.abs(reversedOrdinal)))*oneThirdHeight;
|
const top=Math.max(0,Math.round(numberOfPlayers/5)-Math.min(Math.abs(ordinal-1),Math.abs(reversedOrdinal)))*quarterHeight;
|
||||||
playerPositions.push(lib.init.sheet([
|
playerPositions.push(lib.init.sheet([
|
||||||
`#arena[data-number='${numberOfPlayers}']>.player[data-position='${ordinal}']{`,
|
`#arena[data-number='${numberOfPlayers}']>.player[data-position='${ordinal}']{`,
|
||||||
`left:calc(${percentage*(reversedOrdinal+1)}% - ${halfWidth}px);`,
|
`left:calc(${percentage*reversedOrdinal+5}% - ${halfWidth}px);`,
|
||||||
`top:${top}px;`,
|
`top:${top}px;`,
|
||||||
`transform:scale(${scale});`,
|
`transform:scale(${scale});`,
|
||||||
'}'
|
'}'
|
||||||
|
@ -58716,8 +58719,9 @@
|
||||||
default:return get.cnNumber(parseInt(config.number))+'人'+(config.double_character?'双将':'')+'身份';
|
default:return get.cnNumber(parseInt(config.number))+'人'+(config.double_character?'双将':'')+'身份';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(config.mode=='guozhan'&&config.guozhan_mode!='normal'){
|
else if(config.mode=='guozhan'){
|
||||||
switch(config.guozhan_mode){
|
if(config.separatism) return '群雄割据';
|
||||||
|
if(config.guozhan_mode!='normal') switch(config.guozhan_mode){
|
||||||
case 'yingbian':return '应变国战';
|
case 'yingbian':return '应变国战';
|
||||||
case 'old':return '怀旧国战';
|
case 'old':return '怀旧国战';
|
||||||
}
|
}
|
||||||
|
|
384
mode/brawl.js
384
mode/brawl.js
|
@ -1143,377 +1143,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
qunxionggeju:{
|
|
||||||
name:'群雄割据',
|
|
||||||
mode:'guozhan',
|
|
||||||
intro:[
|
|
||||||
'开放不同势力组合,以优先亮出的武将牌作为自己的势力,双势力武将则使用列表的第一个势力',
|
|
||||||
],
|
|
||||||
showcase:function(init){
|
|
||||||
var node=this;
|
|
||||||
var list=[
|
|
||||||
['re_yuanshao','re_lidian'],
|
|
||||||
['zhangliao','sunquan'],
|
|
||||||
['xin_fazheng','sp_lvfan'],
|
|
||||||
['sunjian','lvbu'],
|
|
||||||
['jin_simashi','re_weiyan'],
|
|
||||||
['guanyu','sunce'],
|
|
||||||
['zhenji','sp_zhangjiao'],
|
|
||||||
['guojia','sp_zhugeliang'],
|
|
||||||
];
|
|
||||||
list.randomSort();
|
|
||||||
var func=function(){
|
|
||||||
var card=ui.create.player(null,true);
|
|
||||||
var name=list.shift();
|
|
||||||
card.init(name[0],name[1]);
|
|
||||||
card.node.marks.remove();
|
|
||||||
card.node.count.remove();
|
|
||||||
card.node.hp.remove();
|
|
||||||
card.classList.remove('unseen');
|
|
||||||
node.nodes.push(card);
|
|
||||||
card.style.position='absolute';
|
|
||||||
card.style.zIndex=2;
|
|
||||||
card.style.transition='all 2s';
|
|
||||||
var rand1=Math.round(Math.random()*100);
|
|
||||||
var rand2=Math.round(Math.random()*100);
|
|
||||||
var rand3=Math.round(Math.random()*40)-20;
|
|
||||||
card.style.left='calc('+rand1+'% - '+(rand1*1.5)+'px)';
|
|
||||||
card.style.top='calc('+rand2+'% - '+(rand2*1.8)+'px)';
|
|
||||||
card.style.transform='scale(0.8) rotate('+rand3+'deg)';
|
|
||||||
node.appendChild(card);
|
|
||||||
ui.refresh(card);
|
|
||||||
};
|
|
||||||
|
|
||||||
var list2=['feilongduofeng','taipingyaoshu','dinglanyemingzhu'];
|
|
||||||
var func2=function(){
|
|
||||||
var card=game.createCard(list2.shift(),'noclick');
|
|
||||||
node.nodes.push(card);
|
|
||||||
card.style.position='absolute';
|
|
||||||
card.style.zIndex=2;
|
|
||||||
card.style.transition='all 2s';
|
|
||||||
var rand1=Math.round(Math.random()*100);
|
|
||||||
var rand2=Math.round(Math.random()*100);
|
|
||||||
var rand3=Math.round(Math.random()*40)-20;
|
|
||||||
card.style.left='calc('+rand1+'% - '+rand1+'px)';
|
|
||||||
card.style.top='calc('+rand2+'% - '+rand2+'px)';
|
|
||||||
card.style.transform='rotate('+rand3+'deg)';
|
|
||||||
node.appendChild(card);
|
|
||||||
ui.refresh(card);
|
|
||||||
};
|
|
||||||
if(init){
|
|
||||||
node.nodes=[];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
while(node.nodes.length){
|
|
||||||
node.nodes.shift().remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(var i=0;i<5;i++){
|
|
||||||
func();
|
|
||||||
}
|
|
||||||
for(var i=0;i<3;i++){
|
|
||||||
func2();
|
|
||||||
func();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
init:function(){},
|
|
||||||
content:{
|
|
||||||
chooseCharacterBefore:function(){
|
|
||||||
game.chooseCharacter=function(){
|
|
||||||
var next=game.createEvent('chooseCharacter');
|
|
||||||
next.showConfig=true;
|
|
||||||
next.addPlayer=true;
|
|
||||||
next.ai=function(player,list,back){
|
|
||||||
var mainx=list[0];
|
|
||||||
var vicex=list[1];
|
|
||||||
if(get.guozhanReverse(mainx,vicex)){
|
|
||||||
mainx=list[1];
|
|
||||||
vicex=list[0];
|
|
||||||
}
|
|
||||||
player.init(mainx,vicex,false);
|
|
||||||
if(back){
|
|
||||||
list.remove(player.name1);
|
|
||||||
list.remove(player.name2);
|
|
||||||
for(var i=0;i<list.length;i++){
|
|
||||||
back.push(list[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
next.setContent(function(){
|
|
||||||
"step 0"
|
|
||||||
var eltp={
|
|
||||||
getGuozhanGroup:function(num){
|
|
||||||
if(num==1) return lib.character[this.name2][1];
|
|
||||||
return lib.character[this.name1][1];
|
|
||||||
},
|
|
||||||
wontYe:function(group){
|
|
||||||
if(!group) group=lib.character[this.name1][1];
|
|
||||||
if(_status.yeidentity&&_status.yeidentity.contains(group)) return false;
|
|
||||||
if(get.zhu(this,null,true)) return true;
|
|
||||||
var num=3,total=get.population();
|
|
||||||
if(total<6) num=1;
|
|
||||||
else if(total<8) num=2;
|
|
||||||
return get.totalPopulation(group)+1<=num;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
for(var i of game.players){
|
|
||||||
for(var j in eltp) i[j]=eltp[j];
|
|
||||||
}
|
|
||||||
for(var j in eltp) lib.element.player[j]=eltp[j];
|
|
||||||
ui.arena.classList.add('choose-character');
|
|
||||||
var addSetting=function(dialog){
|
|
||||||
dialog.add('选择座位').classList.add('add-setting');
|
|
||||||
var seats=document.createElement('table');
|
|
||||||
seats.classList.add('add-setting');
|
|
||||||
seats.style.margin='0';
|
|
||||||
seats.style.width='100%';
|
|
||||||
seats.style.position='relative';
|
|
||||||
for(var i=1;i<=game.players.length;i++){
|
|
||||||
var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode');
|
|
||||||
td.innerHTML='<span>'+get.cnNumber(i,true)+'</span>';
|
|
||||||
td.link=i-1;
|
|
||||||
seats.appendChild(td);
|
|
||||||
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
|
|
||||||
if(_status.dragged) return;
|
|
||||||
if(_status.justdragged) return;
|
|
||||||
if(_status.cheat_seat){
|
|
||||||
_status.cheat_seat.classList.remove('bluebg');
|
|
||||||
if(_status.cheat_seat==this){
|
|
||||||
delete _status.cheat_seat;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.classList.add('bluebg');
|
|
||||||
_status.cheat_seat=this;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
dialog.content.appendChild(seats);
|
|
||||||
if(game.me==game.zhu){
|
|
||||||
seats.previousSibling.style.display='none';
|
|
||||||
seats.style.display='none';
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog.add(ui.create.div('.placeholder.add-setting'));
|
|
||||||
dialog.add(ui.create.div('.placeholder.add-setting'));
|
|
||||||
if(get.is.phoneLayout()) dialog.add(ui.create.div('.placeholder.add-setting'));
|
|
||||||
};
|
|
||||||
var removeSetting=function(){
|
|
||||||
var dialog=_status.event.dialog;
|
|
||||||
if(dialog){
|
|
||||||
dialog.style.height='';
|
|
||||||
delete dialog._scrollset;
|
|
||||||
var list=Array.from(dialog.querySelectorAll('.add-setting'));
|
|
||||||
while(list.length){
|
|
||||||
list.shift().remove();
|
|
||||||
}
|
|
||||||
ui.update();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
event.addSetting=addSetting;
|
|
||||||
event.removeSetting=removeSetting;
|
|
||||||
|
|
||||||
var chosen=lib.config.continue_name||[];
|
|
||||||
game.saveConfig('continue_name');
|
|
||||||
event.chosen=chosen;
|
|
||||||
|
|
||||||
var i;
|
|
||||||
event.list=[];
|
|
||||||
for(i in lib.character){
|
|
||||||
if(i.indexOf('gz_shibing')==0) continue;
|
|
||||||
if(chosen.contains(i)) continue;
|
|
||||||
if(lib.filter.characterDisabled(i)) continue;
|
|
||||||
if(get.config('onlyguozhan')){
|
|
||||||
if(!lib.characterPack.mode_guozhan[i]) continue;
|
|
||||||
if(get.is.jun(i)) continue;
|
|
||||||
}
|
|
||||||
if(lib.character[i][4].contains('hiddenSkill')) continue;
|
|
||||||
if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5)
|
|
||||||
event.list.push(i);
|
|
||||||
}
|
|
||||||
_status.characterlist=event.list.slice(0);
|
|
||||||
_status.yeidentity=[];
|
|
||||||
event.list.randomSort();
|
|
||||||
// var list=event.list.splice(0,parseInt(get.config('choice_num')));
|
|
||||||
var list=event.list.randomRemove(parseInt(get.config('choice_num')));
|
|
||||||
if(_status.auto){
|
|
||||||
event.ai(game.me,list);
|
|
||||||
lib.init.onfree();
|
|
||||||
}
|
|
||||||
else if(chosen.length){
|
|
||||||
game.me.init(chosen[0],chosen[1],false);
|
|
||||||
lib.init.onfree();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
var dialog=ui.create.dialog('选择角色','hidden',[list,'character']);
|
|
||||||
if(get.config('change_identity')){
|
|
||||||
addSetting(dialog);
|
|
||||||
}
|
|
||||||
var next=game.me.chooseButton(dialog,true,2).set('onfree',true);
|
|
||||||
next.filterButton=function(button){
|
|
||||||
if(ui.dialog.buttons.length<=10){
|
|
||||||
for(var i=0;i<ui.dialog.buttons.length;i++){
|
|
||||||
if(ui.dialog.buttons[i]!=button){
|
|
||||||
if(lib.element.player.perfectPair.call({
|
|
||||||
name1:button.link,name2:ui.dialog.buttons[i].link
|
|
||||||
})){
|
|
||||||
button.classList.add('glow2');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
next.switchToAuto=function(){
|
|
||||||
event.ai(game.me,list);
|
|
||||||
ui.arena.classList.remove('selecting');
|
|
||||||
};
|
|
||||||
var createCharacterDialog=function(){
|
|
||||||
event.dialogxx=ui.create.characterDialog('heightset',function(i){
|
|
||||||
if(i.indexOf('gz_shibing')==0) return true;
|
|
||||||
if(get.config('onlyguozhan')){
|
|
||||||
if(!lib.characterPack.mode_guozhan[i]) return true;
|
|
||||||
if(get.is.jun(i)) return true;
|
|
||||||
}
|
|
||||||
},get.config('onlyguozhanexpand')?'expandall':undefined,get.config('onlyguozhan')?'onlypack:mode_guozhan':undefined);
|
|
||||||
if(ui.cheat2){
|
|
||||||
ui.cheat2.animate('controlpressdownx',500);
|
|
||||||
ui.cheat2.classList.remove('disabled');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if(lib.onfree){
|
|
||||||
lib.onfree.push(createCharacterDialog);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
createCharacterDialog();
|
|
||||||
}
|
|
||||||
ui.create.cheat2=function(){
|
|
||||||
ui.cheat2=ui.create.control('自由选将',function(){
|
|
||||||
if(this.dialog==_status.event.dialog){
|
|
||||||
if(game.changeCoin){
|
|
||||||
game.changeCoin(50);
|
|
||||||
}
|
|
||||||
this.dialog.close();
|
|
||||||
_status.event.dialog=this.backup;
|
|
||||||
this.backup.open();
|
|
||||||
delete this.backup;
|
|
||||||
game.uncheck();
|
|
||||||
game.check();
|
|
||||||
if(ui.cheat){
|
|
||||||
ui.cheat.animate('controlpressdownx',500);
|
|
||||||
ui.cheat.classList.remove('disabled');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.changeCoin){
|
|
||||||
game.changeCoin(-10);
|
|
||||||
}
|
|
||||||
this.backup=_status.event.dialog;
|
|
||||||
_status.event.dialog.close();
|
|
||||||
_status.event.dialog=_status.event.parent.dialogxx;
|
|
||||||
this.dialog=_status.event.dialog;
|
|
||||||
this.dialog.open();
|
|
||||||
game.uncheck();
|
|
||||||
game.check();
|
|
||||||
if(ui.cheat){
|
|
||||||
ui.cheat.classList.add('disabled');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(lib.onfree){
|
|
||||||
ui.cheat2.classList.add('disabled');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ui.create.cheat=function(){
|
|
||||||
_status.createControl=ui.cheat2;
|
|
||||||
ui.cheat=ui.create.control('更换',function(){
|
|
||||||
if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(game.changeCoin){
|
|
||||||
game.changeCoin(-3);
|
|
||||||
}
|
|
||||||
event.list=event.list.concat(list);
|
|
||||||
event.list.randomSort();
|
|
||||||
// list=event.list.splice(0,parseInt(get.config('choice_num')));
|
|
||||||
list=event.list.randomRemove(parseInt(get.config('choice_num')));
|
|
||||||
var buttons=ui.create.div('.buttons');
|
|
||||||
var node=_status.event.dialog.buttons[0].parentNode;
|
|
||||||
_status.event.dialog.buttons=ui.create.buttons(list,'character',buttons);
|
|
||||||
_status.event.dialog.content.insertBefore(buttons,node);
|
|
||||||
buttons.animate('start');
|
|
||||||
node.remove();
|
|
||||||
game.uncheck();
|
|
||||||
game.check();
|
|
||||||
});
|
|
||||||
delete _status.createControl;
|
|
||||||
}
|
|
||||||
if(!ui.cheat&&get.config('change_choice'))
|
|
||||||
ui.create.cheat();
|
|
||||||
if(!ui.cheat2&&get.config('free_choose'))
|
|
||||||
ui.create.cheat2();
|
|
||||||
}
|
|
||||||
"step 1"
|
|
||||||
if(ui.cheat){
|
|
||||||
ui.cheat.close();
|
|
||||||
delete ui.cheat;
|
|
||||||
}
|
|
||||||
if(ui.cheat2){
|
|
||||||
ui.cheat2.close();
|
|
||||||
delete ui.cheat2;
|
|
||||||
}
|
|
||||||
if(result.buttons){
|
|
||||||
game.me.init(result.buttons[0].link,result.buttons[1].link,false);
|
|
||||||
game.addRecentCharacter(result.buttons[0].link,result.buttons[1].link);
|
|
||||||
}
|
|
||||||
// game.me.setIdentity(game.me.group);
|
|
||||||
event.list.remove(game.me.name1);
|
|
||||||
event.list.remove(game.me.name2);
|
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
if(game.players[i]!=game.me){
|
|
||||||
event.ai(game.players[i],event.list.randomRemove(parseInt(get.config('choice_num'))),event.list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
game.players[i].classList.add('unseen');
|
|
||||||
game.players[i].classList.add('unseen2');
|
|
||||||
_status.characterlist.remove(game.players[i].name);
|
|
||||||
_status.characterlist.remove(game.players[i].name2);
|
|
||||||
if(game.players[i]!=game.me){
|
|
||||||
game.players[i].node.identity.firstChild.innerHTML='猜';
|
|
||||||
game.players[i].node.identity.dataset.color='unknown';
|
|
||||||
game.players[i].node.identity.classList.add('guessing');
|
|
||||||
}
|
|
||||||
game.players[i].hiddenSkills=lib.character[game.players[i].name1][3].slice(0);
|
|
||||||
var hiddenSkills2=lib.character[game.players[i].name2][3];
|
|
||||||
for(var j=0;j<hiddenSkills2.length;j++){
|
|
||||||
game.players[i].hiddenSkills.add(hiddenSkills2[j]);
|
|
||||||
}
|
|
||||||
for(var j=0;j<game.players[i].hiddenSkills.length;j++){
|
|
||||||
if(!lib.skill[game.players[i].hiddenSkills[j]]){
|
|
||||||
game.players[i].hiddenSkills.splice(j--,1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
game.players[i].group='unknown';
|
|
||||||
game.players[i].sex='unknown';
|
|
||||||
game.players[i].name1=game.players[i].name;
|
|
||||||
game.players[i].name='unknown';
|
|
||||||
game.players[i].identity='unknown';
|
|
||||||
game.players[i].node.name.show();
|
|
||||||
game.players[i].node.name2.show();
|
|
||||||
game.players[i]._group=lib.character[game.players[i].name1][1];
|
|
||||||
for(var j=0;j<game.players[i].hiddenSkills.length;j++){
|
|
||||||
game.players[i].addSkillTrigger(game.players[i].hiddenSkills[j],true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setTimeout(function(){
|
|
||||||
ui.arena.classList.remove('choose-character');
|
|
||||||
},500);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
duzhansanguo:{
|
duzhansanguo:{
|
||||||
name:'毒战三国',
|
name:'毒战三国',
|
||||||
mode:'identity',
|
mode:'identity',
|
||||||
|
@ -4204,7 +3833,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
},style);
|
},style);
|
||||||
var editPile=ui.create.node('button','场景选项',line1,function(){
|
var editPile=ui.create.node('button','场景选项',line1,function(){
|
||||||
resetCharacter();
|
resetCharacter();
|
||||||
addCharacter.disabled=true;
|
|
||||||
// editCode.disabled=true;
|
// editCode.disabled=true;
|
||||||
saveButton.disabled=true;
|
saveButton.disabled=true;
|
||||||
// exportButton.disabled=true;
|
// exportButton.disabled=true;
|
||||||
|
@ -4636,14 +4264,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
player.listen(function(){
|
player.listen(function(){
|
||||||
if(confirm('是否删除此角色?')){
|
if(confirm('是否删除此角色?')){
|
||||||
this.remove();
|
this.remove();
|
||||||
if(line7.childElementCount<8){
|
|
||||||
addCharacter.disabled=false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(line7.childElementCount>=8){
|
|
||||||
addCharacter.disabled=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return player;
|
return player;
|
||||||
};
|
};
|
||||||
|
@ -4711,12 +4333,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
line9.style.display='none';
|
line9.style.display='none';
|
||||||
line9.style.marginTop='20px';
|
line9.style.marginTop='20px';
|
||||||
var resetStatus=function(all){
|
var resetStatus=function(all){
|
||||||
if(line7.childElementCount>=8){
|
|
||||||
addCharacter.disabled=true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
addCharacter.disabled=false;
|
|
||||||
}
|
|
||||||
// editCode.disabled=false;
|
// editCode.disabled=false;
|
||||||
saveButton.disabled=false;
|
saveButton.disabled=false;
|
||||||
// exportButton.disabled=false;
|
// exportButton.disabled=false;
|
||||||
|
|
|
@ -99,11 +99,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
if(_status.brawl&&_status.brawl.submode){
|
if(_status.brawl&&_status.brawl.submode){
|
||||||
_status.mode=_status.brawl.submode;
|
_status.mode=_status.brawl.submode;
|
||||||
}
|
}
|
||||||
|
if(get.config('separatism')) _status.separatism=true;
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
if(_status.connectMode){
|
if(_status.connectMode){
|
||||||
_status.mode=lib.configOL.guozhan_mode;
|
_status.mode=lib.configOL.guozhan_mode;
|
||||||
if(!['normal','yingbian','old'].contains(_status.mode)) _status.mode='normal';
|
if(!['normal','yingbian','old'].contains(_status.mode)) _status.mode='normal';
|
||||||
|
if(lib.configOL.separatism) _status.separatism=true;
|
||||||
//决定牌堆
|
//决定牌堆
|
||||||
switch(_status.mode){
|
switch(_status.mode){
|
||||||
case 'old':lib.card.list=lib.guozhanPile_old.slice(0);break;
|
case 'old':lib.card.list=lib.guozhanPile_old.slice(0);break;
|
||||||
|
@ -115,8 +117,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
default:lib.card.list=lib.guozhanPile.slice(0);break;
|
default:lib.card.list=lib.guozhanPile.slice(0);break;
|
||||||
}
|
}
|
||||||
game.fixedPile=true;
|
game.fixedPile=true;
|
||||||
game.broadcastAll(function(mode){
|
game.broadcastAll((mode,separatism)=>{
|
||||||
_status.mode=mode;
|
_status.mode=mode;
|
||||||
|
if(separatism) _status.separatism=true;
|
||||||
if(mode=='yingbian'){
|
if(mode=='yingbian'){
|
||||||
delete lib.translate.shuiyanqijunx_info_guozhan;
|
delete lib.translate.shuiyanqijunx_info_guozhan;
|
||||||
}
|
}
|
||||||
|
@ -145,7 +148,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lib.characterReplace={};
|
lib.characterReplace={};
|
||||||
},_status.mode);
|
},_status.mode,_status.separatism);
|
||||||
game.randomMapOL();
|
game.randomMapOL();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -13504,6 +13507,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
else{
|
else{
|
||||||
num={mark:'标记',draw:'摸牌'}[lib.configOL.initshow_draw];
|
num={mark:'标记',draw:'摸牌'}[lib.configOL.initshow_draw];
|
||||||
}
|
}
|
||||||
|
uiintro.add('<div class="text chat">群雄割据:'+(lib.configOL.separatism?'开启':'关闭'));
|
||||||
uiintro.add('<div class="text chat">首亮奖励:'+num);
|
uiintro.add('<div class="text chat">首亮奖励:'+num);
|
||||||
uiintro.add('<div class="text chat">珠联璧合:'+(lib.configOL.zhulian?'开启':'关闭'));
|
uiintro.add('<div class="text chat">珠联璧合:'+(lib.configOL.zhulian?'开启':'关闭'));
|
||||||
uiintro.add('<div class="text chat">出牌时限:'+lib.configOL.choose_timeout+'秒');
|
uiintro.add('<div class="text chat">出牌时限:'+lib.configOL.choose_timeout+'秒');
|
||||||
|
@ -13585,7 +13589,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
getVideoName:function(){
|
getVideoName:function(){
|
||||||
var str=get.translation(game.me.name1)+'/'+get.translation(game.me.name2);
|
var str=get.translation(game.me.name1)+'/'+get.translation(game.me.name2);
|
||||||
var str2=get.cnNumber(parseInt(get.config('player_number')))+'人'+
|
var str2=_status.separatism?get.modetrans({
|
||||||
|
mode:lib.config.mode,
|
||||||
|
separatism:true
|
||||||
|
}):get.cnNumber(parseInt(get.config('player_number')))+'人'+
|
||||||
get.translation(lib.config.mode);
|
get.translation(lib.config.mode);
|
||||||
if(game.me.identity=='ye'){
|
if(game.me.identity=='ye'){
|
||||||
str2+=' - 野心家';
|
str2+=' - 野心家';
|
||||||
|
@ -13689,6 +13696,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var filterChoice=function(name1,name2){
|
var filterChoice=function(name1,name2){
|
||||||
|
if(_status.separatism) return true;
|
||||||
var group1=lib.character[name1][1];
|
var group1=lib.character[name1][1];
|
||||||
var group2=lib.character[name2][1];
|
var group2=lib.character[name2][1];
|
||||||
var doublex=get.is.double(name1,true);
|
var doublex=get.is.double(name1,true);
|
||||||
|
@ -13849,6 +13857,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
if(lib.character[button.link][4].contains('hiddenSkill')) return false;
|
if(lib.character[button.link][4].contains('hiddenSkill')) return false;
|
||||||
var filterChoice=function(name1,name2){
|
var filterChoice=function(name1,name2){
|
||||||
|
if(_status.separatism) return true;
|
||||||
var group1=lib.character[name1][1];
|
var group1=lib.character[name1][1];
|
||||||
var group2=lib.character[name2][1];
|
var group2=lib.character[name2][1];
|
||||||
var doublex=get.is.double(name1,true);
|
var doublex=get.is.double(name1,true);
|
||||||
|
@ -14078,6 +14087,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var filterChoice=function(name1,name2){
|
var filterChoice=function(name1,name2){
|
||||||
|
if(_status.separatism) return true;
|
||||||
var group1=lib.character[name1][1];
|
var group1=lib.character[name1][1];
|
||||||
var group2=lib.character[name2][1];
|
var group2=lib.character[name2][1];
|
||||||
var doublex=get.is.double(name1,true);
|
var doublex=get.is.double(name1,true);
|
||||||
|
@ -14113,13 +14123,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}).set('processAI',function(){
|
}).set('processAI',function(){
|
||||||
var buttons=_status.event.dialog.buttons;
|
var buttons=_status.event.dialog.buttons;
|
||||||
var filterChoice=function(name1,name2){
|
var filterChoice=function(name1,name2){
|
||||||
if(get.is.double(name1)) return false;
|
if(_status.separatism) return true;
|
||||||
var group1=lib.character[name1][1];
|
var group1=lib.character[name1][1];
|
||||||
var group2=lib.character[name2][1];
|
var group2=lib.character[name2][1];
|
||||||
if(group1=='ye') return group2!='ye';
|
var doublex=get.is.double(name1,true);
|
||||||
var double=get.is.double(name2,true);
|
if(doublex){
|
||||||
if(double) return double.contains(group1);
|
var double=get.is.double(name2,true);
|
||||||
return group1==group2;
|
if(double) return doublex.some(group=>double.contains(group));
|
||||||
|
return doublex.contains(group2);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(group1=='ye') return group2!='ye';
|
||||||
|
var double=get.is.double(name2,true);
|
||||||
|
if(double) return double.contains(group1);
|
||||||
|
return group1==group2;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
for(var i=0;i<buttons.length-1;i++){
|
for(var i=0;i<buttons.length-1;i++){
|
||||||
for(var j=i+1;j<buttons.length;j++){
|
for(var j=i+1;j<buttons.length;j++){
|
||||||
|
@ -16020,7 +16038,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
if(_status.yeidentity&&_status.yeidentity.contains(group)) return false;
|
if(_status.yeidentity&&_status.yeidentity.contains(group)) return false;
|
||||||
if(get.zhu(this,null,group)) return true;
|
if(get.zhu(this,null,group)) return true;
|
||||||
return get.totalPopulation(group)+1<=get.population()/2;
|
return get.totalPopulation(group)+1<=_status.separatism?Math.max(get.population()/2-1,1):get.population()/2;
|
||||||
},
|
},
|
||||||
perfectPair:function(choosing){
|
perfectPair:function(choosing){
|
||||||
if(_status.connectMode){
|
if(_status.connectMode){
|
||||||
|
|
|
@ -3802,9 +3802,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
if(player.identity=='zhu'){
|
if(player.identity=='zhu'){
|
||||||
if(event.player==player){
|
if(event.player==player){
|
||||||
if(event.name=='dying') return true;
|
if(event.name=='dying') return true;
|
||||||
return game.roundNumber>=Math.max(Math.round(get.totalPopulation()/2),3);
|
return game.roundNumber>=Math.max(Math.round(get.population()/2),3);
|
||||||
}
|
}
|
||||||
if(event.name=='die') return game.dead.length>=Math.max(Math.round(get.totalPopulation()/3),2);
|
if(event.name=='die') return game.dead.length>=Math.max(Math.round(get.population()/3),2);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue