重构模式环境的dropPiece和task事件为更强大的自定义和未来联网任意模式做准备
整理出所有模式的这两个事件独立到一个文件夹并整理所有模式引用它们的方式 警告:很可能有错误,需要他人帮助测试
This commit is contained in:
@@ -1,36 +1,3 @@
|
||||
local PCbase=require"parts.modes.PCbase"
|
||||
local PClist=require"parts.modes.PClist"
|
||||
local PCtype={
|
||||
1,1,1,1,2,
|
||||
1,1,1,1,3,
|
||||
1,1,1,2,
|
||||
1,2,1,3,
|
||||
1,2,3,
|
||||
}
|
||||
local function task_PC(P)
|
||||
P.control=false
|
||||
for _=1,26 do YIELD()end
|
||||
P.control=true
|
||||
local base=PCbase[P.modeData.type]
|
||||
P:pushLineList(base[P.holeRND:random(#base)],P.modeData.symmetry)
|
||||
end
|
||||
local function check(P)
|
||||
local r=P.field
|
||||
if #r>0 then
|
||||
if #r+P.stat.row%4>4 then
|
||||
P:lose()
|
||||
end
|
||||
else
|
||||
local type=PCtype[P.stat.pc+1]or 3
|
||||
local L=PClist[type][P.holeRND:random(#PClist[type])]
|
||||
local symmetry=P.holeRND:random()>.5
|
||||
P.modeData.type=type
|
||||
P.modeData.symmetry=symmetry
|
||||
P:pushNextList(L,symmetry)
|
||||
P.modeData.counter=P.stat.piece==0 and 20 or 0
|
||||
P:newTask(task_PC)
|
||||
end
|
||||
end
|
||||
return{
|
||||
color=COLOR.green,
|
||||
env={
|
||||
@@ -39,13 +6,12 @@ return{
|
||||
drop=120,lock=180,
|
||||
fall=20,
|
||||
sequence='none',
|
||||
dropPiece=check,
|
||||
RS="SRS",
|
||||
eventSet='pctrain_n',
|
||||
bg='rgb',bgm='oxygen',
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1)
|
||||
check(PLAYERS[1])
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
setFont(60)
|
||||
|
||||
Reference in New Issue
Block a user