玩家next序列长度增加至12(内部)

录像回放模式下会尝试显示至多12个next
This commit is contained in:
MrZ626
2021-08-17 14:01:00 +08:00
parent 7dbd5de980
commit 8049792dc4
2 changed files with 68 additions and 19 deletions

View File

@@ -541,7 +541,7 @@ local draw={}
draw.drawGhost=drawGhost
draw.applyField=applyField
draw.cancelField=cancelField
function draw.drawNext_norm(P)
function draw.drawNext_norm(P,repMode)
local ENV=P.gameEnv
local texture=P.skinLib
gc_translate(488,20)
@@ -552,6 +552,9 @@ function draw.drawNext_norm(P)
N=1
gc_push('transform')
gc_translate(50,40)
gc_setColor(1,1,1)
--Draw nexts
gc_setShader(shader_blockSatur)
local queue=P.nextQueue
while N<=ENV.nextCount and queue[N]do
@@ -568,6 +571,24 @@ function draw.drawNext_norm(P)
gc_translate(0,72)
end
gc_setShader()
--Draw more nexts
if repMode then
gc_translate(50,-28)
local blockImg=TEXTURE.miniBlock
local skinSet=ENV.skin
local n=N
while n<=12 and queue[n]do
local id=queue[n].id
local _=minoColor[skinSet[id]]
gc_setColor(_[1],_[2],_[3],.2)
_=blockImg[id]
local h=_:getHeight()
gc_draw(_,-_:getWidth()*10,0,nil,10,nil)
gc_translate(0,10*h+3)
n=n+1
end
end
gc_pop()
if ENV.bagLine then
@@ -578,20 +599,30 @@ function draw.drawNext_norm(P)
end
gc_translate(-488,-20)
end
function draw.drawNext_hidden(P)
function draw.drawNext_hidden(P,repMode)
local ENV=P.gameEnv
local texture=P.skinLib
gc_translate(476,20)
gc_translate(488,20)
gc_setLineWidth(2)
local N=ENV.nextCount*72
gc_setColor(.5,0,0,.4)gc_rectangle('fill',0,0,124,N+8)
gc_setColor(.97,.97,.975)gc_rectangle('line',0,0,124,N+8)
N=min(ENV.nextStartPos,P.pieceCount+1)
gc_setColor(.5,0,0,.4)gc_rectangle('fill',0,0,100,N+8,5)
gc_setColor(.97,.97,.975)gc_rectangle('line',0,0,100,N+8,5)
local startN=min(ENV.nextStartPos,P.pieceCount+1)
if repMode then
gc_setColor(1,1,1,.2)
N=1
else
gc_setColor(1,1,1)
N=startN
end
gc_push('transform')
gc_translate(62,40)
gc_translate(50,72*N-32)
--Draw nexts
gc_setShader(shader_blockSatur)
local queue=P.nextQueue
while N<=ENV.nextCount and queue[N]do
if N==startN then gc_setColor(1,1,1)end
local bk,sprite=queue[N].bk,texture[queue[N].color]
local k=min(2.3/#bk,3/#bk[1],.85)
gc_scale(k)
@@ -605,6 +636,24 @@ function draw.drawNext_hidden(P)
gc_translate(0,72)
end
gc_setShader()
--Draw more nexts
if repMode then
gc_translate(50,-28)
local blockImg=TEXTURE.miniBlock
local skinSet=ENV.skin
local n=N
while n<=12 and queue[n]do
local id=queue[n].id
local _=minoColor[skinSet[id]]
gc_setColor(_[1],_[2],_[3],.2)
_=blockImg[id]
local h=_:getHeight()
gc_draw(_,-_:getWidth()*10,0,nil,10,nil)
gc_translate(0,10*h+3)
n=n+1
end
end
gc_pop()
if ENV.bagLine then
@@ -663,10 +712,10 @@ function draw.norm(P,repMode)
mStr(P.username,300,-60)
--Draw HUD
P:drawNext()
P:drawNext(repMode)
drawMission(P)
drawHold(P)
drawDial(490,500,P.dropSpeed)
drawDial(499,505,P.dropSpeed)
if P.life>0 then drawLife(P.life)end
--Field-related things

View File

@@ -9,7 +9,7 @@ local seqGenerators={
local len=#seq0
local bag={}
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
if #bag==0 then
for i=1,len do
bag[i]=seq0[len-i+1]
@@ -26,7 +26,7 @@ local seqGenerators={
local hisLen=ceil(len*.5)
local history=TABLE.new(0,hisLen)
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
local r
for _=1,hisLen do--Reroll up to [hisLen] times
r=rndGen:random(len)
@@ -82,7 +82,7 @@ local seqGenerators={
end
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
-- print"======================"
--Pick a mino from pool
local tryTime=0
@@ -114,7 +114,7 @@ local seqGenerators={
for i=1,len do weight[i]=0 end
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
local maxK=1
for i=1,len do
weight[i]=weight[i]*.5+rndGen:random()
@@ -132,7 +132,7 @@ local seqGenerators={
if #seq0==1 then
local i=seq0[1]
while true do
while #P.nextQueue<6 do P:getNext(i)end
while #P.nextQueue<12 do P:getNext(i)end
yield()
end
else
@@ -140,7 +140,7 @@ local seqGenerators={
local len=#seq0
local last=0
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
local r=rndGen:random(len-1)
if r>=last then r=r+1 end
P:getNext(seq0[r])
@@ -153,7 +153,7 @@ local seqGenerators={
mess=function(P,seq0)
local rndGen=P.seqRND
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
P:getNext(seq0[rndGen:random(#seq0)])
end
yield()
@@ -163,7 +163,7 @@ local seqGenerators={
local rndGen=P.seqRND
local bufferSeq,bag={},{}
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
if #bag==0 then
for i=1,#seq0 do bufferSeq[i]=seq0[i]end
repeat
@@ -187,7 +187,7 @@ local seqGenerators={
local len=#seq0
local bag={}
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
if #bag==0 then
for i=1,len do
bag[i]=seq0[len-i+1]
@@ -204,7 +204,7 @@ local seqGenerators={
ins(seq,seq0[i])
end
while true do
while #P.nextQueue<6 do
while #P.nextQueue<12 do
if seq[1]then
P:getNext(rem(seq))
else