"use strict"; (function(){ var _status={ paused:false, paused2:false, over:false, clicked:false, auto:false, event:{ finished:true, next:[], }, ai:{}, lastdragchange:[], skillaudio:[], dieClose:[] }; var lib={ version:1.62, changeLog:[ '改进触屏操作,增加上划/下划手势(可在选项-通用中设置)', '音效菜单中增加音量选项', '字体选项', '修改标身份操作', '装备距离提示', '加入部分美化版素材(by @tanyuanjkl)', '界面、bug修复' ], configprefix:'noname_0.9_', updates:[], canvasUpdates:[], video:[], arenaReady:[], _onDB:[], onDB:function(func){ if(lib.db){ func(); } else{ lib._onDB.push(func); } }, listenEnd:function(node){ if(!node._listeningEnd){ node._listeningEnd=true; node.addEventListener('webkitTransitionEnd',function(){ if(node._onEndMoveDelete){ node.moveDelete(node._onEndMoveDelete); } else if(node._onEndDelete){ node.delete(); } node._transitionEnded=true; }); } }, configMenu:{ general:{ name:'通用', config:{ cheat:{ name:'控制台命令', init:false, onclick:function(bool){ if(lib.config.cheat&&bool==false){ lib.cheat=window.cheat; delete window.cheat; delete window.game; delete window.ui; delete window.get; delete window.ai; delete window.lib; delete window._status; } else if(!lib.config.cheat&&bool){ window.cheat=lib.cheat; window.cheat.i(); } game.saveConfig('cheat',bool); }, unfrequent:true, }, low_performance:{ name:'流畅模式', init:false, onclick:function(bool){ game.saveConfig('low_performance',bool); if(bool){ ui.arena.classList.add('low_performance'); ui.updatehl(); } else{ ui.arena.classList.remove('low_performance'); var hs=ui.me.querySelectorAll('.handcards>.card'); for(var i=0;i'+ ''+ '', clear:true, }, export_data:{ name:'导出游戏数据', onclick:function(){ var data={}; for(var i in localStorage){ data[i]=localStorage[i]; } game.export(lib.init.encode(JSON.stringify(data)), '无名杀 - 数据 - '+(new Date()).toLocaleString()); }, clear:true } } } }, mode:{ identity:{ name:'身份', config:{ update:function(config,map){ if(config.player_number=='8'){ map.double_nei.show(); } else{ map.double_nei.hide(); } if(config.identity_mode=='zhong'){ map.player_number.hide(); map.enhance_zhu.hide(); map.double_nei.hide(); map.auto_identity.hide(); } else{ map.player_number.show(); map.enhance_zhu.show(); map.double_nei.show(); map.auto_identity.show(); } }, identity_mode:{ name:'游戏模式', init:'normal', item:{ normal:'普通', zhong:'明忠' }, restart:true, frequent:true, }, player_number:{ name:'游戏人数', init:'8', item:{ '2':'两人', '3':'三人', '4':'四人', '5':'五人', '6':'六人', '7':'七人', '8':'八人' }, frequent:true, restart:true, }, double_nei:{ name:'双内奸', init:false, frequent:true, restart:true, }, double_character:{ name:'双将模式', init:false, frequent:true, restart:true, }, double_hp:{ name:'双将体力上限', init:'pingjun', item:{ hejiansan:'和减三', pingjun:'平均值', zuidazhi:'最大值', zuixiaozhi:'最小值', zonghe:'相加', }, restart:true, }, auto_identity:{ name:'自动显示身份', item:{ off:'关闭', one:'一轮', two:'两轮', three:'三轮', always:'始终' }, init:'off', onclick:function(bool){ game.saveConfig('auto_identity',bool,this._link.config.mode); if(get.config('identity_mode')=='zhong') return; var num; switch(bool){ case '一轮':num=1;break; case '两轮':num=2;break; case '三轮':num=3;break; default:num=0;break; } if(num&!_status.identityShown&&game.phaseNumber>game.players.length*num&&game.showIdentity){ _status.identityShown=true; game.showIdentity(false); } } }, ban_weak:{ name:'屏蔽弱将', init:false, restart:true, }, ban_strong:{ name:'屏蔽强将', init:false, restart:true, }, enhance_zhu:{ name:'加强主公', init:false, restart:true, frequent:true, }, free_choose:{ name:'自由选将', init:true, onclick:function(bool){ game.saveConfig('free_choose',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); else if(ui.cheat2&&!get.config('free_choose')){ ui.cheat2.close(); delete ui.cheat2; if(ui.cheat2x){ ui.cheat2x.close(); delete ui.cheat2; } } } }, change_identity:{ name:'自由选择身份和座位', init:true, onclick:function(bool){ game.saveConfig('change_identity',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; var dialog; if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; else dialog=_status.event.dialog; if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.parent.addSetting(dialog); else _status.event.parent.removeSetting(dialog); ui.update(); } }, change_choice:{ name:'开启换将卡', init:false, onclick:function(bool){ game.saveConfig('change_choice',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); else if(ui.cheat&&!get.config('change_choice')){ ui.cheat.close(); delete ui.cheat; } } }, change_card:{ name:'开启手气卡', init:false, }, dierestart:{ name:'死亡后显示重来', init:true, onclick:function(bool){ game.saveConfig('dierestart',bool,this._link.config.mode); if(get.config('dierestart')){ if(!ui.restart&&game.me.isDead()){ ui.restart=ui.create.control('restart',game.reload); } } else if(ui.restart){ ui.restart.close(); delete ui.restart; } } }, // 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; // } // } // }, revive:{ name:'死亡后显示复活', init:false, onclick:function(bool){ game.saveConfig('revive',bool,this._link.config.mode); if(get.config('revive')){ if(!ui.revive&&game.me.isDead()){ ui.revive=ui.create.control('revive',ui.click.dierevive); } } else if(ui.revive){ ui.revive.close(); delete ui.revive; } } }, ai_strategy:{ name:'内奸策略', init:'ai_strategy_1', item:{ ai_strategy_1:'均衡', ai_strategy_2:'偏反', ai_strategy_3:'偏忠', ai_strategy_4:'酱油', ai_strategy_5:'天使', ai_strategy_6:'仇主', } }, difficulty:{ name:'AI对人类态度', init:'normal', item:{ easy:'友好', normal:'一般', hard:'仇视', } }, choice_zhu:{ name:'主公候选武将数', init:'3', restart:true, item:{ '3':'三', '4':'四', '5':'五', '6':'六', '8':'八', '10':'十', } }, choice_zhong:{ name:'忠臣候选武将数', init:'4', restart:true, item:{ '3':'三', '4':'四', '5':'五', '6':'六', '8':'八', '10':'十', } }, choice_nei:{ name:'内奸候选武将数', init:'5', restart:true, item:{ '3':'三', '4':'四', '5':'五', '6':'六', '8':'八', '10':'十', } }, choice_fan:{ name:'反贼候选武将数', init:'3', restart:true, item:{ '3':'三', '4':'四', '5':'五', '6':'六', '8':'八', '10':'十', } }, } }, guozhan:{ name:'国战', config:{ guozhan_mode:{ name:'游戏模式', init:'normal', item:{ normal:'普通', mingjiang:'明将' }, restart:true, frequent:true, }, player_number:{ name:'游戏人数', init:'8', item:{ '3':'三人', '4':'四人', '5':'五人', '6':'六人', '7':'七人', '8':'八人' }, frequent:true, restart:true, }, initshow_draw:{ name:'首亮摸牌', item:{ '0':'无', '1':'一张', '2':'两张', '3':'三张', }, init:'2', frequent:true, }, zhulian:{ name:'珠联璧合', init:true, frequent:true, }, double_hp:{ name:'双将体力上限', init:'pingjun', item:{ hejiansan:'和减三', pingjun:'平均值', zuidazhi:'最大值', zuixiaozhi:'最小值', zonghe:'相加', }, restart:true, }, ban_strong:{ name:'屏蔽强将', init:false, restart:true, }, free_choose:{ name:'自由选将', init:true, onclick:function(bool){ game.saveConfig('free_choose',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); else if(ui.cheat2&&!get.config('free_choose')){ ui.cheat2.close(); delete ui.cheat2; if(ui.cheat2x){ ui.cheat2x.close(); delete ui.cheat2; } } } }, change_identity:{ name:'自由选择座位', init:true, onclick:function(bool){ game.saveConfig('change_identity',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; var dialog; if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; else dialog=_status.event.dialog; if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.parent.addSetting(dialog); else _status.event.parent.removeSetting(dialog); ui.update(); } }, change_choice:{ name:'开启换将卡', init:false, onclick:function(bool){ game.saveConfig('change_choice',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); else if(ui.cheat&&!get.config('change_choice')){ ui.cheat.close(); delete ui.cheat; } } }, change_card:{ name:'开启手气卡', init:false, }, dierestart:{ name:'死亡后显示重来', init:true, onclick:function(bool){ game.saveConfig('dierestart',bool,this._link.config.mode); if(get.config('dierestart')){ if(!ui.restart&&game.me.isDead()){ ui.restart=ui.create.control('restart',game.reload); } } else if(ui.restart){ ui.restart.close(); delete ui.restart; } } }, // 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; // } // } // }, revive:{ name:'死亡后显示复活', init:false, onclick:function(bool){ game.saveConfig('revive',bool,this._link.config.mode); if(get.config('revive')){ if(!ui.revive&&game.me.isDead()){ ui.revive=ui.create.control('revive',ui.click.dierevive); } } else if(ui.revive){ ui.revive.close(); delete ui.revive; } } }, difficulty:{ name:'AI对人类态度', init:'normal', item:{ easy:'友好', normal:'一般', hard:'仇视', } }, choice_num:{ name:'候选武将数', init:'7', restart:true, item:{ '5':'五', '6':'六', '7':'七', '8':'八', '9':'九', '10':'十', } }, } }, versus:{ name:'对决', config:{ change_choice:{ name:'开启换将卡', init:false, onclick:function(bool){ game.saveConfig('change_choice',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); else if(ui.cheat&&!get.config('change_choice')){ ui.cheat.close(); delete ui.cheat; } }, frequent:true, }, ban_weak:{ name:'屏蔽弱将', init:false, restart:true, frequent:true, }, ban_strong:{ name:'屏蔽强将', init:false, restart:true, frequent:true, }, } }, boss:{ name:'挑战', config:{ free_choose:{ name:'自由选将', init:true, frequent:true, onclick:function(bool){ game.saveConfig('free_choose',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); else if(ui.cheat2&&!get.config('free_choose')){ ui.cheat2.close(); delete ui.cheat2; if(ui.cheat2x){ ui.cheat2x.close(); delete ui.cheat2; } } } }, change_choice:{ name:'开启换将卡', init:false, onclick:function(bool){ game.saveConfig('change_choice',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); else if(ui.cheat&&!get.config('change_choice')){ ui.cheat.close(); delete ui.cheat; } }, frequent:true, }, ban_weak:{ name:'屏蔽弱将', init:false, restart:true, frequent:true, }, ban_strong:{ name:'屏蔽强将', init:false, restart:true, frequent:true, }, } }, chess:{ name:'战棋', config:{ chess_mode:{ name:'游戏模式', init:'combat', item:{ combat:'对战', leader:'统率', tafang:'塔防' }, restart:true, frequent:true, }, update:function(config,map){ if(config.chess_mode=='leader'){ map.chess_leader_save.show(); map.chess_leader_clear.show(); map.chess_character.hide(); } else{ map.chess_leader_save.hide(); map.chess_leader_clear.hide(); map.chess_character.show(); } if(config.chess_mode=='combat'){ map.battle_number.show(); map.chess_ordered.show(); map.free_choose.show(); map.change_choice.show(); } else{ map.battle_number.hide(); map.chess_ordered.hide(); map.free_choose.hide(); map.change_choice.hide(); } if(config.chess_mode=='tafang'){ map.chess_treasure.hide(); map.chess_obstacle.hide(); map.tafang_size.show(); map.tafang_turn.show(); map.tafang_difficulty.show(); } else{ map.chess_treasure.show(); map.chess_obstacle.show(); map.tafang_size.hide(); map.tafang_turn.hide(); map.tafang_difficulty.hide(); } if(config.chess_mode=='combat'||config.chess_mode=='tafang'){ map.ban_weak.show(); } else{ map.ban_weak.hide(); } }, tafang_turn:{ name:'游戏胜利', init:'20', frequent:true, item:{ '10':'十回合', '20':'二十回合', '30':'三十回合', '1000':'无限', } }, tafang_size:{ name:'战场大小', init:'9', frequent:true, item:{ '6':'小', '9':'中', '12':'大', } }, tafang_difficulty:{ name:'战斗难度', init:'2', frequent:true, item:{ '1':'简单', '2':'普通', '3':'困难', } }, chess_leader_save:{ name:'选择历程', init:'save1', item:{ save1:'一', save2:'二', save3:'三', save4:'四', save5:'五', }, restart:true, frequent:true, }, chess_leader_clear:{ name:'清除进度', onclick:function(){ var node=this; if(node._clearing){ game.save(get.config('chess_leader_save'),null); window.location.reload(); return; } node._clearing=true; node.innerHTML='单击以确认 (3)'; setTimeout(function(){ node.innerHTML='单击以确认 (2)'; setTimeout(function(){ node.innerHTML='单击以确认 (1)'; setTimeout(function(){ node.innerHTML='清除进度'; delete node._clearing; },1000); },1000); },1000); }, clear:true, frequent:true, }, battle_number:{ name:'对战人数', init:'3', frequent:true, item:{ '2':'2v2', '3':'3v3', '4':'4v4', '6':'6v6', '8':'8v8', }, onclick:function(num){ game.saveConfig('battle_number',num,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(_status.event.parent.changeDialog){ _status.event.parent.changeDialog(); } }, }, chess_treasure:{ name:'战场机关', init:'0.2', frequent:true, item:{ '0':'关闭', '0.1':'较少出现', '0.2':'偶尔出现', '0.333':'时常出现', '0.5':'频繁出现', } }, chess_obstacle:{ name:'随机路障', init:'0.333', item:{ '0':'关闭', '0.2':'少量', '0.333':'中量', '0.5':'大量', }, frequent:true, }, attack_move:{ name:'击退效果', init:true, // frequent:true, }, show_distance:{ name:'显示距离', init:true, // frequent:true, }, chess_ordered:{ name:'交替行动', init:true, // frequent:true, }, chess_character:{ name:'战棋武将', init:true, // frequent:true, }, chess_card:{ name:'战棋卡牌', init:true, // frequent:true, }, free_choose:{ name:'自由选将', init:true, onclick:function(bool){ game.saveConfig('free_choose',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); else if(ui.cheat2&&!get.config('free_choose')){ ui.cheat2.close(); delete ui.cheat2; if(ui.cheat2x){ ui.cheat2x.close(); delete ui.cheat2; } } }, }, change_choice:{ name:'开启换将卡', init:false, onclick:function(bool){ game.saveConfig('change_choice',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); else if(ui.cheat&&!get.config('change_choice')){ ui.cheat.close(); delete ui.cheat; } }, }, ban_weak:{ name:'屏蔽弱将', init:false, restart:true, }, ban_strong:{ name:'屏蔽强将', init:false, restart:true, }, chessscroll_speed:{ name:'边缘滚动速度', init:'20', item:{ '0':'不滚动', '10':'10格/秒', '20':'20格/秒', '30':'30格/秒', } }, } }, stone:{ name:'炉石', config:{ battle_number:{ name:'出场人数', init:'3', frequent:true, item:{ '2':'两人', '3':'三人', '4':'四人', '6':'六人', '8':'八人', '10':'十人', }, onclick:function(num){ game.saveConfig('battle_number',num,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(_status.event.parent.changeDialog){ _status.event.parent.changeDialog(); } }, }, free_choose:{ name:'自由选将', init:true, onclick:function(bool){ game.saveConfig('free_choose',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); else if(ui.cheat2&&!get.config('free_choose')){ ui.cheat2.close(); delete ui.cheat2; if(ui.cheat2x){ ui.cheat2x.close(); delete ui.cheat2; } } }, frequent:true, }, change_choice:{ name:'开启换将卡', init:false, onclick:function(bool){ game.saveConfig('change_choice',bool,this._link.config.mode); if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); else if(ui.cheat&&!get.config('change_choice')){ ui.cheat.close(); delete ui.cheat; } }, frequent:true, }, ban_weak:{ name:'屏蔽弱将', init:false, restart:true, frequent:true, }, ban_strong:{ name:'屏蔽强将', init:false, restart:true, frequent:true, }, } } }, status:{ running:false, canvas:false, time:0, delayed:0, frameId:0, videoId:0, }, help:{ '游戏选项':'