Compare commits

..

30 Commits

Author SHA1 Message Date
MrZ_26
becc092192 0.10.4:漏洞修复 2020-08-14 00:25:00 +08:00
MrZ_26
185862eabf 锁延机制错误(重构锁延代码) 2020-08-13 23:59:26 +08:00
MrZ_26
19ce62997b 代码整理 2020-08-13 23:53:07 +08:00
MrZ_26
d8c096b06b 修复拼图模式序列准备错误(改了自定义忘了改这个) 2020-08-13 21:43:05 +08:00
MrZ_26
aa836c7028 修复游戏结束后马上暂停并解除还会自动暂停(之前没修好) 2020-08-13 02:42:03 +08:00
MrZ_26
e5e378fa07 更改减速debug模式速度 2020-08-13 02:33:31 +08:00
MrZ_26
230514e34a 一条tip 2020-08-13 02:33:03 +08:00
MrZ_26
d196d73448 修复提前硬降失效 2020-08-13 02:09:30 +08:00
MrZ_26
cb98a9094a 修复计算器切场景bug 2020-08-12 22:57:43 +08:00
MrZ_26
ec036037fe 0.10.4:漏洞修复 2020-08-12 21:56:02 +08:00
MrZ_26
882769bb71 修改场景模块方法名 2020-08-12 21:45:42 +08:00
MrZ_26
ba43e5e6a7 软件锁变量名修改 2020-08-12 18:47:00 +08:00
MrZ_26
09c56d74bd 代码整理 2020-08-12 18:46:52 +08:00
MrZ_26
c78630a31e linter查出的几个小问题 2020-08-12 18:43:42 +08:00
MrZ_26
d46d111900 0.10.3:软件锁 2020-08-12 00:04:48 +08:00
MrZ_26
87d6e0b501 回放时暂停不打断玩家操作 2020-08-12 00:02:26 +08:00
MrZ_26
45430a6a4a 修复禁断连c4wtrain的成绩为随机(我傻逼) 2020-08-11 23:22:57 +08:00
MrZ_26
7f8a10327b 剩余锁延重置次数指示器改为长方形 2020-08-11 18:28:19 +08:00
MrZ_26
bebe4b96a3 设置添加软件锁,debug界面改为重置界面,进入方法调整 2020-08-11 17:57:57 +08:00
MrZ_26
c1fd22f0b4 场景系统逻辑微调 2020-08-11 00:35:26 +08:00
MrZ_26
0f204e8659 取消按钮喵叫 2020-08-11 00:34:40 +08:00
MrZ_26
9529597a0d 取消"找不到语音"的print 2020-08-11 00:32:19 +08:00
MrZ_26
392ec9abab 加载完毕标记 2020-08-11 00:31:37 +08:00
MrZ_26
d0c7e14f74 "声明"变量 2020-08-11 00:26:44 +08:00
MrZ_26
3cd86472f8 修复回放也计入排行榜 2020-08-10 23:18:21 +08:00
MrZ_26
1e6e3d0d50 时间tip报错 2020-08-10 19:00:25 +08:00
MrZ_26
ed89685925 语音音量设置连续 2020-08-10 01:44:26 +08:00
MrZ_26
971dce6a66 极简提示音量放大 2020-08-10 01:44:00 +08:00
MrZ_26
5de78e924d 取消quickR设置,修改游戏设置布局,增加相关tip 2020-08-10 01:43:39 +08:00
MrZ_26
de0de3a771 修复无尽挖掘报错,小改垃圾行出现代码 2020-08-10 01:37:49 +08:00
23 changed files with 479 additions and 303 deletions

View File

@@ -25,6 +25,7 @@ local Timer=love.timer.getTime
local int,rnd,max,min=math.floor,math.random,math.max,math.min local int,rnd,max,min=math.floor,math.random,math.max,math.min
local abs=math.abs local abs=math.abs
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local byte=string.byte
local scr=scr local scr=scr
local xOy=love.math.newTransform() local xOy=love.math.newTransform()
@@ -127,12 +128,83 @@ local touchDown,touchUp,touchMove={},{},{}
local keyDown,keyUp={},{} local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{} local gamepadDown,gamepadUp={},{}
function keyDown.calculator(k)
local S=sceneTemp
if byte(k)>=48 and byte(k)<=57 then
if S.sym=="="then
S.val=tonumber(k)
S.sym=false
elseif S.sym then
if not S.reg then
S.reg=S.val
S.val=tonumber(k)
elseif S.val<1e13 then
S.val=S.val*10+tonumber(k)
end
else
if S.val<1e13 then
S.val=S.val*10+tonumber(k)
end
end
elseif k=="backspace"then
if S.val>0 then
S.val=int(S.val/10)
end
elseif k=="+"or k=="="and kb.isDown("rshift","lshift")then
S.sym="+"
elseif k=="-"then
S.sym="-"
elseif k=="*"or k=="8"and kb.isDown("rshift","lshift")then
S.sym="*"
elseif k=="/"then
S.sym="/"
elseif k=="return"then
if S.val then
if S.sym and S.reg then
S.val=
S.sym=="+"and S.reg+S.val or
S.sym=="-"and S.reg-S.val or
S.sym=="*"and S.reg*S.val or
S.sym=="/"and S.reg/S.val or
-1
end
S.sym="="
S.reg=false
if S.val==626 then
S.pass=true
elseif S.val==196022 then
marking=nil
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
SFX.play("clear")
elseif S.val==72943816 then
for name,M in next,Modes do
if not modeRanks[name]then
modeRanks[name]=M.score and 0 or 6
end
end
FILE.saveUnlock()
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
SFX.play("clear_2")
elseif S.val==137926261379 then
SCN.go("debug")
end
end
elseif k=="space"then
if S.pass then
SCN.swapTo("load")
end
end
end
function keyDown.load(k) function keyDown.load(k)
if k=="a"then if k=="a"then
sceneTemp.skip=true sceneTemp.skip=true
elseif k=="s"then elseif k=="s"then
marking=nil marking=nil
sceneTemp.skip=true sceneTemp.skip=true
elseif k=="escape"then
SCN.back()
end end
end end
function touchDown.load(id,x,y) function touchDown.load(id,x,y)
@@ -146,7 +218,7 @@ function mouseDown.intro(x,y,k)
VOC.play("bye") VOC.play("bye")
SCN.back() SCN.back()
else else
SCN.goto("main") SCN.go("main")
end end
end end
function touchDown.intro(id,x,y) function touchDown.intro(id,x,y)
@@ -269,7 +341,7 @@ function keyDown.mode(key)
end end
elseif mapCam.sel=="custom_clear" or mapCam.sel=="custom_puzzle" then elseif mapCam.sel=="custom_clear" or mapCam.sel=="custom_puzzle" then
if key=="e"then if key=="e"then
SCN.goto("custom") SCN.go("custom")
end end
end end
end end
@@ -326,7 +398,7 @@ function keyDown.custom(key)
BGM.play(customRange.bgm[customSel[sel]]) BGM.play(customRange.bgm[customSel[sel]])
end end
elseif key=="q"then elseif key=="q"then
SCN.goto("sequence") SCN.go("sequence")
elseif key=="e"then elseif key=="e"then
SCN.swapTo("draw","swipe") SCN.swapTo("draw","swipe")
elseif #key==1 then elseif #key==1 then
@@ -615,7 +687,7 @@ function keyDown.pause(key)
elseif key=="escape"then elseif key=="escape"then
resumeGame() resumeGame()
elseif key=="s"then elseif key=="s"then
SCN.goto("setting_sound") SCN.go("setting_sound")
elseif key=="r"then elseif key=="r"then
TASK.clear("play") TASK.clear("play")
resetGameData() resetGameData()
@@ -738,34 +810,6 @@ function gamepadUp.play(key)
end end
end end
function keyDown.staff(key,RESET)
if key=="escape"then
SCN.back()
elseif key=="\122"then
if RESET or kb.isDown("\109")and kb.isDown("\114")then
SCN.goto("debug")
end
end
end
function touchDown.staff(id,x,y)
local pw=sceneTemp.pw
local t=pw%4
if
t==0 and x<640 and y<360 or
t==1 and x>640 and y<360 or
t==2 and x<640 and y>360 or
t==3 and x>640 and y>360
then
pw=pw+1
if pw==8 then
SCN.goto("debug")
end
else
pw=x<640 and y<360==1 and 1 or 0
end
sceneTemp.pw=pw
end
function wheelMoved.history(x,y) function wheelMoved.history(x,y)
wheelScroll(y) wheelScroll(y)
end end
@@ -1050,7 +1094,7 @@ function love.run()
local FCT=0--Framedraw counter local FCT=0--Framedraw counter
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
SCN.init("load")--Scene Launch SCN.init(setting.appLock and "calculator"or"load")--Scene Launch
marking=true marking=true
return function() return function()
@@ -1120,7 +1164,7 @@ function love.run()
--Draw scene swapping animation --Draw scene swapping animation
if SCN.swapping then if SCN.swapping then
_=SCN.swap _=SCN.stat
_.draw(_.time) _.draw(_.time)
end end
@@ -1142,8 +1186,8 @@ function love.run()
for i=1,#LIST do for i=1,#LIST do
gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000) gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000)
end end
if devMode==3 then WAIT(.26) if devMode==3 then WAIT(.1)
elseif devMode==4 then WAIT(.626) elseif devMode==4 then WAIT(.5)
end end
end end
@@ -1152,7 +1196,7 @@ function love.run()
end end
--Fresh power info. --Fresh power info.
if Timer()-lastFreshPow>2 and setting.powerInfo and SCN.cur~="load"then if Timer()-lastFreshPow>2 and setting.powerInfo and loadingFinished then
updatePowerInfo() updatePowerInfo()
lastFreshPow=Timer() lastFreshPow=Timer()
_=gc.getWidth() _=gc.getWidth()

View File

