Compare commits

...

1 Commits

Author SHA1 Message Date
MrZ_26
72dcb84662 Alpha V0.7.12 2020-02-04 19:32:38 +08:00
19 changed files with 934 additions and 798 deletions

BIN
BGM/sores.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
SFX/lock.ogg Normal file

Binary file not shown.

7
ai.lua
View File

@@ -171,11 +171,4 @@ function AI_getControls(ctrl)
ins(ctrl,l[i])
end
ins(ctrl,6)
if rnd()<.1 then
if P.atkMode~=4 and P==mostDangerous then
ins(P.ai.controls,9)
--Smarter AI???
end
end
end

View File

@@ -14,37 +14,32 @@ function onVirtualkey(x,y)
end
function buttonControl_key(i)
if i=="up"or i=="down"or i=="left"or i=="right"then
if not Buttons.sel then
if Buttons[scene][1]then
Buttons.sel=1
end
if Buttons.sel then
Buttons.sel=Buttons[scene][Buttons.sel[i]]or Buttons.sel
else
Buttons.sel=Buttons[scene][Buttons.sel][i]or Buttons.sel
Buttons.sel=select(2,next(Buttons[scene]))
mouseShow=false
end
elseif i=="space"or i=="return"then
if not sceneSwaping and Buttons.sel then
local B=Buttons[scene][Buttons.sel]
B.code()
B.alpha=1
Buttons.sel.alpha=1
Buttons.sel.code()
sysSFX("button")
end
end
end
function buttonControl_gamepad(i)
if i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
if not Buttons.sel then
if Buttons[scene][1]then
Buttons.sel=1
end
mouseShow=false
if Buttons.sel then
Buttons.sel=Buttons[scene][Buttons.sel[i=="dpup"and"up"or i=="dpdown"and"down"or i=="dpleft"and"left"or"right"]]or Buttons.sel
else
Buttons.sel=Buttons[scene][Buttons.sel][i=="dpup"and"up"or i=="dpdown"and"down"or i=="dpleft"and"left"or"right"]or Buttons.sel
Buttons.sel=select(2,next(Buttons[scene]))
mouseShow=false
end
elseif i=="start"then
if not sceneSwaping and Buttons.sel then
local B=Buttons[scene][Buttons.sel]
B.code()
B.alpha=1
Buttons.sel.alpha=1
Buttons.sel.code()
sysSFX("button")
end
end
@@ -257,40 +252,37 @@ end
function love.mousemoved(x,y,dx,dy,t)
if not t then
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
Buttons.sel=nil
for i=1,#Buttons[scene]do
local B=Buttons[scene][i]
if not(B.hide and B.hide())then
if abs(mx-B.x)<B.w*.5 and abs(my-B.y)<B.h*.5 then
Buttons.sel=i
return
end
if t then return end
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
Buttons.sel=nil
for N,B in next,Buttons[scene]do
if not(B.hide and B.hide())then
if abs(mx-B.x)<B.w*.5 and abs(my-B.y)<B.h*.5 then
Buttons.sel=B
return
end
end
end
end
function love.mousepressed(x,y,k,t,num)
if not t then
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
if mouseDown[scene]then
mouseDown[scene](mx,my,k)
else
if k==1 then
if not sceneSwaping and Buttons.sel then
local B=Buttons[scene][Buttons.sel]
B.code()
B.alpha=1
Buttons.sel=nil
love.mousemoved(x,y)
sysSFX("button")
end
elseif k==2 then
back()
if t then return end
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
if mouseDown[scene]then
mouseDown[scene](mx,my,k)
else
if k==1 then
if not sceneSwaping and Buttons.sel then
local B=Buttons.sel
B.code()
B.alpha=1
Buttons.sel=nil
love.mousemoved(x,y)
sysSFX("button")
end
elseif k==2 then
back()
end
end
end
@@ -333,6 +325,7 @@ function love.touchreleased(id,x,y)
B.code()
B.alpha=1
Buttons.sel=nil
sysSFX("button")
end
Buttons.sel=nil
mouseShow=false
@@ -382,6 +375,8 @@ function love.keypressed(i)
if i=="f12"then devMode=not devMode end
if devMode then
if i=="k"then
P=players.alive[rnd(#players.alive)]
Event_gameover.lose()
--Test code here
elseif i=="q"then
for i=1,#Buttons[scene]do
@@ -389,7 +384,7 @@ function love.keypressed(i)
print(format("x=%d,y=%d,w=%d,h=%d",B.x,B.y,B.w,B.h))
end
elseif Buttons.sel then
local B=Buttons[scene][Buttons.sel]
local B=Buttons.sel
if i=="left"then B.x=B.x-10
elseif i=="right"then B.x=B.x+10
elseif i=="up"then B.y=B.y-10
@@ -458,9 +453,9 @@ function love.update(dt)
if sceneSwaping then
sceneSwaping.time=sceneSwaping.time-1
if sceneSwaping.time==sceneSwaping.mid then
for i=1,#Buttons[scene]do
Buttons[scene][i].alpha=0
end--Reset buttons' state
for k,B in next,Buttons[scene]do
B.alpha=0
end--Reset buttons' alpha
scene=sceneSwaping.tar
BGM("blank")
sceneInit[scene]()
@@ -468,9 +463,13 @@ function love.update(dt)
elseif sceneSwaping.time==0 then
sceneSwaping=nil
end
elseif Tmr[scene]then
end
if Tmr[scene]then
Tmr[scene](dt)
end
for i=#Task,1,-1 do
Task[i]:update()
end
updateButton()
end
function love.sendData(data)
@@ -523,7 +522,9 @@ function love.draw()
end
end
function love.resize(w,h)
ww,wh=w,h
if w>=h then ww,wh=w,h
else ww,wh=h,w
end
screenK=h/w>=.5625 and w/1280 or h/720
xOy=xOy:setTransformation(w*.5,h*.5,nil,screenK,nil,640,360)
gc.replaceTransform(xOy)

45
class.lua Normal file
View File

@@ -0,0 +1,45 @@
Task={}
metatable_task={__index=Task}
function newTask(code,P,data)
local obj={
code=code,
P=P,
data=data,
}
setmetatable(obj,metatable_task)
ins(Task,obj)
end
function clearTask(opt)
if opt=="all"then
while Task[1]do
rem(Task,i)
end
elseif opt=="play"then
for i=#Task,1,-1 do
if Task[i].P then
rem(Task,i)
end
end
else--Player table
for i=#Task,1,-1 do
if Task[i].P==P then
rem(Task,i)
end
end
end
end
function Task:update()
if self.code(self.P,self.data)then
self:destroy()
return nil
end
end
function Task:destroy()
for i=#Task,1,-1 do
if Task[i]==self then
rem(Task,i)
return nil
end
end
end

View File

@@ -9,7 +9,7 @@ function love.conf(t)
t.audio.mixwithsystem=true--Switch on to keep sysBGM
local W=t.window
W.title="Techmino V0.7.11"
W.title="Techmino V0.7.12"
W.icon="/image/icon.png"
W.width,W.height=1280,720
W.minwidth,W.minheight=640,360
@@ -17,7 +17,7 @@ function love.conf(t)
W.resizable=true
W.fullscreentype="desktop"--Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string)
W.fullscreen=X
W.vsync=X--0 to set ∞fps
W.vsync=0--0 to set ∞fps
W.msaa=X--The number of samples to use with multi-sampled antialiasing (number)
W.depth=X--Bits per sample in the depth buffer
W.stencil=1--The number of bits per sample in the stencil buffer

View File

@@ -20,11 +20,11 @@ local PClist={
{2,5,4,3},{2,5,6,7},{7,5,4,2},{4,5,3,5},
}
local marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0}
local rush_lock={20,18,16,14,12}
local rush_lock={20,18,16,15,14}
local rush_wait={12,10,9,8,7}
local rush_fall={12,11,10,9,8}
local death_lock={12,11,10,9,8}
local death_wait={9,8,7,6,5}
local rush_fall={18,16,14,13,12}
local death_lock={12,10,9,8,7}
local death_wait={10,9,8,7,6}
local death_fall={10,9,8,7,6}
local pc_drop={50,45,40,35,30,26,22,18,15,12}
local pc_lock={55,50,45,40,36,32,30}
@@ -89,114 +89,11 @@ freshMethod={
end,
}
Event={
gameover={
win=function()
local P=players.alive[1]
P.alive=false
P.control=false
P.timing=false
P.waiting=1e99
P.b2b=0
if modeEnv.royaleMode then
P.rank=1
P.result="WIN"
showText(P,1,"appear",60,120,nil,true)
changeAtk(P)
end
::L::if P.task[1]then
rem(P.task)
goto L
end
for i=1,#P.atkBuffer do
P.atkBuffer[i].sent=true
P.atkBuffer[i].time=0
end
for i=1,#P.field do
for j=1,10 do
P.visTime[i][j]=min(P.visTime[i][j],20)
end
end
showText(P,text.win,"beat",90,nil,nil,true)
if P.id==1 and players[2]and players[2].ai then SFX("win")end
ins(P.task,Event.task.win)
end,
lose=function()
P.alive=false
P.control=false
P.timing=false
P.waiting=1e99
P.b2b=0
::L::if P.task[1]then
rem(P.task)
goto L
end
for i=1,#players.alive do
if players.alive[i]==P then
rem(players.alive,i)
break
end
end
if modeEnv.royaleMode then
changeAtk(P)
P.result="K.O."
P.rank=#players.alive+1
showText(P,P.rank,"appear",60,120,nil,true)
P.strength=0
local A=P
::L::
A=A.lastRecv
if A and not A.alive and A~=P then goto L end
if A and A~=P then
if P.id==1 or A.id==1 then
P.killMark=A.id==1
end
A.ko,A.badge=A.ko+1,A.badge+P.badge+1
for i=A.strength+1,4 do
if A.badge>=modeEnv.royalePowerup[i]then
A.strength=i
end
end
P.lastRecv=A
if P.id==1 or A.id==1 then
ins(P.task,Event.task.throwBadge)
end
freshMostBadge()
end
freshMostDangerous()
for i=1,#players.alive do
if players.alive[i].atking==P then
freshTarget(players.alive[i])
end
end
if #players.alive==modeEnv.royaleRemain[gameStage]then
royaleLevelup()
end
end
for i=1,#P.atkBuffer do
P.atkBuffer[i].sent=true
P.atkBuffer[i].time=0
end
for i=1,#P.field do
for j=1,10 do
P.visTime[i][j]=min(P.visTime[i][j],20)
end
end
showText(P,text.lose,"appear",90,nil,nil,true)
if P.id==1 and players[2]and players[2].ai then SFX("fail")end
ins(P.task,Event.task.lose)
if #players.alive==1 then
local t=P
P=players.alive[1]
Event.gameover.win()
P=t
end
end,
},
marathon_reach=function()
local s=int(P.cstat.row*.1)
if s>=20 then
P.cstat.row=200
Event.gameover.win()
Event_gameover.win()
else
P.gameEnv.drop=marathon_drop[s]
if s==18 then P.gameEnv._20G=true end
@@ -204,37 +101,58 @@ Event={
SFX("reach")
end
end,
marathon_reach_lunatic=function()
if P.gameEnv.target==250 then
P.cstat.row=250
Event.gameover.win()
else
P.gameEnv.target=P.gameEnv.target+50
local t=P.gameEnv.target/50
P.gameEnv.lock=rush_lock[t]
P.gameEnv.wait=rush_wait[t]
P.gameEnv.fall=rush_fall[t]
if t==4 then P.gameEnv.bone=true end
showText(P,text.stage[t],"fly",80,-120)
SFX("reach")
master_reach_lunatic=function()
local t=P.cstat.point
if t%100==99 and #P.clearing==0 then goto L end
t=t+clearPoint[#P.clearing]
if int(t*.01)>P.cstat.event then
P.cstat.event=P.cstat.event+1
if P.cstat.event==5 then
P.cstat.event=4
P.cstat.point=500
Event_gameover.win()
goto L
else
local s=P.cstat.event+1
P.gameEnv.lock=rush_lock[s]
P.gameEnv.wait=rush_wait[s]
P.gameEnv.fall=rush_fall[s]
P.gameEnv.das=10-s
if s==3 then P.gameEnv.arr=2 end
if s==5 then P.gameEnv.bone=true end
showText(P,text.stage[s],"fly",80,-120)
SFX("reach")
end
end
P.cstat.point=t
if t%100==99 then SFX("blip_1")end
::L::
end,
marathon_reach_ultimate=function()
if P.cstat.event==5 then
P.cstat.row=250
Event.gameover.win()
else
local t=P.cstat.event+1
if t==1 then t=2 end
P.gameEnv.target=50*t
P.cstat.event=t
P.gameEnv.lock=death_lock[t]
P.gameEnv.wait=death_wait[t]
P.gameEnv.fall=death_fall[t]
if t==4 then P.gameEnv.bone=true end
showText(P,text.stage[t],"fly",80,-120)
SFX("reach")
master_reach_ultimate=function()
local t=P.cstat.point
if t%100==99 and #P.clearing==0 then goto L end
t=t+clearPoint[#P.clearing]
if int(t*.01)>P.cstat.event then
P.cstat.event=P.cstat.event+1
if P.cstat.event==5 then
P.cstat.event=4
P.cstat.point=500
Event_gameover.win()
goto L
else
local s=P.cstat.event+1
P.gameEnv.lock=death_lock[s]
P.gameEnv.wait=death_wait[s]
P.gameEnv.fall=death_fall[s]
P.gameEnv.das=int(7.3-s*.4)
if s==4 then P.gameEnv.bone=true end
showText(P,text.stage[s],"fly",80,-120)
SFX("reach")
end
end
P.cstat.point=t
if t%100==99 then SFX("blip_1")end
::L::
end,
classic_reach=function()
P.gameEnv.target=P.gameEnv.target+10
@@ -245,7 +163,7 @@ Event={
end,
tsd_reach=function()
if P.lastClear~=52 then
Event.gameover.lose()
Event_gameover.lose()
elseif #P.clearing>0 then
P.cstat.event=P.cstat.event+1
if #P.field>11 and P.cstat.event%5~=1 then
@@ -255,12 +173,12 @@ Event={
end,
tech_reach=function()
if #P.clearing>0 and P.lastClear<10 then
Event.gameover.lose()
Event_gameover.lose()
end
end,
tech_reach_hard=function()
if #P.clearing>0 and P.lastClear<10 or P.lastClear==74 then
Event.gameover.lose()
Event_gameover.lose()
end
end,
newPC=function()
@@ -268,7 +186,7 @@ Event={
if P.cstat.piece%4==0 then
if #P.field==#P.clearing then
P.counter=P.cstat.piece==0 and 20 or 0
ins(P.task,Event.task.PC)
newTask(Event_task.PC,P)
if curMode.lv==2 then
local s=P.cstat.pc*.5
if int(s)==s and s>0 then
@@ -283,206 +201,321 @@ Event={
end
end
else
Event.gameover.lose()
Event_gameover.lose()
end
end
end,
task={
win=function()
P.endCounter=P.endCounter+1
if P.endCounter>80 then
if P.gameEnv.visible=="show"then
for i=1,#P.field do
for j=1,10 do
if P.visTime[i][j]>0 then
P.visTime[i][j]=P.visTime[i][j]-1
end
end
}
Event_gameover={
win=function()
local P=players.alive[1]
P.alive=false
P.control=false
P.timing=false
P.waiting=1e99
P.b2b=0
clearTask(P)
if modeEnv.royaleMode then
P.rank=1
P.result="WIN"
showText(P,1,"appear",60,120,nil,true)
changeAtk(P)
end
for i=1,#P.atkBuffer do
P.atkBuffer[i].sent=true
P.atkBuffer[i].time=0
end
for i=1,#P.field do
for j=1,10 do
P.visTime[i][j]=min(P.visTime[i][j],20)
end
end
showText(P,text.win,"beat",90,nil,nil,true)
if P.id==1 and players[2]and players[2].ai then SFX("win")BGM()end
newTask(Event_task.win,P)
end,
lose=function()
P.alive=false
P.control=false
P.timing=false
P.waiting=1e99
P.b2b=0
clearTask(P)
for i=1,#players.alive do
if players.alive[i]==P then
rem(players.alive,i)
break
end
end
if modeEnv.royaleMode then
changeAtk(P)
P.result="K.O."
P.rank=#players.alive+1
showText(P,P.rank,"appear",60,120,nil,true)
P.strength=0
local A,i=P,0
::L::
A,i=A.lastRecv,i+1
if A and not A.alive and A~=P and i<3 then goto L end
if A and A~=P then
if P.id==1 or A.id==1 then
P.killMark=A.id==1
end
A.ko,A.badge=A.ko+1,A.badge+P.badge+1
for i=A.strength+1,4 do
if A.badge>=modeEnv.royalePowerup[i]then
A.strength=i
end
if P.endCounter==100 then
for i=1,#P.field do
removeRow(P.field)
removeRow(P.visTime)
end
return true
end
elseif P.endCounter==100 then
return true
end
P.lastRecv=A
if P.id==1 or A.id==1 then
newTask(Event_task.throwBadge,nil,{P,max(3,P.badge)*4})
end
freshMostBadge()
else
P.badge=-1
end
freshMostDangerous()
for i=1,#players.alive do
if players.alive[i].atking==P then
freshTarget(players.alive[i])
end
end
end,
lose=function()
P.endCounter=P.endCounter+1
if P.endCounter>80 then
if P.gameEnv.visible=="show"then
for i=1,#P.field do
for j=1,10 do
if P.visTime[i][j]>0 then
P.visTime[i][j]=P.visTime[i][j]-1
end
end
end
if P.endCounter==100 then
for i=1,#P.field do
removeRow(P.field)
removeRow(P.visTime)
end
return true
end
elseif P.endCounter==100 then
return true
end
if #players.alive==modeEnv.royaleRemain[gameStage]then
royaleLevelup()
end
end,
throwBadge=function()
if P.badge%2==0 then
throwBadge(P,P.lastRecv)
if P.badge%16==0 then
sysSFX("collect")
end
end
for i=1,#P.atkBuffer do
P.atkBuffer[i].sent=true
P.atkBuffer[i].time=0
end
for i=1,#P.field do
for j=1,10 do
P.visTime[i][j]=min(P.visTime[i][j],20)
end
P.badge=P.badge-1
if P.badge<=0 then return true end
end,
dig_normal=function()
local P=players[1]
P.counter=P.counter+1
if #P.clearing==0 and P.counter>=max(90,180-2*P.cstat.event)then
ins(P.field,1,getNewRow(10))
ins(P.visTime,1,getNewRow(1e99))
P.field[1][rnd(10)]=0
P.fieldBeneath=P.fieldBeneath+30
P.curY,P.y_img=P.curY+1,P.y_img+1
P.counter=0
P.cstat.event=P.cstat.event+1
end
showText(P,text.lose,"appear",90,nil,nil,true)
if P.id==1 then
SFX("fail")
if modeEnv.royaleMode then
BGM("sores")
end
end,
dig_lunatic=function()
local P=players[1]
P.counter=P.counter+1
if #P.clearing==0 and P.counter>=max(45,80-.4*P.cstat.event)then
ins(P.field,1,getNewRow(11+P.cstat.event%3))
ins(P.visTime,1,getNewRow(1e99))
P.field[1][rnd(10)]=0
P.fieldBeneath=P.fieldBeneath+30
P.curY,P.y_img=P.curY+1,P.y_img+1
P.counter=0
P.cstat.event=P.cstat.event+1
end
end,
survivor_easy=function()
local P=players[1]
P.counter=P.counter+1
if P.counter==max(60,180-2*P.cstat.event)then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1})
P.counter=0
if P.cstat.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_normal=function()
local P=players[1]
P.counter=P.counter+1
if P.counter==max(60,180-2*P.cstat.event)then
local d=P.cstat.event+1
if d%4==0 then ins (P.atkBuffer,{rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1})
elseif d%4==1 then ins(P.atkBuffer,{rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1})
elseif d%4==2 then ins(P.atkBuffer,{rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2})
elseif d%4==3 then ins(P.atkBuffer,{rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3})
end
P.counter=0
if P.cstat.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_hard=function()
local P=players[1]
P.counter=P.counter+1
if P.counter==max(60,180-2*P.cstat.event)then
if P.cstat.event%3<2 then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1})
else
ins(P.atkBuffer,{rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2})
end
P.counter=0
if P.cstat.event==45 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_lunatic=function()
local P=players[1]
P.counter=P.counter+1
if P.counter==max(90,150-P.cstat.event)then
local t=max(60,90-P.cstat.event)
ins(P.atkBuffer,{rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3})
P.counter=0
if P.cstat.event==30 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
PC=function()
local P=players[1]
P.counter=P.counter+1
if P.counter==21 then
local t=P.cstat.pc%2
for i=1,4 do
local r=getNewRow()
end
newTask(Event_task.lose,P)
if #players.alive==1 then
local t=P
P=players.alive[1]
Event_gameover.win()
P=t
end
end,
}
Event_task={
win=function(P)
P.endCounter=P.endCounter+1
if P.endCounter>80 then
if P.gameEnv.visible=="show"then
for i=1,#P.field do
for j=1,10 do
r[j]=PCbase[4*t+i][j]
if P.visTime[i][j]>0 then
P.visTime[i][j]=P.visTime[i][j]-1
end
end
ins(P.field,1,r)
ins(P.visTime,1,getNewRow(P.showTime))
end
P.fieldBeneath=P.fieldBeneath+120
-- P.curY=P.curY+4
P.y_img=P.y_img+4
freshgho()
if P.endCounter==100 then
for i=1,#P.field do
removeRow(P.field)
removeRow(P.visTime)
end
return true
end
elseif P.endCounter==100 then
return true
end
end,
},
end
end,
lose=function(P)
P.endCounter=P.endCounter+1
if P.endCounter>80 then
if P.gameEnv.visible=="show"then
for i=1,#P.field do
for j=1,10 do
if P.visTime[i][j]>0 then
P.visTime[i][j]=P.visTime[i][j]-1
end
end
end
if P.endCounter==100 then
for i=1,#P.field do
removeRow(P.field)
removeRow(P.visTime)
end
return true
end
elseif P.endCounter==100 then
return true
end
end
end,
throwBadge=function(P,data)
data[2]=data[2]-1
if data[2]%4==0 then
throwBadge(data[1],data[1].lastRecv)
if data[2]%8==0 then
sysSFX("collect")
end
end
if data[2]<=0 then return true end
end,
dig_normal=function(P)
if not P.control then return end
P.counter=P.counter+1
if #P.clearing==0 and P.counter>=max(90,180-2*P.cstat.event)then
ins(P.field,1,getNewRow(10))
ins(P.visTime,1,getNewRow(1e99))
P.field[1][rnd(10)]=0
P.fieldBeneath=P.fieldBeneath+30
P.curY,P.y_img=P.curY+1,P.y_img+1
P.counter=0
P.cstat.event=P.cstat.event+1
end
end,
dig_lunatic=function(P)
if not P.control then return end
P.counter=P.counter+1
if #P.clearing==0 and P.counter>=max(45,80-.4*P.cstat.event)then
ins(P.field,1,getNewRow(11+P.cstat.event%3))
ins(P.visTime,1,getNewRow(1e99))
P.field[1][rnd(10)]=0
P.fieldBeneath=P.fieldBeneath+30
P.curY,P.y_img=P.curY+1,P.y_img+1
P.counter=0
P.cstat.event=P.cstat.event+1
end
end,
survivor_easy=function(P)
if not P.control then return end
P.counter=P.counter+1
if P.counter==max(60,180-2*P.cstat.event)then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1})
P.counter=0
if P.cstat.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_normal=function(P)
if not P.control then return end
P.counter=P.counter+1
if P.counter==max(60,180-2*P.cstat.event)then
local d=P.cstat.event+1
if d%4==0 then ins (P.atkBuffer,{rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1})
elseif d%4==1 then ins(P.atkBuffer,{rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1})
elseif d%4==2 then ins(P.atkBuffer,{rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2})
elseif d%4==3 then ins(P.atkBuffer,{rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3})
end
P.counter=0
if P.cstat.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_hard=function(P)
if not P.control then return end
P.counter=P.counter+1
if P.counter==max(60,180-2*P.cstat.event)then
if P.cstat.event%3<2 then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1})
else
ins(P.atkBuffer,{rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2})
end
P.counter=0
if P.cstat.event==45 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_lunatic=function(P)
if not P.control then return end
P.counter=P.counter+1
if P.counter==max(90,150-P.cstat.event)then
local t=max(60,90-P.cstat.event)
ins(P.atkBuffer,{rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3})
P.counter=0
if P.cstat.event==30 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
PC=function(P)
P.counter=P.counter+1
if P.counter==21 then
local t=P.cstat.pc%2
for i=1,4 do
local r=getNewRow()
for j=1,10 do
r[j]=PCbase[4*t+i][j]
end
ins(P.field,1,r)
ins(P.visTime,1,getNewRow(P.showTime))
end
P.fieldBeneath=P.fieldBeneath+120
-- P.curY=P.curY+4
P.y_img=P.y_img+4
freshgho()
return true
end
end,
bgmFadeOut=function(_,id)
bgm[id]:setVolume(max(bgm[id]:getVolume()-.03,0))
if bgm[id]:getVolume()==0 then
bgm[id]:stop()
return true
end
end,
bgmFadeIn=function(_,id)
bgm[id]:setVolume(min(bgm[id]:getVolume()+.03,1))
if bgm[id]:getVolume()==1 then return true end
end,
}
defaultModeEnv={
sprint={
{
drop=60,
target=10,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=20,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=40,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=100,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=400,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="push",
},
{
drop=60,
target=1000,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="push",
},
@@ -513,28 +546,30 @@ defaultModeEnv={
bg="strap",
bgm="race",
},
},
master={
{
_20G=true,
drop=0,
lock=rush_lock[1],
wait=rush_wait[1],
fall=rush_fall[1],
target=50,
reach=Event.marathon_reach_lunatic,
arr=2,
target=0,
reach=Event.master_reach_lunatic,
das=9,arr=3,
freshLimit=15,
bg="game2",
bgm="secret8th",
},
{
{
_20G=true,
drop=0,
lock=death_lock[1],
wait=death_wait[1],
fall=death_fall[1],
target=50,
reach=Event.marathon_reach_ultimate,
arr=1,
target=0,
reach=Event.master_reach_ultimate,
das=6,arr=1,
freshLimit=15,
bg="game2",
bgm="secret7th",
@@ -562,7 +597,7 @@ defaultModeEnv={
lock=1e99,
oncehold=false,
target=200,
reach=Event.gameover.win,
reach=Event_gameover.win,
bg="strap",
bgm="infinite",
},
@@ -791,7 +826,7 @@ defaultModeEnv={
drop=300,
lock=1e99,
target=100,
reach=Event.gameover.win,
reach=Event_gameover.win,
ospin=false,
bg="rgb",
bgm="newera",
@@ -801,7 +836,7 @@ defaultModeEnv={
lock=120,
fall=10,
target=100,
reach=Event.gameover.win,
reach=Event_gameover.win,
freshLimit=15,
ospin=false,
bg="rgb",
@@ -812,7 +847,7 @@ defaultModeEnv={
lock=60,
fall=20,
target=100,
reach=Event.gameover.win,
reach=Event_gameover.win,
freshLimit=15,
ospin=false,
bg="rgb",
@@ -828,7 +863,7 @@ defaultModeEnv={
pushSpeed=2,
freshLimit=15,
bg="game3",
bgm="race",
bgm="rockblock",
},
},
techmino99={
@@ -840,7 +875,7 @@ defaultModeEnv={
pushSpeed=2,
freshLimit=15,
bg="game3",
bgm="race",
bgm="rockblock",
},
},
drought={
@@ -849,7 +884,7 @@ defaultModeEnv={
lock=60,
sequence="drought1",
target=100,
reach=Event.gameover.win,
reach=Event_gameover.win,
ospin=false,
freshLimit=15,
bg="glow",
@@ -860,7 +895,7 @@ defaultModeEnv={
lock=60,
sequence="drought2",
target=100,
reach=Event.gameover.win,
reach=Event_gameover.win,
ospin=false,
freshLimit=15,
bg="glow",
@@ -878,7 +913,7 @@ defaultModeEnv={
{
bg="none",
bgm="reason",
reach=Event.gameover.win,
reach=Event_gameover.win,
},
},
}

BIN
font.ttf

Binary file not shown.

View File

@@ -84,7 +84,11 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.control=false
P.timing=false
P.time=0
P.cstat={key=0,piece=0,row=0,atk=0,techrash=0,pc=0,event=0}--Current gamestat
P.cstat={
key=0,piece=0,row=0,atk=0,
techrash=0,pc=0,
point=0,event=0
}--Current gamestat
P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0
P.dropTime={}for i=1,10 do P.dropTime[i]=-1e5 end P.dropSpeed=0
@@ -160,8 +164,7 @@ function createPlayer(id,x,y,size,AIspeed,data)
P.endCounter=0
P.counter=0
P.result=nil--string,"win"/"lose"
P.task={}
P.result=nil--string:win/lose
P.bonus={}
end
function showText(P,text,type,font,dy,spd,inf)
@@ -254,6 +257,20 @@ function freshTarget(P)
end
end
end
function changeAtkMode(m)
if P.atkMode==m then goto L end
P.atkMode=m
if m==1 then
changeAtk(P,randomTarget(P))
elseif m==2 then
freshTarget(P)
elseif m==3 then
freshTarget(P)
elseif m==4 then
changeAtk(P)
end
::L::
end
function changeAtk(P,R)
if P.atking then
local K=P.atking.atker
@@ -311,7 +328,7 @@ function royaleLevelup()
elseif gameStage==3 then
spd=15
garbageSpeed=.6
BGM("cruelty")
if players[1].alive then BGM("cruelty")end
elseif gameStage==4 then
spd=10
pushSpeed=3
@@ -320,7 +337,7 @@ function royaleLevelup()
garbageSpeed=1
elseif gameStage==6 then
spd=3
BGM("final")
if players[1].alive then BGM("final")end
end
for i=1,#players.alive do
local P=players.alive[i]
@@ -415,7 +432,7 @@ function resetblock()
P.curX=P.curX+sgn(P.moving)
end
if ifoverlap(P.curBlock,P.curX,P.curY)then lock()Event.gameover.lose()end
if ifoverlap(P.curBlock,P.curX,P.curY)then lock()Event_gameover.lose()end
freshgho()
if P.keyPressing[6]then act.hardDrop()P.keyPressing[6]=false end
end
@@ -432,7 +449,9 @@ function pressKey(i,p)
if P.control and P.waiting<=0 then
act[actName[i]]()
if i>2 and i<7 then P.keyPressing[i]=false end
elseif P.keyPressing[9]then
elseif i==9 and not setting.swap then
P.atkMode=P.atkMode<3 and P.atkMode+2 or 5-P.atkMode
elseif P.keyPressing[9]and setting.swap then
if i==1 then
P.atkMode=1
changeAtk(P,randomTarget(P))
@@ -556,7 +575,7 @@ function hold(ifpre)
freshgho()
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,0
if ifoverlap(P.curBlock,P.curX,P.curY)then lock()Event.gameover.lose()end
if ifoverlap(P.curBlock,P.curX,P.curY)then lock()Event_gameover.lose()end
SFX(ifpre and"prehold"or"hold")
if P.id==1 then
@@ -612,7 +631,6 @@ function drop()
csend=6
sendTime=100
exblock=exblock+1
P.b2b=P.b2b-20
elseif P.b2b>=40 then
showText(P,text.techrashB2B,"drive",80,-30)
sendTime=80
@@ -653,7 +671,7 @@ function drop()
end
SFX(spin_n[cc])
elseif #P.clearing<#P.field then
P.b2b=max(P.b2b-280-cc*40,0)
P.b2b=max(P.b2b-250,0)
showText(P,text.clear[cc],"appear",32+cc*3,-30,(8-cc)*.3)
csend=cc-1
sendTime=20+csend*20
@@ -752,7 +770,7 @@ function drop()
end
garbageRelease()
end
if id==1 then
if P.id==1 then
stat.piece,stat.row=stat.piece+1,stat.row+cc
end
P.cstat.piece,P.cstat.row=P.cstat.piece+1,P.cstat.row+cc
@@ -760,6 +778,7 @@ function drop()
P.gameEnv.reach()
end
P.spinLast=dospin and cc>0
SFX("lock")
else
P.curY=P.curY-1
P.spinLast=false
@@ -779,11 +798,8 @@ function lock()
end
act={
moveLeft=function(auto)
if P.keyPressing[9]then
if P.atkMode~=1 then
P.atkMode=1
changeAtk(P,randomTarget(P))
end
if P.keyPressing[9]and setting.swap then
changeAtkMode(1)
else
if not auto then
P.moving=-1
@@ -798,11 +814,8 @@ act={
end
end,
moveRight=function(auto)
if P.keyPressing[9]then
if P.atkMode~=2 then
P.atkMode=2
freshTarget(P)
end
if P.keyPressing[9]and setting.swap then
changeAtkMode(2)
else
if not auto then
P.moving=1
@@ -820,11 +833,8 @@ act={
rotLeft=function()spin(3)end,
rotFlip=function()spin(2)end,
hardDrop=function()
if P.keyPressing[9]then
if P.atkMode~=3 then
P.atkMode=3
freshTarget(P)
end
if P.keyPressing[9]and setting.swap then
changeAtkMode(3)
else
if P.waiting<=0 then
if P.curY~=P.y_img then
@@ -838,11 +848,8 @@ act={
end
end,
softDrop=function()
if P.keyPressing[9]then
if P.atkMode~=4 then
P.atkMode=4
changeAtk(P)
end
if P.keyPressing[9]and setting.swap then
changeAtkMode(4)
else
if P.curY~=P.y_img then
P.curY=P.curY-1
@@ -852,7 +859,6 @@ act={
end
end,
hold=function()hold()end,
--Player movements
swap=function()
if modeEnv.royaleMode then
for i=1,#P.keyPressing do
@@ -860,7 +866,12 @@ act={
P.keyPressing[i]=false
end
end
P.keyPressing[9]=true
if setting.swap then
P.keyPressing[9]=true
else
changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode)
P.swappingAtkMode=30
end
else
P.keyPressing[9]=false
end
@@ -904,6 +915,6 @@ act={
end
end
end,
quit=function()Event.gameover.lose()end,
quit=function()Event_gameover.lose()end,
--System movements
}

View File

@@ -1,7 +1,6 @@
return{
royale_remain=function(n)
return "剩余 "..n.." 名玩家"
end,
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
techrash="Techrash",
techrashB2B="Techrash B2B",
@@ -45,7 +44,7 @@ return{
next=nil,
hold={"",""},
sequence={"bag7","his4","随机"},
visible={"可见","半隐","全隐"},
visible={"可见","半隐","全隐","瞬隐"},
target={10,20,40,100,200,500,1000,""},
freshLimit={0,8,15,""},
opponent={"无电脑",1,2,3,4,5,6,7,8,9,10,11},
@@ -58,15 +57,16 @@ return{
setting2Help="方向键选择/翻页,回车修改,esc返回",
actName={"左移:","右移:","顺时针旋转:","时针旋转:","180°旋转","硬降:","软降:","暂存:","切换攻击:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
actName={"左移:","右移:","顺时针旋转:","时针旋转:","180°旋转","硬降:","软降:","暂存:","切换攻击:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
modeName={
[0]="自定义",
"竞速","马拉松","经典","","无尽","单挑","仅TSD","隐形","挖掘","生存","科研",
"竞速","马拉松","大师","经典","","无尽","单挑","仅TSD","隐形","挖掘","生存","科研",
"全清训练","全清挑战","41人混战","99人混战","干旱","多人",
},
modeInfo={
sprint="挑战世界纪录",
marathon="尝试坚持到最后",
master="成为方块大师",
classic="高速经典",
zen="无重力消除200行",
infinite="科研沙盒",
@@ -125,69 +125,71 @@ return{
group="官方QQ群",
ButtonText={
main={
"开始",
"设置",
"统计信息",
"帮助",
"退出",
play="开始",
setting="设置",
stat="统计信息",
help="帮助",
quit="退出",
},
mode={
"Λ",
"v",
"<",
">",
"开始",
"自定义(C)",
"返回",
up="Λ",
down="v",
left="<",
right=">",
start="开始",
custom="自定义(C)",
back="返回",
},
custom={
"Λ",
"v",
"<",
">",
"开始",
"返回",
up="Λ",
down="v",
left="<",
right=">",
start="开始",
back="返回",
},
play={
back="返回",
},
setting={
function()return setting.ghost and"阴影 "or"阴影 "end,
function()return setting.center and"旋转中心 "or"旋转中心 "end,
"-",
"+",
"-",
"+",
"-",
"+",
"-",
"+",
function()return setting.sfx and"音效 开"or"音效 关"end,
function()return setting.bgm and"音乐 "or"音乐 "end,
function()return "震动强度:"..setting.vib end,
function()return setting.fullscreen and"全屏 开"or"全屏 关"end,
function()return setting.bgblock and"背景动画 开"or"背景动画 关"end,
function()return"绘制帧:"..setting.frameMul.."%"end,
"控制设置",
"触摸设置",
function()return langName[setting.lang]end,
"保存&返回",
ghost=function()return setting.ghost and"阴影:"or"阴影:"end,
center=function()return setting.center and"旋转中心:"or"旋转中心:"end,
grid=function()return setting.grid and"网格:开"or"网格:关"end,
swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end,
dasD="-",dasU="+",
arrD="-",arrU="+",
sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+",
sfx=function()return setting.sfx and"音效:开"or"音效:关"end,
bgm=function()return setting.bgm and"音乐:开"or"音乐:关"end,
vib=function()return "震动强度:"..setting.vib end,
fullscreen=function()return setting.fullscreen and"全屏:"or"全屏:"end,
bgblock=function()return setting.bgblock and"背景动画:开"or"背景动画:关"end,
frame=function()return"绘制帧:"..setting.frameMul.."%"end,
control="控制设置",
touch="触摸设置",
lang=function()return langName[setting.lang]end,
back="保存&返回",
},
setting2={
"返回",
back="返回",
},
setting3={
"返回",
function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
"默认组合",
function()return text.snapLevelName[snapLevel]end,
function()return percent0to5[setting.virtualkeyAlpha]end,
"图标",
"大小",
back="返回",
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return percent0to5[setting.virtualkeyAlpha]end,
icon="图标",
size="大小",
},
help={
"返回",
"作者QQ",
back="返回",
qq="作者QQ",
},
stat={
"返回",
back="返回",
path="打开存储目录",
},
},
}--中文→

View File

@@ -1,7 +1,6 @@
return{
royale_remain=function(n)
return n.." Players Remain"
end,
atkModeName={"Random","Badges","K.O.s","Counters"},
royale_remain=function(n)return n.." Players Remain"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
techrash="Techrash",
techrashB2B="Techrash B2B",
@@ -45,7 +44,7 @@ return{
next=nil,
hold={"on","off"},
sequence={"bag7","his4","random"},
visible={"normal","time","invisible"},
visible={"normal","time","invisible","sudden"},
target={10,20,40,100,200,500,1000,""},
freshLimit={0,8,15,""},
opponent={"No CPU",1,2,3,4,5,6,7,8,9,10,11},
@@ -61,12 +60,13 @@ return{
actName={"Move Left:","Move Right:","Rotate Right:","Rotate Left:","Rotate Flip:","Hard Drop:","Soft Drop:","Hold:","Swap:","Restart:","Instant Left:","Instant Right:","Ins Down:"},
modeName={
[0]="Custom",
"Sprint","Marathon","Classic","Zen","Infinite","1v1","TSD-only","Blind","Dig","Survivor","Tech",
"Sprint","Marathon","Master","Classic","Zen","Infinite","1v1","TSD-only","Blind","Dig","Survivor","Tech",
"PC Train","PC Challenge","Techmino41","Techmino99","Drought","Hotseat",
},
modeInfo={
sprint="Speed run",
marathon="Survive and reach target",
master="To be Grand Master",
classic="Vintage car drag racing",
zen="Clear 200 Lines without gravity",
infinite="Infinite game,infinite happiness",
@@ -125,69 +125,75 @@ return{
group="Official QQ Group",
ButtonText={
main={
"Play",
"Settings",
"Statistics",
"Help",
"Quit",
play="Play",
setting="Settings",
stat="Statistics",
help="Help",
quit="Quit",
},
mode={
"Λ",
"v",
"<",
">",
"Start",
"Custom(C)",
"Back",
up="Λ",
down="v",
left="<",
right=">",
start="Start",
custom="Custom(C)",
back="Back",
},
custom={
"Λ",
"v",
"<",
">",
"Start",
"Back",
up="Λ",
down="v",
left="<",
right=">",
start="Start",
back="Back",
},
play={
back="Back",
},
setting={
function()return setting.ghost and"Ghost:ON"or"Ghost:OFF"end,
function()return setting.center and"Center:ON"or"Center:OFF"end,
"-",
"+",
"-",
"+",
"-",
"+",
"-",
"+",
function()return setting.sfx and"SFX:on"or"SFX:off"end,
function()return setting.bgm and"BGM:on"or"BGM:off"end,
function()return "Vibrate level:"..setting.vib end,
function()return setting.fullscreen and"Fullscreen:on"or"Fullscreen:off"end,
function()return setting.bgblock and"BG animation:on"or"BG animation:off"end,
function()return"FrameDraw:"..setting.frameMul.."%"end,
"Control settings",
"Touch settings",
function()return langName[setting.lang]end,
"Save&Back",
ghost=function()return setting.ghost and"Ghost:ON"or"Ghost:OFF"end,
center=function()return setting.center and"Center:ON"or"Center:OFF"end,
grid=function()return setting.grid and"Grid:ON"or"Grid:OFF"end,
swap=function()return setting.swap and"Swap:comboKey"or"Swap:loop"end,
dasD="-",
dasU="+",
arrD="-",
arrU="+",
sddasD="-",
sddasU="+",
sdarrD="-",
sdarrU="+",
sfx=function()return setting.sfx and"SFX:ON"or"SFX:off"end,
bgm=function()return setting.bgm and"BGM:ON"or"BGM:off"end,
vib=function()return "Vibrate level:"..setting.vib end,
fullscreen=function()return setting.fullscreen and"Fullscreen:ON"or"Fullscreen:off"end,
bgblock=function()return setting.bgblock and"BG animation:ON"or"BG animation:off"end,
frame=function()return"FrameDraw:"..setting.frameMul.."%"end,
control="Control settings",
touch="Touch settings",
lang=function()return langName[setting.lang]end,
back="Save&Back",
},
setting2={
"Back",
back="Back",
},
setting3={
"Back",
function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,
"Defaults",
function()return text.snapLevelName[snapLevel]end,
function()return percent0to5[setting.virtualkeyAlpha]end,
"Icon",
"Size",
back="Back",
hide=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,
default="Defaults",
snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return percent0to5[setting.virtualkeyAlpha]end,
icon="Icon",
size="Size",
},
help={
"Back",
"Author's qq",
back="Back",
qq="Author's qq",
},
stat={
"Back",
back="Back",
path="Open Data Folder",
},
}
}

295
list.lua
View File

@@ -43,7 +43,7 @@ color={
lightPurple={.7,.3,1},
}
attackColor={
{color.darkGrey,color.lightGrey},
{color.darkGrey,color.white},
{color.grey,color.white},
{color.lightPurple,color.white},
{color.lightRed,color.white},
@@ -82,7 +82,7 @@ sfx={
"ready","start","win","fail","collect",
"move","rotate","rotatekick","hold",
"prerotate","prehold",
"drop","fall",
"lock","drop","fall",
"reach",
"ren_1","ren_2","ren_3","ren_4","ren_5","ren_6","ren_7","ren_8","ren_9","ren_10","ren_11",
"clear_1","clear_2","clear_3","clear_4",
@@ -103,8 +103,77 @@ bgm={
"secret7th",
"secret8th",
"rockblock",
"sores",
}
sceneInit={
load=function()
curBG="none"
keeprun=true
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar(0~1)
end,
intro=function()
curBG="none"
count=0
keeprun=true
end,
main=function()
curBG="none"
keeprun=true
collectgarbage()
end,
mode=function()
saveData()
modeSel=modeSel or 1
levelSel=levelSel or 3
curBG="none"
keeprun=true
end,
custom=function()
optSel=optSel or 1
curBG="matrix"
keeprun=true
end,
play=function()
keeprun=false
resetGameData()
sysSFX("ready")
mouseShow=false
end,
setting=function()
curBG="none"
keeprun=true
end,
setting2=function()
curBG="none"
keeprun=true
curBoard=1
keyboardSet=1
joystickSet=1
keyboardSetting=false
joystickSetting=false
end,--Control settings
setting3=function()
curBG="game1"
keeprun=true
defaultSel=1
sel=nil
snapLevel=1
end,--Touch setting
help=function()
curBG="none"
keeprun=true
end,
stat=function()
curBG="none"
keeprun=true
end,
quit=function()
love.event.quit()
end,
}
prevMenu={
load=love.event.quit,
intro="quit",
@@ -113,6 +182,7 @@ prevMenu={
custom="mode",
ready="mode",
play=function()
clearTask()
gotoScene(curMode.id~="custom"and"mode"or"custom")
end,
help="main",
@@ -156,32 +226,34 @@ langName={"中文","English"}
langID={"chi","eng"}
actName={"moveLeft","moveRight","rotRight","rotLeft","rotFlip","hardDrop","softDrop","hold","swap","restart","insLeft","insRight","insDown"}
blockPos={4,4,4,4,4,5,4}
clearPoint={[0]=1,2,3,5,7}
renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else
b2bPoint={50,120,200}
b2bATK={3,5,8}
testScore={[-1]=1,[-2]=0,[-3]=1,2,2,2}
visible_opt={show=1e99,time=300,fast=20,none=5}
reAtk={0,0,1,1,1,2,2,3,3}
reDef={0,1,1,2,3,3,4,4,5}
spin_n={"spin_1","spin_2","spin_3"}
clear_n={"clear_1","clear_2","clear_3","clear_4"}
ren_n={}for i=1,11 do ren_n[i]="ren_"..i end
vibrateLevel={0,0,.03,.04,.05,.07,.9}
snapLevelValue={1,10,20,40,60,80}
reAtk={0,0,1,1,1,2,2,3,3}
reDef={0,1,1,2,3,3,4,4,5}
atkModeName={"Random","Badges","K.O.s","Counters"}
RCPB={10,33,200,33,105,5,105,60}
up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
percent0to5={[0]="0%","20%","40%","60%","80%","100%",}
modeID={
[0]="custom",
"sprint","marathon","classic","zen","infinite","solo","tsd","blind","dig","survivor","tech",
"sprint","marathon","master","classic","zen","infinite","solo","tsd","blind","dig","survivor","tech",
"pctrain","pcchallenge","techmino41","techmino99","drought","hotseat",
}
modeLevel={
sprint={"10L","20L","40L","100L","400L","1000L"},
marathon={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
marathon={"EASY","NORMAL","HARD"},
master={"LUNATIC","ULTIMATE"},
classic={"CTWC"},
zen={"NORMAL"},
infinite={"NORMAL"},
@@ -243,24 +315,24 @@ TRS={
[1]={
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{0,1}},
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2},{0,-1}},
[12]={{0,0},{1,0},{1,-1},{-1,0},{0,2},{1,2}},
[12]={{0,0},{1,0},{1,-1},{0,1},{-1,0},{0,2},{1,2}},
[21]={{0,0},{-1,0},{-1,1},{1,0},{0,-2},{-1,-2}},
[23]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2}},
[32]={{0,0},{-1,0},{-1,-1},{-1,1},{0,2},{-1,2}},
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2},{0,-1}},
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{0,1}},
[03]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2},{0,1}},
[02]={{0,0},{1,0},{-1,0},{0,-1},{0,1}},
[20]={{0,0},{-1,0},{1,0},{0,1},{0,-1}},
[13]={{0,0},{0,-1},{0,1},{-1,0}},
[31]={{0,0},{0,1},{0,-1},{1,0}},
},--Z/J
[2]={
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
[01]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}},
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2}},
[12]={{0,0},{1,0},{1,-1},{1,1},{0,2},{1,2}},
[21]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}},
[23]={{0,0},{1,0},{1,1},{-1,0},{0,-2},{1,-2}},
[32]={{0,0},{-1,0},{-1,-1},{1,0},{0,2},{-1,2}},
[32]={{0,0},{-1,0},{-1,-1},{0,1},{1,0},{0,2},{-1,2}},
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2},{0,-1},{-1,1}},
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{1,-1},{0,1}},
[02]={{0,0},{-1,0},{1,0},{0,-1},{0,1}},
@@ -283,8 +355,8 @@ TRS={
[31]={{0,0},{0,-1},{0,1},{-1,0},{1,0},{0,2}},
},
[7]={
[01]={{0,0},{1,0},{-2,0},{-2,-1},{1,2}},
[03]={{0,0},{-1,0},{2,0},{2,-1},{-1,2}},
[01]={{0,0},{0,1},{1,0},{-2,0},{-2,-1},{1,2}},
[03]={{0,0},{0,1},{-1,0},{2,0},{2,-1},{-1,2}},
[10]={{0,0},{2,0},{-1,0},{-1,-2},{2,1},{0,2}},
[30]={{0,0},{-2,0},{1,0},{1,-2},{-2,1},{0,2}},
[12]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
@@ -298,6 +370,38 @@ TRS={
}
}TRS[3],TRS[4]=TRS[2],TRS[1]
dataOpt={
"run",
"game",
"gametime",
"piece",
"row",
"atk",
"key",
"rotate",
"hold",
"spin",
}
saveOpt={
"lang",
"ghost",
"center",
"grid",
"swap",
"sfx",
"bgm",
"vib",
"fullscreen",
"bgblock",
"das",
"arr",
"sddas",
"sdarr",
"virtualkeyAlpha",
"virtualkeyIcon",
"virtualkeySwitch",
"frameMul",
}
virtualkeySet={
{
{80,720-200,6400,80},--moveLeft
@@ -348,133 +452,125 @@ virtualkeySet={
{80,320,6400,80},--restart
},--Keyboard set
{
{1280-360,40,0,40},--moveLeft
{1280-280,40,0,40},--moveRight
{1280-520,40,0,40},--rotRight
{1280-600,40,0,40},--rotLeft
{1280-440,40,0,40},--rotFlip
{1280-40,40,0,40},--hardDrop
{1280-120,40,0,40},--softDrop
{1280-200,40,0,40},--hold
{1280-680,40,0,40},--swap
{1280-760,40,0,40},--restart
{1200-360,40,0,40},--moveLeft
{1200-280,40,0,40},--moveRight
{1200-520,40,0,40},--rotRight
{1200-600,40,0,40},--rotLeft
{1200-440,40,0,40},--rotFlip
{1200-40,40,0,40},--hardDrop
{1200-120,40,0,40},--softDrop
{1200-200,40,0,40},--hold
{1200-680,40,0,40},--swap
{1200-760,40,0,40},--restart
},--PC key feedback
}
Buttons={
load={},
intro={},
main={
{x=640,y=290,w=220,h=220,rgb=color.red,f=60,code=function()gotoScene("mode")end,down=4,left=3,right=2},
{x=880,y=290,w=220,h=220,rgb=color.blue,f=60,code=function()gotoScene("setting")end,down=5,left=1,right=2},
{x=400,y=290,w=220,h=220,rgb=color.cyan,f=60,code=function()gotoScene("stat")end,down=4,right=1},
{x=640,y=530,w=220,h=220,rgb=color.yellow,f=60,code=function()gotoScene("help")end,up=1,down=5,left=3,right=5},
{x=1180,y=620,w=120,h=120,rgb=color.grey,f=50,code=function()gotoScene("quit")end,up=2,left=4},
play={x=380,y=300,w=240,h=240,rgb=color.red,f=70,code=function()gotoScene("mode")end,down="stat",right="setting"},
setting={x=640,y=300,w=240,h=240,rgb=color.lightBlue,f=55,code=function()gotoScene("setting")end,down="stat",left="play",right="help"},
stat={x=640,y=560,w=240,h=240,rgb=color.cyan,f=55,code=function()gotoScene("stat")end,up="setting",left="play",right="help"},
help={x=900,y=560,w=240,h=240,rgb=color.yellow,f=55,code=function()gotoScene("help")end,up="setting",left="stat",right="quit"},
quit={x=1180,y=620,w=120,h=120,rgb=color.lightGrey,f=50,code=function()gotoScene("quit")end,up="setting",left="help"},
},
mode={
{x=1000,y=210,w=200,h=140,rgb=color.white,hide=function()return modeSel==1 end,f=64,code=function()keyDown.mode("up")end},
{x=1000,y=430,w=200,h=140,rgb=color.white,hide=function()return modeSel==#modeID end,f=80,code=function()keyDown.mode("down")end},
{x=190,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==1 end,code=function()keyDown.mode("left")end},
{x=350,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==#modeLevel[modeID[modeSel]] end,code=function()keyDown.mode("right")end},
{x=1000,y=600,w=250,h=100,rgb=color.green,f=50,code=function()loadGame(modeSel,levelSel)end},
{x=270,y=540,w=190,h=85,rgb=color.yellow,code=function()gotoScene("custom")end},
{x=640,y=630,w=230,h=90,rgb=color.white,f=45,code=back},
up={x=1000,y=210,w=200,h=140,rgb=color.white,hide=function()return modeSel==1 end,f=64,code=function()keyDown.mode("up")end},
down={x=1000,y=430,w=200,h=140,rgb=color.white,hide=function()return modeSel==#modeID end,f=80,code=function()keyDown.mode("down")end},
left={x=190,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==1 end,code=function()keyDown.mode("left")end},
right={x=350,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==#modeLevel[modeID[modeSel]] end,code=function()keyDown.mode("right")end},
start={x=1000,y=600,w=250,h=100,rgb=color.green,f=50,code=function()loadGame(modeSel,levelSel)end},
custom={x=270,y=540,w=190,h=85,rgb=color.yellow,code=function()gotoScene("custom")end},
back={x=640,y=630,w=230,h=90,rgb=color.white,f=45,code=back},
},
custom={
{x=1000,y=200,w=100,h=100,rgb=color.white,code=function()optSel=(optSel-2)%#customID+1 end},
{x=1000,y=440,w=100,h=100,rgb=color.white,f=50,code=function()optSel=optSel%#customID+1 end},
{x=880,y=320,w=100,h=100,rgb=color.white,f=50,code=function()local k=customID[optSel]customSel[k]=(customSel[k]-2)%#customRange[k]+1 end},
{x=1120,y=320,w=100,h=100,rgb=color.white,f=50,code=function()local k=customID[optSel]customSel[k]=customSel[k]%#customRange[k]+1 end},
{x=1000,y=580,w=180,h=80,rgb=color.green,code=function()loadGame(0,1)end},
{x=640,y=630,w=180,h=60,rgb=color.white,code=back},
up={x=1000,y=200,w=100,h=100,rgb=color.white,code=function()optSel=(optSel-2)%#customID+1 end},
down={x=1000,y=440,w=100,h=100,rgb=color.white,f=50,code=function()optSel=optSel%#customID+1 end},
left={x=880,y=320,w=100,h=100,rgb=color.white,f=50,code=function()local k=customID[optSel]customSel[k]=(customSel[k]-2)%#customRange[k]+1 end},
right={x=1120,y=320,w=100,h=100,rgb=color.white,f=50,code=function()local k=customID[optSel]customSel[k]=customSel[k]%#customRange[k]+1 end},
start={x=1000,y=580,w=180,h=80,rgb=color.green,code=function()loadGame(0,1)end},
back={x=640,y=630,w=180,h=60,rgb=color.white,code=back},
},
play={
back={x=1235,y=45,w=80,h=80,rgb=color.white,code=back,f=35},
},
setting={--Normal setting
{x=285,y=90,w=210,h=60,rgb=color.white,code=function()setting.ghost=not setting.ghost end,down=3,right=2},
{x=510,y=90,w=210,h=60,rgb=color.white,code=function()setting.center=not setting.center end,down=5,left=1,right=11},
--1,2
{x=205,y=180,w=50,h=50,rgb=color.white,code=function()setting.das=(setting.das-1)%31 end,up=1,down=7,right=4},
{x=370,y=180,w=50,h=50,rgb=color.white,code=function()setting.das=(setting.das+1)%31 end,up=1,down=8,left=3,right=5},
{x=425,y=180,w=50,h=50,rgb=color.white,code=function()setting.arr=(setting.arr-1)%16 end,up=2,down=9,left=4,right=6},
{x=590,y=180,w=50,h=50,rgb=color.white,code=function()setting.arr=(setting.arr+1)%16 end,up=2,down=10,left=5,right=13},
--3~6
{x=205,y=260,w=50,h=50,rgb=color.white,code=function()setting.sddas=(setting.sddas-1)%11 end,up=3,down=19,right=8},
{x=370,y=260,w=50,h=50,rgb=color.white,code=function()setting.sddas=(setting.sddas+1)%11 end,up=4,down=19,left=7,right=9},
{x=425,y=260,w=50,h=50,rgb=color.white,code=function()setting.sdarr=(setting.sdarr-1)%4 end,up=5,down=19,left=8,right=10},
{x=590,y=260,w=50,h=50,rgb=color.white,code=function()setting.sdarr=(setting.sdarr+1)%4 end,up=6,down=19,left=9,right=14},
--7~10
{x=760,y=90,w=160,h=60,rgb=color.white,code=function()setting.sfx=not setting.sfx end,down=13,left=2,right=12},
{x=940,y=90,w=160,h=60,rgb=color.white,code=function()
ghost={x=290,y=90,w=210,h=60,rgb=color.white,code=function()setting.ghost=not setting.ghost end,down="grid",right="center"},
center={x=505,y=90,w=210,h=60,rgb=color.white,code=function()setting.center=not setting.center end,down="swap",left="ghost",right="sfx"},
grid={x=290,y=160,w=210,h=60,rgb=color.white,code=function()setting.grid=not setting.grid end,up="ghost",down="dasD",right="swap"},
swap={x=505,y=160,w=210,h=60,f=28,rgb=color.white,code=function()setting.swap=not setting.swap end,up="center",down="arrD",left="grid",right="vib"},
dasD={x=210,y=230,w=50,h=50,rgb=color.white,code=function()setting.das=(setting.das-1)%31 end,up="grid",down="sddasD",right="dasU"},
dasU={x=370,y=230,w=50,h=50,rgb=color.white,code=function()setting.das=(setting.das+1)%31 end,up="grid",down="sddasU",left="dasD",right="arrD"},
arrD={x=425,y=230,w=50,h=50,rgb=color.white,code=function()setting.arr=(setting.arr-1)%16 end,up="swap",down="sdarrD",left="dasU",right="arrU"},
arrU={x=585,y=230,w=50,h=50,rgb=color.white,code=function()setting.arr=(setting.arr+1)%16 end,up="swap",down="sdarrU",left="arrD",right="fullscreen"},--3~6
sddasD={x=210,y=300,w=50,h=50,rgb=color.white,code=function()setting.sddas=(setting.sddas-1)%11 end,up="dasD",down="lang",right="sddasU"},
sddasU={x=370,y=300,w=50,h=50,rgb=color.white,code=function()setting.sddas=(setting.sddas+1)%11 end,up="dasU",down="lang",left="sddasD",right="sdarrD"},
sdarrD={x=425,y=300,w=50,h=50,rgb=color.white,code=function()setting.sdarr=(setting.sdarr-1)%4 end,up="arrD",down="lang",left="sddasU",right="sdarrU"},
sdarrU={x=585,y=300,w=50,h=50,rgb=color.white,code=function()setting.sdarr=(setting.sdarr+1)%4 end,up="arrU",down="lang",left="sdarrD",right="bgblock"},
sfx={x=760,y=90,w=160,h=60,rgb=color.white,code=function()setting.sfx=not setting.sfx end,down="vib",left="center",right="bgm"},
bgm={x=940,y=90,w=160,h=60,rgb=color.white,code=function()
BGM()
setting.bgm=not setting.bgm
BGM("blank")
end,down=13,left=6},
{x=850,y=160,w=340,h=60,rgb=color.white,code=function()
end,down="vib",left="sfx"},
vib={x=850,y=160,w=340,h=60,rgb=color.white,code=function()
setting.vib=(setting.vib+1)%5
VIB(2)
end,up=11,down=14,left=6},
{x=850,y=230,w=340,h=60,rgb=color.white,
code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then
love.resize(gc.getWidth(),gc.getHeight())
end,up="sfx",down="fullscreen",left="swap"},
fullscreen={x=850,y=230,w=340,h=60,rgb=color.white,code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then
love.resize(gc.getWidth(),gc.getHeight())
end
end,up="vib",down="bgblock",left="arrU"},
bgblock={x=850,y=300,w=340,h=60,rgb=color.white,code=function()
setting.bgblock=not setting.bgblock
if not setting.bgblock then
for i=1,16 do
BGblockList[i].v=3*BGblockList[i].v
end
end,
up=13,down=15,left=6
},
{x=850,y=300,w=340,h=60,rgb=color.white,
code=function()
setting.bgblock=not setting.bgblock
if not setting.bgblock then
for i=1,16 do
BGblockList[i].v=3*BGblockList[i].v
end
end
end,
up=14,down=16,left=10
},
{x=850,y=370,w=340,h=60,rgb=color.white,code=function()
end
end,up="fullscreen",down="frame",left="sdarrU"},
frame={x=850,y=370,w=340,h=60,rgb=color.white,code=function()
setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10)
if setting.frameMul>100 then setting.frameMul=25 end
end,up=15,down=17,left=19},
--11~16
{x=850,y=440,w=340,h=60,rgb=color.green,code=function()gotoScene("setting2")end,up=16,down=18,left=19},
{x=850,y=510,w=340,h=60,rgb=color.yellow,code=function()gotoScene("setting3")end,up=17,down=20,left=19},
{x=280,y=510,w=200,h=60,rgb=color.red,code=function()
end,up="bgblock",down="control",left="sdarrU"},
control={x=850,y=440,w=340,h=60,rgb=color.green,code=function()gotoScene("setting2")end,up="frame",down="touch",left="lang"},
touch={x=850,y=510,w=340,h=60,rgb=color.yellow,code=function()gotoScene("setting3")end,up="control",down="back",left="lang"},
lang={x=280,y=510,w=200,h=60,rgb=color.red,code=function()
setting.lang=setting.lang%#langName+1
swapLanguage(setting.lang)
end,up=7,down=20,right=18},
{x=640,y=620,w=300,h=70,rgb=color.white,code=back,up=19},
--17~20
end,up="sddasD",down="back",right="touch"},
back={x=640,y=620,w=300,h=70,rgb=color.white,code=back,up="touch"},
},
setting2={--Control setting
{x=840,y=630,w=180,h=60,rgb=color.white,code=back},
back={x=840,y=630,w=180,h=60,rgb=color.white,code=back},
},
setting3={--Touch setting
{x=640,y=410,w=170,h=80,code=back},
{x=640,y=210,w=500,h=80,code=function()
back={x=640,y=410,w=170,h=80,f=45,code=back},
hide={x=640,y=210,w=500,h=80,f=45,code=function()
setting.virtualkeySwitch=not setting.virtualkeySwitch
end},
{x=450,y=310,w=170,h=80,code=function()
default={x=450,y=310,w=170,h=80,code=function()
for K=1,#virtualkey do
local b,b0=virtualkey[K],virtualkeySet[defaultSel][K]
b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4]
end--Default virtualkey
defaultSel=defaultSel%5+1
end},
{x=640,y=310,w=170,h=80,code=function()
snap={x=640,y=310,w=170,h=80,code=function()
snapLevel=snapLevel%6+1
end},
{x=830,y=310,w=170,h=80,code=function()
alpha={x=830,y=310,w=170,h=80,f=45,code=function()
setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%6
--Adjust virtualkey alpha
end},
{x=450,y=410,w=170,h=80,code=function()
icon={x=450,y=410,w=170,h=80,f=45,code=function()
setting.virtualkeyIcon=not setting.virtualkeyIcon
--Switch virtualkey icon
end},
{x=830,y=410,w=170,h=80,code=function()
size={x=830,y=410,w=170,h=80,f=45,code=function()
if sel then
local b=virtualkey[sel]
b[4]=b[4]+10
@@ -484,11 +580,12 @@ Buttons={
end},
},
help={
{x=640,y=590,w=180,h=60,rgb=color.white,code=back,right=2},
{x=980,y=590,w=230,h=60,rgb=color.white,code=function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,left=1},
back={x=640,y=590,w=180,h=60,rgb=color.white,code=back,right="qq"},
qq={x=980,y=590,w=230,h=60,rgb=color.white,code=function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,left="back"},
},
stat={
{x=640,y=590,w=180,h=60,rgb=color.white,code=back},
back={x=640,y=590,w=180,h=60,rgb=color.white,code=back,right="path"},
path={x=980,y=590,w=250,h=60,f=30,rgb=color.white,code=function()sys.openURL("C:/Users/MrZ/AppData/Roaming/LOVE/Techmino")end,left="back"},
},
sel=nil,--selected button id(integer)
}

View File

@@ -50,13 +50,15 @@ end
gameEnv0={
das=10,arr=2,
sddas=0,sdarr=2,
ghost=true,center=true,bone=false,
ghost=true,center=true,
grid=false,swap=true,
_20G=false,bone=false,
drop=30,lock=45,
wait=1,fall=1,
next=6,hold=true,oncehold=true,
sequence="bag7",
block=true,visible="show",
_20G=false,target=1e99,
target=1e99,
freshLimit=1e99,
ospin=true,
reach=null,
@@ -83,6 +85,9 @@ loadmode={
marathon=function()
createPlayer(1,340,15)
end,
master=function()
createPlayer(1,340,15)
end,
classic=function()
createPlayer(1,340,15)
end,
@@ -106,17 +111,16 @@ loadmode={
createPlayer(1,340,15)
local P=players[1]
if curMode.lv==1 then
ins(players[1].task,Event.task.dig_normal)
newTask(Event_task.dig_normal,P)
pushSpeed=1
elseif curMode.lv==2 then
ins(players[1].task,Event.task.dig_lunatic)
newTask(Event_task.dig_lunatic,P)
pushSpeed=1
end
end,
survivor=function()
createPlayer(1,340,15)
local P=players[1]
ins(players[1].task,Event.task[curMode.lv==1 and"survivor_easy"or curMode.lv==2 and"survivor_normal"or curMode.lv==3 and"survivor_hard"or curMode.lv==4 and"survivor_lunatic"])
newTask(Event_task[curMode.lv==1 and"survivor_easy"or curMode.lv==2 and"survivor_normal"or curMode.lv==3 and"survivor_hard"or curMode.lv==4 and"survivor_lunatic"],P)
pushSpeed=curMode.lv>2 and 2 or 1
end,
tech=function()
@@ -201,8 +205,8 @@ loadmode={
createPlayer(1,340,15)
else
modeEnv.target=nil
createPlayer(1,20,15)
createPlayer(2,660,85,.9,modeEnv.opponent)
createPlayer(1,340,15)
createPlayer(2,965,360,.9,modeEnv.opponent)
end
end,
}
@@ -210,7 +214,13 @@ mesDisp={
--Default:font=35,white
sprint=function()
setFont(70)
mStr(max(P.gameEnv.target-P.cstat.row,0),-75,260)
local r=max(P.gameEnv.target-P.cstat.row,0)
mStr(r,-75,260)
if r<21 and r>0 then
gc.setLineWidth(3)
gc.setColor(color.lightRed)
gc.line(0,600-30*r,300,600-30*r)
end
end,
marathon=function()
setFont(50)
@@ -218,6 +228,12 @@ mesDisp={
mStr(P.gameEnv.target,-75,370)
gc.rectangle("fill",-120,376,90,4)
end,
master=function()
setFont(50)
mStr(P.cstat.point,-75,320)
mStr((P.cstat.event+1)*100,-75,370)
gc.rectangle("fill",-120,376,90,4)
end,
classic=function()
setFont(80)
local r=P.gameEnv.target*.1
@@ -331,6 +347,7 @@ setting={
das=10,arr=2,
sddas=0,sdarr=2,
ghost=true,center=true,
grid=false,swap=true,
keyMap={
{"left","right","x","z","c","up","down","space","tab","r","","",""},
{"","","","","","","","","","","","",""},
@@ -404,9 +421,18 @@ virtualkey={
virtualkeyDown={false,false,false,false,false,false,false,false,false,false,false,false,false}
virtualkeyPressTime={0,0,0,0,0,0,0,0,0,0,0,0,0}
--User Data&User Setting
require("toolfunc")
userData=fs.newFile("userdata")
userSetting=fs.newFile("usersetting")
require"toolfunc"
require"class"
require"gamefunc"
require"ai"
require"timer"
require"paint"
require"call&sys"
require"dataList"
require"list"
require"texture"
userData,userSetting=fs.newFile("userdata"),fs.newFile("usersetting")
if fs.getInfo("userdata")then
loadData()
end
@@ -414,14 +440,6 @@ if fs.getInfo("usersetting")then
loadSetting()
elseif system=="Android" or system=="iOS"then
setting.virtualkeySwitch=true
setting.swap=false
end
require("gamefunc")
require("ai")
require("timer")
require("paint")
require("call&sys")
require("largeList")
require("list")
swapLanguage(setting.lang)
require("texture")
swapLanguage(setting.lang)

View File

@@ -109,20 +109,20 @@ FX={
}
function updateButton()
for i=1,#Buttons[scene]do
local B=Buttons[scene][i]
local t=i==Buttons.sel and .4 or 0
for k,B in next,Buttons[scene]do
local t=B==Buttons.sel and .4 or 0
B.alpha=abs(B.alpha-t)>.02 and(B.alpha+(B.alpha<t and .02 or -.02))or t
if B.alpha>t then B.alpha=B.alpha-.02 elseif B.alpha<t then B.alpha=B.alpha+.02 end
end
end
function drawButton()
for i=1,#Buttons[scene]do
local B=Buttons[scene][i]
for k,B in next,Buttons[scene]do
if not(B.hide and B.hide())then
local C=B.rgb or color.white
gc.setColor(C[1],C[2],C[3],B.alpha)
gc.rectangle("fill",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h)
gc.setColor(C)
gc.setLineWidth(3)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h,4)
gc.setColor(C[1],C[2],C[3],.3)
gc.setLineWidth(5)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h,4)
local t=B.t
@@ -130,17 +130,14 @@ function drawButton()
if t then
if type(t)=="function"then t=t()end
setFont(B.f or 40)
y0=B.y-7-currentFont*.5
mStr(t,B.x-1,y0)
mStr(t,B.x+1,y0)
mStr(t,B.x-1,y0+2)
mStr(t,B.x+1,y0+2)
end
gc.setColor(C)
if t then
y0=B.y-currentFont*.64
gc.printf(t,B.x-201,y0+2,400,"center")
gc.printf(t,B.x-199,y0+2,400,"center")
gc.printf(t,B.x-201,y0,400,"center")
gc.printf(t,B.x-199,y0,400,"center")
gc.setColor(C)
mStr(t,B.x,y0+1)
end
gc.setLineWidth(3)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h,4)
end
end
end
@@ -178,7 +175,7 @@ function drawVirtualkey()
local P=players[1]
for i=1,#virtualkey do
local p,b=virtualkeyDown[i],virtualkey[i]
if p then gc.setColor(.75,.75,.75,a)
if p then gc.setColor(.7,.7,.7,a)
else gc.setColor(1,1,1,a)
end
gc.setLineWidth(b[4]*.07)
@@ -268,7 +265,7 @@ function Pnt.main()
gc.setColor(1,1,1)
gc.draw(titleImage,300,30)
setFont(30)
gc.print("Alpha V0.7.11",290,140)
gc.print("Alpha V0.7.12",290,140)
gc.print(system,800,110)
end
function Pnt.mode()
@@ -356,8 +353,15 @@ function Pnt.play()
gc.setColor(0,0,0,.6)gc.rectangle("fill",0,0,600,690)--Black Background
gc.setLineWidth(7)
gc.setColor(frameColor[P.strength])gc.rectangle("line",0,0,600,690)--Big frame
gc.translate(150,70)
if P.gameEnv.grid then
gc.setLineWidth(1)
gc.setColor(1,1,1,.2)
for x=1,9 do gc.line(30*x,-10,30*x,600)end
for y=0,19 do gc.line(0,30*y,300,30*y)end
end
gc.stencil(stencil_field,"replace", 1)
gc.translate(150,70+P.fieldBeneath)
gc.translate(0,P.fieldBeneath)
gc.setStencilTest("equal",1)
for j=int(P.fieldBeneath/30+1),#P.field do
if P.falling<=0 or without(P.clearing,j)then
@@ -405,7 +409,10 @@ function Pnt.play()
gc.setStencilTest()--In-playField mask
gc.translate(0,-P.fieldBeneath)
gc.setLineWidth(3)
gc.setColor(1,1,1)gc.rectangle("line",-1,-11,302,612)--Draw boarder
gc.setColor(1,1,1)
gc.rectangle("line",-1,-11,302,612)--Draw boarder
gc.setLineWidth(2)
gc.rectangle("line",301,0,16,601.5)--Draw atkBuffer boarder
local h=0
for i=1,#P.atkBuffer do
@@ -419,21 +426,21 @@ function Pnt.play()
end
if a.countdown>0 then
gc.setColor(attackColor[a.lv][1])
gc.rectangle("fill",304,600-h,12,-bar+3)
gc.rectangle("fill",304,599-h,11,-bar+3)
gc.setColor(attackColor[a.lv][2])
gc.rectangle("fill",304,600-h+(-bar+3),12,-(-bar+3)*(1-a.countdown/a.cd0))
gc.rectangle("fill",304,599-h+(-bar+3),11,-(-bar+3)*(1-a.countdown/a.cd0))
--Timing
else
local t=sin((Timer()-i)*20)*.5+.5
local t=sin((Timer()-i)*30)*.5+.5
local c1,c2=attackColor[a.lv][1],attackColor[a.lv][2]
gc.setColor(c1[1]*t+c2[1]*(1-t),c1[2]*t+c2[2]*(1-t),c1[3]*t+c2[3]*(1-t))
gc.rectangle("fill",304,600-h,12,-bar+3)
gc.rectangle("fill",304,599-h,11,-bar+3)
--Warning
end
else
gc.setColor(attackColor[a.lv][1])
bar=bar*(20-a.time)*.05
gc.rectangle("fill",304,600-h,12,-bar+2)
gc.rectangle("fill",304,599-h,11,-bar+2)
--Disappear
end
h=h+bar
@@ -463,7 +470,7 @@ function Pnt.play()
for i=1,#b do
for j=1,#b[1] do
if b[i][j]>0 then
drawPixel(i+20-2.4*N-#b*.5,j+12.5-#b[1]*.5,P.nextColor[N],1)
drawPixel(i+20-2.4*N-#b*.5,j+12.7-#b[1]*.5,P.nextColor[N],1)
end
end
end
@@ -544,30 +551,31 @@ end
function Pnt.setting()
gc.setColor(1,1,1)
setFont(35)
mStr("DAS:"..setting.das,288,158)
mStr("ARR:"..setting.arr,503,158)
mStr("DAS:"..setting.das,290,208)
mStr("ARR:"..setting.arr,506,208)
setFont(18)
mStr(text.softdropdas..setting.sddas,288,249)
mStr(text.softdroparr..setting.sdarr,503,249)
mStr(text.softdropdas..setting.sddas,290,291)
mStr(text.softdroparr..setting.sdarr,506,291)
end
function Pnt.setting2()
local a=.2+(sin(Timer()*15)+1)*.1
if keyboardSetting then
gc.setColor(1,.5,.5,.2+(sin(Timer()*15)+1)*.1)
gc.setColor(1,.5,.5,a)
else
gc.setColor(.9,.9,.9,.2+(sin(Timer()*15)+1)*.1)
gc.setColor(.9,.9,.9,a)
end
gc.rectangle("fill",240,40*keyboardSet-10,200,40)
if joystickSetting then
gc.setColor(1,.5,.5,.2+(sin(Timer()*15)+1)*.1)
gc.setColor(1,.5,.5,a)
else
gc.setColor(.9,.9,.9,.2+(sin(Timer()*15)+1)*.1)
gc.setColor(.9,.9,.9,a)
end
gc.rectangle("fill",440,40*joystickSet-10,200,40)
gc.setColor(1,1,1)
setFont(25)
for y=1,13 do
mStr(text.actName[y],150,40*y)
mStr(text.actName[y],150,40*y-5)
for x=1,2 do
mStr(setting.keyMap[curBoard+x*8-8][y],200*x+140,40*y-3)
end
@@ -615,13 +623,10 @@ end
function Pnt.stat()
setFont(35)
gc.setColor(1,1,1)
for i=1,10 do
gc.print(text.stat[i],350,20+40*i)
end
for i=1,10 do gc.print(text.stat[i],350,20+40*i)end
gc.print(stat.run,650,60)
gc.print(stat.game,650,100)
gc.print(format("%0.2f",stat.gametime).."s",650,140)
gc.print(format("%0.1fhr",stat.gametime*2.78e-4),650,140)
gc.print(stat.piece,650,180)
gc.print(stat.row,650,220)
gc.print(stat.atk,650,260)
@@ -629,6 +634,5 @@ function Pnt.stat()
gc.print(stat.rotate,650,340)
gc.print(stat.hold,650,380)
gc.print(stat.spin,650,420)
gc.draw(titleImage,260,570,.2+.07*sin(Timer()*3),.8,nil,250,60)
end

View File

@@ -1,5 +1,6 @@
local c
local N=gc.newImage
function C(x,y)
local C=function(x,y)
c=gc.newCanvas(x,y)
gc.setCanvas(c)
return c
@@ -17,21 +18,8 @@ for i=1,13 do
gc.draw(blockImg,6-6*i,0,nil,.2)
blockSkinmini[i]=c
end
for i=1,13 do
end
blockImg:release()
RCPB={10,33,200,33,105,5,105,60}
do royaleCtrlPad=C(300,100)
gc.setColor(1,1,1)
setFont(25)
gc.setLineWidth(2)
for i=1,4 do
gc.rectangle("line",RCPB[2*i-1],RCPB[2*i],90,35,8,4)
mStr(atkModeName[i],RCPB[2*i-1]+45,RCPB[2*i]+3)
end
end
virtualkeyIcon={}
for i=1,10 do
virtualkeyIcon[i]=N("/image/virtualkey/"..actName[i]..".png")
@@ -96,73 +84,4 @@ groupCode=N("/image/mess/groupcode.png")
payCode=N("/image/mess/paycode.png")
c=nil
gc.setCanvas()
sceneInit={
load=function()
curBG="none"
keeprun=true
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar(0~1)
end,
intro=function()
curBG="none"
count=0
keeprun=true
end,
main=function()
curBG="none"
keeprun=true
collectgarbage()
end,
mode=function()
saveData()
modeSel=modeSel or 1
levelSel=levelSel or 3
curBG="none"
keeprun=true
end,
custom=function()
optSel=optSel or 1
curBG="matrix"
keeprun=true
end,
play=function()
keeprun=false
resetGameData()
sysSFX("ready")
mouseShow=false
end,
setting=function()
curBG="none"
keeprun=true
end,
setting2=function()
curBG="none"
keeprun=true
curBoard=1
keyboardSet=1
joystickSet=1
keyboardSetting=false
joystickSetting=false
end,--Control settings
setting3=function()
curBG="game1"
keeprun=true
defaultSel=1
sel=nil
snapLevel=1
end,--Touch setting
help=function()
curBG="none"
keeprun=true
end,
stat=function()
curBG="none"
keeprun=true
end,
quit=function()
love.event.quit()
end,
}
gc.setCanvas()

View File

@@ -4,7 +4,7 @@ function Tmr.load()
loadnum=loadnum+1
loadprogress=loadnum/10
if loadnum==5 then
--require("load_texture")
--require("texture")
elseif loadnum==10 then
loadnum=1
loading=2
@@ -13,6 +13,7 @@ function Tmr.load()
if loadnum<=#bgm then
bgm[bgm[loadnum]]=love.audio.newSource("/BGM/"..bgm[loadnum]..".ogg","stream")
bgm[bgm[loadnum]]:setLooping(true)
bgm[bgm[loadnum]]:setVolume(0)
loadprogress=loadnum/#bgm
loadnum=loadnum+1
else
@@ -119,6 +120,11 @@ function Tmr.play(dt)
else
AI_getControls(P.ai.controls)
P.ai.controlDelay=P.ai.controlDelay0+2
if Timer()-P.cstat.point>P.cstat.event then
P.cstat.point=Timer()
P.cstat.event=P.ai.controlDelay0+rnd(2,10)
changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.35 and 2 or 3)
end
end
end
end
@@ -234,9 +240,6 @@ function Tmr.play(dt)
if b.t>=60 then rem(P.bonus,i)end
end
end
for i=#P.task,1,-1 do
if P.task[i]()then rem(P.task,i)end
end
for i=#P.atkBuffer,1,-1 do
local atk=P.atkBuffer[i]
atk.time=atk.time+1
@@ -255,5 +258,5 @@ function Tmr.play(dt)
PTC.dust[p]:update(dt)
end
end
if modeEnv.royaleMode and frame%60==0 then freshMostDangerous()end
if modeEnv.royaleMode and frame%120==0 then freshMostDangerous()end
end

View File

@@ -8,7 +8,6 @@ function string.splitS(s,sep)
return t
end
function sgn(i)return i>0 and 1 or i<0 and -1 or 0 end--Row numbe is A-uth-or's id!
function stringPack(s,v)return s..toS(v)end
function without(t,v)
for i=1,#t do
if t[i]==v then return end
@@ -66,7 +65,7 @@ function stencil_miniTitle()
end
end
function stencil_field()
gc.rectangle("fill",150,60,300,610)
gc.rectangle("fill",0,-10,300,610)
end
function stencil_field_small()
gc.rectangle("fill",0,0,60,120)
@@ -75,12 +74,24 @@ end
function swapLanguage(l)
text=require("language/"..langID[l])
Buttons.sel=nil
for scene,list in pairs(Buttons)do
for num=1,#list do
list[num].alpha=0
list[num].t=text.ButtonText[scene][num]
for S,L in next,Buttons do
for N,B in next,L do
B.alpha=0
B.t=text.ButtonText[S][N]
end
end
if royaleCtrlPad then royaleCtrlPad:release()end
royaleCtrlPad=gc.newCanvas(300,100)
gc.setCanvas(royaleCtrlPad)
gc.setColor(1,1,1)
setFont(25)
gc.setLineWidth(2)
for i=1,4 do
gc.rectangle("line",RCPB[2*i-1],RCPB[2*i],90,35,8,4)
mStr(text.atkModeName[i],RCPB[2*i-1]+45,RCPB[2*i]+3)
end
gc.setCanvas()
collectgarbage()
end
function VIB(t)
if setting.vib>0 then
@@ -121,8 +132,16 @@ function SFX(s,v)
end
function BGM(s)
if setting.bgm and bgmPlaying~=s then
for k,v in pairs(bgm)do v:stop()end
if s then bgm[s]:play()end
if bgmPlaying then newTask(Event_task.bgmFadeOut,nil,bgmPlaying)end
for i=1,#Task do
if Task[i].code==Event_task.bgmFadeIn then
Task[i].code=Event_task.bgmFadeOut
end
end
if s then
newTask(Event_task.bgmFadeIn,nil,s)
bgm[s]:play()
end
bgmPlaying=s
end
end
@@ -163,18 +182,11 @@ function loadData()
end
end
function saveData()
local t=table.concat({
stringPack("run=",stat.run),
stringPack("game=",stat.game),
stringPack("gametime=",stat.gametime),
stringPack("piece=",stat.piece),
stringPack("row=",stat.row),
stringPack("atk=",stat.atk),
stringPack("key=",stat.key),
stringPack("rotate=",stat.rotate),
stringPack("hold=",stat.hold),
stringPack("spin=",stat.spin),
},"\r\n")
local t={}
for i=1,#dataOpt do
ins(t,dataOpt[i].."="..toS(stat[dataOpt[i]]))
end
t=table.concat(t,"\r\n")
--t=love.math.compress(t,"zlib"):getString()
userData:open("w")
userData:write(t)
@@ -239,7 +251,7 @@ function loadSetting()
elseif t=="das"or t=="arr"or t=="sddas"or t=="sdarr"then
v=toN(v)if not v or v<0 then v=0 end
setting[t]=int(v)
elseif t=="ghost"or t=="center"then
elseif t=="ghost"or t=="center"or t=="grid"or t=="swap"then
setting[t]=v=="true"
elseif t=="lang"then
setting[t]=toN(v:match("[12]"))or 1
@@ -263,25 +275,15 @@ function saveSetting()
for i=1,4 do
lib[i]=table.concat(setting.keyLib[i],",")
end
local t=table.concat({
stringPack("lang=",setting.lang),
stringPack("sfx=",setting.sfx),
stringPack("bgm=",setting.bgm),
stringPack("vib=",setting.vib),
stringPack("fullscreen=",setting.fullscreen),
stringPack("bgblock=",setting.bgblock),
stringPack("das=",setting.das),
stringPack("arr=",setting.arr),
stringPack("sddas=",setting.sddas),
stringPack("sdarr=",setting.sdarr),
stringPack("keymap=",table.concat(map,"/")),
stringPack("keylib=",table.concat(lib,"/")),
stringPack("virtualkey=",table.concat(vk,"/")),
stringPack("virtualkeyAlpha=",setting.virtualkeyAlpha),
stringPack("virtualkeyIcon=",setting.virtualkeyIcon),
stringPack("virtualkeySwitch=",setting.virtualkeySwitch),
stringPack("frameMul=",setting.frameMul),
},"\r\n")
local t={
"keymap="..toS(table.concat(map,"/")),
"keylib="..toS(table.concat(lib,"/")),
"virtualkey="..toS(table.concat(vk,"/")),
}
for i=1,#saveOpt do
ins(t,saveOpt[i].."="..toS(setting[saveOpt[i]]))
end
t=table.concat(t,"\r\n")
--t=love.math.compress(t,"zlib"):getString()
userSetting:open("w")
userSetting:write(t)