整 理 代 码

(应该没有改到字符串里面的东西吧…)起码不直接影响运行
This commit is contained in:
MrZ_26
2022-10-01 11:32:11 +08:00
parent 6e00ff96ec
commit 06f4bb4e1a
236 changed files with 2087 additions and 2114 deletions

View File

@@ -19,13 +19,13 @@ local trophyColor--Current trophy color
function scene.sceneInit()
page=0
if SCN.prev:find("setting")then
if SCN.prev:find("setting") then
TEXT.show(text.needRestart,640,410,50,'fly',.6)
end
local P1=PLAYERS[1]
local S=P1.stat
timer1=SCN.prev=='game'and 0 or 50
timer1=SCN.prev=='game' and 0 or 50
timer2=timer1
local frameLostRate=(S.frame/S.time/60-1)*100
@@ -54,7 +54,7 @@ function scene.sceneInit()
--Normalize Values
for i=1,6 do
val[i]=val[i]*radar[i]if val[i]>1.26 then val[i]=1.26+log(val[i]-.26)end
val[i]=val[i]*radar[i] if val[i]>1.26 then val[i]=1.26+log(val[i]-.26) end
end
for i=1,6 do
@@ -87,16 +87,16 @@ function scene.sceneInit()
val[2*i-1],val[2*i]=val[i]*standard[2*i-1],val[i]*standard[2*i]
end
if P1.result=='win'and P1.stat.piece>4 then
if P1.result=='win' and P1.stat.piece>4 then
local acc=P1.stat.finesseRate*.2/P1.stat.piece
rank=CHAR.icon['rank'..(
acc==1. and"Z"or
acc>.97 and"S"or
acc>.94 and"A"or
acc>.87 and"B"or
acc>.70 and"C"or
acc>.50 and"D"or
acc>.30 and"E"or
acc==1. and "Z" or
acc>.97 and "S" or
acc>.94 and "A" or
acc>.87 and "B" or
acc>.70 and "C" or
acc>.50 and "D" or
acc>.30 and "E" or
"F"
)]
if acc==1 then
@@ -122,43 +122,43 @@ end
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='q'then
if key=='q' then
SCN.back()
GAME.playing=false
elseif key=='escape'then
SCN.swapTo(GAME.result and'game'or'depause','none')
elseif key=='s'then
elseif key=='escape' then
SCN.swapTo(GAME.result and 'game' or 'depause','none')
elseif key=='s' then
if not GAME.fromRepMenu then
GAME.prevBG=BG.cur
SCN.go('setting_sound')
end
elseif key=='r'then
elseif key=='r' then
if not GAME.fromRepMenu then
resetGameData()
SCN.swapTo('game','none')
end
elseif key=='p'then
if(GAME.result or GAME.replaying)and #PLAYERS==1 then
elseif key=='p' then
if (GAME.result or GAME.replaying) and #PLAYERS==1 then
resetGameData('r')
PLAYERS[1]:startStreaming(GAME.rep)
SCN.swapTo('game','none')
end
elseif key=='o'then
if(GAME.result or GAME.replaying)and #PLAYERS==1 and not GAME.saved then
if DATA.saveReplay()then
elseif key=='o' then
if (GAME.result or GAME.replaying) and #PLAYERS==1 and not GAME.saved then
if DATA.saveReplay() then
GAME.saved=true
SFX.play('connected')
end
end
elseif key=='tab'or key=='Stab'then
if love.keyboard.isDown('lshift','rshift')or key=='Stab'then
elseif key=='tab' or key=='Stab' then
if love.keyboard.isDown('lshift','rshift') or key=='Stab' then
page=(page-1)%2
else
page=(page+1)%2
end
timer2=0
elseif key=='t'then
if SETTING.allowTAS and not(GAME.result or GAME.replaying)then
elseif key=='t' then
if SETTING.allowTAS and not (GAME.result or GAME.replaying) then
GAME.tasUsed=true
SFX.play('ren_mega')
SFX.play('clear_3')
@@ -170,7 +170,7 @@ function scene.keyDown(key,isRep)
end
function scene.update(dt)
if not(GAME.result or GAME.replaying)then
if not (GAME.result or GAME.replaying) then
GAME.pauseTime=GAME.pauseTime+dt
end
timer1=math.min(timer1+dt*60*.02,1)
@@ -198,13 +198,13 @@ function scene.draw()
gc.setColor(.97,.97,.97,timer1)
--Result Text
mDraw(GAME.result and TEXTOBJ[GAME.result]or TEXTOBJ.pause,640,70-10*(5-timer1*5)^1.5)
mDraw(GAME.result and TEXTOBJ[GAME.result] or TEXTOBJ.pause,640,70-10*(5-timer1*5)^1.5)
--Mode Info (outside)
gc.draw(TEXTOBJ.modeName,745-TEXTOBJ.modeName:getWidth(),143)
--Level rank
if RANK_CHARS[GAME.rank]then
if RANK_CHARS[GAME.rank] then
gc.push('transform')
gc.translate(1050,5)
setFont(80)
@@ -320,7 +320,7 @@ function scene.draw()
gc.scale(.65)
if #GAME.mod>0 then
gc.setLineWidth(2)
if scoreValid()then
if scoreValid() then
gc.setColor(.7,.7,.7,timer1)
gc.rectangle('line',-5,-5,500,150,8)
gc.setColor(.7,.7,.7,timer1*.05)
@@ -345,22 +345,22 @@ end
scene.widgetList={
WIDGET.newKey{name='resume', x=290,y=240,w=300,h=70,code=pressKey'escape'},
WIDGET.newKey{name='restart', x=290,y=340,w=300,h=70,code=pressKey'r',hideF=function()return GAME.fromRepMenu end},
WIDGET.newKey{name='setting', x=290,y=440,w=300,h=70,code=pressKey's',hideF=function()return GAME.fromRepMenu end},
WIDGET.newKey{name='restart', x=290,y=340,w=300,h=70,code=pressKey'r',hideF=function() return GAME.fromRepMenu end},
WIDGET.newKey{name='setting', x=290,y=440,w=300,h=70,code=pressKey's',hideF=function() return GAME.fromRepMenu end},
WIDGET.newKey{name='quit', x=290,y=540,w=300,h=70,code=pressKey'q'},
WIDGET.newKey{name='tas', x=290,y=620,w=240,h=50,code=pressKey't',hideF=function()return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
WIDGET.newKey{name='tas', x=290,y=620,w=240,h=50,code=pressKey't',hideF=function() return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
WIDGET.newKey{name='page_prev',x=500,y=390,w=70,code=pressKey'tab',
fText=GC.DO{70,70,{'setLW',2}, {'dRRPol',33,35,32,3,6,3.142},{'dRRPol',45,35,32,3,6,3.142}},
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRRPol',33,35,32,3,6,3.142},{'fRRPol',45,35,32,3,6,3.142}}}},
hideF=function()return PLAYERS[1].frameRun<=180 end,
hideF=function() return PLAYERS[1].frameRun<=180 end,
},
WIDGET.newKey{name='page_next',x=1230,y=390,w=70,code=pressKey'Stab',
fText=GC.DO{70,70,{'setLW',2}, {'dRRPol',37,35,32,3,6},{'dRRPol',25,35,32,3,6}},
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRRPol',37,35,32,3,6},{'fRRPol',25,35,32,3,6}}}},
hideF=function()return PLAYERS[1].frameRun<=180 end,
hideF=function() return PLAYERS[1].frameRun<=180 end,
},
WIDGET.newKey{name='replay', x=865,y=165,w=200,h=40,font=25,code=pressKey'p',hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey'o',hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
WIDGET.newKey{name='replay', x=865,y=165,w=200,h=40,font=25,code=pressKey'p',hideF=function() return not (GAME.result or GAME.replaying) or #PLAYERS>1 end},
WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey'o',hideF=function() return not (GAME.result or GAME.replaying) or #PLAYERS>1 or GAME.saved end},
}
return scene