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:{
trigger:{player:'damageEnd'},
content:function(){
player.addSkill('fenyong2');
player.addTempSkill('fenyong2','phaseAfter');
}
},
fenyong2:{

View File

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

View File

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

View File

@ -4512,23 +4512,40 @@ mode.versus={
if(this.identity=='zhu'){
game.over(this.side!=game.me.side);
}
else if(source){
if(source.side==this.side){
if(source.identity=='zhu'){
source.discard(source.getCards('he'));
else{
if(source){
if(source.side==this.side){
if(source.identity=='zhu'){
source.discard(source.getCards('he'));
}
}
else{
var num1=0,num2=1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].side==source.side){
num1++;
}
else{
num2++;
}
}
source.draw(2+Math.max(0,num2-num1));
}
}
else{
var num1=0,num2=1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].side==source.side){
num1++;
}
else{
num2++;
}
var side1=[],side2=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].side){
side1.push(game.players[i]);
}
source.draw(2+Math.max(0,num2-num1));
else{
side2.push(game.players[i]);
}
}
if(side1.length==1){
side1[0].showGiveup();
}
if(side2.length==1){
side2[0].showGiveup();
}
}
return;
@ -4539,23 +4556,44 @@ mode.versus={
if(this.identity=='zhu'){
game.over(this.side!=game.me.side);
}
else if(source){
if(source.side==this.side){
if(source.identity=='zhu'){
source.discard(source.getCards('he'));
else{
if(source){
if(source.side==this.side){
if(source.identity=='zhu'){
source.discard(source.getCards('he'));
}
}
else{
var num1=0,num2=1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].side==source.side){
num1++;
}
else{
num2++;
}
}
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{
var num1=0,num2=1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].side==source.side){
num1++;
}
else{
num2++;
}
if(side1.length>=side2.length+2){
game.me.showGiveup();
}
source.draw(2+Math.max(0,num2-num1));
}
}
return;