@@ -85,8 +85,6 @@ local langList={
unlockSavingError="解锁保存失败:", unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:", recSavingError="纪录保存失败:",
ai_fixed="不能同时开启AI和固定序列",
ai_prebag="不能同时开启AI和自定义序列",
switchSpawnSFX="请开启方块出生音效", switchSpawnSFX="请开启方块出生音效",
needRestart="重新开始以生效", needRestart="重新开始以生效",
@@ -186,6 +184,17 @@ local langList={
support="支持作者", support="支持作者",
group="官方QQ群(如果没有被暗改的话就是这个):1080457319", group="官方QQ群(如果没有被暗改的话就是这个):1080457319",
WidgetText={ WidgetText={
calculator={
_1="1",_2="2",_3="3",
_4="4",_5="5",_6="6",
_7="7",_8="8",_9="9",
_0="0",["<"]="<",["="]="=",
["+"]="+",
["-"]="-",
["*"]="*",
["/"]="/",
play="开始",
},
main={ main={
play="开始", play="开始",
setting="设置", setting="设置",
@@ -258,15 +267,15 @@ local langList={
graphic="←画面设置", graphic="←画面设置",
sound="声音设置→", sound="声音设置→",
ctrl="控制设置", ctrl="控制设置",
reTime="开局等待时间",
maxNext="最大预览数量",
autoPause="自动暂停",
layout="外观",
key="键位设置", key="键位设置",
touch="触屏设置", touch="触屏设置",
quickR="快速重新开始", reTime="开局等待时间",
maxNext="最大预览数量",
layout="外观",
autoPause="失去焦点自动暂停",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
fine="极简操作提示音", fine="极简操作提示音",
appLock="软件锁(密码626)",
back="返回", back="返回",
}, },
setting_video={ setting_video={
@@ -376,8 +385,6 @@ local langList={
back="返回", back="返回",
}, },
debug={ debug={
killWTM="关闭水印",
unlock="解锁全模式",
reset="重置?", reset="重置?",
reset1="重置解锁/等级", reset1="重置解锁/等级",
reset2="重置统计", reset2="重置统计",
@@ -546,8 +553,6 @@ local langList={
unlockSavingError="解锁保存失败:", unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:", recSavingError="纪录保存失败:",
ai_fixed="不能同时开启电脑玩家和固定序列",
ai_prebag="不能同时开启电脑玩家和自定义序列",
switchSpawnSFX="请开启方块出生音效", switchSpawnSFX="请开启方块出生音效",
needRestart="重新开始以生效", needRestart="重新开始以生效",
@@ -646,6 +651,17 @@ local langList={
support="支持作者", support="支持作者",
group="官方QQ群(如果没有被暗改的话就是这个):1080457319", group="官方QQ群(如果没有被暗改的话就是这个):1080457319",
WidgetText={ WidgetText={
calculator={
_1="1",_2="2",_3="3",
_4="4",_5="5",_6="6",
_7="7",_8="8",_9="9",
_0="0",["<"]="<",["="]="=",
["+"]="+",
["-"]="-",
["*"]="*",
["/"]="/",
play="开始",
},
main={ main={
play="开始", play="开始",
setting="设置", setting="设置",
@@ -718,15 +734,15 @@ local langList={
graphic="←画面设置", graphic="←画面设置",
sound="声音设置→", sound="声音设置→",
ctrl="控制设置", ctrl="控制设置",
reTime="开局等待时间",
maxNext="最大预览数量",
autoPause="自动暂停",
layout="外观",
key="键位设置", key="键位设置",
touch="触屏设置", touch="触屏设置",
quickR="快速重新开始", reTime="开局等待时间",
maxNext="最大预览数量",
layout="外观",
autoPause="失去焦点自动暂停",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
fine="极简操作提示音", fine="极简操作提示音",
appLock="软件锁(密码626)",
back="返回", back="返回",
}, },
setting_video={ setting_video={
@@ -836,8 +852,6 @@ local langList={
back="返回", back="返回",
}, },
debug={ debug={
killWTM="关闭水印",
unlock="解锁全模式",
reset="重置?", reset="重置?",
reset1="重置解锁/等级", reset1="重置解锁/等级",
reset2="重置统计", reset2="重置统计",
@@ -1006,8 +1020,6 @@ local langList={
unlockSavingError="Failed to save unlock:", unlockSavingError="Failed to save unlock:",
recSavingError="Failed to save record:", recSavingError="Failed to save record:",
ai_fixed="AI is incompatible with fixed sequence",
ai_prebag="AI is incompatible with custom sequence",
switchSpawnSFX="Switch on spawn SFX to play", switchSpawnSFX="Switch on spawn SFX to play",
needRestart="Effective after restart", needRestart="Effective after restart",
@@ -1095,6 +1107,17 @@ local langList={
support="Support author", support="Support author",
group="Official QQ Group(if not hacked):1080457319", group="Official QQ Group(if not hacked):1080457319",
WidgetText={ WidgetText={
calculator={
_1="1",_2="2",_3="3",
_4="4",_5="5",_6="6",
_7="7",_8="8",_9="9",
_0="0",["<"]="<",["="]="=",
["+"]="+",
["-"]="-",
["*"]="*",
["/"]="/",
play="Play",
},
main={ main={
play="Play", play="Play",
setting="Settings", setting="Settings",
@@ -1167,15 +1190,15 @@ local langList={
graphic="←Video", graphic="←Video",
sound="Sound→", sound="Sound→",
ctrl="Control settings", ctrl="Control settings",
reTime="Start Delay",
maxNext="Next Queue Length",
autoPause="Auto pause",
layout="Layout",
key="Key Mappings", key="Key Mappings",
touch="Touch Settings", touch="Touch Settings",
quickR="Quick Retry", reTime="Start Delay",
maxNext="Next Queue Length",
layout="Layout",
autoPause="Pause when lose focus",
swap="Key Combination (Change Atk. Mode)", swap="Key Combination (Change Atk. Mode)",
fine="Finesse Error Sound", fine="Finesse Error Sound",
appLock="App Lock(pw=626)",
back="Back", back="Back",
}, },
setting_video={ setting_video={
@@ -1285,8 +1308,6 @@ local langList={
back="Back", back="Back",
}, },
debug={ debug={
killWTM="Kill watermark",
unlock="Unlock all",
reset="Reset?", reset="Reset?",
reset1="Reset rank", reset1="Reset rank",
reset2="Reset data", reset2="Reset data",
@@ -1540,6 +1561,17 @@ local langList={
support="Support author", support="Support author",
group="Official QQ Group(if not hacked):1080457319", group="Official QQ Group(if not hacked):1080457319",
WidgetText={ WidgetText={
calculator={
_1="1",_2="2",_3="3",
_4="4",_5="5",_6="6",
_7="7",_8="8",_9="9",
_0="0",["<"]="<",["="]="=",
["+"]="+",
["-"]="-",
["*"]="*",
["/"]="/",
play="!!!",
},
main={ main={
play="!!!", play="!!!",
setting="_?_", setting="_?_",
@@ -1612,15 +1644,15 @@ local langList={
graphic="←Video", graphic="←Video",
sound="Sound→", sound="Sound→",
ctrl="=?=", ctrl="=?=",
reTime="3-2-1",
maxNext="=123",
autoPause="A||",
layout="=-=-=",
key="=?", key="=?",
touch="_?", touch="_?",
quickR="R!", reTime="3-2-1",
maxNext="=123",
layout="=-=-=",
autoPause="A||",
swap="=+=+=", swap="=+=+=",
fine="!#!X #!#", fine="!#!X #!#",
appLock="?XX(=626)",
back="X", back="X",
}, },
setting_video={ setting_video={
@@ -1730,8 +1762,6 @@ local langList={
back="X", back="X",
}, },
debug={ debug={
killWTM="Kill watermark",
unlock="Unlock all",
reset="Reset?", reset="Reset?",
reset1="Reset rank", reset1="Reset rank",
reset2="Reset data", reset2="Reset data",
@@ -1902,8 +1932,6 @@ local langList={
unlockSavingError="解锁保存失败:", unlockSavingError="解锁保存失败:",
recSavingError="纪录保存失败:", recSavingError="纪录保存失败:",
ai_fixed="不能同时开启AI和固定序列",
ai_prebag="不能同时开启AI和自定义序列",
switchSpawnSFX="请开启方块出生音效", switchSpawnSFX="请开启方块出生音效",
needRestart="重新开始以生效", needRestart="重新开始以生效",
@@ -2003,6 +2031,17 @@ local langList={
support="支持作者", support="支持作者",
group="官方QQ群(如果没有被暗改的话就是这个):1080457319", group="官方QQ群(如果没有被暗改的话就是这个):1080457319",
WidgetText={ WidgetText={
calculator={
_1="1",_2="2",_3="3",
_4="4",_5="5",_6="6",
_7="7",_8="8",_9="9",
_0="0",["<"]="<",["="]="=",
["+"]="+",
["-"]="-",
["*"]="*",
["/"]="/",
play="开始",
},
main={ main={
play="开始", play="开始",
setting="设置", setting="设置",
@@ -2075,15 +2114,15 @@ local langList={
graphic="←改画面", graphic="←改画面",
sound="改声音→", sound="改声音→",
ctrl="改控制", ctrl="改控制",
reTime="开局等待时间",
maxNext="最大预览数量",
autoPause="自动暂停",
layout="外观",
key="改键位", key="改键位",
touch="改触屏", touch="改触屏",
quickR="快速重新开始", reTime="开局等待时间",
maxNext="最大预览数量",
layout="外观",
autoPause="失去焦点自动暂停",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
fine="极简操作提示音", fine="极简操作提示音",
appLock="家长锁(密码626)",
back="返回", back="返回",
}, },
setting_video={ setting_video={
@@ -2193,8 +2232,6 @@ local langList={
back="返回", back="返回",
}, },
debug={ debug={
killWTM="关水印",
unlock="解锁全模式",
reset="重置?", reset="重置?",
reset1="重置解锁/等级", reset1="重置解锁/等级",
reset2="重置统计", reset2="重置统计",
@@ -2356,7 +2393,6 @@ function LANG.set(l)
end end
end end
for _,s in next,drawableTextLoad do for _,s in next,drawableTextLoad do
print(s)
drawableText[s]:set(text[s]) drawableText[s]:set(text[s])
end end
collectgarbage() collectgarbage()

View File

@@ -94,6 +94,16 @@ end
local Pnt={} local Pnt={}
function Pnt.calculator()
local S=sceneTemp
gc.setLineWidth(4)
gc.rectangle("line",100,80,650,150)
setFont(45)
if S.reg then gc.printf(S.reg,0,100,720,"right")end
if S.val then gc.printf(S.val,0,150,720,"right")end
setFont(50)
if S.sym then gc.print(S.sym,126,150)end
end
function Pnt.load() function Pnt.load()
local S=sceneTemp local S=sceneTemp
gc.setLineWidth(4) gc.setLineWidth(4)
@@ -381,7 +391,6 @@ function Pnt.sequence()
gc.draw(drawableText.question,980,470) gc.draw(drawableText.question,980,470)
end end
end end
function Pnt.draw() function Pnt.draw()
local sx,sy=sceneTemp.x,sceneTemp.y local sx,sy=sceneTemp.x,sceneTemp.y
gc.translate(200,60) gc.translate(200,60)
@@ -531,10 +540,10 @@ function Pnt.play()
end end
gc.pop() gc.pop()
end end
local hexList={1,0,.5,1.732*.5,-.5,1.732*.5}for i=1,6 do hexList[i]=hexList[i]*150 end local hexList={1,0,.5,1.732*.5,-.5,1.732*.5}for i=1,6 do hexList[i]=hexList[i]*150 end
local textPos={90,131,-90,131,-200,-25,-90,-181,90,-181,200,-25} local textPos={90,131,-90,131,-200,-25,-90,-181,90,-181,200,-25}
local dataPos={90,143,-90,143,-200,-13,-90,-169,90,-169,200,-13} local dataPos={90,143,-90,143,-200,-13,-90,-169,90,-169,200,-13}
function Pnt.pause() function Pnt.pause()
local S=sceneTemp local S=sceneTemp
local T=S.timer*.02 local T=S.timer*.02
@@ -625,7 +634,7 @@ end
function Pnt.setting_game() function Pnt.setting_game()
gc.setColor(1,1,1) gc.setColor(1,1,1)
mText(drawableText.setting_game,640,15) mText(drawableText.setting_game,640,15)
gc.draw(blockSkin[int(Timer()*2)%11+1],720,540,Timer()%6.28319,2,nil,15,15) gc.draw(blockSkin[int(Timer()*2)%11+1],590,540,Timer()%6.28319,2,nil,15,15)
end end
function Pnt.setting_video() function Pnt.setting_video()
gc.setColor(1,1,1) gc.setColor(1,1,1)
@@ -646,6 +655,7 @@ function Pnt.setting_sound()
gc.draw(IMG.miyaF4,129,98+3*sin(t*.7)) gc.draw(IMG.miyaF4,129,98+3*sin(t*.7))
gc.translate(-x,-y) gc.translate(-x,-y)
end end
local function timeConv(t) local function timeConv(t)
return t.."F "..int(t*16.67).."ms" return t.."F "..int(t*16.67).."ms"
end end

View File

@@ -7,6 +7,14 @@ local scr=scr
local sceneInit={} local sceneInit={}
sceneInit.quit=love.event.quit sceneInit.quit=love.event.quit
function sceneInit.calculator()
sceneTemp={
reg=false,
val=0,
sym=false,
pass=false,
}
end
function sceneInit.load() function sceneInit.load()
sceneTemp={ sceneTemp={
phase=1,--Loading stage phase=1,--Loading stage
@@ -221,7 +229,6 @@ function sceneInit.help()
end end
function sceneInit.staff() function sceneInit.staff()
sceneTemp={ sceneTemp={
pw=0,
time=0, time=0,
v=1, v=1,
} }
@@ -322,7 +329,7 @@ end
local SCN={ local SCN={
cur="load",--Current scene cur="load",--Current scene
swapping=false,--If Swapping swapping=false,--If Swapping
swap={ stat={
tar=nil, --Swapping target tar=nil, --Swapping target
style=nil, --Swapping style style=nil, --Swapping style
mid=nil, --Loading point mid=nil, --Loading point
@@ -333,12 +340,10 @@ local SCN={
}--Scene datas, returned }--Scene datas, returned
function SCN.swapUpdate() function SCN.swapUpdate()
local S=SCN.swap local S=SCN.stat
S.time=S.time-1 S.time=S.time-1
if S.time==S.mid then if S.time==S.mid then
SCN.init(S.tar,SCN.cur) SCN.init(S.tar,SCN.cur)
SCN.cur=S.tar
WIDGET.set(Widgets[S.tar])
collectgarbage() collectgarbage()
--Scene swapped this moment --Scene swapped this moment
end end
@@ -348,6 +353,8 @@ function SCN.swapUpdate()
end end
function SCN.init(s,org) function SCN.init(s,org)
if sceneInit[s]then sceneInit[s](org)end if sceneInit[s]then sceneInit[s](org)end
SCN.cur=s
WIDGET.set(Widgets[s])
end end
function SCN.push(tar,style) function SCN.push(tar,style)
if not SCN.swapping then if not SCN.swapping then
@@ -388,7 +395,7 @@ local swap={
end}, end},
}--Scene swapping animations }--Scene swapping animations
function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
local S=SCN.swap local S=SCN.stat
if not SCN.swapping and tar~=SCN.cur then if not SCN.swapping and tar~=SCN.cur then
SCN.swapping=true SCN.swapping=true
if not style then style="fade"end if not style then style="fade"end
@@ -400,7 +407,7 @@ function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
S.draw=swap[3] S.draw=swap[3]
end end
end end
function SCN.goto(tar,style)--Normal scene swapping, can back function SCN.go(tar,style)--Normal scene swapping, can back
SCN.push()SCN.swapTo(tar,style) SCN.push()SCN.swapTo(tar,style)
end end
function SCN.back() function SCN.back()

View File

@@ -52,6 +52,7 @@ function Tmr.load()
SCN.swapTo("intro","none") SCN.swapTo("intro","none")
end end
end end
loadingFinished=true
return return
end end
S.cur=S.cur+1 S.cur=S.cur+1
@@ -130,7 +131,7 @@ function Tmr.mode(dt)
cam.x1=cam.x1*.85+x*.15 cam.x1=cam.x1*.85+x*.15
cam.y1=cam.y1*.85+y*.15 cam.y1=cam.y1*.85+y*.15
cam.k1=cam.k1*.85+k*.15 cam.k1=cam.k1*.85+k*.15
local _=SCN.swap.tar local _=SCN.stat.tar
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2 cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
if cam.zoomMethod==1 then if cam.zoomMethod==1 then
if cam.sel then if cam.sel then

View File

@@ -91,13 +91,13 @@ function VOC.update()
end end
elseif Q.s==1 then--Waiting load source elseif Q.s==1 then--Waiting load source
Q[1]=getVoice(Q[1]) Q[1]=getVoice(Q[1])
Q[1]:setVolume(setting.voc*.1) Q[1]:setVolume(setting.voc*.01)
Q[1]:play() Q[1]:play()
Q.s=Q[2]and 2 or 4 Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--Playing 1,ready 2 elseif Q.s==2 then--Playing 1,ready 2
if Q[1]:getDuration()-Q[1]:tell()<.08 then if Q[1]:getDuration()-Q[1]:tell()<.08 then
Q[2]=getVoice(Q[2]) Q[2]=getVoice(Q[2])
Q[2]:setVolume(setting.voc*.1) Q[2]:setVolume(setting.voc*.01)
Q[2]:play() Q[2]:play()
Q.s=3 Q.s=3
end end
@@ -121,7 +121,7 @@ function VOC.play(s,chn)
if chn then if chn then
local L=voiceQueue[chn] local L=voiceQueue[chn]
local _=VOC.list[s] local _=VOC.list[s]
if not _ then DBP("no VOC called:"..s)return end if not _ then return end
L[#L+1]=_[rnd(#_)] L[#L+1]=_[rnd(#_)]
L.s=1 L.s=1
--Add to queue[chn] --Add to queue[chn]

View File

@@ -395,7 +395,6 @@ function WIDGET.press(x,y)
W.code() W.code()
W:FX() W:FX()
SFX.play("button") SFX.play("button")
VOC.play("nya")
elseif W.type=="key"then elseif W.type=="key"then
W.code() W.code()
SFX.play("lock") SFX.play("lock")

View File

@@ -98,19 +98,38 @@ newSlider=WIDGET.newSlider
--All widgets --All widgets
local Widgets={ local Widgets={
load={},intro={},quit={}, load={},intro={},quit={},
calculator={
newKey({name="_1", x=300,y=300,w=90,h=90, color="white", font=50,code=pressKey("1")}),
newKey({name="_2", x=400,y=300,w=90,h=90, color="white", font=50,code=pressKey("2")}),
newKey({name="_3", x=500,y=300,w=90,h=90, color="white", font=50,code=pressKey("3")}),
newKey({name="_4", x=300,y=400,w=90,h=90, color="white", font=50,code=pressKey("4")}),
newKey({name="_5", x=400,y=400,w=90,h=90, color="white", font=50,code=pressKey("5")}),
newKey({name="_6", x=500,y=400,w=90,h=90, color="white", font=50,code=pressKey("6")}),
newKey({name="_7", x=300,y=500,w=90,h=90, color="white", font=50,code=pressKey("7")}),
newKey({name="_8", x=400,y=500,w=90,h=90, color="white", font=50,code=pressKey("8")}),
newKey({name="_9", x=500,y=500,w=90,h=90, color="white", font=50,code=pressKey("9")}),
newKey({name="_0", x=300,y=600,w=90,h=90, color="white", font=50,code=pressKey("0")}),
newKey({name="<", x=400,y=600,w=90,h=90, color="lRed", font=50,code=pressKey("backspace")}),
newKey({name="=", x=500,y=600,w=90,h=90, color="lYellow",font=50,code=pressKey("return")}),
newKey({name="+", x=600,y=300,w=90,h=90, color="lBlue", font=50,code=pressKey("+")}),
newKey({name="-", x=600,y=400,w=90,h=90, color="lBlue", font=50,code=pressKey("-")}),
newKey({name="*", x=600,y=500,w=90,h=90, color="lBlue", font=50,code=pressKey("*")}),
newKey({name="/", x=600,y=600,w=90,h=90, color="lBlue", font=50,code=pressKey("/")}),
newButton({name="play", x=800,y=600,w=180,h=90, color="lGreen", font=40,code=pressKey("space"),hide=function()return not sceneTemp.pass end}),
},
main={ main={
newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=function()SCN.goto("mode")end}), newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=function()SCN.go("mode")end}),
newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=function()SCN.goto("setting_game")end}), newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=function()SCN.go("setting_game")end}),
newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=function()SCN.goto("music")end}), newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=function()SCN.go("music")end}),
newButton({name="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=function()SCN.goto("help")end}), newButton({name="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=function()SCN.go("help")end}),
newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=function()SCN.goto("stat")end}), newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=function()SCN.go("stat")end}),
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay,true)end}), newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay,true)end}),
newButton({name="lang", x=150,y=610,w=160,h=100,color="lGreen", font=45,code=function()SCN.goto("setting_lang")end}), newButton({name="lang", x=150,y=610,w=160,h=100,color="lGreen", font=45,code=function()SCN.go("setting_lang")end}),
newButton({name="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}), newButton({name="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
}, },
mode={ mode={
newButton({name="setting", x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function() newButton({name="setting", x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
SCN.goto("custom") SCN.go("custom")
end, end,
hide=function() hide=function()
return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle" return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle"
@@ -219,18 +238,18 @@ local Widgets={
setting_game={ setting_game={
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}), newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound","swipe")end}), newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound","swipe")end}),
newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.goto("setting_control")end}), newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.go("setting_control")end}),
newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.goto("setting_key")end}), newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.go("setting_key")end}),
newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.goto("setting_touch")end}), newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.go("setting_touch")end}),
newSlider({name="reTime", x=350, y=340, w=300,unit=10, font=30,disp=SETval("reTime"), code=SETsto("reTime")}), newSlider({name="reTime", x=350, y=340, w=300,unit=10, font=30,disp=SETval("reTime"), code=SETsto("reTime")}),
newSlider({name="maxNext", x=350, y=440, w=300,unit=6, font=30,disp=SETval("maxNext"), code=SETsto("maxNext")}), newSlider({name="maxNext", x=350, y=440, w=300,unit=6, font=30,disp=SETval("maxNext"), code=SETsto("maxNext")}),
newSwitch({name="autoPause",x=350, y=540, font=20,disp=SETval("autoPause"),code=SETrev("autoPause")}), newButton({name="layout", x=460, y=540, w=140,h=70,color="white", font=35,code=function()
newButton({name="layout", x=590, y=540, w=140,h=70,color="white", font=35,code=function() SCN.go("setting_skin")
SCN.goto("setting_skin")
end}), end}),
newSwitch({name="quickR", x=1050, y=320, font=35,disp=SETval("quickR"), code=SETrev("quickR")}), newSwitch({name="autoPause",x=1080, y=320, font=20,disp=SETval("autoPause"), code=SETrev("autoPause")}),
newSwitch({name="swap", x=1050, y=400, font=20,disp=SETval("swap"), code=SETrev("swap")}), newSwitch({name="swap", x=1080, y=380, font=20,disp=SETval("swap"), code=SETrev("swap")}),
newSwitch({name="fine", x=1050, y=480, font=20,disp=SETval("fine"), code=SETrev("fine")}), newSwitch({name="fine", x=1080, y=440, font=20,disp=SETval("fine"), code=SETrev("fine")}),
newSwitch({name="appLock", x=1080, y=500, font=20,disp=SETval("appLock"), code=SETrev("appLock")}),
newButton({name="back", x=1140, y=650, w=200,h=80,color="white", font=40,code=BACK}), newButton({name="back", x=1140, y=650, w=200,h=80,color="white", font=40,code=BACK}),
}, },
setting_video={ setting_video={
@@ -278,10 +297,10 @@ local Widgets={
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video","swipe")end}), newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
newSlider({name="sfx", x=180, y=200,w=400,unit=100,noUnit=true,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}), newSlider({name="sfx", x=180, y=200,w=400,unit=100,noUnit=true,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
newSlider({name="stereo", x=180, y=500,w=400,unit=10, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}), newSlider({name="stereo", x=180, y=500,w=400,unit=10, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
newSlider({name="spawn", x=180, y=300,w=400,unit=100,noUnit=true,font=30,change=function()SFX.fplay("spawn_1",setting.spawn)end, disp=SETval("spawn"), code=SETsto("spawn")}), newSlider({name="spawn", x=180, y=300,w=400,unit=100,noUnit=true,font=30,change=function()SFX.fplay("spawn_1",setting.spawn)end, disp=SETval("spawn"), code=SETsto("spawn")}),
newSlider({name="bgm", x=180, y=400,w=400,unit=100,noUnit=true,font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}), newSlider({name="bgm", x=180, y=400,w=400,unit=100,noUnit=true,font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}), newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
newSlider({name="voc", x=750, y=300,w=400,unit=10,font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}), newSlider({name="voc", x=750, y=300,w=400,unit=100,noUnit=true,font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}), newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
}, },
setting_control={ setting_control={
@@ -371,7 +390,7 @@ local Widgets={
end}), end}),
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40, newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,
code=function() code=function()
SCN.goto("setting_touchSwitch") SCN.go("setting_touchSwitch")
end}), end}),
newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}), newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}),
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40, newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,
@@ -417,7 +436,7 @@ local Widgets={
newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}), newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}),
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32, newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,
code=function() code=function()
SCN.goto("setting_trackSetting") SCN.go("setting_trackSetting")
end, end,
hide=function() hide=function()
return not setting.VKTrack return not setting.VKTrack
@@ -440,8 +459,8 @@ local Widgets={
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}), newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
}, },
help={ help={
newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("staff")end}), newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.go("staff")end}),
newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("history")end}), newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.go("history")end}),
newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}), newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}), newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
}, },
@@ -458,27 +477,7 @@ local Widgets={
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}), newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
}, },
debug={ debug={
newButton({name="killWTM", x=340,y=200,w=260,h=100,color="white",font=35, newButton({name="reset", x=640,y=200,w=260,h=100,color="yellow",font=40,
code=function()
marking=nil
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
SFX.play("clear")
end,
hide=function()
return not marking
end}),
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,
code=function()
for name,M in next,Modes do
if not modeRanks[name]then
modeRanks[name]=M.score and 0 or 6
end
end
FILE.saveUnlock()
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
SFX.play("clear_2")
end}),
newButton({name="reset", x=940,y=200,w=260,h=100,color="yellow",font=40,
code=function() code=function()
sceneTemp.reset=true sceneTemp.reset=true
end, end,

View File

@@ -1,4 +1,4 @@
gameVersion="Alpha V0.10.2" gameVersion="Alpha V0.10.4"
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Saving folder t.identity="Techmino"--Saving folder
t.version="11.1" t.version="11.1"

View File

@@ -1,11 +1,11 @@
--[[ --[[
______ __ _ ______ __ _
/_ __/___ _____ / /_ ____ ___ (_)____ ____ /_ __/___ _____ / /_ ____ ___ (_)____ ____
/ / / _ \ / ___// __ \ / __ `__ \ / // __ \ / __ \ / / / _ \ / ___// __ \ / __ `__ \ / // __ \ / __ \
/ / / __// /__ / / / // / / / / // // / / // /_/ / / / / __// /__ / / / // / / / / // // / / // /_/ /
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/ /_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
Techmino is my first "huge project" Techmino is my first "huge project"
optimization is welcomed if you also love tetromino game optimization is welcomed if you also love tetromino game
]]-- ]]--
--? --?
@@ -19,7 +19,6 @@ love.keyboard.setTextInput(false)
love.mouse.setVisible(false) love.mouse.setVisible(false)
system=love.system.getOS() system=love.system.getOS()
game={}
mapCam={ mapCam={
sel=nil,--Selected mode ID sel=nil,--Selected mode ID
@@ -34,15 +33,15 @@ mapCam={
zoomMethod=nil, zoomMethod=nil,
zoomK=nil, zoomK=nil,
} }
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--wid,hei,radius,scale K scr={x=0,y=0,w=0,h=0,W=0,H=0,rad=0,k=1}--wid,hei,radius,scale K
customSel={1,22,1,1,7,3,1,1,8,4,1,1,1} customSel={1,22,1,1,7,3,1,1,8,4,1,1,1}
preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
preBag={} preBag={}
game={ game={
frame=0, --Frame count frame=0, --Frame count
result=0, --Game result result=false, --Game result (string)
pauseTime=0, --Time paused pauseTime=0, --Time paused
pauseCount=0, --Pausing count pauseCount=0, --Pausing count
garbageSpeed=1, --Garbage timing speed garbageSpeed=1, --Garbage timing speed
@@ -50,7 +49,16 @@ game={
warnLVL=0, --Warning level (show) warnLVL=0, --Warning level (show)
recording=false, --If recording recording=false, --If recording
replaying=false, --If replaying replaying=false, --If replaying
rec={}, --Recording list, key-time seed=math.random(999999999),--Game seed
setting={}, --Game settings
rec={}, --Recording list, key,time,key,time...
--Data for royale mode
stage=nil, --Game stage
mostBadge=nil, --Most badge owner
secBadge=nil, --Second badge owner
mostDangerous=nil, --Most dangerous player
secDangerous=nil, --Second dangerous player
}--Global game data }--Global game data
players={alive={}}--Players data players={alive={}}--Players data
curMode=nil--Current mode object curMode=nil--Current mode object
@@ -121,12 +129,12 @@ end
--Update data file --Update data file
S=stat S=stat
if S.version=="Alpha V0.9.1"or type(setting.spawn)~="number"then if type(setting.spawn)~="number"then
setting.spawn=0 setting.spawn=0
end end
if S.version~=gameVersion then if S.version~=gameVersion then
S.version=gameVersion S.version=gameVersion
TEXT.show(text.newBigVersion,640,200,30,"fly",.3) TEXT.show(text.newVersion,640,200,30,"fly",.3)
newVersionLaunch=true newVersionLaunch=true
fs.remove("sprintPenta.dat") fs.remove("sprintPenta.dat")

View File

@@ -4,7 +4,7 @@ return{
color=color.magenta, color=color.magenta,
env={ env={
drop=15,lock=45, drop=15,lock=45,
fall=10,lock=60, fall=10,
center=false, center=false,
visible="none", visible="none",
dropPiece=PLY.reach_winCheck, dropPiece=PLY.reach_winCheck,

View File

@@ -7,7 +7,6 @@ return{
freshLimit=10, freshLimit=10,
visible="fast", visible="fast",
dropPiece=PLY.reach_winCheck, dropPiece=PLY.reach_winCheck,
freshLimit=10,
target=200, target=200,
bg="glow",bgm="reason", bg="glow",bgm="reason",
}, },

View File

@@ -1,4 +1,4 @@
local min=math.random,math.min local min=math.min
local function check_c4w(P) local function check_c4w(P)
for i=1,#P.clearedRow do for i=1,#P.clearedRow do
P.field[#P.field+1]=freeRow.get(13) P.field[#P.field+1]=freeRow.get(13)
@@ -59,7 +59,7 @@ return{
if L==100 then if L==100 then
local T=P.stat.time local T=P.stat.time
return return
T<=36 and 5 or T<=40 and 5 or
T<=60 and 4 or T<=60 and 4 or
3 3
else else

View File

@@ -31,7 +31,11 @@ return{
end end
modeEnv._20G=modeEnv.drop==0 modeEnv._20G=modeEnv.drop==0
modeEnv.oncehold=customSel[6]==1 modeEnv.oncehold=customSel[6]==1
if preBag[1]then modeEnv.bag=preBag end if preBag[1]then
modeEnv.bag=preBag
else
modeEnv.bag=nil
end
modeEnv.target=0 modeEnv.target=0
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local L=modeEnv.opponent local L=modeEnv.opponent

View File

@@ -18,8 +18,9 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local P=players[1]
for _=1,8 do for _=1,8 do
players[1]:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)

View File

@@ -17,7 +17,6 @@ return{
color=color.green, color=color.green,
env={ env={
noFly=true, noFly=true,
minsdarr=1,
wait=8,fall=20, wait=8,fall=20,
target=10,dropPiece=check_LVup, target=10,dropPiece=check_LVup,
mindas=7,minarr=1,minsdarr=1, mindas=7,minarr=1,minsdarr=1,

View File

@@ -3,12 +3,14 @@ setting={
das=10,arr=2, das=10,arr=2,
sddas=0,sdarr=2, sddas=0,sdarr=2,
ihs=true,irs=true,ims=true, ihs=true,irs=true,ims=true,
reTime=4,
maxNext=6, maxNext=6,
autoPause=true,
quickR=true,
swap=true, swap=true,
--System
reTime=4,
autoPause=true,
fine=false, fine=false,
appLock=false,
lang=1, lang=1,
skinSet=1, skinSet=1,
skin={1,5,8,2,10,3,7,1,5,1,5,8,2,10,3,7,10,7,8,2,8,2,1,5,3}, skin={1,5,8,2,10,3,7,1,5,1,5,8,2,10,3,7,10,7,8,2,8,2,1,5,3},

View File

@@ -263,11 +263,13 @@ function pauseGame()
if not game.result then if not game.result then
game.pauseCount=game.pauseCount+1 game.pauseCount=game.pauseCount+1
end end
for i=1,#players do if not game.replaying then
local l=players[i].keyPressing for i=1,#players do
for j=1,#l do local l=players[i].keyPressing
if l[j]then for j=1,#l do
players[i]:releaseKey(j) if l[j]then
players[i]:releaseKey(j)
end
end end
end end
end end
@@ -308,7 +310,6 @@ function resetGameData()
destroyPlayers() destroyPlayers()
modeEnv=curMode.env modeEnv=curMode.env
math.randomseed(game.seed)
curMode.load()--BG/BGM need redefine in custom,so up here curMode.load()--BG/BGM need redefine in custom,so up here
if modeEnv.task then if modeEnv.task then
for i=1,#players do for i=1,#players do
@@ -361,7 +362,6 @@ function resetPartGameData(replaying)
destroyPlayers() destroyPlayers()
modeEnv=curMode.env modeEnv=curMode.env
math.randomseed(game.seed)
curMode.load() curMode.load()
if modeEnv.task then if modeEnv.task then
for i=1,#players do for i=1,#players do
@@ -386,8 +386,8 @@ function gameStart()
SFX.play("start") SFX.play("start")
for P=1,#players do for P=1,#players do
P=players[P] P=players[P]
P:popNext()
P.timing=true
P.control=true P.control=true
P.timing=true
P:popNext()
end end
end end

View File

@@ -15,7 +15,6 @@ if setting.lang==1 or setting.lang==2 then
"O spin Triple!", "O spin Triple!",
"nullpomino也很好玩!", "nullpomino也很好玩!",
"Naki 可爱!", "Naki 可爱!",
"Miya:喵!",
"Miya 可爱!", "Miya 可爱!",
"Lua天下第一", "Lua天下第一",
"LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF",
@@ -29,7 +28,6 @@ if setting.lang==1 or setting.lang==2 then
"DT炮=TSD+TST炮", "DT炮=TSD+TST炮",
"Cultris II也很好玩!", "Cultris II也很好玩!",
"COOL!!", "COOL!!",
"CLASSIC SEXY RUSSIAN BLOCKS",
"BT炮=beta炮", "BT炮=beta炮",
"B2B2B2B存在吗?", "B2B2B2B存在吗?",
"B2B2B???", "B2B2B???",
@@ -39,7 +37,8 @@ if setting.lang==1 or setting.lang==2 then
"有疑问? 先看设置有没有你想要的", "有疑问? 先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~", "有建议的话可以把信息反馈给作者~",
"学会使用两个旋转键, 三个更好", "学会使用两个旋转键, 三个更好",
"享受特色旋转系统!", "新人请千万记住,打好基础,不要太早学那些花里胡哨的",
"享受Tech的特色旋转系统!",
"无聊翻翻设置是好习惯", "无聊翻翻设置是好习惯",
"我的世界好玩!", "我的世界好玩!",
"提前旋转等设置可以用来救命", "提前旋转等设置可以用来救命",
@@ -49,9 +48,11 @@ if setting.lang==1 or setting.lang==2 then
"少女祈祷中", "少女祈祷中",
"扫雷好玩!", "扫雷好玩!",
"哦,我的上帝", "哦,我的上帝",
"你可以长按R键重新开始游戏(也不是很长)",
"你可以从统计页面打开游戏存档目录", "你可以从统计页面打开游戏存档目录",
"你好 世界!", "你好 世界!",
"魔方好玩!", "魔方好玩!",
"喵!",
"免费吃鸡方块", "免费吃鸡方块",
"秘密数字:626", "秘密数字:626",
"每个虚拟按键都可以隐藏/显示", "每个虚拟按键都可以隐藏/显示",
@@ -60,6 +61,8 @@ if setting.lang==1 or setting.lang==2 then
"没学过编曲,音乐都是自己凭感觉写的,觉得不好听就设置里关了吧", "没学过编曲,音乐都是自己凭感觉写的,觉得不好听就设置里关了吧",
"联网还没做呢, 别急", "联网还没做呢, 别急",
"键位是可以自定义的", "键位是可以自定义的",
"健康小贴士:上厕所太用力容易脑出血(尤其是老年人!)",
"健康小贴士:不要熬夜,真的容易猝死",
"合群了就会消失, 但是消失不代表没有意义", "合群了就会消失, 但是消失不代表没有意义",
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)", "更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
"俄罗斯方块环游记也不错!", "俄罗斯方块环游记也不错!",
@@ -68,7 +71,6 @@ if setting.lang==1 or setting.lang==2 then
"戴上耳机以获得最佳体验", "戴上耳机以获得最佳体验",
"大满贯10连击消四全清!", "大满贯10连击消四全清!",
"打好块没有捷径,多练", "打好块没有捷径,多练",
"车车人在此",
"茶娘 可爱!", "茶娘 可爱!",
"草(日本语)", "草(日本语)",
"不要在上课时玩游戏!", "不要在上课时玩游戏!",
@@ -90,6 +92,7 @@ if setting.lang==1 or setting.lang==2 then
"2.7182818284590452353", "2.7182818284590452353",
"15puzzle好玩!", "15puzzle好玩!",
"11renPC!", "11renPC!",
"100行内23PC来一个?",
"1, 2, 9!!!!!", "1, 2, 9!!!!!",
"<方块研究所>有一个Nspire-CX版本!", "<方块研究所>有一个Nspire-CX版本!",
"↑↑↓↓←→←→BABA", "↑↑↓↓←→←→BABA",
@@ -111,8 +114,8 @@ elseif setting.lang==3 then
"This in not a casual game", "This in not a casual game",
"This game can be very hard,be mentally perpared", "This game can be very hard,be mentally perpared",
"Tetris journey has network battle!", "Tetris journey has network battle!",
"Terraria is fun!",
"Tetralegends is fun!", "Tetralegends is fun!",
"Terraria is fun!",
"Techmino=Technique+Tetromino", "Techmino=Technique+Tetromino",
"Techmino is so fun!", "Techmino is so fun!",
"Techmino has a Nspire-CX edition!", "Techmino has a Nspire-CX edition!",
@@ -140,6 +143,7 @@ elseif setting.lang==3 then
"l-=-1", "l-=-1",
"Is B2B2B2B possible?", "Is B2B2B2B possible?",
"Initial Rotation etc. can save your life", "Initial Rotation etc. can save your life",
"Hold R key to restart game",
"Hello world!", "Hello world!",
"Headphones for better experience", "Headphones for better experience",
"Have you noticed what does \"rotating\" do to block?", "Have you noticed what does \"rotating\" do to block?",
@@ -154,8 +158,7 @@ elseif setting.lang==3 then
"Disappearing doesn't mean useless", "Disappearing doesn't mean useless",
"Diao so bully", "Diao so bully",
"COOL!!", "COOL!!",
"CLASSIC SEXY RUSSIAN BLOCKS", "BT cannon=beta cannon",
"BT cannon=beta",
"Back to Back 10 combo Techrash PC!", "Back to Back 10 combo Techrash PC!",
"B2B2B???", "B2B2B???",
"Any suggestions to author!", "Any suggestions to author!",
@@ -163,9 +166,9 @@ elseif setting.lang==3 then
"Also try VVVVVV!", "Also try VVVVVV!",
"Also try Tetr.js!", "Also try Tetr.js!",
"Also try Tetr.io!", "Also try Tetr.io!",
"Also try Nullpomino!",
"Also try Jstris!", "Also try Jstris!",
"Also try Cultris II!", "Also try Cultris II!",
"Also try Nullpomino!",
"ALLSPIN!", "ALLSPIN!",
"少女祈禱中", "少女祈禱中",
"40L WR: 15.654s", "40L WR: 15.654s",
@@ -196,32 +199,33 @@ elseif setting.lang==5 then
local R=math.random() local R=math.random()
if R<.05 then if R<.05 then
local time={ local time={
"大半夜的在这干啥呢?不睡觉是会猝死的", --[[00]]"大半夜的在这干啥呢?不睡觉是会猝死的",
"大半夜的在这干啥呢?不睡觉是会猝死的", --[[01]]"大半夜的在这干啥呢?不睡觉是会猝死的",
"现在打块你是认真的?", --[[02]]"现在打块你是认真的?",
"现在打块你是认真的?", --[[03]]"现在打块你是认真的?",
"早起是好的,但是你不应该打块", --[[04]]"早起是好的,但是你不应该打块",
"早起是好的,但是你不应该打块", --[[05]]"早起是好的,但是你不应该打块",
"早饭吃好了?", --[[06]]"早饭吃好了?",
"早饭吃好了?", --[[07]]"早饭吃好了?",
"九点多了,没自己的事情要做?", --[[08]]"九点多了,没自己的事情要做?",
"十点多了,没自己的事情要做?", --[[09]]"十点多了,没自己的事情要做?",
"十一点多了,午饭有的吃么", --[[10]]"十一点多了,午饭有的吃么",
"十二点多了,午饭有的吃么", --[[11]]"十二点多了,午饭有的吃么",
"累了累了,现在不想说你", --[[12]]"累了累了,现在不想说你",
"累了累了,现在不想说你", --[[13]]"累了累了,现在不想说你",
"累了累了,现在不想说你", --[[14]]"累了累了,现在不想说你",
"累了累了,现在不想说你", --[[15]]"累了累了,现在不想说你",
"累了累了,现在不想说你", --[[16]]"累了累了,现在不想说你",
"晚饭吃好了?", --[[17]]"晚饭吃好了?",
"晚饭吃好了?", --[[18]]"晚饭吃好了?",
"累了累了,现在不想说你", --[[19]]"累了累了,现在不想说你",
"累了累了,现在不想说你", --[[20]]"累了累了,现在不想说你",
"好睡了,作息健康活得久", --[[21]]"好睡了,作息健康活得久",
"大半夜的在这干啥呢?不睡觉是会猝死的", --[[22]]"好睡了,作息健康活得久",
--[[23]]"大半夜的在这干啥呢?不睡觉是会猝死的",
} }
return time[os.date("%H")] return time[tonumber(os.date("%H"))+1]
elseif true or R<.1 then elseif R<.1 then
local int=math.floor local int=math.floor
L={ L={
"平均"..int(stat.row/stat.time*60).."LPM,那可真强呢", "平均"..int(stat.row/stat.time*60).."LPM,那可真强呢",
@@ -241,8 +245,10 @@ elseif setting.lang==5 then
"我一个滑铲就挖了个11renPC", "我一个滑铲就挖了个11renPC",
"我曾经在极度愤怒的时候15秒消了40行", "我曾经在极度愤怒的时候15秒消了40行",
"天天F3F3,怕别人不知道你菜?", "天天F3F3,怕别人不知道你菜?",
"天天卖弱,你一定把把150apm吧?",
"天天催更催更,你咋不来帮忙开发啊,真以为作者很强催催啥都有?", "天天催更催更,你咋不来帮忙开发啊,真以为作者很强催催啥都有?",
"设置都看过一遍了吗?明明都能调还嫌这嫌那,可牛逼了您", "设置都看过一遍了吗?明明都能调还嫌这嫌那,可牛逼了您",
"少玩点,多眨眼,到时候瞎了别怪我没提醒你",
"人只用一只手都能玩,你呢?", "人只用一只手都能玩,你呢?",
"没那水平别天天整什么花里胡哨的,人玩几年你想几天赶上?", "没那水平别天天整什么花里胡哨的,人玩几年你想几天赶上?",
"满口PCDT信天翁,还会点别的么?", "满口PCDT信天翁,还会点别的么?",
@@ -251,6 +257,7 @@ elseif setting.lang==5 then
"还搁这玩手机呢,作业做完了?", "还搁这玩手机呢,作业做完了?",
"除了雨宫太阳你还认识谁?Jonas知道吗?Ajanba听过吗?", "除了雨宫太阳你还认识谁?Jonas知道吗?Ajanba听过吗?",
"不会吧不会吧,真的还有人不能随手Tspin?", "不会吧不会吧,真的还有人不能随手Tspin?",
"别会个c4w就以为自己多强,这是基本功罢了",
"60lpm?拍硬降刷的吧", "60lpm?拍硬降刷的吧",
"4pps不是人均水平?", "4pps不是人均水平?",
"40行还要40多秒,就这?", "40行还要40多秒,就这?",
@@ -258,8 +265,8 @@ elseif setting.lang==5 then
"20连pc不是随手?", "20连pc不是随手?",
"100apm?定式刷的吧", "100apm?定式刷的吧",
"0202年了,还在玩这种小孩子玩的游戏?", "0202年了,还在玩这种小孩子玩的游戏?",
"天天卖弱,你一定把把150apm吧?", "极限20G?那不是随手通",
"别会个c4w就以为自己多强,这是基本功罢了", "全隐40行全消四很难吗??",
} }
end end
end end

View File

@@ -114,7 +114,6 @@ local TRS={
},--T },--T
function(P,d) function(P,d)
if P.human then SFX.fieldPlay("rotate",nil,P)end if P.human then SFX.fieldPlay("rotate",nil,P)end
P:freshLockDelay()
if not P.gameEnv.ospin then return end if not P.gameEnv.ospin then return end
local x,y=P.curX,P.curY local x,y=P.curX,P.curY
if y==P.imgY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then if y==P.imgY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
@@ -136,7 +135,7 @@ local TRS={
P.dir,P.sc=dir,scs[id][dir] P.dir,P.sc=dir,scs[id][dir]
P.spinLast=2 P.spinLast=2
P.stat.rotate=P.stat.rotate+1 P.stat.rotate=P.stat.rotate+1
P:freshgho() P:freshBlock(false,true)
P.spinSeq=0 P.spinSeq=0
SFX.fieldPlay("rotatekick",nil,P) SFX.fieldPlay("rotatekick",nil,P)
return return
@@ -146,6 +145,7 @@ local TRS={
else else
P.spinSeq=0 P.spinSeq=0
end end
P:freshBlock(true,true)
end,--O end,--O
{ {
[01]={{ 0, 1},{ 1, 0},{-2, 0},{-2,-1},{ 1, 2}}, [01]={{ 0, 1},{ 1, 0},{-2, 0},{-2,-1},{ 1, 2}},
@@ -256,18 +256,18 @@ local TRS={
},--W },--W
function(P,d) function(P,d)
if P.human then SFX.fieldPlay("rotate",nil,P)end if P.human then SFX.fieldPlay("rotate",nil,P)end
P:freshLockDelay()
local iki=XspinList[d] local iki=XspinList[d]
for test=1,#iki do for test=1,#iki do
local x,y=P.curX+iki[test][1],P.curY+iki[test][2] local x,y=P.curX+iki[test][1],P.curY+iki[test][2]
if not P:ifoverlap(P.cur.bk,x,y)then if not P:ifoverlap(P.cur.bk,x,y)then
P.curX,P.curY=x,y P.curX,P.curY=x,y
P.spinLast=1 P.spinLast=1
P:freshgho() P:freshBlock(false,true)
P.stat.rotate=P.stat.rotate+1 P.stat.rotate=P.stat.rotate+1
return return
end end
end end
P:freshBlock(true,true)
end,--X end,--X
{ {
[01]={{-1, 0},{-1, 1},{ 0,-3},{-1, 1},{-1, 2},{ 0, 1}}, [01]={{-1, 0},{-1, 1},{ 0,-3},{-1, 1},{-1, 2},{ 0, 1}},

View File

@@ -5,13 +5,15 @@ local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.ma
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local format=string.format local format=string.format
local scr=scr--Screen camera local scr=scr--Screen camera
local setFont=setFont
--------------------------<GameData>-------------------------- --------------------------<GameData>--------------------------
local gameEnv0={ local gameEnv0={
noFly=false, noFly=false,
das=10,arr=2, das=10,arr=2,
sddas=2,sdarr=2, sddas=2,sdarr=2,
ihs=true,irs=true,ims=true, ihs=true,irs=true,ims=true,
quickR=true,swap=true, swap=true,
ghost=true,center=true, ghost=true,center=true,
smooth=false,grid=false, smooth=false,grid=false,
bagLine=false, bagLine=false,
@@ -435,7 +437,7 @@ local function Pupdate_alive(P,dt)
P.curY=P.imgY P.curY=P.imgY
end end
end end
P:freshMinY() P:freshBlock(true,true)
P.spinLast=false P.spinLast=false
if P.imgY~=P.curY then if P.imgY~=P.curY then
@@ -688,9 +690,9 @@ local function Pdraw_norm(P)
if P.lockDelay>=0 then if P.lockDelay>=0 then
gc.rectangle("fill",0,602,300*P.lockDelay/P.gameEnv.lock,6)--Lock delay indicator gc.rectangle("fill",0,602,300*P.lockDelay/P.gameEnv.lock,6)--Lock delay indicator
end end
_=10 _=3
for i=1,min(P.gameEnv.freshLimit-P.freshTime,15)do for i=1,min(P.gameEnv.freshLimit-P.freshTime,15)do
gc.circle("fill",_,615,5) gc.rectangle("fill",_,615,14,5)
_=_+20 _=_+20
end end
@@ -809,6 +811,12 @@ local function Pdraw_norm(P)
mStr(format("%.2f",P.stat.time),-81,518)--Time mStr(format("%.2f",P.stat.time),-81,518)--Time
mStr(P.score1,-81,560)--Score mStr(P.score1,-81,560)--Score
--Display Ys
-- gc.setLineWidth(6)
-- if P.curY then gc.setColor(1,.4,0,.626)gc.line(0,611-P.curY*30,300,611-P.curY*30)end
-- if P.imgY then gc.setColor(0,1,.4,.626)gc.line(0,615-P.imgY*30,300,615-P.imgY*30)end
-- if P.minY then gc.setColor(0,.4,1,.626)gc.line(0,619-P.minY*30,300,619-P.minY*30)end
--Other messages --Other messages
gc.setColor(1,1,1) gc.setColor(1,1,1)
curMode.mesDisp(P) curMode.mesDisp(P)
@@ -1136,7 +1144,7 @@ function player.finesseError(P,rate)
SFX.play("finesseError_long",.6) SFX.play("finesseError_long",.6)
P:lose() P:lose()
elseif setting.fine then elseif setting.fine then
SFX.play("finesseError",.3) SFX.play("finesseError",.8)
end end
elseif P.gameEnv.fineKill then elseif P.gameEnv.fineKill then
P:lose() P:lose()
@@ -1197,9 +1205,11 @@ function player.garbageRise(P,color,amount,pos)
P.field[1][pos]=0 P.field[1][pos]=0
end end
P.fieldBeneath=P.fieldBeneath+amount*30 P.fieldBeneath=P.fieldBeneath+amount*30
P.curY=P.curY+amount if P.cur then
P.curY=P.curY+amount
P.imgY=P.imgY+amount
end
P.garbageBeneath=P.garbageBeneath+amount P.garbageBeneath=P.garbageBeneath+amount
P.imgY=P.imgY+amount
for i=1,#P.clearingRow do for i=1,#P.clearingRow do
P.clearingRow[i]=P.clearingRow[i]+amount P.clearingRow[i]=P.clearingRow[i]+amount
end end
@@ -1234,7 +1244,7 @@ function player.pushLine(P,L,mir)
P.fieldBeneath=P.fieldBeneath+120 P.fieldBeneath=P.fieldBeneath+120
P.curY=P.curY+#L P.curY=P.curY+#L
P.imgY=P.imgY+#L P.imgY=P.imgY+#L
P:freshgho() P:freshBlock(true,false)
end end
function player.pushNext(P,L,mir) function player.pushNext(P,L,mir)
for i=1,#L do for i=1,#L do
@@ -1289,59 +1299,64 @@ function player.changeAtk(P,R)
P.atking=nil P.atking=nil
end end
end end
function player.freshgho(P) function player.freshBlock(P,keepGhost,control,system)
if not P.cur then return end if not keepGhost and P.cur then
P.imgY=min(#P.field+1,P.curY) P.imgY=min(#P.field+1,P.curY)
if P.gameEnv._20G or P.keyPressing[7]and P.gameEnv.sdarr==0 then
local _=P.imgY
if P.gameEnv._20G or P.keyPressing[7]and P.gameEnv.sdarr==0 then --Move ghost to bottom
local _=P.imgY while not P:ifoverlap(P.cur.bk,P.curX,P.imgY-1)do
P.imgY=P.imgY-1
--Move ghost to bottom
while not P:ifoverlap(P.cur.bk,P.curX,P.imgY-1)do
P.imgY=P.imgY-1
end
--Cancel spinLast
if _~=P.imgY then
P.spinLast=false
end
--Create FX if dropped
if P.curY>P.imgY then
if P.gameEnv.dropFX then
P:createDropFX(P.curX,P.curY+1,P.curX+P.c-1,P.imgY+P.r-1)
end end
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.5 --Cancel spinLast
if _~=P.imgY then
P.spinLast=false
end
--Create FX if dropped
if P.curY>P.imgY then
if P.gameEnv.dropFX then
P:createDropFX(P.curX,P.curY+1,P.curX+P.c-1,P.imgY+P.r-1)
end
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.5
end
P.curY=P.imgY
end
else
while not P:ifoverlap(P.cur.bk,P.curX,P.imgY-1)do
P.imgY=P.imgY-1
end end
P.curY=P.imgY
end end
else
while not P:ifoverlap(P.cur.bk,P.curX,P.imgY-1)do
P.imgY=P.imgY-1
end
end
end
function player.freshLockDelay(P)
--Return when fall-fresh but no fall
if not P.gameEnv.easyFresh and P.curY>=P.minY then
return
end end
local d,d0=P.lockDelay,P.gameEnv.lock if control then
if d<d0 and(P.freshTime<P.gameEnv.freshLimit or P.curY<P.minY)then if P.gameEnv.easyFresh then
if P.lockDelay<P.gameEnv.lock then local d,d0=P.lockDelay,P.gameEnv.lock
P.dropDelay=P.gameEnv.drop if d<d0 and P.freshTime<P.gameEnv.freshLimit then
if not system then
P.freshTime=P.freshTime+1
end
P.lockDelay=min(d+d0*.6,d0)
P.dropDelay=P.gameEnv.drop
end
if P.curY<P.minY then
P.minY=P.curY
P.dropDelay=P.gameEnv.drop
P.lockDelay=P.gameEnv.lock
end
else
if P.curY<P.minY then
P.minY=P.curY
if P.lockDelay<P.gameEnv.lock and P.freshTime<P.gameEnv.freshLimit then
P.freshTime=P.freshTime+1
P.dropDelay=P.gameEnv.drop
P.lockDelay=P.gameEnv.lock
end
end
end end
P.freshTime=P.freshTime+1
P.lockDelay=min(d+d0*.6,d0)
end
end
function player.freshMinY(P)
if P.curY<P.minY then
P.freshTime=max(P.freshTime-1,0)
P.minY=P.curY
P.lockDelay=P.gameEnv.lock
end end
end end
function player.lock(P) function player.lock(P)
@@ -1366,7 +1381,9 @@ function player.spin(P,d,ifpre)
local ix,iy=P.curX+P.sc[2]-isc[2],P.curY+P.sc[1]-isc[1] local ix,iy=P.curX+P.sc[2]-isc[2],P.curY+P.sc[1]-isc[1]
iki=iki[P.dir*10+idir] iki=iki[P.dir*10+idir]
if not iki then if not iki then
if P.gameEnv.easyFresh then P:freshLockDelay()end if P.gameEnv.easyFresh then
P:freshBlock(false,true)
end
SFX.fieldPlay(ifpre and"prerotate"or "rotate",nil,P) SFX.fieldPlay(ifpre and"prerotate"or "rotate",nil,P)
return return
end end
@@ -1381,10 +1398,10 @@ function player.spin(P,d,ifpre)
P.sc,P.cur.bk=scs[P.cur.id][idir],icb P.sc,P.cur.bk=scs[P.cur.id][idir],icb
P.r,P.c=ir,ic P.r,P.c=ir,ic
P.spinLast=test==2 and 0 or 1 P.spinLast=test==2 and 0 or 1
if not ifpre then P:freshgho()end if not ifpre then
P:freshLockDelay() P:freshBlock(false,true)
P:freshMinY() end
if iki[test][2]>0 then if iki[test][2]>0 and not P.gameEnv.easyFresh then
P.freshTime=P.freshTime+1 P.freshTime=P.freshTime+1
end end
@@ -1483,8 +1500,10 @@ function player.hold(P,ifpre)
end end
if C then if C then
P:resetBlock() P:resetBlock()
P:freshgho() P:freshBlock(false,true)
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,max(P.freshTime-5,0) P.dropDelay=P.gameEnv.drop
P.lockDelay=P.gameEnv.lock
P.freshTime=max(P.freshTime-5,0)
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end
end end
@@ -1515,7 +1534,7 @@ function player.popNext(P)--Pop next queue to hand
BOT.addNext(P.AI_bot,CCblockID[next.id]) BOT.addNext(P.AI_bot,CCblockID[next.id])
end end
end end
local _=P.keyPressing local _=P.keyPressing
--IHS --IHS
if _[8]and P.gameEnv.hold and P.gameEnv.ihs then if _[8]and P.gameEnv.hold and P.gameEnv.ihs then
@@ -1525,15 +1544,23 @@ function player.popNext(P)--Pop next queue to hand
P:resetBlock() P:resetBlock()
end end
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,0 P.dropDelay=P.gameEnv.drop
P.lockDelay=P.gameEnv.lock
P.freshTime=0
if P.cur then if P.cur then
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end if P:ifoverlap(P.cur.bk,P.curX,P.curY)then
P:freshgho() P:lock()
P:lose()
end
P:freshBlock(false,true,true)
end end
--IHdS --IHdS
if _[6]then P.act.hardDrop(P)_[6]=false end if _[6]then
P.act.hardDrop(P)
_[6]=false
end
end end
end end
@@ -1938,7 +1965,7 @@ function player.drop(P)--Place piece
if P.dropSpeed>60 then if P.dropSpeed>60 then
dropScore=dropScore*P.dropSpeed/60 dropScore=dropScore*P.dropSpeed/60
elseif P.dropSpeed>120 then elseif P.dropSpeed>120 then
dropScore=dropScore*1,2*P.dropSpeed/120 dropScore=dropScore*1.2*P.dropSpeed/120
elseif P.dropSpeed>180 then elseif P.dropSpeed>180 then
dropScore=dropScore*1.5*P.dropSpeed/180 dropScore=dropScore*1.5*P.dropSpeed/180
end end
@@ -2029,6 +2056,7 @@ end
--------------------------<Events>-------------------------- --------------------------<Events>--------------------------
local function gameOver()--Save record local function gameOver()--Save record
if game.replaying then return end
FILE.saveData() FILE.saveData()
local M=curMode local M=curMode
local R=M.getRank local R=M.getRank
@@ -2233,8 +2261,7 @@ function player.act.moveLeft(P,auto)
elseif P.control and P.waiting==-1 then elseif P.control and P.waiting==-1 then
if P.cur and not P:ifoverlap(P.cur.bk,P.curX-1,P.curY)then if P.cur and not P:ifoverlap(P.cur.bk,P.curX-1,P.curY)then
P.curX=P.curX-1 P.curX=P.curX-1
P:freshgho() P:freshBlock(false,true)
P:freshLockDelay()
if P.human and P.curY==P.imgY then SFX.play("move")end if P.human and P.curY==P.imgY then SFX.play("move")end
if not auto then P.moving=0 end if not auto then P.moving=0 end
P.spinLast=false P.spinLast=false
@@ -2258,8 +2285,7 @@ function player.act.moveRight(P,auto)
elseif P.control and P.waiting==-1 then elseif P.control and P.waiting==-1 then
if P.cur and not P:ifoverlap(P.cur.bk,P.curX+1,P.curY)then if P.cur and not P:ifoverlap(P.cur.bk,P.curX+1,P.curY)then
P.curX=P.curX+1 P.curX=P.curX+1
P:freshgho() P:freshBlock(false,true)
P:freshLockDelay()
if P.human and P.curY==P.imgY then SFX.play("move")end if P.human and P.curY==P.imgY then SFX.play("move")end
if not auto then P.moving=0 end if not auto then P.moving=0 end
P.spinLast=false P.spinLast=false
@@ -2297,7 +2323,7 @@ function player.act.hardDrop(P)
P:changeAtkMode(3) P:changeAtkMode(3)
end end
P.keyPressing[6]=false P.keyPressing[6]=false
elseif P.control and P.waiting==-1 and P.cur then elseif P.control and P.waiting<=0 and P.cur then
if P.curY~=P.imgY then if P.curY~=P.imgY then
if P.gameEnv.dropFX then if P.gameEnv.dropFX then
P:createDropFX(P.curX,P.curY+1,P.curX+P.c-1,P.imgY+P.r-1) P:createDropFX(P.curX,P.curY+1,P.curX+P.c-1,P.imgY+P.r-1)
@@ -2327,7 +2353,7 @@ function player.act.softDrop(P)
if P.control and P.waiting==-1 and P.cur then if P.control and P.waiting==-1 and P.cur then
if P.curY~=P.imgY then if P.curY~=P.imgY then
P.curY=P.curY-1 P.curY=P.curY-1
P:freshMinY() P:freshBlock(true,true)
P.spinLast=false P.spinLast=false
end end
end end
@@ -2342,7 +2368,7 @@ function player.act.func(P)
P.gameEnv.Fkey(P) P.gameEnv.Fkey(P)
end end
function player.act.restart(P) function player.act.restart(P)
if P.gameEnv.quickR or game.frame<180 then if game.frame<240 or game.result then
TASK.removeTask_code(TICK.autoPause) TASK.removeTask_code(TICK.autoPause)
resetPartGameData() resetPartGameData()
end end
@@ -2355,10 +2381,9 @@ function player.act.insLeft(P,auto)
if P.gameEnv.dropFX then if P.gameEnv.dropFX then
P:createDropFX(P.curX+P.c,P.curY+P.r-1,P.curX+P.c,P.curY) P:createDropFX(P.curX+P.c,P.curY+P.r-1,P.curX+P.c,P.curY)
end end
P:freshgho() P:freshBlock(false,true)
end end
if P.curX~=x0 then if P.curX~=x0 then
P:freshLockDelay()
P.spinLast=false P.spinLast=false
end end
if P.gameEnv.shakeFX then if P.gameEnv.shakeFX then
@@ -2378,10 +2403,9 @@ function player.act.insRight(P,auto)
if P.gameEnv.dropFX then if P.gameEnv.dropFX then
P:createDropFX(P.curX-1,P.curY+P.r-1,P.curX-1,P.curY) P:createDropFX(P.curX-1,P.curY+P.r-1,P.curX-1,P.curY)
end end
P:freshgho() P:freshBlock(false,true)
end end
if P.curX~=x0 then if P.curX~=x0 then
P:freshLockDelay()
P.spinLast=false P.spinLast=false
end end
if P.gameEnv.shakeFX then if P.gameEnv.shakeFX then
@@ -2402,13 +2426,13 @@ function player.act.insDown(P)
P.fieldOff.vy=P.gameEnv.shakeFX*.5 P.fieldOff.vy=P.gameEnv.shakeFX*.5
end end
P.curY,P.lockDelay,P.spinLast=P.imgY,P.gameEnv.lock,false P.curY,P.lockDelay,P.spinLast=P.imgY,P.gameEnv.lock,false
P:freshMinY() P:freshBlock(true,true)
end end
end end
function player.act.down1(P) function player.act.down1(P)
if P.curY~=P.imgY and P.cur then if P.curY~=P.imgY and P.cur then
P.curY=P.curY-1 P.curY=P.curY-1
P:freshMinY() P:freshBlock(true,true)
P.spinLast=false P.spinLast=false
end end
end end
@@ -2416,7 +2440,7 @@ function player.act.down4(P)
for _=1,4 do for _=1,4 do
if P.curY~=P.imgY and P.cur then if P.curY~=P.imgY and P.cur then
P.curY=P.curY-1 P.curY=P.curY-1
P:freshMinY() P:freshBlock(true,true)
P.spinLast=false P.spinLast=false
else else
return return
@@ -2428,7 +2452,7 @@ function player.act.down10(P)
for _=1,10 do for _=1,10 do
if P.curY~=P.imgY then if P.curY~=P.imgY then
P.curY=P.curY-1 P.curY=P.curY-1
P:freshMinY() P:freshBlock(true,true)
P.spinLast=false P.spinLast=false
else else
return return
@@ -2574,15 +2598,20 @@ end
local function loadGameEnv(P)--Load gameEnv local function loadGameEnv(P)--Load gameEnv
P.gameEnv={}--Current game setting environment P.gameEnv={}--Current game setting environment
local ENV=P.gameEnv local ENV=P.gameEnv
local E
--Load game settings --Load game settings
for k,v in next,gameEnv0 do for k,v in next,gameEnv0 do
if modeEnv[k]~=nil then if modeEnv[k]~=nil then
v=modeEnv[k] --Mode setting v=modeEnv[k] --Mode setting
-- DBP("mode-"..k..":"..tostring(v))
elseif game.setting[k]~=nil then elseif game.setting[k]~=nil then
v=game.setting[k] --Game setting v=game.setting[k] --Game setting
-- DBP("game-"..k..":"..tostring(v))
elseif setting[k]~=nil then elseif setting[k]~=nil then
v=setting[k] --Global setting v=setting[k] --Global setting
-- DBP("global-"..k..":"..tostring(v))
-- else
-- DBP("default-"..k..":"..tostring(v))
end end
ENV[k]=v --Default setting ENV[k]=v --Default setting
end end
@@ -2687,7 +2716,7 @@ function PLY.newDemoPlayer(id,x,y,size)
noFly=false, noFly=false,
das=10,arr=2, das=10,arr=2,
sddas=2,sdarr=2, sddas=2,sdarr=2,
quickR=true,swap=true, swap=true,
ghost=setting.ghost,center=setting.center, ghost=setting.ghost,center=setting.center,
smooth=setting.smooth,grid=setting.grid, smooth=setting.smooth,grid=setting.grid,
text=setting.text, text=setting.text,
@@ -2740,9 +2769,9 @@ end
function PLY.newRemotePlayer(id,x,y,size,actions) function PLY.newRemotePlayer(id,x,y,size,actions)
local P=newEmptyPlayer(id,x,y,size) local P=newEmptyPlayer(id,x,y,size)
P.human=false -- 录像不是人为操作 P.human=false
P.remote=true -- 远程操作 P.remote=true
-- 开发中
-- P.updateAction=buildActionFunctionFromActions(P, actions) -- P.updateAction=buildActionFunctionFromActions(P, actions)
loadGameEnv(P) loadGameEnv(P)

View File

@@ -67,7 +67,7 @@ function Tick.throwBadge(data)--{ifAI,Sender,timer}
end end
function Tick.autoPause(data) function Tick.autoPause(data)
data[1]=data[1]+1 data[1]=data[1]+1
if SCN.cur~="play"then return end if SCN.cur~="play"then return true end
if data[1]==120 then if data[1]==120 then
if SCN.cur=="play"then if SCN.cur=="play"then
pauseGame() pauseGame()

View File

@@ -56,7 +56,6 @@ Future outlook:
mine sweeper mine sweeper
tank battle tank battle
new AI: task-Z new AI: task-Z
self protection
cool backgrounds cool backgrounds
'Encrypt'(compile to byte code) 'Encrypt'(compile to byte code)
better drop FX better drop FX
@@ -70,11 +69,43 @@ Future outlook:
more graphic FXs & 3D features & animations more graphic FXs & 3D features & animations
network game network game
0.10.4: 漏洞修复 Bug Fix
代码:
修改场景模块方法名
软件锁变量名从lock改为appLock
使用linter整理代码
重构锁延相关代码,freshgho,freshLockDelay,freshMinY合并为freshBlock
修复:
BPM120~180之间分数计算不正确
进不指定锁延的模式就报错
锁延机制错误(这次真修好了)
游戏结束后马上暂停并解除还会自动暂停(之前没修好)
提前硬降失效
0.10.3: 软件锁 APP Lock
新内容:
设置增加软件锁选项,打开游戏后进入伪装界面
改动:
剩余锁延重置次数指示器改为长方形
debug界面改为重置界面,进入方法修改
游戏设置页面布局更改
语音音量条改为无刻度
取消快速重开设置,游戏过程中长按重开,结束后开局一秒内点击重开
修复:
无尽挖掘报错
极简错误提示声音太小
修复回放也计入排行榜
回放时暂停不打断玩家操作
c4w练习的lunatic分数bug
0.10.2: 锁延修复 Lock Delay Fixed 0.10.2: 锁延修复 Lock Delay Fixed
改动: 改动:
锁延机制再修正 锁延机制再修正
"失败"字样改为"游戏结束" "失败"改为"游戏结束"
修复: 修复:
纠正部分rank文件转换错误
模式文件使用玩家的随机器以正确回放
游戏结束后马上暂停并解除还会自动暂停
改设置后回放错误 改设置后回放错误
字库缺字 字库缺字