This commit is contained in:
libccy 2017-03-30 18:23:02 +08:00
parent fe3b90b744
commit 8bf5d190ab
4 changed files with 106 additions and 51 deletions

View File

@ -3034,7 +3034,7 @@ character.sp={
fenyong:{ fenyong:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
content:function(){ content:function(){
player.addSkill('fenyong2'); player.addTempSkill('fenyong2','phaseAfter');
} }
}, },
fenyong2:{ fenyong2:{

View File

@ -2863,6 +2863,14 @@
game.saveConfig('show_handcardbutton',bool); game.saveConfig('show_handcardbutton',bool);
} }
}, },
show_giveup:{
name:'显示投降按钮',
init:true,
unfrequent:true,
onclick:function(bool){
game.saveConfig('show_giveup',bool);
}
},
show_wuxie:{ show_wuxie:{
name:'显示无懈按钮', name:'显示无懈按钮',
intro:'在右上角显示不询问无懈', intro:'在右上角显示不询问无懈',
@ -4264,6 +4272,7 @@
map.enable_all.show(); map.enable_all.show();
map.enable_all_cards_four.show(); map.enable_all_cards_four.show();
map.four_assign.show(); map.four_assign.show();
map.four_phaseswap.show();
map.expand_dialog.show(); map.expand_dialog.show();
} }
else{ else{
@ -4274,6 +4283,7 @@
map.enable_all.hide(); map.enable_all.hide();
map.enable_all_cards_four.hide(); map.enable_all_cards_four.hide();
map.four_assign.hide(); map.four_assign.hide();
map.four_phaseswap.hide();
map.expand_dialog.hide(); map.expand_dialog.hide();
} }
if(config.versus_mode=='three'||config.versus_mode=='one'){ if(config.versus_mode=='three'||config.versus_mode=='one'){
@ -7184,6 +7194,11 @@
}, },
onfree:function(){ onfree:function(){
if(lib.onfree){ if(lib.onfree){
clearTimeout(window.resetGameTimeout);
delete window.resetGameTimeout;
delete window.resetExtension;
localStorage.removeItem(lib.configprefix+'disable_extension',true);
var onfree=lib.onfree; var onfree=lib.onfree;
delete lib.onfree; delete lib.onfree;
var loop=function(){ var loop=function(){
@ -19042,11 +19057,12 @@
if(player) lib.element.player.chat.call(player,str); if(player) lib.element.player.chat.call(player,str);
}, },
giveup:function(player){ giveup:function(player){
_status.event.next.length=0;
game.createEvent('giveup',false).setContent(function(){
game.log(player,'投降'); game.log(player,'投降');
player.popup('投降'); player.popup('投降');
setTimeout(function(){
player.die('nosource'); player.die('nosource');
},1000); }).player=player;
}, },
auto:function(){ auto:function(){
var player=lib.playerOL[this.id]; var player=lib.playerOL[this.id];
@ -32506,6 +32522,7 @@
}, },
giveup:function(){ giveup:function(){
if(ui.giveup) return; if(ui.giveup) return;
if(!lib.config.show_giveup) return;
ui.giveup=ui.create.system('投降',function(){ ui.giveup=ui.create.system('投降',function(){
var player=game.me; var player=game.me;
this.remove(); this.remove();
@ -32513,11 +32530,12 @@
game.send('giveup',player); game.send('giveup',player);
} }
else{ else{
_status.event.next.length=0;
game.createEvent('giveup',false).setContent(function(){
game.log(player,'投降'); game.log(player,'投降');
player.popup('投降'); player.popup('投降');
setTimeout(function(){
player.die('nosource'); player.die('nosource');
},1000); }).player=player;
} }
if(_status.paused&&_status.imchoosing&&!_status.auto){ if(_status.paused&&_status.imchoosing&&!_status.auto){
ui.click.auto(); ui.click.auto();
@ -34022,11 +34040,11 @@
},3000); },3000);
}); });
} }
clearTimeout(window.resetGameTimeout); // clearTimeout(window.resetGameTimeout);
delete window.resetGameTimeout; // delete window.resetGameTimeout;
delete window.resetExtension; // delete window.resetExtension;
localStorage.removeItem(lib.configprefix+'disable_extension',true); // localStorage.removeItem(lib.configprefix+'disable_extension',true);
setTimeout(lib.init.onfree,3000); // setTimeout(lib.init.onfree,3000);
if(lib.config.test_game){ if(lib.config.test_game){
ui.window.classList.add('testing'); ui.window.classList.add('testing');

View File

@ -1,9 +1,8 @@
window.noname_update={ window.noname_update={
version:'1.9.19', version:'1.9.19.1',
update:'1.9.18.2', update:'1.9.19',
changeLog:[ changeLog:[
'bug修复', 'bug修复',
'4v4单人控制',
], ],
files:[ files:[
'game/game.js', 'game/game.js',
@ -12,12 +11,12 @@ window.noname_update={
// 'game/source.js', // 'game/source.js',
// 'game/asset.js', // 'game/asset.js',
// 'card/*', // 'card/*',
'card/swd.js', // 'card/swd.js',
'character/*', // 'character/*',
// 'character/refresh.js', 'character/sp.js',
// 'mode/boss.js', // 'mode/boss.js',
'mode/versus.js', 'mode/versus.js',
'mode/guozhan.js', // 'mode/guozhan.js',
// 'mode/identity.js', // 'mode/identity.js',
// 'mode/chess.js', // 'mode/chess.js',
// 'mode/tafang.js', // 'mode/tafang.js',

View File

@ -4512,7 +4512,8 @@ mode.versus={
if(this.identity=='zhu'){ if(this.identity=='zhu'){
game.over(this.side!=game.me.side); game.over(this.side!=game.me.side);
} }
else if(source){ else{
if(source){
if(source.side==this.side){ if(source.side==this.side){
if(source.identity=='zhu'){ if(source.identity=='zhu'){
source.discard(source.getCards('he')); source.discard(source.getCards('he'));
@ -4531,6 +4532,22 @@ mode.versus={
source.draw(2+Math.max(0,num2-num1)); source.draw(2+Math.max(0,num2-num1));
} }
} }
var side1=[],side2=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].side){
side1.push(game.players[i]);
}
else{
side2.push(game.players[i]);
}
}
if(side1.length==1){
side1[0].showGiveup();
}
if(side2.length==1){
side2[0].showGiveup();
}
}
return; return;
} }
} }
@ -4539,7 +4556,8 @@ mode.versus={
if(this.identity=='zhu'){ if(this.identity=='zhu'){
game.over(this.side!=game.me.side); game.over(this.side!=game.me.side);
} }
else if(source){ else{
if(source){
if(source.side==this.side){ if(source.side==this.side){
if(source.identity=='zhu'){ if(source.identity=='zhu'){
source.discard(source.getCards('he')); source.discard(source.getCards('he'));
@ -4558,6 +4576,26 @@ mode.versus={
source.draw(2+Math.max(0,num2-num1)); source.draw(2+Math.max(0,num2-num1));
} }
} }
var side1=[],side2=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].side){
side1.push(game.players[i]);
}
else{
side2.push(game.players[i]);
}
}
if(game.me.side){
if(side1.length<=side2.length-2){
game.me.showGiveup();
}
}
else{
if(side1.length>=side2.length+2){
game.me.showGiveup();
}
}
}
return; return;
} }
else if(_status.mode=='two'){ else if(_status.mode=='two'){