Final push
This commit is contained in:
@@ -593,7 +593,8 @@ function loadGame(mode,ifQuickPlay,ifNet)-- Load a mode and go to game scene
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function gameOver()-- Save record
|
function gameOver()
|
||||||
|
-- Save record
|
||||||
if GAME.replaying then
|
if GAME.replaying then
|
||||||
local R=GAME.curMode.getRank
|
local R=GAME.curMode.getRank
|
||||||
if R then
|
if R then
|
||||||
@@ -665,6 +666,14 @@ function gameOver()-- Save record
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Kill mod patching function
|
||||||
|
if GAME.ApplyModsTask then
|
||||||
|
TASK.removeTask_code(GAME.ApplyModsTask)
|
||||||
|
TABLE.cut(GAME.modCodeList)
|
||||||
|
GAME.modCodeList=nil
|
||||||
|
GAME.ApplyModsTask=nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function trySave()
|
function trySave()
|
||||||
if not GAME.statSaved and PLAYERS[1] and PLAYERS[1].type=='human' and (PLAYERS[1].frameRun>300 or GAME.result) then
|
if not GAME.statSaved and PLAYERS[1] and PLAYERS[1].type=='human' and (PLAYERS[1].frameRun>300 or GAME.result) then
|
||||||
|
|||||||
@@ -364,7 +364,9 @@ do-- Mod data
|
|||||||
{no=1,id="HL",name="hold",
|
{no=1,id="HL",name="hold",
|
||||||
key="w",x=200,y=230,color='lO',
|
key="w",x=200,y=230,color='lO',
|
||||||
list={0,1,2,3,4,5,6},
|
list={0,1,2,3,4,5,6},
|
||||||
func=function(P,O) P.gameEnv.holdCount=O end,
|
func=function(P,O,F)
|
||||||
|
if P.gameEnv.holdCount==O then return end
|
||||||
|
if F then P:setHold(O) else P.gameEnv.holdCount=O end end,
|
||||||
unranked=true,
|
unranked=true,
|
||||||
},
|
},
|
||||||
{no=2,id="FL",name="hideNext",
|
{no=2,id="FL",name="hideNext",
|
||||||
@@ -410,7 +412,11 @@ do-- Mod data
|
|||||||
{no=9,id="DT",name="dropDelay",
|
{no=9,id="DT",name="dropDelay",
|
||||||
key="a",x=140,y=350,color='lR',
|
key="a",x=140,y=350,color='lR',
|
||||||
list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
|
list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
|
||||||
func=function(P,O) P.gameEnv.drop=O end,
|
func=function(P,O,F)
|
||||||
|
if P.gameEnv.drop==O then return end
|
||||||
|
P.gameEnv.drop=O
|
||||||
|
if F then P:set20G(O==0) end
|
||||||
|
end,
|
||||||
unranked=true,
|
unranked=true,
|
||||||
},
|
},
|
||||||
{no=10,id="LT",name="lockDelay",
|
{no=10,id="LT",name="lockDelay",
|
||||||
@@ -522,6 +528,7 @@ do-- Game data tables
|
|||||||
curMode=false, -- Current gamemode object
|
curMode=false, -- Current gamemode object
|
||||||
initPlayerCount=0, -- Player count when init game
|
initPlayerCount=0, -- Player count when init game
|
||||||
mod=TABLE.new(0,#MODOPT),-- List of loaded mods
|
mod=TABLE.new(0,#MODOPT),-- List of loaded mods
|
||||||
|
modPatch=false, -- Mods can lock value to prevent changes? False by default to compactible with old replays (from 0.17 to 0.17.15)
|
||||||
modeEnv=false, -- Current gamemode environment
|
modeEnv=false, -- Current gamemode environment
|
||||||
setting={}, -- Game settings
|
setting={}, -- Game settings
|
||||||
rep={}, -- Recording list, key,time,key,time...
|
rep={}, -- Recording list, key,time,key,time...
|
||||||
|
|||||||
@@ -449,6 +449,7 @@ C. Gamepad
|
|||||||
},
|
},
|
||||||
mod={
|
mod={
|
||||||
title="Mods",
|
title="Mods",
|
||||||
|
modPatch="Enable mod patch",
|
||||||
reset="Reset (tab)",
|
reset="Reset (tab)",
|
||||||
unranked="Unranked",
|
unranked="Unranked",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ return {
|
|||||||
noRotation="No Rotation\nKhông thể xoay gạch",
|
noRotation="No Rotation\nKhông thể xoay gạch",
|
||||||
noMove="No Movement\nKhông thể di chuyển trái phải",
|
noMove="No Movement\nKhông thể di chuyển trái phải",
|
||||||
customSeq="Randomizer\nGhi đè trình xáo gạch",
|
customSeq="Randomizer\nGhi đè trình xáo gạch",
|
||||||
pushSpeed="Garbage Speed\nGhi đề tốc độ xuất hiện của hàng rác",
|
pushSpeed="Garbage Speed\nGhi đè tốc độ xuất hiện rác",
|
||||||
boneBlock="[ ]\nChơi với skin [ ]",
|
boneBlock="[ ]\nChơi với skin [ ]",
|
||||||
},
|
},
|
||||||
pauseStat={
|
pauseStat={
|
||||||
@@ -457,6 +457,7 @@ C. Tay cầm chơi game (Gamepad):
|
|||||||
mod={
|
mod={
|
||||||
title="Mods",
|
title="Mods",
|
||||||
reset="Đặt lại (tab)",
|
reset="Đặt lại (tab)",
|
||||||
|
modPatch="Bật bản vá mod",
|
||||||
unranked="Không tính điểm",
|
unranked="Không tính điểm",
|
||||||
},
|
},
|
||||||
pause={
|
pause={
|
||||||
|
|||||||
@@ -200,22 +200,33 @@ local function _loadGameEnv(P)-- Load gameEnv
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if ENV.allowMod then
|
if ENV.allowMod then
|
||||||
if SETTING.forceMod or ENV.forceMod then
|
if GAME.modPatch then
|
||||||
-- Psudeo code
|
GAME.modCodeList={}
|
||||||
MOD_CODE_LIST={}
|
|
||||||
for i=1,#GAME.mod do
|
for i=1,#GAME.mod do
|
||||||
if GAME.mod[i]>0 then
|
if GAME.mod[i]>0 then
|
||||||
local M=MODOPT[i]
|
local M=MODOPT[i]
|
||||||
table.insert(MOD_CODE_LIST,function() M.func(P,M.list and M.list[GAME.mod[i]]) end)
|
if not GAME.modCodeList[P.id] then GAME.modCodeList[P.id]={} end
|
||||||
|
table.insert(GAME.modCodeList[P.id], function() M.func(P,M.list and M.list[GAME.mod[i]],true) end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
MOD_BATCH_TASK=function() for _,c in pairs(MOD_CODE_LIST) do c() end end
|
|
||||||
TASK.new(MOD_BATCH_TASK)
|
if not GAME.ApplyModsTask then
|
||||||
|
GAME.ApplyModsTask=function()
|
||||||
|
while true do
|
||||||
|
for _,p in pairs(GAME.modCodeList) do
|
||||||
|
for _,c in pairs(p) do pcall(c) end
|
||||||
|
end
|
||||||
|
coroutine.yield()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
TASK.new(GAME.ApplyModsTask)
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
for i=1,#GAME.mod do
|
for i=1,#GAME.mod do
|
||||||
if GAME.mod[i]>0 then
|
if GAME.mod[i]>0 then
|
||||||
local M=MODOPT[i]
|
local M=MODOPT[i]
|
||||||
M.func(P,M.list and M.list[GAME.mod[i]])
|
M.func(P,M.list and M.list[GAME.mod[i]],false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2786,6 +2786,9 @@ function Player:_die()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if GAME.ApplyModsTask then
|
||||||
|
TABLE.cut(GAME.modCodeList[self.id])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function Player:update(dt)
|
function Player:update(dt)
|
||||||
self.trigFrame=self.trigFrame+dt*60
|
self.trigFrame=self.trigFrame+dt*60
|
||||||
|
|||||||
@@ -145,8 +145,9 @@ end
|
|||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newText{name='title', x=80,y=50,font=70,align='L'},
|
WIDGET.newText{name='title', x=80,y=50,font=70,align='L'},
|
||||||
WIDGET.newText{name='unranked', x=1200,y=60,color='Y',font=50,align='R'},
|
WIDGET.newText{name='unranked', x=1200,y=60,color='Y',font=50,align='R'},
|
||||||
WIDGET.newButton{name='reset', x=1140,y=540,w=170,h=80,font=25,code=pressKey'tab'},
|
WIDGET.newSwitch{name='modPatch',x=1175,y=550,font=20,disp=function() return GAME.modPatch end,code=function() GAME.modPatch=not GAME.modPatch end},
|
||||||
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
|
WIDGET.newButton{name='reset', x=1095,y=640,w=80,h=80,font=60,fText=CHAR.icon.trash,code=pressKey'tab'},
|
||||||
|
WIDGET.newButton{name='back', x=1185,y=640,w=80,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene
|
return scene
|
||||||
|
|||||||
Reference in New Issue
Block a user