diff --git a/character/xianding.js b/character/xianding.js index 7bad4a349..30913db30 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -5566,7 +5566,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var evt=trigger.getl(player); var num=0; player.getHistory('lose',function(evt){ - if(!goon||evt.type!='discard') return false; + if(evt.type!='discard') return false; num+=evt.cards2.length; }); var cards=[]; @@ -5597,52 +5597,148 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' var list=lib.skill.dchuishu.getList(player); - event.initial_list=list.slice(0); - var min=list[0]; + var min=list[0],max=list[0]; for(var i of list){ if(imax) max=i; } var exps=['摸牌数[','弃牌数[','目标牌数[']; - var choices=[]; + var choices_min=[],choices_max=[]; for(var i=0;i'; + td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ + if(_status.dragged) return; + if(_status.justdragged) return; + _status.tempNoButton=true; + setTimeout(function(){ + _status.tempNoButton=false; + },500); + var link=this.link; + var current=this.parentNode.querySelector('.bluebg'); + if(current) current.classList.remove('bluebg'); + this.classList.add('bluebg'); + event._result.min=link; + }); + } + dialog.content.appendChild(table); + dialog.addText('最大值-1'); + var table2=document.createElement('div'); + table2.classList.add('add-setting'); + table2.style.margin='0'; + table2.style.width='100%'; + table2.style.position='relative'; + for(var i=0;i'; + td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ + if(_status.dragged) return; + if(_status.justdragged) return; + _status.tempNoButton=true; + setTimeout(function(){ + _status.tempNoButton=false; + },500); + var link=this.link; + var current=this.parentNode.querySelector('.bluebg'); + if(current) current.classList.remove('bluebg'); + this.classList.add('bluebg'); + event._result.max=link; + }); + } + dialog.content.appendChild(table2); + dialog.add('  '); + event.dialog.open(); + + event.switchToAuto=function(){ + event._result={ + bool:true, + min:min[0], + max:max[0], + }; + event.dialog.close(); + event.control.close(); + game.resume(); + _status.imchoosing=false; + }; + event.control=ui.create.control('ok',function(link){ + var result=event._result; + if(!result.min||!result.max) return; + result.bool=true; + event.dialog.close(); + event.control.close(); + game.resume(); + _status.imchoosing=false; + }); + for(var i=0;i