diff --git a/character/diy.js b/character/diy.js index 620d21ec3..57c466efd 100755 --- a/character/diy.js +++ b/character/diy.js @@ -4483,37 +4483,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(list.length>=result.score) list=list.randomGets(result.score); else list.addArray(list2.randomGets(result.score-list.length)); list.sort(); - event.videoId=lib.status.videoId++; - var func=function(id,list){ - var choiceList=ui.create.dialog('控物:请选择一项','forcebutton'); - choiceList.videoId=id; - for(var ii=0;ii{ + return [i,lib.skill.yukito_kongwu.moves[i].prompt]; + }),'textbutton'], + ]); next.set('forced',true); next.set('filterButton',function(button){ return lib.skill.yukito_kongwu.moves[button.link].filter(_status.event.player); @@ -4523,10 +4498,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return Math.random(); }); "step 2" - if(player.isOnline2()){ - player.send('closeDialog',event.videoId); - } - event.dialog.close(); var num=result.links[0]; switch(num){ case 0:event.goto(3);break; @@ -4944,35 +4915,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, chooseButton:{ dialog:function(event,player){ - var dialog=ui.create.dialog('游凤','hidden'); + const dialog=ui.create.dialog('游凤','hidden'); + const equips=[]; if(player.storage.chihaya_youfeng){ - var table=document.createElement('div'); - table.classList.add('add-setting'); - table.style.margin='0'; - table.style.width='100%'; - table.style.position='relative'; - for(var i=1;i<6;i++){ + for(let i=1;i<6;i++){ if(!player.hasEnabledSlot(i)) continue; - var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); - td.innerHTML=''+get.translation('equip'+i)+''; - td.link=i; - td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button); - for(var j in lib.element.button){ - td[j]=lib.element.button[i]; - } - table.appendChild(td); - dialog.buttons.add(td); + equips.push([i,get.translation('equip'+i)]); } - dialog.content.appendChild(table); + if(equips.length>0) dialog.add([equips,'tdnodes']) } - var type=player.storage.chihaya_youfeng?'basic':'trick'; - var list=[]; - for(var name of lib.inpile){ + const type=player.storage.chihaya_youfeng?'basic':'trick'; + const list=[]; + for(const name of lib.inpile){ if(get.type(name)!=type) continue; if(event.filterCard({name:name,isCard:true},player,event)){ list.push([type,'',name]); if(name=='sha'){ - for(var j of lib.inpile_nature) list.push([type,'',name,j]); + for(let j of lib.inpile_nature) list.push([type,'',name,j]); } } } diff --git a/character/extra.js b/character/extra.js index b04bc6aa9..3abd6c7bf 100755 --- a/character/extra.js +++ b/character/extra.js @@ -4481,7 +4481,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }; "step 3" if(!result.bool){ - lib.element.player.die.apply(target,[]); + lib.element.Player.prototype.die.apply(target,[]); } }, sub:true, diff --git a/character/huicui.js b/character/huicui.js index 2e4d4e5e7..4dc06253a 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -4863,23 +4863,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } (player.isDisabledJudge()?list2:list1).push(-1); var addTable=function(list,bool){ - var table=document.createElement('div'); - table.classList.add('add-setting'); - table.style.margin='0'; - table.style.width='100%'; - table.style.position='relative'; + const adds=[]; for(var i of list){ - var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); - td.innerHTML=''+(i>0?get.translation('equip'+i)+'栏':'判定区')+''; - td.link=[i,bool]; - td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button); - for(var j in lib.element.button){ - td[j]=lib.element.button[j]; - } - table.appendChild(td); - dialog.buttons.add(td); + adds.push([[i,bool],(i>0?get.translation('equip'+i)+'栏':'判定区')]); } - dialog.content.appendChild(table); + dialog.add([adds,'tdnodes']) } if(list1.length){ dialog.addText('未废除'); @@ -6061,38 +6049,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.cardname=player.storage.dunshi_damage; player.removeSkill('dunshi_damage'); event.target=trigger.source; - event.videoId=lib.status.videoId++; - var func=function(card,id,card2,card3){ - var list=[ - '防止即将对'+card3+'造成的伤害,并令'+card+'获得一个技能名中包含“仁/义/礼/智/信”的技能', - '从〖遁世〗中删除【'+card2+'】并获得一枚“席”', - '减1点体力上限,然后摸等同于“席”数的牌', - ]; - var choiceList=ui.create.dialog('遁世:请选择两项'); - choiceList.videoId=id; - for(var i=0;i{ + return [i,item]; + }),'textbutton'] + ]); next.set('forced',true); next.set('selectButton',2); next.set('ai',function(button){ @@ -6113,10 +6081,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }); 'step 1' - if(player.isOnline2()){ - player.send('closeDialog',event.videoId); - } - event.dialog.close(); event.links=result.links.sort(); for(var i of event.links){ game.log(player,'选择了','#g【遁世】','的','#y选项'+get.cnNumber(i+1,true)); @@ -10076,7 +10040,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ str+=strx; if(i!='jiu') str+='/'; } - str+=',然后当前回合角色于本回合内下一次造成伤害时,你选择两项:⒈防止此伤害。系统从技能名中包含“仁/义/礼/智/信”字样的技能中随机选择三个其未拥有的技能,然后你令当前回合角色获得其中一个技能。⒉从〖遁世〗中删除你本次使用或打出的牌并获得一个“赂”。⒊减1点体力上限并摸X张牌(X为你的“赂”数)。'; + str+=',然后当前回合角色于本回合内下一次造成伤害时,你选择两项:⒈防止此伤害。系统从技能名中包含“仁/义/礼/智/信”字样的技能中随机选择三个其未拥有的技能,然后你令当前回合角色获得其中一个技能。⒉从〖遁世〗中删除你本次使用或打出的牌并获得一个“席”。⒊减1点体力上限并摸X张牌(X为你的“席”数)。'; return str; }, dcporui:function(player){ diff --git a/character/mobile.js b/character/mobile.js index 0e4e38622..e06572a21 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -5511,24 +5511,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var dialog=ui.create.dialog('集兵','hidden'); if(event.filterCard({name:'sha'},player,event)&&event.filterCard({name:'shan'},player,event)){ dialog._chooseButton=2; - var table=document.createElement('div'); - table.classList.add('add-setting'); - table.style.margin='0'; - table.style.width='100%'; - table.style.position='relative'; var list=['sha','shan']; - for(var i of list){ - var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); - td.innerHTML=''+get.translation(i)+''; - td.link=i; - td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button); - for(var j in lib.element.button){ - td[j]=lib.element.button[j]; - } - table.appendChild(td); - dialog.buttons.add(td); - } - dialog.content.appendChild(table); + dialog.add([list.map(i=>{ + return [i,get.translation(i)]; + }),'tdnodes']); } else dialog._cardName=event.filterCard({name:'sha'},player,event)?'sha':'shan'; dialog.add(player.getExpansions('jibing')); @@ -13953,21 +13939,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '摸一张牌并视为使用一张【杀】', ]; var choiceList=ui.create.dialog('知略:失去1点体力并...','forcebutton','hidden'); - for(var i=0;i{ + return [i,item]; + }),'textbutton']); return choiceList; }, filter:function(button,player){ diff --git a/character/refresh.js b/character/refresh.js index 6c16df7de..95a1f1a0c 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -5523,19 +5523,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ table.style.width='100%'; table.style.position='relative'; var list=['摸牌','造成伤害']; - for(var i=0;i'; - td.link=i; - td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button); - for(var j in lib.element.button){ - td[j]=lib.element.button[j]; - } - table.appendChild(td); - dialog.buttons.add(td); - } - dialog.content.appendChild(table); + dialog.add([list.map((item,i)=>{ + return [i,item]; + }),'tdnodes']); dialog.add(player.getExpansions('xinquanji')); return dialog; }, diff --git a/character/shiji.js b/character/shiji.js index 9191f86ee..07eb16e1e 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -4765,21 +4765,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '将两张牌交给一名其他角色并获得其装备区内的一张牌', ]; var choiceList=ui.create.dialog('睦阵:请选择一项','hidden'); - for(var i=0;i{ + return [i,item]; + }),'textbutton']); return choiceList; }, filter:function(button,player){ diff --git a/character/sp.js b/character/sp.js index bf49a22ab..da23f0209 100755 --- a/character/sp.js +++ b/character/sp.js @@ -12350,24 +12350,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ chooseButton:{ dialog:function(event,player){ var dialog=ui.create.dialog('游龙','hidden'); - var table=document.createElement('div'); - table.classList.add('add-setting'); - table.style.margin='0'; - table.style.width='100%'; - table.style.position='relative'; - for(var i=1;i<6;i++){ + const equips=[]; + for(let i=1;i<6;i++){ if(!player.hasEnabledSlot(i)) continue; - var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode'); - td.innerHTML=''+get.translation('equip'+i)+''; - td.link=i; - td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button); - for(var j in lib.element.button){ - td[j]=lib.element.button[j]; - } - table.appendChild(td); - dialog.buttons.add(td); + equips.push([i,get.translation('equip'+i)]); } - dialog.content.appendChild(table); + if(equips.length>0) dialog.add([equips,'tdnodes']) var type=player.storage.youlong?'basic':'trick'; var list=[]; for(var name of lib.inpile){ @@ -20405,40 +20393,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event._result={bool:true,links:[0]}; return; } - event.videoId=lib.status.videoId++; - var func=function(card,id,bool){ - var list=[ - '令自己摸一张牌', - '令XXX摸两张牌', - '令XXX回复1点体力', - ]; - var choiceList=ui.create.dialog('【礼下】:请选择一至两项','forcebutton'); - choiceList.videoId=id; - for(var i=0;i{ + return [index,item.replace(/XXX/g,card)] + }),'textbutton'] + ],true,[1,2]); next.set('dialog',event.videoId); next.set('filterButton',function(button){ if(button.link==2){ @@ -20454,12 +20420,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return button.link*Math.random(); }); "step 1" - if(event.videoId!=undefined){ - if(player.isOnline2()){ - player.send('closeDialog',event.videoId); - } - event.dialog.close(); - } var map=[ function(trigger,player,event){ player.draw(); diff --git a/character/sp2.js b/character/sp2.js index 8649de266..a469692ec 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -7816,34 +7816,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.control=="手动分配"){ event.goto(8); } - else if(!_status.connectMode){ - var choiceList=ui.create.dialog('请选择一种方案','hidden','forcebutton'); - for(var i=0;i0?('至'+get.cnNumber(player.getDamagedHp()+1)):'')+'项'); - choiceList.videoId=id; - for(var i=0;i0?('至'+get.cnNumber(player.getDamagedHp()+1)):'')+'项', + [list.map((item,i)=>{ + return [i,item]; + }),'textbutton'] + ]); next.set('dialog',event.videoId); next.set('forced',true); next.set('ai',function(button){ @@ -9293,10 +9273,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(player.getDamagedHp()>0) next.set('selectButton',[1,1+player.getDamagedHp()]); 'step 3' - if(player.isOnline2()){ - player.send('closeDialog',event.videoId); - } - event.dialog.close(); result.links.sort(); for(var i of result.links) game.log(player,'选择了','#g【玉陨】','的','#y选项'+get.cnNumber(1+i,true)) event.links=result.links; @@ -10246,26 +10222,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '选择手牌数大于你的一名角色', '选择装备数大于你的一名角色', ]; - var choiceList=ui.create.dialog('尊位:清选择一项','forcebutton','hidden'); - for(var i=0;i{ + return [i,item]; + }),'textbutton']) return choiceList; }, filter:function(button){ diff --git a/character/yijiang.js b/character/yijiang.js index adbf3be78..ae3ca6940 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -10094,21 +10094,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '选择体力值最大的一名角色', ]; var choiceList=ui.create.dialog('散谣:请选择一项','forcebutton','hidden'); - for(var i=0;i{ + return [i,item]; + }),'textbutton']); return choiceList; }, filter:function(button,player){ diff --git a/game/game.js b/game/game.js index 809788ffb..3b6f3af9e 100644 --- a/game/game.js +++ b/game/game.js @@ -8991,7 +8991,7 @@ } } - if(lib.assetURL.includes('com.widget.noname.qingyao')){ + if(lib.assetURL.includes('com.widget.noname.qingyao')||lib.assetURL.includes('online.nonamekill.android')){ alert('您正在一个不受信任的闭源客户端上运行《无名杀》。建议您更换为其他开源的无名杀客户端,避免给您带来不必要的损失。'); } @@ -60048,7 +60048,8 @@ } tr.appendChild(td); td=document.createElement('td'); - td.innerHTML=`${node.countCards('h')}/${node.getHandcardLimit()}`; + let handcardLimit=node.getHandcardLimit(); + td.innerHTML=`${node.countCards('h')}/${handcardLimit>=114514?'∞':handcardLimit}`; tr.appendChild(td); td=document.createElement('td'); td.innerHTML=node.phaseNumber; diff --git a/mode/brawl.js b/mode/brawl.js index b693cdcca..0e9d830b8 100644 --- a/mode/brawl.js +++ b/mode/brawl.js @@ -3786,21 +3786,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ ui.arena.classList.add('choose-character'); var list=game.liangjunduilei; var id=lib.status.videoId++; - var choiceList=ui.create.dialog('请选择要游玩的剧情','forcebutton'); - choiceList.videoId=id; - for(var i=0;i{ + return [i,``]; + }),'textbutton']) + game.me.chooseButton(true).set('dialog',id).set('onfree',true); 'step 1' var pack=game.liangjunduilei[result.links[0]]; game.versusVideoName=pack.name;