diff --git a/character/refresh.js b/character/refresh.js index 552a5a7ed..4b26c2559 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -1031,6 +1031,12 @@ character.refresh={ audio:2, enable:'phaseUse', usable:1, + filter:function(event,player){ + for(var i=0;i0; + }, + viewAs:{name:'wuzhong'}, + filterCard:{suit:'heart'}, + check:function(card){ + return 8-ai.get.value(card); + } + }, dili:{ trigger:{player:'phaseDrawBegin'}, forced:true, diff --git a/game/game.js b/game/game.js index 9a12fb1a3..3240a8d5b 100755 --- a/game/game.js +++ b/game/game.js @@ -1574,22 +1574,22 @@ } } }, - // swap:{ - // name:'死亡后显示换人', - // init:true, - // onclick:function(bool){ - // game.saveConfig('swap',bool,this._link.config.mode); - // if(get.config('swap')){ - // if(!ui.swap&&game.me.isDead()){ - // ui.swap=ui.create.control('换人',ui.click.dieswap); - // } - // } - // else if(ui.swap){ - // ui.swap.close(); - // delete ui.swap; - // } - // } - // }, + continue_game:{ + name:'显示继续游戏', + init:false, + onclick:function(bool){ + game.saveConfig('continue_game',bool,this._link.config.mode); + if(get.config('continue_game')){ + if(!ui.continue_game&&_status.over){ + ui.continue_game=ui.create.control('继续',game.reloadCurrent); + } + } + else if(ui.continue_game){ + ui.continue_game.close(); + delete ui.continue_game; + } + } + }, revive:{ name:'死亡后显示复活', init:false, @@ -1804,22 +1804,22 @@ } } }, - // swap:{ - // name:'死亡后显示换人', - // init:true, - // onclick:function(bool){ - // game.saveConfig('swap',bool,this._link.config.mode); - // if(get.config('swap')){ - // if(!ui.swap&&game.me.isDead()){ - // ui.swap=ui.create.control('换人',ui.click.dieswap); - // } - // } - // else if(ui.swap){ - // ui.swap.close(); - // delete ui.swap; - // } - // } - // }, + continue_game:{ + name:'显示继续游戏', + init:false, + onclick:function(bool){ + game.saveConfig('continue_game',bool,this._link.config.mode); + if(get.config('continue_game')){ + if(!ui.continue_game&&_status.over){ + ui.continue_game=ui.create.control('继续',game.reloadCurrent); + } + } + else if(ui.continue_game){ + ui.continue_game.close(); + delete ui.continue_game; + } + } + }, revive:{ name:'死亡后显示复活', init:false, @@ -2628,7 +2628,7 @@ } delete lib.help2; - if(localStorage.getItem(lib.configprefix+'playbackmode')){ + if(localStorage.getItem(lib.configprefix+'playback')){ lib.init.js('mode',lib.config.mode); } else if((localStorage.getItem(lib.configprefix+'directstart')||!lib.config.show_splash) @@ -10390,6 +10390,11 @@ } window.location.reload(); }, + reloadCurrent:function(){ + game.saveConfig('continue_name',[game.me.name1||game.me.name,game.me.name2]); + localStorage.setItem(lib.configprefix+'directstart',true); + game.reload(); + }, update:function(func){ lib.updates.push(func); if(lib.updates.length===1){ @@ -11164,9 +11169,9 @@ if(game.controlOver){ game.controlOver();return; } - // if(!ui.savevideo&&lib.db&&lib.config.savevideo){ - // ui.savevideo=ui.create.control('保存录像',game.saveVideo); - // } + if(get.config('continue_game')){ + ui.continue_game=ui.create.control('继续',game.reloadCurrent); + } if(!ui.restart){ ui.restart=ui.create.control('restart',game.reload); } diff --git a/mode/guozhan.js b/mode/guozhan.js index 74d14bf62..f54154d1e 100755 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -274,9 +274,14 @@ mode.guozhan={ 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(chosen.contains(i)) continue; if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue; @@ -291,8 +296,11 @@ mode.guozhan={ if(_status.auto){ event.ai(game.me,list); } + else if(chosen.length){ + game.me.init(chosen[0],chosen[1],false); + } else{ - var dialog=ui.create.dialog('选择角色',[list,'character']); + var dialog=ui.create.dialog('选择角色','hidden',[list,'character']); if(get.config('change_identity')){ addSetting(dialog); } @@ -419,6 +427,11 @@ mode.guozhan={ for(var j=0;j