Alpha V0.7.22

This commit is contained in:
MrZ_26
2020-02-04 19:35:33 +08:00
parent b354604c77
commit 7b797baf6a
79 changed files with 2360 additions and 1791 deletions

View File

@@ -1,6 +1,11 @@
local gc=love.graphics
local setFont=setFont
local int,rnd,max,min=math.floor,math.random,math.max,math.min
local format=string.format
local ins,rem=table.insert,table.remove
local function newNext(n)
P.next[#P.next+1]={bk=blocks[n][0],id=n,color=P.gameEnv.bone and 8 or n,name=n}
end
local PCbase={
{3,3,3,0,0,0,0,0,2,2},
{3,6,6,0,0,0,0,2,2,5},
@@ -32,6 +37,21 @@ 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}
local pc_fall={18,16,14,12,10,9,8,7,6}
local blockColor=blockColor
local function throwBadge(S,R)--Sender/Receiver
local x1,y1,x2,y2
if S.small then
x1,y1=S.centerX,S.centerY
else
x1,y1=S.x+308*S.size,S.y+450*S.size
end
if R.small then
x2,y2=R.centerX,R.centerY
else
x2,y2=R.x+66*R.size,R.y+344*R.size
end
FX.badge[#FX.badge+1]={x1,y1,x2,y2,t=0}
end
loadmode={
sprint=function()
createPlayer(1,340,15)
@@ -74,7 +94,7 @@ loadmode={
end,
survivor=function()
createPlayer(1,340,15)
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"or curMode.lv==5 and"survivor_ultimate"],P)
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"or curMode.lv==5 and"survivor_ultimate"or curMode.lv==6 and"survivor_extra"],P)
pushSpeed=curMode.lv>2 and 2 or 1
end,
tech=function()
@@ -101,7 +121,6 @@ loadmode={
createPlayer(1,340,15)
P=players[1]
Event.newPC()
P.freshNext()
end,
pcchallenge=function()
createPlayer(1,340,15)
@@ -170,14 +189,14 @@ loadmode={
createPlayer(2,965,360,.5,modeEnv.opponent)
end
preField.h=20
::R::
repeat
for i=1,10 do
if preField[preField.h][i]>0 or curMode.lv==2 and preField[preField.h][i]==-1 then
goto L
end
end
preField.h=preField.h-1
if preField.h>0 then goto R end
until preField.h==0
::L::
if curMode.lv==1 then
for _,P in next,players.alive do
@@ -196,12 +215,12 @@ loadmode={
mesDisp={
--Default:font=35,white
sprint=function()
setFont(70)
setFont(65)
local r=max(P.gameEnv.target-P.stat.row,0)
mStr(r,-82,260)
mStr(r,-82,265)
if r<21 and r>0 then
gc.setLineWidth(3)
gc.setColor(1,.5,.5)
gc.setLineWidth(4)
gc.setColor(1,r>10 and 0 or rnd(),.5)
gc.line(0,600-30*r,300,600-30*r)
end
end,
@@ -235,7 +254,7 @@ mesDisp={
infinite=function()
setFont(50)
mStr(P.stat.atk,-82,310)
mStr(format("%.2f",2.5*P.stat.atk/P.stat.piece),-82,420)
mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420)
setFont(20)
mStr("Attack",-82,363)
mStr("Efficiency",-82,475)
@@ -250,6 +269,11 @@ mesDisp={
setFont(25)
mStr("Rows",-82,300)
mStr("Techrash",-82,420)
if curMode.lv==6 then
mStr("Point",-82,180)
setFont(60)
mStr(P.modeData.point*.1,-82,110)
end
setFont(80)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
@@ -269,13 +293,14 @@ mesDisp={
tech=function()
setFont(50)
mStr(P.stat.atk,-82,310)
mStr(format("%.2f",2.5*P.stat.atk/P.stat.piece),-82,420)
mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420)
setFont(20)
mStr("Attack",-82,363)
mStr("Efficiency",-82,475)
end,
c4wtrain=function()
setFont(50)
mStr(max(200-P.stat.row,0),-82,220)
mStr(P.combo,-82,310)
mStr(P.modeData.point,-82,400)
setFont(20)
@@ -295,6 +320,9 @@ mesDisp={
mStr(P.stat.pc,-82,350)
setFont(50)
mStr(max(100-P.stat.row,0),-82,250)
gc.setColor(.5,.5,.5)
local y=72*(7-(P.stat.piece+1)%7)-36
gc.line(320,y,442,y)
end,
techmino49=function()
setFont(40)
@@ -333,22 +361,26 @@ mesDisp={
custom=function()
setFont(25)
mStr("Rows",-82,300)
setFont(80)
mStr(P.stat.row,-82,220)
setFont(65)
mStr(P.stat.row,-82,225)
if P.gameEnv.target<1e4 then
setFont(75)
mStr(max(P.gameEnv.target-P.stat.row,0),-82,280)
end
if curMode.lv==2 and P.modeData.event==0 then
gc.setColor(1,1,1,.6)
if P.gameEnv.puzzle and P.modeData.event==0 then
gc.setLineWidth(3)
for y=1,preField.h do for x=1,10 do
local B=preField[y][x]
if B>0 then
if B>7 then
gc.setColor(blockColor[B])
gc.rectangle("line",30*x-23,607-30*y,16,16)
elseif B>0 then
local c=blockColor[B]
gc.setColor(c[1],c[2],c[3],.6)
gc.rectangle("line",30*x-25,605-30*y,20,20)
gc.rectangle("line",30*x-20,610-30*y,10,10)
elseif B==0 then
gc.setColor(.8,.8,.8,.6)
gc.setColor(1,1,1,.4)
gc.line(30*x-25,605-30*y,30*x-5,625-30*y)
gc.line(30*x-25,625-30*y,30*x-5,605-30*y)
end
@@ -380,13 +412,13 @@ Event={
end
if P.human then
gamefinished=true
newTask(Event_task.finish,P)
SFX("win")
VOICE("win")
if modeEnv.royaleMode then
BGM("8-bit happiness")
end
end
newTask(Event_task.finish,P)
showText(P,text.win,"beat",90,nil,.4,curMode.id~="custom")
end,
lose=function()
@@ -398,7 +430,9 @@ Event={
clearTask(P)
for i=1,#players.alive do
if players.alive[i]==P then
rem(players.alive,i)
for k=i,#players.alive do
players.alive[k]=players.alive[k+1]
end
break
end
end
@@ -410,10 +444,10 @@ Event={
P.strength=0
if P.lastRecv then
local A,i=P,0
::L::
repeat
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
until not A or A.alive or A==P or i==3
if A and A.alive then
if P.id==1 or A.id==1 then
P.killMark=A.id==1
end
@@ -486,7 +520,7 @@ Event={
master_reach_lunatic=function()
local t=P.modeData.point
local c=#P.clearing
if t%100==99 and c==0 then goto L end
if t%100==99 and c==0 then return end
t=t+(c<3 and c+1 or c==3 and 5 or 7)
if int(t*.01)>P.modeData.event then
P.modeData.event=P.modeData.event+1
@@ -494,7 +528,7 @@ Event={
P.modeData.event=4
P.modeData.point=500
Event.win()
goto L
return
else
local s=P.modeData.event+1
curBG=s==2 and"game1"or s==3 and"game2"or s==4 and"game3"or s==5 and"game4"
@@ -510,12 +544,11 @@ Event={
end
P.modeData.point=t
if t%100==99 then SFX("blip_1")end
::L::
end,
master_reach_ultimate=function()
local t=P.modeData.point
local c=#P.clearing
if t%100==99 and c==0 then goto L end
if t%100==99 and c==0 then return end
t=t+(c<3 and c+1 or c==3 and 5 or 7)
if int(t*.01)>P.modeData.event then
P.modeData.event=P.modeData.event+1
@@ -524,7 +557,7 @@ Event={
P.modeData.event=4
P.modeData.point=500
Event.win()
goto L
return
else
local s=P.modeData.event+1
curBG=s==2 and"game3"or s==3 and"game4"or s==4 and"game5"or s==5 and"game6"
@@ -539,7 +572,6 @@ Event={
end
P.modeData.point=t
if t%100==99 then SFX("blip_1")end
::L::
end,
classic_reach=function()
P.gameEnv.target=P.gameEnv.target+10
@@ -555,6 +587,14 @@ Event={
end
end
end,
GM_reach=function()
local R=#P.clearing
if R==4 then R=10 end
P.modeData.point=P.modeData.point+R
if P.stat.time>=53.5 then
Event.win()
end
end,
tsd_reach=function()
if P.lastClear~=52 then
Event.lose()
@@ -565,6 +605,8 @@ Event={
tech_reach_easy=function()
if P.b2b<40 then
Event.lose()
elseif P.stat.row==3 then
Event.win()
end
end,
tech_reach_hard=function()
@@ -579,22 +621,38 @@ Event={
end,
c4w_reach=function()
for i=1,#P.clearing do
ins(P.field,getNewRow(10))
ins(P.visTime,getNewRow(20))
P.field[#P.field+1]=getNewRow(10)
P.visTime[#P.visTime+1]=getNewRow(20)
for i=4,7 do P.field[#P.field][i]=0 end
end
if #P.clearing==0 then
if curMode.lv==2 then
Event.lose()
end
elseif P.combo>P.modeData.point then
P.modeData.point=P.combo
else
if P.combo>P.modeData.point then
P.modeData.point=P.combo
end
if P.stat.row>=200 then
Event.win()
end
end
end,
newPC=function()
local P=players[1]
if P.stat.piece%4==0 then
if #P.field==#P.clearing then
P.modeData.event=P.modeData.event==0 and 1 or 0
local r=rnd(#PClist)
local f=P.modeData.event==0
for i=1,4 do
local b=PClist[r][i]
if f then
if b<3 then b=3-b
elseif b<5 then b=7-b
end
end
newNext(b)
end
P.counter=P.stat.piece==0 and 20 or 0
newTask(Event_task.PC,P)
if curMode.lv==2 then
@@ -604,17 +662,30 @@ Event={
P.gameEnv.lock=pc_lock[s]or 20
P.gameEnv.fall=pc_fall[s]or 5
if s==10 then
showText(P,text.maxspeed,"appear",80,-140)
showText(P,text.maxspeed,"appear",100,-140,.6)
else
showText(P,text.speedup,"appear",30,-140)
showText(P,text.speedup,"appear",40,-140)
end
end
end
else
Event.lose()
end
elseif P.curY+P.r>5-P.stat.row%4+#P.clearing then
Event.lose()
end
end,
puzzleCheck=function()
for y=1,20 do
local L=P.field[y]
for x=1,10 do
local a,b=preField[y][x],L and L[x]or 0
if a~=-1 and(a==0 and b>0 or a<8 and a~=b or a>7 and b==0)then return end
end
end
P.modeData.event=1
Event.win()
end
}
Event_task={
finish=function(self,P)
@@ -678,10 +749,10 @@ Event_task={
if not P.control then return end
P.counter=P.counter+1
if P.counter>=max(60,150-2*P.modeData.event)and P.atkBuffer.sum<4 then
ins(P.atkBuffer,{pos=rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1})
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1}
P.atkBuffer.sum=P.atkBuffer.sum+1
P.stat.recv=P.stat.recv+1
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",80,-140)end
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",100,-140,.6)end
P.counter=0
P.modeData.event=P.modeData.event+1
end
@@ -691,14 +762,14 @@ Event_task={
P.counter=P.counter+1
if P.counter>=max(90,180-2*P.modeData.event)and P.atkBuffer.sum<8 then
local d=P.modeData.event+1
if d%4==0 then ins(P.atkBuffer,{pos=rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1})
elseif d%4==1 then ins(P.atkBuffer,{pos=rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1})
elseif d%4==2 then ins(P.atkBuffer,{pos=rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2})
elseif d%4==3 then ins(P.atkBuffer,{pos=rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3})
end
P.atkBuffer[#P.atkBuffer+1]=
d%4==0 and{pos=rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1}or
d%4==1 and{pos=rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1}or
d%4==2 and{pos=rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2}or
d%4==3 and{pos=rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3}
P.atkBuffer.sum=P.atkBuffer.sum+d%4+1
P.stat.recv=P.stat.recv+d%4+1
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",80,-140)end
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",100,-140,.6)end
P.counter=0
P.modeData.event=d
end
@@ -707,15 +778,15 @@ Event_task={
if not P.control then return end
P.counter=P.counter+1
if P.counter>=max(60,180-2*P.modeData.event)and P.atkBuffer.sum<15 then
if P.modeData.event%3<2 then
ins(P.atkBuffer,{pos=rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1})
else
ins(P.atkBuffer,{pos=rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2})
end
P.atkBuffer[#P.atkBuffer+1]=
P.modeData.event%3<2 and
{pos=rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1}
or
{pos=rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2}
local R=(P.modeData.event%3<2 and 1 or 3)
P.atkBuffer.sum=P.atkBuffer.sum+R
P.stat.recv=P.stat.recv+R
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",80,-140)end
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",100,-140,.6)end
P.counter=0
P.modeData.event=P.modeData.event+1
end
@@ -725,10 +796,10 @@ Event_task={
P.counter=P.counter+1
if P.counter>=max(60,150-P.modeData.event)and P.atkBuffer.sum<20 then
local t=max(60,90-P.modeData.event)
ins(P.atkBuffer,{pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3})
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}
P.atkBuffer.sum=P.atkBuffer.sum+4
P.stat.recv=P.stat.recv+4
if P.modeData.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
if P.modeData.event==60 then showText(P,text.maxspeed,"appear",100,-140,.6)end
P.counter=0
P.modeData.event=P.modeData.event+1
end
@@ -738,17 +809,52 @@ Event_task={
P.counter=P.counter+1
if P.counter>=max(300,600-10*P.modeData.event)and P.atkBuffer.sum<20 then
local t=max(300,480-12*P.modeData.event)
ins(P.atkBuffer,{pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2})
ins(P.atkBuffer,{pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3})
ins(P.atkBuffer,{pos=rnd(10),amount=6,countdown=1.2*t,cd0=1.2*t,time=0,sent=false,lv=4})
ins(P.atkBuffer,{pos=rnd(10),amount=6,countdown=1.5*t,cd0=1.5*t,time=0,sent=false,lv=5})
local p=#P.atkBuffer+1
P.atkBuffer[p] ={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2}
P.atkBuffer[p+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}
P.atkBuffer[p+2]={pos=rnd(10),amount=6,countdown=1.2*t,cd0=1.2*t,time=0,sent=false,lv=4}
P.atkBuffer[p+3]={pos=rnd(10),amount=6,countdown=1.5*t,cd0=1.5*t,time=0,sent=false,lv=5}
P.atkBuffer.sum=P.atkBuffer.sum+20
P.stat.recv=P.stat.recv+4
P.stat.recv=P.stat.recv+20
P.counter=0
if P.modeData.event==31 then showText(P,text.maxspeed,"appear",80,-140)end
if P.modeData.event==31 then showText(P,text.maxspeed,"appear",100,-140,.6)end
P.modeData.event=P.modeData.event+1
end
end,
survivor_extra=function(self,P)
if not P.control then return end
if P.atkBuffer.sum<3 then
local p=#P.atkBuffer+1
local T=P.modeData.event
if T<15 then
local t=1200-20*T--1200~900
P.atkBuffer[p] ={pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3}
P.atkBuffer[p+1]={pos=rnd(4,7),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
elseif T<30 then
local t=900-20*(T-15)--900~600
P.atkBuffer[p] ={pos=rnd(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
P.atkBuffer[p+1]={pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
else
local t=max(480,720-16*(T-30))--720~480
P.atkBuffer[p] ={pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
P.atkBuffer[p+1]={pos=rnd(3,8),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
end
P.atkBuffer.sum=P.atkBuffer.sum+20
P.stat.recv=P.stat.recv+20
P.modeData.event=P.modeData.event+1
if P.modeData.event==15 then
showText(P,text.awesome,"appear",100,-140,.6)
elseif P.modeData.event==16 then
pushSpeed=4
elseif P.modeData.event==30 then
showText(P,text.continue,"appear",100,-140,.6)
elseif P.modeData.event==31 then
pushSpeed=6
elseif P.modeData.event==45 then
showText(P,text.maxspeed,"appear",100,-140,.6)
end
end
end,
PC=function(self,P)
P.counter=P.counter+1
if P.counter==21 then
@@ -960,10 +1066,10 @@ defaultModeEnv={
{
_20G=true,
drop=0,lock=15,
wait=10,
fall=15,
wait=10,fall=15,
visible="fast",
freshLimit=15,
target=1,reach=Event.GM_reach,
arr=1,
bg="game3",bgm="secret8th",
},
@@ -1001,7 +1107,7 @@ defaultModeEnv={
bg="game2",bgm="secret8th",
},
{
drop=5,lock=60,
drop=6,lock=60,
fall=10,
freshLimit=15,
bg="game3",bgm="secret7th",
@@ -1012,13 +1118,19 @@ defaultModeEnv={
freshLimit=15,
bg="rgb",bgm="secret7th",
},
{
drop=3,lock=60,
fall=8,
freshLimit=15,
bg="game4",bgm="push",
},
},
tech={
{
oncehold=false,
drop=1e99,lock=1e99,
target=1,reach=Event.tech_reach_easy,
bg="matrix",bgm="way",
bg="matrix",bgm="newera",
},
{
oncehold=false,
@@ -1029,18 +1141,23 @@ defaultModeEnv={
{
drop=10,lock=60,
freshLimit=15,
target=1,reach=Event.tech_reach_hard,
bg="matrix",bgm="way",
},
{
drop=3,lock=40,
target=1,
freshLimit=15,
reach=Event.tech_reach_hard,
target=1,reach=Event.tech_reach_easy,
bg="matrix",bgm="secret8th",
},
{
drop=1,lock=40,
drop=30,lock=60,
freshLimit=15,
target=1,reach=Event.tech_reach_ultimate,
bg="matrix",bgm="secret8th",
},
{
_20G=true,lock=60,
freshLimit=15,
target=1,reach=Event.tech_reach_hard,
bg="matrix",bgm="secret7th",
},
{
_20G=true,lock=60,
freshLimit=15,
target=1,reach=Event.tech_reach_ultimate,
bg="matrix",bgm="secret7th",
@@ -1065,7 +1182,7 @@ defaultModeEnv={
hold=false,
drop=150,lock=150,
fall=20,
sequence="pc",
sequence="none",
target=0,reach=Event.newPC,
ospin=false,
bg="rgb",bgm="newera",
@@ -1075,7 +1192,7 @@ defaultModeEnv={
hold=false,
drop=60,lock=60,
fall=20,
sequence="pc",
sequence="none",
freshLimit=15,
target=0,reach=Event.newPC,
ospin=false,
@@ -1160,8 +1277,8 @@ defaultModeEnv={
reach=Event.win,
},
{
Fkey=true,
reach=Event.win,
Fkey=true,puzzle=true,
target=0,reach=Event.puzzleCheck,
},
},
}