diff --git a/mode/game.js b/mode/game.js deleted file mode 100644 index 0564bd4e5..000000000 --- a/mode/game.js +++ /dev/null @@ -1,50664 +0,0 @@ -"use strict"; -(function(){ - var _status={ - paused:false, - paused2:false, - paused3:false, - over:false, - clicked:false, - auto:false, - event:{ - finished:true, - next:[], - after:[] - }, - ai:{}, - lastdragchange:[], - skillaudio:[], - dieClose:[], - dragline:[], - dying:[], - globalHistory:[{ - cardMove:[], - custom:[], - }], - }; - var lib={ - configprefix:'noname_0.9_', - versionOL:27, - updateURLS:{ - coding:'https://nakamurayuri.coding.net/p/noname/d/noname/git/raw', - github:'https://raw.githubusercontent.com/libccy/noname', - }, - updateURL:'https://raw.githubusercontent.com/libccy/noname', - mirrorURL:'https://nakamurayuri.coding.net/p/noname/d/noname/git/raw', - hallURL:'noname.mobi', - assetURL:'', - changeLog:[], - updates:[], - canvasUpdates:[], - video:[], - skilllist:[], - connectBanned:[], - characterIntro:{}, - characterTitle:{}, - characterPack:{}, - characterFilter:{}, - characterSort:{}, - cardPack:{}, - onresize:[], - onphase:[], - onwash:[], - onover:[], - ondb:[], - ondb2:[], - chatHistory:[], - emotionList:{ - shibing_emotion:15, - guojia_emotion:20, - zhenji_emotion:20, - }, - animate:{ - skill:{}, - card:{}, - }, - arenaReady:[], - onfree:[], - inpile:[], - extensions:[], - extensionPack:{}, - cardType:{}, - hook:{globaltrigger:{},globalskill:{}}, - hookmap:{}, - imported:{}, - layoutfixed:['chess','tafang','stone'], - characterDialogGroup:{ - '收藏':function(name,capt){ - return lib.config.favouriteCharacter.contains(name)?capt:null; - }, - '最近':function(name,capt){ - var list=get.config('recentCharacter')||[]; - return list.contains(name)?capt:null; - } - }, - listenEnd:function(node){ - if(!node._listeningEnd){ - node._listeningEnd=true; - node.listenTransition(function(){ - delete node._listeningEnd; - if(node._onEndMoveDelete){ - node.moveDelete(node._onEndMoveDelete); - } - else if(node._onEndDelete){ - node.delete(); - } - node._transitionEnded=true; - }); - } - }, - configMenu:{ - general:{ - name:'通用', - config:{ - low_performance:{ - name:'流畅模式', - init:false, - intro:'减少部分游戏特效,提高游戏速度', - onclick:function(bool){ - game.saveConfig('low_performance',bool); - if(bool){ - ui.window.classList.add('low_performance'); - } - else{ - ui.window.classList.remove('low_performance'); - } - } - }, - compatiblemode:{ - name:'兼容模式', - init:false, - intro:'开启兼容模式可防止扩展使游戏卡死并提高对旧扩展的兼容性,但对游戏速度有一定影响,若无不稳定或不兼容的扩展建议关闭', - onclick:function(bool){ - game.saveConfig('compatiblemode',bool); - if(bool){ - ui.window.classList.add('compatiblemode'); - } - else{ - ui.window.classList.remove('compatiblemode'); - } - } - }, - confirm_exit:{ - name:'确认退出', - init:false, - unfrequent:true, - intro:'离开游戏前弹出确认对话框', - }, - keep_awake:{ - name:'屏幕常亮', - init:false, - unfrequent:true, - intro:'防止屏幕自动关闭
注:旧版本通过NoSleep.js实现的屏幕常亮可能会影响外置音频的音量', - onclick:function(bool){ - game.saveConfig('keep_awake',bool); - if(bool){ - if(window.plugins&&window.plugins.insomnia) window.plugins.insomnia.keepAwake(); - else if(window.noSleep){ - document.addEventListener(lib.config.touchscreen?'touchend':'click', function enableNoSleepX() { - document.removeEventListener(lib.config.touchscreen?'touchend':'click', enableNoSleepX, false); - window.noSleep.enable(); - }, false); - } - } - else{ - if(window.plugins&&window.plugins.insomnia) window.plugins.insomnia.allowSleepAgain(); - else if(window.noSleep) window.noSleep.disable(); - } - } - }, - auto_confirm:{ - name:'自动确认', - init:true, - unfrequent:true, - intro:'当候选目标只有1个时,点击目标后无需再点击确认', - }, - skip_shan:{ - name:'无闪自动取消', - init:false, - unfrequent:true, - intro:'当自己需要使用或打出闪时,若自己没有闪,则跳过该步骤', - }, - wuxie_self:{ - name:'不无懈自己', - init:true, - unfrequent:true, - intro:'自己使用的单目标普通锦囊即将生效时,不询问无懈', - }, - tao_enemy:{ - name:'不对敌方出桃', - init:false, - intro:'双方阵营明确的模式中(如对决),敌方角色濒死时不询问出桃', - unfrequent:true, - }, - enable_drag:{ - name:'启用拖拽', - init:true, - intro:'按住卡牌后可将卡牌拖至目标', - unfrequent:true, - }, - enable_dragline:{ - name:'拖拽指示线', - init:true, - unfrequent:true, - intro:'拖拽时显示虚线,可能降低游戏速度', - }, - enable_touchdragline:{ - name:'拖拽指示线', - init:false, - unfrequent:true, - intro:'拖拽时显示虚线,可能降低游戏速度', - }, - // enable_pressure:{ - // name:'启用压感', - // init:false, - // intro:'开启后可通过按压执行操作', - // unfrequent:true, - // }, - // pressure_taptic:{ - // name:'触觉反馈', - // init:false, - // intro:'开启后按压操作执行时将产生震动', - // unfrequent:true, - // }, - // pressure_click:{ - // name:'按压操作', - // init:'pause', - // intro:'在空白区域按压时的操作', - // unfrequent:true, - // item:{ - // pause:'暂停', - // config:'选项', - // auto:'托管', - // } - // }, - touchscreen:{ - name:'触屏模式', - init:false, - restart:true, - unfrequent:true, - intro:'开启后可使触屏设备反应更快,但无法使用鼠标操作', - onclick:function(bool){ - if(get.is.nomenu('touchscreen',bool)) return false; - game.saveConfig('touchscreen',bool); - } - }, - swipe:{ - name:'滑动手势', - init:true, - unfrequent:true, - intro:'在非滚动区域向四个方向滑动可执行对应操作', - }, - swipe_down:{ - name:'下划操作', - init:'menu', - unfrequent:true, - intro:'向下滑动时执行的操作', - item:{ - system:'显示按钮', - menu:'打开菜单', - pause:'切换暂停', - auto:'切换托管', - chat:'显示聊天', - off:'关闭', - }, - onclick:function(item){ - if(get.is.nomenu('swipe_down',item)) return false; - game.saveConfig('swipe_down',item); - } - }, - swipe_up:{ - name:'上划操作', - intro:'向上滑动时执行的操作', - init:'auto', - unfrequent:true, - item:{ - system:'显示按钮', - menu:'打开菜单', - pause:'切换暂停', - auto:'切换托管', - chat:'显示聊天', - off:'关闭', - }, - onclick:function(item){ - if(get.is.nomenu('swipe_up',item)) return false; - game.saveConfig('swipe_up',item); - } - }, - swipe_left:{ - name:'左划操作', - intro:'向左滑动时执行的操作', - init:'system', - unfrequent:true, - item:{ - system:'显示按钮', - menu:'打开菜单', - pause:'切换暂停', - auto:'切换托管', - chat:'显示聊天', - off:'关闭', - }, - onclick:function(item){ - if(get.is.nomenu('swipe_left',item)) return false; - game.saveConfig('swipe_left',item); - } - }, - swipe_right:{ - name:'右划操作', - intro:'向右滑动时执行的操作', - init:'system', - unfrequent:true, - item:{ - system:'显示按钮', - menu:'打开菜单', - pause:'切换暂停', - auto:'切换托管', - chat:'显示聊天', - off:'关闭', - }, - onclick:function(item){ - if(get.is.nomenu('swipe_right',item)) return false; - game.saveConfig('swipe_right',item); - } - }, - round_menu_func:{ - name:'触屏按钮操作', - intro:'点击屏幕中圆形按钮时执行的操作', - init:'system', - unfrequent:true, - item:{ - system:'显示按钮', - menu:'打开菜单', - pause:'切换暂停', - auto:'切换托管' - }, - onclick:function(item){ - if(get.is.nomenu('round_menu_func',item)) return false; - game.saveConfig('round_menu_func',item); - }, - }, - show_splash:{ - name:'显示开始界面', - intro:'游戏开始前进入模式选择画面', - init:'init', - item:{ - off:'关闭', - init:'首次启动', - always:'保持开启', - } - }, - game_speed:{ - name:'游戏速度', - init:'mid', - item:{ - vslow:'慢', - slow:'较慢', - mid:'中', - fast:'较快', - vfast:'快', - vvfast:'很快', - }, - intro:'设置不同游戏操作间的时间间隔' - }, - sync_speed:{ - name:'限制结算速度', - intro:'在动画结算完成前不执行下一步操作,开启后游戏操作的间隔更长但画面更浏畅,在游戏较卡时建议开启', - init:true - }, - enable_vibrate:{ - name:'开启震动', - intro:'回合开始时使手机震动', - init:false - }, - right_click:{ - name:'右键操作', - init:'pause', - intro:'在空白区域点击右键时的操作', - unfrequent:true, - item:{ - pause:'暂停', - shortcut:'工具', - config:'选项', - auto:'托管', - }, - onclick:function(item){ - if(get.is.nomenu('right_click',item)) return false; - game.saveConfig('right_click',item); - } - }, - longpress_info:{ - name:'长按显示信息', - init:true, - unfrequent:true, - restart:true, - intro:'长按后弹出菜单', - }, - right_info:{ - name:'右键显示信息', - init:true, - unfrequent:true, - restart:true, - intro:'右键点击后弹出菜单', - }, - hover_all:{ - name:'悬停显示信息', - init:true, - unfrequent:true, - restart:true, - intro:'悬停后弹出菜单', - }, - hover_handcard:{ - name:'悬停手牌显示信息', - init:true, - unfrequent:true, - intro:'悬停手牌后弹出菜单', - }, - hoveration:{ - name:'悬停菜单弹出时间', - unfrequent:true, - intro:'鼠标移至目标到弹出菜单的时间间隔', - init:'1000', - item:{ - '500':'0.5秒', - '700':'0.7秒', - '1000':'1秒', - '1500':'1.5秒', - '2500':'2.5秒', - } - }, - doubleclick_intro:{ - name:'双击显示武将资料', - init:true, - unfrequent:true, - intro:'双击武将头像后显示其资料卡', - }, - video:{ - name:'保存录像', - init:'20', - intro:'游戏结束后保存录像在最大条数,超过后将从最早的录像开始删除(已收藏的录像不计入条数)', - item:{ - '0':'关闭', - '5':'五局', - '10':'十局', - '20':'二十局', - '50':'五十局', - '10000':'无限', - }, - unfrequent:true, - }, - max_loadtime:{ - name:'最长载入时间', - intro:'设置游戏从启动到完成载入所需的最长时间,超过此时间未完成载入会报错,若设备较慢或安装了较多扩展可适当延长此时间', - init:'5000', - unfrequent:true, - item:{ - 5000:'5秒', - 10000:'10秒', - 20000:'20秒', - 60000:'60秒' - }, - onclick:function(item){ - game.saveConfig('max_loadtime',item); - if(item=='5000'){ - localStorage.removeItem(lib.configprefix+'loadtime'); - } - else{ - localStorage.setItem(lib.configprefix+'loadtime',item); - } - } - }, - mousewheel:{ - name:'滚轮控制手牌', - init:true, - unfrequent:true, - intro:'开启后滚轮可使手牌横向滚动,在mac等可横向滚动的设备上建议关闭', - onclick:function(bool){ - game.saveConfig('mousewheel',bool); - if(lib.config.touchscreen) return; - if(lib.config.mousewheel){ - ui.handcards1Container.onmousewheel=ui.click.mousewheel; - ui.handcards2Container.onmousewheel=ui.click.mousewheel; - } - else{ - ui.handcards1Container.onmousewheel=null; - ui.handcards2Container.onmousewheel=null; - } - } - }, - auto_check_update:{ - name:'自动检查游戏更新', - intro:'进入游戏时检查更新', - init:false, - unfrequent:true - }, - lucky_star:{ - name:'幸运星模式', - intro:'在涉及随机数等的技能中,必定得到效果最好的结果。(联机模式无效)', - init:false, - unfrequent:true - }, - dev:{ - name:'开发者模式', - intro:'开启后可使用浏览器控制台控制游戏,同时可更新到开发版', - init:false, - onclick:function(bool){ - game.saveConfig('dev',bool); - if(_status.connectMode) return; - if(bool){ - lib.cheat.i(); - } - else{ - delete window.cheat; - delete window.game; - delete window.ui; - delete window.get; - delete window.ai; - delete window.lib; - delete window._status; - } - }, - unfrequent:true, - }, - errstop:{ - name:'出错时停止游戏', - init:false, - unfrequent:true - }, - update_link:{ - name:'更新地址', - init:'coding', - unfrequent:true, - item:{ - coding:'Coding', - github:'GitHub', - }, - onclick:function(item){ - game.saveConfig('update_link',item); - lib.updateURL=lib.updateURLS[item]||lib.updateURLS.coding; - }, - }, - update:function(config,map){ - if('ontouchstart' in document){ - map.touchscreen.show(); - } - else{ - map.touchscreen.hide(); - } - if(lib.device||lib.node){ - map.auto_check_update.show(); - } - else{ - map.auto_check_update.hide(); - } - if(lib.device){ - map.enable_vibrate.show(); - map.keep_awake.show(); - } - else{ - map.enable_vibrate.hide(); - map.keep_awake.hide(); - } - // if(config.enable_pressure){ - // map.pressure_click.show(); - // if(lib.device){ - // map.pressure_taptic.show(); - // } - // else{ - // map.pressure_taptic.hide(); - // } - // } - // else{ - // map.pressure_click.hide(); - // map.pressure_taptic.hide(); - // } - if(lib.config.touchscreen){ - map.mousewheel.hide(); - map.hover_all.hide(); - map.hover_handcard.hide(); - map.hoveration.hide(); - map.right_info.hide(); - map.right_click.hide(); - map.longpress_info.show(); - map.swipe.show(); - if(lib.config.swipe){ - map.swipe_up.show(); - map.swipe_down.show(); - map.swipe_left.show(); - map.swipe_right.show(); - } - else{ - map.swipe_up.hide(); - map.swipe_down.hide(); - map.swipe_left.hide(); - map.swipe_right.hide(); - } - } - else{ - map.mousewheel.show(); - map.hover_all.show(); - map.right_info.show(); - map.right_click.show(); - map.longpress_info.hide(); - if(!config.hover_all){ - map.hover_handcard.hide(); - map.hoveration.hide(); - } - else{ - map.hover_handcard.show(); - map.hoveration.show(); - } - map.swipe.hide(); - map.swipe_up.hide(); - map.swipe_down.hide(); - map.swipe_left.hide(); - map.swipe_right.hide(); - } - if(lib.config.enable_drag){ - if(lib.config.touchscreen){ - map.enable_dragline.hide(); - map.enable_touchdragline.show(); - } - else{ - map.enable_dragline.show(); - map.enable_touchdragline.hide(); - } - } - else{ - map.enable_dragline.hide(); - map.enable_touchdragline.hide(); - } - if(!get.is.phoneLayout()){ - map.round_menu_func.hide(); - } - else{ - map.round_menu_func.show(); - } - if(!lib.node&&lib.device!='ios'){ - map.confirm_exit.show(); - } - else{ - map.confirm_exit.hide(); - } - if(config.dev){ - map.errstop.show(); - } - else{ - map.errstop.hide(); - } - } - } - }, - appearence:{ - name:'外观', - config:{ - theme:{ - name:'主题', - init:'woodden', - item:{}, - visualMenu:function(node,link){ - if(!node.menu){ - node.className='button character themebutton '+link; - node.menu=ui.create.div(node,'','
'); - } - }, - onclick:function(theme){ - game.saveConfig('theme',theme); - ui.arena.hide(); - lib.init.background(); - if(lib.config.autostyle){ - if(theme=='simple'){ - lib.configMenu.appearence.config.player_border.onclick('slim'); - } - else{ - lib.configMenu.appearence.config.player_border.onclick('normal'); - } - } - setTimeout(function(){ - var theme=ui.css.theme; - ui.css.theme=lib.init.css(lib.assetURL+'theme/'+lib.config.theme,'style'); - theme.remove(); - setTimeout(function(){ui.arena.show();},100); - },500); - } - }, - layout:{ - name:'布局', - init:'mobile', - item:{ - default:'旧版', - newlayout:'对称', - mobile:'默认', - long:'宽屏', - long2:'手杀', - nova:'新版' - }, - visualMenu:function(node,link){ - node.className='button character themebutton '+lib.config.theme; - if(!node.created){ - node.created=true; - node.style.overflow='hidden'; - node.firstChild.style.display='none'; - // node.firstChild.classList.add('shadowed'); - // node.firstChild.style.width='16px'; - // node.firstChild.style.height='auto'; - // node.firstChild.style.padding='2px'; - // node.firstChild.style.textAlign='center'; - var me=ui.create.div(node); - me.style.top='auto'; - if(link=='default'||link=='newlayout'){ - me.style.width='calc(100% - 6px)'; - me.style.left='3px'; - me.style.bottom='3px'; - me.style.height='25px'; - if(link=='newlayout'){ - me.style.height='23px'; - me.style.bottom='4px'; - } - } - else if(link=='long2'||link=='nova'){ - me.style.display='none'; - } - else{ - me.style.width='120%'; - me.style.left='-10%'; - me.style.bottom='0'; - me.style.height='22px'; - } - me.style.borderRadius='2px'; - var list=['re_caocao','re_liubei','sp_zhangjiao','sunquan']; - for(var i=0;i<4;i++){ - var player=ui.create.div('.fakeplayer',node); - ui.create.div('.avatar',player).setBackground(list.randomRemove(),'character'); - player.style.borderRadius='2px'; - if(i!=3){ - player.style.top='auto'; - } - if(link=='default'){ - player.style.height='19px'; - player.style.width='38px'; - player.classList.add('oldlayout') - } - else if(link=='mobile'||link=='newlayout'){ - player.style.width='24px'; - player.style.height='29px'; - } - else if(link=='nova') { - player.style.width='20px'; - player.style.height='24px'; - } - else{ - player.style.width='20px'; - player.style.height='34px'; - } - if(i==1){ - player.style.left='3px'; - } - if(i==2){ - player.style.left='auto'; - player.style.right='3px'; - } - if(i==3){ - player.style.top='3px'; - } - if(link=='default'){ - if(i==0){ - player.style.bottom='6px'; - } - if(i==0||i==3){ - player.style.left='calc(50% - 18px)'; - } - if(i==1||i==2){ - player.style.bottom='36px'; - } - } - else if(link=='newlayout'){ - if(i==0){ - player.style.bottom='1px'; - } - if(i==0||i==3){ - player.style.left='calc(50% - 12px)'; - } - if(i==1||i==2){ - player.style.bottom='32px'; - } - } - else if(link=='mobile'){ - if(i==0||i==3){ - player.style.left='calc(50% - 12px)'; - } - if(i==1||i==2){ - player.style.bottom='30px'; - } - } - else if(link=='long'){ - if(i==0||i==3){ - player.style.left='calc(50% - 10px)'; - } - if(i==1||i==2){ - player.style.bottom='45px'; - } - } - else if(link=='long2'){ - if(i==0){ - player.style.bottom='2px'; - player.style.left='3px'; - } - if(i==3){ - player.style.left='calc(50% - 10px)'; - } - if(i==1||i==2){ - player.style.bottom='45px'; - } - } - else if(link=='nova'){ - if(i==0){ - player.style.bottom='2px'; - player.style.left='3px'; - } - if(i==3){ - player.style.left='calc(50% - 10px)'; - } - if(i==1||i==2){ - player.style.left='3px'; - player.style.bottom=(i*30)+'px'; - } - } - - if(i==0&&(link=='mobile'||link=='long')){ - player.classList.add('me'); - player.style.borderRadius='0px'; - player.style.width='25px'; - player.style.height='25px'; - player.style.bottom='-3px'; - player.style.left='-3px'; - } - } - } - }, - onclick:function(layout){ - if(lib.layoutfixed.contains(lib.config.mode)){ - game.saveConfig('layout',layout); - } - else{ - lib.init.layout(layout); - } - } - }, - // fewplayer:{ - // name:'启用人数', - // intro:'设置启用新版布局的最小人数(不足时切换至默认布局)', - // init:'3', - // // unfrequent:true, - // item:{ - // '2':'两人', - // '3':'三人', - // '4':'四人', - // '5':'五人', - // '6':'六人', - // '7':'七人', - // '8':'八人', - // }, - // onclick:function(item){ - // game.saveConfig('fewplayer',item); - // if(ui.arena) ui.arena.setNumber(ui.arena.dataset.number); - // } - // }, - player_height:{ - name:'角色高度', - init:'long', - // unfrequent:true, - item:{ - short:'矮', - default:'中', - long:'高', - }, - onclick:function(item){ - game.saveConfig('player_height',item); - ui.arena.dataset.player_height=item; - } - }, - player_height_nova:{ - name:'角色高度', - init:'short', - item:{ - // auto:'自动', - short:'矮', - default:'中', - long:'高', - }, - onclick:function(item){ - game.saveConfig('player_height_nova',item); - // if(item=='auto'){ - // if(parseInt(ui.arena.dataset.number)>=7){ - // ui.arena.dataset.player_height_nova='short'; - // } - // else{ - // ui.arena.dataset.player_height_nova='default'; - // } - // } - // else{ - ui.arena.dataset.player_height_nova=item; - // } - } - }, - // background_color_music:{ - // name:'背景色', - // init:'black', - // item:{ - // blue:'蓝色', - // black:'黑色', - // }, - // onclick:function(color){ - // game.saveConfig('background_color_music',color); - // document.body.dataset.background_color_music=color; - // } - // }, - // background_color_wood:{ - // name:'背景色', - // init:'blue', - // item:{ - // blue:'蓝色', - // black:'黑色', - // }, - // onclick:function(color){ - // game.saveConfig('background_color_wood',color); - // document.body.dataset.background_color_wood=color; - // } - // }, - // theme_color_music:{ - // name:'主题色', - // init:'black', - // item:{ - // blue:'蓝色', - // black:'黑色', - // }, - // onclick:function(color){ - // game.saveConfig('theme_color_music',color); - // document.body.dataset.theme_color_music=color; - // } - // }, - ui_zoom:{ - name:'界面缩放', - unfrequent:true, - init:'normal', - item:{ - esmall:'80%', - vsmall:'90%', - small:'95%', - normal:'100%', - big:'105%', - vbig:'110%', - ebig:'120%', - }, - onclick:function(zoom){ - game.saveConfig('ui_zoom',zoom); - switch(zoom){ - case 'esmall':zoom=0.8;break; - case 'vsmall':zoom=0.9;break; - case 'small':zoom=0.93;break; - case 'big':zoom=1.05;break; - case 'vbig':zoom=1.1;break; - case 'ebig':zoom=1.2;break; - default:zoom=1; - } - game.documentZoom=game.deviceZoom*zoom; - ui.updatez(); - } - }, - image_background:{ - name:'游戏背景', - init:'default', - item:{}, - visualBar:function(node,item,create){ - if(node.created){ - node.lastChild.classList.remove('active'); - return; - } - node.created=true; - ui.create.filediv('.menubutton','添加背景',node,function(file){ - if(file){ - var name=file.name; - if(name.indexOf('.')!=-1){ - name=name.slice(0,name.indexOf('.')); - } - var link=(game.writeFile?'cdv_':'custom_')+name; - if(item[link]){ - for(var i=1;i<1000;i++){ - if(!item[link+'_'+i]){ - link=link+'_'+i;break; - } - } - } - item[link]=name; - var callback=function(){ - create(link,node.parentNode.defaultNode); - node.parentNode.updateBr(); - lib.config.customBackgroundPack.add(link); - game.saveConfig('customBackgroundPack',lib.config.customBackgroundPack); - }; - if(game.writeFile){ - game.writeFile(file,'image/background',link+'.jpg',callback); - } - else{ - game.putDB('image',link,file,callback); - } - if(node.lastChild.classList.contains('active')){ - editbg.call(node.lastChild); - } - } - }).inputNode.accept='image/*'; - var editbg=function(){ - this.classList.toggle('active'); - var page=this.parentNode.parentNode; - for(var i=0;i4){ - node.classList.add('hideadd'); - button.classList.remove('transparent'); - delete node.currentDB; - } - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept='image/*'; - deletepic=ui.create.div('.menubutton.deletebutton','删除图片',node,function(){ - if(confirm('确定删除自定义图片?(此操作不可撤销)')){ - game.deleteDB('image','hp_style1'); - game.deleteDB('image','hp_style2'); - game.deleteDB('image','hp_style3'); - game.deleteDB('image','hp_style4'); - for(var i=0;idiv:not(.lost){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','hp_style2',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet2){ - ui.css.hp_stylesheet2.remove(); - } - ui.css.hp_stylesheet2=lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','hp_style3',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet3){ - ui.css.hp_stylesheet3.remove(); - } - ui.css.hp_stylesheet3=lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','hp_style4',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet4){ - ui.css.hp_stylesheet4.remove(); - } - ui.css.hp_stylesheet4=lib.init.sheet('.hp:not(.text):not(.actcount)>.lost{background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - unfrequent:true, - }, - player_style:{ - name:'角色背景', - init:'default', - intro:'设置角色的背景图片', - item:{ - wood:'木纹', - music:'音乐', - simple:'简约', - custom:'自定', - default:'默认', - }, - visualBar:function(node,item,create,switcher){ - if(node.created){ - return; - } - var button; - for(var i=0;i.framebg{display:block;background-image:url("'+fileLoadedEvent.target.result+'")}',0); - ui.css.border_stylesheet.sheet.insertRule('.player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}',0); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - else if(layout!='default'&&layout!='auto'){ - ui.css.border_stylesheet=lib.init.sheet(); - if(layout.indexOf('dragon_')==0){ - layout=layout.slice(7); - ui.arena.dataset.framedecoration=layout; - } - else{ - ui.arena.dataset.framedecoration=''; - } - ui.css.border_stylesheet.sheet.insertRule('#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("'+lib.assetURL+'theme/style/player/'+layout+'1.png")}',0); - ui.css.border_stylesheet.sheet.insertRule('#window #arena.long:not(.fewplayer) .player>.framebg, #arena.oldlayout .player>.framebg{background-image:url("'+lib.assetURL+'theme/style/player/'+layout+'3.png")}',0); - ui.css.border_stylesheet.sheet.insertRule('.player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}',0); - } - }, - unfrequent:true, - }, - autoborder_count:{ - name:'边框升级方式', - intro:'击杀 每击杀一人,边框提升两级
伤害 每造成两点伤害,边框提升一级
混合 击杀量决定边框颜色,伤害量决定边框装饰', - init:'kill', - item:{ - kill:'击杀', - damage:'伤害', - mix:'混合', - }, - unfrequent:true, - }, - autoborder_start:{ - name:'基础边框颜色', - init:'bronze', - item:{ - bronze:'铜', - silver:'银', - gold:'金' - }, - unfrequent:true - }, - player_border:{ - name:'边框宽度', - init:'normal', - intro:'设置角色的边框宽度', - unfrequent:true, - item:{ - slim:'细', - narrow:'窄', - normal:'中', - wide:'宽' - }, - onclick:function(item){ - game.saveConfig('player_border',item); - if(item!='wide'||game.layout=='long'||game.layout=='long2'){ - ui.arena.classList.add('slim_player'); - } - else{ - ui.arena.classList.remove('slim_player'); - } - if(item=='slim'){ - ui.arena.classList.add('uslim_player'); - } - else{ - ui.arena.classList.remove('uslim_player'); - } - if(item=='narrow'){ - ui.arena.classList.add('mslim_player'); - } - else{ - ui.arena.classList.remove('mslim_player'); - } - if(item=='normal'&&lib.config.mode!='brawl'&&(game.layout=='long'||game.layout=='long2')){ - ui.arena.classList.add('lslim_player'); - } - else{ - ui.arena.classList.remove('lslim_player'); - } - ui.window.dataset.player_border=item; - } - }, - menu_style:{ - name:'菜单背景', - init:'default', - item:{ - wood:'木纹', - music:'音乐', - simple:'简约', - custom:'自定', - default:'默认', - }, - visualBar:function(node,item,create,switcher){ - if(node.created){ - return; - } - var button; - for(var i=0;i.dialog.popped,html .menu,html .menubg{background-image:url("'+fileLoadedEvent.target.result+'");background-size:cover}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - else if(layout!='default'){ - var str=''; - switch(layout){ - case 'wood':str='url("'+lib.assetURL+'theme/woodden/wood2.png")';break; - case 'music':str='linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px';break; - case 'simple':str='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px';break; - } - ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:'+str+'}'); - } - }, - unfrequent:true, - }, - control_style:{ - name:'按钮背景', - init:'default', - item:{ - wood:'木纹', - music:'音乐', - simple:'简约', - custom:'自定', - default:'默认', - }, - visualBar:function(node,item,create,switcher){ - if(node.created){ - return; - } - var button; - for(var i=0;idiv>div{background-image:url("'+fileLoadedEvent.target.result+'")}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - else if(layout!='default'){ - var str=''; - switch(layout){ - case 'wood':str='url("'+lib.assetURL+'theme/woodden/wood.jpg")';break; - case 'music':str='linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px';break; - case 'simple':str='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px';break; - } - if(layout=='wood'){ - ui.css.control_stylesheet=lib.init.sheet('#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:'+str+'}'); - } - else{ - ui.css.control_stylesheet=lib.init.sheet('#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:'+str+'}'); - } - } - }, - unfrequent:true, - }, - custom_button:{ - name:'自定义按钮高度', - init:false, - unfrequent:true, - onclick:function(bool){ - if(bool!=='skip'){ - game.saveConfig('custom_button',bool); - } - if(ui.css.buttonsheet){ - ui.css.buttonsheet.remove(); - } - if(lib.config.custom_button){ - var cbnum1=6+(parseInt(lib.config.custom_button_system_top)||0); - var cbnum2=6+(parseInt(lib.config.custom_button_system_bottom)||0); - var cbnum3=3+(parseInt(lib.config.custom_button_control_top)||0); - var cbnum4=3+(parseInt(lib.config.custom_button_control_bottom)||0); - var cbnum5=2; - var cbnum6=2; - if(cbnum3<0){ - cbnum5+=cbnum3; - cbnum3=0; - } - if(cbnum4<0){ - cbnum6+=cbnum4; - cbnum4=0; - } - ui.css.buttonsheet=lib.init.sheet( - '#system>div>div, .caption>div>.tdnode{padding-top:'+cbnum1+'px !important;padding-bottom:'+cbnum2+'px !important}', - '#control>.control>div{padding-top:'+cbnum3+'px;padding-bottom:'+cbnum4+'px}', - '#control>.control{padding-top:'+cbnum5+'px;padding-bottom:'+cbnum6+'px}' - ); - } - } - }, - custom_button_system_top:{ - name:'菜单上部高度', - init:'0x', - item:{ - '-5x':'-5px', - '-4x':'-4px', - '-3x':'-3px', - '-2x':'-2px', - '-1x':'-1px', - '0x':'默认', - '1x':'1px', - '2x':'2px', - '3x':'3px', - '4x':'4px', - '5x':'5px', - }, - unfrequent:true, - onclick:function(item){ - game.saveConfig('custom_button_system_top',item); - lib.configMenu.appearence.config.custom_button.onclick('skip'); - } - }, - custom_button_system_bottom:{ - name:'菜单下部高度', - init:'0x', - item:{ - '-5x':'-5px', - '-4x':'-4px', - '-3x':'-3px', - '-2x':'-2px', - '-1x':'-1px', - '0x':'默认', - '1x':'1px', - '2x':'2px', - '3x':'3px', - '4x':'4px', - '5x':'5px', - }, - unfrequent:true, - onclick:function(item){ - game.saveConfig('custom_button_system_bottom',item); - lib.configMenu.appearence.config.custom_button.onclick('skip'); - } - }, - custom_button_control_top:{ - name:'技能上部高度', - init:'0x', - item:{ - '-5x':'-5px', - '-4x':'-4px', - '-3x':'-3px', - '-2x':'-2px', - '-1x':'-1px', - '0x':'默认', - '1x':'1px', - '2x':'2px', - '3x':'3px', - '4x':'4px', - '5x':'5px', - }, - unfrequent:true, - onclick:function(item){ - game.saveConfig('custom_button_control_top',item); - lib.configMenu.appearence.config.custom_button.onclick('skip'); - } - }, - custom_button_control_bottom:{ - name:'技能下部高度', - init:'0x', - item:{ - '-5x':'-5px', - '-4x':'-4px', - '-3x':'-3px', - '-2x':'-2px', - '-1x':'-1px', - '0x':'默认', - '1x':'1px', - '2x':'2px', - '3x':'3px', - '4x':'4px', - '5x':'5px', - }, - unfrequent:true, - onclick:function(item){ - game.saveConfig('custom_button_control_bottom',item); - lib.configMenu.appearence.config.custom_button.onclick('skip'); - } - }, - radius_size:{ - name:'圆角大小', - init:'default', - item:{ - off:'关闭', - reduce:'减小', - default:'默认', - increase:'增大', - }, - unfrequent:true, - onclick:function(item){ - game.saveConfig('radius_size',item); - ui.window.dataset.radius_size=item; - } - }, - glow_phase:{ - name:'当前回合角色高亮', - unfrequent:true, - init:'yellow', - intro:'设置当前回合角色的边框颜色', - item:{ - none:'无', - yellow:'黄色', - green:'绿色', - purple:'紫色', - }, - onclick:function(bool){ - game.saveConfig('glow_phase',bool); - lib.init.cssstyles(); - } - }, - fold_card:{ - name:'折叠手牌', - init:true, - unfrequent:true, - }, - fold_mode:{ - name:'折叠模式菜单', - intro:'关闭后模式菜单中“更多”内的项目将直接展开', - init:true, - unfrequent:true, - }, - seperate_control:{ - name:'分离选项条', - init:true, - unfrequent:true, - intro:'开启后玩家在进行选择时不同的选项将分开,而不是连在一起', - }, - blur_ui:{ - name:'模糊效果', - intro:'在暂停或打开菜单时开启模糊效果', - init:false, - unfrequent:true, - onclick:function(bool){ - game.saveConfig('blur_ui',bool); - if(bool){ - ui.window.classList.add('blur_ui'); - } - else{ - ui.window.classList.remove('blur_ui'); - } - } - }, - glass_ui:{ - name:'玻璃主题', - intro:'为游戏主题打开玻璃效果(手机暂不支持)', - init:false, - unfrequent:true, - onclick:function(bool){ - game.saveConfig('glass_ui',bool); - if(bool){ - ui.window.classList.add('glass_ui'); - } - else{ - ui.window.classList.remove('glass_ui'); - } - } - }, - damage_shake:{ - name:'伤害抖动', - intro:'角色受到伤害时的抖动效果', - init:true, - unfrequent:true, - }, - button_press:{ - name:'按钮效果', - intro:'选项条被按下时将有按下效果', - init:true, - unfrequent:true, - }, - jiu_effect:{ - name:'喝酒效果', - init:true, - unfrequent:true, - }, - animation:{ - name:'游戏特效', - intro:'开启后出现属性伤害、回复体力等情况时会显示动画', - init:false, - unfrequent:true, - }, - skill_animation_type:{ - name:'技能特效', - intro:'开启后觉醒技、限定技将显示全屏文字', - init:'default', - unfrequent:true, - item:{ - default:'默认', - old:'旧版', - off:'关闭' - } - }, - die_move:{ - name:'阵亡效果', - intro:'阵亡后武将的显示效果', - init:'flip', - unfrequent:true, - item:{ - off:'关闭', - move:'移动', - flip:'翻面', - } - }, - target_shake:{ - name:'目标效果', - intro:'一名玩家成为卡牌或技能的目标时的显示效果', - init:'off', - item:{ - off:'关闭', - zoom:'缩放', - shake:'抖动', - }, - unfrequent:true, - onclick:function(bool){ - game.saveConfig('target_shake',bool); - ui.arena.dataset.target_shake=bool; - } - }, - turned_style:{ - name:'翻面文字', - intro:'角色被翻面时显示“翻面”', - init:true, - unfrequent:true, - onclick:function(bool){ - game.saveConfig('turned_style',bool); - if(bool){ - ui.arena.classList.remove('hide_turned'); - } - else{ - ui.arena.classList.add('hide_turned'); - } - } - }, - link_style2:{ - name:'横置样式', - intro:'设置角色被横置时的样式', - init:'chain', - unfrequent:true, - item:{ - chain:'铁索', - rotate:'横置', - mark:'标记' - }, - onclick:function(style){ - var list=[]; - for(var i=0;i'+ - ''+ - '', - clear:true, - }, - background_audio:{ - name:'游戏音效', - init:true, - }, - background_speak:{ - name:'人物配音', - init:true, - }, - equip_audio:{ - name:'装备配音', - init:false, - }, - repeat_audio:{ - name:'播放重复语音', - init:false, - }, - volumn_audio:{ - name:'音效音量', - init:8, - item:{ - '0':'〇', - '1':'一', - '2':'二', - '3':'三', - '4':'四', - '5':'五', - '6':'六', - '7':'七', - '8':'八', - }, - onclick:function(volume){ - game.saveConfig('volumn_audio',parseInt(volume)); - } - }, - volumn_background:{ - name:'音乐音量', - init:8, - item:{ - '0':'〇', - '1':'一', - '2':'二', - '3':'三', - '4':'四', - '5':'五', - '6':'六', - '7':'七', - '8':'八', - }, - onclick:function(volume){ - game.saveConfig('volumn_background',parseInt(volume)); - ui.backgroundMusic.volume=volume/8; - } - }, - clear_background_music:{ - name:'清除自定义背景音乐', - clear:true, - onclick:function(){ - if(confirm('是否清除已导入的所有自定义背景音乐?(该操作不可撤销!)')){ - for(var i in lib.config.customBackgroundMusic){ - lib.config.all.background_music.remove(i); - if(i.indexOf('cdv_')==0){ - game.removeFile('audio/background/'+i+'.mp3'); - } - else{ - game.deleteDB('audio',i); - } - } - lib.config.customBackgroundMusic=null; - game.saveConfig('customBackgroundMusic',null); - game.saveConfig('background_music','music_off'); - if(!_status._aozhan) game.playBackgroundMusic(); - } - }, - }, - } - }, - skill:{ - name:'技能', - config:{ - update:function(config,map){ - for(var i in map){ - if(map[i]._link.config.type=='autoskill'){ - if(!lib.config.autoskilllist.contains(i)){ - map[i].classList.add('on'); - } - else{ - map[i].classList.remove('on'); - } - } - else if(map[i]._link.config.type=='banskill'){ - if(!lib.config.forbidlist.contains(i)){ - map[i].classList.add('on'); - } - else{ - map[i].classList.remove('on'); - } - } - } - } - } - }, - others:{ - name:'其它', - config:{ - // reset_database:{ - // name:'重置游戏', - // onclick:function(){ - // var node=this; - // if(node._clearing){ - // if(indexedDB) indexedDB.deleteDatabase(lib.configprefix+'data'); - // game.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 - // }, - reset_game:{ - name:'重置游戏设置', - onclick:function(){ - var node=this; - if(node._clearing){ - var noname_inited=localStorage.getItem('noname_inited'); - var onlineKey=localStorage.getItem(lib.configprefix+'key'); - localStorage.clear(); - if(noname_inited){ - localStorage.setItem('noname_inited',noname_inited); - } - if(onlineKey){ - localStorage.setItem(lib.configprefix+'key',onlineKey); - } - game.deleteDB('config'); - game.deleteDB('data'); - game.reload(); - return; - } - node._clearing=true; - node.firstChild.innerHTML='单击以确认 (3)'; - setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (2)'; - setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (1)'; - setTimeout(function(){ - node.firstChild.innerHTML='重置游戏设置'; - delete node._clearing; - },1000); - },1000); - },1000); - }, - clear:true - }, - reset_hiddenpack:{ - name:'重置隐藏内容', - onclick:function(){ - if(this.firstChild.innerHTML!='已重置'){ - this.firstChild.innerHTML='已重置' - game.saveConfig('hiddenModePack',[]); - game.saveConfig('hiddenCharacterPack',[]); - game.saveConfig('hiddenCardPack',[]); - game.saveConfig('hiddenPlayPack',[]); - game.saveConfig('hiddenBackgroundPack',[]); - var that=this; - setTimeout(function(){ - that.firstChild.innerHTML='重置隐藏内容'; - setTimeout(function(){ - if(confirm('是否重新启动使改变生效?')){ - game.reload(); - } - }); - },500); - } - }, - clear:true - }, - reset_tutorial:{ - name:'重置新手向导', - onclick:function(){ - if(this.firstChild.innerHTML!='已重置'){ - this.firstChild.innerHTML='已重置' - game.saveConfig('new_tutorial',false); - game.saveConfig('prompt_hidebg'); - game.saveConfig('prompt_hidepack'); - var that=this; - setTimeout(function(){ - that.firstChild.innerHTML='重置新手向导'; - },500); - } - }, - clear:true - }, - import_data:{ - name:'导入游戏设置', - onclick:function(){ - ui.import_data_button.classList.toggle('hidden'); - }, - clear:true - }, - import_data_button:{ - name:'
'+ - ''+ - '
', - clear:true, - }, - export_data:{ - name:'导出游戏设置', - onclick:function(){ - var data; - var export_data=function(data){ - game.export(lib.init.encode(JSON.stringify(data)),'无名杀 - 数据 - '+(new Date()).toLocaleString()); - } - if(!lib.db){ - data={}; - for(var i in localStorage){ - if(i.indexOf(lib.configprefix)==0){ - data[i]=localStorage[i]; - } - } - export_data(data); - } - else{ - game.getDB('config',null,function(data1){ - game.getDB('data',null,function(data2){ - export_data({ - config:data1, - data:data2 - }); - }); - }); - } - - }, - clear:true - }, - redownload_game:{ - name:'重新下载游戏', - onclick:function(){ - var node=this; - if(node._clearing){ - localStorage.removeItem('noname_inited'); - game.reload(); - return; - } - node._clearing=true; - node.firstChild.innerHTML='单击以确认 (3)'; - setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (2)'; - setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (1)'; - setTimeout(function(){ - node.firstChild.innerHTML='重新下载游戏'; - delete node._clearing; - },1000); - },1000); - },1000); - }, - clear:true - }, - update:function(config,map){ - if(lib.device||lib.node){ - map.redownload_game.show(); - } - else{ - map.redownload_game.hide(); - } - } - // trim_game:{ - // name:'隐藏非官方扩展包', - // onclick:function(){ - // if(this.innerHTML!='已隐藏'){ - // this.innerHTML='已隐藏'; - // var pack=lib.config.all.cards.slice(0); - // if(Array.isArray(lib.config.hiddenCardPack)){ - // for(var i=0;igame.players.length*num&&game.showIdentity){ - _status.identityShown=true; - game.showIdentity(false); - } - }, - intro:'游戏进行若干轮将自动显示所有角色的身份', - }, - auto_mark_identity:{ - name:'自动标记身份', - init:true, - intro:'根据角色的出牌行为自动标记可能的身份', - }, - // ban_weak:{ - // name:'屏蔽弱将', - // init:true, - // restart:true, - // }, - // ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - enhance_zhu:{ - name:'加强主公', - init:false, - restart:true, - intro:'为主公增加一个额外技能' - }, - free_choose:{ - name:'自由选将', - init:true, - onclick:function(bool){ - game.saveConfig('free_choose',bool,this._link.config.mode); - if(!_status.event.getParent().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; - } - } - }, - change_identity:{ - name:'自由选择身份和座位', - init:true, - onclick:function(bool){ - game.saveConfig('change_identity',bool,this._link.config.mode); - if(!_status.event.getParent().showConfig&&!_status.event.showConfig) return; - var dialog; - if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; - else dialog=_status.event.dialog; - if(!_status.brawl||!_status.brawl.noAddSetting){ - if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.getParent().addSetting(dialog); - else _status.event.getParent().removeSetting(dialog); - } - ui.update(); - } - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(!_status.event.getParent().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:'disabled', - item:{ - disabled:'禁用', - once:'一次', - twice:'两次', - unlimited:'无限', - }, - }, - 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&&!_status.brawl){ - ui.continue_game=ui.create.control('再战',game.reloadCurrent); - } - } - else if(ui.continue_game){ - ui.continue_game.close(); - delete ui.continue_game; - } - }, - intro:'游戏结束后可选择用相同的武将再进行一局游戏' - }, - 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()&&!_status.connectMode){ - ui.restart=ui.create.control('restart',game.reload); - } - } - else if(ui.restart){ - ui.restart.close(); - delete ui.restart; - } - } - }, - 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; - } - } - }, - ban_identity:{ - name:'屏蔽身份', - init:'off', - item:{ - off:'关闭', - zhu:'主公', - zhong:'忠臣', - nei:'内奸', - fan:'反贼', - }, - }, - ban_identity2:{ - name:'屏蔽身份2', - init:'off', - item:{ - off:'关闭', - zhu:'主公', - zhong:'忠臣', - nei:'内奸', - fan:'反贼', - }, - }, - ban_identity3:{ - name:'屏蔽身份3', - init:'off', - item:{ - off:'关闭', - zhu:'主公', - zhong:'忠臣', - nei:'内奸', - fan:'反贼', - }, - }, - 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:'仇主', - }, - intro:'设置内奸对主忠反的态度' - }, - 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:'国战', - connect:{ - update:function(config,map){ - if(config.connect_onlyguozhan){ - map.connect_junzhu.show(); - } - else{ - map.connect_junzhu.hide(); - } - }, - connect_player_number:{ - name:'游戏人数', - init:'8', - item:{ - '3':'三人', - '4':'四人', - '5':'五人', - '6':'六人', - '7':'七人', - '8':'八人' - }, - frequent:true, - restart:true, - }, - connect_initshow_draw:{ - name:'首亮奖励', - item:{ - 'off':'关闭', - 'draw':'摸牌', - 'mark':'标记', - }, - init:'mark', - frequent:true, - intro:'第一个明置武将牌的角色可获得首亮奖励' - }, - connect_aozhan:{ - name:'鏖战模式', - init:true, - intro:'若开启此选项,则将在游戏中引入“鏖战模式”的规则:
当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', - frequent:true, - restart:true, - }, - connect_viewnext:{ - name:'观看下家副将', - init:false, - intro:'若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', - }, - connect_zhulian:{ - name:'珠联璧合', - init:true, - // frequent:true, - intro:'主将和副将都明置后,若为特定组合,可获得【珠联璧合】标记' - }, - connect_guozhanpile:{ - name:'使用国战牌堆', - init:true, - frequent:true, - restart:true, - }, - connect_onlyguozhan:{ - name:'使用国战武将', - init:true, - frequent:true, - restart:true, - intro:'开启武将技能将替换为国战版本并禁用非国战武将' - }, - connect_junzhu:{ - name:'替换君主', - init:true, - // frequent:true, - restart:true, - intro:'若开启此选项,玩家的第一个回合开始时,若其主武将牌有对应的君主武将牌,则其可以将此武将牌替换为对应的君主武将牌,然后重新调整体力上限。若玩家的体力上限因此增大,则玩家回复等量的体力。' - }, - connect_change_card:{ - name:'启用手气卡', - init:false, - frequent:true, - restart:true, - }, - // connect_ban_weak:{ - // name:'屏蔽弱将', - // init:false, - // restart:true, - // }, - // connect_ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - }, - config:{ - update:function(config,map){ - if(config.onlyguozhan){ - map.junzhu.show(); - } - else{ - map.junzhu.hide(); - } - }, - guozhan_mode:{ - name:'游戏模式', - init:'normal', - item:{ - normal:'标准', - mingjiang:'明将' - }, - frequent:true, - }, - player_number:{ - name:'游戏人数', - init:'8', - item:{ - '3':'三人', - '4':'四人', - '5':'五人', - '6':'六人', - '7':'七人', - '8':'八人' - }, - frequent:true, - restart:true, - }, - initshow_draw:{ - name:'首亮奖励', - item:{ - 'off':'关闭', - 'draw':'摸牌', - 'mark':'标记', - }, - init:'mark', - frequent:true, - intro:'第一个明置身份牌的角色可获得摸牌奖励' - }, - aozhan:{ - name:'鏖战模式', - init:true, - frequent:true, - restart:true, - intro:'若开启此选项,则将在游戏中引入“鏖战模式”的规则:
当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', - }, - viewnext:{ - name:'观看下家副将', - init:false, - intro:'若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', - }, - aozhan_bgm:{ - name:'鏖战背景音乐', - item:{ - disabled:'不启用', - online:'Online', - rewrite:'Rewrite', - chaoming:'潮鸣', - }, - init:'rewrite', - onclick:function(item){ - game.saveConfig('aozhan_bgm',item,this._link.config.mode); - if(_status._aozhan==true) game.playBackgroundMusic(); - }, - }, - zhulian:{ - name:'珠联璧合', - init:true, - // frequent:true, - intro:'主将和副将都明置后,若为特定组合,可获得【珠联璧合】标记' - }, - guozhanpile:{ - name:'使用国战牌堆', - init:true, - frequent:true, - restart:true, - }, - changeViceType:{ - name:'副将变更方式', - init:'default', - item:{ - default:'发现式', - online:'随机式', - }, - frequent:true, - restart:true, - }, - onlyguozhan:{ - name:'使用国战武将', - init:true, - frequent:true, - restart:true, - intro:'开启武将技能将替换为国战版本并禁用非国战武将' - }, - guozhanSkin:{ - name:'使用国战皮肤', - init:true, - frequent:true, - restart:true, - intro:'开启此选项后,将会把有国战专属皮肤的武将替换为国战皮肤' - }, - junzhu:{ - name:'替换君主', - init:true, - // frequent:true, - restart:true, - intro:'若开启此选项,玩家的第一个回合开始时,若其主武将牌有对应的君主武将牌,则其可以将此武将牌替换为对应的君主武将牌,然后重新调整体力上限。若玩家的体力上限因此增大,则玩家回复等量的体力。' - }, - double_hp:{ - name:'双将体力上限', - init:'pingjun', - item:{ - hejiansan:'和减三', - pingjun:'平均值', - zuidazhi:'最大值', - zuixiaozhi:'最小值', - zonghe:'相加', - }, - restart:true, - }, - // ban_weak:{ - // name:'屏蔽弱将', - // init:true, - // 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.getParent().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; - } - } - }, - onlyguozhanexpand:{ - name:'默认展开自由选将', - init:false, - restart:true, - intro:'开启后自由选将对话框将默认显示全部武将' - }, - change_identity:{ - name:'自由选择座位', - init:true, - onclick:function(bool){ - game.saveConfig('change_identity',bool,this._link.config.mode); - if(!_status.event.getParent().showConfig&&!_status.event.showConfig) return; - var dialog; - if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; - else dialog=_status.event.dialog; - if(!_status.brawl||!_status.brawl.noAddSetting){ - if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.getParent().addSetting(dialog); - else _status.event.getParent().removeSetting(dialog); - } - ui.update(); - } - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(!_status.event.getParent().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:'disabled', - item:{ - disabled:'禁用', - once:'一次', - twice:'两次', - unlimited:'无限', - } - }, - continue_game:{ - name:'显示再战', - init:true, - intro:'游戏结束后可选择用相同的武将再进行一局游戏', - onclick:function(bool){ - game.saveConfig('continue_game',bool,this._link.config.mode); - if(get.config('continue_game')){ - if(!ui.continue_game&&_status.over&&!_status.brawl){ - ui.continue_game=ui.create.control('再战',game.reloadCurrent); - } - } - else if(ui.continue_game){ - ui.continue_game.close(); - delete ui.continue_game; - } - } - }, - 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()&&!_status.connectMode){ - ui.restart=ui.create.control('restart',game.reload); - } - } - else if(ui.restart){ - ui.restart.close(); - delete ui.restart; - } - } - }, - 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:'对决', - connect:{ - update:function(config,map){ - if(config.connect_versus_mode=='1v1'){ - map.connect_choice_num.show(); - map.connect_replace_number.show(); - } - else{ - map.connect_choice_num.hide(); - map.connect_replace_number.hide(); - } - if(config.connect_versus_mode=='2v2'||config.connect_versus_mode=='3v3'){ - map.connect_replace_handcard.show(); - } - else{ - map.connect_replace_handcard.hide(); - } - }, - connect_versus_mode:{ - name:'游戏模式', - init:'1v1', - item:{ - '1v1':'1v1', - '2v2':'2v2', - '3v3':'3v3', - '4v4':'4v4', - }, - frequent:true - }, - connect_replace_handcard:{ - name:'四号位保护', - init:true, - frequent:true, - intro:'最后行动的角色起始手牌数+1' - }, - connect_choice_num:{ - name:'侯选武将数', - init:'20', - frequent:true, - item:{ - '12':'12人', - '16':'16人', - '20':'20人', - '24':'24人', - '40':'40人', - } - }, - connect_replace_number:{ - name:'替补人数', - init:'2', - frequent:true, - item:{ - '0':'无', - '1':'1人', - '2':'2人', - '3':'3人', - '4':'4人', - '5':'5人', - } - }, - // connect_ban_weak:{ - // name:'屏蔽弱将', - // init:true, - // restart:true, - // }, - // connect_ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - }, - config:{ - update:function(config,map){ - if(config.versus_mode=='four'){ - map.change_choice.hide(); - map.ladder.show(); - if(config.ladder){ - map.ladder_monthly.show(); - map.ladder_reset.show(); - } - else{ - map.ladder_monthly.hide(); - map.ladder_reset.hide(); - } - map.enable_all.show(); - map.enable_all_cards_four.show(); - map.four_assign.show(); - map.four_phaseswap.show(); - map.expand_dialog.show(); - map.fouralign.show(); - } - else{ - map.change_choice.show(); - map.ladder.hide(); - map.ladder_monthly.hide(); - map.ladder_reset.hide(); - map.enable_all.hide(); - map.enable_all_cards_four.hide(); - map.four_assign.hide(); - map.four_phaseswap.hide(); - map.expand_dialog.hide(); - map.fouralign.hide(); - } - if(config.versus_mode=='three'||config.versus_mode=='one'){ - map.enable_all_three.show(); - map.enable_all_cards.show(); - } - else{ - map.enable_all_three.hide(); - map.enable_all_cards.hide(); - } - if(config.versus_mode=='jiange'||config.versus_mode=='two'||config.versus_mode=='endless'|| - config.versus_mode=='three'||config.versus_mode=='one'||config.versus_mode=='siguo'){ - map.free_choose.show(); - } - else{ - map.free_choose.hide(); - } - if(config.versus_mode=='jiange'){ - map.double_character_jiange.show(); - } - else{ - map.double_character_jiange.hide(); - } - if(config.versus_mode=='two'){ - map.replace_handcard_two.show(); - map.replace_character_two.show(); - map.two_assign.show(); - map.two_phaseswap.show(); - } - else{ - map.replace_handcard_two.hide(); - map.replace_character_two.hide(); - map.two_assign.hide(); - map.two_phaseswap.hide(); - } - if(config.versus_mode=='two'||config.versus_mode=='siguo'||config.versus_mode=='four'){ - if(config.versus_mode=='four'&&(config.four_assign||config.four_phaseswap)){ - map.change_identity.hide(); - } - else{ - map.change_identity.show(); - } - } - else{ - map.change_identity.hide(); - } - if(config.versus_mode=='siguo'){ - map.siguo_character.show(); - } - else{ - map.siguo_character.hide(); - } - }, - versus_mode:{ - name:'游戏模式', - init:'four', - item:{ - four:'对抗', - three:'统率', - two:'欢乐', - jiange:'剑阁', - siguo:'四国', - standard:'自由' - // endless:'无尽', - // triple:'血战', - // one:'1v1', - }, - restart:true, - frequent:true, - }, - ladder:{ - name:'天梯模式', - init:true, - frequent:true, - restart:true - }, - ladder_monthly:{ - name:'每月重置天梯', - init:true, - frequent:true, - }, - enable_all:{ - name:'启用全部武将', - init:false, - frequent:true, - restart:true, - }, - enable_all_cards_four:{ - name:'启用全部卡牌', - init:false, - frequent:true, - restart:true, - }, - enable_all_three:{ - name:'启用全部武将', - init:false, - frequent:true, - restart:true, - }, - enable_all_cards:{ - name:'启用全部卡牌', - init:false, - frequent:true, - restart:true, - }, - four_assign:{ - name:'代替队友选将', - init:false, - restart:true, - }, - four_phaseswap:{ - name:'代替队友行动', - init:false, - restart:true, - }, - two_assign:{ - name:'代替队友选将', - init:false, - restart:true, - }, - two_phaseswap:{ - name:'代替队友行动', - init:false, - restart:true, - }, - free_choose:{ - name:'自由选将', - init:true, - frequent:true, - onclick:function(bool){ - game.saveConfig('free_choose',bool,this._link.config.mode); - if(!ui.create.cheat2) return; - if(!_status.event.getParent().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; - } - } - }, - fouralign:{ - name:'自由选择阵型', - init:false - }, - change_identity:{ - name:'自由选择座位', - init:true, - onclick:function(bool){ - game.saveConfig('change_identity',bool,this._link.config.mode); - if(!_status.event.getParent().showConfig&&!_status.event.showConfig) return; - if(_status.mode=='four'){ - if(get.config('four_assign')||get.config('four_phaseswap')) return; - if(bool){ - if(_status.event.parent.addSetting){ - _status.event.parent.addSetting(); - } - } - else{ - var seats=_status.event.parent.seatsbutton; - if(seats){ - while(seats.length){ - seats.shift().remove(); - } - delete _status.event.parent.seatsbutton; - } - } - } - else{ - var dialog; - if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; - else dialog=_status.event.dialog; - if(!_status.brawl||!_status.brawl.noAddSetting){ - if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.getParent().addSetting(dialog); - else _status.event.getParent().removeSetting(dialog); - } - ui.update(); - } - } - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(!_status.event.getParent().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, - }, - double_character_jiange:{ - name:'双将模式', - init:false, - frequent:true, - }, - replace_handcard_two:{ - name:'四号位保护', - init:true, - frequent:true, - intro:'最后行动的角色起始手牌+1' - }, - replace_character_two:{ - name:'替补模式', - init:false, - frequent:true, - intro:'每个额外选择一名武将,死亡后用该武将代替重新上场,替补武将用完时失败' - }, - expand_dialog:{ - name:'默认展开选将框', - intro:'选将框打开时直接显示全部武将(可能使游戏在开始时卡顿)', - init:false, - }, - siguo_character:{ - name:'专属武将出场率', - init:'increase', - item:{ - increase:'大概率', - normal:'默认概率', - off:'不出现', - }, - frequent:true - }, - // ban_weak:{ - // name:'屏蔽弱将', - // init:true, - // restart:true, - // }, - // ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true - // }, - ladder_reset:{ - name:'重置天梯数据', - onclick:function(){ - var node=this; - if(node._clearing){ - game.save('ladder',{ - current:900, - top:900, - month:(new Date()).getMonth() - }); - ui.ladder.innerHTML='卫士五'; - clearTimeout(node._clearing); - node.firstChild.innerHTML='重置天梯数据'; - delete node._clearing; - return; - } - node.firstChild.innerHTML='单击以确认 (3)'; - node._clearing=setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (2)'; - node._clearing=setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (1)'; - node._clearing=setTimeout(function(){ - node.firstChild.innerHTML='重置天梯数据'; - delete node._clearing; - },1000); - },1000); - },1000); - }, - clear:true, - }, - } - }, - connect:{ - name:'联机', - config:{ - connect_nickname:{ - name:'联机昵称', - input:true, - frequent:true, - }, - connect_avatar:{ - name:'联机头像', - init:'caocao', - item:{}, - frequent:true, - onclick:function(item){ - game.saveConfig('connect_avatar',item); - game.saveConfig('connect_avatar',item,'connect'); - } - }, - hall_ip:{ - name:'联机大厅', - input:true, - frequent:true, - }, - hall_button:{ - name:'联机大厅按钮', - init:true, - frequent:true, - onclick:function(bool){ - game.saveConfig('hall_button',bool,'connect'); - if(ui.hall_button){ - if(bool){ - ui.hall_button.style.display=''; - } - else{ - ui.hall_button.style.display='none'; - } - } - } - }, - room_button:{ - name:'创建服务器按钮', - init:false, - frequent:true, - intro:'开启后可创建一个空房间但不加入游戏', - onclick:function(bool){ - game.saveConfig('room_button',bool,'connect'); - if(ui.connectRoom){ - if(bool){ - ui.connectRoom.style.display=''; - } - else{ - ui.connectRoom.style.display='none'; - } - } - } - } - } - }, - 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.getParent().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; - } - } - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(!_status.event.getParent().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, - }, - single_control:{ - name:'单人控制', - init:true, - frequent:true, - onclick:function(bool){ - game.saveConfig('single_control',bool,this._link.config.mode); - if(ui.single_swap&&game.me!=game.boss){ - if(bool){ - ui.single_swap.style.display='none'; - } - else{ - ui.single_swap.style.display=''; - } - } - }, - intro:'只控制一名角色,其他角色由AI控制' - }, - // ban_weak:{ - // name:'屏蔽弱将', - // init:true, - // restart:true, - // }, - // ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - } - }, - doudizhu:{ - name:'斗地主', - connect:{ - update:function(config,map){}, - connect_double_character:{ - name:'双将模式', - init:false, - frequent:true, - restart:true, - }, - connect_change_card:{ - name:'启用手气卡', - init:false, - frequent:true, - restart:true, - }, - }, - config:{ - update:function(config,map){ - if(config.double_character){ - map.double_hp.show(); - } - else{ - map.double_hp.hide(); - } - }, - double_character:{ - name:'双将模式', - init:false, - frequent:true, - restart:true, - }, - double_hp:{ - name:'双将体力上限', - init:'pingjun', - item:{ - hejiansan:'和减三', - pingjun:'平均值', - zuidazhi:'最大值', - zuixiaozhi:'最小值', - zonghe:'相加', - }, - restart:true, - }, - free_choose:{ - name:'自由选将', - init:true, - onclick:function(bool){ - game.saveConfig('free_choose',bool,this._link.config.mode); - if(!_status.event.getParent().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; - } - } - }, - change_identity:{ - name:'自由选择身份和座位', - init:true, - onclick:function(bool){ - game.saveConfig('change_identity',bool,this._link.config.mode); - if(!_status.event.getParent().showConfig&&!_status.event.showConfig) return; - var dialog; - if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; - else dialog=_status.event.dialog; - if(!_status.brawl||!_status.brawl.noAddSetting){ - if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.getParent().addSetting(dialog); - else _status.event.getParent().removeSetting(dialog); - } - ui.update(); - } - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(!_status.event.getParent().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:'disabled', - item:{ - disabled:'禁用', - once:'一次', - twice:'两次', - unlimited:'无限', - }, - }, - 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&&!_status.brawl){ - ui.continue_game=ui.create.control('再战',game.reloadCurrent); - } - } - else if(ui.continue_game){ - ui.continue_game.close(); - delete ui.continue_game; - } - }, - intro:'游戏结束后可选择用相同的武将再进行一局游戏' - }, - 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()&&!_status.connectMode){ - ui.restart=ui.create.control('restart',game.reload); - } - } - else if(ui.restart){ - ui.restart.close(); - delete ui.restart; - } - } - }, - 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; - } - } - }, - choice_zhu:{ - name:'地主候选武将数', - init:'3', - restart:true, - item:{ - '3':'三', - '4':'四', - '5':'五', - '6':'六', - '8':'八', - '10':'十', - }, - }, - choice_fan:{ - name:'农民候选武将数', - init:'3', - restart:true, - item:{ - '3':'三', - '4':'四', - '5':'五', - '6':'六', - '8':'八', - '10':'十', - }, - }, - } - }, - single:{ - name:'单挑', - connect:{ - connect_single_mode:{ - name:'游戏模式', - init:'normal', - item:{ - normal:'新1v1', - dianjiang:'点将单挑', - changban:'血战长坂坡', - }, - restart:true, - frequent:true, - }, - update:function(config,map){}, - }, - config:{ - single_mode:{ - name:'游戏模式', - init:'normal', - item:{ - normal:'新1v1', - dianjiang:'点将单挑', - changban:'血战长坂坡', - }, - restart:true, - frequent:true, - }, - update:function(config,map){ - }, - } - }, - chess:{ - name:'战棋', - config:{ - chess_mode:{ - name:'游戏模式', - init:'combat', - item:{ - combat:'自由', - three:'统率', - leader:'君主', - }, - 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!='leader'){ - // map.ban_weak.show(); - // map.ban_strong.show(); - // } - // else{ - // map.ban_weak.hide(); - // map.ban_strong.hide(); - // } - }, - 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); - game.reload(); - return; - } - node._clearing=true; - node.firstChild.innerHTML='单击以确认 (3)'; - setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (2)'; - setTimeout(function(){ - node.firstChild.innerHTML='单击以确认 (1)'; - setTimeout(function(){ - node.firstChild.innerHTML='清除进度'; - delete node._clearing; - },1000); - },1000); - },1000); - }, - clear:true, - frequent:true, - }, - // chess_treasure:{ - // name:'战场机关', - // init:'0', - // frequent:true, - // item:{ - // '0':'关闭', - // '0.1':'较少出现', - // '0.2':'偶尔出现', - // '0.333':'时常出现', - // '0.5':'频繁出现', - // } - // }, - chess_obstacle:{ - name:'随机路障', - init:'0.2', - item:{ - '0':'关闭', - '0.2':'少量', - '0.333':'中量', - '0.5':'大量', - }, - frequent:true, - }, - show_range:{ - name:'显示卡牌范围', - init:true, - }, - show_distance:{ - name:'显示距离', - init: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.getParent().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; - } - }, - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(!_status.event.getParent().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:true, - // restart:true, - // }, - // ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - chessscroll_speed:{ - name:'边缘滚动速度', - init:'20', - intro:'鼠标移至屏幕边缘时自动滚屏', - item:{ - '0':'不滚动', - '10':'10格/秒', - '20':'20格/秒', - '30':'30格/秒', - } - }, - } - }, - tafang:{ - name:'塔防', - config:{ - tafang_turn:{ - name:'游戏胜利', - init:'10', - 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':'困难', - } - }, - show_range:{ - name:'显示卡牌范围', - init:true, - }, - show_distance:{ - name:'显示距离', - init:true, - }, - // ban_weak:{ - // name:'屏蔽弱将', - // init:true, - // restart:true, - // }, - // ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - chessscroll_speed:{ - name:'边缘滚动速度', - intro:'鼠标移至屏幕边缘时自动滚屏', - init:'20', - item:{ - '0':'不滚动', - '10':'10格/秒', - '20':'20格/秒', - '30':'30格/秒', - } - }, - } - }, - brawl:{ - name:'乱斗', - config:{ - huanhuazhizhan:{ - name:'幻化之战', - init:true, - frequent:true - }, - duzhansanguo:{ - name:'毒战三国', - init:true, - frequent:true - }, - daozhiyueying:{ - name:'导师月英', - init:true, - frequent:true - }, - weiwoduzun:{ - name:'唯我独尊', - init:true, - frequent:true - }, - tongxingzhizheng:{ - name:'同姓之争', - init:true, - frequent:true - }, - tongqueduopao:{ - name:'铜雀夺袍', - init:true, - frequent:true - }, - tongjiangmoshi:{ - name:'同将模式', - init:true, - frequent:true - }, - baiyidujiang:{ - name:'白衣渡江', - init:true, - frequent:true - }, - scene:{ - name:'创建场景', - init:true, - frequent:true - } - } - }, - stone:{ - name:'炉石', - config:{ - // update:function(config,map){ - // if(config.stone_mode=='deck'){ - // // map.deck_length.show(); - // // map.deck_repeat.show(); - // map.random_length.hide(); - // map.skill_bar.show(); - // } - // else{ - // // map.deck_length.hide(); - // // map.deck_repeat.hide(); - // map.random_length.show(); - // map.skill_bar.hide(); - // } - // }, - // stone_mode:{ - // name:'游戏模式', - // init:'deck', - // item:{ - // deck:'构筑', - // random:'随机' - // }, - // restart:true, - // frequent:true, - // }, - // deck_length:{ - // name:'卡组长度', - // init:'30', - // item:{ - // '30':'30张', - // '50':'50张', - // '80':'80张', - // }, - // frequent:true, - // }, - // deck_repeat:{ - // name:'重复卡牌', - // init:'2', - // item:{ - // '2':'2张', - // '3':'3张', - // '5':'5张', - // '80':'无限', - // }, - // frequent:true, - // }, - // random_length:{ - // name:'随从牌数量', - // init:'1/80', - // item:{ - // '1/120':'少', - // '1/80':'中', - // '1/50':'多', - // }, - // frequent:true, - // }, - battle_number:{ - name:'出场人数', - init:'1', - frequent:true, - item:{ - '1':'一人', - '2':'两人', - '3':'三人', - '4':'四人', - '6':'六人', - '8':'八人', - '10':'十人', - }, - onclick:function(num){ - game.saveConfig('battle_number',num,this._link.config.mode); - if(_status.connectMode) return; - if(!_status.event.getParent().showConfig&&!_status.event.showConfig) return; - if(_status.event.getParent().changeDialog){ - _status.event.getParent().changeDialog(); - } - }, - }, - mana_mode:{ - name:'行动值变化', - init:'inc', - item:{ - inf:'涨落', - inc:'递增' - }, - frequent:true - }, - skill_bar:{ - name:'怒气值', - init:true, - frequent:true, - restart:true, - }, - double_character:{ - name:'双将模式', - init:false, - frequent:true, - restart:function(){ - return _status.event.getParent().name!='chooseCharacter'||_status.event.name!='chooseButton'; - } - }, - free_choose:{ - name:'自由选将', - init:true, - onclick:function(bool){ - game.saveConfig('free_choose',bool,this._link.config.mode); - if(_status.connectMode) return; - if(!_status.event.getParent().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; - } - }, - }, - change_choice:{ - name:'开启换将卡', - init:true, - onclick:function(bool){ - game.saveConfig('change_choice',bool,this._link.config.mode); - if(_status.connectMode) return; - if(!_status.event.getParent().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:true, - // restart:true, - // }, - // ban_strong:{ - // name:'屏蔽强将', - // init:false, - // restart:true, - // }, - } - }, - }, - status:{ - running:false, - canvas:false, - time:0, - reload:0, - delayed:0, - frameId:0, - videoId:0, - globalId:0, - }, - help:{ - '游戏操作':'
  • 长按/鼠标悬停/右键单击显示信息
  • 触屏模式中,双指点击切换暂停;下划显示菜单,上划切换托管
  • 键盘快捷键
    '+ - '
    A切换托管
    W切换不询问无懈
    空格暂停
  • 编辑牌堆
    在卡牌包中修改牌堆后,将自动创建一个临时牌堆,在所有模式中共用,当保存当前牌堆后,临时牌堆被清除。每个模式可设置不同的已保存牌堆,设置的牌堆优先级大于临时牌堆
', - '游戏命令':'
变量名
  • 场上角色
    game.players
  • 阵亡角色
    game.dead'+ - '
  • 玩家
    game.me
  • 玩家的上/下家
    game.me.previous/next'+ - '
  • 玩家的上/下家(含阵亡)
    game.me.previousSeat/
    nextSeat'+ - '
  • 牌堆
    ui.cardPile
  • 弃牌堆
    ui.discardPile
'+ - '
角色属性
  • 体力值
    player.hp'+ - '
  • 体力上限
    player.maxHp
  • 身份
    player.identity
  • 手牌
    player.getCards("h")
  • 装备牌
    player.getCards("e")
  • 判定牌
    player.getCards("j")'+ - '
  • 是否存活/横置/翻面
    player.isAlive()/
    isLinked()/
    isTurnedOver()
'+ - '
角色操作
  • 受到伤害
    player.damage(source,
    num)'+ - '
  • 回复体力
    player.recover(num)
  • 摸牌
    player.draw(num)
  • 获得牌
    player.gain(cards)
  • 弃牌
    player.discard(cards)'+ - '
  • 使用卡牌
    player.useCard(card,
    targets)
  • 死亡
    player.die()
  • 复活
    player.revive(hp)
'+ - '
游戏操作
  • 在命令框中输出结果
    game.print(str)
  • 清除命令框中的内容
    cls
  • 上一条/下一条输入的内容
    up/down
  • 游戏结束
    game.over(bool)'+ - '
  • 角色资料
    lib.character
  • 卡牌资料
    lib.card
', - '游戏名词':'
  • 护甲:和体力类似,每点护甲可抵挡一点伤害,但不影响手牌上限'+ - '
  • 随从:通过技能获得,拥有独立的技能、手牌区和装备区(共享判定区),出场时替代主武将的位置;随从死亡时自动切换回主武将'+ - '
  • 发现:从三张随机亮出的牌中选择一张,若无特殊说明,则获得此牌'+ - '
  • 蓄力技:发动时可以增大黄色的数字。若如此做,红色数字于技能的结算过程中改为原来的两倍' - }, - setIntro:function(node,func,left){ - if(lib.config.touchscreen){ - if(left){ - node.listen(ui.click.touchintro); - } - else{ - lib.setLongPress(node,ui.click.intro); - } - } - else{ - if(left){ - node.listen(ui.click.intro); - } - if(lib.config.hover_all){ - lib.setHover(node,ui.click.hoverplayer); - } - if(lib.config.right_info){ - node.oncontextmenu=ui.click.rightplayer; - } - } - // if(!left){ - // lib.setPressure(node,ui.click.rightpressure); - // } - if(func){ - node._customintro=func; - } - }, - // setPressure:function(node,func){ - // if(window.Pressure){ - // window.Pressure.set(node,{change: func}, {polyfill: false}); - // } - // }, - setPopped:function(node,func,width,height,forceclick,paused2){ - node._poppedfunc=func; - node._poppedwidth=width; - node._poppedheight=height; - if(forceclick){ - node.forceclick=true; - } - if(lib.config.touchscreen||forceclick){ - node.listen(ui.click.hoverpopped); - } - else{ - node.addEventListener('mouseenter',ui.click.hoverpopped); - // node.addEventListener('mouseleave',ui.click.hoverpopped_leave); - } - if(paused2){ - node._paused2=true; - } - }, - placePoppedDialog:function(dialog,e){ - if(dialog._place_text){ - if(dialog._place_text.firstChild.offsetWidth>=190|| - dialog._place_text.firstChild.offsetHeight>=30){ - dialog._place_text.style.textAlign='left'; - dialog._place_text.style.marginLeft='14px'; - } - } - if(e.touches&&e.touches[0]){ - e=e.touches[0]; - } - var height=Math.min(ui.window.offsetHeight-20,dialog.content.scrollHeight); - if(dialog._mod_height){ - height+=dialog._mod_height; - } - dialog.style.height=height+'px'; - if(e.clientX/game.documentZoomui.window.offsetHeight){ - idealtop=ui.window.offsetHeight-10-dialog.offsetHeight; - } - dialog.style.top=idealtop+'px'; - }, - setHover:function(node,func,hoveration,width){ - node._hoverfunc=func; - if(typeof hoveration=='number'){ - node._hoveration=hoveration; - } - if(typeof width=='number'){ - node._hoverwidth=width - } - node.addEventListener('mouseenter',ui.click.mouseenter); - node.addEventListener('mouseleave',ui.click.mouseleave); - node.addEventListener('mousedown',ui.click.mousedown); - node.addEventListener('mousemove',ui.click.mousemove); - return node; - }, - setScroll:function(node){ - node.ontouchstart=ui.click.touchStart; - node.ontouchmove=ui.click.touchScroll; - node.style.WebkitOverflowScrolling='touch'; - return node; - }, - setMousewheel:function(node){ - if(lib.config.mousewheel) node.onmousewheel=ui.click.mousewheel; - }, - setLongPress:function(node,func){ - node.addEventListener('touchstart',ui.click.longpressdown); - node.addEventListener('touchend',ui.click.longpresscancel); - node._longpresscallback=func; - return node; - }, - updateCanvas:function(time){ - if(lib.canvasUpdates.length===0){ - lib.status.canvas=false; - return false; - } - ui.canvas.width=ui.arena.offsetWidth; - ui.canvas.height=ui.arena.offsetHeight; - var ctx=ui.ctx; - ctx.shadowBlur=5; - ctx.shadowColor='rgba(0,0,0,0.3)'; - ctx.strokeStyle='white'; - // ctx.lineCap='round'; - ctx.lineWidth=3; - ctx.save(); - for(var i=0;i0) top+='+ '+position[1]+'px)'; - else top+='- '+Math.abs(position[1])+'px)'; - var left='calc('+position[2]+'% '; - if(position[3]>0) left+='+ '+position[3]+'px)'; - else left+='- '+Math.abs(position[3])+'px)'; - this.style.top=top; - this.style.left=left; - return this; - }; - HTMLDivElement.prototype.css=function(style){ - for(var i in style){ - if(i=='innerHTML'){ - this.innerHTML=style[i]; - } - else{ - this.style[i]=style[i]; - } - } - return this; - }; - HTMLTableElement.prototype.get=function(row,col){ - if(rowthis.length){ - num=this.length; - } - var arr=this.slice(0); - var list=[]; - for(var i=0;i.dialog.popped:not(.static)'); - for(var i=0;i.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("'+lib.assetURL+'theme/style/player/'+bstyle+'1.png")}',0); - ui.css.border_stylesheet.sheet.insertRule('#window #arena.long:not(.fewplayer) .player>.framebg, #arena.oldlayout .player>.framebg{background-image:url("'+lib.assetURL+'theme/style/player/'+bstyle+'3.png")}',0); - ui.css.border_stylesheet.sheet.insertRule('.player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}',0); - } - if(lib.config.control_style&&lib.config.control_style!='default'&&lib.config.control_style!='custom'){ - var str=''; - switch(lib.config.control_style){ - case 'wood':str='url("'+lib.assetURL+'theme/woodden/wood.jpg")';break; - case 'music':str='linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px';break; - case 'simple':str='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px';break; - } - if(lib.config.control_style=='wood'){ - ui.css.control_stylesheet=lib.init.sheet('#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:'+str+'}'); - } - else{ - ui.css.control_stylesheet=lib.init.sheet('#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:'+str+'}'); - } - } - if(lib.config.menu_style&&lib.config.menu_style!='default'&&lib.config.menu_style!='custom'){ - var str=''; - switch(lib.config.menu_style){ - case 'wood':str='url("'+lib.assetURL+'theme/woodden/wood2.png")';break; - case 'music':str='linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px';break; - case 'simple':str='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px';break; - } - ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:'+str+'}'); - } - - lib.config.duration=500; - - if(!lib.config.touchscreen){ - document.addEventListener('mousewheel',ui.click.windowmousewheel,{passive:true}); - document.addEventListener('mousemove',ui.click.windowmousemove); - document.addEventListener('mousedown',ui.click.windowmousedown); - document.addEventListener('mouseup',ui.click.windowmouseup); - document.addEventListener('contextmenu',ui.click.right); - } - else{ - document.addEventListener('touchstart',ui.click.touchconfirm); - document.addEventListener('touchstart',ui.click.windowtouchstart); - document.addEventListener('touchend',ui.click.windowtouchend); - document.addEventListener('touchmove',ui.click.windowtouchmove); - } - }; - var proceed2=function(){ - if(config3){ - proceed(config3); - } - else{ - config3=true; - } - }; - - ui.css={menu:lib.init.css(lib.assetURL+'layout/default','menu',function(){ - ui.css.default=lib.init.css(lib.assetURL+'layout/default','layout'); - proceed2(); - })}; - - if(lib.device){ - lib.init.cordovaReady=function(){ - if(lib.device=='android'){ - document.addEventListener("pause", function(){ - if(!_status.paused2&&!_status.event.isMine()){ - ui.click.pause(); - } - if(ui.backgroundMusic){ - ui.backgroundMusic.pause(); - } - }); - document.addEventListener("resume", function(){ - if(ui.backgroundMusic){ - ui.backgroundMusic.play(); - } - }); - document.addEventListener("backbutton", function(){ - if(ui.arena&&ui.arena.classList.contains('menupaused')){ - if(window.saveNonameInput){ - window.saveNonameInput(); - } - else{ - ui.click.configMenu(); - } - } - else if(lib.config.confirm_exit){ - navigator.notification.confirm( - '是否退出游戏?', - function(index){ - switch(index){ - case 2:game.saveConfig('null');game.reload();break; - case 3:navigator.app.exitApp();break; - } - }, - '确认退出', - ['取消','重新开始','退出'] - ); - } - else{ - navigator.app.exitApp(); - } - }); - } - game.download=function(url,folder,onsuccess,onerror,dev,onprogress){ - if(url.indexOf('http')!=0){ - url=get.url(dev)+url; - } - var fileTransfer = new FileTransfer(); - folder=lib.assetURL+folder; - if(onprogress){ - fileTransfer.onprogress=function(progressEvent){ - onprogress(progressEvent.loaded,progressEvent.total); - }; - } - lib.config.brokenFile.add(folder); - game.saveConfigValue('brokenFile'); - fileTransfer.download(encodeURI(url),encodeURI(folder),function(){ - lib.config.brokenFile.remove(folder); - game.saveConfigValue('brokenFile'); - if(onsuccess){ - onsuccess(); - } - },onerror); - }; - game.readFile=function(filename,callback,onerror){ - window.resolveLocalFileSystemURL(lib.assetURL,function(entry){ - entry.getFile(filename,{},function(fileEntry){ - fileEntry.file(function(fileToLoad){ - var fileReader = new FileReader(); - fileReader.onload = function(e){ - callback(e.target.result); - }; - fileReader.readAsArrayBuffer(fileToLoad, "UTF-8"); - },onerror); - },onerror); - },onerror); - }; - game.writeFile=function(data,path,name,callback){ - game.ensureDirectory(path,function(){}); - if(Object.prototype.toString.call(data)=='[object File]'){ - var fileReader = new FileReader(); - fileReader.onload = function(e){ - game.writeFile(e.target.result,path,name,callback); - }; - fileReader.readAsArrayBuffer(data, "UTF-8"); - } - else{ - window.resolveLocalFileSystemURL(lib.assetURL+path,function(entry){ - entry.getFile(name,{create:true},function(fileEntry){ - fileEntry.createWriter(function(fileWriter){ - fileWriter.onwriteend=callback; - fileWriter.write(data); - }); - }); - }); - } - }; - game.removeFile=function(dir,callback){ - window.resolveLocalFileSystemURL(lib.assetURL,function(entry){ - entry.getFile(dir,{},function(fileEntry){ - fileEntry.remove(); - if(callback){ - callback(); - } - }); - }); - }; - game.getFileList=function(dir,callback){ - var files=[],folders=[]; - window.resolveLocalFileSystemURL(lib.assetURL+dir,function(entry){ - var dirReader=entry.createReader(); - var entries=[]; - var readEntries=function(){ - dirReader.readEntries(function(results){ - if(!results.length){ - entries.sort(); - for(var i=0;i 10 || - Math.abs(e.touches[0].clientY/game.documentZoom - this.startY) > 10) { - _status.dragged=true; - } - }); - } - - if(lib.config.image_background.indexOf('custom_')==0){ - ui.background.style.backgroundImage="none"; - game.getDB('image',lib.config.image_background,function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent) - { - var data = fileLoadedEvent.target.result; - ui.background.style.backgroundImage='url('+data+')'; - if(lib.config.image_background_blur){ - ui.background.style.filter='blur(8px)'; - ui.background.style.webkitFilter='blur(8px)'; - ui.background.style.transform='scale(1.05)'; - } - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.card_style=='custom'){ - game.getDB('image','card_style',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.card_stylesheet){ - ui.css.card_stylesheet.remove(); - } - ui.css.card_stylesheet=lib.init.sheet('.card:not(*:empty){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.cardback_style=='custom'){ - game.getDB('image','cardback_style',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.cardback_stylesheet){ - ui.css.cardback_stylesheet.remove(); - } - ui.css.cardback_stylesheet=lib.init.sheet('.card:empty,.card.infohidden{background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','cardback_style2',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.cardback_stylesheet2){ - ui.css.cardback_stylesheet2.remove(); - } - ui.css.cardback_stylesheet2=lib.init.sheet('.card.infohidden:not(.infoflip){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.hp_style=='custom'){ - game.getDB('image','hp_style1',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet1){ - ui.css.hp_stylesheet1.remove(); - } - ui.css.hp_stylesheet1=lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="high"]>div:not(.lost){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','hp_style2',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet2){ - ui.css.hp_stylesheet2.remove(); - } - ui.css.hp_stylesheet2=lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','hp_style3',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet3){ - ui.css.hp_stylesheet3.remove(); - } - ui.css.hp_stylesheet3=lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - game.getDB('image','hp_style4',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.hp_stylesheet4){ - ui.css.hp_stylesheet4.remove(); - } - ui.css.hp_stylesheet4=lib.init.sheet('.hp:not(.text):not(.actcount)>.lost{background-image:url('+fileLoadedEvent.target.result+')}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.player_style=='custom'){ - ui.css.player_stylesheet=lib.init.sheet('#window .player{background-image:none;background-size:100% 100%;}'); - game.getDB('image','player_style',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.player_stylesheet){ - ui.css.player_stylesheet.remove(); - } - ui.css.player_stylesheet=lib.init.sheet('#window .player{background-image:url("'+fileLoadedEvent.target.result+'");background-size:100% 100%;}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.border_style=='custom'){ - game.getDB('image','border_style',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.border_stylesheet){ - ui.css.border_stylesheet.remove(); - } - ui.css.border_stylesheet=lib.init.sheet(); - ui.css.border_stylesheet.sheet.insertRule('#window .player>.framebg{display:block;background-image:url("'+fileLoadedEvent.target.result+'")}',0); - ui.css.border_stylesheet.sheet.insertRule('.player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}',0); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.control_style=='custom'){ - game.getDB('image','control_style',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.control_stylesheet){ - ui.css.control_stylesheet.remove(); - } - ui.css.control_stylesheet=lib.init.sheet('#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:url("'+fileLoadedEvent.target.result+'")}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - if(lib.config.menu_style=='custom'){ - game.getDB('image','menu_style',function(fileToLoad){ - if(!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent){ - if(ui.css.menu_stylesheet){ - ui.css.menu_stylesheet.remove(); - } - ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:url("'+fileLoadedEvent.target.result+'");background-size:cover}'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - - var proceed2=function(){ - var mode=lib.imported.mode; - var card=lib.imported.card; - var character=lib.imported.character; - var play=lib.imported.play; - delete window.game; - var i,j,k; - for(i in mode[lib.config.mode].element){ - if(!lib.element[i]) lib.element[i]=[]; - for(j in mode[lib.config.mode].element[i]){ - if(j=='init'){ - if(!lib.element[i].inits) lib.element[i].inits=[]; - lib.element[i].inits.push(mode[lib.config.mode].element[i][j]); - } - else{ - lib.element[i][j]=mode[lib.config.mode].element[i][j]; - } - } - } - for(i in mode[lib.config.mode].ai){ - if(typeof mode[lib.config.mode].ai[i]=='object'){ - if(ai[i]==undefined) ai[i]={}; - for(j in mode[lib.config.mode].ai[i]){ - ai[i][j]=mode[lib.config.mode].ai[i][j]; - } - } - else{ - ai[i]=mode[lib.config.mode].ai[i]; - } - } - for(i in mode[lib.config.mode].ui){ - if(typeof mode[lib.config.mode].ui[i]=='object'){ - if(ui[i]==undefined) ui[i]={}; - for(j in mode[lib.config.mode].ui[i]){ - ui[i][j]=mode[lib.config.mode].ui[i][j]; - } - } - else{ - ui[i]=mode[lib.config.mode].ui[i]; - } - } - for(i in mode[lib.config.mode].game){ - game[i]=mode[lib.config.mode].game[i]; - } - for(i in mode[lib.config.mode].get){ - get[i]=mode[lib.config.mode].get[i]; - } - lib.init.start=mode[lib.config.mode].start; - lib.init.startBefore=mode[lib.config.mode].startBefore; - if(game.onwash){ - lib.onwash.push(game.onwash); - delete game.onwash; - } - if(game.onover){ - lib.onover.push(game.onover); - delete game.onover; - } - lib.config.banned=lib.config[lib.config.mode+'_banned']||[]; - lib.config.bannedcards=lib.config[lib.config.mode+'_bannedcards']||[]; - - lib.rank=window.noname_character_rank; - delete window.noname_character_rank; - for(i in mode[lib.config.mode]){ - if(i=='element') continue; - if(i=='game') continue; - if(i=='ai') continue; - if(i=='ui') continue; - if(i=='get') continue; - if(i=='config') continue; - if(i=='onreinit') continue; - if(i=='start') continue; - if(i=='startBefore') continue; - if(lib[i]==undefined) lib[i]=(Array.isArray(mode[lib.config.mode][i]))?[]:{}; - for(j in mode[lib.config.mode][i]){ - lib[i][j]=mode[lib.config.mode][i][j]; - } - } - if(typeof mode[lib.config.mode].init=='function'){ - mode[lib.config.mode].init(); - } - - var connectCharacterPack=[]; - var connectCardPack=[]; - for(i in character){ - if(character[i].character){ - lib.characterPack[i]=character[i].character - } - for(j in character[i]){ - if(j=='mode'||j=='forbid') continue; - if(j=='connect'){ - connectCharacterPack.push(i); - continue; - } - if(j=='character'&&!lib.config.characters.contains(i)&&lib.config.mode!='connect'){ - if(lib.config.mode=='chess'&&get.config('chess_mode')=='leader'){ - for(k in character[i][j]){ - lib.hiddenCharacters.push(k); - } - } - else if(lib.config.mode!='boss'||i!='boss'){ - continue; - } - } - if(Array.isArray(lib[j])&&Array.isArray(character[i][j])){ - lib[j].addArray(character[i][j]); - continue; - } - for(k in character[i][j]){ - if(j=='character'){ - if(!character[i][j][k][4]){ - character[i][j][k][4]=[]; - } - if(character[i][j][k][4].contains('boss')|| - character[i][j][k][4].contains('hiddenboss')){ - lib.config.forbidai.add(k); - } - if(lib.config.forbidai_user&&lib.config.forbidai_user.contains(k)){ - lib.config.forbidai.add(k); - } - for(var l=0;l.name,#arena .button.character>.name {font-family: '+(lib.config.name_font||'xinwei')+',xinwei}',0); - ui.css.styles.sheet.insertRule('#arena .player .identity>div {font-family: '+(lib.config.identity_font||'huangcao')+',xinwei}',0); - ui.css.styles.sheet.insertRule('.button.character.newstyle>.identity {font-family: '+(lib.config.identity_font||'huangcao')+',xinwei}',0); - if(lib.config.cardtext_font&&lib.config.cardtext_font!='default'){ - ui.css.styles.sheet.insertRule('.card div:not(.info):not(.background) {font-family: '+lib.config.cardtext_font+';}',0); - } - if(lib.config.global_font&&lib.config.global_font!='default'){ - ui.css.styles.sheet.insertRule('#window {font-family: '+lib.config.global_font+',xinwei}',0); - ui.css.styles.sheet.insertRule('#window #control{font-family: STHeiti,SimHei,Microsoft JhengHei,Microsoft YaHei,WenQuanYi Micro Hei,Helvetica,Arial,sans-serif}',0); - } - switch(lib.config.glow_phase){ - case 'yellow':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgb(217, 152, 62) 0 0 15px, rgb(217, 152, 62) 0 0 15px !important;}',0);break; - case 'green':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(10, 155, 67, 1) 0 0 15px, rgba(10, 155, 67, 1) 0 0 15px !important;}',0);break; - case 'purple':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgb(189, 62, 170) 0 0 15px, rgb(189, 62, 170) 0 0 15px !important;}',0);break; - } - }, - layout:function(layout,nosave){ - if(!nosave) game.saveConfig('layout',layout); - game.layout=layout; - ui.arena.hide(); - setTimeout(function(){ - if(game.layout=='default'){ - ui.css.layout.href=''; - } - else{ - ui.css.layout.href=lib.assetURL+'layout/'+game.layout+'/layout.css'; - } - if(game.layout=='mobile'||game.layout=='long'){ - ui.arena.classList.add('mobile'); - } - else{ - ui.arena.classList.remove('mobile'); - } - if(game.layout=='mobile'||game.layout=='long'||game.layout=='long2'||game.layout=='nova'){ - if(game.me&&game.me.node.handcards2.childNodes.length){ - while(game.me.node.handcards2.childNodes.length){ - game.me.node.handcards1.appendChild(game.me.node.handcards2.firstChild); - } - } - } - if(game.layout=='default'){ - ui.arena.classList.add('oldlayout'); - } - else{ - ui.arena.classList.remove('oldlayout'); - } - if(lib.config.cardshape=='oblong'&&(game.layout=='long'||game.layout=='mobile'||game.layout=='long2'||game.layout=='nova')){ - ui.arena.classList.add('oblongcard'); - ui.window.classList.add('oblongcard'); - } - else{ - ui.arena.classList.remove('oblongcard'); - ui.window.classList.remove('oblongcard'); - } - if(lib.config.textequip=='text'&&(game.layout=='long'||game.layout=='mobile')){ - ui.arena.classList.add('textequip'); - } - else{ - ui.arena.classList.remove('textequip'); - } - if(get.is.phoneLayout()){ - ui.css.phone.href=lib.assetURL+'layout/default/phone.css'; - ui.arena.classList.add('phone'); - } - else{ - ui.css.phone.href=''; - ui.arena.classList.remove('phone'); - } - for(var i=0;i>6, 0x80 | cc&0x3f); - }); - strUtf = strUtf.replace( - /[\u0800-\uffff]/g,function(c) { - var cc = c.charCodeAt(0); - return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); - }); - return btoa(strUtf); - }, - decode:function(str){ - var strUtf=atob(str); - var strUni = strUtf.replace( - /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(c) { - var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f); - return String.fromCharCode(cc); - }); - strUni = strUni.replace( - /[\u00c0-\u00df][\u0080-\u00bf]/g,function(c){ - var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f; - return String.fromCharCode(cc); - }); - return strUni; - }, - stringify:function(obj){ - var str='{' - for(var i in obj){ - str+='"'+i+'":' - if(Object.prototype.toString.call(obj[i])=='[object Object]'){ - str+=lib.init.stringify(obj[i]); - } - else if(typeof obj[i]=='function'){ - str+=obj[i].toString(); - } - else{ - str+=JSON.stringify(obj[i]); - } - str+=',' - } - str+='}'; - return str; - }, - stringifySkill:function(obj){ - var str=''; - for(var i in obj){ - str+=i+':' - if(Object.prototype.toString.call(obj[i])=='[object Object]'){ - str+='{\n'+lib.init.stringifySkill(obj[i])+'}'; - } - else if(typeof obj[i]=='function'){ - str+=obj[i].toString().replace(/\t/g,''); - } - else{ - str+=JSON.stringify(obj[i]); - } - str+=',\n' - } - return str; - } - }, - cheat:{ - i:function(){ - window.cheat=lib.cheat; - window.game=game; - window.ui=ui; - window.get=get; - window.ai=ai; - window.lib=lib; - window._status=_status; - }, - dy:function(){ - var next=game.me.next; - for(var i=0;i<10;i++){ - if(next.identity!='zhu'){ - break; - } - next=next.next; - } - next.die(); - }, - x:function(){ - var gl=function(dir,callback){ - var files=[],folders=[]; - dir='/Users/widget/Documents/extension/'+dir; - lib.node.fs.readdir(dir,function(err,filelist){ - for(var i=0;i1){ - for(var i=0;i0&&typeof arguments[i]=='number'){ - for(var j=0;j0; - }; - } - } - else{ - var next=player.chooseTarget(); - next.set('_get_card',card); - next.set('filterTarget',function(card,player,target){ - if(!_status.event.targets.contains(target)) return false; - return lib.filter[_status.event.nodistance?'targetEnabled':'filterTarget'].apply(this,arguments); - }); - next.set('ai',event.ai||get.effect); - next.set('selectTarget',event.selectTarget||lib.filter.selectTarget); - if(event.nodistance) next.set('nodistance',true); - if(event.forced) next.set('forced',true); - next.set('targets',targets); - next.set('prompt',event.prompt||('选择'+get.translation(card)+'的目标')); - if(event.prompt2) next.set('prompt2',event.prompt2); - } - 'step 1' - if(result.bool){ - event.result={ - bool:true, - targets:event.targets2||result.targets, - }; - if(event.logSkill){ - if(typeof event.logSkill=='string'){ - player.logSkill(event.logSkill); - } - else if(Array.isArray(event.logSkill)){ - player.logSkill.apply(player,event.logSkill); - } - } - var next=player.useCard(card,event.targets2||result.targets); - if(cards) next.cards=cards.slice(0); - if(event.nopopup) next.nopopup=true; - if(event.animate===false) next.animate=false; - if(event.addCount===false) next.addCount=false; - if(event.noTargetDelay) next.targetDelay=false; - if(event.nodelayx) next.delayx=false; - } - }, - chooseToDuiben:function(){ - 'step 0' - game.log(player,'对',target,'发起了','#y对策'); - if(_status.connectMode){ - player.chooseButtonOL([ - [player,['对策:请选择一种防御对策',[[['','','db_def2'],['','','db_def1']],'vcard']],true], - [target,['对策:请选择一种进攻之策',[[['','','db_atk1'],['','','db_atk2']],'vcard']],true] - ],function(){},function(){return 1+Math.random()}).set('switchToAuto',function(){ - _status.event.result='ai'; - }).set('processAI',function(){ - var buttons=_status.event.dialog.buttons; - return { - bool:true, - links:[buttons.randomGet().link], - } - }); - } - 'step 1' - if(_status.connectMode){ - event.mes=result[player.playerid].links[0][2]; - event.tes=result[target.playerid].links[0][2]; - event.goto(4); - } - else{ - player.chooseButton(['对策:请选择一种防御对策',[[['','','db_def2'],['','','db_def1']],'vcard']],true).ai=function(){return 1+Math.random()}; - } - 'step 2' - event.mes=result.links[0][2]; - target.chooseButton(['对策:请选择一种进攻之策',[[['','','db_atk1'],['','','db_atk2']],'vcard']],true).ai=function(){return 1+Math.random()}; - 'step 3' - event.tes=result.links[0][2]; - 'step 4' - game.broadcast(function(){ - ui.arena.classList.add('thrownhighlight'); - }); - ui.arena.classList.add('thrownhighlight'); - game.addVideo('thrownhighlight1'); - target.$compare(game.createCard(event.tes,'',''),player,game.createCard(event.mes,'','')); - game.log(target,'选择的进攻之策为','#g'+get.translation(event.tes)); - game.log(player,'选择的防御对策为','#g'+get.translation(event.mes)); - game.delay(0,1500); - 'step 5' - var mes=event.mes.slice(6); - var tes=event.tes.slice(6); - var str; - if(mes==tes){ - str=get.translation(player)+'对策成功'; - player.popup('胜','wood'); - target.popup('负','fire'); - game.log(player,'#g胜'); - event.result={bool:true}; - } - else{ - str=get.translation(player)+'对策失败'; - target.popup('胜','wood'); - player.popup('负','fire'); - game.log(target,'#g胜'); - event.result={bool:false}; - } - game.broadcastAll(function(str){ - var dialog=ui.create.dialog(str); - dialog.classList.add('center'); - setTimeout(function(){ - dialog.close(); - },1000); - },str); - game.delay(2); - 'step 6' - game.broadcastAll(function(){ - ui.arena.classList.remove('thrownhighlight'); - }); - game.addVideo('thrownhighlight2'); - if(event.clear!==false){ - game.broadcastAll(ui.clear); - } - }, - chooseToPSS:function(){ - 'step 0' - game.log(player,'对',target,'发起了猜拳'); - if(_status.connectMode){ - player.chooseButtonOL([ - [player,['猜拳:请选择一种手势',[[['','','pss_stone'],['','','pss_scissor'],['','','pss_paper']],'vcard']],true], - [target,['猜拳:请选择一种手势',[[['','','pss_stone'],['','','pss_scissor'],['','','pss_paper']],'vcard']],true] - ],function(){},function(){return 1+Math.random()}).set('switchToAuto',function(){ - _status.event.result='ai'; - }).set('processAI',function(){ - var buttons=_status.event.dialog.buttons; - return { - bool:true, - links:[buttons.randomGet().link], - } - }); - } - 'step 1' - if(_status.connectMode){ - event.mes=result[player.playerid].links[0][2]; - event.tes=result[target.playerid].links[0][2]; - event.goto(4); - } - else{ - player.chooseButton(['猜拳:请选择一种手势',[[['','','pss_stone'],['','','pss_scissor'],['','','pss_paper']],'vcard']],true).ai=function(){return 1+Math.random()}; - } - 'step 2' - event.mes=result.links[0][2]; - target.chooseButton(['猜拳:请选择一种手势',[[['','','pss_stone'],['','','pss_scissor'],['','','pss_paper']],'vcard']],true).ai=function(){return 1+Math.random()}; - 'step 3' - event.tes=result.links[0][2]; - 'step 4' - game.broadcast(function(){ - ui.arena.classList.add('thrownhighlight'); - }); - ui.arena.classList.add('thrownhighlight'); - game.addVideo('thrownhighlight1'); - player.$compare(game.createCard(event.mes,'',''),target,game.createCard(event.tes,'','')); - game.log(player,'选择的手势为','#g'+get.translation(event.mes)); - game.log(target,'选择的手势为','#g'+get.translation(event.tes)); - game.delay(0,1500); - 'step 5' - var mes=event.mes.slice(4); - var tes=event.tes.slice(4); - var str; - if(mes==tes){ - str='二人平局'; - player.popup('平','metal'); - target.popup('平','metal'); - game.log('猜拳的结果为','#g平局'); - event.result={tie:true}; - } - else{ - if({paper:'stone',scissor:'paper',stone:'scissor'}[mes]==tes){ - str=get.translation(player)+'胜利'; - player.popup('胜','wood'); - target.popup('负','fire'); - game.log(player,'#g胜'); - event.result={bool:true}; - } - else{ - str=get.translation(target)+'胜利'; - target.popup('胜','wood'); - player.popup('负','fire'); - game.log(target,'#g胜'); - event.result={bool:false}; - } - } - game.broadcastAll(function(str){ - var dialog=ui.create.dialog(str); - dialog.classList.add('center'); - setTimeout(function(){ - dialog.close(); - },1000); - },str); - game.delay(2); - 'step 6' - game.broadcastAll(function(){ - ui.arena.classList.remove('thrownhighlight'); - }); - game.addVideo('thrownhighlight2'); - if(event.clear!==false){ - game.broadcastAll(ui.clear); - } - }, - cardsDiscard:function(){ - game.getGlobalHistory().cardMove.push(event); - for(var i=0;igame.players.length*num&&game.showIdentity){ - if(!_status.video) player.popup('显示身份'); - _status.identityShown=true; - game.showIdentity(false); - } - } - player.ai.tempIgnore=[]; - _status.globalHistory.push({ - cardMove:[], - custom:[], - }); - game.countPlayer2(function(current){ - current.actionHistory.push({useCard:[],respond:[],skipped:[],lose:[],gain:[],sourceDamage:[],damage:[],custom:[]}); - current.stat.push({card:{},skill:{}}); - }); - if(ui.land&&ui.land.player==player){ - game.addVideo('destroyLand'); - ui.land.destroy(); - } - 'step 1' - event.trigger('phaseBeginStart'); - }, - toggleSubPlayer:function(){ - 'step 0' - var list=event.list||player.storage.subplayer.skills.slice(0); - list.remove(player.storage.subplayer.name2); - event.list=list; - if(!event.directresult){ - if(list.length>1){ - var dialog=ui.create.dialog('更换一个随从','hidden'); - dialog.add([list,'character']); - player.chooseButton(dialog,true); - } - else if(list.length==1){ - event.directresult=list[0]; - } - else{ - event.finish(); - } - } - else{ - if(!list.contains(event.directresult)){ - event.finish(); - } - } - 'step 1' - if(!event.directresult){ - if(result&&result.bool&&result.links[0]){ - event.directresult=result.links[0]; - } - else{ - event.finish(); - return; - } - } - if(player.storage.subplayer){ - var current=player.storage.subplayer.name2; - if(event.directresult==current){ - event.finish(); - return; - } - player.storage[current].hp=player.hp; - player.storage[current].maxHp=player.maxHp; - player.storage[current].hs=player.getCards('h'); - player.storage[current].es=player.getCards('e'); - player.lose(player.getCards('he'),ui.special)._triggered=null; - - var cfg=player.storage[event.directresult]; - player.storage.subplayer.name2=event.directresult; - player.reinit(current,event.directresult,[ - cfg.hp, - cfg.maxHp - ]); - if(cfg.hs.length) player.directgain(cfg.hs); - if(cfg.es.length) player.directequip(cfg.es); - } - }, - exitSubPlayer:function(){ - 'step 0' - if(player.storage.subplayer){ - var current=player.storage.subplayer.name2; - if(event.remove){ - player.lose(player.getCards('he'),ui.discardPile)._triggered=null; - } - else{ - player.storage[current].hp=player.hp; - player.storage[current].maxHp=player.maxHp; - player.storage[current].hs=player.getCards('h'); - player.storage[current].es=player.getCards('e'); - player.lose(player.getCards('he'),ui.special)._triggered=null; - } - player.reinit(current,player.storage.subplayer.name,[ - player.storage.subplayer.hp, - player.storage.subplayer.maxHp - ]); - player.update(); - if(event.remove){ - if(player.storage[current].onremove){ - player.storage[current].onremove(player); - } - delete player.storage[current]; - player.storage.subplayer.skills.remove(current); - game.log(player,'牺牲了随从','#g'+current); - } - else{ - game.log(player,'收回了随从','#g'+current); - } - player.addSkill(player.storage.subplayer.skills); - } - 'step 1' - if(player.storage.subplayer){ - player.directgain(player.storage.subplayer.hs); - player.directequip(player.storage.subplayer.es); - } - player.removeSkill('subplayer'); - 'step 2' - if(event.remove){ - event.trigger('subPlayerDie'); - } - }, - callSubPlayer:function(){ - 'step 0' - var list=player.getSubPlayers(event.tag); - event.list=list; - if(!event.directresult){ - if(list.length>1){ - var dialog=ui.create.dialog('调遣一个随从','hidden'); - dialog.add([list,'character']); - player.chooseButton(dialog,true); - } - else if(list.length==1){ - event.directresult=list[0]; - } - else{ - event.finish(); - } - } - else{ - if(!list.contains(event.directresult)){ - event.finish(); - } - } - 'step 1' - if(!event.directresult){ - if(result&&result.bool&&result.links[0]){ - event.directresult=result.links[0]; - } - else{ - event.finish(); - return; - } - } - if(event.directresult){ - var cfg=player.storage[event.directresult]; - var source=cfg.source||player.name; - var name=event.directresult; - game.log(player,'调遣了随从','#g'+name); - player.storage.subplayer={ - name:source, - name2:event.directresult, - hp:player.hp, - maxHp:player.maxHp, - skills:event.list.slice(0), - hs:player.getCards('h'), - es:player.getCards('e'), - intro2:cfg.intro2 - } - player.removeSkill(event.list); - player.reinit(source,name,[cfg.hp,cfg.maxHp]); - player.addSkill('subplayer'); - player.lose(player.getCards('he'),ui.special)._triggered=null; - if(cfg.hs.length) player.directgain(cfg.hs); - if(cfg.es.length) player.directequip(cfg.es); - } - 'step 2' - game.delay(); - }, - reverseOrder:function(){ - "step 0" - game.delay(); - "step 1" - var choice; - if(get.tag(card,'multineg')){ - choice=(player.previous.side==player.side)?'逆时针':'顺时针'; - } - else{ - choice=(player.next.side==player.side)?'逆时针':'顺时针'; - } - player.chooseControl('顺时针','逆时针',function(event,player){ - return _status.event.choice||'逆时针'; - }).set('prompt','选择'+get.translation(card)+'的结算方向').set('choice',choice).set('forceDie',true); - "step 2" - if(result&&result.control=='顺时针'){ - var evt=event.getParent(); - evt.fixedSeat=true; - evt.targets.sortBySeat(); - evt.targets.reverse(); - if(evt.targets[evt.targets.length-1]==player){ - evt.targets.unshift(evt.targets.pop()); - } - } - }, - addJudgeCard:function(){ - if(lib.filter.judge(card,player,target)&&cards.length&&get.position(cards[0],true)=='o') target.addJudge(card,cards); - }, - equipCard:function(){ - if(cards.length&&get.position(cards[0],true)=='o') target.equip(cards[0]); - }, - gameDraw:function(){ - "step 0" - if(_status.brawl&&_status.brawl.noGameDraw){ - event.finish(); - return; - } - var end=player; - var numx=num; - do{ - if(typeof num=='function'){ - numx=num(player); - } - player.directgain(get.cards(numx)); - if(player.singleHp===true&&get.mode()!='guozhan'){ - player.doubleDraw(); - } - player=player.next; - } - while(player!=end); - event.changeCard=get.config('change_card'); - if(_status.connectMode||lib.config.mode!='identity'&&lib.config.mode!='guozhan'&&lib.config.mode!='doudizhu'){ - event.changeCard='disabled'; - } - "step 1" - if(event.changeCard!='disabled'&&!_status.auto){ - event.dialog=ui.create.dialog('是否使用手气卡?'); - ui.create.confirm('oc'); - event.custom.replace.confirm=function(bool){ - _status.event.bool=bool; - game.resume(); - } - } - else{ - event.finish(); - } - "step 2" - if(event.changeCard=='once'){ - event.changeCard='disabled'; - } - else if(event.changeCard=='twice'){ - event.changeCard='once'; - } - else if(event.changeCard=='disabled'){ - event.bool=false; - return; - } - _status.imchoosing=true; - event.switchToAuto=function(){ - _status.event.bool=false; - game.resume(); - } - game.pause(); - "step 3" - _status.imchoosing=false; - if(event.bool){ - if(game.changeCoin){ - game.changeCoin(-3); - } - var hs=game.me.getCards('h'); - game.addVideo('lose',game.me,[get.cardsInfo(hs),[],[]]); - for(var i=0;ipriority){ - event.doing.list.splice(i--,1); - event.num--; - } - } - event.choice=[]; - if(event.num
"\n}\n帮助内容将显示在菜单-选项-帮助中\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; - } - }; - var dashes={}; - var createCode=function(str1,str2,sub,func,link,str){ - var dash=ui.create.div('.menubutton.large.dashboard'); - dashes[link]=dash; - sub.appendChild(dash); - dash.listen(func); - dash.link=link; - ui.create.div('',str1,dash); - ui.create.div('',str2,dash); - var container=ui.create.div('.popup-container.editor'); - var editorpage=ui.create.div(container); - var discardConfig=ui.create.div('.editbutton','取消',editorpage,function(){ - ui.window.classList.remove('shortcutpaused'); - ui.window.classList.remove('systempaused'); - container.delete(null); - delete window.saveNonameInput; - }); - var saveInput=function(){ - var code; - if(container.editor){ - code=container.editor.getValue(); - } - else if(container.textarea){ - code=container.textarea.value; - } - try{ - if(link=='content'||link=='precontent'){ - var func=null; - eval('func='+code); - if(typeof func!='function'){ - throw('err'); - } - } - else if(link=='config'){ - var config=null; - eval(code); - if(config==null||typeof config!='object'){ - throw('err'); - } - } - else if(link=='help'){ - var help=null; - eval(code); - if(help==null||typeof help!='object'){ - throw('err'); - } - } - } - catch(e){ - if(e=='err'){ - alert('代码格式有错误,请对比示例代码仔细检查'); - } - else{ - alert('代码语法有错误,请仔细检查('+e+')') - } - return; - } - dash4.link.classList.add('active'); - ui.window.classList.remove('shortcutpaused'); - ui.window.classList.remove('systempaused'); - container.delete(); - container.code=code; - page.content[link]=code; - delete window.saveNonameInput; - }; - var saveConfig=ui.create.div('.editbutton','保存',editorpage,saveInput); - var editor=ui.create.div(editorpage); - container.code=str; - dash.editor=editor; - dash.node=container; - dash.saveInput=saveInput; - page.content[link]=str; - }; - var clickCode=function(){ - var node=this.node; - ui.window.classList.add('shortcutpaused'); - ui.window.classList.add('systempaused'); - window.saveNonameInput=this.saveInput; - if(node.aced){ - ui.window.appendChild(node); - node.editor.setValue(node.code,1); - } - else if(lib.device=='ios'){ - ui.window.appendChild(node); - if(!node.textarea){ - var textarea=document.createElement('textarea'); - this.editor.appendChild(textarea); - node.textarea=textarea; - lib.setScroll(textarea); - } - node.textarea.value=node.code; - } - else{ - var editor=this.editor; - var aceReady=function(){ - ui.window.appendChild(node); - var mirror = window.CodeMirror(editor, { - value:node.code, - mode:"javascript", - lineWrapping:!lib.config.touchscreen&&lib.config.mousewheel, - lineNumbers:true, - indentUnit:4, - autoCloseBrackets:true, - theme:'mdn-like' - }); - lib.setScroll(editor.querySelector('.CodeMirror-scroll')); - node.aced=true; - node.editor=mirror; - } - if(!window.ace){ - lib.init.js(lib.assetURL+'game','codemirror',aceReady); - lib.init.css(lib.assetURL+'layout/default','codemirror'); - } - else{ - aceReady(); - } - } - }; - page.content={} - createCode('主','主代码',page,clickCode,'content','function(config,pack){\n \n}\n\n\/*\n函数执行时机为游戏数据加载之后、界面加载之前\n参数1扩展选项(见选项代码);参数2为扩展定义的武将、卡牌和技能等(可在此函数中修改)\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - createCode('启','启动代码',page,clickCode,'precontent','function(){\n \n}\n\n\/*\n函数执行时机为游戏数据加载之前,且不受禁用扩展的限制\n除添加模式外请慎用\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - createCode('选','选项代码',page,clickCode,'config','config={\n \n}\n\n\/*\n示例:\nconfig={\n switcher_example:{\n name:"示例列表选项",\n init:"3",\n item:{"1":"一","2":"二","3":"三"}\n },\n toggle_example:{\n name:"示例开关选项",\n init:true\n }\n}\n此例中传入的主代码函数的默认参数为{switcher_example:"3",toggle_example:true}\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - createCode('帮','帮助代码',page,clickCode,'help','help={\n \n}\n\n\/*\n示例:\nhelp={\n "帮助条目":"
  • 列表1-条目1
  • 列表1-条目2
  1. 列表2-条目1
  2. 列表2-条目2"\n}\n帮助内容将显示在菜单-选项-帮助中\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - - return page; - }()); - createDash('将','编辑武将',dash1); - createDash('卡','编辑卡牌',dash2); - createDash('技','编辑技能',dash3); - createDash('码','编辑代码',dash4); - }()); - (function(){ - var page=ui.create.div(''); - var node=ui.create.div('.menubutton.large','获取扩展',start.firstChild,clickMode); - node.link=page; - node.mode='get'; - page.listen(function(){ - if(!page.currenttimeout){ - var active=page.querySelector('.videonode.current'); - if(active){ - active.classList.remove('current'); - } - } - }); - var importextensionexpanded=false; - page.style.paddingBottom='10px'; - var importExtension; - var extensionnode=ui.create.div('.config.more','导入扩展
    >
    ',page,function(){ - if(importextensionexpanded){ - this.classList.remove('on'); - importExtension.style.display='none'; - } - else{ - this.classList.add('on'); - importExtension.style.display=''; - } - importextensionexpanded=!importextensionexpanded; - }); - importExtension=ui.create.div('.new_character.export.import',page); - importExtension.style.marginLeft='5px'; - importExtension.style.marginTop='5px'; - importExtension.style.marginBottom='5px'; - importExtension.style.display='none'; - importExtension.style.width='100%'; - importExtension.style.textAlign='left'; - ui.create.div('','',importExtension); - - var extensionURL=lib.updateURL.replace(/noname/g,'noname-extension')+'/master/'; - - var reloadnode=ui.create.div('.config.toggle.pointerdiv','重新启动',page,game.reload); - reloadnode.style.display='none'; - var placeholder=ui.create.div('.config.toggle',page); - placeholder.style.height=0; - placeholder.style.marginTop='5px'; - - importExtension.firstChild.lastChild.onclick=function(){ - var fileToLoad=this.previousSibling.files[0]; - if(fileToLoad){ - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent) - { - var finishLoad=function(){ - extensionnode.innerHTML='导入成功,3秒后将重启'; - setTimeout(function(){ - extensionnode.innerHTML='导入成功,2秒后将重启'; - setTimeout(function(){ - extensionnode.innerHTML='导入成功,1秒后将重启'; - setTimeout(game.reload,1000); - },1000); - },1000); - }; - var data = fileLoadedEvent.target.result; - if(game.importExtension(data,finishLoad)!==false){ - importExtension.style.display='none'; - } - }; - fileReader.readAsArrayBuffer(fileToLoad, "UTF-8"); - } - } - - var clickExtension=function(){ - var active=this.parentNode.querySelector('.videonode.current'); - if(active&&active!=this){ - active.classList.remove('current'); - } - this.classList.add('current'); - clearTimeout(page.currenttimeout); - page.currenttimeout=setTimeout(function(){ - delete page.currenttimeout; - },200); - }; - var downloadExtension=function(e){ - if((this.innerHTML!='下载扩展'&&this.innerHTML!='更新扩展')||!window.JSZip) return; - this.classList.remove('update'); - if(e){ - e.stopPropagation(); - } - node.updated=true; - var that=this; - var list=[]; - var size=parseFloat(this.info.size)||0; - if(size){ - if(this.info.size.indexOf('MB')!=-1){ - size*=1024*1024; - } - else if(this.info.size.indexOf('KB')!=-1){ - size*=1024; - } - } - - this.innerHTML='正在下载
    正在下载
    '; - this.classList.add('nopointer'); - this.classList.add('button-downloading'); - var progress=ui.create.div('.button-progress',this); - ui.create.div(progress); - var url=extensionURL+this.info.name+'.zip'; - var onprogress=function(byte,total){ - if(total){ - size=total; - } - if(byte==-1){ - byte=size; - } - progress.firstChild.style.width=Math.round(100*byte/size)+'%'; - }; - var files=this.info.files||[]; - for(var i=0;i('+list[i].size+')',node); - ui.create.div('.text',list[i].intro,node); - var download=ui.create.div('.menubutton.text.active','下载扩展',node.firstChild); - if(game.download){ - if(list[i].netdisk){ - var linknode=ui.create.div('.text',node); - ui.create.node('span.hrefnode','网盘链接',function(){ - game.open(this.link); - },linknode).link=list[i].netdisk; - if(list[i].forum){ - ui.create.node('span',linknode).style.marginRight='10px'; - ui.create.node('span.hrefnode','参与讨论',function(){ - game.open(this.link); - },linknode).link=list[i].forum; - } - } - else if(list[i].forum){ - var linknode=ui.create.div('.text',node); - ui.create.node('span.hrefnode','参与讨论',function(){ - game.open(this.link); - },linknode).link=list[i].forum; - } - download.listen(downloadExtension); - if(lib.config.extensions.contains(list[i].name)){ - download.classList.remove('active'); - if(lib.extensionPack[list[i].name]&&lib.extensionPack[list[i].name].version==list[i].version){ - download.classList.add('transparent2'); - download.classList.remove('active'); - download.innerHTML='已安装'; - } - else if(lib.config['extension_'+list[i].name+'_version']!=list[i].version){ - download.innerHTML='更新扩展'; - download.classList.add('highlight'); - download.classList.add('update'); - } - else{ - download.classList.add('transparent2'); - download.classList.remove('active'); - download.innerHTML='已安装'; - } - } - download.info=list[i]; - } - else{ - if(list[i].forum){ - var linknode=ui.create.div('.text',node); - ui.create.node('span',linknode); - ui.create.node('span.hrefnode','参与讨论',function(){ - game.open(this.link); - },linknode).link=list[i].forum; - } - download.listen(function(){ - game.open(this.link); - }); - download.link=list[i].netdisk; - } - } - }; - window.extension={}; - if(game.download){ - lib.init.req(extensionURL+'catalog.js',function(){ - try{ - eval(this.responseText); - // if(!window.noname_extension_list){ - // throw('err'); - // } - } - catch(e){ - delete window.extension; - loading.innerHTML='连接失败'; - return; - } - loaded(); - },function(){ - delete window.extension; - loading.innerHTML='连接失败'; - }); - } - else{ - lib.init.js(extensionURL.replace(/raw\.githubusercontent\.com/,'rawgit.com')+'catalog.js',null,loaded,function(){ - delete window.extension; - loading.innerHTML='连接失败'; - }); - } - }; - }()); - var active=start.firstChild.querySelector('.active'); - if(!active){ - active=start.firstChild.firstChild; - active.classList.add('active'); - } - rightPane.appendChild(active.link); - updateNodes(); - }()); - - (function(){ - if(connectMenu) return; - var start=menuxpages.shift(); - var rightPane=start.lastChild; - var cheatButton=ui.create.div('.menubutton.round.highlight','作',start); - cheatButton.style.display='none'; - var runButton=ui.create.div('.menubutton.round.highlight','执',start); - runButton.style.display='none'; - var clearButton=ui.create.div('.menubutton.round.highlight','清',start); - clearButton.style.display='none'; - clearButton.style.left='275px'; - var playButton=ui.create.div('.menubutton.round.highlight.hidden','播',start); - playButton.style.display='none'; - playButton.style.left='215px'; - playButton.style.transition='opacity 0.3s'; - var deleteButton=ui.create.div('.menubutton.round.highlight.hidden','删',start); - deleteButton.style.display='none'; - deleteButton.style.left='275px'; - deleteButton.style.transition='opacity 0.3s'; - var saveButton=ui.create.div('.menubutton.round.highlight.hidden','存',start); - saveButton.style.display='none'; - saveButton.style.transition='opacity 0.3s'; - - - var clickMode=function(){ - if(this.classList.contains('off')) return; - var active=this.parentNode.querySelector('.active'); - if(active===this){ - return; - } - if(active){ - active.classList.remove('active'); - active.link.remove(); - } - active=this; - this.classList.add('active'); - rightPane.appendChild(this.link); - if(this.type=='cheat'){ - cheatButton.style.display=''; - } - else{ - cheatButton.style.display='none'; - } - if(this.type=='cmd'){ - runButton.style.display=''; - clearButton.style.display=''; - } - else{ - runButton.style.display='none'; - clearButton.style.display='none'; - } - if(this.type=='video'){ - playButton.style.display=''; - saveButton.style.display=''; - deleteButton.style.display=''; - } - else{ - playButton.style.display='none'; - saveButton.style.display='none'; - deleteButton.style.display='none'; - } - }; - - ui.click.consoleMenu=function(){ - ui.click.menuTab('其它'); - clickMode.call(ui.commandnode); - }; - (function(){ - var page=ui.create.div(''); - var node=ui.create.div('.menubutton.large','更新',start.firstChild,clickMode); - node.link=page; - page.classList.add('menu-help'); - var ul=document.createElement('ul'); - var li1=document.createElement('li'); - var li2=document.createElement('li'); - var li3=document.createElement('li'); - var trimurl=function(str){ - if(str==lib.updateURLS.github){ - return 'GitHub'; - } - if(str==lib.updateURLS.coding){ - return 'Coding'; - } - var index; - index=str.indexOf('://'); - if(index!=-1){ - str=str.slice(index+3); - } - index=str.indexOf('/'); - if(index!=-1){ - str=str.slice(0,index); - } - if(str.length>15){ - var list=str.split('.'); - if(list.length>1){ - list.shift(); - } - str=list[0]; - for(var i=1;i15){ - var list=str.split('.'); - if(list.length>1){ - list.pop(); - } - str=list[0]; - for(var i=1;i

    '; - li2.innerHTML='素材版本:'+(lib.config.asset_version||'无')+'

    '; - li3.innerHTML='更新地址:'+trimurl(lib.config.updateURL||lib.updateURL)+'

    '; - li3.style.whiteSpace='nowrap'; - li3.style.display='none';// coding - - var button1,button2,button3,button4,button5; - - game.checkForUpdate=function(forcecheck,dev){ - if(!dev&&button1.disabled){ - return; - } - else if(dev&&button3.disabled){ - return; - } - else if(!game.download){ - alert('此版本不支持游戏内更新,请手动更新'); - return; - } - else{ - if(dev){ - button3.innerHTML='正在检查更新'; - } - else{ - button1.innerHTML='正在检查更新'; - } - button3.disabled=true; - button1.disabled=true; - - var goupdate=function(files,update){ - lib.version=update.version; - if(update.dev&&!lib.config.debug){ - dev='nodev'; - } - lib.init.req('game/source.js',function(){ - try{ - eval(this.responseText); - if(!window.noname_source_list){ - throw('err'); - } - } - catch(e){ - alert('更新地址有误'); - console.log(e); - return; - } - - var updates=window.noname_source_list; - delete window.noname_source_list; - if(Array.isArray(files)){ - files.add('game/update.js'); - var files2=[]; - for(var i=0;iversion1[i]){ - files=false;break; - } - else if(version1[i]>version2[i]){ - files=update.files.slice(0);break; - } - } - if(files===null){ - if(version1.length>=version2.length){ - files=update.files.slice(0); - } - } - } - var str; - if(dev){ - str='开发版仅供测试使用,可能存在风险,是否确定更新?' - } - else{ - str='有新版本'+update.version+'可用,是否下载?'; - } - if(navigator.notification&&navigator.notification.confirm){ - var str2; - if(dev){ - str2=str; - str='更新到开发版'; - } - else{ - str2=update.changeLog[0]; - for(var i=1;i>'); - span1.style.fontSize='small'; - span1.style.display='inline'; - span1.toggle=function(){ - if(!this.classList.toggle('on')){ - game.saveConfig('asset_toggle_off',true); - span2.style.display='none'; - span2_br.style.display='none'; - span2_check.style.display='none'; - span3.style.display='none'; - span3_br.style.display='none'; - span3_check.style.display='none'; - span4.style.display='none'; - span4_br.style.display='none'; - span4_check.style.display='none'; - span5.style.display='none'; - span5_br.style.display='none'; - span5_check.style.display='none'; - span6.style.display='none'; - span6_br.style.display='none'; - span6_check.style.display='none'; - } - else{ - game.saveConfig('asset_toggle_off'); - span2.style.display=''; - span2_br.style.display=''; - span2_check.style.display=''; - span3.style.display=''; - span3_br.style.display=''; - span3_check.style.display=''; - span4.style.display=''; - span4_br.style.display=''; - span4_check.style.display=''; - span5.style.display=''; - span5_br.style.display=''; - span5_check.style.display=''; - span6.style.display=''; - span6_br.style.display=''; - span6_check.style.display=''; - } - }; - span1.listen(span1.toggle); - li2.lastChild.appendChild(span1); - - var span6_br=ui.create.node('br'); - li2.lastChild.appendChild(span6_br); - - var span5=ui.create.div('','图片素材(精简,126MB)'); - span5.style.fontSize='small'; - span5.style.lineHeight='16px'; - var span5_check=document.createElement('input'); - span5_check.type='checkbox'; - span5_check.style.marginLeft='5px'; - if(lib.config.asset_image){ - span5_check.checked=true; - } - span5_check.onchange=function(){ - game.saveConfig('asset_image',this.checked); - } - var span2_br=ui.create.node('br'); - - var span4=ui.create.div('','字体素材(48MB)'); - span4.style.fontSize='small'; - span4.style.lineHeight='16px'; - li2.lastChild.appendChild(span4); - var span4_check=document.createElement('input'); - span4_check.type='checkbox'; - span4_check.style.marginLeft='5px'; - if(lib.config.asset_font){ - span4_check.checked=true; - } - span4_check.onchange=function(){ - game.saveConfig('asset_font',this.checked); - } - li2.lastChild.appendChild(span4_check); - var span3_br=ui.create.node('br'); - li2.lastChild.appendChild(span3_br); - - var span3=ui.create.div('','音效素材(36MB)'); - span3.style.fontSize='small'; - span3.style.lineHeight='16px'; - li2.lastChild.appendChild(span3); - var span3_check=document.createElement('input'); - span3_check.type='checkbox'; - span3_check.style.marginLeft='5px'; - if(lib.config.asset_audio){ - span3_check.checked=true; - } - span3_check.onchange=function(){ - game.saveConfig('asset_audio',this.checked); - } - li2.lastChild.appendChild(span3_check); - var span4_br=ui.create.node('br'); - li2.lastChild.appendChild(span4_br); - - var span2=ui.create.div('','皮肤素材(23MB)'); - span2.style.fontSize='small'; - span2.style.lineHeight='16px'; - li2.lastChild.appendChild(span2); - var span2_check=document.createElement('input'); - span2_check.type='checkbox'; - span2_check.style.marginLeft='5px'; - if(lib.config.asset_skin){ - span2_check.checked=true; - } - span2_check.onchange=function(){ - game.saveConfig('asset_skin',this.checked); - } - li2.lastChild.appendChild(span2_check); - var span5_br=ui.create.node('br'); - li2.lastChild.appendChild(span5_br); - - - li2.lastChild.appendChild(span5); - li2.lastChild.appendChild(span5_check); - li2.lastChild.appendChild(span2_br); - - var span6=ui.create.div('','图片素材(完整,203MB)'); - span6.style.fontSize='small'; - span6.style.lineHeight='16px'; - li2.lastChild.appendChild(span6); - var span6_check=document.createElement('input'); - span6_check.type='checkbox'; - span6_check.style.marginLeft='5px'; - if(lib.config.asset_full){ - span6_check.checked=true; - } - span6_check.onchange=function(){ - game.saveConfig('asset_full',this.checked); - } - li2.lastChild.appendChild(span6_check); - - span2.style.display='none'; - span2_br.style.display='none'; - span2_check.style.display='none'; - span3.style.display='none'; - span3_br.style.display='none'; - span3_check.style.display='none'; - span4.style.display='none'; - span4_br.style.display='none'; - span4_check.style.display='none'; - span5.style.display='none'; - span5_br.style.display='none'; - span5_check.style.display='none'; - span6.style.display='none'; - span6_br.style.display='none'; - span6_check.style.display='none'; - - ul.appendChild(li1); - ul.appendChild(li2); - ul.appendChild(li3); - page.appendChild(ul); - - - if(!lib.config.asset_toggle_off){ - span1.toggle(); - } - }()); - (function(){ - var norow2=function(){ - var node=currentrow1; - if(!node) return false; - return node.innerHTML=='横置'||node.innerHTML=='翻面'||node.innerHTML=='换人'||node.innerHTML=='复活'; - }; - var checkCheat=function(){ - if(norow2()){ - for(var i=0;i=0){ - logindex--; - if(logindex<0){ - text2.value=''; - } - else{ - text2.value=logs[logindex]; - } - } - else{ - text2.value=''; - } - } - else{ - if(!game.observe&&!game.online){ - try{ - var result=eval(text2.value); - game.print(result); - } - catch(e){ - game.print(e); - } - } - text2.value=''; - } - } - text2.addEventListener('keydown',function(e){ - if(e.keyCode==13){ - runCommand(); - } - else if(e.keyCode==38){ - if(logindex+1=0){ - logindex--; - if(logindex<0){ - text2.value=''; - } - else{ - text2.value=logs[logindex]; - } - } - } - }); - page.appendChild(text2); - game.print=function(){ - var textstr=''; - for(var i=0;i重置',page); - item.style.height='auto'; - item.lastChild.addEventListener('click',reset); - item.lastChild.classList.add('pointerdiv'); - item.link=lib.config.all.mode[i]; - } - } - }()); - (function(){ - if(!window.indexedDB||window.nodb) return; - var page=ui.create.div(''); - var node=ui.create.div('.menubutton.large','录像',start.firstChild,clickMode); - node.type='video'; - node.link=page; - - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - lib.videos=[]; - store.openCursor().onsuccess=function(e){ - var cursor=e.target.result; - if(cursor){ - lib.videos.push(cursor.value); - cursor.continue(); - } - else{ - lib.videos.sort(function(a,b){ - return parseInt(b.time)-parseInt(a.time); - }); - var clickcapt=function(){ - var current=this.parentNode.querySelector('.videonode.active'); - if(current&¤t!=this){ - current.classList.remove('active'); - } - if(this.classList.toggle('active')){ - playButton.show(); - deleteButton.show(); - saveButton.show(); - } - else{ - playButton.hide(); - deleteButton.hide(); - saveButton.hide(); - } - }; - var staritem=function(){ - this.parentNode.classList.toggle('starred'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - if(this.parentNode.classList.contains('starred')){ - this.parentNode.link.starred=true; - } - else{ - this.parentNode.link.starred=false; - } - store.put(this.parentNode.link); - } - var createNode=function(video,before){ - var node=ui.create.div('.videonode.menubutton.large',clickcapt); - node.link=video; - var nodename1=ui.create.div('.menubutton.videoavatar',node); - nodename1.setBackground(video.name1,'character'); - if(video.name2){ - var nodename2=ui.create.div('.menubutton.videoavatar2',node); - nodename2.setBackground(video.name2,'character'); - } - var date=new Date(video.time); - var str=date.getFullYear()+'.'+(date.getMonth()+2)+'.'+(date.getDay()+1)+' '+ - date.getHours()+':'; - var minutes=date.getMinutes(); - if(minutes<10){ - str+='0'; - } - str+=minutes; - ui.create.div('.caption',video.name[0],node); - ui.create.div('.text',str+'
    '+video.name[1],node); - if(video.win){ - ui.create.div('.victory','胜',node); - } - - if(before){ - page.insertBefore(node,page.firstChild); - } - else{ - page.appendChild(node); - } - ui.create.div('.video_star','★',node,staritem); - if(video.starred){ - node.classList.add('starred'); - } - } - for(var i=0;i导入录像...',function(){ - this.nextSibling.classList.toggle('hidden'); - },page); - importVideoNode.style.marginLeft='12px'; - importVideoNode.style.marginTop='3px'; - var importVideo=ui.create.div('.config.hidden',page); - importVideo.style.whiteSpace='nowrap'; - importVideo.style.marginBottom='80px'; - importVideo.style.marginLeft='13px'; - importVideo.style.width='calc(100% - 30px)'; - importVideo.innerHTML=''+ - ''; - importVideo.lastChild.onclick=function(){ - var fileToLoad = importVideo.firstChild.files[0]; - var fileReader = new FileReader(); - fileReader.onload = function(fileLoadedEvent) - { - var data = fileLoadedEvent.target.result; - if(!data) return; - try{ - data=JSON.parse(lib.init.decode(data)); - } - catch(e){ - console.log(e); - alert('导入失败'); - return; - } - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - var videos=lib.videos.slice(0); - for(var i=0;i=parseInt(lib.config.video)&&videos.length){ - var toremove=videos.pop(); - lib.videos.remove(toremove); - store.delete(toremove.time); - for(var i=0;iposition2){ - position.insertBefore(node,position.childNodes[position2]); - } - else{ - position.appendChild(node); - } - } - return node; - }, - giveup:function(){ - if(ui.giveup) return; - if(!lib.config.show_giveup) return; - ui.giveup=ui.create.system('投降',function(){ - var player=game.me; - this.remove(); - if(game.online){ - game.send('giveup',player); - } - else{ - _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(); - } - },true); - }, - groupControl:function(dialog){ - return ui.create.control('wei','shu','wu','qun','western','key',function(link,node){ - if(link=='全部'){ - dialog.currentcapt=''; - dialog.currentgroup=''; - for(var i=0;ib?1:-1; - }); - if(!thisiscard){ - namecapt.remove('自定义'); - namecapt.push('newline'); - for(var i in lib.characterDialogGroup){ - namecapt.push(i); - } - } - var newlined=false; - var newlined2; - var packsource; - var clickCapt=function(e){ - if(_status.dragged) return; - if(dialog.currentcapt2=='最近'&&dialog.currentcaptnode2!=this&&!dialog.currentcaptnode2.inited){ - dialog.currentcapt2=null; - dialog.currentcaptnode2.classList.remove('thundertext'); - dialog.currentcaptnode2.inited=true; - dialog.currentcaptnode2=null; - } - if(this.alphabet){ - if(this.classList.contains('thundertext')){ - dialog.currentcapt=null; - dialog.currentcaptnode=null; - this.classList.remove('thundertext'); - if(this.touchlink){ - this.touchlink.classList.remove('active'); - } - for(var i=0;i0){ - filternode.firstChild.style.top=(dh/2)+'px'; - } - else{ - filternode.firstChild.style.top=''; - } - } - else{ - if(newlined2.style.display=='none'){ - newlined2.style.display='block'; - } - else{ - newlined2.style.display='none'; - } - } - }); - var packlist=[]; - for(var i=0;ib?1:-1; - } - return aa>bb?1:-1; - }); - dialog=ui.create.dialog('hidden'); - dialog.classList.add('noupdate'); - dialog.classList.add('scroll1'); - dialog.classList.add('scroll2'); - dialog.classList.add('scroll3'); - dialog.addEventListener(lib.config.touchscreen?'touchend':'mouseup',function(){ - _status.clicked2=true; - }); - if(heightset){ - dialog.style.height=((game.layout=='long2'||game.layout=='nova')?380:350)+'px'; - dialog._scrollset=true; - } - dialog.getCurrentCapt=function(link,capt,noalph){ - var currentcapt=noalph?this.currentcapt2:this.currentcapt; - if(this.seperatelist&&noalph){ - if(this.seperatelist[currentcapt].contains(link)) return capt; - return null; - } - if(lib.characterDialogGroup[currentcapt]){ - return lib.characterDialogGroup[currentcapt](link,capt); - } - if(lib.characterPack[currentcapt]){ - if(lib.characterPack[currentcapt][link]){ - return capt; - } - return null; - } - return this.currentcapt; - } - if(str){ - dialog.add(str); - } - dialog.add(node); - if(thisiscard){ - if(seperate){ - seperate=seperate(list); - dialog.seperate=[]; - dialog.seperatelist=seperate.list; - if(dialog.seperatelist){ - newlined=document.createElement('div'); - newlined.style.marginTop='5px'; - newlined.style.display='block'; - newlined.style.fontFamily='xinwei'; - if(get.is.phoneLayout()){ - newlined.style.fontSize='32px'; - } - else{ - newlined.style.fontSize='22px'; - } - newlined.style.textAlign='center'; - node.appendChild(newlined); - for(var i in dialog.seperatelist){ - var span=document.createElement('span'); - span.style.margin='3px'; - span.innerHTML=i; - span.link=i; - span.seperate=true; - span.addEventListener(lib.config.touchscreen?'touchend':'click',clickCapt); - newlined.appendChild(span); - } - } - for(var i in seperate){ - if(i=='list') continue; - var link=''; - var linkcontent=seperate[i]; - if(i.indexOf('_link:')!=-1){ - link=i.slice(i.indexOf('_link:')+6); - i=i.slice(0,i.indexOf('_link:')); - } - var nodesep=dialog.add(i); - nodesep.link=link; - dialog.seperate.push(nodesep); - dialog.add([linkcontent,'vcard'],noclick); - } - } - else{ - dialog.add([list,'vcard'],noclick); - } - } - else{ - if(precharacter){ - dialog.add([list,'precharacter'],noclick); - } - else{ - dialog.add([list,'character'],noclick); - } - } - dialog.add(ui.create.div('.placeholder')); - for(i=0;i