1.8.2
This commit is contained in:
parent
4b300b1fc2
commit
59a1cc57ca
|
@ -53,6 +53,9 @@ card.mingzhong={
|
||||||
order:2.5,
|
order:2.5,
|
||||||
value:[4,1],
|
value:[4,1],
|
||||||
useful:1,
|
useful:1,
|
||||||
|
wuxie:function(){
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
var ok=false;
|
var ok=false;
|
||||||
|
|
108
card/standard.js
108
card/standard.js
|
@ -77,16 +77,18 @@ card.standard={
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var next=target.chooseToRespond({name:'shan'});
|
var next=target.chooseToRespond({name:'shan'});
|
||||||
next.ai=function(){
|
next.set('ai',function(){
|
||||||
|
var target=_status.event.player;
|
||||||
|
var evt=_status.event.getParent();
|
||||||
var sks=target.get('s');
|
var sks=target.get('s');
|
||||||
if(sks.contains('leiji')||
|
if(sks.contains('leiji')||
|
||||||
sks.contains('diyleiji')||
|
sks.contains('diyleiji')||
|
||||||
sks.contains('lingbo')){
|
sks.contains('lingbo')){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(ai.get.damageEffect(target,player,target,card.nature)>=0) return -1;
|
if(ai.get.damageEffect(target,evt.player,target,evt.card.nature)>=0) return -1;
|
||||||
return 1;
|
return 1;
|
||||||
};
|
});
|
||||||
next.autochoose=lib.filter.autoRespondShan;
|
next.autochoose=lib.filter.autoRespondShan;
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
@ -605,12 +607,13 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var next=target.chooseToRespond({name:'sha'});
|
var next=target.chooseToRespond({name:'sha'});
|
||||||
next.ai=function(card){
|
next.set('ai',function(card){
|
||||||
if(ai.get.damageEffect(target,player,target)>=0) return 0;
|
var evt=_status.event.getParent();
|
||||||
if(player.get('s').contains('xinwuyan')) return 0;
|
if(ai.get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
|
||||||
if(target.get('s').contains('xinwuyan')) return 0;
|
if(evt.player.get('s').contains('xinwuyan')) return 0;
|
||||||
|
if(evt.target.get('s').contains('xinwuyan')) return 0;
|
||||||
return 1;
|
return 1;
|
||||||
};
|
});
|
||||||
next.autochoose=lib.filter.autoRespondSha;
|
next.autochoose=lib.filter.autoRespondSha;
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool==false){
|
if(result.bool==false){
|
||||||
|
@ -664,12 +667,13 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var next=target.chooseToRespond({name:'shan'});
|
var next=target.chooseToRespond({name:'shan'});
|
||||||
next.ai=function(card){
|
next.set('ai',function(card){
|
||||||
if(ai.get.damageEffect(target,player,target)>=0) return 0;
|
var evt=_status.event.getParent();
|
||||||
if(player.get('s').contains('xinwuyan')) return 0;
|
if(ai.get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
|
||||||
if(target.get('s').contains('xinwuyan')) return 0;
|
if(evt.player.get('s').contains('xinwuyan')) return 0;
|
||||||
|
if(evt.target.get('s').contains('xinwuyan')) return 0;
|
||||||
return 1;
|
return 1;
|
||||||
};
|
});
|
||||||
next.autochoose=lib.filter.autoRespondShan;
|
next.autochoose=lib.filter.autoRespondShan;
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool==false){
|
if(result.bool==false){
|
||||||
|
@ -1196,9 +1200,10 @@ card.standard={
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
trigger.target.chooseToDiscard().ai=function(card){
|
trigger.target.chooseToDiscard().set('ai',function(card){
|
||||||
return -ai.get.attitude(trigger.target,player)-ai.get.value(card);
|
var trigger=_status.event.getParent()._trigger;
|
||||||
};
|
return -ai.get.attitude(trigger.target,trigger.player)-ai.get.value(card);
|
||||||
|
});
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool==false) player.draw();
|
if(result.bool==false) player.draw();
|
||||||
}
|
}
|
||||||
|
@ -1265,21 +1270,21 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var next=player.chooseToDiscard('是否发动贯石斧?',2,'he',function(card){
|
var next=player.chooseToDiscard('是否发动贯石斧?',2,'he',function(card){
|
||||||
return player.get('e',{subtype:'equip1'}).contains(card)==false;
|
return _status.event.player.get('e',{subtype:'equip1'}).contains(card)==false;
|
||||||
});
|
});
|
||||||
next.logSkill='guanshi_skill';
|
next.logSkill='guanshi_skill';
|
||||||
next.ai=
|
next.set('ai',function(card){
|
||||||
function(card){
|
var evt=_status.event.getParent();
|
||||||
if(ai.get.attitude(player,trigger.target)<0){
|
if(ai.get.attitude(evt.player,evt._trigger.target)<0){
|
||||||
if(player.skills.contains('jiu')||
|
if(evt.player.skills.contains('jiu')||
|
||||||
player.skills.contains('tianxianjiu')||
|
evt.player.skills.contains('tianxianjiu')||
|
||||||
trigger.target.hp==1){
|
evt._trigger.target.hp==1){
|
||||||
return 8-ai.get.value(card)
|
return 8-ai.get.value(card)
|
||||||
}
|
}
|
||||||
return 5-ai.get.value(card)
|
return 5-ai.get.value(card)
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
};
|
});
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
trigger.untrigger();
|
trigger.untrigger();
|
||||||
|
@ -1312,17 +1317,17 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var att=(ai.get.attitude(player,trigger.target)<=0);
|
var att=(ai.get.attitude(player,trigger.target)<=0);
|
||||||
player.chooseButton(ui.create.dialog('选择要弃置的马',
|
var next=player.chooseButton();
|
||||||
trigger.target.get('e',{subtype:['equip3','equip4']}))).ai=function(button){
|
next.set('att',att);
|
||||||
if(att){
|
next.set('createDialog',['选择要弃置的马',trigger.target.get('e',{subtype:['equip3','equip4']})]);
|
||||||
return ai.get.buttonValue(button);
|
next.set('ai',function(button){
|
||||||
}
|
if(_status.event.att) return ai.get.buttonValue(button);
|
||||||
return 0;
|
return 0;
|
||||||
};
|
});
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.logSkill('qilin_skill');
|
player.logSkill('qilin_skill');
|
||||||
trigger.target.discard(result.buttons[0].link);
|
trigger.target.discard(result.links[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1399,6 +1404,7 @@ card.standard={
|
||||||
var id=get.id();
|
var id=get.id();
|
||||||
event.id=id;
|
event.id=id;
|
||||||
var send=function(state,isJudge,card,source,target,targets,id){
|
var send=function(state,isJudge,card,source,target,targets,id){
|
||||||
|
state=state?1:-1;
|
||||||
var str='';
|
var str='';
|
||||||
if(isJudge){
|
if(isJudge){
|
||||||
str+=get.translation(source)+'的';
|
str+=get.translation(source)+'的';
|
||||||
|
@ -1432,7 +1438,7 @@ card.standard={
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var eff=ai.get.effect(source,card,source,_status.event.player);
|
var eff=ai.get.effect(source,card,source,source);
|
||||||
if(eff>=0) return 0;
|
if(eff>=0) return 0;
|
||||||
return state*ai.get.attitude(_status.event.player,source);
|
return state*ai.get.attitude(_status.event.player,source);
|
||||||
}
|
}
|
||||||
|
@ -1466,20 +1472,44 @@ card.standard={
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var aix=function(player){
|
var aix=function(player){
|
||||||
var info=get.info(event.card);
|
var source=event.source;
|
||||||
|
var card=event.card;
|
||||||
|
var state=event.state?1:-1;
|
||||||
|
var target=event.target;
|
||||||
|
var targets=event.targets;
|
||||||
|
if(event.triggername=='phaseJudge'){
|
||||||
|
var info=lib.card[card.viewAs||card.name];
|
||||||
|
if(info&&info.ai&&info.ai.wuxie){
|
||||||
|
var aiii=info.ai.wuxie(source,card,source,player,state);
|
||||||
|
if(typeof aiii=='number') return aiii;
|
||||||
|
}
|
||||||
|
if(Math.abs(ai.get.attitude(player,source))<3) return 0;
|
||||||
|
if(source.skills.contains('guanxing')) return 0;
|
||||||
|
if(card.name!='lebu'&&card.name!='bingliang'){
|
||||||
|
if(source!=player){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var eff=ai.get.effect(source,card,source,source);
|
||||||
|
if(eff>=0) return 0;
|
||||||
|
return state*ai.get.attitude(player,source);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var info=get.info(card);
|
||||||
if(info.ai&&info.ai.wuxie){
|
if(info.ai&&info.ai.wuxie){
|
||||||
var aiii=info.ai.wuxie(event.target,event.card,event.source,player,event.state);
|
var aiii=info.ai.wuxie(target,card,source,player,state);
|
||||||
if(typeof aiii=='number') return aiii;
|
if(typeof aiii=='number') return aiii;
|
||||||
}
|
}
|
||||||
if(info.multitarget&&targets){
|
if(info.multitarget&&targets){
|
||||||
var eff=0;
|
var eff=0;
|
||||||
for(var i=0;i<event.targets.length;i++){
|
for(var i=0;i<targets.length;i++){
|
||||||
eff+=ai.get.effect(event.targets[i],event.card,event.source,player)
|
eff+=ai.get.effect(targets[i],card,source,player)
|
||||||
}
|
}
|
||||||
return -eff*state;
|
return -eff*state;
|
||||||
}
|
}
|
||||||
if(Math.abs(ai.get.attitude(player,event.target))<3) return 0;
|
if(Math.abs(ai.get.attitude(player,target))<3) return 0;
|
||||||
return -ai.get.effect(event.target,event.card,event.source,player)*event.state;
|
return -ai.get.effect(target,card,source,player)*state;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
var sendback=function(result,player){
|
var sendback=function(result,player){
|
||||||
if(result&&result.id==id&&!event.wuxieresult&&result.bool){
|
if(result&&result.id==id&&!event.wuxieresult&&result.bool){
|
||||||
|
@ -1542,7 +1572,7 @@ card.standard={
|
||||||
game.resume();
|
game.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},event.aionly?200:(Math.random()*90000+3000));
|
},event.aionly?200:(Math.random()*5000+3000));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
event.aionly=false;
|
event.aionly=false;
|
||||||
|
|
|
@ -228,7 +228,7 @@ character.refresh={
|
||||||
cards.splice(i,1);i--;
|
cards.splice(i,1);i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.gain(cards);
|
player.gain(cards,'gain2');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reluoyi2:{
|
reluoyi2:{
|
||||||
|
|
|
@ -122,7 +122,7 @@ character.standard={
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.logSkill('fankui',trigger.source);
|
player.logSkill('fankui',trigger.source);
|
||||||
player.gain(result.buttons[0].link);
|
player.gain(result.links[0]);
|
||||||
trigger.source.$give(1,player);
|
trigger.source.$give(1,player);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1009,12 +1009,15 @@ character.standard={
|
||||||
filterCard:true,
|
filterCard:true,
|
||||||
selectCard:[1,Infinity],
|
selectCard:[1,Infinity],
|
||||||
prompt:'弃置任意张牌并摸等量的牌',
|
prompt:'弃置任意张牌并摸等量的牌',
|
||||||
check:function(card){return 6-ai.get.value(card)},
|
check:function(card){
|
||||||
|
return -1;
|
||||||
|
return 6-ai.get.value(card)
|
||||||
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
player.draw(cards.length);
|
player.draw(cards.length);
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
order:1,
|
order:11,
|
||||||
result:{
|
result:{
|
||||||
player:1
|
player:1
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
window.noname_asset_list=[
|
window.noname_asset_list=[
|
||||||
'1.8.1.1',
|
'1.8.2',
|
||||||
'image/background/huangtian_bg.jpg',
|
'image/background/huangtian_bg.jpg',
|
||||||
'image/background/shengshi_bg.jpg',
|
'image/background/shengshi_bg.jpg',
|
||||||
'image/background/xueji_bg.jpg',
|
'image/background/xueji_bg.jpg',
|
||||||
|
|
374
game/game.js
374
game/game.js
|
@ -1879,7 +1879,7 @@
|
||||||
onclick:function(bool){
|
onclick:function(bool){
|
||||||
game.saveConfig('dierestart',bool,this._link.config.mode);
|
game.saveConfig('dierestart',bool,this._link.config.mode);
|
||||||
if(get.config('dierestart')){
|
if(get.config('dierestart')){
|
||||||
if(!ui.restart&&game.me.isDead()){
|
if(!ui.restart&&game.me.isDead()&&!_status.connectMode){
|
||||||
ui.restart=ui.create.control('restart',game.reload);
|
ui.restart=ui.create.control('restart',game.reload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2115,7 +2115,7 @@
|
||||||
onclick:function(bool){
|
onclick:function(bool){
|
||||||
game.saveConfig('dierestart',bool,this._link.config.mode);
|
game.saveConfig('dierestart',bool,this._link.config.mode);
|
||||||
if(get.config('dierestart')){
|
if(get.config('dierestart')){
|
||||||
if(!ui.restart&&game.me.isDead()){
|
if(!ui.restart&&game.me.isDead()&&!_status.connectMode){
|
||||||
ui.restart=ui.create.control('restart',game.reload);
|
ui.restart=ui.create.control('restart',game.reload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3359,8 +3359,8 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(lib.config.debug){
|
if(lib.config.debug&&window.require){
|
||||||
require('remote').getCurrentWindow().openDevTools();
|
window.require('remote').getCurrentWindow().openDevTools();
|
||||||
}
|
}
|
||||||
ui.background=ui.create.div('.background');
|
ui.background=ui.create.div('.background');
|
||||||
ui.background.style.backgroundSize="cover";
|
ui.background.style.backgroundSize="cover";
|
||||||
|
@ -3697,6 +3697,9 @@
|
||||||
|
|
||||||
if(lib.config.connectMode&&lib.mode[lib.config.mode].connect){
|
if(lib.config.connectMode&&lib.mode[lib.config.mode].connect){
|
||||||
_status.connectMode=true;
|
_status.connectMode=true;
|
||||||
|
}
|
||||||
|
else if(lib.config.mode=='connect'){
|
||||||
|
_status.connectMode=true;
|
||||||
}
|
}
|
||||||
if(lib.config.cheat&&!_status.connectMode){
|
if(lib.config.cheat&&!_status.connectMode){
|
||||||
cheat.i();
|
cheat.i();
|
||||||
|
@ -4240,6 +4243,7 @@
|
||||||
ui.click.cancel();
|
ui.click.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"step 2"
|
||||||
delete _status.noclearcountdown;
|
delete _status.noclearcountdown;
|
||||||
if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){
|
if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){
|
||||||
event.skillDialog.close();
|
event.skillDialog.close();
|
||||||
|
@ -4254,7 +4258,7 @@
|
||||||
if(!_status.noclearcountdown){
|
if(!_status.noclearcountdown){
|
||||||
game.stopCountChoose();
|
game.stopCountChoose();
|
||||||
}
|
}
|
||||||
"step 2"
|
"step 3"
|
||||||
if(event._result&&event.result){
|
if(event._result&&event.result){
|
||||||
event.result.result=event._result;
|
event.result.result=event._result;
|
||||||
}
|
}
|
||||||
|
@ -4265,7 +4269,7 @@
|
||||||
delete event.dialog;
|
delete event.dialog;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(event.autochoose&&event.autochoose()){
|
if(!_status.connectMode&&event.autochoose&&event.autochoose()){
|
||||||
event.result={bool:false};
|
event.result={bool:false};
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -4274,7 +4278,16 @@
|
||||||
game.pause();
|
game.pause();
|
||||||
if(event.dialog) event.dialog=ui.create.dialog(event.dialog);
|
if(event.dialog) event.dialog=ui.create.dialog(event.dialog);
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
if(ai.basic.chooseCard(event.ai)||forced){
|
if(ai.basic.chooseCard(event.ai)||forced){
|
||||||
ui.click.ok();
|
ui.click.ok();
|
||||||
}
|
}
|
||||||
|
@ -4289,9 +4302,8 @@
|
||||||
ui.click.cancel();
|
ui.click.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
"step 2"
|
||||||
"step 1"
|
if(event.result.bool&&!game.online){
|
||||||
if(event.result.bool){
|
|
||||||
player.respond(event.result.cards,event.result.card,event.animate,event.result.skill,event.source);
|
player.respond(event.result.cards,event.result.card,event.animate,event.result.skill,event.source);
|
||||||
}
|
}
|
||||||
if(event.dialog&&event.dialog.close) event.dialog.close();
|
if(event.dialog&&event.dialog.close) event.dialog.close();
|
||||||
|
@ -4342,7 +4354,16 @@
|
||||||
event.dialog.open();
|
event.dialog.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
if(ai.basic.chooseCard(event.ai)||forced){
|
if(ai.basic.chooseCard(event.ai)||forced){
|
||||||
ui.click.ok();
|
ui.click.ok();
|
||||||
}
|
}
|
||||||
|
@ -4357,8 +4378,7 @@
|
||||||
ui.click.cancel();
|
ui.click.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
"step 2"
|
||||||
"step 1"
|
|
||||||
if(event.promptdiscard){
|
if(event.promptdiscard){
|
||||||
event.promptdiscard.close();
|
event.promptdiscard.close();
|
||||||
}
|
}
|
||||||
|
@ -4370,7 +4390,7 @@
|
||||||
player.logSkill.apply(player,event.logSkill);
|
player.logSkill.apply(player,event.logSkill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.discard(event.result.cards);
|
if(!game.online) player.discard(event.result.cards);
|
||||||
if(event.dialog) event.dialog.close();
|
if(event.dialog) event.dialog.close();
|
||||||
},
|
},
|
||||||
chooseToCompare:function(){
|
chooseToCompare:function(){
|
||||||
|
@ -4395,6 +4415,9 @@
|
||||||
player.lose(event.card1);
|
player.lose(event.card1);
|
||||||
target.lose(event.card2);
|
target.lose(event.card2);
|
||||||
"step 3"
|
"step 3"
|
||||||
|
game.broadcast(function(){
|
||||||
|
ui.arena.classList.add('thrownhighlight');
|
||||||
|
});
|
||||||
ui.arena.classList.add('thrownhighlight');
|
ui.arena.classList.add('thrownhighlight');
|
||||||
game.addVideo('thrownhighlight1');
|
game.addVideo('thrownhighlight1');
|
||||||
player.$compare(event.card1,target,event.card2);
|
player.$compare(event.card1,target,event.card2);
|
||||||
|
@ -4404,11 +4427,17 @@
|
||||||
player:event.card1,
|
player:event.card1,
|
||||||
target:event.card2,
|
target:event.card2,
|
||||||
}
|
}
|
||||||
|
event.dialogid=lib.status.videoId++;
|
||||||
if(get.number(event.card1)>get.number(event.card2)){
|
if(get.number(event.card1)>get.number(event.card2)){
|
||||||
event.result.bool=true;
|
event.result.bool=true;
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
event.dialog=ui.create.dialog(get.translation(player.name)+'拼点成功');
|
var str=get.translation(player.name)+'拼点成功';
|
||||||
|
game.broadcast(function(str,id){
|
||||||
|
var dialog=ui.create.dialog(str);
|
||||||
|
dialog.videoId=id;
|
||||||
|
dialog.classList.add('center');
|
||||||
|
},str,event.dialogid);
|
||||||
|
event.dialog=ui.create.dialog(str);
|
||||||
event.dialog.classList.add('center');
|
event.dialog.classList.add('center');
|
||||||
player.popup('胜');
|
player.popup('胜');
|
||||||
target.popup('负');
|
target.popup('负');
|
||||||
|
@ -4420,7 +4449,13 @@
|
||||||
if(get.number(event.card1)>get.number(event.card2)){
|
if(get.number(event.card1)>get.number(event.card2)){
|
||||||
event.result.tie=true;
|
event.result.tie=true;
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
event.dialog=ui.create.dialog(get.translation(player.name)+'拼点失败');
|
var str=get.translation(player.name)+'拼点失败';
|
||||||
|
game.broadcast(function(str,id){
|
||||||
|
var dialog=ui.create.dialog(str);
|
||||||
|
dialog.videoId=id;
|
||||||
|
dialog.classList.add('center');
|
||||||
|
},str,event.dialogid);
|
||||||
|
event.dialog=ui.create.dialog(str);
|
||||||
event.dialog.classList.add('center');
|
event.dialog.classList.add('center');
|
||||||
player.popup('平');
|
player.popup('平');
|
||||||
target.popup('平');
|
target.popup('平');
|
||||||
|
@ -4445,8 +4480,18 @@
|
||||||
event.target.ai.shown+=0.1;
|
event.target.ai.shown+=0.1;
|
||||||
}
|
}
|
||||||
ui.arena.classList.remove('thrownhighlight');
|
ui.arena.classList.remove('thrownhighlight');
|
||||||
|
game.broadcast(function(id){
|
||||||
|
var dialog=get.idDialog(id);
|
||||||
|
if(dialog){
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
ui.arena.classList.remove('thrownhighlight');
|
||||||
|
},event.dialogid);
|
||||||
game.addVideo('thrownhighlight2');
|
game.addVideo('thrownhighlight2');
|
||||||
if(event.clear!==false) ui.clear();
|
if(event.clear!==false){
|
||||||
|
ui.clear();
|
||||||
|
game.broadcast(ui.clear);
|
||||||
|
}
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
},
|
},
|
||||||
chooseButton:function(){
|
chooseButton:function(){
|
||||||
|
@ -4565,7 +4610,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
if(ai.basic.chooseCard(event.ai)||forced){
|
if(ai.basic.chooseCard(event.ai)||forced){
|
||||||
ui.click.ok();
|
ui.click.ok();
|
||||||
}
|
}
|
||||||
|
@ -4580,13 +4633,13 @@
|
||||||
ui.click.cancel();
|
ui.click.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 2"
|
||||||
if(event.dialog) event.dialog.close();
|
if(event.dialog) event.dialog.close();
|
||||||
},
|
},
|
||||||
chooseTarget:function(){
|
chooseTarget:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
game.check();
|
|
||||||
if(event.isMine()){
|
if(event.isMine()){
|
||||||
|
game.check();
|
||||||
game.pause();
|
game.pause();
|
||||||
if(event.prompt!=false){
|
if(event.prompt!=false){
|
||||||
var str;
|
var str;
|
||||||
|
@ -4610,7 +4663,15 @@
|
||||||
event.dialog.open();
|
event.dialog.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
if(ai.basic.chooseTarget(event.ai)||forced){
|
if(ai.basic.chooseTarget(event.ai)||forced){
|
||||||
ui.click.ok();
|
ui.click.ok();
|
||||||
}
|
}
|
||||||
|
@ -4618,7 +4679,6 @@
|
||||||
ui.click.cancel();
|
ui.click.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"step 1"
|
|
||||||
if(event.result.bool){
|
if(event.result.bool){
|
||||||
for(var i=0;i<event.result.targets.length;i++){
|
for(var i=0;i<event.result.targets.length;i++){
|
||||||
event.result.targets[i].animate('target');
|
event.result.targets[i].animate('target');
|
||||||
|
@ -4628,14 +4688,22 @@
|
||||||
},
|
},
|
||||||
chooseCardTarget:function(){
|
chooseCardTarget:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
game.check();
|
|
||||||
if(event.isMine()){
|
if(event.isMine()){
|
||||||
|
game.check();
|
||||||
game.pause();
|
game.pause();
|
||||||
if(event.prompt!=false){
|
if(event.prompt!=false){
|
||||||
event.dialog=ui.create.dialog(event.prompt||'请选择卡牌和目标');
|
event.dialog=ui.create.dialog(event.prompt||'请选择卡牌和目标');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
if(ai.basic.chooseCard(event.ai1)){
|
if(ai.basic.chooseCard(event.ai1)){
|
||||||
if(ai.basic.chooseTarget(event.ai2)){
|
if(ai.basic.chooseTarget(event.ai2)){
|
||||||
ui.click.ok();
|
ui.click.ok();
|
||||||
|
@ -4652,7 +4720,7 @@
|
||||||
ui.click.cancel();
|
ui.click.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 2"
|
||||||
if(event.result.bool){
|
if(event.result.bool){
|
||||||
for(var i=0;i<event.result.targets.length;i++){
|
for(var i=0;i<event.result.targets.length;i++){
|
||||||
event.result.targets[i].animate('target');
|
event.result.targets[i].animate('target');
|
||||||
|
@ -4677,7 +4745,14 @@
|
||||||
game.pause();
|
game.pause();
|
||||||
game.countChoose();
|
game.countChoose();
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
event.result={};
|
event.result={};
|
||||||
if(event.ai){
|
if(event.ai){
|
||||||
var result=event.ai(event.getParent(),player);
|
var result=event.ai(event.getParent(),player);
|
||||||
|
@ -4686,7 +4761,6 @@
|
||||||
}
|
}
|
||||||
else event.result.control=event.controls[event.choice];
|
else event.result.control=event.controls[event.choice];
|
||||||
}
|
}
|
||||||
"step 1"
|
|
||||||
_status.imchoosing=false;
|
_status.imchoosing=false;
|
||||||
if(event.dialog) event.dialog.close();
|
if(event.dialog) event.dialog.close();
|
||||||
if(event.controlbar) event.controlbar.close();
|
if(event.controlbar) event.controlbar.close();
|
||||||
|
@ -4704,13 +4778,19 @@
|
||||||
game.pause();
|
game.pause();
|
||||||
game.countChoose();
|
game.countChoose();
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
event.result='ai';
|
||||||
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
if(event.ai){
|
if(event.ai){
|
||||||
event.choice=event.ai(event.getParent(),player);
|
event.choice=event.ai(event.getParent(),player);
|
||||||
}
|
}
|
||||||
event.result={bool:event.choice};
|
event.result={bool:event.choice};
|
||||||
}
|
}
|
||||||
"step 1"
|
|
||||||
_status.imchoosing=false;
|
_status.imchoosing=false;
|
||||||
if(event.dialog) event.dialog.close();
|
if(event.dialog) event.dialog.close();
|
||||||
},
|
},
|
||||||
|
@ -4762,17 +4842,22 @@
|
||||||
else{
|
else{
|
||||||
if(event.isMine()){
|
if(event.isMine()){
|
||||||
event.dialog.open();
|
event.dialog.open();
|
||||||
}
|
|
||||||
game.check();
|
game.check();
|
||||||
if(event.isMine()){
|
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok();
|
event.result='ai';
|
||||||
else ui.click.cancel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
|
if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok();
|
||||||
|
else ui.click.cancel();
|
||||||
|
}
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
},
|
},
|
||||||
discardPlayerCard:function(){
|
discardPlayerCard:function(){
|
||||||
|
@ -4832,20 +4917,25 @@
|
||||||
else{
|
else{
|
||||||
if(event.isMine()){
|
if(event.isMine()){
|
||||||
event.dialog.open();
|
event.dialog.open();
|
||||||
}
|
|
||||||
game.check();
|
game.check();
|
||||||
if(event.isMine()){
|
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok();
|
event.result='ai';
|
||||||
else ui.click.cancel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
|
if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok();
|
||||||
|
else ui.click.cancel();
|
||||||
|
}
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
"step 2"
|
"step 2"
|
||||||
if(event.result.bool&&event.result.buttons){
|
if(event.result.bool&&event.result.buttons&&!game.online){
|
||||||
if(event.logSkill){
|
if(event.logSkill){
|
||||||
if(typeof event.logSkill=='string'){
|
if(typeof event.logSkill=='string'){
|
||||||
player.logSkill(event.logSkill);
|
player.logSkill(event.logSkill);
|
||||||
|
@ -4855,8 +4945,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var cards=[];
|
var cards=[];
|
||||||
for(var i=0;i<event.result.buttons.length;i++){
|
for(var i=0;i<event.result.links.length;i++){
|
||||||
cards.push(event.result.buttons[i].link);
|
cards.push(event.result.links[i]);
|
||||||
}
|
}
|
||||||
target.discard(cards);
|
target.discard(cards);
|
||||||
}
|
}
|
||||||
|
@ -4919,22 +5009,31 @@
|
||||||
else{
|
else{
|
||||||
if(event.isMine()){
|
if(event.isMine()){
|
||||||
event.dialog.open();
|
event.dialog.open();
|
||||||
}
|
|
||||||
game.check();
|
game.check();
|
||||||
if(event.isMine()){
|
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok();
|
event.result='ai';
|
||||||
else ui.click.cancel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
if(event.result=='ai'){
|
||||||
|
game.check();
|
||||||
|
if(ai.basic.chooseButton(event.ai)||forced) ui.click.ok();
|
||||||
|
else ui.click.cancel();
|
||||||
|
}
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
"step 2"
|
"step 2"
|
||||||
|
if(game.online){
|
||||||
|
event.finish();
|
||||||
|
}
|
||||||
|
"step 3"
|
||||||
var cards=[];
|
var cards=[];
|
||||||
for(var i=0;i<event.result.buttons.length;i++){
|
for(var i=0;i<event.result.links.length;i++){
|
||||||
cards.push(event.result.buttons[i].link);
|
cards.push(event.result.links[i]);
|
||||||
}
|
}
|
||||||
target.lose(cards);
|
target.lose(cards);
|
||||||
event.cards=cards;
|
event.cards=cards;
|
||||||
|
@ -4953,7 +5052,7 @@
|
||||||
if(oths.length){
|
if(oths.length){
|
||||||
target.$give(oths,player);
|
target.$give(oths,player);
|
||||||
}
|
}
|
||||||
"step 3"
|
"step 4"
|
||||||
if(player==game.me){
|
if(player==game.me){
|
||||||
game.delay(2);
|
game.delay(2);
|
||||||
}
|
}
|
||||||
|
@ -4971,10 +5070,21 @@
|
||||||
var cards=player.get('h');
|
var cards=player.get('h');
|
||||||
var str=get.translation(player.name)+'的手牌';
|
var str=get.translation(player.name)+'的手牌';
|
||||||
event.dialog=ui.create.dialog(str,cards);
|
event.dialog=ui.create.dialog(str,cards);
|
||||||
|
event.dialogid=lib.status.videoId++;
|
||||||
|
event.dialog.videoId=event.dialogid;
|
||||||
|
game.broadcast(function(str,cards,id){
|
||||||
|
ui.create.dialog(str,cards).videoId=id;
|
||||||
|
},str,cards,event.dialogid);
|
||||||
game.log(player,'展示了',cards);
|
game.log(player,'展示了',cards);
|
||||||
game.addVideo('showCards',player,[str,get.cardsInfo(cards)]);
|
game.addVideo('showCards',player,[str,get.cardsInfo(cards)]);
|
||||||
game.delayx(2);
|
game.delayx(2);
|
||||||
"step 1"
|
"step 1"
|
||||||
|
game.broadcast(function(id){
|
||||||
|
var dialog=get.idDialog(id);
|
||||||
|
if(dialog){
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
},event.dialogid);
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
},
|
},
|
||||||
showCards:function(){
|
showCards:function(){
|
||||||
|
@ -4987,10 +5097,21 @@
|
||||||
event.str=get.translation(player.name)+'展示的牌';
|
event.str=get.translation(player.name)+'展示的牌';
|
||||||
}
|
}
|
||||||
event.dialog=ui.create.dialog(event.str,cards);
|
event.dialog=ui.create.dialog(event.str,cards);
|
||||||
|
event.dialogid=lib.status.videoId++;
|
||||||
|
event.dialog.videoId=event.dialogid;
|
||||||
|
game.broadcast(function(str,cards,id){
|
||||||
|
ui.create.dialog(str,cards).videoId=id;
|
||||||
|
},event.str,cards,event.dialogid);
|
||||||
game.log(player,'展示了',cards);
|
game.log(player,'展示了',cards);
|
||||||
game.delayx(2);
|
game.delayx(2);
|
||||||
game.addVideo('showCards',player,[event.str,get.cardsInfo(cards)]);
|
game.addVideo('showCards',player,[event.str,get.cardsInfo(cards)]);
|
||||||
"step 1"
|
"step 1"
|
||||||
|
game.broadcast(function(id){
|
||||||
|
var dialog=get.idDialog(id);
|
||||||
|
if(dialog){
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
},event.dialogid);
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
},
|
},
|
||||||
viewHandcards:function(){
|
viewHandcards:function(){
|
||||||
|
@ -5004,18 +5125,23 @@
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
event.finish();
|
event.finish();
|
||||||
|
event.result='viewed';
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
},2*lib.config.duration);
|
},2*lib.config.duration);
|
||||||
game.delayx(2);
|
game.delayx(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(event.isOnline()){
|
||||||
|
event.send();
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
event.result='viewed';
|
||||||
_status.imchoosing=false;
|
_status.imchoosing=false;
|
||||||
event.dialog.close();
|
if(event.dialog) event.dialog.close();
|
||||||
},
|
},
|
||||||
useCard:function(){
|
useCard:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
|
@ -5939,6 +6065,8 @@
|
||||||
player.skills.remove(i);
|
player.skills.remove(i);
|
||||||
delete player.tempSkills[i];
|
delete player.tempSkills[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var proc=function(player){
|
||||||
player.classList.add('dead');
|
player.classList.add('dead');
|
||||||
// player.classList.remove('linked');
|
// player.classList.remove('linked');
|
||||||
player.classList.remove('turnedover');
|
player.classList.remove('turnedover');
|
||||||
|
@ -5951,6 +6079,10 @@
|
||||||
player.next.previous=player.previous;
|
player.next.previous=player.previous;
|
||||||
game.players.remove(player);
|
game.players.remove(player);
|
||||||
game.dead.push(player);
|
game.dead.push(player);
|
||||||
|
}
|
||||||
|
proc(player);
|
||||||
|
game.broadcast(proc,player);
|
||||||
|
|
||||||
if(lib.config.background_speak){
|
if(lib.config.background_speak){
|
||||||
if(lib.character[player.name]&&
|
if(lib.character[player.name]&&
|
||||||
lib.character[player.name][4].contains('die_audio')){
|
lib.character[player.name][4].contains('die_audio')){
|
||||||
|
@ -5963,7 +6095,7 @@
|
||||||
// game.playAudio('effect','die_'+(player.sex==='female'?'female':'male'));
|
// game.playAudio('effect','die_'+(player.sex==='female'?'female':'male'));
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if(player==game.me&&!_status.over&&!game.controlOver){
|
if(!_status.connectMode&&player==game.me&&!_status.over&&!game.controlOver){
|
||||||
ui.control.show();
|
ui.control.show();
|
||||||
if(get.config('revive')&&lib.mode[lib.config.mode].config.revive){
|
if(get.config('revive')&&lib.mode[lib.config.mode].config.revive){
|
||||||
ui.revive=ui.create.control('revive',ui.click.dierevive);
|
ui.revive=ui.create.control('revive',ui.click.dierevive);
|
||||||
|
@ -5972,7 +6104,7 @@
|
||||||
ui.restart=ui.create.control('restart',game.reload);
|
ui.restart=ui.create.control('restart',game.reload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(player==game.me&&!game.modeSwapPlayer){
|
if(!_status.connectMode&&player==game.me&&!game.modeSwapPlayer){
|
||||||
// _status.auto=false;
|
// _status.auto=false;
|
||||||
if(ui.auto){
|
if(ui.auto){
|
||||||
// ui.auto.classList.remove('glow');
|
// ui.auto.classList.remove('glow');
|
||||||
|
@ -6127,6 +6259,9 @@
|
||||||
turnOver:function(){
|
turnOver:function(){
|
||||||
game.log(player,'翻面');
|
game.log(player,'翻面');
|
||||||
player.classList.toggle('turnedover');
|
player.classList.toggle('turnedover');
|
||||||
|
game.broadcast(function(player){
|
||||||
|
player.classList.toggle('turnedover');
|
||||||
|
},player);
|
||||||
game.addVideo('turnOver',player,player.classList.contains('turnedover'));
|
game.addVideo('turnOver',player,player.classList.contains('turnedover'));
|
||||||
},
|
},
|
||||||
link:function(){
|
link:function(){
|
||||||
|
@ -6141,6 +6276,10 @@
|
||||||
}
|
}
|
||||||
player.classList.remove('target');
|
player.classList.remove('target');
|
||||||
player.classList.toggle('linked');
|
player.classList.toggle('linked');
|
||||||
|
game.broadcast(function(player){
|
||||||
|
player.classList.remove('target');
|
||||||
|
player.classList.toggle('linked');
|
||||||
|
},player);
|
||||||
game.addVideo('link',player,player.classList.contains('linked'));
|
game.addVideo('link',player,player.classList.contains('linked'));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -6356,12 +6495,12 @@
|
||||||
if(this.hp>=this.maxHp) this.hp=this.maxHp;
|
if(this.hp>=this.maxHp) this.hp=this.maxHp;
|
||||||
var hp=this.node.hp;
|
var hp=this.node.hp;
|
||||||
hp.style.transition='none';
|
hp.style.transition='none';
|
||||||
game.broadcast(function(player,hp,maxHp,nh,hujia){
|
game.broadcast(function(player,hp,maxHp,hujia){
|
||||||
player.hp=hp;
|
player.hp=hp;
|
||||||
player.maxHp=maxHp;
|
player.maxHp=maxHp;
|
||||||
player.hujia=hujia;
|
player.hujia=hujia;
|
||||||
player.update();
|
player.update();
|
||||||
},this,this.hp,this.maxHp,this.num('h'),this.hujia);
|
},this,this.hp,this.maxHp,this.hujia);
|
||||||
if(!_status.video){
|
if(!_status.video){
|
||||||
if(this.hujia){
|
if(this.hujia){
|
||||||
this.markSkill('ghujia');
|
this.markSkill('ghujia');
|
||||||
|
@ -6909,6 +7048,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
next.content=lib.element.playerproto.chooseToRespond;
|
next.content=lib.element.playerproto.chooseToRespond;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseToDiscard:function(){
|
chooseToDiscard:function(){
|
||||||
|
@ -6951,6 +7091,7 @@
|
||||||
return get.select(this.selectCard)[0]>=this.player.num(this.position||'h');
|
return get.select(this.selectCard)[0]>=this.player.num(this.position||'h');
|
||||||
}
|
}
|
||||||
next.content=lib.element.playerproto.chooseToDiscard;
|
next.content=lib.element.playerproto.chooseToDiscard;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseToCompare:function(target,check){
|
chooseToCompare:function(target,check){
|
||||||
|
@ -6977,6 +7118,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
next.content=lib.element.playerproto.chooseToCompare;
|
next.content=lib.element.playerproto.chooseToCompare;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseCardButton:function(){
|
chooseCardButton:function(){
|
||||||
|
@ -7021,6 +7163,7 @@
|
||||||
if(next.selectButton==undefined) next.selectButton=[1,1];
|
if(next.selectButton==undefined) next.selectButton=[1,1];
|
||||||
if(next.ai==undefined) next.ai=function(){return 1};
|
if(next.ai==undefined) next.ai=function(){return 1};
|
||||||
next.content=lib.element.playerproto.chooseButton;
|
next.content=lib.element.playerproto.chooseButton;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseButtonOL:function(list,callback,ai){
|
chooseButtonOL:function(list,callback,ai){
|
||||||
|
@ -7029,6 +7172,7 @@
|
||||||
next.content=lib.element.playerproto.chooseButtonOL;
|
next.content=lib.element.playerproto.chooseButtonOL;
|
||||||
next.ai=ai;
|
next.ai=ai;
|
||||||
next.callback=callback;
|
next.callback=callback;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseCard:function(){
|
chooseCard:function(){
|
||||||
|
@ -7062,6 +7206,7 @@
|
||||||
if(next.selectCard==undefined) next.selectCard=[1,1];
|
if(next.selectCard==undefined) next.selectCard=[1,1];
|
||||||
if(next.ai==undefined) next.ai=ai.get.unuseful2;
|
if(next.ai==undefined) next.ai=ai.get.unuseful2;
|
||||||
next.content=lib.element.playerproto.chooseCard;
|
next.content=lib.element.playerproto.chooseCard;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseTarget:function(){
|
chooseTarget:function(){
|
||||||
|
@ -7093,6 +7238,7 @@
|
||||||
if(next.selectTarget==undefined) next.selectTarget=[1,1];
|
if(next.selectTarget==undefined) next.selectTarget=[1,1];
|
||||||
if(next.ai==undefined) next.ai=ai.get.attitude2;
|
if(next.ai==undefined) next.ai=ai.get.attitude2;
|
||||||
next.content=lib.element.playerproto.chooseTarget;
|
next.content=lib.element.playerproto.chooseTarget;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseCardTarget:function(choose){
|
chooseCardTarget:function(choose){
|
||||||
|
@ -7124,6 +7270,7 @@
|
||||||
if(next.ai1==undefined) next.ai1=ai.get.unuseful2;
|
if(next.ai1==undefined) next.ai1=ai.get.unuseful2;
|
||||||
if(next.ai2==undefined) next.ai2=ai.get.attitude2;
|
if(next.ai2==undefined) next.ai2=ai.get.attitude2;
|
||||||
next.content=lib.element.playerproto.chooseCardTarget;
|
next.content=lib.element.playerproto.chooseCardTarget;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseControl:function(){
|
chooseControl:function(){
|
||||||
|
@ -7149,6 +7296,7 @@
|
||||||
next.player=this;
|
next.player=this;
|
||||||
if(next.choice==undefined) next.choice=0;
|
if(next.choice==undefined) next.choice=0;
|
||||||
next.content=lib.element.playerproto.chooseControl;
|
next.content=lib.element.playerproto.chooseControl;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
chooseBool:function(){
|
chooseBool:function(){
|
||||||
|
@ -7170,6 +7318,7 @@
|
||||||
}
|
}
|
||||||
next.player=this;
|
next.player=this;
|
||||||
next.content=lib.element.playerproto.chooseBool;
|
next.content=lib.element.playerproto.chooseBool;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
choosePlayerCard:function(){
|
choosePlayerCard:function(){
|
||||||
|
@ -7214,6 +7363,7 @@
|
||||||
return val;
|
return val;
|
||||||
};
|
};
|
||||||
next.content=lib.element.playerproto.choosePlayerCard;
|
next.content=lib.element.playerproto.choosePlayerCard;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
discardPlayerCard:function(){
|
discardPlayerCard:function(){
|
||||||
|
@ -7258,6 +7408,7 @@
|
||||||
return val;
|
return val;
|
||||||
};
|
};
|
||||||
next.content=lib.element.playerproto.discardPlayerCard;
|
next.content=lib.element.playerproto.discardPlayerCard;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
gainPlayerCard:function(){
|
gainPlayerCard:function(){
|
||||||
|
@ -7302,12 +7453,15 @@
|
||||||
return val;
|
return val;
|
||||||
};
|
};
|
||||||
next.content=lib.element.playerproto.gainPlayerCard;
|
next.content=lib.element.playerproto.gainPlayerCard;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
showHandcards:function(){
|
showHandcards:function(){
|
||||||
var next=game.createEvent('showHandcards');
|
var next=game.createEvent('showHandcards');
|
||||||
next.player=this;
|
next.player=this;
|
||||||
next.content=lib.element.playerproto.showHandcards;
|
next.content=lib.element.playerproto.showHandcards;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
|
return next;
|
||||||
},
|
},
|
||||||
showCards:function(cards,str){
|
showCards:function(cards,str){
|
||||||
var next=game.createEvent('showCards');
|
var next=game.createEvent('showCards');
|
||||||
|
@ -7317,12 +7471,15 @@
|
||||||
else if(get.itemtype(cards)=='cards') next.cards=cards;
|
else if(get.itemtype(cards)=='cards') next.cards=cards;
|
||||||
else _status.event.next.remove(next);
|
else _status.event.next.remove(next);
|
||||||
next.content=lib.element.playerproto.showCards;
|
next.content=lib.element.playerproto.showCards;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
},
|
},
|
||||||
viewHandcards:function(target){
|
viewHandcards:function(target){
|
||||||
var next=game.createEvent('viewHandcards');
|
var next=game.createEvent('viewHandcards');
|
||||||
next.player=this;
|
next.player=this;
|
||||||
next.target=target;
|
next.target=target;
|
||||||
next.content=lib.element.playerproto.viewHandcards;
|
next.content=lib.element.playerproto.viewHandcards;
|
||||||
|
next._args=Array.from(arguments);
|
||||||
|
return next;
|
||||||
},
|
},
|
||||||
useResult:function(result,event){
|
useResult:function(result,event){
|
||||||
event=event||_status.event;
|
event=event||_status.event;
|
||||||
|
@ -9833,10 +9990,11 @@
|
||||||
skills:lib.playerOL[i].skills,
|
skills:lib.playerOL[i].skills,
|
||||||
hiddenSkills:lib.playerOL[i].hiddenSkills,
|
hiddenSkills:lib.playerOL[i].hiddenSkills,
|
||||||
additionalSkills:lib.playerOL[i].additionalSkills,
|
additionalSkills:lib.playerOL[i].additionalSkills,
|
||||||
|
tempSkills:lib.playerOL[i].tempSkills,
|
||||||
storage:lib.playerOL[i].storage,
|
storage:lib.playerOL[i].storage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.player.send(function(name,args,set,event,trigger,stat,skills){
|
this.player.send(function(name,args,set,event,stat,skills){
|
||||||
for(var i in skills){
|
for(var i in skills){
|
||||||
if(i=='global'){
|
if(i=='global'){
|
||||||
lib.skill.global=skills[i];
|
lib.skill.global=skills[i];
|
||||||
|
@ -9853,11 +10011,9 @@
|
||||||
next.set(set[i][0],set[i][1]);
|
next.set(set[i][0],set[i][1]);
|
||||||
}
|
}
|
||||||
next._modparent=event;
|
next._modparent=event;
|
||||||
next._trigger=trigger;
|
|
||||||
game.resume();
|
game.resume();
|
||||||
},this.name,this._args||[],this._set,
|
},this.name,this._args||[],this._set,
|
||||||
get.stringifiedResult(this.parent,3),
|
get.stringifiedResult(this.parent,3),
|
||||||
get.stringifiedResult(this._trigger,2),
|
|
||||||
this.player.getStat(),skills);
|
this.player.getStat(),skills);
|
||||||
this.player.wait();
|
this.player.wait();
|
||||||
game.pause();
|
game.pause();
|
||||||
|
@ -10239,6 +10395,10 @@
|
||||||
},
|
},
|
||||||
ws:{
|
ws:{
|
||||||
onopen:function(){
|
onopen:function(){
|
||||||
|
if(_status.connectCallback){
|
||||||
|
_status.connectCallback(true);
|
||||||
|
delete _status.connectCallback;
|
||||||
|
}
|
||||||
game.send('init',lib.versionOL,{
|
game.send('init',lib.versionOL,{
|
||||||
avatar:lib.config.connect_avatar,
|
avatar:lib.config.connect_avatar,
|
||||||
nickname:lib.config.connect_nickname
|
nickname:lib.config.connect_nickname
|
||||||
|
@ -10267,12 +10427,22 @@
|
||||||
lib.message.client[message.shift()].apply(null,message);
|
lib.message.client[message.shift()].apply(null,message);
|
||||||
},
|
},
|
||||||
onerror:function(e){
|
onerror:function(e){
|
||||||
|
if(_status.connectCallback){
|
||||||
|
_status.connectCallback(false);
|
||||||
|
delete _status.connectCallback;
|
||||||
|
}
|
||||||
|
else{
|
||||||
alert('连接失败');
|
alert('连接失败');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onclose:function(){
|
onclose:function(){
|
||||||
|
if(_status.connectCallback){
|
||||||
|
_status.connectCallback(false);
|
||||||
|
delete _status.connectCallback;
|
||||||
|
}
|
||||||
game.saveConfig('reconnect_info');
|
game.saveConfig('reconnect_info');
|
||||||
if(game.online){
|
if(game.online){
|
||||||
alert('连接已断开');
|
game.saveConfig('reconnect_more',game.ip);
|
||||||
game.reload();
|
game.reload();
|
||||||
}
|
}
|
||||||
game.online=false;
|
game.online=false;
|
||||||
|
@ -10831,6 +11001,7 @@
|
||||||
init:function(id,config,ip){
|
init:function(id,config,ip){
|
||||||
game.online=true;
|
game.online=true;
|
||||||
game.onlineID=id;
|
game.onlineID=id;
|
||||||
|
game.ip=ip;
|
||||||
game.saveConfig('reconnect_info',[_status.ip,id]);
|
game.saveConfig('reconnect_info',[_status.ip,id]);
|
||||||
_status.connectMode=true;
|
_status.connectMode=true;
|
||||||
lib.configOL=config;
|
lib.configOL=config;
|
||||||
|
@ -10839,7 +11010,17 @@
|
||||||
game.clearArena();
|
game.clearArena();
|
||||||
game.finishCards();
|
game.finishCards();
|
||||||
ui.create.connectPlayers(ip);
|
ui.create.connectPlayers(ip);
|
||||||
|
ui.pause.hide();
|
||||||
ui.auto.hide();
|
ui.auto.hide();
|
||||||
|
ui.cardPileButton.style.display='none';
|
||||||
|
if(ui.ipnode){
|
||||||
|
ui.ipnode.delete();
|
||||||
|
delete ui.ipnode;
|
||||||
|
}
|
||||||
|
if(ui.iptext){
|
||||||
|
ui.iptext.delete();
|
||||||
|
delete ui.iptext;
|
||||||
|
}
|
||||||
var proceed=function(){
|
var proceed=function(){
|
||||||
game.loadModeAsync(config.mode,function(mode){
|
game.loadModeAsync(config.mode,function(mode){
|
||||||
for(var i in mode.ai){
|
for(var i in mode.ai){
|
||||||
|
@ -10857,8 +11038,8 @@
|
||||||
lib.translate[i]=mode.translate[i];
|
lib.translate[i]=mode.translate[i];
|
||||||
}
|
}
|
||||||
if(mode.game){
|
if(mode.game){
|
||||||
game.getIdentityList=mode.game.getIdentityList;
|
game.getIdentityList=lib.init.eval(mode.game.getIdentityList);
|
||||||
game.updateState=mode.game.updateState;
|
game.updateState=lib.init.eval(mode.game.updateState);
|
||||||
}
|
}
|
||||||
_status.event={
|
_status.event={
|
||||||
finished:true,
|
finished:true,
|
||||||
|
@ -10906,8 +11087,8 @@
|
||||||
lib.translate[i]=mode.translate[i];
|
lib.translate[i]=mode.translate[i];
|
||||||
}
|
}
|
||||||
if(mode.game){
|
if(mode.game){
|
||||||
game.getIdentityList=mode.game.getIdentityList;
|
game.getIdentityList=lib.init.eval(mode.game.getIdentityList);
|
||||||
game.updateState=mode.game.updateState;
|
game.updateState=lib.init.eval(mode.game.updateState);
|
||||||
}
|
}
|
||||||
state=get.parsedResult(state);
|
state=get.parsedResult(state);
|
||||||
game.players=[];
|
game.players=[];
|
||||||
|
@ -10984,7 +11165,11 @@
|
||||||
case 'version':alert('加入失败:版本不匹配');break;
|
case 'version':alert('加入失败:版本不匹配');break;
|
||||||
case 'gaming':alert('加入失败:游戏已开始');break;
|
case 'gaming':alert('加入失败:游戏已开始');break;
|
||||||
case 'number':alert('加入失败:房间已满');break;
|
case 'number':alert('加入失败:房间已满');break;
|
||||||
case 'offline':if(_status.paused) game.resume();break;
|
case 'offline':
|
||||||
|
if(_status.paused&&_status.event.name=='game'){
|
||||||
|
setTimeout(game.resume,500);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
game.ws.close();
|
game.ws.close();
|
||||||
},
|
},
|
||||||
|
@ -11008,7 +11193,15 @@
|
||||||
ui.connectStartButton.delete();
|
ui.connectStartButton.delete();
|
||||||
delete ui.connectStartButton;
|
delete ui.connectStartButton;
|
||||||
}
|
}
|
||||||
|
if(ui.connectStartBar){
|
||||||
|
ui.connectStartBar.delete();
|
||||||
|
delete ui.connectStartBar;
|
||||||
|
}
|
||||||
ui.auto.show();
|
ui.auto.show();
|
||||||
|
ui.pause.show();
|
||||||
|
if(lib.config.show_cardpile){
|
||||||
|
ui.cardPileButton.style.display='';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
updateWaiting:function(map){
|
updateWaiting:function(map){
|
||||||
for(var i=0;i<map.length;i++){
|
for(var i=0;i<map.length;i++){
|
||||||
|
@ -11064,10 +11257,9 @@
|
||||||
var next=game.createEvent('waitForPlayer',false);
|
var next=game.createEvent('waitForPlayer',false);
|
||||||
next.content=function(){
|
next.content=function(){
|
||||||
'step 0'
|
'step 0'
|
||||||
if(!ui.auto.classList.contains('hidden')){
|
|
||||||
ui.auto.hide();
|
ui.auto.hide();
|
||||||
event.hideauto=true;
|
ui.pause.hide();
|
||||||
}
|
ui.cardPileButton.style.display='none';
|
||||||
ui.create.connectPlayers(game.ip);
|
ui.create.connectPlayers(game.ip);
|
||||||
var me=game.connectPlayers[0];
|
var me=game.connectPlayers[0];
|
||||||
me.initOL(lib.config.connect_nickname,lib.config.connect_avatar);
|
me.initOL(lib.config.connect_nickname,lib.config.connect_avatar);
|
||||||
|
@ -11083,8 +11275,10 @@
|
||||||
delete game.connectPlayers;
|
delete game.connectPlayers;
|
||||||
game.broadcast('gameStart');
|
game.broadcast('gameStart');
|
||||||
game.delay(2);
|
game.delay(2);
|
||||||
if(event.hideauto){
|
|
||||||
ui.auto.show();
|
ui.auto.show();
|
||||||
|
ui.pause.show();
|
||||||
|
if(lib.config.show_cardpile){
|
||||||
|
ui.cardPileButton.style.display='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -11132,7 +11326,8 @@
|
||||||
ui.timer.hide();
|
ui.timer.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
connect:function(ip){
|
connect:function(ip,callback){
|
||||||
|
if(game.online) return;
|
||||||
var withport=false;
|
var withport=false;
|
||||||
var index=ip.lastIndexOf(':');
|
var index=ip.lastIndexOf(':');
|
||||||
if(index!=-1){
|
if(index!=-1){
|
||||||
|
@ -11144,7 +11339,7 @@
|
||||||
if(!withport){
|
if(!withport){
|
||||||
ip=ip+':8080';
|
ip=ip+':8080';
|
||||||
}
|
}
|
||||||
if(game.online) return;
|
_status.connectCallback=callback;
|
||||||
try{
|
try{
|
||||||
game.ws=new WebSocket('ws://'+ip+'');
|
game.ws=new WebSocket('ws://'+ip+'');
|
||||||
}
|
}
|
||||||
|
@ -13257,6 +13452,9 @@
|
||||||
else if(get.info(event.skill).direct&&player==game.me&&!_status.auto){
|
else if(get.info(event.skill).direct&&player==game.me&&!_status.auto){
|
||||||
event._result={bool:true};
|
event._result={bool:true};
|
||||||
}
|
}
|
||||||
|
else if(get.info(event.skill).direct&&player.isOnline()){
|
||||||
|
event._result={bool:true};
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
var str;
|
var str;
|
||||||
var check=get.info(event.skill).check;
|
var check=get.info(event.skill).check;
|
||||||
|
@ -13432,6 +13630,16 @@
|
||||||
_status.over=true;
|
_status.over=true;
|
||||||
ui.control.show();
|
ui.control.show();
|
||||||
ui.clear();
|
ui.clear();
|
||||||
|
game.stopCountChoose();
|
||||||
|
if(game.online){
|
||||||
|
game.saveConfig('reconnect_info');
|
||||||
|
ui.create.dialog().content.innerHTML=result;
|
||||||
|
ui.update();
|
||||||
|
if(!ui.restart){
|
||||||
|
ui.restart=ui.create.control('restart',game.reload);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
if(result===true){
|
if(result===true){
|
||||||
game.playAudio('effect','win');
|
game.playAudio('effect','win');
|
||||||
|
@ -13721,6 +13929,7 @@
|
||||||
}
|
}
|
||||||
dialog.add(ui.create.div('.placeholder'));
|
dialog.add(ui.create.div('.placeholder'));
|
||||||
dialog.add(ui.create.div('.placeholder'));
|
dialog.add(ui.create.div('.placeholder'));
|
||||||
|
game.broadcast(game.over,dialog.content.innerHTML);
|
||||||
game.addVideo('over',null,dialog.content.innerHTML);
|
game.addVideo('over',null,dialog.content.innerHTML);
|
||||||
var vinum=parseInt(lib.config.video);
|
var vinum=parseInt(lib.config.video);
|
||||||
if(!_status.video&&vinum&&game.getVideoName&&window.indexedDB&&!game.online){
|
if(!_status.video&&vinum&&game.getVideoName&&window.indexedDB&&!game.online){
|
||||||
|
@ -13808,7 +14017,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(get.config('continue_game')){
|
else if(!_status.connectMode&&get.config('continue_game')){
|
||||||
ui.continue_game=ui.create.control('再战',game.reloadCurrent);
|
ui.continue_game=ui.create.control('再战',game.reloadCurrent);
|
||||||
}
|
}
|
||||||
if(!ui.restart){
|
if(!ui.restart){
|
||||||
|
@ -19699,7 +19908,7 @@
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
},
|
},
|
||||||
connectPlayers:function(){
|
connectPlayers:function(ip){
|
||||||
game.connectPlayers=[];
|
game.connectPlayers=[];
|
||||||
for(var i=0;i<8;i++){
|
for(var i=0;i<8;i++){
|
||||||
var player=ui.create.player(ui.window);
|
var player=ui.create.player(ui.window);
|
||||||
|
@ -19710,6 +19919,18 @@
|
||||||
player.classList.add('unselectable2');
|
player.classList.add('unselectable2');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var bar=ui.create.div(ui.window);
|
||||||
|
bar.style.height='20px';
|
||||||
|
bar.style.width='80%';
|
||||||
|
bar.style.left='10%';
|
||||||
|
bar.style.top='calc(200% / 7 - 120px + 5px)';
|
||||||
|
bar.style.textAlign='center';
|
||||||
|
var ipbar=ui.create.div('.shadowed',ip,bar);
|
||||||
|
ipbar.style.padding='4px';
|
||||||
|
ipbar.style.borderRadius='2px';
|
||||||
|
ipbar.style.position='relative';
|
||||||
|
|
||||||
var button=ui.create.div('.menubutton.large.highlight',game.online?'退出联机':'开始游戏',ui.window,function(){
|
var button=ui.create.div('.menubutton.large.highlight',game.online?'退出联机':'开始游戏',ui.window,function(){
|
||||||
if(button.clicked) return;
|
if(button.clicked) return;
|
||||||
if(game.online){
|
if(game.online){
|
||||||
|
@ -19719,20 +19940,17 @@
|
||||||
game.resume();
|
game.resume();
|
||||||
}
|
}
|
||||||
button.delete();
|
button.delete();
|
||||||
|
bar.delete();
|
||||||
delete ui.connectStartButton;
|
delete ui.connectStartButton;
|
||||||
|
delete ui.connectStartBar;
|
||||||
button.clicked=true;
|
button.clicked=true;
|
||||||
});
|
});
|
||||||
|
|
||||||
var bar=ui.create.div('.shadowed',ui.window);
|
|
||||||
bar.style.height='20px';
|
|
||||||
bar.style.width='80%';
|
|
||||||
bar.style.left='10%';
|
|
||||||
bar.style.top='calc(200% / 7 - 120px + 5px)';
|
|
||||||
|
|
||||||
button.style.top='calc(500% / 7 + 80px + 5px)';
|
button.style.top='calc(500% / 7 + 80px + 5px)';
|
||||||
button.style.width='130px';
|
button.style.width='130px';
|
||||||
button.style.left='calc(50% - 65px)';
|
button.style.left='calc(50% - 65px)';
|
||||||
ui.connectStartButton=button;
|
ui.connectStartButton=button;
|
||||||
|
ui.connectStartBar=bar;
|
||||||
},
|
},
|
||||||
players:function(num){
|
players:function(num){
|
||||||
if(num===0){
|
if(num===0){
|
||||||
|
@ -21639,8 +21857,9 @@
|
||||||
if(_status.paused2) return;
|
if(_status.paused2) return;
|
||||||
if(!_status.auto){
|
if(!_status.auto){
|
||||||
_status.auto=true;
|
_status.auto=true;
|
||||||
// ui.auto.innerHTML='手动';
|
|
||||||
ui.auto.classList.add('glow');
|
ui.auto.classList.add('glow');
|
||||||
|
|
||||||
|
if(_status.imchoosing&&_status.paused){
|
||||||
if(ui.confirm) ui.confirm.close();
|
if(ui.confirm) ui.confirm.close();
|
||||||
ui.control.hide();
|
ui.control.hide();
|
||||||
if(_status.event.switchToAuto){
|
if(_status.event.switchToAuto){
|
||||||
|
@ -21653,12 +21872,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game.resume();
|
game.resume();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ui.control.show();
|
ui.control.show();
|
||||||
_status.auto=false;
|
_status.auto=false;
|
||||||
ui.auto.classList.remove('glow');
|
ui.auto.classList.remove('glow');
|
||||||
// ui.auto.innerHTML='托管';
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
wuxie:function(){
|
wuxie:function(){
|
||||||
|
@ -22374,18 +22593,21 @@
|
||||||
case 'player': return get.playerInfoOL(item);
|
case 'player': return get.playerInfoOL(item);
|
||||||
case 'players': return get.playersInfoOL(item);
|
case 'players': return get.playersInfoOL(item);
|
||||||
default:
|
default:
|
||||||
|
if(typeof level!='number'){
|
||||||
|
level=5;
|
||||||
|
}
|
||||||
if(Array.isArray(item)){
|
if(Array.isArray(item)){
|
||||||
|
if(level==0){
|
||||||
|
return [];
|
||||||
|
}
|
||||||
var item2=[];
|
var item2=[];
|
||||||
for(var i=0;i<item.length;i++){
|
for(var i=0;i<item.length;i++){
|
||||||
item2.push(get.stringifiedResult(item[i]));
|
item2.push(get.stringifiedResult(item[i],level-1));
|
||||||
}
|
}
|
||||||
return item2;
|
return item2;
|
||||||
}
|
}
|
||||||
else if(Object.prototype.toString.call(item)=='[object Object]'){
|
else if(Object.prototype.toString.call(item)=='[object Object]'){
|
||||||
if(typeof level!='number'){
|
if(level==0){
|
||||||
level=-1;
|
|
||||||
}
|
|
||||||
else if(level==0){
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
var item2={};
|
var item2={};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
window.noname_update={
|
window.noname_update={
|
||||||
version:'1.8.2',
|
version:'1.8.2.0',
|
||||||
changeLog:[
|
changeLog:[
|
||||||
'联机预览版(身份模式、标准版包)',
|
'联机预览版(身份模式,标准包)',
|
||||||
'新卡牌样式(by @_游离感_ )',
|
'新卡牌样式(by @_游离感_ )',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,30 @@ mode.connect={
|
||||||
if(lib.config.reconnect_info){
|
if(lib.config.reconnect_info){
|
||||||
var info=lib.config.reconnect_info;
|
var info=lib.config.reconnect_info;
|
||||||
game.onlineID=info[1];
|
game.onlineID=info[1];
|
||||||
game.connect(info[0]);
|
game.connect(info[0],game.resume);
|
||||||
game.saveConfig('reconnect_info');
|
game.saveConfig('reconnect_info');
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
'step 1'
|
'step 1'
|
||||||
delete game.onlineID;
|
delete game.onlineID;
|
||||||
|
if(lib.config.reconnect_more){
|
||||||
|
var n=5;
|
||||||
|
var connect=function(){
|
||||||
|
game.connect(lib.config.reconnect_more,function(success){
|
||||||
|
if(success){
|
||||||
|
game.saveConfig('reconnect_more');
|
||||||
|
}
|
||||||
|
else if(n--){
|
||||||
|
event.timeout=setTimeout(connect,1000);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
game.saveConfig('reconnect_more');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
event.timeout=setTimeout(connect,500);
|
||||||
|
}
|
||||||
|
'step 2'
|
||||||
for(var i in lib.element.event){
|
for(var i in lib.element.event){
|
||||||
event.parent[i]=lib.element.event[i];
|
event.parent[i]=lib.element.event[i];
|
||||||
}
|
}
|
||||||
|
@ -18,6 +36,44 @@ mode.connect={
|
||||||
add:{},
|
add:{},
|
||||||
replace:{}
|
replace:{}
|
||||||
};
|
};
|
||||||
game.connect('localhost');
|
var node=ui.create.div('.shadowed');
|
||||||
|
node.style.width='400px';
|
||||||
|
node.style.height='30px';
|
||||||
|
node.style.lineHeight='30px';
|
||||||
|
node.style.fontFamily='xinwei';
|
||||||
|
node.style.fontSize='30px';
|
||||||
|
node.style.padding='10px';
|
||||||
|
node.style.left='calc(50% - 200px)';
|
||||||
|
node.style.top='calc(50% - 20px)';
|
||||||
|
node.style.whiteSpace='nowrap';
|
||||||
|
node.innerHTML=lib.config.last_ip||'';
|
||||||
|
node.contentEditable=true;
|
||||||
|
node.style.webkitUserSelect='text';
|
||||||
|
node.style.textAlign='center';
|
||||||
|
node.addEventListener('keydown',function(e){
|
||||||
|
if(e.keyCode==13){
|
||||||
|
clearTimeout(event.timeout);
|
||||||
|
e.preventDefault();
|
||||||
|
game.saveConfig('last_ip',node.innerHTML);
|
||||||
|
game.connect(node.innerHTML);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ui.window.appendChild(node);
|
||||||
|
ui.ipnode=node;
|
||||||
|
|
||||||
|
var text=ui.create.div();
|
||||||
|
text.style.width='400px';
|
||||||
|
text.style.height='30px';
|
||||||
|
text.style.lineHeight='30px';
|
||||||
|
text.style.fontFamily='xinwei';
|
||||||
|
text.style.fontSize='30px';
|
||||||
|
text.style.padding='10px';
|
||||||
|
text.style.left='calc(50% - 200px)';
|
||||||
|
text.style.top='calc(50% - 80px)';
|
||||||
|
text.innerHTML='输入联机地址';
|
||||||
|
text.style.textAlign='center';
|
||||||
|
ui.window.appendChild(text);
|
||||||
|
ui.iptext=text;
|
||||||
|
// game.connect('localhost');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue