From e1d52de4107ff1f240be2c9090cf81d664fc23a2 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 15 Mar 2021 20:47:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5c2=E5=BA=8F=E5=88=97=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=9C=A8=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=88=96mod=E4=B8=AD=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/globalTables.lua | 2 +- parts/player/prepareSequence.lua | 20 ++++++++++++++++++++ parts/scenes/custom_sequence.lua | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 7da2d980..cf7db677 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -119,7 +119,7 @@ MODOPT={--Mod options }, {no=19,id="CS",name="customSeq", key="b",x=680,y=470,color="blue", - list={"bag","his4","rnd","reverb"}, + list={"bag","his4","c2","rnd","reverb"}, func=function(P,O)P.gameEnv.sequence=O end, unranked=true, }, diff --git a/parts/player/prepareSequence.lua b/parts/player/prepareSequence.lua index b44283d6..aa5f6f35 100644 --- a/parts/player/prepareSequence.lua +++ b/parts/player/prepareSequence.lua @@ -36,6 +36,26 @@ local sequenceModes={ yield() end end, + c2=function(P,seq0) + local len=#seq0 + local weight={} + for i=1,len do weight[i]=0 end + + while true do + while #P.nextQueue<6 do + local maxK=1 + for i=1,len do + weight[i]=weight[i]*.5+P:RND() + if weight[i]>weight[maxK]then + maxK=i + end + end + weight[maxK]=weight[maxK]/3.5 + P:getNext(seq0[maxK]) + end + yield() + end + end, rnd=function(P,seq0) P:getNext(seq0[rnd(#seq0)]) while true do diff --git a/parts/scenes/custom_sequence.lua b/parts/scenes/custom_sequence.lua index 981dc7cc..80bf7d90 100644 --- a/parts/scenes/custom_sequence.lua +++ b/parts/scenes/custom_sequence.lua @@ -190,7 +190,7 @@ scene.widgetList={ WIDGET.newSelector{name="sequence", x=1080,y=60,w=200,color="yellow", - list={"bag","his4","rnd","reverb","loop","fixed"}, + list={"bag","his4","c2","rnd","reverb","loop","fixed"}, disp=lnk_CUSval("sequence"), code=lnk_CUSsto("sequence") },