modeData地位提升,模式环境变量target移入其中,大规模整理代码,可读性增强
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
local rnd,min=math.random,math.min
|
||||
local rnd=math.random
|
||||
local rem=table.remove
|
||||
local function check_c4w(P)
|
||||
if P.lastPiece.row==0 then
|
||||
P:lose()
|
||||
else
|
||||
for _=1,P.lastPiece.row do
|
||||
P.field[#P.field+1]=FREEROW.get(20)
|
||||
P.visTime[#P.visTime+1]=FREEROW.get(20)
|
||||
for i=4,7 do P.field[#P.field][i]=0 end
|
||||
local h=#P.field
|
||||
P.field[h+1]=FREEROW.get(20)
|
||||
P.visTime[h+1]=FREEROW.get(20)
|
||||
for i=4,7 do P.field[h][i]=0 end
|
||||
end
|
||||
if P.combo>P.modeData.point then
|
||||
P.modeData.point=P.combo
|
||||
if P.combo>P.modeData.maxCombo then
|
||||
P.modeData.maxCombo=P.combo
|
||||
end
|
||||
if P.stat.row>=100 then
|
||||
P:win("finish")
|
||||
@@ -22,6 +23,7 @@ return{
|
||||
color=COLOR.red,
|
||||
env={
|
||||
drop=5,lock=30,
|
||||
task=function(P)P.modeData.maxCombo=0 end,
|
||||
dropPiece=check_c4w,
|
||||
freshLimit=15,ospin=false,
|
||||
bg="rgb",bgm="oxygen",
|
||||
@@ -55,15 +57,15 @@ return{
|
||||
mesDisp=function(P)
|
||||
setFont(45)
|
||||
mStr(P.combo,69,310)
|
||||
mStr(P.modeData.point,69,400)
|
||||
mStr(P.modeData.maxCombo,69,400)
|
||||
mText(drawableText.combo,69,358)
|
||||
mText(drawableText.maxcmb,69,450)
|
||||
end,
|
||||
score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
|
||||
score=function(P)return{math.min(P.modeData.maxCombo,100),P.stat.time}end,
|
||||
scoreDisp=function(D)return D[1].." Combo "..TIMESTR(D[2])end,
|
||||
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
|
||||
getRank=function(P)
|
||||
local L=P.modeData.point
|
||||
local L=P.modeData.maxCombo
|
||||
if L==100 then
|
||||
local T=P.stat.time
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user