序列生成模块改名,修正his4的”重复“概念为序列里的id重复而不是方块重复

This commit is contained in:
MrZ626
2021-05-05 10:21:07 +08:00
parent 2e7df49c4f
commit 58305a9690
2 changed files with 8 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
local Player=require"parts.player.player"
local getSeqGen=require"parts.player.getSeqGen"
local seqGenerators=require"parts.player.seqGenerators"
local gameEnv0=require"parts.player.gameEnv0"
local rnd,max=math.random,math.max
@@ -314,7 +314,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
if ENV.nextCount==0 then ENV.nextPos=false end
P.newNext=coroutine.wrap(getSeqGen(P))
P.newNext=coroutine.wrap(seqGenerators(P))
P.newNext(P,P.gameEnv.seqData)
if P.mini then

View File

@@ -1,7 +1,7 @@
local ins,rem=table.insert,table.remove
local yield=YIELD
local seqGens={
local seqGenerators={
none=function()while true do yield()end end,
bag=function(P,seq0)
local len=#seq0
@@ -26,10 +26,10 @@ local seqGens={
for n=1,4 do
local j,i=0
repeat
i=seq0[P:RND(len)]
i=P:RND(len)
j=j+1
until i~=his[1]and i~=his[2]and i~=his[3]and i~=his[4]or j==4
his[n]=i
his[n]=seq0[i]
P:getNext(i)
end
end
@@ -143,8 +143,8 @@ return function(P)--Return a piece-generating funtion for player P
local s=P.gameEnv.sequence
if type(s)=='function'then
return s
elseif type(s)=='string'and seqGens[s]then
return seqGens[s]
elseif type(s)=='string'and seqGenerators[s]then
return seqGenerators[s]
else
LOG.print(
type(s)=='string'and
@@ -152,6 +152,6 @@ return function(P)--Return a piece-generating funtion for player P
"Wrong sequence generator",
'warn')
P.gameEnv.sequence='bag'
return seqGens.bag
return seqGenerators.bag
end
end