0.8.12
This commit is contained in:
172
parts/event.lua
172
parts/event.lua
@@ -1,172 +0,0 @@
|
||||
local int,max,min=math.floor,math.max,math.min
|
||||
local ins,rem=table.insert,table.remove
|
||||
local function gameOver()
|
||||
saveStat()
|
||||
local M=curMode
|
||||
if M.pauseLimit and(pauseCount==1 and pauseTime>2.6 or pauseTime>6.26)then
|
||||
TEXT(text.invalidGame,640,260,80,"flicker",.5)
|
||||
return
|
||||
end
|
||||
local R=M.getRank
|
||||
if R then
|
||||
local P=players[1]
|
||||
R=R(P)--new rank
|
||||
if R then
|
||||
local r=modeRanks[M.id]--old rank
|
||||
if R>r then
|
||||
modeRanks[M.id]=R
|
||||
if r==0 then
|
||||
for i=1,#M.unlock do
|
||||
local m=M.unlock[i]
|
||||
modeRanks[m]=modes[m].score and 0 or 6
|
||||
end
|
||||
end
|
||||
saveUnlock()
|
||||
end
|
||||
local D=M.score(P)
|
||||
local L=M.records
|
||||
local p=#L--排名数-1
|
||||
if p>0 then
|
||||
::L::
|
||||
if M.comp(D,L[p])then--是否靠前
|
||||
p=p-1
|
||||
if p>0 then
|
||||
goto L
|
||||
end
|
||||
end
|
||||
end
|
||||
if p<10 then
|
||||
if p==0 then
|
||||
P:showText(text.newRecord,0,-100,100,"beat",.5)
|
||||
end
|
||||
D.date=os.date("%Y/%m/%d %H:%M")
|
||||
ins(L,p+1,D)
|
||||
if L[11]then L[11]=nil end
|
||||
saveRecord(M.saveFileName,L)
|
||||
end
|
||||
end
|
||||
end
|
||||
end--Save record
|
||||
local function die(P)--Same thing when win/lose,not really die!
|
||||
P.alive=false
|
||||
P.control=false
|
||||
P.timing=false
|
||||
P.waiting=1e99
|
||||
P.b2b=0
|
||||
clearTask(P)
|
||||
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
|
||||
end
|
||||
Event={}
|
||||
function Event.reach_winCheck(P)
|
||||
if P.stat.row>=P.gameEnv.target then
|
||||
Event.win(P,"finish")
|
||||
end
|
||||
end
|
||||
function Event.win(P,result)
|
||||
die(P)
|
||||
P.result="WIN"
|
||||
if modeEnv.royaleMode then
|
||||
P.modeData.event=1
|
||||
P:changeAtk()
|
||||
end
|
||||
if P.human then
|
||||
gameResult=result or"win"
|
||||
SFX.play("win")
|
||||
VOICE("win")
|
||||
if modeEnv.royaleMode then
|
||||
BGM.play("8-bit happiness")
|
||||
end
|
||||
end
|
||||
newTask(Event_task.finish,P)
|
||||
if curMode.id=="custom_puzzle"then
|
||||
P:showText(text.win,0,0,90,"beat",.4)
|
||||
else
|
||||
P:showText(text.win,0,0,90,"beat",.5,.2)
|
||||
end
|
||||
if P.human then
|
||||
gameOver()
|
||||
end
|
||||
end
|
||||
function Event.lose(P)
|
||||
if P.invincible then
|
||||
while P.field[1]do
|
||||
removeRow(P.field)
|
||||
removeRow(P.visTime)
|
||||
end
|
||||
if P.AI_mode=="CC"then
|
||||
P.AI_needFresh=true
|
||||
end
|
||||
return
|
||||
end
|
||||
die(P)
|
||||
for i=1,#players.alive do
|
||||
if players.alive[i]==P then
|
||||
rem(players.alive,i)
|
||||
break
|
||||
end
|
||||
end
|
||||
P.result="K.O."
|
||||
if modeEnv.royaleMode then
|
||||
P:changeAtk()
|
||||
P.modeData.event=#players.alive+1
|
||||
P:showText(P.modeData.event,0,-120,60,"appear",1,12)
|
||||
P.strength=0
|
||||
if P.lastRecv then
|
||||
local A,i=P,0
|
||||
repeat
|
||||
A,i=A.lastRecv,i+1
|
||||
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
|
||||
A.modeData.point,A.badge=A.modeData.point+1,A.badge+P.badge+1
|
||||
for i=A.strength+1,4 do
|
||||
if A.badge>=royaleData.powerUp[i]then
|
||||
A.strength=i
|
||||
end
|
||||
end
|
||||
P.lastRecv=A
|
||||
if P.id==1 or A.id==1 then
|
||||
newTask(Event_task.throwBadge,A,{P,max(3,P.badge)*4})
|
||||
end
|
||||
freshMostBadge()
|
||||
end
|
||||
else
|
||||
P.badge=-1
|
||||
end
|
||||
freshMostDangerous()
|
||||
for i=1,#players.alive do
|
||||
if players.alive[i].atking==P then
|
||||
players.alive[i]:freshTarget()
|
||||
end
|
||||
end
|
||||
if #players.alive==royaleData.stage[gameStage]then
|
||||
royaleLevelup()
|
||||
end
|
||||
end
|
||||
P.gameEnv.keepVisible=P.gameEnv.visible~="show"
|
||||
P:showText(text.lose,0,0,90,"appear",.5,.2)
|
||||
if P.human then
|
||||
gameResult="lose"
|
||||
SFX.play("fail")
|
||||
VOICE("lose")
|
||||
if modeEnv.royaleMode then BGM.play("end")end
|
||||
end
|
||||
if #players.alive==1 then
|
||||
Event.win(players.alive[1])
|
||||
end
|
||||
if #players==1 or(P.human and not players[2].human)then
|
||||
gameOver()
|
||||
end
|
||||
newTask(#players>1 and Event_task.lose or Event_task.finish,P)
|
||||
end
|
||||
return Event
|
||||
36
parts/freeRow.lua
Normal file
36
parts/freeRow.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
local freeRow={}
|
||||
local L={}--storage
|
||||
local _=0--lenth
|
||||
function freeRow.reset(num)
|
||||
if num<_ then
|
||||
for i=_,num+1,-1 do
|
||||
L[i]=nil
|
||||
end
|
||||
elseif num>_ then
|
||||
for i=_+1,num do
|
||||
L[i]={0,0,0,0,0,0,0,0,0,0}
|
||||
end
|
||||
end
|
||||
_=num
|
||||
end
|
||||
function freeRow.get(val)
|
||||
if _==0 then
|
||||
for i=1,10 do
|
||||
L[i]={0,0,0,0,0,0,0,0,0,0}
|
||||
end
|
||||
_=_+10
|
||||
end
|
||||
local t=L[_]
|
||||
for i=1,10 do t[i]=val end
|
||||
L[_]=nil
|
||||
_=_-1
|
||||
return t
|
||||
end
|
||||
function freeRow.discard(t)
|
||||
_=_+1
|
||||
L[_]=t
|
||||
end
|
||||
function freeRow.getCount()
|
||||
return _
|
||||
end
|
||||
return freeRow
|
||||
114
parts/getTip.lua
Normal file
114
parts/getTip.lua
Normal file
@@ -0,0 +1,114 @@
|
||||
local L
|
||||
if setting.lang==1 then
|
||||
L={
|
||||
"不是动画,真的在加载!",
|
||||
"大满贯10连击消四全清!",
|
||||
"<方块研究所>有一个Nspire-CX版本!",
|
||||
"B2B2B???",
|
||||
"B2B2B2B存在吗?",
|
||||
"MEGACMB!",
|
||||
"ALLSPIN!",
|
||||
"O型回旋三清!",
|
||||
"Miya:喵!",
|
||||
"2+2=Miya",
|
||||
"225238922 哔哩哔哩 干杯~",
|
||||
"适度游戏益脑,沉迷游戏伤身,合理安排时间,享受健康生活",
|
||||
"合群了就会消失,但是消失不代表没有意义",
|
||||
"学会使用两个旋转键,三个更好",
|
||||
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
|
||||
"注意到\"旋转\"到底对方块做了些什么吗?",
|
||||
"20G本质是一套全新的游戏规则",
|
||||
"不要在上课时玩游戏!",
|
||||
"本游戏难度上限很高,做好心理准备",
|
||||
"本游戏可不是休闲游戏",
|
||||
"调到特殊的日期也不会发生什么的",
|
||||
"3.1415926535897932384",
|
||||
"2.7182818284590452353",
|
||||
"Let-The-Bass-Kick!",
|
||||
"使用love2d引擎制作",
|
||||
"有疑问?先看设置有没有你想要的",
|
||||
"有建议的话可以把信息反馈给作者~",
|
||||
"不要按F8",
|
||||
"秘密数字:626",
|
||||
"CLASSIC SEXY RUSSIAN BLOCKS",
|
||||
"戴上耳机以获得最佳体验",
|
||||
"少女祈祷中",
|
||||
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
|
||||
"(第一次才准)今日幸运数字:"..math.random(100,626),
|
||||
}
|
||||
elseif setting.lang==2 then
|
||||
L={
|
||||
"不是动画,真的在加载!",
|
||||
"大满贯10连击消四全清!",
|
||||
"<方块研究所>有一个Nspire-CX版本!",
|
||||
"B2B2B???",
|
||||
"B2B2B2B存在吗?",
|
||||
"MEGACMB!",
|
||||
"ALLSPIN!",
|
||||
"O spin triple!",
|
||||
"Miya:喵!",
|
||||
"2*2=Miya",
|
||||
"225238922 哔哩哔哩 干杯~",
|
||||
"适度游戏益脑,沉迷游戏伤身,合理安排时间,享受健康生活",
|
||||
"合群了就会消失,但是消失不代表没有意义",
|
||||
"学会使用两个旋转键,三个更好",
|
||||
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
|
||||
"注意到\"旋转\"到底对方块做了些什么吗?",
|
||||
"20G本质是一套全新的游戏规则",
|
||||
"不要在上课时玩游戏!",
|
||||
"本游戏难度上限很高,做好心理准备",
|
||||
"本游戏可不是休闲游戏",
|
||||
"调到特殊的日期也不会发生什么的",
|
||||
"3.1415926535897932384",
|
||||
"2.7182818284590452353",
|
||||
"Let-The-Bass-Kick!",
|
||||
"使用love2d引擎制作",
|
||||
"有疑问?先看设置有没有你想要的",
|
||||
"有建议的话可以把信息反馈给作者~",
|
||||
"不要按F8",
|
||||
"秘密数字:626",
|
||||
"CLASSIC SEXY RUSSIAN BLOCKS",
|
||||
"戴上耳机以获得最佳体验",
|
||||
"少女祈祷中",
|
||||
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
|
||||
"(第一次才准)今日幸运数字:"..math.random(100,626),
|
||||
}
|
||||
elseif setting.lang==3 then
|
||||
L={
|
||||
"Not animation,real loading!",
|
||||
"Back to Back 10 combo Techrash PC!",
|
||||
"Techmino has a Nspire-CX edition!",
|
||||
"B2B2B???",
|
||||
"Is B2B2B2B possible?",
|
||||
"MEGACMB!",
|
||||
"ALLSPIN!",
|
||||
"O spin triple!",
|
||||
"Miya:Nya!",
|
||||
"2^2=Miya",
|
||||
"225238922 Bilibili cheers!",
|
||||
"Playing too much = taking drugs",
|
||||
"Disappearing doesn't mean useless",
|
||||
"Try to use two rotate button,three better",
|
||||
"Small DAS&ARR can make you faster,if you can control block correctly",
|
||||
"Have you noticed what does \"rotating\" do to block?",
|
||||
"20G actually is a brand new game rule",
|
||||
"Do not play game in class!",
|
||||
"This game can be very hard,be mentally perpared",
|
||||
"This in not a casual game",
|
||||
"Nothing will happen when some special day come",
|
||||
"3.1415926535897932384",
|
||||
"2.7182818284590452353",
|
||||
"Let-The-Bass-Kick!",
|
||||
"Powered by love2d",
|
||||
"Find out what's in the setting!",
|
||||
"Any suggestions to author!",
|
||||
"DO NOT PRESS F8",
|
||||
"Secret num:626",
|
||||
"Techmino=Technique+Tetromino",
|
||||
"CLASSIC SEXY RUSSIAN BLOCKS",
|
||||
"Headphones for better experience",
|
||||
"少女祈禱中",
|
||||
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
|
||||
}
|
||||
end
|
||||
return L[math.random(#L)]
|
||||
125
parts/kickList.lua
Normal file
125
parts/kickList.lua
Normal file
@@ -0,0 +1,125 @@
|
||||
local map={{},{},{},{},{}}
|
||||
for x=1,5 do for y=1,5 do map[x][y]={x-3,y-3}end end
|
||||
local function collect(T)
|
||||
for _,T in next,T do
|
||||
for k,vec in next,T do
|
||||
T[k]=map[vec[1]+3][vec[2]+3]
|
||||
end
|
||||
end
|
||||
end
|
||||
local 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} },
|
||||
[03]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-1}, {1,-2} },
|
||||
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}},
|
||||
[12]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[21]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[32]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[23]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[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}, {0,-2} },
|
||||
[31]={{0,0},{0,1}, {0,-1}, {1,0}, {0,2} },
|
||||
},--Z
|
||||
[2]={
|
||||
[01]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-1},{-1,-2} },
|
||||
[10]={{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} },
|
||||
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
|
||||
[12]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[21]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[32]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[23]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[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}, {0,2} },
|
||||
[31]={{0,0},{0,-1}, {0,1}, {1,0}, {0,-2} },
|
||||
},--S
|
||||
[3]={
|
||||
[01]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1},{0,1} },
|
||||
[10]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1} },
|
||||
[03]={{0,0},{1,0}, {1,1}, {0,-2}, {-1,1} },
|
||||
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[12]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
|
||||
[21]={{0,0},{-1,0}, {-1,-1},{-1,1}, {0,-2}, {-1,-2},{-1,-1} },
|
||||
[32]={{0,0},{-1,0}, {-1,-1},{-1,1}, {1,0}, {0,2}, {-1,2} },
|
||||
[23]={{0,0},{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
|
||||
[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}, {1,0}, {0,-1} },
|
||||
[31]={{0,0},{0,-1}, {-1,0}, {0,1} },
|
||||
},--L
|
||||
[4]={
|
||||
[01]={{0,0},{-1,0}, {-1,1}, {0,-2}, {1,1} },
|
||||
[10]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[03]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1}, {0,1} },
|
||||
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
|
||||
[12]={{0,0},{1,0}, {1,-1}, {1,1}, {-1,0}, {0,2}, {1,2} },
|
||||
[21]={{0,0},{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
|
||||
[32]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
|
||||
[23]={{0,0},{1,0}, {1,-1}, {1,1}, {0,-2}, {1,-2}, {1,-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}, {1,0}, {0,1} },
|
||||
[31]={{0,0},{0,1}, {-1,0}, {0,-1} },
|
||||
},--J
|
||||
[5]={
|
||||
[01]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
|
||||
[10]={{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} },
|
||||
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
|
||||
[12]={{0,0},{1,0}, {1,-1}, {0,-1}, {-1,-1},{0,2}, {1,2}},
|
||||
[21]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2},{1,1} },
|
||||
[32]={{0,0},{-1,0}, {-1,-1},{0,-1}, {1,-1}, {0,2}, {-1,2}},
|
||||
[23]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2}, {-1,1} },
|
||||
[02]={{0,0},{-1,0}, {1,0}, {0,1} },
|
||||
[20]={{0,0},{1,0}, {-1,0}, {0,-1} },
|
||||
[13]={{0,0},{0,-1}, {0,1}, {1,0}, {0,-2}, {0,2}},
|
||||
[31]={{0,0},{0,-1}, {0,1}, {-1,0}, {0,-2}, {0,2}},
|
||||
},--T
|
||||
[6]={},--O(special)
|
||||
[7]={
|
||||
[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} },
|
||||
[32]={{0,0},{1,0}, {-2,0}, {1,-2}, {-2,-1} },
|
||||
[21]={{0,0},{-2,0}, {1,0}, {1,-2}, {-2,1} },
|
||||
[23]={{0,0},{2,0}, {-1,0}, {-1,-2},{2,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}, {-1,0}, {1,0}, {0,1} },
|
||||
[31]={{0,0},{1,0}, {-1,0}},
|
||||
}
|
||||
}for i=1,7 do collect(TRS[i])end
|
||||
local AIRS={
|
||||
[1]={
|
||||
[01]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[10]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[03]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[12]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[21]={{0,0},{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[32]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[23]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
},
|
||||
[7]={
|
||||
[01]={{0,0},{-2,0}, {1,0}, {-2,-1},{1,2} },
|
||||
[10]={{0,0},{2,0}, {-1,0}, {2,1}, {-1,-2} },
|
||||
[12]={{0,0},{-1,0}, {2,0}, {-1,2}, {2,-1} },
|
||||
[21]={{0,0},{1,0}, {-2,0}, {1,-2}, {-2,1} },
|
||||
[23]={{0,0},{2,0}, {-1,0}, {2,1}, {-1,-2} },
|
||||
[32]={{0,0},{-2,0}, {1,0}, {-2,-1},{1,2} },
|
||||
[30]={{0,0},{1,0}, {-2,0}, {1,-2}, {-2,1} },
|
||||
[03]={{0,0},{-1,0}, {2,0}, {-1,2}, {2,-1} },
|
||||
}
|
||||
}
|
||||
for i=2,6 do AIRS[i]=AIRS[1]end
|
||||
collect(AIRS[1])collect(AIRS[7])
|
||||
|
||||
return{
|
||||
TRS=TRS,
|
||||
AIRS=AIRS,
|
||||
}
|
||||
134
parts/list.lua
Normal file
134
parts/list.lua
Normal file
@@ -0,0 +1,134 @@
|
||||
actName={
|
||||
"moveLeft","moveRight",
|
||||
"rotRight","rotLeft","rot180",
|
||||
"hardDrop","softDrop",
|
||||
"hold","func",
|
||||
"restart",
|
||||
"insLeft","insRight","insDown","down1","down4","down10",
|
||||
"dropLeft","dropRight","addLeft","addRight",--Super contorl system
|
||||
}
|
||||
color={
|
||||
red={1,0,0},
|
||||
green={0,1,0},
|
||||
blue={.2,.2,1},
|
||||
yellow={1,1,0},
|
||||
magenta={1,0,1},
|
||||
cyan={0,1,1},
|
||||
grey={.6,.6,.6},
|
||||
|
||||
lightRed={1,.5,.5},
|
||||
lightGreen={.5,1,.5},
|
||||
lightBlue={.6,.6,1},
|
||||
lightYellow={1,1,.5},
|
||||
lightMagenta={1,.5,1},
|
||||
lightCyan={.5,1,1},
|
||||
lightGrey={.8,.8,.8},
|
||||
|
||||
darkRed={.6,0,0},
|
||||
darkGreen={0,.6,0},
|
||||
darkBlue={0,0,.6},
|
||||
darkYellow={.6,.6,0},
|
||||
darkMagenta={.6,0,.6},
|
||||
darkCyan={0,.6,.6},
|
||||
darkGrey={.3,.3,.3},
|
||||
|
||||
orange={1,.6,0},
|
||||
pink={1,0,.6},
|
||||
grass={.6,1,0},
|
||||
water={0,1,.6},
|
||||
bronze={.7,.4,0},
|
||||
white={1,1,1},
|
||||
lightOrange={1,.7,.3},
|
||||
darkOrange={.6,.4,0},
|
||||
purple={.5,0,1},
|
||||
lightPurple={.8,.4,1},
|
||||
darkPurple={.3,0,.6},
|
||||
}
|
||||
voiceBank={}--{{SRC1s},{SRC2s},...}
|
||||
voiceName={
|
||||
"zspin","sspin","lspin","jspin","tspin","ospin","ispin",
|
||||
"single","double","triple","techrash",
|
||||
"mini","b2b","b3b","pc",
|
||||
"win","lose",
|
||||
"bye",
|
||||
"nya",
|
||||
"happy",
|
||||
"doubt",
|
||||
"sad",
|
||||
"egg",
|
||||
}
|
||||
voiceList={
|
||||
zspin={"zspin_1","zspin_2","zspin_3"},
|
||||
sspin={"sspin_1","sspin_2","sspin_3","sspin_4","sspin_5","sspin_6"},
|
||||
lspin={"lspin_1","lspin_2"},
|
||||
jspin={"jspin_1","jspin_2","jspin_3","jspin_4"},
|
||||
tspin={"tspin_1","tspin_2","tspin_3","tspin_4","tspin_5","tspin_6"},
|
||||
ospin={"ospin_1","ospin_2","ospin_3"},
|
||||
ispin={"ispin_1","ispin_2","ispin_3"},
|
||||
|
||||
single={"single_1","single_2","single_3","single_4","single_5","single_6","single_7"},
|
||||
double={"double_1","double_2","double_3","double_4","double_5"},
|
||||
triple={"triple_1","triple_2","triple_3","triple_4","triple_5","triple_6","triple_7"},
|
||||
techrash={"techrash_1","techrash_2","techrash_3","techrash_4"},
|
||||
|
||||
mini={"mini_1","mini_2","mini_3"},
|
||||
b2b={"b2b_1","b2b_2","b2b_3"},
|
||||
b3b={"b3b_1","b3b_2"},
|
||||
pc={"perfectclear_1","perfectclear_2"},
|
||||
win={"win_1","win_2","win_3","win_4","win_5","win_6","win_6","win_7"},
|
||||
lose={"lose_1","lose_2","lose_3"},
|
||||
bye={"bye_1","bye_2"},
|
||||
nya={"nya_1","nya_2","nya_3","nya_4"},
|
||||
happy={"nya_happy_1","nya_happy_2","nya_happy_3","nya_happy_4"},
|
||||
doubt={"nya_doubt_1","nya_doubt_2"},
|
||||
sad={"nya_sad_1"},
|
||||
egg={"egg_1","egg_2"},
|
||||
}
|
||||
|
||||
musicID={
|
||||
"blank",
|
||||
"way",
|
||||
"race",
|
||||
"newera",
|
||||
"push",
|
||||
"reason",
|
||||
"infinite",
|
||||
"secret7th",
|
||||
"secret8th",
|
||||
"shining terminal",
|
||||
"oxygen",
|
||||
"distortion",
|
||||
"rockblock",
|
||||
"cruelty",
|
||||
"final",
|
||||
"8-bit happiness",
|
||||
"end",
|
||||
}
|
||||
customID={
|
||||
"drop","lock",
|
||||
"wait","fall",
|
||||
"next","hold",
|
||||
"sequence","visible",
|
||||
"target",
|
||||
"freshLimit",
|
||||
"opponent",
|
||||
"bg","bgm",
|
||||
}
|
||||
customRange={
|
||||
drop={1e99,180,60,40,30,25,20,18,16,14,12,10,9,8,7,6,5,4,3,2,1,.5,.25,.125,0},
|
||||
lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
|
||||
wait={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
|
||||
fall={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
|
||||
next={0,1,2,3,4,5,6},
|
||||
hold={true,false,true},
|
||||
sequence={"bag7","his4","rnd"},
|
||||
visible={"show","time","fast","none"},
|
||||
target={10,20,40,100,200,500,1000,1e99},
|
||||
freshLimit={0,8,15,1e99},
|
||||
opponent={0,1,2,3,4,5,11,12,13,14,15,16},
|
||||
bg={"none","game1","game2","game3","strap","rgb","glow","matrix"},
|
||||
bgm={"blank","way","race","newera","push","reason","infinite","secret7th","secret8th","rockblock"},
|
||||
}
|
||||
|
||||
RCPB={10,33,200,33,105,5,105,60}
|
||||
snapLevelValue={1,10,20,40,60,80}
|
||||
@@ -1,13 +1,13 @@
|
||||
modes={
|
||||
{"sprint_10", id=1, x=0, y=0, size=35,shape=1,icon="timer", unlock={2,3}},
|
||||
{"sprint_20", id=2, x=-300, y=0, size=45,shape=1,icon="timer", unlock={73,74,75}},
|
||||
{"sprint_40", id=3, x=0, y=-400, size=55,shape=1,icon="timer", unlock={4,9}},
|
||||
{"sprint_40", id=3, x=0, y=-400, size=55,shape=1,icon="timer", unlock={4,9,71,72}},
|
||||
{"sprint_100", id=4, x=-200, y=-400, size=45,shape=1,icon="timer", unlock={5,7}},
|
||||
{"sprint_400", id=5, x=-400, y=-400, size=35,shape=1,icon="timer", unlock={6}},
|
||||
{"sprint_1000", id=6, x=-600, y=-400, size=35,shape=1,icon="timer", unlock={}},
|
||||
{"drought_normal", id=7, x=-400, y=-200, size=35,shape=1,icon="noI", unlock={8}},
|
||||
{"drought_lunatic", id=8, x=-600, y=-200, size=35,shape=1,icon="mess", unlock={}},
|
||||
{"marathon_normal", id=9, x=0, y=-600, size=55,shape=1,icon="flag", unlock={10,11,22,31,36,37,48,67,71,72}},
|
||||
{"marathon_normal", id=9, x=0, y=-600, size=55,shape=1,icon="flag", unlock={10,11,22,31,36,37,48,67}},
|
||||
{"marathon_hard", id=10, x=0, y=-800, size=45,shape=1,icon="flag", unlock={27}},
|
||||
{"solo_1", id=11, x=-300, y=-1000, size=35,shape=1,icon="solo", unlock={12}},
|
||||
{"solo_2", id=12, x=-500, y=-1000, size=35,shape=1,icon="solo", unlock={13}},
|
||||
|
||||
138
parts/skin.lua
Normal file
138
parts/skin.lua
Normal file
@@ -0,0 +1,138 @@
|
||||
local gc=love.graphics
|
||||
local int=math.floor
|
||||
local function C(x,y)
|
||||
local _=gc.newCanvas(x,y)
|
||||
gc.setCanvas(_)
|
||||
return _
|
||||
end
|
||||
local list={
|
||||
"normal(mrz)",
|
||||
"smooth(mrz)",
|
||||
"contrast(mrz)",
|
||||
"glow(mrz)",
|
||||
"plastic(mrz)",
|
||||
"jelly(miya)",
|
||||
"steel(kulumi)",
|
||||
"pure(mrz)",
|
||||
"ball(shaw)",
|
||||
"text_bone(mrz)",
|
||||
"colored_bone(mrz)",
|
||||
"white_bone(mrz)",
|
||||
}
|
||||
local skin={}
|
||||
skin.lib={}
|
||||
skin.libMini={}
|
||||
skin.libColor={
|
||||
color.red,
|
||||
color.orange,
|
||||
color.yellow,
|
||||
color.grass,
|
||||
color.green,
|
||||
color.water,
|
||||
color.cyan,
|
||||
color.blue,
|
||||
color.purple,
|
||||
color.magenta,
|
||||
color.pink,
|
||||
color.darkGreen,
|
||||
color.grey,
|
||||
color.lightGrey,
|
||||
color.darkPurple,
|
||||
color.darkRed,
|
||||
color.darkGreen,
|
||||
}
|
||||
function skin.load()
|
||||
gc.push()
|
||||
gc.origin()
|
||||
gc.setDefaultFilter("nearest","nearest")
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,#list do
|
||||
local I=gc.newImage("/image/skin/"..list[i]..".png")
|
||||
skin.lib[i],skin.libMini[i]={},{}--30/6
|
||||
for j=1,11 do
|
||||
skin.lib[i][j]=C(30,30)
|
||||
gc.draw(I,30-30*j,0)
|
||||
|
||||
skin.libMini[i][j]=C(6,6)
|
||||
gc.draw(I,6-6*j,0,nil,.2)
|
||||
end
|
||||
for j=1,6 do
|
||||
skin.lib[i][11+j]=C(30,30)
|
||||
gc.draw(I,30-30*j,-30)
|
||||
|
||||
skin.libMini[i][11+j]=C(6,6)
|
||||
gc.draw(I,6-6*j,-6,nil,.2)
|
||||
end
|
||||
I:release()
|
||||
end
|
||||
skin.change(setting.skinSet)
|
||||
puzzleMark={}
|
||||
gc.setLineWidth(3)
|
||||
for i=1,11 do
|
||||
puzzleMark[i]=C(30,30)
|
||||
local _=blockColor[i]
|
||||
gc.setColor(_[1],_[2],_[3],.6)
|
||||
gc.rectangle("line",5,5,20,20)
|
||||
gc.rectangle("line",10,10,10,10)
|
||||
end
|
||||
for i=12,17 do
|
||||
puzzleMark[i]=C(30,30)
|
||||
gc.setColor(blockColor[i])
|
||||
gc.rectangle("line",7,7,16,16)
|
||||
end
|
||||
local _=C(30,30)
|
||||
gc.setColor(1,1,1)
|
||||
gc.line(5,5,25,25)
|
||||
gc.line(5,25,25,5)
|
||||
puzzleMark[-1]=C(30,30)
|
||||
gc.setColor(1,1,1,.9)
|
||||
gc.draw(_)
|
||||
_:release()
|
||||
gc.setCanvas()
|
||||
gc.pop()
|
||||
end
|
||||
local L=#list
|
||||
function skin.prevSet()--prev skin_set
|
||||
local _=(setting.skinSet-2)%L+1
|
||||
setting.skinSet=_
|
||||
skin.change(_)
|
||||
_=list[_]
|
||||
TEXT(_,1100,100,int(300/#_)+5,"fly")
|
||||
end
|
||||
function skin.nextSet()--next skin_set
|
||||
local _=setting.skinSet%L+1
|
||||
setting.skinSet=_
|
||||
skin.change(_)
|
||||
_=list[_]
|
||||
TEXT(_,1100,100,int(300/#_)+5,"fly")
|
||||
end
|
||||
function skin.prev(i)--prev skin for [i]
|
||||
local _=setting.skin
|
||||
_[i]=(_[i]-2)%11+1
|
||||
skin.adjust(i,_[i])
|
||||
end
|
||||
function skin.next(i)--next skin for [i]
|
||||
local _=setting.skin
|
||||
_[i]=_[i]%11+1
|
||||
skin.adjust(i,_[i])
|
||||
end
|
||||
function skin.rotate(i)--change direction of [i]
|
||||
setting.face[i]=(setting.face[i]+1)%4
|
||||
SFX.play("rotate")
|
||||
end
|
||||
function skin.change(i)--change to skin_set[i]
|
||||
for _=1,7 do
|
||||
skin.adjust(_,setting.skin[_])
|
||||
end
|
||||
for _=8,13 do
|
||||
blockSkin[_]=skin.lib[i][_+4]
|
||||
blockSkinMini[_]=skin.libMini[i][_+4]
|
||||
end
|
||||
end
|
||||
function skin.adjust(i,id)--load color/image/image_mini of [i] from lib
|
||||
local S=setting.skinSet
|
||||
blockSkin[i]=skin.lib[S][id]
|
||||
blockSkinMini[i]=skin.libMini[S][id]
|
||||
blockColor[i]=skin.libColor[id]
|
||||
end
|
||||
return skin
|
||||
@@ -30,54 +30,10 @@ function space.new()
|
||||
stars[i]=s --size
|
||||
stars[i+1]=rnd(W) --x
|
||||
stars[i+2]=rnd(H) --y
|
||||
stars[i+3]=(rnd()-.5)*.05*s --vx
|
||||
stars[i+4]=(rnd()-.5)*.05*s --vy
|
||||
stars[i+3]=(rnd()-.5)*.01*s --vx
|
||||
stars[i+4]=(rnd()-.5)*.01*s --vy
|
||||
end--800 stars
|
||||
end
|
||||
function space.translate(dx,dy)
|
||||
planet.x=planet.x+dx*.26
|
||||
planet.y=planet.y+dy*.26
|
||||
for i=1,2600,5 do
|
||||
local s=stars[i]
|
||||
stars[i+1]=stars[i+1]+dx*s
|
||||
stars[i+2]=stars[i+2]+dy*s
|
||||
end
|
||||
end
|
||||
function space.scale(k)
|
||||
planet.r=planet.r*k^.15
|
||||
for i=1,2600,5 do
|
||||
local s=stars[i]
|
||||
local x=stars[i+1]
|
||||
local y=stars[i+2]
|
||||
s=s*k
|
||||
x=W*.5+(x-W*.5)*k
|
||||
y=H*.5+(y-H*.5)*k
|
||||
if k>1 then
|
||||
if x%W~=x or y%H~=y then
|
||||
s=.75
|
||||
x=W*.5+(rnd()-.5)*W*.5
|
||||
y=H*.5+(rnd()-.5)*H*.5
|
||||
end
|
||||
--out,new small one
|
||||
elseif s<.75 then
|
||||
local vx,vy
|
||||
repeat
|
||||
s=rnd()*.75+2.25
|
||||
stars[i]=s --size
|
||||
x=rnd(W) --x
|
||||
y=rnd(H) --y
|
||||
vx=(rnd()-.5)*.15 --vx
|
||||
vy=(rnd()-.5)*.15 --vy
|
||||
until x<100 or x>W-100 or y<100 or y>H-100
|
||||
stars[i+3]=vx
|
||||
stars[i+4]=vy
|
||||
--disappear,new big one
|
||||
end
|
||||
stars[i]=s
|
||||
stars[i+1]=x
|
||||
stars[i+2]=y
|
||||
end
|
||||
end
|
||||
function space.update(dt)
|
||||
local x,y=planet.x,planet.y
|
||||
planet.x=planet.x+planet.vx
|
||||
@@ -94,9 +50,9 @@ function space.draw()
|
||||
if not stars[1]then return end
|
||||
gc.translate(-50,-50)
|
||||
gc.setLineWidth(7)
|
||||
gc.setColor(planet.R,planet.G,.6,.2)
|
||||
gc.setColor(planet.R,planet.G,.6,.1626)
|
||||
gc.circle("line",planet.x,planet.y,planet.r+1)
|
||||
gc.setColor(planet.R,planet.G,.6,.5)
|
||||
gc.setColor(planet.R,planet.G,.6,.26)
|
||||
gc.circle("fill",planet.x,planet.y,planet.r)
|
||||
gc.setColor(.9,.9,.9)
|
||||
for i=1,2600,5 do
|
||||
|
||||
12
parts/spinCenters.lua
Normal file
12
parts/spinCenters.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local TMP1,TMP2,TMP3,TMP4={1,2},{2,1},{2,2},{1.5,1.5}
|
||||
local scs={
|
||||
{[0]=TMP1,TMP2,TMP3,TMP3},
|
||||
{[0]=TMP1,TMP2,TMP3,TMP3},
|
||||
{[0]=TMP1,TMP2,TMP3,TMP3},
|
||||
{[0]=TMP1,TMP2,TMP3,TMP3},
|
||||
{[0]=TMP1,TMP2,TMP3,TMP3},
|
||||
{[0]=TMP4,TMP4,TMP4,TMP4},
|
||||
{[0]={0.5,2.5},{2.5,0.5},{1.5,2.5},{2.5,1.5}},
|
||||
}
|
||||
TMP1,TMP2,TMP3,TMP4=nil
|
||||
return scs
|
||||
@@ -30,9 +30,10 @@ function task.lose(P)
|
||||
end
|
||||
end
|
||||
if P.endCounter==120 then
|
||||
while P.field[1]do
|
||||
removeRow(P.field)
|
||||
removeRow(P.visTime)
|
||||
for _=#P.field,1,-1 do
|
||||
freeRow.discard(P.field[_])
|
||||
freeRow.discard(P.visTime[_])
|
||||
P.field[_],P.visTime[_]=nil
|
||||
end
|
||||
if #players==1 and scene=="play"then
|
||||
pauseGame()
|
||||
@@ -84,7 +85,9 @@ function task.settingSaved(_,T)
|
||||
T[1]=T[1]-1
|
||||
if T[1]==0 then
|
||||
if scene.cur=="main"then
|
||||
TEXT(text.settingSaved,370,330,30,"appear")
|
||||
TEXT(text.settingSaved,370,330,28,"appear")
|
||||
else
|
||||
TEXT(text.needRestart,1130,130,28,"appear")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user