Files
Techmino/parts/modes/custom_clear.lua
MrZ626 7ad386d28f 重构模式环境的dropPiece和task事件为更强大的自定义和未来联网任意模式做准备
整理出所有模式的这两个事件独立到一个文件夹并整理所有模式引用它们的方式
警告:很可能有错误,需要他人帮助测试
2021-08-26 23:49:20 +08:00

34 lines
1.0 KiB
Lua

return{
color=COLOR.white,
env={},
load=function()
applyCustomGame()
for y=1,20 do
if solidLine(FIELD[1][y])then
--Switch clear sprint mode on
GAME.modeEnv.dropPiece=require'parts.eventsets.checkClearBoard'.dropPiece
goto BREAK_clearMode
end
end
GAME.modeEnv.dropPiece=NULL
::BREAK_clearMode::
PLY.newPlayer(1)
local AItype=GAME.modeEnv.opponent:sub(1,2)
local AIlevel=tonumber(GAME.modeEnv.opponent:sub(-1))
if AItype=='9S'then
PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=true})
elseif AItype=='CC'then
PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=true,node=20000+5000*AIlevel})
end
for _,P in next,PLY_ALIVE do
setField(P,1)
end
end,
mesDisp=function(P)
setFont(55)
mStr(P.stat.row,63,225)
mText(drawableText.line,63,290)
end,
}