From aad7316c51a473cf1ef16c5d5914981314cc9deb Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sun, 14 Jan 2024 00:38:18 +0800 Subject: [PATCH 01/65] =?UTF-8?q?=E4=B9=90=E5=B0=8F=E4=B9=94=E5=8D=A1?= =?UTF-8?q?=E7=89=8C=E6=A0=87=E8=AE=B0=E6=B7=BB=E5=8A=A0=E3=80=81=E4=B9=90?= =?UTF-8?q?=E5=B0=8F=E4=B9=94=E5=88=86=E5=8C=85=E6=B7=BB=E5=8A=A0=E3=80=81?= =?UTF-8?q?=E4=B9=90=E5=B0=8F=E4=B9=94=E5=87=BA=E5=9C=BA=E7=8E=87=E8=AF=84?= =?UTF-8?q?=E7=BA=A7=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 3 ++- character/rank.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/character/huicui.js b/character/huicui.js index 204981408..48d53cbac 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -107,7 +107,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_jishi:['dc_jiben','zhenghun','dc_sunhanhua','liuchongluojun'], sp_raoting:['dc_huanghao','dc_sunziliufang','dc_sunchen','dc_jiachong'], sp_yijun:['gongsundu','mengyou'], - sp_zhengyin:['yue_caiwenji','yue_zhoufei','yue_caiyong'], + sp_zhengyin:['yue_caiwenji','yue_zhoufei','yue_caiyong','yue_xiaoqiao'], } }, skill:{ @@ -11552,6 +11552,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yue_xiaoqiao:'乐小乔', yue_xiaoqiao_prefix:'乐', dcqiqin:'绮琴', + dcqiqin_tag:'乐', dcqiqin_info:'锁定技。①游戏开始时,你将所有手牌标记为“乐”。②你的“乐”牌不计入手牌上限。③准备阶段,你获得弃牌堆中所有你标记过的“乐”牌。', dcweiwan:'媦婉', dcweiwan_info:'出牌阶段限一次,你可以弃置一张“乐”并获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', diff --git a/character/rank.js b/character/rank.js index 15033c82b..6a0e44615 100644 --- a/character/rank.js +++ b/character/rank.js @@ -987,6 +987,7 @@ window.noname_character_rank={ 'libai', 'tw_gongsunfan', 'yue_caiwenji', + 'yue_xiaoqiao', 'vtb_xiaole', 'vtb_xiaojiu', 'ol_zhangzhang', @@ -1817,6 +1818,7 @@ window.noname_character_rank={ 'caoxian', ], epic:[ + 'yue_xiaoqiao', 'mb_chengui', 'ol_pengyang', 'ol_luyusheng', From 35d166a4e10c41f21d57a46573e9ecd168a6ffda Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sun, 14 Jan 2024 12:39:19 +0800 Subject: [PATCH 02/65] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=9F=E7=8E=87?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=89=E5=B0=86=E7=9A=84=E4=B8=A5=E9=87=8D?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/game/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index b824aff41..f38cd8cb7 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -7135,14 +7135,14 @@ export class Game extends Uninstantable { event.avatars[i].classList.add('selecting'); } } - let rand2 = []; + let rand = []; for (let i = 0; i < event.config.width; i++) { for (let j = 0; j < event.config.width - i; j++) { - rand2.push(i); + rand.push(i); } } for (let i = 0; i < event.config.num; i++) { - let rand2 = rand2.randomGet(); + let rand2 = rand.randomGet(); for (let j = 0; j < rand2.length; j++) { if (rand2[j] == rand2) { rand2.splice(j--, 1); From a8bd5fa8def93eaf23cc54cefd9fb719454d93e2 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Sun, 14 Jan 2024 12:39:44 +0800 Subject: [PATCH 03/65] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=9B=B4=E6=96=B0fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/source.js | 3 ++- game/update.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/game/source.js b/game/source.js index dfcfe6035..097039e26 100644 --- a/game/source.js +++ b/game/source.js @@ -17,6 +17,7 @@ window.noname_source_list=[ 'noname/init/node.js', 'noname/init/onload.js', 'noname/init/polyfill.js', + 'noname/library/index.js', 'noname/library/path.js', 'noname/library/announce/index.d.ts', 'noname/library/announce/index.js', @@ -122,9 +123,9 @@ window.noname_source_list=[ 'game/phantom.js', 'game/pinyinjs.js', 'game/pressure.js', + 'game/server.js', 'game/source.js', 'game/update.js', - 'game/src/lib/announce.js', 'image/card/cardtempname_bg.png', 'image/flappybird/BG.png', diff --git a/game/update.js b/game/update.js index ed203acc6..7c18fdd0b 100644 --- a/game/update.js +++ b/game/update.js @@ -98,6 +98,7 @@ window.noname_update={ 'noname/init/node.js', 'noname/init/onload.js', 'noname/init/polyfill.js', + 'noname/library/index.js', 'noname/library/path.js', 'noname/library/announce/index.d.ts', 'noname/library/announce/index.js', From ac05de482d58f61bf84cb9d9e8448cab5870c909 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sun, 14 Jan 2024 18:12:58 +0800 Subject: [PATCH 04/65] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BD=E6=88=98?= =?UTF-8?q?=E9=92=9F=E4=BC=9Aai=E5=8D=A1=E6=AD=BB=E7=9A=84=E4=B8=A5?= =?UTF-8?q?=E9=87=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/refresh.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/refresh.js b/character/refresh.js index 4e75e2c6a..71930bb29 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -6656,7 +6656,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ order:function(item,player){ - var num=player.getStorage('gzquanji').length; + var num=player.getExpansions('gzquanji').length; if(num==1) return 8; return 1; }, From c05e555476e82f74f48296a551886ae201986c23 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sun, 14 Jan 2024 18:58:34 +0800 Subject: [PATCH 05/65] =?UTF-8?q?=E5=BC=A0=E8=91=B3=E3=80=90=E6=8A=A4?= =?UTF-8?q?=E4=BC=97=E3=80=91=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E8=91=A3=E7=BB=BE=E3=80=81=E6=98=9F=E8=A2=81=E6=9C=AF=E3=80=81?= =?UTF-8?q?=E4=B9=90=E5=91=A8=E5=A6=83=E3=80=81=E5=BA=9E=E5=B1=B1=E6=B0=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 15 +++++++-------- character/sp2.js | 3 ++- character/tw.js | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index 48d53cbac..81683ea41 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -658,7 +658,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'phaseEnd'}, forced:true, filter:function(event,player){ - return player.getHistory('useCard').length>player.getHp(); + return player.getHistory('useCard').length>player.getHp()||player.getHistory('gain').reduce((sum,evt)=>sum+evt.cards.length,0)>player.getHp(); }, content:function*(event,map){ const player=map.player; @@ -1094,7 +1094,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:['gainAfter','loseAsyncAfter']}, forced:true, filter:(event,player)=>{ - // if(player==_status.currentPhase) return false; if(event.getParent('phaseDraw',true)) return false; const evt=player.getHistory('gain')[0]; if(!evt) return false; @@ -1109,8 +1108,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ var hs=player.getCards('h'),cards=trigger.getg(player); - var card=cards.filter(card=>hs.includes(card)).randomGet(); - player.addGaintag(card,'dclingkong_tag'); + cards=cards.filter(card=>hs.includes(card)); + player.addGaintag(cards,'dclingkong_tag'); game.delayx(); }, }, @@ -2254,7 +2253,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ logTarget:'player', content:function(){ var num=trigger.player.countMark('dcshengdu'); - player.draw(num); + player.draw(num*trigger.cards.length); trigger.player.removeMark('dcshengdu',num); }, } @@ -11468,7 +11467,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcguangshi_info:'锁定技。准备阶段,若所有其他角色均有“信众”,你摸两张牌并失去1点体力。', dongwan:'董绾', dcshengdu:'生妒', - dcshengdu_info:'回合开始时,你可以选择一名其他角色,令其获得1枚“生妒”标记。有“生妒”标记的角色于摸牌阶段得到牌后,你摸X张牌,然后其移去所有“生妒”标记(X为其拥有的“生妒”标记数)。', + dcshengdu_info:'回合开始时,你可以选择一名其他角色,令其获得1枚“生妒”标记。有“生妒”标记的角色于摸牌阶段得到牌后,你摸X张牌,然后其移去所有“生妒”标记(X为摸牌数乘以其拥有的“生妒”标记数)。', dcjieling:'介绫', dcjieling_info:'出牌阶段每种花色限一次,你可以将两张花色不同的手牌当无距离限制且无任何次数限制的【杀】使用。然后若此【杀】:造成了伤害,所有目标角色失去1点体力;未造成伤害,所有目标角色依次获得1枚“生妒”标记。', yuanyin:'袁胤', @@ -11514,7 +11513,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yue_zhoufei_prefix:'乐', dclingkong:'灵箜', dclingkong_tag:'箜篌', - dclingkong_info:'锁定技。①游戏开始时,你将所有手牌标记为“箜篌”。②你的“箜篌”牌不计入手牌上限。③当你于一回合内首次于摸牌阶段外得到牌后,系统随机将其中的一张牌标记为“箜篌”。', + dclingkong_info:'锁定技。①游戏开始时,你将所有手牌标记为“箜篌”。②你的“箜篌”牌不计入手牌上限。③当你于一回合内首次于摸牌阶段外得到牌后,你将这些牌标记为“箜篌”。', dcxianshu:'贤淑', dcxianshu_info:'出牌阶段,你可以将一张“箜篌”正面向上交给一名其他角色,然后你摸X张牌(X为你与其的体力值之差且至多为5)。若此牌为红色,且该角色的体力值不大于你,则其回复1点体力;若此牌为黑色,且该角色的体力值不小于你,则其失去1点体力。', dc_zhangmancheng:'张曼成', @@ -11531,7 +11530,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dccaisi:'才思', dccaisi_info:'当你于回合内/回合外使用基本牌结算结束后,若你本回合以此法得到的牌数小于你的体力上限,你可以从牌堆/弃牌堆随机获得一张非基本牌,然后本回合下次发动此技能获得的牌数+1。', dczhuoli:'擢吏', - dczhuoli_info:'锁定技。一名角色的回合结束时,若你本回合使用的牌数大于体力值,你加1点体力上限(不能超过存活角色数),回复1点体力。', + dczhuoli_info:'锁定技。一名角色的回合结束时,若你本回合使用或获得的牌数大于体力值,你加1点体力上限(不能超过存活角色数),回复1点体力。', yue_caiyong:'乐蔡邕', yue_caiyong_prefix:'乐', dcjiaowei:'焦尾', diff --git a/character/sp2.js b/character/sp2.js index a43f80794..0acd2355c 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -451,6 +451,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseEnd',global:'die'}, filter:function(event,player){ if(event.name=='phase') return player.hasMark('starpizhi'); + if(!player.getStorage('starcanxi_wangsheng').includes(event.player.group)&&!player.getStorage('starcanxi_xiangsi').includes(event.player.group)) return false; var groups=player.getSkills().filter(skill=>skill.indexOf('starcanxi_')==0); groups=groups.map(group=>group.slice(10)); return groups.includes(event.player.group); @@ -11181,7 +11182,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ starcanxi_cancel:'向死', starcanxi_info:'锁定技。游戏开始时,你获得场上所有角色的势力对应的“玺角”标记,然后选择一个“玺角”对应势力并选择以下一项;一轮开始时,你选择一个“玺角”对应势力并选择以下一项:①妄生:本轮被选择势力角色每回合首次造成的伤害+1且计算与其他角色间的距离-1;②向死:本轮其他被选择势力角色每回合首次回复体力后失去1点体力且每回合对你使用的第一张牌无效。', starpizhi:'圮秩', - starpizhi_info:'锁定技。①一名角色死亡后,若你拥有该角色对应的“玺角”标记,你失去之并摸X张牌。②结束阶段,你摸X张牌。(X为你本局游戏失去的“玺角”标记数)', + starpizhi_info:'锁定技。①一名角色死亡后,若你拥有该角色对应的“玺角”标记且你本轮发动〖向死〗的势力与其相同,你失去之并摸X张牌。②结束阶段,你摸X张牌。(X为你本局游戏失去的“玺角”标记数)', starzhonggu:'冢骨', starzhonggu_info:'主公技,锁定技。摸牌阶段,若游戏轮数大于等于场上的群势力角色数,则你额外摸两张牌,否则你少摸一张牌。', star_dongzhuo:'星董卓', diff --git a/character/tw.js b/character/tw.js index dc2404dcd..a81055f87 100644 --- a/character/tw.js +++ b/character/tw.js @@ -364,12 +364,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.target=target; var list=['cancel2']; var choiceList=[ - '弃置一张手牌,令此【杀】可以额外指定一个目标', + '令此【杀】可以额外指定一个目标', '弃置其一张手牌,若此【杀】造成伤害,则你摸一张牌且本阶段可以额外使用一张【杀】', ]; if(target.countCards('h')) list.unshift('其弃置'); else choiceList[1]=''+choiceList[1]+''; - if(game.hasPlayer(targetx=>!trigger.targets.includes(targetx)&&player.canUse(trigger.card,targetx))) list.unshift('你弃置'); + if(game.hasPlayer(targetx=>!trigger.targets.includes(targetx)&&player.canUse(trigger.card,targetx))) list.unshift('多指'); else choiceList[0]=''+choiceList[0]+''; player.chooseControl(list).set('choiceList',choiceList).set('ai',()=>{ var controls=_status.event.controls; @@ -377,7 +377,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var player=trigger.player; var target=trigger.target; if(controls.includes('其弃置')&&_status.event.goon) return '其弃置'; - if(controls.includes('你弃置')){ + if(controls.includes('多指')){ if(game.hasPlayer(targetx=>!trigger.targets.includes(targetx)&&player.canUse(trigger.card,targetx)&&get.effect(targetx,trigger.card,player,player)>0)) return '你弃置'; } return 'cancel2'; From 36f9da5dba57e35620d337960ca60a33a84f5f61 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sun, 14 Jan 2024 19:04:17 +0800 Subject: [PATCH 06/65] =?UTF-8?q?=E8=B0=8B=E8=AF=B8=E8=91=9B=E4=BA=AE?= =?UTF-8?q?=E3=80=90=E7=9C=8B=E7=A0=B4=E3=80=91bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/sb.js b/character/sb.js index 8950fa6d1..be73a07b3 100644 --- a/character/sb.js +++ b/character/sb.js @@ -709,7 +709,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:'sbkanpo', trigger:{global:'useCard'}, filter:function(event,player){ - return event.player!=player&&player.getStorage('sbkanpo').includes(event.card.name); + return event.player!=player&&player.storage.sbkanpo[1].includes(event.card.name); }, prompt2:function(event,player){ return '移除'+get.translation(event.card.name)+'的记录,令'+get.translation(event.card)+'无效'; From d02b1c8750c0e4c55317228998b714e171cc9061 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sun, 14 Jan 2024 20:19:37 +0800 Subject: [PATCH 07/65] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A5=9E=E5=BC=A0?= =?UTF-8?q?=E8=BE=BD=E6=97=A0=E6=B3=95=E5=8F=91=E5=8A=A8=E3=80=90=E5=A4=BA?= =?UTF-8?q?=E9=94=90=E3=80=91=E7=9A=84=E4=B8=A5=E9=87=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/extra.js b/character/extra.js index 256698cac..62f2f50a0 100755 --- a/character/extra.js +++ b/character/extra.js @@ -7014,11 +7014,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ source:'damageSource' }, filter:function(event,player){ - if(get.attitude(_status.event.player,event.player)>=0) return false; if(player.storage.drlt_duorui.length) return false; return event.player.isIn()&&_status.currentPhase==player; }, check:function(event,player){ + if(get.attitude(_status.event.player,event.player)>=0) return false; if(player.hasEnabledSlot()&&!player.hasEnabledSlot(5)) return false; return true; }, From b8d8deb5cf40e9e8ea3a49f285eb4afbe656adae Mon Sep 17 00:00:00 2001 From: Curpond <1713610444@qq.name> Date: Sun, 14 Jan 2024 21:40:53 +0800 Subject: [PATCH 08/65] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E7=94=B1?= =?UTF-8?q?=E9=80=89=E5=B0=86=E6=97=B6=EF=BC=8C=E8=87=AA=E7=94=B1=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/ui/index.js | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/noname/ui/index.js b/noname/ui/index.js index 705e91cde..1f2fc20dd 100644 --- a/noname/ui/index.js +++ b/noname/ui/index.js @@ -8652,6 +8652,48 @@ class Create extends Uninstantable { clickCapt.call(node[lib.config.character_dialog_tool]); } } + + //仅仅下面是新加的,by Curpond + + let container = dialog.querySelector('.content-container>.content') + let Searcher = ui.create.div('.searcher.caption') + let input = document.createElement('input') + input.style.textAlign = 'center' + input.style.border = 'solid 2px #294510' + input.style.borderRadius = '6px' + input.style.fontWeight = 'bold' + input.style.fontSize = '21px' + let find = ui.create.button(['find', '搜索'], 'tdnodes') + find.style.display = 'inline' + let clickfind = function (e) { + e.stopPropagation() + let value = input.value + if (value == '') { + game.alert('搜索不能为空') + input.focus() + return + } + let list = [] + for (let btn of dialog.buttons) { + + if ((new RegExp(value, 'g').test(get.translation(btn.link)))) { + btn.classList.remove('nodisplay') + } else { + btn.classList.add('nodisplay') + } + } + + } + input.addEventListener('keyup', (e) => { + + if (e.key == 'Enter') clickfind(e) + }) + find.listen(clickfind) + Searcher.appendChild(input) + Searcher.appendChild(find) + container.prepend(Searcher) + + return dialog; } static dialog() { @@ -9624,8 +9666,8 @@ class Create extends Uninstantable { if (get.position(item) == 'j' && item.viewAs && lib.config.cardtempname != 'off') { node.classList.add('infoflip'); node.classList.add('infohidden') - ui.create.cardTempName(item, node).style.setProperty('display','block','important') - + ui.create.cardTempName(item, node).style.setProperty('display', 'block', 'important') + } return node; }, From 2a978638ce2f8b5860d2205d47cf3f29bed8859d Mon Sep 17 00:00:00 2001 From: kuangthree Date: Sun, 14 Jan 2024 22:31:29 +0800 Subject: [PATCH 09/65] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E7=BE=BD?= =?UTF-8?q?=E6=AD=A6=E5=9C=A3=E7=89=8C=E8=A7=86=E4=B8=BA=E6=97=A0=E8=8A=B1?= =?UTF-8?q?=E8=89=B2BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/element/vcard.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/noname/library/element/vcard.js b/noname/library/element/vcard.js index a0bc68e30..deca706e7 100644 --- a/noname/library/element/vcard.js +++ b/noname/library/element/vcard.js @@ -13,10 +13,6 @@ export class VCard { * @param { string } [nature] */ constructor(suitOrCard, numberOrCards, name, nature) { - if (suitOrCard instanceof VCard) { - const other = suitOrCard; - [suitOrCard, numberOrCards, name, nature] = other._args; - } if (Array.isArray(suitOrCard)) { /** From d68d4310e40a9f314e7a87ea5b8579a561bfe7c6 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Sun, 14 Jan 2024 22:44:37 +0800 Subject: [PATCH 10/65] =?UTF-8?q?=E3=80=90=E5=B1=AF=E7=94=B0=E3=80=91?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=BB=B6=E6=97=B6=E9=94=A6=E5=9B=8A=E7=BA=B3?= =?UTF-8?q?=E5=85=A5ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/shenhua.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/shenhua.js b/character/shenhua.js index 34750ef38..95ce88be9 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3667,7 +3667,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target:function(card,player,target,current){ if(typeof card==='object'&&get.name(card)==='sha'&&target.mayHaveShan(player,'use')) return [0.6,0.75]; if(!target.hasFriend()&&!player.hasUnknown()) return; - if(_status.currentPhase==target) return; + if(_status.currentPhase==target||get.type(card)==='delay') return; if(card.name!='shuiyanqijunx'&&get.tag(card,'loseCard')&&target.countCards('he')){ if(target.hasSkill('ziliang')) return 0.7; return [0.5,Math.max(2,target.countCards('h'))]; From ab5dce918a5f04665f719547d8c6dc3a2457e171 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Sun, 14 Jan 2024 23:24:30 +0800 Subject: [PATCH 11/65] =?UTF-8?q?=E6=88=98=E8=B1=A1=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/yongjian.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/card/yongjian.js b/card/yongjian.js index 18f63d18a..5e0a3e7e1 100644 --- a/card/yongjian.js +++ b/card/yongjian.js @@ -411,7 +411,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ equipSkill:true, forced:true, trigger:{target:'gift'}, - filter:(event,player)=>event.target!=player, + filter:(event,player)=>event.player!=player, logTarget:'player', content:()=>{ trigger.deniedGift.add(trigger.card); From 826391ebba3290fb7afe3d76573fd94e8328efcb Mon Sep 17 00:00:00 2001 From: Ansolve Date: Mon, 15 Jan 2024 13:33:53 +0800 Subject: [PATCH 12/65] fix: cannot edit the character. --- noname/ui/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noname/ui/index.js b/noname/ui/index.js index 705e91cde..ea01b714e 100644 --- a/noname/ui/index.js +++ b/noname/ui/index.js @@ -4190,7 +4190,7 @@ class Create extends Uninstantable { } editnode.classList.remove('disabled'); }; - var clickButton = async () => { + var clickButton = async function () { if (currentButton == this) { resetEditor(); return; From 92dcd6655516e5b4d960b48fba66bd5375a044e3 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Mon, 15 Jan 2024 14:27:33 +0800 Subject: [PATCH 13/65] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B9=90=E5=B0=8F?= =?UTF-8?q?=E4=B9=94=E6=8A=80=E8=83=BD=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index 81683ea41..c5296134a 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -11551,10 +11551,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yue_xiaoqiao:'乐小乔', yue_xiaoqiao_prefix:'乐', dcqiqin:'绮琴', - dcqiqin_tag:'乐', - dcqiqin_info:'锁定技。①游戏开始时,你将所有手牌标记为“乐”。②你的“乐”牌不计入手牌上限。③准备阶段,你获得弃牌堆中所有你标记过的“乐”牌。', + dcqiqin_tag:'琴', + dcqiqin_info:'锁定技。①游戏开始时,你将所有手牌标记为“琴”。②你的“琴”牌不计入手牌上限。③准备阶段,你获得弃牌堆中所有你标记过的“琴”牌。', dcweiwan:'媦婉', - dcweiwan_info:'出牌阶段限一次,你可以弃置一张“乐”并获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', + dcweiwan_info:'出牌阶段限一次,你可以弃置一张“琴”并随机获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', sp_baigei:'无双上将', sp_caizijiaren:'才子佳人', From 514751d3719eabe0b94b6df1cbc7041dc8baa879 Mon Sep 17 00:00:00 2001 From: Ansolve Date: Mon, 15 Jan 2024 14:27:34 +0800 Subject: [PATCH 14/65] fix: ext loaded failed. --- noname/init/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/noname/init/index.js b/noname/init/index.js index 1cc23525d..13b8b327b 100644 --- a/noname/init/index.js +++ b/noname/init/index.js @@ -468,6 +468,7 @@ export async function boot() { if (extensionlist.length && (config.get('mode') != 'connect' || show_splash)) { _status.extensionLoading = []; + _status.extensionLoaded = []; const bannedExtensions = Reflect.get(window, 'bannedExtensions'); From 2190dfe083779f962eec6abd96947e0a99b669ab Mon Sep 17 00:00:00 2001 From: Ansolve Date: Mon, 15 Jan 2024 14:27:59 +0800 Subject: [PATCH 15/65] fix: get copy. --- noname/get/index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/noname/get/index.js b/noname/get/index.js index 955765fc9..f38faf096 100644 --- a/noname/get/index.js +++ b/noname/get/index.js @@ -814,6 +814,7 @@ export class Get extends Uninstantable { "[object Object]": true, "[object Array]": true, "[object Arguments]": true, + "[object Date]": true }; if (typeof obj !== "object" || obj === null || !canTranverse[getType(obj)]) @@ -827,16 +828,22 @@ export class Get extends Uninstantable { const target = constructor ? ( - // 这三类数据处理单独处理 + // 这四类数据处理单独处理 // (实际上需要处理的只有Map和Set) // 除此之外的就只能祝愿有拷贝构造函数了 - (Array.isArray(obj) || obj instanceof Map || obj instanceof Set) + (Array.isArray(obj) || obj instanceof Map || obj instanceof Set || constructor === Object) // @ts-ignore ? new constructor() - // @ts-ignore - : new constructor(obj) + : ( + (constructor.name in window && /\[native code\]/.test(constructor.toString())) + // @ts-ignore + ? new constructor(obj) + : obj + ) ) : Object.create(null); + if (target === obj) return target; + map.set(obj, target); if (obj instanceof Map) { From 8b80deb3b3ae2c11ca751703b2f379fa9918a6fa Mon Sep 17 00:00:00 2001 From: Ansolve Date: Mon, 15 Jan 2024 14:29:33 +0800 Subject: [PATCH 16/65] fix: vcard without args. --- noname/library/element/vcard.js | 253 ++++++++++++++++---------------- 1 file changed, 125 insertions(+), 128 deletions(-) diff --git a/noname/library/element/vcard.js b/noname/library/element/vcard.js index deca706e7..30b4d58b6 100644 --- a/noname/library/element/vcard.js +++ b/noname/library/element/vcard.js @@ -1,128 +1,125 @@ -import { AI as ai } from '../../ai/index.js'; -import { Get as get } from '../../get/index.js'; -import { Game as game } from '../../game/index.js'; -import { Library as lib } from "../index.js"; -import { status as _status } from '../../status/index.js'; -import { UI as ui } from '../../ui/index.js'; - -export class VCard { - /** - * @param { any } [suitOrCard] - * @param { number | Card[] } [numberOrCards] - * @param { string } [name] - * @param { string } [nature] - */ - constructor(suitOrCard, numberOrCards, name, nature) { - - if (Array.isArray(suitOrCard)) { - /** - * @type {string} - */ - this.suit = suitOrCard[0]; - /** - * @type {number} - */ - this.number = suitOrCard[1]; - /** - * @type {string} - */ - this.name = suitOrCard[2]; - /** - * @type {string} - */ - this.nature = suitOrCard[3]; - } - // @ts-ignore - else if (get.itemtype(suitOrCard) == 'card') { - this.name = get.name(suitOrCard); - this.suit = get.suit(suitOrCard); - this.color = get.color(suitOrCard); - this.number = get.number(suitOrCard); - this.nature = get.nature(suitOrCard); - /** - * @type { boolean } - */ - this.isCard = true; - this.cardid = suitOrCard.cardid; - this.wunature = suitOrCard.wunature; - /** - * @type {Record} - */ - this.storage = get.copy(suitOrCard.storage); - if (Array.isArray(numberOrCards)) this.cards = numberOrCards.slice(); - else this.cards = [suitOrCard]; - const info = get.info(this, false); - if (info) { - const autoViewAs = info.autoViewAs; - if (typeof autoViewAs == 'string') this.name = autoViewAs; - } - } - else if (suitOrCard && typeof suitOrCard != 'string') { - Object.keys(suitOrCard).forEach(key => { - /** - * @type { PropertyDescriptor } - */ - // @ts-ignore - const propertyDescriptor = Object.getOwnPropertyDescriptor(suitOrCard, key), value = propertyDescriptor.value; - if (Array.isArray(value)) this[key] = value.slice(); - else Object.defineProperty(this, key, propertyDescriptor); - }); - if (Array.isArray(numberOrCards)) { - const noCards = !this.cards; - /** - * @type { Card[] } - */ - this.cards = numberOrCards.slice(); - if (noCards) { - if (!lib.suits.includes(this.suit)) this.suit = get.suit(this); - if (!Object.keys(lib.color).includes(this.color)) this.color = get.color(this); - if (typeof this.number != 'number') this.number = get.number(this); - if (!this.nature) this.nature = get.nature(this); - } - } - const info = get.info(this, false); - if (info) { - const autoViewAs = info.autoViewAs; - if (typeof autoViewAs == 'string') this.name = autoViewAs; - } - } - if (typeof suitOrCard == 'string') this.suit = suitOrCard; - if (typeof numberOrCards == 'number') this.number = numberOrCards; - if (typeof name == 'string') this.name = name; - if (typeof nature == 'string') this.nature = nature; - if (!this.storage) this.storage = {}; - if (!this.cards) this.cards = []; - - this._args = [suitOrCard, numberOrCards, name, nature]; - } - sameSuitAs(card) { - return get.suit(this) == get.suit(card); - } - differentSuitFrom(card) { - return get.suit(this) != get.suit(card); - } - sameNumberAs(card) { - return get.number(this) == get.number(card); - } - differentNumberFrom(card) { - return get.number(this) != get.number(card); - } - sameNameAs(card) { - return get.name(this) == get.name(card); - } - differentNameFrom(card) { - return get.name(this) != get.name(card); - } - /** - * @param { Player } player - */ - hasNature(nature, player) { - const natures = get.natureList(this, player); - if (!nature) return natures.length > 0; - if (nature == 'linked') return natures.some(n => lib.linked.includes(n)); - return get.is.sameNature(natures, nature); - } - hasGaintag(tag) { - return this.gaintag && this.gaintag.includes(tag); - } -} +import { AI as ai } from '../../ai/index.js'; +import { Get as get } from '../../get/index.js'; +import { Game as game } from '../../game/index.js'; +import { Library as lib } from "../index.js"; +import { status as _status } from '../../status/index.js'; +import { UI as ui } from '../../ui/index.js'; + +export class VCard { + /** + * @param { any } [suitOrCard] + * @param { number | Card[] } [numberOrCards] + * @param { string } [name] + * @param { string } [nature] + */ + constructor(suitOrCard, numberOrCards, name, nature) { + if (Array.isArray(suitOrCard)) { + /** + * @type {string} + */ + this.suit = suitOrCard[0]; + /** + * @type {number} + */ + this.number = suitOrCard[1]; + /** + * @type {string} + */ + this.name = suitOrCard[2]; + /** + * @type {string} + */ + this.nature = suitOrCard[3]; + } + // @ts-ignore + else if (get.itemtype(suitOrCard) == 'card') { + this.name = get.name(suitOrCard); + this.suit = get.suit(suitOrCard); + this.color = get.color(suitOrCard); + this.number = get.number(suitOrCard); + this.nature = get.nature(suitOrCard); + /** + * @type { boolean } + */ + this.isCard = true; + this.cardid = suitOrCard.cardid; + this.wunature = suitOrCard.wunature; + /** + * @type {Record} + */ + this.storage = get.copy(suitOrCard.storage); + if (Array.isArray(numberOrCards)) this.cards = numberOrCards.slice(); + else this.cards = [suitOrCard]; + const info = get.info(this, false); + if (info) { + const autoViewAs = info.autoViewAs; + if (typeof autoViewAs == 'string') this.name = autoViewAs; + } + } + else if (suitOrCard && typeof suitOrCard != 'string') { + Object.keys(suitOrCard).forEach(key => { + /** + * @type { PropertyDescriptor } + */ + // @ts-ignore + const propertyDescriptor = Object.getOwnPropertyDescriptor(suitOrCard, key), value = propertyDescriptor.value; + if (Array.isArray(value)) this[key] = value.slice(); + else Object.defineProperty(this, key, propertyDescriptor); + }); + if (Array.isArray(numberOrCards)) { + const noCards = !this.cards; + /** + * @type { Card[] } + */ + this.cards = numberOrCards.slice(); + if (noCards) { + if (!lib.suits.includes(this.suit)) this.suit = get.suit(this); + if (!Object.keys(lib.color).includes(this.color)) this.color = get.color(this); + if (typeof this.number != 'number') this.number = get.number(this); + if (!this.nature) this.nature = get.nature(this); + } + } + const info = get.info(this, false); + if (info) { + const autoViewAs = info.autoViewAs; + if (typeof autoViewAs == 'string') this.name = autoViewAs; + } + } + if (typeof suitOrCard == 'string') this.suit = suitOrCard; + if (typeof numberOrCards == 'number') this.number = numberOrCards; + if (typeof name == 'string') this.name = name; + if (typeof nature == 'string') this.nature = nature; + if (!this.storage) this.storage = {}; + if (!this.cards) this.cards = []; + } + sameSuitAs(card) { + return get.suit(this) == get.suit(card); + } + differentSuitFrom(card) { + return get.suit(this) != get.suit(card); + } + sameNumberAs(card) { + return get.number(this) == get.number(card); + } + differentNumberFrom(card) { + return get.number(this) != get.number(card); + } + sameNameAs(card) { + return get.name(this) == get.name(card); + } + differentNameFrom(card) { + return get.name(this) != get.name(card); + } + /** + * @param { Player } player + */ + hasNature(nature, player) { + const natures = get.natureList(this, player); + if (!nature) return natures.length > 0; + if (nature == 'linked') return natures.some(n => lib.linked.includes(n)); + return get.is.sameNature(natures, nature); + } + hasGaintag(tag) { + return this.gaintag && this.gaintag.includes(tag); + } +} From dfb9bfeae0d3c9b193104549858df4638befe490 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 15 Jan 2024 14:47:49 +0800 Subject: [PATCH 17/65] =?UTF-8?q?=E6=9B=B9=E5=AE=87bugfix=EF=BC=8C?= =?UTF-8?q?=E7=A5=9E=E5=8D=8E=E4=BD=97=E6=8A=80=E8=83=BD=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E4=B9=90=E5=B0=8F=E4=B9=94=E5=8D=A1?= =?UTF-8?q?=E7=89=8C=E6=A0=87=E8=AE=B0=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 73 ++++++++++++++++++++++++++------------------- character/huicui.js | 6 ++-- character/sp.js | 5 +++- 3 files changed, 50 insertions(+), 34 deletions(-) diff --git a/character/extra.js b/character/extra.js index 256698cac..93bc0269d 100755 --- a/character/extra.js +++ b/character/extra.js @@ -155,8 +155,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '虎:当你使用指定唯一目标的牌对目标角色造成伤害时,此伤害+1。', '鹿:①当你获得此效果时,你回复1点体力并弃置判定区的所有牌。②你不能成为延时锦囊牌的目标。', '熊:每回合限一次,当你受到伤害时,此伤害-1。', - '猿:出牌阶段开始时,你选择一名角色,随机获得其装备区里的一张牌。', - '鹤:出牌阶段开始时,你摸三张牌。', + '猿:当你获得此效果时,你选择一名其他角色,获得其装备区里的一张牌。', + '鹤:当你获得此效果时,你摸三张牌。', ], updateMark:function(player){ var wuqinxi=player.storage.wuling_wuqinxi; @@ -177,11 +177,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.broadcastAll(function(player,curMark){ if(player.marks.wuling_wuqinxi) player.marks.wuling_wuqinxi.firstChild.innerHTML=curMark; },player,curMark); - if(curMark=='鹿'){ - player.logSkill('wuling_wuqinxi'); - player.recover(); - player.discard(player.getCards('j')).discarder=player; - } + var next=game.createEvent('wuling_change'); + next.player=player; + next.setContent('emptyEvent'); }, ai:{ order:7, @@ -214,7 +212,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, trigger:{ source:'damageBegin1', - player:['phaseZhunbeiBegin','damageBegin4','phaseUseBegin'], + player:['phaseZhunbeiBegin','damageBegin4','wuling_change'], }, filter:function(event,player,name){ const wuqinxi=player.storage.wuling_wuqinxi&&player.storage.wuling_wuqinxi[0]; @@ -228,9 +226,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ case 'damageBegin4': return wuqinxi=='熊'&&!player.hasSkill('wuling_xiong'); default: - if(wuqinxi=='鹤') return true; - if(wuqinxi!='猿') return false; - return game.hasPlayer(target=>target.countGainableCards(player,'e')); + switch(wuqinxi){ + case '鹿': + return player.isDamaged()||player.countCards('j'); + case '鹤': + return true; + case '猿': + return game.hasPlayer(target=>target!=playertarget.countGainableCards(player,'e')); + default: + return false; + } + break; } }, forced:true, @@ -256,31 +262,38 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); break; default: - if(wuqinxi=='鹤'){ - player.draw(3); - event.finish(); - } - else{ - player.chooseTarget('五禽戏:获得一名角色装备区里的一张装备牌',function(card,player,target){ - return target.countGainableCards(player,'e'); - }).set('ai',function(target){ - var player=_status.event.player; - var att=get.attitude(player,target),eff=0; - target.getCards('e',function(card){ - var val=get.value(card,target); - eff=Math.max(eff,-val*att); + switch(wuqinxi){ + case '鹿': + player.recover(); + player.discard(player.getCards('j')).discarder=player; + event.finish(); + break; + case '鹤': + player.draw(3); + event.finish(); + break; + case '猿': + player.chooseTarget('五禽戏:获得一名其他角色装备区里的一张装备牌',function(card,player,target){ + return target!=player&&target.countGainableCards(player,'e'); + }).set('ai',function(target){ + var player=_status.event.player; + var att=get.attitude(player,target),eff=0; + target.getCards('e',function(card){ + var val=get.value(card,target); + eff=Math.max(eff,-val*att); + }); + return eff; }); - return eff; - }); + break; } + break; } } 'step 1' if(result.bool){ var target=result.targets[0]; player.line(target,'green'); - var cards=target.getGainableCards(player,'e'); - player.gain(cards.randomGets(1),target,'give'); + player.gainPlayerCard(target,'e',true); } }, ai:{ @@ -8049,8 +8062,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '
  • 虎:当你使用指定唯一目标的牌对目标角色造成伤害时,此伤害+1。'+ '
  • 鹿:①当你获得此效果时,你回复1点体力并弃置判定区的所有牌。②你不能成为延时锦囊牌的目标。'+ '
  • 熊:每回合限一次,当你受到伤害时,此伤害-1。'+ - '
  • 猿:出牌阶段开始时,你选择一名角色,随机获得其装备区里的一张牌。'+ - '
  • 鹤:出牌阶段开始时,你摸三张牌。', + '
  • 猿:当你获得此效果时,你选择一名其他角色,获得其装备区里的一张牌。'+ + '
  • 鹤:当你获得此效果时,你摸三张牌。', youyi:'游医', youyi_info:'①弃牌阶段结束时,你可以将所有于此阶段弃置的牌置入仁区。②出牌阶段限一次。你可以将仁区的所有牌置入弃牌堆,令所有角色各回复1点体力。', diff --git a/character/huicui.js b/character/huicui.js index 81683ea41..ae9cd2da0 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -11551,10 +11551,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yue_xiaoqiao:'乐小乔', yue_xiaoqiao_prefix:'乐', dcqiqin:'绮琴', - dcqiqin_tag:'乐', - dcqiqin_info:'锁定技。①游戏开始时,你将所有手牌标记为“乐”。②你的“乐”牌不计入手牌上限。③准备阶段,你获得弃牌堆中所有你标记过的“乐”牌。', + dcqiqin_tag:'琴', + dcqiqin_info:'锁定技。①游戏开始时,你将所有手牌标记为“琴”。②你的“琴”牌不计入手牌上限。③准备阶段,你获得弃牌堆中所有你标记过的“琴”牌。', dcweiwan:'媦婉', - dcweiwan_info:'出牌阶段限一次,你可以弃置一张“乐”并获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', + dcweiwan_info:'出牌阶段限一次,你可以弃置一张“琴”并获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', sp_baigei:'无双上将', sp_caizijiaren:'才子佳人', diff --git a/character/sp.js b/character/sp.js index 69ad799e9..57854724a 100755 --- a/character/sp.js +++ b/character/sp.js @@ -727,7 +727,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var {result:{bool,targets}}=await player.chooseTarget(get.prompt2('olgongjie'),[1,num],lib.filter.notMe).set('ai',target=>get.attitude(_status.event.player,target)); if(!bool) return; targets=targets.sortBySeat(); - player.logSkill('gongjie',targets); + player.logSkill('olgongjie',targets); for(var target of targets){ var {result:{bool,cards}}=await target.gainPlayerCard(player,true,'he'); if(bool) draws.add(get.suit(cards[0],player)); @@ -788,6 +788,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player.countCards('he'); }, direct:true, + limited:true, + skillAnimation:true, + animationColor:'water', async content(event,trigger,player){ var target=_status.currentPhase,num=player.countCards('he'); var {result:{bool,cards}}=await player.chooseToGive(get.prompt2('olxiangzuo',target),[1,num],'he').set('ai',card=>{ From cf119d8668400671417252f69ef43bf26685a1c4 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 15 Jan 2024 14:50:40 +0800 Subject: [PATCH 18/65] resolve conflicts --- character/huicui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/huicui.js b/character/huicui.js index ae9cd2da0..c5296134a 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -11554,7 +11554,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcqiqin_tag:'琴', dcqiqin_info:'锁定技。①游戏开始时,你将所有手牌标记为“琴”。②你的“琴”牌不计入手牌上限。③准备阶段,你获得弃牌堆中所有你标记过的“琴”牌。', dcweiwan:'媦婉', - dcweiwan_info:'出牌阶段限一次,你可以弃置一张“琴”并获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', + dcweiwan_info:'出牌阶段限一次,你可以弃置一张“琴”并随机获得一名其他角色区域内花色与此牌不相同的牌各一张,若你获得了:一张牌,其失去1点体力;两张牌,本回合你对其使用牌无距离和次数限制;三张牌,本回合你不能对其使用牌。', sp_baigei:'无双上将', sp_caizijiaren:'才子佳人', From cd2139edb131fe7860551db353746c398d74f9bd Mon Sep 17 00:00:00 2001 From: Ansolve Date: Mon, 15 Jan 2024 14:52:27 +0800 Subject: [PATCH 19/65] fix: remove unnecessary semicolon. --- noname/library/index.js | 26191 +++++++++++++++++++------------------- 1 file changed, 13095 insertions(+), 13096 deletions(-) diff --git a/noname/library/index.js b/noname/library/index.js index 6d04c9d4c..3d407ab8e 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -1,13096 +1,13095 @@ -/** - * @typedef { InstanceType } Player - * @typedef { InstanceType } Card - * @typedef { InstanceType } VCard - * @typedef { InstanceType } Button - * @typedef { InstanceType } Dialog - * @typedef { InstanceType } GameEvent - * @typedef { InstanceType & InstanceType & typeof Promise } GameEventPromise - * @typedef { InstanceType } NodeWS - * @typedef { InstanceType } Control -*/ -import { nonameInitialized, assetURL, userAgent, Uninstantable, GeneratorFunction, AsyncFunction, characterDefaultPicturePath } from "../util/index.js"; -import { AI as ai } from '../ai/index.js'; -import { Get as get } from '../get/index.js'; -import { Game as game } from '../game/index.js'; -import { status as _status } from '../status/index.js'; -import { UI as ui } from '../ui/index.js'; -import { GNC as gnc } from '../gnc/index.js'; - -import { LibInit } from "./init/index.js"; -import { Announce } from "./announce/index.js"; -import { Channel } from "./channel/index.js"; -import { Experimental } from "./experimental/index.js"; -import * as Element from "./element/index.js"; - - -export class Library extends Uninstantable { - static configprefix = 'noname_0.9_'; - static versionOL = 27; - static updateURLS = { - coding: 'https://gitcode.net/sinat_33405273/noname/-/raw/', - github: 'https://raw.githubusercontent.com/libccy/noname', - }; - static updateURL = 'https://raw.githubusercontent.com/libccy/noname'; - static mirrorURL = 'https://gitcode.net/sinat_33405273/noname/-/raw/'; - static hallURL = '47.99.105.222'; - static assetURL = assetURL; - static userAgent = userAgent; - static characterDefaultPicturePath = characterDefaultPicturePath; - static compatibleEdition = Boolean(typeof nonameInitialized == 'string' && nonameInitialized.match(/\/(?:com\.widget|yuri\.nakamura)\.noname\//)); - static changeLog = []; - static updates = []; - static canvasUpdates = []; - /** - * @type { Video[] } - */ - static video = []; - static skilllist = []; - static connectBanned = []; - static characterIntro = {}; - static characterTitle = {}; - static characterPack = {}; - static characterFilter = {}; - static characterSort = {}; - static characterReplace = {}; - static characterGuozhanFilter = ["mode_guozhan"]; - static dynamicTranslate = {}; - static cardPack = {}; - /** - * @type { SMap } - */ - static skin = {}; - static onresize = []; - static onphase = []; - static onwash = []; - static onover = []; - static ondb = []; - static ondb2 = []; - static chatHistory = []; - static emotionList = { - xiaowu_emotion: 14, - xiaokuo_emotion: 8, - shibing_emotion: 15, - guojia_emotion: 20, - zhenji_emotion: 20, - xiaosha_emotion: 20, - xiaotao_emotion: 20, - xiaojiu_emotion: 20, - }; - static animate = { - skill: {}, - card: {}, - }; - static onload = []; - static onload2 = []; - static onprepare = []; - static arenaReady = []; - static onfree = []; - static inpile = []; - static inpile_nature = []; - static extensions = []; - static extensionPack = {}; - static cardType = {}; - static hook = { globalskill: {} }; - /** - * @returns { never } - */ - static typeAnnotation() { - /** - * @type { Videos[] } - */ - // @ts-ignore - this.videos; - /** - * @type { { - * fs: typeof import("fs"), - * path: typeof import("path"), - * debug: () => void, - * clients: Element.Client[], - * banned:[], - * observing:[], - * torespond:{}, - * torespondtimeout:{}, - * } } - */ - // @ts-ignore - this.node; - /** - * @type { { [key: string]: string } } - */ - // @ts-ignore - this.playerOL; - throw new Error('Do not call this method'); - } - - //函数钩子 - static hooks = { - // 本体势力的颜色 - addGroup: [(id, _short, _name, config) => { - if ("color" in config && config.color != null) { - let color1, color2, color3, color4; - if (typeof config.color == "string" && /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(config.color)) { - let c1 = parseInt(`0x${config.color.slice(1, 3)}`); - let c2 = parseInt(`0x${config.color.slice(3, 5)}`); - let c3 = parseInt(`0x${config.color.slice(5, 7)}`); - color1 = color2 = color3 = color4 = [c1, c2, c3, 1]; - } - else if (Array.isArray(config.color) && config.color.length == 4) { - if (config.color.every(item => Array.isArray(item))) { - color1 = config.color[0]; - color2 = config.color[1]; - color3 = config.color[2]; - color4 = config.color[3]; - } - else color1 = color2 = color3 = color4 = config.color; - } - if (color1 && color2 && color3 && color4) { - const cs = lib.linq.cselector; - const g1 = cs.group( - cs.of( - cs.class("player ", "identity"), - cs.isAttr("data-color", `"${id}"`) - ), - cs.of( - "div", - cs.isAttr("data-nature", `"${id}"`) - ), - cs.of( - "span", - cs.isAttr("data-nature", `"${id}"`) - ) - ); - const g2 = cs.group( - cs.of( - "div", - cs.isAttr("data-nature", `"${id}m"`) - ), - cs.of( - "span", - cs.isAttr("data-nature", `"${id}m"`) - ) - ); - const g3 = cs.group( - cs.of( - "div", - cs.isAttr("data-nature", `"${id}mm"`) - ), - cs.of( - "span", - cs.isAttr("data-nature", `"${id}mm"`) - ) - ); - let result = {}; - result[g1] = { - textShadow: cs.group( - "black 0 0 1px", - `rgba(${color1.join()}) 0 0 2px`, - `rgba(${color2.join()}) 0 0 5px`, - `rgba(${color3.join()}) 0 0 10px`, - `rgba(${color4.join()}) 0 0 10px` - ) - }; - result[g2] = { - textShadow: cs.group( - "black 0 0 1px", - `rgba(${color1.join()}) 0 0 2px`, - `rgba(${color2.join()}) 0 0 5px`, - `rgba(${color3.join()}) 0 0 5px`, - `rgba(${color4.join()}) 0 0 5px`, - "black 0 0 1px" - ) - }; - result[g3] = { - textShadow: cs.group( - "black 0 0 1px", - `rgba(${color1.join()}) 0 0 2px`, - `rgba(${color2.join()}) 0 0 2px`, - `rgba(${color3.join()}) 0 0 2px`, - `rgba(${color4.join()}) 0 0 2px`, - "black 0 0 1px" - ) - }; - game.dynamicStyle.addObject(result); - lib.groupnature[id] = id; - } - } - if (typeof config.image == 'string') Object.defineProperty(lib.card, `group_${id}`, { - configurable: true, - enumerable: false, - writable: true, - value: { - fullskin: true, - image: config.image - } - }); - }], - //增加新属性杀 - addNature: [(nature, _translation, config) => { - if (typeof config != 'object') config = {}; - let linked = config.linked, order = config.order, background = config.background, lineColor = config.lineColor; - if (typeof linked != 'boolean') linked = true; - if (typeof order != 'number') order = 0; - if (typeof background != 'string') background = ''; - if (!Array.isArray(lineColor) || lineColor.length != 3) lineColor = []; - else if (background.startsWith('ext:')) { - background = background.replace(/^ext:/, 'extension/'); - } - if (linked) lib.linked.add(nature); - if (lineColor.length) lib.lineColor.set(nature, lineColor); - lib.nature.set(nature, order); - if (background.length > 0) lib.natureBg.set(nature, background); - if (config.audio) { - for (let key in config.audio) { - if (!lib.natureAudio[key]) { - lib.natureAudio[key] = config.audio[key]; - } else { - for (let key2 in config.audio[key]) { - lib.natureAudio[key][key2] = config.audio[key][key2]; - } - } - } - } - - let color1, color2; - if (typeof config.color == "string" && /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(config.color)) { - let c1 = parseInt(`0x${item[1].slice(1, 3)}`); - let c2 = parseInt(`0x${item[1].slice(3, 5)}`); - let c3 = parseInt(`0x${item[1].slice(5, 7)}`); - color1 = color2 = [c1, c2, c3, 1]; - } - else if (Array.isArray(config.color) && config.color.length >= 2 && config.color.length <= 4) { - if (config.color.every(item => Array.isArray(item))) { - color1 = config.color[0]; - color2 = config.color[1]; - } - else { - let color = config.color.slice(); - if (color.length == 3) color.push(1); - color1 = color2 = color; - } - } - if (color1 && color2) { - const cs = lib.linq.cselector; - const g1 = cs.group( - cs.of( - cs.class("card", "fullskin", `${nature}`), - '>', - cs.class("name") - ) - ); - let result = {}; - result[g1] = { - color: `rgba(${color1.join()})`, - border: cs.merge( - '1px', - 'solid', - `rgba(${color2.join()})` - ), - }; - game.dynamicStyle.addObject(result); - - const g2 = cs.group( - cs.of( - cs.class("tempname", `${nature}`), - ':not([data-nature])>', - cs.class("span") - ) - ); - let result2 = {}; - result2[g2] = { - color: `rgba(${color1.join()})`, - }; - game.dynamicStyle.addObject(result2); - } - }], - }; - - /** - * **无名杀频道推送机制** - * - * 鉴于`Javascript`的特性及自身对所需功能的思考,这是一个参考`Golang`的`channel`设计的、完全和`go channel`不一样的异步消息传递对象 - * - * 当且仅当接收方和发送方均存在时进行消息传递,完全保证信息传递的单一性(发送方/接收方一旦确定则无法更改)和准确性(发送方必然将消息发送给接收方) - * - * 若存在发送方/接收方时调用`send`/`receive`,将报错 - * - * 若需要异步/不报错发送信息,请等待`lib.actor` - * - * @example - * // 创建一个频道 - * const channel = new lib.channel(); - * - * // 从某个角落接收channel发出的消息,若无消息则等待 - * const message = await channel.receive(); - * - * // 从某个角落向channel发消息,若无消息接收则等待 - * await channel.send(item); - */ - static channel = Channel; - - /** - * **无名杀消息推送库** - * - * 通过`EventTarget`机制,实现消息推送和接收的解耦, - * 从而使消息接收方无需依赖发布方,发布方也无需考虑接收方 - * - * > `lib.announce`不是`actor`模型,若不存在订阅者,则消息发送将无意义 - * - * @example - * // 甲扩展(如《千幻聆音》)在角色皮肤切换后,调用: - * lib.announce.publish("skinChange", { - * player, - * playerName: "zhangfei", - * originSkin: "image/xxx.jpg", - * currentSkin: "image/yyy.jpg" - * }); - * - * // 乙扩展监听此`skinChange`事件,并修改自己扩展相关界面的图片: - * const method = lib.announce.subscribe("skinChange", (e) => { - * div.setBackgroundImage(e.currentSkin); - * }); - * - * // 若此时乙扩展不想继续订阅`skinChange`事件,可以通过`unsubscribe`解除订阅 - * lib.announce.unsubscribe("skinChange", method); - */ - static announce = new Announce(new EventTarget(), new WeakMap()); - - static objectURL = new Map(); - static hookmap = {}; - static imported = {}; - static layoutfixed = ['chess', 'tafang', 'stone']; - static pinyins = { - _metadata: { - shengmu: ['zh', 'ch', 'sh', 'b', 'p', 'm', 'f', 'd', 't', 'l', 'n', 'g', 'k', 'h', 'j', 'q', 'x', 'r', 'z', 'c', 's', 'y', 'w'], - special_shengmu: ['j', 'q', 'x', 'y'], - feijiemu: { - i: ['ing', 'iu', 'ie', 'in'], - u: ['ui', 'un'], - ü: ['üe', 'ün'], - }, - zhengtirendu: ['zhi', 'chi', 'shi', 'ri', 'zi', 'ci', 'si'], - yunjiao: { - '一麻': ['a', 'ia', 'ua'], - '二波': ['o', 'e', 'uo'], - '三皆': ['ie', 'üe'], - '四开': ['ai', 'uai'], - '五微': ['ei', 'ui'], - '六豪': ['ao', 'iao'], - '七尤': ['ou', 'iu'], - '八寒': ['an', 'ian', 'uan', 'üan'], - '九文': ['en', 'in', 'un', 'ün'], - '十唐': ['ang', 'iang', 'uang'], - '十一庚': ['eng', 'ing', 'ong', 'ung'], - '十二齐': ['i', 'er', 'ü'], - '十三支': ['-i'], - '十四姑': ['u'], - }, - } - }; - /** - * Yingbian - * - * 应变 - */ - static yingbian = { - condition: { - color: new Map([ - ['zhuzhan', 'wood'], - ['kongchao', 'soil'], - ['fujia', 'orange'], - ['canqu', 'fire'], - ['force', 'metal'] - ]), - complex: new Map([ - ['zhuzhan', function (event) { - const yingbianZhuzhan = game.createEvent('yingbianZhuzhan'); - yingbianZhuzhan.player = event.player; - yingbianZhuzhan.card = event.card; - yingbianZhuzhan._trigger = event; - yingbianZhuzhan.yingbianZhuzhanAI = event.yingbianZhuzhanAI; - yingbianZhuzhan.afterYingbianZhuzhan = event.afterYingbianZhuzhan; - yingbianZhuzhan.setContent(() => { - 'step 0'; - event._global_waiting = true; - event.send = (player, card, source, targets, id, id2, yingbianZhuzhanAI, skillState) => { - if (skillState) player.applySkills(skillState); - var type = get.type2(card), str = get.translation(source); - if (targets && targets.length) str += `对${get.translation(targets)}`; - str += `使用了${get.translation(card)},是否弃置一张${get.translation(type)}为其助战?`; - player.chooseCard({ - filterCard: (card, player) => get.type2(card) == type && lib.filter.cardDiscardable(card, player), - prompt: str, - position: 'h', - _global_waiting: true, - id: id, - id2: id2, - ai: typeof yingbianZhuzhanAI == 'function' ? yingbianZhuzhanAI(player, card, source, targets) : cardx => { - var info = get.info(card); - if (info && info.ai && info.ai.yingbian) { - var ai = info.ai.yingbian(card, source, targets, player); - if (!ai) return 0; - return ai - get.value(cardx); - } - else if (get.attitude(player, source) <= 0) return 0; - return 5 - get.value(cardx); - } - }); - if (!game.online) return; - _status.event._resultid = id; - game.resume(); - }; - 'step 1'; - var type = get.type2(card); - event.list = game.filterPlayer(current => current != player && current.countCards('h') && (_status.connectMode || current.hasCard(cardx => get.type2(cardx) == type, 'h'))).sortBySeat(_status.currentPhase || player); - event.id = get.id(); - 'step 2'; - if (!event.list.length) event.finish(); - else if (_status.connectMode && (event.list[0].isOnline() || event.list[0] == game.me)) event.goto(4); - else event.send(event.current = event.list.shift(), event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI); - 'step 3'; - if (result.bool) { - event.zhuzhanresult = event.current; - event.zhuzhanresult2 = result; - if (event.current != game.me) game.delayx(); - event.goto(8); - } - else event.goto(2); - 'step 4'; - var id = event.id, sendback = (result, player) => { - if (result && result.id == id && !event.zhuzhanresult && result.bool) { - event.zhuzhanresult = player; - event.zhuzhanresult2 = result; - game.broadcast('cancel', id); - if (_status.event.id == id && _status.event.name == 'chooseCard' && _status.paused) return () => { - event.resultOL = _status.event.resultOL; - ui.click.cancel(); - if (ui.confirm) ui.confirm.close(); - }; - } - else if (_status.event.id == id && _status.event.name == 'chooseCard' && _status.paused) return () => event.resultOL = _status.event.resultOL; - }, withme = false, withol = false, list = event.list; - for (var i = 0; i < list.length; i++) { - var current = list[i]; - if (current.isOnline()) { - withol = true; - current.wait(sendback); - current.send(event.send, current, event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI, get.skillState(current)); - list.splice(i--, 1); - } - else if (current == game.me) { - withme = true; - event.send(current, event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI); - list.splice(i--, 1); - } - } - if (!withme) event.goto(6); - if (_status.connectMode && (withme || withol)) game.players.forEach(value => { - if (value != player) value.showTimer(); - }); - event.withol = withol; - 'step 5'; - if (!result || !result.bool || event.zhuzhanresult) return; - game.broadcast('cancel', event.id); - event.zhuzhanresult = game.me; - event.zhuzhanresult2 = result; - 'step 6'; - if (event.withol && !event.resultOL) game.pause(); - 'step 7'; - game.players.forEach(value => value.hideTimer()); - 'step 8'; - if (event.zhuzhanresult) { - var target = event.zhuzhanresult; - target.line(player, 'green'); - target.discard(event.zhuzhanresult2.cards).discarder = target; - if (typeof event.afterYingbianZhuzhan == 'function') event.afterYingbianZhuzhan(event, trigger); - var yingbianCondition = event.name.slice(8).toLowerCase(), yingbianConditionTag = `yingbian_${yingbianCondition}_tag`; - target.popup(yingbianConditionTag, lib.yingbian.condition.color.get(yingbianCondition)); - game.log(target, '响应了', player, '发起的', yingbianConditionTag); - target.addExpose(0.2); - event.result = { - bool: true - }; - } - else event.result = { - bool: false - }; - }); - yingbianZhuzhan._args = Array.from(arguments); - return yingbianZhuzhan; - }] - ]), - simple: new Map([ - ['kongchao', event => !event.player.countCards('h')], - ['fujia', event => event.player.isMaxHandcard()], - ['canqu', event => event.player.getHp() == 1] - ]) - }, - effect: new Map([ - ['add', () => { - trigger.yingbian_addTarget = true; - }], - ['remove', () => { - trigger.yingbian_removeTarget = true; - }], - ['damage', () => { - if (typeof trigger.baseDamage != 'number') trigger.baseDamage = 1; - trigger.baseDamage++; - game.log(card, '的伤害值基数+1'); - }], - ['draw', () => { - player.draw(); - }], - ['gain', () => { - const cardx = trigger.respondTo; - if (cardx && cardx[1] && cardx[1].cards && cardx[1].cards.filterInD('od').length) player.gain(cardx[1].cards.filterInD('od'), 'gain2'); - }], - ['hit', () => { - trigger.directHit.addArray(game.players).addArray(game.dead); - game.log(card, '不可被响应'); - }], - ['all', () => { - card.yingbian_all = true; - game.log(card, '执行所有选项'); - }] - ]), - prompt: new Map([ - ['add', '目标+1'], - ['remove', '目标-1'], - ['damage', '伤害+1'], - ['draw', '摸一张牌'], - ['gain', '获得响应的牌'], - ['hit', '此牌不可被响应'], - ['all', '无视条件执行所有选项'] - ]) - }; - /** - * Stratagem buff - * - * 谋攻强化 - */ - static stratagemBuff = { - cost: new Map([ - ['sha', 1], - ['shan', 1], - ['juedou', 2], - ['huogong', 2], - ['tao', 3] - ]), - effect: new Map([ - ['sha', (event, option) => { - if (event.step != 0 || option.state != 'end') return; - game.log(event.player, '触发了强化效果'); - game.log(event.card, '抵消所需要的', new lib.element.VCard({ - name: 'shan' - }), '数+1'); - const map = event.customArgs; - game.players.concat(game.dead).forEach(current => { - const id = current.playerid; - if (!map[id]) map[id] = {}; - if (typeof map[id].shanRequired == 'number') map[id].shanRequired++; - else map[id].shanRequired = 2; - }); - }], - ['shan', (event, option) => { - if (event.step != 0 || option.state != 'end') return; - game.log(event.player, '触发了强化效果'); - game.log('使用', event.card, '时视为两张', new lib.element.VCard({ - name: 'shan' - }), '的效果'); - event.player.when('useCard').filter(evt => evt == event).then(() => { - trigger.getParent(2).decrease('shanRequired', 1); - }); - }], - ['juedou', (event, option) => { - if (event.step != 0 || option.state != 'end') return; - game.log(event.player, '触发了强化效果'); - game.log('对', event.card, '的目标造成伤害时,伤害+1'); - event.player.when({ - source: 'damageBegin1' - }).filter(evt => evt.getParent(2) == event && event.targets.includes(evt.player)).then(() => { - trigger.increase('num'); - }); - }], - ['huogong', (event, option) => { - if (event.step != 0 || option.state != 'end') return; - game.log(event.player, '触发了强化效果'); - game.log(event.card, '造成的伤害+1'); - event.increase('baseDamage', 1); - }], - ['tao', (event, option) => { - if (event.step != 0 || option.state != 'end') return; - game.log(event.player, '触发了强化效果'); - game.log(event.card, '回复的体力+1'); - event.increase('baseDamage', 1); - }] - ]), - prompt: new Map([ - [ - 'sha', - /** - * @type {() => string} - */ - () => `抵消所需要的【${get.translation('shan')}】数+1。` - ], - [ - 'shan', - /** - * @type {() => string} - */ - () => `使用时视为两张【${get.translation('shan')}】的效果。` - ], - [ - 'juedou', - () => '对此牌的目标造成伤害时,伤害+1。' - ], - [ - 'huogong', - () => '造成的伤害+1。' - ], - [ - 'tao', - () => '回复的体力+1。' - ] - ]) - }; - /** - * The actual card name - * - * 实际的卡牌名称 - */ - static actualCardName = new Map([ - ['挟令', '挟天子以令诸侯'], - ['霹雳投石车', '霹雳车'] - ]); - static characterDialogGroup = { - '收藏': function (name, capt) { - return lib.config.favouriteCharacter.includes(name) ? capt : null; - }, - '最近': function (name, capt) { - var list = get.config('recentCharacter') || []; - return list.includes(name) ? capt : null; - } - }; - static listenEnd(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; - }); - } - } - static configMenu = { - general: { - name: '通用', - config: { - mount_combine: { - name: '合并坐骑栏', - init: false, - intro: '
  • 将进攻坐骑栏和防御坐骑栏合并为同一个位置(重启后生效)。', - restart: true, - }, - 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: '当自己需要使用或打出【闪】时,若自己没有【闪】,则跳过该步骤', - }, - unauto_choose: { - 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, - }, - fuck_sojson: { - name: '检测加密扩展', - init: false, - }, - errstop: { - name: '出错时停止游戏', - init: false, - unfrequent: true - }, - update_link: { - name: '更新地址', - init: 'coding', - unfrequent: true, - item: { - coding: 'CSDN', - github: 'GitHub', - }, - onclick: function (item) { - game.saveConfig('update_link', item); - lib.updateURL = lib.updateURLS[item] || lib.updateURLS.coding; - }, - }, - extension_source: { - name: '获取扩展地址', - init: 'GitHub Proxy', - unfrequent: true, - item: {}, - intro: () => `获取在线扩展时的地址。当前地址:${document.createElement('br').outerHTML}${lib.config.extension_sources[lib.config.extension_source]}` - }, - extension_create: { - name: '添加获取扩展地址', - clear: true, - unfrequent: true, - onclick: function () { - game.prompt('请输入地址名称', function (str) { - if (str) { - var map = lib.config.extension_sources; - game.prompt('请输入' + str + '的地址', function (str2) { - if (str2) { - delete map[str]; - map[str] = str2; - game.saveConfig('extension_sources', map); - game.saveConfig('extension_source', str); - var nodexx = ui.extension_source; - nodexx.updateInner(); - var nodeyy = nodexx._link.menu; - var nodezz = nodexx._link.config; - for (var i = 0; i < nodeyy.childElementCount; i++) { - if (nodeyy.childNodes[i]._link == str) { - nodeyy.childNodes[i].remove(); - break; - } - } - var textMenu = ui.create.div('', str, nodeyy, function () { - var node = this.parentNode._link; - var config = node._link.config; - node._link.current = this.link; - var tmpName = node.lastChild.innerHTML; - node.lastChild.innerHTML = config.item[this._link]; - if (config.onclick) { - if (config.onclick.call(node, this._link, this) === false) { - node.lastChild.innerHTML = tmpName; - } - } - if (config.update) { - config.update(); - } - }); - textMenu._link = str; - nodezz.item[name] = str; - alert('已添加扩展地址:' + str); - } - }); - } - }); - }, - }, - extension_delete: { - name: '删除当前扩展地址', - clear: true, - unfrequent: true, - onclick: function () { - var bool = false, map = lib.config.extension_sources; - for (var i in map) { - if (i != lib.config.extension_source) { - bool = true; - break; - } - } - if (!bool) { - alert('不能删除最后一个扩展地址!'); - return; - } - var name = lib.config.extension_source; - game.saveConfig('extension_source', i); - delete map[name]; - game.saveConfig('extension_sources', map); - var nodexx = ui.extension_source; - nodexx.updateInner(); - var nodeyy = nodexx._link.menu; - var nodezz = nodexx._link.config; - for (var i = 0; i < nodeyy.childElementCount; i++) { - if (nodeyy.childNodes[i]._link == name) { - nodeyy.childNodes[i].remove(); - break; - } - } - delete nodezz.item[name]; - alert('已删除扩展地址:' + name); - }, - }, - 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: async (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"); - } - } - lib.announce.publish("Noname.Apperaence.Theme.onChanging", theme); - await new Promise(resolve => setTimeout(resolve, 500)); - - const deletingTheme = ui.css.theme; - ui.css.theme = lib.init.css(lib.assetURL + 'theme/' + lib.config.theme, 'style'); - deletingTheme.remove(); - lib.announce.publish("Noname.Apperaence.Theme.onChanged", theme); - await new Promise(resolve => setTimeout(resolve, 100)); - - ui.arena.show(); - lib.announce.publish("Noname.Apperaence.Theme.onChangeFinished", theme); - } - }, - 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.includes(lib.config.mode)) { - game.saveConfig('layout', layout); - } - else { - lib.init.layout(layout); - } - } - }, - splash_style: { - name: '启动页', - init: 'style1', - item: { - style1: '样式一', - style2: '样式二', - }, - visualMenu: (node, link) => { - node.className = 'button character'; - node.style.width = '200px'; - node.style.height = `${node.offsetWidth * 1080 / 2400}px`; - node.style.display = 'flex'; - node.style.flexDirection = 'column'; - node.style.alignItems = 'center'; - node.style.backgroundSize = '100% 100%'; - node.setBackgroundImage(`image/splash/${link}.jpg`); - } - }, - // 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%', - eebig: '150%', - eeebig: '180%', - eeeebig: '200%', - }, - 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; - case 'eebig': zoom = 1.5; break; - case 'eeebig': zoom = 1.8; break; - case 'eeeebig': zoom = 2; break; - default: zoom = 1; - } - game.documentZoom = game.deviceZoom * zoom; - ui.updatez(); - if (Array.isArray(lib.onresize)) { - lib.onresize.forEach(fun => { - if (typeof fun == 'function') fun(); - }); - } - } - }, - 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.includes('.')) { - 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; i < page.childElementCount; i++) { - if (page.childNodes[i].classList.contains('button')) { - var link = page.childNodes[i]._link; - if (link && link != 'default') { - var str; - if (this.classList.contains('active')) { - if (link.startsWith('custom_') || link.startsWith('cdv_')) { - str = '删除'; - } - else { - str = '隐藏'; - } - } - else { - str = item[link]; - } - page.childNodes[i].firstChild.innerHTML = get.verticalStr(str); - } - } - } - }; - ui.create.div('.menubutton', '编辑背景', node, editbg); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button character'; - node.style.backgroundImage = ''; - node.style.backgroundSize = ''; - if (node.firstChild) { - node.firstChild.innerHTML = get.verticalStr(name); - } - if (link == 'default' || link.startsWith('custom_')) { - node.style.backgroundImage = 'none'; - node.classList.add('dashedmenubutton'); - if (link.startsWith('custom_')) { - game.getDB('image', link, function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.style.backgroundSize = 'cover'; - node.classList.remove('dashedmenubutton'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - else { - node.parentNode.defaultNode = node; - } - } - else { - node.setBackgroundImage('image/background/' + link + '.jpg'); - node.style.backgroundSize = 'cover'; - } - }, - onclick: function (background, node) { - if (node && node.firstChild) { - var menu = node.parentNode; - if (node.firstChild.innerHTML == get.verticalStr('隐藏')) { - menu.parentNode.noclose = true; - node.remove(); - menu.updateBr(); - if (!lib.config.prompt_hidebg) { - alert('隐藏的背景可通过选项-其它-重置隐藏内容恢复'); - game.saveConfig('prompt_hidebg', true); - } - lib.config.hiddenBackgroundPack.add(background); - game.saveConfig('hiddenBackgroundPack', lib.config.hiddenBackgroundPack); - delete lib.configMenu.appearence.config.image_background.item[background]; - if (lib.config.image_background == background) { - background = 'default'; - this.lastChild.innerHTML = '默认'; - } - else { - this.lastChild.innerHTML = lib.configMenu.appearence.config.image_background.item[lib.config.image_background]; - return; - } - } - else if (node.firstChild.innerHTML == get.verticalStr('删除')) { - menu.parentNode.noclose = true; - if (confirm('是否删除此背景?(此操作不可撤销)')) { - node.remove(); - menu.updateBr(); - lib.config.customBackgroundPack.remove(background); - game.saveConfig('customBackgroundPack', lib.config.customBackgroundPack); - if (background.startsWith('cdv_')) { - game.removeFile('image/background/' + background + '.jpg'); - } - else { - game.deleteDB('image', background); - } - delete lib.configMenu.appearence.config.image_background.item[background]; - if (lib.config.image_background == background) { - background = 'default'; - this.lastChild.innerHTML = '默认'; - } - else { - this.lastChild.innerHTML = lib.configMenu.appearence.config.image_background.item[lib.config.image_background]; - return; - } - } - } - } - game.saveConfig('image_background', background); - lib.init.background(); - game.updateBackground(); - }, - }, - image_background_random: { - name: '随机背景', - init: false, - onclick: function (bool) { - game.saveConfig('image_background_random', bool); - lib.init.background(); - } - }, - image_background_blur: { - name: '背景模糊', - init: false, - onclick: function (bool) { - game.saveConfig('image_background_blur', bool); - 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)'; - } - else { - ui.background.style.filter = ''; - ui.background.style.webkitFilter = ''; - ui.background.style.transform = ''; - } - }, - }, - phonelayout: { - name: '触屏布局', - init: false, - onclick: function (bool) { - if (get.is.nomenu('phonelayout', bool)) return false; - game.saveConfig('phonelayout', bool); - 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'); - } - } - }, - change_skin: { - name: '开启换肤', - init: true, - intro: '在武将的右键菜单中换肤,皮肤可在选项-文件-图片文件-皮肤图片中添加' - }, - change_skin_auto: { - name: '自动换肤', - init: 'off', - item: { - 'off': '关闭', - '30000': '半分钟', - '60000': '一分钟', - '120000': '两分钟', - '300000': '五分钟', - }, - intro: '游戏每进行一段时间自动为一个随机角色更换皮肤', - onclick: function (item) { - game.saveConfig('change_skin_auto', item); - clearTimeout(_status.skintimeout); - if (item != 'off') { - _status.skintimeout = setTimeout(ui.click.autoskin, parseInt(item)); - } - } - }, - card_style: { - name: '卡牌样式', - init: 'default', - intro: '设置正面朝上的卡牌的样式', - item: { - wood: '木纹', - music: '音乐', - simple: '原版', - ol: '手杀', - // new:'新版', - custom: '自定', - default: '默认', - }, - visualBar: function (node, item, create, switcher) { - if (node.created) { - return; - } - var button; - for (var i = 0; i < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton', '添加图片', node, function (file) { - if (file) { - game.putDB('image', 'card_style', file, function () { - game.getDB('image', 'card_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.style.backgroundImage = 'url(' + data + ')'; - button.className = 'button card fullskin'; - node.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept = 'image*'; - deletepic = ui.create.div('.menubutton.deletebutton', '删除图片', node, function () { - if (confirm('确定删除自定义图片?(此操作不可撤销)')) { - game.deleteDB('image', 'card_style'); - button.style.backgroundImage = 'none'; - button.className = 'button character dashedmenubutton'; - node.classList.remove('showdelete'); - if (lib.config.card_style == 'custom') { - lib.configMenu.appearence.config.card_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - } - }); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button card fullskin'; - node.style.backgroundSize = '100% 100%'; - switch (link) { - case 'default': case 'custom': { - if (lib.config.theme == 'simple') { - node.style.backgroundImage = 'linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))'; - node.className = 'button character'; - } - else { - node.style.backgroundImage = 'none'; - node.className = 'button character dashedmenubutton'; - } - break; - } - case 'new': node.setBackgroundImage('theme/style/card/image/new.png'); break; - case 'ol': node.setBackgroundImage('theme/style/card/image/ol.png'); break; - case 'wood': node.setBackgroundImage('theme/woodden/wood.jpg'); node.style.backgroundSize = 'initial'; break; - case 'music': node.setBackgroundImage('theme/music/wood3.png'); break; - case 'simple': node.setBackgroundImage('theme/simple/card.png'); break; - } - if (link == 'custom') { - node.classList.add('transparent'); - game.getDB('image', 'card_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.className = 'button card fullskin'; - node.parentNode.lastChild.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - onclick: function (layout) { - game.saveConfig('card_style', layout); - var style = ui.css.card_style; - ui.css.card_style = lib.init.css(lib.assetURL + 'theme/style/card', lib.config.card_style); - style.remove(); - if (ui.css.card_stylesheet) { - ui.css.card_stylesheet.remove(); - delete ui.css.card_stylesheet; - } - if (layout == '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"); - }); - } - }, - unfrequent: true, - }, - cardback_style: { - name: '卡背样式', - intro: '设置背面朝上的卡牌的样式', - init: 'default', - item: { - // wood:'木纹', - // music:'音乐', - official: '原版', - // new:'新版', - feicheng: '废城', - liusha: '流沙', - ol: '手杀', - custom: '自定', - default: '默认', - }, - visualBar: function (node, item, create, switcher) { - if (node.created) { - return; - } - var button; - for (var i = 0; i < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton', '添加图片', node, function (file) { - if (file) { - game.putDB('image', 'cardback_style', file, function () { - game.getDB('image', 'cardback_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.style.backgroundImage = 'url(' + data + ')'; - button.className = 'button character'; - node.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept = 'image/*'; - ui.create.filediv('.menubutton.deletebutton.addbutton', '添加翻转图片', node, function (file) { - if (file) { - game.putDB('image', 'cardback_style2', file, function () { - node.classList.add('hideadd'); - }); - } - }).inputNode.accept = 'image/*'; - deletepic = ui.create.div('.menubutton.deletebutton', '删除图片', node, function () { - if (confirm('确定删除自定义图片?(此操作不可撤销)')) { - game.deleteDB('image', 'cardback_style'); - game.deleteDB('image', 'cardback_style2'); - button.style.backgroundImage = 'none'; - button.className = 'button character dashedmenubutton'; - node.classList.remove('showdelete'); - node.classList.remove('hideadd'); - if (lib.config.cardback_style == 'custom') { - lib.configMenu.appearence.config.cardback_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - } - }); - }, - visualMenu: function (node, link, name, config) { - node.style.backgroundSize = '100% 100%'; - switch (link) { - case 'default': case 'custom': { - node.style.backgroundImage = 'none'; - node.className = 'button character dashedmenubutton'; - break; - } - case 'new': node.className = 'button character'; node.setBackgroundImage('theme/style/cardback/image/new.png'); break; - case 'feicheng': node.className = 'button character'; node.setBackgroundImage('theme/style/cardback/image/feicheng.png'); break; - case 'official': node.className = 'button character'; node.setBackgroundImage('theme/style/cardback/image/official.png'); break; - case 'liusha': node.className = 'button character'; node.setBackgroundImage('theme/style/cardback/image/liusha.png'); break; - case 'ol': node.className = 'button character'; node.setBackgroundImage('theme/style/cardback/image/ol.png'); break; - case 'wood': node.className = 'button card fullskin'; node.setBackgroundImage('theme/woodden/wood.jpg'); node.style.backgroundSize = 'initial'; break; - case 'music': node.className = 'button card fullskin'; node.setBackgroundImage('theme/music/wood3.png'); break; - } - if (link == 'custom') { - node.classList.add('transparent'); - game.getDB('image', 'cardback_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.className = 'button character'; - node.parentNode.lastChild.classList.add('showdelete'); - game.getDB('image', 'cardback_style2', function (file) { - if (file) { - node.parentNode.lastChild.classList.add('hideadd'); - } - }); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - onclick: function (layout) { - game.saveConfig('cardback_style', layout); - var style = ui.css.cardback_style; - ui.css.cardback_style = lib.init.css(lib.assetURL + 'theme/style/cardback', lib.config.cardback_style); - style.remove(); - if (ui.css.cardback_stylesheet) { - ui.css.cardback_stylesheet.remove(); - delete ui.css.cardback_stylesheet; - } - if (ui.css.cardback_stylesheet2) { - ui.css.cardback_stylesheet2.remove(); - delete ui.css.cardback_stylesheet2; - } - if (layout == '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 + ')}'); - 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"); - }); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - unfrequent: true, - }, - hp_style: { - name: '体力条样式', - init: 'ol', - item: { - default: '默认', - // official:'勾玉', - emotion: '表情', - glass: '勾玉', - round: '国战', - ol: '手杀', - xinglass: '双鱼', - xinround: 'OL', - custom: '自定', - }, - visualBar: function (node, item, create, switcher) { - if (node.created) { - return; - } - var button; - for (var i = 0; i < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton.addbutton', '添加图片', node, function (file) { - if (file && node.currentDB) { - game.putDB('image', 'hp_style' + node.currentDB, file, function () { - game.getDB('image', 'hp_style' + node.currentDB, function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.childNodes[node.currentDB - 1].style.backgroundImage = 'url(' + data + ')'; - button.classList.add('shown'); - node.classList.add('showdelete'); - node.currentDB++; - if (node.currentDB > 4) { - 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; i < button.childElementCount; i++) { - button.childNodes[i].style.backgroundImage = 'none'; - } - node.classList.remove('showdelete'); - node.classList.remove('hideadd'); - if (lib.config.hp_style == 'custom') { - lib.configMenu.appearence.config.hp_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - button.classList.remove('shown'); - node.currentDB = 1; - } - }); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button hpbutton dashedmenubutton'; - node.innerHTML = ''; - for (var i = 1; i <= 4; i++) { - var div = ui.create.div(node); - if (link == 'default') { - ui.create.div(div); - } - else if (link != 'custom') { - div.setBackgroundImage('theme/style/hp/image/' + link + i + '.png'); - } - if (i == 4) { - div.style.webkitFilter = 'grayscale(1)'; - } - } - if (link == 'custom') { - node.classList.add('transparent'); - var getDB = function (num) { - node.parentNode.lastChild.currentDB = num; - game.getDB('image', 'hp_style' + num, function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.childNodes[num - 1].style.backgroundImage = 'url(' + data + ')'; - node.classList.add('shown'); - node.parentNode.lastChild.classList.add('showdelete'); - if (num < 4) { - getDB(num + 1); - } - else { - node.parentNode.lastChild.classList.add('hideadd'); - node.classList.remove('transparent'); - delete node.parentNode.firstChild.currentDB; - } - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }; - getDB(1); - } - }, - onclick: function (layout) { - game.saveConfig('hp_style', layout); - var style = ui.css.hp_style; - ui.css.hp_style = lib.init.css(lib.assetURL + 'theme/style/hp', lib.config.hp_style); - style.remove(); - if (ui.css.hp_stylesheet1) { - ui.css.hp_stylesheet1.remove(); - delete ui.css.hp_stylesheet1; - } - if (ui.css.hp_stylesheet2) { - ui.css.hp_stylesheet2.remove(); - delete ui.css.hp_stylesheet2; - } - if (ui.css.hp_stylesheet3) { - ui.css.hp_stylesheet3.remove(); - delete ui.css.hp_stylesheet3; - } - if (ui.css.hp_stylesheet4) { - ui.css.hp_stylesheet4.remove(); - delete ui.css.hp_stylesheet4; - } - if (layout == '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"); - }); - } - }, - 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 < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton', '添加图片', node, function (file) { - if (file) { - game.putDB('image', 'player_style', file, function () { - game.getDB('image', 'player_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.style.backgroundImage = 'url(' + data + ')'; - button.className = 'button character'; - button.style.backgroundSize = '100% 100%'; - node.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept = 'image/*'; - deletepic = ui.create.div('.menubutton.deletebutton', '删除图片', node, function () { - if (confirm('确定删除自定义图片?(此操作不可撤销)')) { - game.deleteDB('image', 'player_style'); - button.style.backgroundImage = 'none'; - button.className = 'button character dashedmenubutton'; - node.classList.remove('showdelete'); - if (lib.config.player_style == 'custom') { - lib.configMenu.appearence.config.player_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - } - }); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button character'; - node.style.backgroundSize = ''; - node.style.height = '108px'; - switch (link) { - case 'default': case 'custom': { - node.style.backgroundImage = 'none'; - node.className = 'button character dashedmenubutton'; - break; - } - case 'wood': node.setBackgroundImage('theme/woodden/wood.jpg'); break; - case 'music': node.style.backgroundImage = 'linear-gradient(#4b4b4b, #464646)'; break; - case 'simple': node.style.backgroundImage = 'linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))'; break; - } - if (link == 'custom') { - node.classList.add('transparent'); - game.getDB('image', 'player_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.className = 'button character'; - node.parentNode.lastChild.classList.add('showdelete'); - node.style.backgroundSize = '100% 100%'; - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - onclick: function (layout) { - game.saveConfig('player_style', layout); - if (ui.css.player_stylesheet) { - ui.css.player_stylesheet.remove(); - delete ui.css.player_stylesheet; - } - if (layout == 'custom') { - 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"); - }); - } - 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)'; break; - case 'simple': str = 'linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))'; break; - } - ui.css.player_stylesheet = lib.init.sheet('#window .player{background-image:' + str + '}'); - } - }, - unfrequent: true, - }, - border_style: { - name: '角色边框', - init: 'default', - intro: '设置角色边框的样式,当设为自动时,样式将随着一局游戏中伤害或击杀的数量自动改变', - item: { - gold: '金框', - silver: '银框', - bronze: '铜框', - dragon_gold: '金龙', - dragon_silver: '银龙', - dragon_bronze: '玉龙', - custom: '自定', - auto: '自动', - default: '默认', - }, - visualBar: function (node, item, create, switcher) { - if (node.created) { - return; - } - var button; - for (var i = 0; i < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton', '添加图片', node, function (file) { - if (file) { - game.putDB('image', 'border_style', file, function () { - game.getDB('image', 'border_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.style.backgroundImage = 'url(' + data + ')'; - button.className = 'button character'; - button.style.backgroundSize = '100% 100%'; - node.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept = 'image/*'; - deletepic = ui.create.div('.menubutton.deletebutton', '删除图片', node, function () { - if (confirm('确定删除自定义图片?(此操作不可撤销)')) { - game.deleteDB('image', 'border_style'); - button.style.backgroundImage = 'none'; - button.className = 'button character dashedmenubutton'; - node.classList.remove('showdelete'); - if (lib.config.border_style == 'custom') { - lib.configMenu.appearence.config.border_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - } - }); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button character'; - node.style.backgroundSize = ''; - node.style.height = '108px'; - node.dataset.decoration = ''; - if (link == 'default' || link == 'custom' || link == 'auto') { - node.style.backgroundImage = 'none'; - node.className = 'button character dashedmenubutton'; - } - else { - if (link.startsWith('dragon_')) { - link = link.slice(7); - node.dataset.decoration = link; - } - node.setBackgroundImage('theme/style/player/' + link + '1.png'); - node.style.backgroundSize = '100% 100%'; - } - if (link == 'custom') { - node.classList.add('transparent'); - game.getDB('image', 'border_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.className = 'button character'; - node.parentNode.lastChild.classList.add('showdelete'); - node.style.backgroundSize = '100% 100%'; - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - onclick: function (layout) { - game.saveConfig('border_style', layout); - if (ui.css.border_stylesheet) { - ui.css.border_stylesheet.remove(); - delete ui.css.border_stylesheet; - } - if (layout == '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.id = "ui.css.border"; - 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"); - }); - } - else if (layout != 'default' && layout != 'auto') { - ui.css.border_stylesheet = lib.init.sheet(); - if (layout.startsWith('dragon_')) { - 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 < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton', '添加图片', node, function (file) { - if (file) { - game.putDB('image', 'menu_style', file, function () { - game.getDB('image', 'menu_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.style.backgroundImage = 'url(' + data + ')'; - button.style.backgroundSize = 'cover'; - button.className = 'button character'; - node.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept = 'image/*'; - deletepic = ui.create.div('.menubutton.deletebutton', '删除图片', node, function () { - if (confirm('确定删除自定义图片?(此操作不可撤销)')) { - game.deleteDB('image', 'menu_style'); - button.style.backgroundImage = 'none'; - button.style.backgroundSize = 'auto'; - button.className = 'button character dashedmenubutton'; - node.classList.remove('showdelete'); - if (lib.config.menu_style == 'custom') { - lib.configMenu.appearence.config.menu_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - } - }); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button character'; - node.style.backgroundSize = 'auto'; - switch (link) { - case 'default': case 'custom': { - node.style.backgroundImage = 'none'; - node.classList.add('dashedmenubutton'); - break; - } - case 'wood': node.setBackgroundImage('theme/woodden/wood2.png'); break; - case 'music': node.style.backgroundImage = 'linear-gradient(#4b4b4b, #464646)'; break; - case 'simple': node.style.backgroundImage = 'linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))'; break; - } - if (link == 'custom') { - node.classList.add('transparent'); - game.getDB('image', 'menu_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.style.backgroundSize = 'cover'; - node.className = 'button character'; - node.parentNode.lastChild.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - onclick: function (layout) { - game.saveConfig('menu_style', layout); - if (ui.css.menu_stylesheet) { - ui.css.menu_stylesheet.remove(); - delete ui.css.menu_stylesheet; - } - if (layout == '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"); - }); - } - 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; i < node.parentNode.childElementCount; i++) { - if (node.parentNode.childNodes[i]._link == 'custom') { - button = node.parentNode.childNodes[i]; - } - } - if (!button) { - return; - } - node.created = true; - var deletepic; - ui.create.filediv('.menubutton', '添加图片', node, function (file) { - if (file) { - game.putDB('image', 'control_style', file, function () { - game.getDB('image', 'control_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - button.style.backgroundImage = 'url(' + data + ')'; - button.className = 'button character controlbutton'; - node.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - }); - } - }).inputNode.accept = 'image/*'; - deletepic = ui.create.div('.menubutton.deletebutton', '删除图片', node, function () { - if (confirm('确定删除自定义图片?(此操作不可撤销)')) { - game.deleteDB('image', 'control_style'); - button.style.backgroundImage = 'none'; - button.className = 'button character controlbutton dashedmenubutton'; - node.classList.remove('showdelete'); - if (lib.config.control_style == 'custom') { - lib.configMenu.appearence.config.control_style.onclick('default'); - switcher.lastChild.innerHTML = '默认'; - } - button.classList.add('transparent'); - } - }); - }, - visualMenu: function (node, link, name, config) { - node.className = 'button character controlbutton'; - node.style.backgroundSize = ''; - switch (link) { - case 'default': case 'custom': { - node.style.backgroundImage = 'none'; - node.classList.add('dashedmenubutton'); - break; - } - case 'wood': node.setBackgroundImage('theme/woodden/wood.jpg'); break; - case 'music': node.style.backgroundImage = 'linear-gradient(#4b4b4b, #464646)'; break; - case 'simple': node.style.backgroundImage = 'linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))'; break; - } - if (link == 'custom') { - node.classList.add('transparent'); - game.getDB('image', 'control_style', function (fileToLoad) { - if (!fileToLoad) return; - var fileReader = new FileReader(); - fileReader.onload = function (fileLoadedEvent) { - var data = fileLoadedEvent.target.result; - node.style.backgroundImage = 'url(' + data + ')'; - node.className = 'button character controlbutton'; - node.parentNode.lastChild.classList.add('showdelete'); - }; - fileReader.readAsDataURL(fileToLoad, "UTF-8"); - }); - } - }, - onclick: function (layout) { - game.saveConfig('control_style', layout); - if (ui.css.control_stylesheet) { - ui.css.control_stylesheet.remove(); - delete ui.css.control_stylesheet; - } - if (layout == '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"); - }); - } - 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 < game.players.length; i++) { - if (game.players[i].isLinked()) { - list.push(game.players[i]); - } - } - game.saveConfig('link_style2', style); - for (var i = 0; i < list.length; i++) { - if (get.is.linked2(list[i])) { - list[i].classList.add('linked2'); - list[i].classList.remove('linked'); - } - else { - list[i].classList.add('linked'); - list[i].classList.remove('linked2'); - } - } - if (style == 'chain') { - ui.arena.classList.remove('nolink'); - } - else { - ui.arena.classList.add('nolink'); - } - ui.updatem(); - } - }, - cardshape: { - name: '手牌显示', - intro: '将手牌设置为正方形或长方形', - init: 'default', - unfrequent: true, - item: { - default: '默认', - oblong: '长方', - }, - onclick: function (item) { - var linked = false; - if (game.me && game.me.isLinked()) { - linked = true; - } - game.saveConfig('cardshape', item); - if (item == '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 (linked) { - if (get.is.linked2(game.me)) { - game.me.classList.remove('linked'); - game.me.classList.add('linked2'); - } - else { - game.me.classList.add('linked'); - game.me.classList.remove('linked2'); - } - } - } - }, - cardtempname: { - name: '视为卡牌名称显示', - intro: '显示强制视为类卡牌(如武魂),包括拆顺对话框内的判定牌(国色)转换等名称的显示方式', - init: 'image', - unfrequent: true, - item: { - default: '纵向', - horizon: '横向', - image: '图片', - off: '禁用', - }, - onclick: function (item) { - game.saveConfig('cardtempname', item); - if (!game.me || !game.me.getCards) return; - var hs = game.me.getCards('h'); - for (var i = 0; i < hs.length; i++) { - if (hs[i]._tempName) { - switch (item) { - case 'default': - case 'horizon': - case 'image': - ui.create.cardTempName(hs[i]); - break; - default: - hs[i]._tempName.delete(); - delete hs[i]._tempName; - } - } - } - } - }, - /*textequip:{ - name:'装备显示', - init:'image', - unfrequent:true, - item:{ - image:'图片', - text:'文字', - }, - onclick:function(item){ - game.saveConfig('textequip',item); - if(item=='text'&&(game.layout=='long'||game.layout=='mobile')){ - ui.arena.classList.add('textequip'); - } - else{ - ui.arena.classList.remove('textequip'); - } - } - },*/ - buttoncharacter_style: { - name: '选将样式', - init: 'default', - item: { - default: '默认', - simple: '精简', - old: '旧版' - }, - unfrequent: true, - }, - buttoncharacter_prefix: { - name: '武将前缀', - init: 'default', - item: { - default: '默认', - simple: '不显示颜色', - off: '不显示前缀' - }, - unfrequent: true, - }, - cursor_style: { - name: '鼠标指针', - init: 'auto', - intro: '设置为固定后鼠标指针将不随移动到的区域而变化', - unfrequent: true, - item: { - auto: '自动', - pointer: '固定' - }, - onclick: function (item) { - game.saveConfig('cursor_style', item); - if (item == 'pointer') { - ui.window.classList.add('nopointer'); - } - else { - ui.window.classList.remove('nopointer'); - } - } - }, - name_font: { - name: '人名字体', - init: 'xingkai', - unfrequent: true, - item: {}, - textMenu: function (node, link) { - if (link != 'default') { - node.style.fontFamily = link; - } - node.style.fontSize = '20px'; - }, - onclick: function (font) { - game.saveConfig('name_font', font); - lib.init.cssstyles(); - } - }, - identity_font: { - name: '身份字体', - init: 'huangcao', - unfrequent: true, - item: {}, - textMenu: function (node, link) { - if (link != 'default') { - node.style.fontFamily = link; - } - node.style.fontSize = '20px'; - }, - onclick: function (font) { - game.saveConfig('identity_font', font); - lib.init.cssstyles(); - } - }, - cardtext_font: { - name: '卡牌字体', - init: 'default', - unfrequent: true, - item: {}, - textMenu: function (node, link) { - if (link != 'default') { - node.style.fontFamily = link; - } - node.style.fontSize = '20px'; - }, - onclick: function (font) { - game.saveConfig('cardtext_font', font); - lib.init.cssstyles(); - } - }, - global_font: { - name: '界面字体', - init: 'default', - unfrequent: true, - item: {}, - textMenu: function (node, link) { - if (link != 'default') { - node.style.fontFamily = link; - } - else { - node.style.fontFamily = "'STHeiti','SimHei','Microsoft JhengHei','Microsoft YaHei','WenQuanYi Micro Hei','Suits',Helvetica,Arial,sans-serif"; - } - node.style.fontSize = '20px'; - }, - onclick: function (font) { - game.saveConfig('global_font', font); - lib.init.cssstyles(); - } - }, - suits_font: { - name: '替换花色字体', - init: true, - unfrequent: true, - intro: '使用全角字符的花色替代系统自带的花色(重启游戏后生效)', - onclick: function (bool) { - game.saveConfig('suits_font', bool); - } - }, - update: function (config, map) { - if (lib.config.custom_button) { - map.custom_button_system_top.show(); - map.custom_button_system_bottom.show(); - map.custom_button_control_top.show(); - map.custom_button_control_bottom.show(); - } - else { - map.custom_button_system_top.hide(); - map.custom_button_system_bottom.hide(); - map.custom_button_control_top.hide(); - map.custom_button_control_bottom.hide(); - } - if (lib.config.change_skin) { - map.change_skin_auto.show(); - } - else { - map.change_skin_auto.hide(); - } - if (lib.config.image_background_random) { - map.image_background_blur.show(); - map.image_background.hide(); - // map.import_background.hide(); - } - else { - map.image_background.show(); - if (lib.config.image_background == 'default') { - map.image_background_blur.hide(); - } - else { - map.image_background_blur.show(); - } - // if(lib.config.image_background=='custom'&&lib.db){ - // map.import_background.show(); - // } - // else{ - // map.import_background.hide(); - // } - } - if (lib.config.layout == 'long' || lib.config.layout == 'mobile') { - //map.textequip.show(); - map.cardshape.show(); - map.phonelayout.show(); - } - else { - //map.textequip.hide(); - if (lib.config.layout == 'long2' || lib.config.layout == 'nova') { - map.phonelayout.show(); - map.cardshape.show(); - } - else { - map.phonelayout.hide(); - map.cardshape.hide(); - } - } - if (lib.config.layout == 'long') { - // map.fewplayer.show(); - map.player_height.show(); - } - else { - // map.fewplayer.hide(); - if (lib.config.layout == 'long2') { - map.player_height.show(); - } - else { - map.player_height.hide(); - } - } - if (lib.config.layout == 'nova') { - map.player_height_nova.show(); - } - else { - map.player_height_nova.hide(); - } - if (lib.config.touchscreen) { - map.cursor_style.hide(); - } - else { - map.cursor_style.show(); - } - if (lib.config.border_style == 'auto') { - map.autoborder_count.show(); - map.autoborder_start.show(); - } - else { - map.autoborder_count.hide(); - map.autoborder_start.hide(); - } - }, - } - }, - view: { - name: '显示', - config: { - update: function (config, map) { - if (lib.config.mode == 'versus' || lib.config.mode == 'chess' || lib.config.mode == 'tafang' || lib.config.mode == 'boss') { - map.show_handcardbutton.show(); - } - else { - map.show_handcardbutton.hide(); - } - if (lib.config.touchscreen) { - map.pop_logv.hide(); - } - else { - map.pop_logv.show(); - } - if (lib.device) { - if (lib.device == 'android') { - map.show_statusbar_android.show(); - map.show_statusbar_ios.hide(); - } - else if (lib.device == 'ios') { - map.show_statusbar_ios.show(); - map.show_statusbar_android.hide(); - } - if (!game.download) { - setTimeout(function () { - if (!window.StatusBar) { - map.show_statusbar.hide(); - } - }, 5000); - } - } - else { - map.show_statusbar_ios.hide(); - map.show_statusbar_android.hide(); - } - if (get.is.phoneLayout()) { - map.remember_round_button.show(); - map.popequip.show(); - map.filternode_button.show(); - map.show_pause.hide(); - map.show_auto.hide(); - map.show_replay.hide(); - map.show_round_menu.show(); - } - else { - map.show_pause.show(); - map.show_auto.show(); - map.show_replay.show(); - map.show_round_menu.hide(); - map.remember_round_button.hide(); - map.popequip.hide(); - map.filternode_button.hide(); - } - if (lib.config.show_card_prompt) { - map.hide_card_prompt_basic.show(); - map.hide_card_prompt_equip.show(); - } - else { - map.hide_card_prompt_basic.hide(); - map.hide_card_prompt_equip.hide(); - } - if (lib.config.show_log != 'off') { - map.clear_log.show(); - } - else { - map.clear_log.hide(); - } - if (get.is.phoneLayout()) { - map.show_time2.show(); - map.show_time.hide(); - if (lib.config.show_time2) { - map.watchface.show(); - } - else { - map.watchface.hide(); - } - } - else { - map.show_time2.hide(); - map.show_time.show(); - map.watchface.hide(); - } - if (lib.config.show_extensionmaker) { - map.show_extensionshare.show(); - } - else { - map.show_extensionshare.hide(); - } - }, - show_history: { - name: '出牌记录栏', - init: 'off', - intro: '在屏幕左侧或右侧显示出牌记录', - unfrequent: true, - item: { - off: '关闭', - left: '靠左', - right: '靠右', - }, - onclick: function (bool) { - if (lib.config.show_history == 'right') ui.window.addTempClass('rightbar2'); - game.saveConfig('show_history', bool); - if (_status.video || !_status.prepareArena) return; - if (bool == 'left') { - ui.window.classList.add('leftbar'); - ui.window.classList.remove('rightbar'); - } - else if (bool == 'right') { - ui.window.classList.remove('leftbar'); - ui.window.classList.add('rightbar'); - } - else { - ui.window.classList.remove('leftbar'); - ui.window.classList.remove('rightbar'); - } - } - }, - pop_logv: { - name: '自动弹出记录', - init: false, - unfrequent: true - }, - show_log: { - name: '历史记录栏', - init: 'off', - intro: '在屏幕中部显示出牌文字记录', - unfrequent: true, - item: { - off: '关闭', - left: '靠左', - center: '居中', - right: '靠右', - }, - onclick: function (bool) { - game.saveConfig('show_log', bool); - if (lib.config.show_log != 'off') { - ui.arenalog.style.display = ''; - ui.arenalog.dataset.position = bool; - } - else { - ui.arenalog.style.display = 'none'; - ui.arenalog.innerHTML = ''; - } - } - }, - clear_log: { - name: '自动清除历史记录', - init: false, - unfrequent: true, - intro: '开启后将定时清除历史记录栏的条目(而不是等记录栏满后再清除)' - }, - log_highlight: { - name: '历史记录高亮', - init: true, - unfrequent: true, - intro: '开启后历史记录不同类别的信息将以不同颜色显示', - }, - show_time: { - name: '显示时间', - intro: '在屏幕顶部显示当前时间', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_time', bool); - if (bool) { - ui.time.style.display = ''; - } - else { - ui.time.style.display = 'none'; - } - } - }, - show_time2: { - name: '显示时间', - intro: '在触屏按钮处显示当前时间', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_time2', bool); - if (bool) { - ui.roundmenu.classList.add('clock'); - } - else { - ui.roundmenu.classList.remove('clock'); - } - } - }, - watchface: { - name: '表盘样式', - init: 'none', - unfrequent: true, - item: { - none: '默认', - simple: '简约', - }, - onclick: function (item) { - game.saveConfig('watchface', item); - ui.roundmenu.dataset.watchface = item; - } - }, - show_time3: { - name: '显示游戏时间', - init: false, - unfrequent: true - }, - show_statusbar_android: { - name: '显示状态栏', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_statusbar', bool); - if (window.StatusBar && lib.device == 'android') { - if (bool) { - window.StatusBar.overlaysWebView(false); - window.StatusBar.backgroundColorByName('black'); - window.StatusBar.show(); - } - else { - window.StatusBar.hide(); - } - } - } - }, - show_statusbar_ios: { - name: '显示状态栏', - init: 'off', - unfrequent: true, - item: { - default: '默认', - overlay: '嵌入', - auto: '自动', - off: '关闭' - }, - onclick: function (bool) { - game.saveConfig('show_statusbar_ios', bool); - if (window.StatusBar && lib.device == 'ios') { - if (bool != 'off' && bool != 'auto') { - if (lib.config.show_statusbar_ios == 'default') { - window.StatusBar.overlaysWebView(false); - document.body.classList.remove('statusbar'); - } - else { - window.StatusBar.overlaysWebView(true); - document.body.classList.add('statusbar'); - } - window.StatusBar.backgroundColorByName('black'); - window.StatusBar.show(); - } - else { - document.body.classList.remove('statusbar'); - window.StatusBar.hide(); - } - } - } - }, - show_card_prompt: { - name: '显示出牌信息', - intro: '出牌时在使用者上显示卡牌名称', - init: true, - unfrequent: true, - }, - hide_card_prompt_basic: { - name: '隐藏基本牌信息', - intro: '不显示基本牌名称', - init: false, - unfrequent: true, - }, - hide_card_prompt_equip: { - name: '隐藏装备牌信息', - intro: '不显示装备牌名称', - init: false, - unfrequent: true, - }, - show_phase_prompt: { - name: '显示阶段信息', - intro: '在当前回合不同阶段开始时显示阶段名称', - init: true, - unfrequent: true, - }, - show_phaseuse_prompt: { - name: '出牌阶段提示', - intro: '在你出牌时显示提示文字', - init: true, - unfrequent: true, - }, - auto_popped_config: { - name: '自动弹出选项', - intro: '鼠标移至选项按钮时弹出模式选择菜单', - init: true, - unfrequent: true, - }, - auto_popped_history: { - name: '自动弹出历史', - intro: '鼠标移至暂停按钮时弹出历史记录菜单', - init: false, - unfrequent: true, - }, - show_round_menu: { - name: '显示触屏按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - if (get.is.nomenu('show_round_menu', bool)) return false; - game.saveConfig('show_round_menu', bool); - if (bool && ui.roundmenu) { - ui.roundmenu.style.display = ''; - } - else { - ui.roundmenu.style.display = 'none'; - alert('关闭触屏按钮后可通过手势打开菜单(默认为下划)'); - } - } - }, - remember_round_button: { - name: '记住按钮位置', - intro: '重新开始后触屏按钮将保存的上一局的位置', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('remember_round_button', bool); - if (!bool) { - ui.click.resetround(); - } - } - }, - remember_dialog: { - name: '记住对话框位置', - intro: '移动对话框后新的对话框也将在移动后的位置显示', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('remember_dialog', bool); - if (!bool) { - if (ui.dialog) { - var dialog = ui.dialog; - dialog.style.transform = ''; - dialog._dragtransform = [0, 0]; - dialog.style.transition = 'all 0.3s'; - dialog._dragtouches; - dialog._dragorigin; - dialog._dragorigintransform; - setTimeout(function () { - dialog.style.transition = ''; - }, 500); - } - game.saveConfig('dialog_transform', [0, 0]); - } - } - }, - transparent_dialog: { - name: '堆叠对话框虚化', - init: false, - intro: '当具有static属性的对话框堆叠(如五谷丰登对话框中提示无懈可击)时,将后方的对话框变为半透明', - onclick: function (bool) { - game.saveConfig('transparent_dialog', bool); - if (bool) { - for (var i = 0; i < ui.dialogs.length; i++) { - if (ui.dialogs[i] != ui.dialog && ui.dialogs[i].static) { - ui.dialogs[i].unfocus(); - } - } - } - else { - for (var i = 0; i < ui.dialogs.length; i++) { - if (ui.dialogs[i] != ui.dialog && ui.dialogs[i].static) { - ui.dialogs[i].refocus(); - } - } - } - } - }, - show_rarity: { - name: '显示武将评级', - init: false, - intro: '仅供娱乐,重启后生效', - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_rarity', bool); - } - }, - mark_identity_style: { - name: '标记身份操作', - intro: '设置单击身份按钮时的操作', - unfrequent: true, - init: 'menu', - item: { - menu: '菜单', - click: '单击', - }, - }, - character_dialog_tool: { - name: '自由选将显示', - intro: '点击自由选将时默认显示的条目', - init: '最近', - item: { - '收藏': '收藏', - '最近': '最近', - 'all': '全部' - }, - unfrequent: true, - }, - recent_character_number: { - name: '最近使用武将', - intro: '自由选将对话框中最近使用武将的数量', - init: '12', - item: { - '6': '6', - '12': '12', - '20': '24', - '30': '36', - }, - unfrequent: true - }, - popequip: { - name: '触屏装备选择', - intro: '设置触屏布局中选择装备的方式', - init: true, - unfrequent: true, - }, - filternode_button: { - name: '触屏筛选按钮', - intro: '设置自由选将对话框中筛选按钮的样式', - init: true, - unfrequent: true, - }, - show_charactercard: { - name: '显示武将资料', - intro: '在武将界面单击时弹出武将资料卡', - init: true, - unfrequent: true - }, - show_favourite: { - name: '显示添加收藏', - intro: '在角色的右键菜单中显示添加收藏', - init: false, - unfrequent: true - }, - show_favmode: { - name: '显示模式收藏', - intro: '快捷菜单中显示收藏模式', - init: true, - unfrequent: true - }, - show_favourite_menu: { - name: '显示收藏菜单', - intro: '在选项-武将中显示收藏一栏', - init: true, - unfrequent: true - }, - show_ban_menu: { - name: '显示禁将菜单', - intro: '在选项-武将中显示禁将一栏', - init: true, - unfrequent: true - }, - right_range: { - name: '显示距离信息', - intro: '在角色的右键菜单中显示距离等信息', - init: true, - unfrequent: true - }, - hide_card_image: { - name: '隐藏卡牌背景', - intro: '所有卡牌将使用文字作为背景', - init: false, - unfrequent: true, - restart: true, - }, - show_name: { - name: '显示角色名称', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_name', bool); - if (bool) { - ui.arena.classList.remove('hide_name'); - } - else { - ui.arena.classList.add('hide_name'); - } - } - }, - show_sex: { - name: '显示角色性别', - intro: '在角色的右键菜单中显示角色性别', - init: true, - unfrequent: true - }, - show_group: { - name: '显示角色势力', - intro: '在角色的右键菜单中显示角色势力', - init: true, - unfrequent: true - }, - show_replay: { - name: '显示重来按钮', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_replay', bool); - if (lib.config.show_replay) { - ui.replay.style.display = ''; - } - else { - ui.replay.style.display = 'none'; - } - } - }, - show_playerids: { - name: '显示身份按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_playerids', bool); - if (lib.config.show_playerids) { - ui.playerids.style.display = ''; - } - else { - ui.playerids.style.display = 'none'; - } - } - }, - show_sortcard: { - name: '显示整理手牌按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_sortcard', bool); - if (lib.config.show_sortcard) { - ui.sortCard.style.display = ''; - } - else { - ui.sortCard.style.display = 'none'; - } - } - }, - show_pause: { - name: '显示暂停按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_pause', bool); - if (lib.config.show_pause) { - ui.pause.style.display = ''; - } - else { - ui.pause.style.display = 'none'; - } - } - }, - show_auto: { - name: '显示托管按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_auto', bool); - if (lib.config.show_auto) { - ui.auto.style.display = ''; - } - else { - ui.auto.style.display = 'none'; - } - } - }, - show_volumn: { - name: '显示音量按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_volumn', bool); - if (lib.config.show_volumn) { - ui.volumn.style.display = ''; - } - else { - ui.volumn.style.display = 'none'; - } - } - }, - show_cardpile: { - name: '显示牌堆按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_cardpile', bool); - if (bool) { - ui.cardPileButton.style.display = ''; - } - else { - ui.cardPileButton.style.display = 'none'; - } - } - }, - show_cardpile_number: { - name: '显示剩余牌数', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_cardpile_number', bool); - if (bool) { - ui.cardPileNumber.style.display = ''; - } - else { - ui.cardPileNumber.style.display = 'none'; - } - } - }, - show_handcardbutton: { - name: '显示手牌按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_handcardbutton', bool); - } - }, - show_giveup: { - name: '显示投降按钮', - init: true, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_giveup', bool); - } - }, - show_wuxie: { - name: '显示无懈按钮', - intro: '在右上角显示不询问无懈', - init: false, - unfrequent: true, - onclick: function (bool) { - game.saveConfig('show_wuxie', bool); - if (lib.config.show_wuxie) { - ui.wuxie.style.display = ''; - } - else { - ui.wuxie.style.display = 'none'; - } - } - }, - wuxie_right: { - name: '无懈按钮靠左', - init: true, - unfrequent: true, - }, - show_discardpile: { - name: '暂停时显示弃牌堆', - init: false, - unfrequent: true, - }, - show_extensionmaker: { - name: '显示制作扩展', - init: true, - unfrequent: true, - }, - show_extensionshare: { - name: '显示分享扩展', - init: true, - unfrequent: true, - }, - show_characternamepinyin: { - name: '显示武将名注解', - intro: '在武将资料卡显示武将名及其注解、性别、势力、体力等信息', - init: 'showPinyin', - unfrequent: true, - item: { - doNotShow: '不显示', - showPinyin: '拼音(样式一)', - showCodeIdentifier: '代码ID(样式一)', - showPinyin2: '拼音(样式二)', - showCodeIdentifier2: '代码ID(样式二)', - }, - visualMenu: (node, link, name) => { - node.classList.add('button', 'character'); - const style = node.style; - style.alignItems = 'center'; - style.animation = 'background-position-left-center-right-center-left-center 15s ease infinite'; - style.background = 'linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB)'; - style.backgroundSize = '400% 400%'; - style.display = 'flex'; - style.height = '60px'; - style.justifyContent = 'center'; - style.width = '180px'; - const firstChild = node.firstChild; - firstChild.removeAttribute('class'); - firstChild.style.position = 'initial'; - if (link == 'doNotShow') return; - const ruby = document.createElement('ruby'); - ruby.textContent = name; - const rt = document.createElement('rt'); - rt.style.fontSize = 'smaller'; - if (link == 'showPinyin2' || link == 'showCodeIdentifier2') { - rt.textContent = link == 'showCodeIdentifier2' ? '[' + link + ']' : '[' + get.pinyin(name) + ']'; - ruby.appendChild(rt); - } else { - const leftParenthesisRP = document.createElement('rp'); - leftParenthesisRP.textContent = '('; - ruby.appendChild(leftParenthesisRP); - rt.textContent = link == 'showCodeIdentifier' ? link : get.pinyin(name).join(' '); - ruby.appendChild(rt); - const rightParenthesisRP = document.createElement('rp'); - rightParenthesisRP.textContent = ')'; - ruby.appendChild(rightParenthesisRP); - } - firstChild.innerHTML = ruby.outerHTML; - } - }, - show_skillnamepinyin: { - name: '显示技能名注解', - intro: '在武将资料卡显示技能名注解', - get init() { - return lib.configMenu.view.config.show_characternamepinyin.init; - }, - set init(newVal) { - lib.configMenu.view.config.show_characternamepinyin.init = newVal; - }, - get unfrequent() { - return lib.configMenu.view.config.show_characternamepinyin.unfrequent; - }, - set unfrequent(newVal) { - lib.configMenu.view.config.show_characternamepinyin.unfrequent = newVal; - }, - get item() { - return lib.configMenu.view.config.show_characternamepinyin.item; - }, - set item(newVal) { - lib.configMenu.view.config.show_characternamepinyin.item = newVal; - }, - get visualMenu() { - return lib.configMenu.view.config.show_characternamepinyin.visualMenu; - }, - set visualMenu(newVal) { - lib.configMenu.view.config.show_characternamepinyin.visualMenu = newVal; - }, - } - } - }, - audio: { - name: '音效', - config: { - update: function (config, map) { - if (lib.config.background_music == 'music_custom' && (lib.device || lib.node)) { - map.import_music.show(); - } - else { - map.import_music.hide(); - } - map.clear_background_music[get.is.object(lib.config.customBackgroundMusic) ? 'show' : 'hide'](); - ui.background_music_setting = map.background_music; - map.background_music._link.config.updatex.call(map.background_music, []); - }, - background_music: { - updatex: function () { - this.lastChild.innerHTML = this._link.config.item[lib.config.background_music]; - var menu = this._link.menu; - for (var i = 0; i < menu.childElementCount; i++) { - if (!['music_off', 'music_custom', 'music_random'].concat(lib.config.all.background_music).includes(menu.childNodes[i]._link)) menu.childNodes[i].delete(); - } - }, - name: '背景音乐', - init: true, - item: { - music_default: '默认', - }, - onclick: function (item) { - game.saveConfig('background_music', item); - game.playBackgroundMusic(); - } - }, - import_music: { - name: '
    ' + - '' + - '
    ', - 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.startsWith('cdv_')) { - 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.includes(i)) { - map[i].classList.add('on'); - } - else { - map[i].classList.remove('on'); - } - } - else if (map[i]._link.config.type == 'banskill') { - if (!lib.config.forbidlist.includes(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.startsWith(lib.configprefix)) { - 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;i game.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 (get.mode() != this._link.config.mode || !_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 (get.mode() != 'identity' || !_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 (get.mode() != 'identity' || !_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: '无限', - }, - }, - round_one_use_fury: { - name: '开启首轮强化卡牌', - init: false, - frequent: false, - restart: true, - intro: '谋攻篇规则为第二轮开始才可使用怒气强化卡牌,开启此选项从游戏开始即可强化卡牌。' - }, - nei_auto_mark_camouflage: { - name: '内奸自动标记伪装反贼', - intro: '玩家内奸在游戏开始洞察结束后,自动将被洞察角色标记为反贼。', - init: false, - unfrequent: true, - }, - continue_game: { - name: '显示再战', - init: false, - onclick: function (bool) { - game.saveConfig('continue_game', bool, this._link.config.mode); - if (get.config('continue_game') && get.mode() == 'identity') { - if (!ui.continue_game && _status.over && !_status.brawl && !game.no_continue_game) { - 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') && get.mode() == 'identity') { - 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') && get.mode() == 'identity') { - 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': '十', - }, - }, - limit_zhu: { - name: '常备主候选武将数', - init: 'group', - restart: true, - item: { - off: '不限制', - group: '按势力筛选', - '4': '四', - '6': '六', - '8': '八', - }, - }, - 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': '十', - }, - }, - enable_commoner: { - name: '启用平民', - init: false, - restart: true, - frequent: false, - intro: '开启后游戏中将有一个平民(身份)加入游戏。
    具体规则请查看帮助。', - }, - choice_commoner: { - name: '平民候选武将数', - init: '4', - restart: true, - item: { - '3': '三', - '4': '四', - '5': '五', - '6': '六', - '8': '八', - '10': '十', - }, - }, - enable_year_limit: { - name: '启用年机制', - init: false, - restart: true, - frequent: false, - intro: '开启后将会加入年机制。
    年机制的具体规则请查看帮助。', - }, - } - }, - guozhan: { - name: '国战', - connect: { - connect_guozhan_mode: { - name: '游戏模式', - init: 'normal', - item: { - normal: '势备', - yingbian: '应变', - old: '怀旧', - }, - frequent: true, - restart: true, - intro: '
  • 势备:默认模式,使用线下《君临天下·势备篇》的牌堆进行游戏。
  • 应变:使用OL的应变国战牌堆进行游戏。
  • 怀旧:使用传统国战的牌堆进行游戏。', - }, - connect_player_number: { - name: '游戏人数', - init: '8', - get item() { - return lib.mode.guozhan.config.player_number.item; - }, - frequent: true, - restart: true, - }, - connect_aozhan: { - name: '鏖战模式', - init: true, - intro: '若开启此选项,则将在游戏中引入“鏖战模式”的规则:
    当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
    ◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
    注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', - frequent: true, - restart: true, - }, - get connect_separatism() { - return lib.mode.guozhan.config.separatism; - }, - connect_initshow_draw: { - name: '首亮奖励', - item: { - 'off': '关闭', - 'draw': '摸牌', - 'mark': '标记', - }, - init: 'mark', - frequent: true, - intro: '第一个明置武将牌的角色可获得首亮奖励' - }, - connect_viewnext: { - name: '观看下家副将', - init: false, - intro: '若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', - }, - connect_zhulian: { - name: '珠联璧合', - init: true, - // frequent: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(); - } - ui.aozhan_bgm = map.aozhan_bgm; - map.aozhan_bgm._link.config.updatex.call(map.aozhan_bgm, []); - }, - guozhan_mode: { - name: '游戏模式', - init: 'normal', - item: { - normal: '势备', - yingbian: '应变', - old: '怀旧', - free: '自由', - }, - frequent: true, - restart: true, - intro: '
  • 势备:默认模式,使用线下《君临天下·势备篇》的牌堆进行游戏。
  • 应变:使用OL的应变国战牌堆进行游戏。
  • 怀旧:使用传统国战的牌堆进行游戏。
  • 自由:使用玩家的自定义牌堆进行游戏。', - }, - player_number: { - name: '游戏人数', - init: '8', - get item() { - const minimumNumberOfPlayers = 2, maximumNumberOfPlayers = Math.max(_status.maximumNumberOfPlayers || 12, minimumNumberOfPlayers), item = {}; - for (let playerNumber = minimumNumberOfPlayers; playerNumber <= maximumNumberOfPlayers; playerNumber++) { - item[playerNumber] = `${get.cnNumber(playerNumber)}人`; - } - return item; - }, - frequent: true, - restart: true, - }, - aozhan: { - name: '鏖战模式', - init: true, - frequent: true, - restart: true, - intro: '若开启此选项,则将在游戏中引入“鏖战模式”的规则:
    当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
    ◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
    注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', - }, - separatism: { - name: '群雄割据', - init: false, - frequent: true, - restart: true, - intro: '开放不同势力组合,以优先亮出的武将牌作为自己的势力,双势力武将则使用列表的第一个势力' - }, - initshow_draw: { - name: '首亮奖励', - item: { - 'off': '关闭', - 'draw': '摸牌', - 'mark': '标记', - }, - init: 'mark', - frequent: true, - intro: '第一个明置身份牌的角色可获得摸牌奖励' - }, - viewnext: { - name: '观看下家副将', - init: false, - intro: '若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', - }, - aozhan_bgm: { - updatex: function () { - this.lastChild.innerHTML = this._link.config.item[lib.config.mode_config.guozhan.aozhan_bgm]; - if (!Array.isArray(_status.aozhanBGMToRemove)) return; - const menu = this._link.menu; - for (let i = 0; i < menu.childElementCount; i++) { - const link = menu.childNodes[i]._link; - if (['disabled', 'random'].includes(link) || !_status.aozhanBGMToRemove.includes(link)) continue; - _status.aozhanBGMToRemove.remove(link); - menu.childNodes[i].delete(); - } - }, - name: '鏖战背景音乐', - item: { - disabled: '不启用', - online: 'Online', - rewrite: 'Rewrite', - chaoming: '潮鸣', - random: '随机播放', - }, - 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: '主将和副将都明置后,若为特定组合,可获得【珠联璧合】标记' - }, - 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 (get.mode() != this._link.config.mode || !_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 (get.mode() != 'guozhan' || !_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 (get.mode() != 'guozhan' || !_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') && get.mode() == 'guozhan') { - if (!ui.continue_game && _status.over && !_status.brawl && !game.no_continue_game) { - 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') && get.mode() == 'guozhan') { - 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') && get.mode() == 'guozhan') { - 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', - 'guandu': '官渡', - }, - frequent: true - }, - connect_replace_handcard: { - name: '四号位保护', - init: true, - frequent: true, - intro: '最后行动的角色起始手牌数+1' - }, - connect_olfeiyang_four: { - name: '四号位获得【飞扬】', - init: true, - frequent: true, - intro: '最后行动的角色获得技能【飞扬】(准备阶段,你可以弃置三张牌,然后弃置判定区的一张牌)', - }, - 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(); - map.edit_character_four.show(); - map.reset_character_four.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(); - map.edit_character_four.hide(); - map.reset_character_four.hide(); - } - if (config.versus_mode == 'three') { - map.edit_character_three.show(); - map.reset_character_three.show(); - } - else { - map.edit_character_three.hide(); - map.reset_character_three.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.olfeiyang_four.show(); - map.replace_character_two.show(); - map.two_assign.show(); - map.two_phaseswap.show(); - } - else { - map.replace_handcard_two.hide(); - map.olfeiyang_four.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: '欢乐', - guandu: '官渡', - 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 (get.mode() != this._link.config.mode || !_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' - }, - olfeiyang_four: { - name: '四号位获得【飞扬】', - init: true, - frequent: true, - intro: '最后行动的角色获得技能【飞扬】(准备阶段,你可以弃置三张牌,然后弃置判定区的一张牌)', - }, - 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, - }, - edit_character_three: { - name: '编辑统率将池', - clear: true, - onclick: function () { - if (get.mode() != 'versus') { - alert('请进入对决模式,然后再编辑将池'); - return; - } - var container = ui.create.div('.popup-container.editor'); - var node = container; - var map = get.config('character_three') || lib.choiceThree; - var str = 'character=[\n '; - for (var i = 0; i < map.length; i++) { - str += '"' + map[i] + '",'; - if (i + 1 < map.length && (i + 1) % 5 == 0) str += '\n '; - } - str += '\n];'; - node.code = str; - ui.window.classList.add('shortcutpaused'); - ui.window.classList.add('systempaused'); - var saveInput = function () { - var code; - if (container.editor) { - code = container.editor.getValue(); - } - else if (container.textarea) { - code = container.textarea.value; - } - try { - var character = null; - eval(code); - if (!Array.isArray(character)) { - throw ('err'); - } - } - catch (e) { - var tip = lib.getErrorTip(e) || ''; - alert('代码语法有错误,请仔细检查(' + e + ')' + tip); - window.focus(); - if (container.editor) { - container.editor.focus(); - } - else if (container.textarea) { - container.textarea.focus(); - } - return; - } - game.saveConfig('character_three', character, 'versus'); - ui.window.classList.remove('shortcutpaused'); - ui.window.classList.remove('systempaused'); - container.delete(); - container.code = code; - delete window.saveNonameInput; - }; - window.saveNonameInput = saveInput; - var editor = ui.create.editor(container, 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'); - editor.appendChild(textarea); - node.textarea = textarea; - lib.setScroll(textarea); - } - node.textarea.value = node.code; - } - else { - if (!window.CodeMirror) { - import('../../game/codemirror.js').then(() => { - lib.codeMirrorReady(node, editor); - }); - lib.init.css(lib.assetURL + 'layout/default', 'codemirror'); - } - else { - lib.codeMirrorReady(node, editor); - } - } - }, - }, - reset_character_three: { - name: '重置统率将池', - intro: '将统率三军模式下的将池重置为默认将池', - clear: true, - onclick: function () { - if (confirm('该操作不可撤销!是否清除统率三军模式的自定义将池,并将其重置为默认将池?')) { - game.saveConfig('character_three', null, 'versus'); - alert('将池已重置'); - } - }, - }, - edit_character_four: { - name: '编辑4v4将池', - clear: true, - onclick: function () { - if (get.mode() != 'versus') { - alert('请进入对决模式,然后再编辑将池'); - return; - } - var container = ui.create.div('.popup-container.editor'); - var node = container; - var map = get.config('character_four') || lib.choiceFour; - var str = 'character=[\n '; - for (var i = 0; i < map.length; i++) { - str += '"' + map[i] + '",'; - if (i + 1 < map.length && (i + 1) % 5 == 0) str += '\n '; - } - str += '\n];'; - node.code = str; - ui.window.classList.add('shortcutpaused'); - ui.window.classList.add('systempaused'); - var saveInput = function () { - var code; - if (container.editor) { - code = container.editor.getValue(); - } - else if (container.textarea) { - code = container.textarea.value; - } - try { - var character = null; - eval(code); - if (!Array.isArray(character)) { - throw ('err'); - } - } - catch (e) { - var tip = lib.getErrorTip(e) || ''; - alert('代码语法有错误,请仔细检查(' + e + ')' + tip); - window.focus(); - if (container.editor) { - container.editor.focus(); - } - else if (container.textarea) { - container.textarea.focus(); - } - return; - } - game.saveConfig('character_four', character, 'versus'); - ui.window.classList.remove('shortcutpaused'); - ui.window.classList.remove('systempaused'); - container.delete(); - container.code = code; - delete window.saveNonameInput; - }; - window.saveNonameInput = saveInput; - var editor = ui.create.editor(container, 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'); - editor.appendChild(textarea); - node.textarea = textarea; - lib.setScroll(textarea); - } - node.textarea.value = node.code; - } - else { - if (!window.CodeMirror) { - import('../../game/codemirror.js').then(() => { - lib.codeMirrorReady(node, editor); - }); - lib.init.css(lib.assetURL + 'layout/default', 'codemirror'); - } - else { - lib.codeMirrorReady(node, editor); - } - } - }, - }, - reset_character_four: { - name: '重置4v4将池', - intro: '将4v4模式下的将池重置为默认将池', - clear: true, - onclick: function () { - if (confirm('该操作不可撤销!是否清除4v4模式的自定义将池,并将其重置为默认将池?')) { - game.saveConfig('character_four', null, 'versus'); - alert('将池已重置'); - } - }, - }, - } - }, - 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'; - } - } - } - }, - wss_mode: { - name: '使用WSS协议', - init: false, - frequent: true, - intro: '在用户填写的IP地址没有直接指定使用WS/WSS协议的情况下,默认使用WSS协议,而非WS协议来连接到联机服务器。
    请不要轻易勾选此项!', - }, - read_clipboard: { - name: '读取邀请链接', - init: false, - frequent: true, - intro: '读取剪贴板以解析邀请链接自动加入联机房间', - } - } - }, - boss: { - name: '挑战', - config: { - free_choose: { - name: '自由选将', - init: true, - frequent: true, - onclick: function (bool) { - game.saveConfig('free_choose', bool, this._link.config.mode); - if (get.mode() != this._link.config.mode || !_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) { - if (config.connect_doudizhu_mode == 'online') { - map.connect_change_card.hide(); - } - else { - map.connect_change_card.show(); - } - if (config.connect_doudizhu_mode != 'normal') { - map.connect_double_character.hide(); - } - else { - map.connect_double_character.show(); - } - }, - connect_doudizhu_mode: { - name: '游戏模式', - init: 'normal', - item: { - normal: '休闲', - kaihei: '开黑', - huanle: '欢乐', - binglin: '兵临', - online: '智斗', - }, - restart: true, - frequent: true, - }, - 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.doudizhu_mode == 'online') { - map.change_card.hide(); - map.edit_character.show(); - map.reset_character.show(); - } - else { - map.change_card.show(); - map.edit_character.hide(); - map.reset_character.hide(); - } - if (config.doudizhu_mode != 'normal') { - map.double_character.hide(); - map.free_choose.hide(); - map.change_identity.hide(); - map.change_choice.hide(); - map.continue_game.hide(); - map.dierestart.hide(); - map.choice_zhu.hide(); - map.choice_fan.hide(); - map.revive.hide(); - } - else { - map.double_character.show(); - map.free_choose.show(); - map.change_identity.show(); - map.change_choice.show(); - map.continue_game.show(); - map.dierestart.show(); - map.choice_zhu.show(); - map.choice_fan.show(); - map.revive.show(); - } - if (config.double_character && config.doudizhu_mode == 'normal') { - map.double_hp.show(); - } - else { - map.double_hp.hide(); - } - }, - doudizhu_mode: { - name: '游戏模式', - init: 'normal', - item: { - normal: '休闲', - kaihei: '开黑', - huanle: '欢乐', - binglin: '兵临', - online: '智斗', - }, - restart: true, - frequent: true, - }, - 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 (get.mode() != this._link.config.mode || !_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 && !game.no_continue_game) { - 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': '十', - }, - }, - edit_character: { - name: '编辑将池', - clear: true, - onclick: function () { - if (get.mode() != 'doudizhu') { - alert('请进入斗地主模式,然后再编辑将池'); - return; - } - var container = ui.create.div('.popup-container.editor'); - var node = container; - var map = get.config('character_online') || lib.characterOnline; - node.code = 'character=' + get.stringify(map) + '\n/*\n 这里是智斗三国模式的武将将池。\n 您可以在这里编辑对武将将池进行编辑,然后点击“保存”按钮即可保存。\n 将池中的Key势力武将,仅同时在没有被禁用的情况下,才会出现在选将框中。\n 而非Key势力的武将,只要所在的武将包没有被隐藏,即可出现在选将框中。\n 该将池为单机模式/联机模式通用将池。在这里编辑后,即使进入联机模式,也依然会生效。\n 但联机模式本身禁用的武将(如神貂蝉)不会出现在联机模式的选将框中。\n*/'; - ui.window.classList.add('shortcutpaused'); - ui.window.classList.add('systempaused'); - var saveInput = function () { - var code; - if (container.editor) { - code = container.editor.getValue(); - } - else if (container.textarea) { - code = container.textarea.value; - } - try { - var character = null; - eval(code); - if (!get.is.object(character)) { - throw ('err'); - } - var groups = []; - for (var i in character) { - if (!Array.isArray(character[i])) throw ('type'); - if (character[i].length >= 3) groups.push(i); - } - if (groups.length < 3) throw ('enough'); - } - catch (e) { - if (e == 'type') { - alert('请严格按照格式填写,不要写入不为数组的数据'); - } - else if (e == 'enough') { - alert('请保证至少写入了3个势力,且每个势力至少有3个武将'); - } - else if (e == 'err') { - alert('代码格式有错误,请对比示例代码仔细检查'); - } - else { - var tip = lib.getErrorTip(e) || ''; - alert('代码语法有错误,请仔细检查(' + e + ')' + tip); - } - window.focus(); - if (container.editor) { - container.editor.focus(); - } - else if (container.textarea) { - container.textarea.focus(); - } - return; - } - game.saveConfig('character_online', character, 'doudizhu'); - ui.window.classList.remove('shortcutpaused'); - ui.window.classList.remove('systempaused'); - container.delete(); - container.code = code; - delete window.saveNonameInput; - }; - window.saveNonameInput = saveInput; - var editor = ui.create.editor(container, 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'); - editor.appendChild(textarea); - node.textarea = textarea; - lib.setScroll(textarea); - } - node.textarea.value = node.code; - } - else { - if (!window.CodeMirror) { - import('../../game/codemirror.js').then(() => { - lib.codeMirrorReady(node, editor); - }); - lib.init.css(lib.assetURL + 'layout/default', 'codemirror'); - } - else { - lib.codeMirrorReady(node, editor); - } - } - }, - }, - reset_character: { - name: '重置将池', - intro: '将智斗三国模式下的将池重置为默认将池', - clear: true, - onclick: function () { - if (confirm('该操作不可撤销!是否清除智斗三国模式的自定义将池,并将其重置为默认将池?')) { - game.saveConfig('character_online', null, 'doudizhu'); - alert('将池已重置'); - } - }, - }, - } - }, - single: { - name: '单挑', - connect: { - connect_single_mode: { - name: '游戏模式', - init: 'normal', - item: { - normal: '新1v1', - dianjiang: '点将单挑', - changban: '血战长坂坡', - }, - restart: true, - frequent: true, - }, - connect_enable_jin: { - name: '启用晋势力武将', - init: false, - restart: true, - frequent: true, - }, - update: function (config, map) { - if (config.connect_single_mode != 'normal') { - map.connect_enable_jin.hide(); - } - else { - map.connect_enable_jin.show(); - } - }, - }, - config: { - single_mode: { - name: '游戏模式', - init: 'normal', - item: { - normal: '新1v1', - dianjiang: '点将单挑', - changban: '血战长坂坡', - }, - restart: true, - frequent: true, - }, - enable_jin: { - name: '启用晋势力武将', - init: false, - restart: true, - frequent: true, - }, - update: function (config, map) { - if (config.single_mode != 'normal') { - map.enable_jin.hide(); - } - else { - map.enable_jin.show(); - } - }, - } - }, - 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_leader_allcharacter.show(); - map.chess_character.hide(); - } - else { - map.chess_leader_save.hide(); - map.chess_leader_clear.hide(); - map.chess_leader_allcharacter.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_allcharacter: { - name: '启用全部角色', - init: true, - onclick: function (bool) { - if (confirm('调整该设置将清除所有进度,是否继续?')) { - for (var i = 1; i < 6; i++) game.save('save' + i, null, 'chess'); - game.saveConfig('chess_leader_allcharacter', bool, 'chess'); - if (get.mode() == 'chess') game.reload(); - return; - } - else this.classList.toggle('on'); - }, - }, - chess_leader_clear: { - name: '清除进度', - onclick: function () { - var node = this; - if (node._clearing) { - for (var i = 1; i < 6; i++) game.save('save' + i, null, 'chess'); - 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 (get.mode() != this._link.config.mode || !_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 - }, - jiazuzhizheng: { - name: '家族之争', - init: true, - frequent: true - }, - tongqueduopao: { - name: '铜雀夺袍', - init: true, - frequent: true - }, - tongjiangmoshi: { - name: '同将模式', - init: true, - frequent: true - }, - baiyidujiang: { - name: '白衣渡江', - init: true, - frequent: true - }, - qianlidanji: { - name: '千里单骑', - init: true, - frequent: true - }, - liangjunduilei: { - 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 (get.mode() != this._link.config.mode || !_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, - // }, - } - }, - }; - static status = { - running: false, - canvas: false, - time: 0, - reload: 0, - delayed: 0, - frameId: 0, - videoId: 0, - globalId: 0, - }; - static help = { - '关于游戏': '
    关于无名杀