0.7.28+α

This commit is contained in:
MrZ_26
2020-02-04 19:37:06 +08:00
parent 48b68a876b
commit f261906f1a
16 changed files with 327 additions and 177 deletions

BIN
SFX/error.ogg Normal file

Binary file not shown.

BIN
SFX/error_long.ogg Normal file

Binary file not shown.

9
ai.lua
View File

@@ -119,9 +119,8 @@ local function ifoverlapAI(f,bk,x,y)
end end
end
local function resetField(f0,f,start)
::L::if f[start]then
while f[start]do
removeRow(f,start)
goto L
end
for i=start,#f0 do
f[i]=getNewRow(0)
@@ -148,9 +147,8 @@ local function getScore(field,cb,cy)
if #field==0 then return 1e99 end--PC best
for x=1,10 do
local h=#field
::L::if field[h][x]==0 and h>1 then
while field[h][x]==0 and h>1 do
h=h-1
goto L
end
height[x]=h
if x>3 and x<8 and h>highest then highest=h end
@@ -204,9 +202,8 @@ AI_think={
local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--each pos
local cy=#Tfield+1
::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then
while not ifoverlapAI(Tfield,cb,cx,cy-1)do
cy=cy-1
goto L
end--move to bottom
for i=1,#cb do
local y=cy+i-1

View File

@@ -1,4 +1,4 @@
gameVersion="Alpha V0.7.27+"
gameVersion="Alpha V0.7.28"
function love.conf(t)
t.identity="Techmino"--Save directory name
t.version="11.1"

View File

@@ -1298,6 +1298,20 @@ defaultModeEnv={
dropPiece="tech_reach_ultimate",
bg="matrix",bgm="secret7th",
},
{
drop=1e99,lock=60,
freshLimit=15,
fine=true,fineKill=true,
dropPiece="tech_reach_hard",
bg="flink",bgm="infinite",
},
{
drop=1e99,lock=60,
freshLimit=15,
fine=true,fineKill=true,
dropPiece="tech_reach_ultimate",
bg="flink",bgm="infinite",
},
},
c4wtrain={
{

BIN
font.ttf

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -149,6 +149,7 @@ return{
"B2B数:",
"PC数:",
"效率:",
"多余操作:"
},
help={
"好像也没啥好帮助的吧?就当是关于了",
@@ -251,7 +252,8 @@ return{
sdarrD="-",sdarrU="+",
quickR="快速重新开始",
swap="组合键切换攻击模式",
ctrl="控制设置",
fine="极简操作提示音",
ctrl="键位设置",
touch="触屏设置",
back=BK,
},

View File

@@ -149,6 +149,7 @@ return{
"满贯数:",
"全清数:",
"效率:",
"多余操作:"
},
help={
"好像也没啥好帮助的吧?就当是关于了",
@@ -252,7 +253,8 @@ return{
sdarrD="-",sdarrU="+",
quickR="快速重新开始",
swap="组合键切换攻击模式",
ctrl="控制设置",
fine="极简操作提示音",
ctrl="键位设置",
touch="触屏设置",
back=BK,
},

View File

@@ -128,7 +128,7 @@ return{
"Powered by love2d",
"Find out what's in the setting!",
"Any suggestions to author!",
"Techmino=Technique+tetromino",
"Techmino=Technique+Tetromino",
"CLASSIC SEXY RUSSIAN BLOCKS",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
},
@@ -150,6 +150,7 @@ return{
"B2B:",
"PC:",
"Efficiency:",
"Fineese:"
},
help={
"I don't think you need \"help\".",
@@ -252,7 +253,8 @@ Lib used:
sdarrD="-",sdarrU="+",
quickR="Quick restart",
swap="Combo key to change ATK mode",
ctrl="Control Setting",
fine="Fineese error SFX",
ctrl="Key Setting",
touch="Touch Setting",
back=BK,
},

View File

@@ -55,7 +55,7 @@ sfx={
"move","rotate","rotatekick","hold",
"prerotate","prehold",
"lock","drop","fall",
"reach",
"error","error_long","reach",
"ren_1","ren_2","ren_3","ren_4","ren_5","ren_6","ren_7","ren_8","ren_9","ren_10","ren_11","ren_mega",
"clear_1","clear_2","clear_3","clear_4",
"spin_0","spin_1","spin_2","spin_3",
@@ -178,7 +178,7 @@ modeLevel={
survivor={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
defender={"NORMAL","LUNATIC"},
attacker={"HARD","ULTIMATE"},
tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+",},
tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE","ULTIMATE+",},
c4wtrain={"NORMAL","LUNATIC"},
pctrain={"NORMAL","EXTRA"},
pcchallenge={"NORMAL","HARD","LUNATIC"},
@@ -379,8 +379,9 @@ Widget={
sddasU= newButton(400,340,50,50,color.white,40,function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"),
sdarrD= newButton(500,340,50,50,color.white,40,function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"),
sdarrU= newButton(720,340,50,50,color.white,40,function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"),
quickR= newSwitch(560,440,40,function()return setting.quickR end,function()setting.quickR=not setting.quickR end, nil,"swap"),
swap= newSwitch(560,530,25,function()return setting.swap end,function()setting.swap=not setting.swap end, nil,"ctrl"),
quickR= newSwitch(560,430,40,function()return setting.quickR end,function()setting.quickR=not setting.quickR end, nil,"swap"),
swap= newSwitch(560,510,25,function()return setting.swap end,function()setting.swap=not setting.swap end, nil,"fine"),
fine= newSwitch(560,590,25,function()return setting.fine end,function()setting.fine=not setting.fine end, nil,"ctrl"),
ctrl= newButton(1020,230,320,80,color.white,40,function()gotoScene("setting_control")end, nil,"touch"),
touch= newButton(1020,340,320,80,color.white,40,function()gotoScene("setting_touch")end, nil,"back"),
back= newButton(1160,600,160,160,color.white,55,back,nil,"graphic"),
@@ -468,8 +469,8 @@ Widget={
back= newButton(1155,600,180,90,color.white,40,back),
},
stat={
path= newButton(980,590,250,60,color.white,30,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"),
back= newButton(640,590,180,60,color.white,40,back,nil,"path"),
path= newButton(980,620,250,60,color.white,30,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"),
back= newButton(640,620,180,60,color.white,40,back,nil,"path"),
},
}
for S,L in next,Widget do

View File

@@ -1,7 +1,7 @@
--[[
第一次搞这么大的工程~参考价值不是很大
如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话当然欢迎!
(顺便,无授权直接盗代码的先死个妈)
(顺便,无授权直接盗代码的先死个妈)
]]
local love=love
local ms,kb,tc=love.mouse,love.keyboard,love.touch
@@ -54,6 +54,7 @@ setting={
das=10,arr=2,
sddas=0,sdarr=2,
quickR=true,swap=true,
fine=false,
--game
ghost=true,center=true,
@@ -110,6 +111,7 @@ setting={
}
stat={
run=0,game=0,time=0,
extraPiece=0,extraRate=0,
key=0,rotate=0,hold=0,piece=0,row=0,
atk=0,send=0,recv=0,pend=0,
clear_1=0,clear_2=0,clear_3=0,clear_4=0,
@@ -960,7 +962,6 @@ function love.resize(w,h)
gc.origin()
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360)
gc.replaceTransform(xOy)
collectgarbage()
end
function love.focus(f)
if system~="Android" and not f and scene=="play"then pauseGame()end
@@ -1022,19 +1023,18 @@ function love.update(dt)
for i=1,#Q do
Q[i]=Q[i+1]
end
end--play next when stop
end--放完后放下一个
else
local n=1
local L=voiceBank[Q[1]]
::L::if L[n]:isPlaying()then
while L[n]:isPlaying()do
n=n+1
if not L[n]then
L[n]=L[n-1]:clone()
L[n]:seek(0)
goto quit
break
end
goto L
end::quit::
end
Q[1]=L[n]
Q[1]:setVolume(setting.voc*.125)
Q[1]:play()

View File

@@ -50,6 +50,8 @@ local function dataOpt(i)
return stat.pc
elseif i==14 then
return format("%0.2f",stat.atk/stat.row)
elseif i==15 then
return stat.extraPiece.."["..(int(stat.extraRate/stat.piece*10000)*.01).."%]"
end
end
local statOptL={
@@ -72,6 +74,8 @@ local function statOpt(i)
return stat.pc
elseif i==17 then
return format("%0.2f",stat.atk/stat.row)
elseif i==18 then
return stat.extraPiece.."["..(int(stat.extraRate/stat.piece*10000)*.01).."%]"
end
end
local miniTitle_rect={
@@ -215,6 +219,27 @@ function Pnt.BG.glow()
local t=((sin(Timer()*.5)+sin(Timer()*.7)+sin(Timer()*.9+1)+sin(Timer()*1.5)+sin(Timer()*2+3))+5)*.05
gc.clear(t,t,t)
end
function Pnt.BG.rgb()
gc.clear(
sin(Timer()*1.2)*.15+.5,
sin(Timer()*1.5)*.15+.5,
sin(Timer()*1.9)*.15+.5
)
end
function Pnt.BG.strap()
gc.setColor(1,1,1)
local x=Timer()%32*40
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
end
function Pnt.BG.flink()
local t=.13-Timer()%3%1.7
if t<.25 then
gc.clear(t,t,t)
else
gc.clear(0,0,0)
end
end
function Pnt.BG.game1()
gc.setColor(1,1,1)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64)
@@ -249,19 +274,6 @@ function Pnt.BG.game6()
local r=7-int(Timer()*.5)%7
gc.draw(mouseBlock[r],640,360,Timer()%3.1416*6,400,400,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
end--Fast lightning&spining tetromino
function Pnt.BG.rgb()
gc.clear(
sin(Timer()*1.2)*.15+.5,
sin(Timer()*1.5)*.15+.5,
sin(Timer()*1.9)*.15+.5
)
end
function Pnt.BG.strap()
gc.setColor(1,1,1)
local x=Timer()%32*40
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
end
local matrixT={}for i=0,15 do matrixT[i]={}for j=0,8 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function Pnt.BG.matrix()
gc.clear(.15,.15,.15)
@@ -485,13 +497,13 @@ function Pnt.pause()
if pauseCount>0 then
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150)
end
for i=1,7 do
for i=1,8 do
gc.print(text.stat[i+3],110,30*i+270)
gc.print(dataOpt(i),305,30*i+270)
end
for i=8,14 do
gc.print(text.stat[i+3],860,30*i+60)
gc.print(dataOpt(i),1000,30*i+60)
for i=9,15 do
gc.print(text.stat[i+3],860,30*i+30)
gc.print(dataOpt(i),1000,30*i+30)
end
setFont(40)
if system~="Android"then
@@ -592,7 +604,7 @@ end
function Pnt.stat()
setFont(28)
gc.setColor(1,1,1)
for i=1,17 do
for i=1,18 do
gc.print(text.stat[i],400,30*i-5)
gc.print(statOpt(i),720,30*i-5)
end

View File

@@ -23,6 +23,7 @@ local gameEnv0={
visible="show",--keepVisible=visile~="show"
Fkey=NULL,puzzle=false,ospin=true,
freshLimit=1e99,easyFresh=true,
fine=false,fineKill=false,
target=1e99,dropPiece="null",
bg="none",bgm="race"
}
@@ -50,123 +51,149 @@ local spin_n={[0]="spin_0","spin_1","spin_2","spin_3"}
local clear_n={"clear_1","clear_2","clear_3","clear_4"}
local ren_n={}for i=1,11 do ren_n[i]="ren_"..i end
local blockPos={4,4,4,4,4,5,4}
local TMP1,TMP2,TMP3,TMP4={1,2},{2,1},{2,2},{1.5,1.5}----------save cache
local scs={
{[0]={1,2},{2,1},{2,2},{2,2}},
{[0]={1,2},{2,1},{2,2},{2,2}},
{[0]={1,2},{2,1},{2,2},{2,2}},
{[0]={1,2},{2,1},{2,2},{2,2}},
{[0]={1,2},{2,1},{2,2},{2,2}},
{[0]={1.5,1.5},{1.5,1.5},{1.5,1.5},{1.5,1.5},},
{[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}},
}
local ORG={0,0}
local CCblockID={4,3,5,6,1,2,0}
TMP1={0,0}
local TRS={
[1]={
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{0,1} },
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1} },
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-1}, {1,-2} },
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}},
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
[02]={ORG,{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={ORG,{-1,0}, {1,0}, {0,1}, {0,-1} },
[13]={ORG,{0,-1}, {0,1}, {-1,0}, {0,-2} },
[31]={ORG,{0,1}, {0,-1}, {1,0}, {0,2} },
[01]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{0,1} },
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1} },
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-1}, {1,-2} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}},
[12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2} },
[02]={TMP1,{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={TMP1,{-1,0}, {1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,-1}, {0,1}, {-1,0}, {0,-2} },
[31]={TMP1,{0,1}, {0,-1}, {1,0}, {0,2} },
},--Z
[2]={
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-1},{-1,-2} },
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}},
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {0,1} },
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
[02]={ORG,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={ORG,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={ORG,{0,1}, {0,-1}, {-1,0}, {0,2} },
[31]={ORG,{0,-1}, {0,1}, {1,0}, {0,-2} },
[01]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-1},{-1,-2} },
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}},
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {0,1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
[12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2} },
[02]={TMP1,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={TMP1,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,1}, {0,-1}, {-1,0}, {0,2} },
[31]={TMP1,{0,-1}, {0,1}, {1,0}, {0,-2} },
},--S
[3]={
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{0,1}, {-1,-1} },
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1} },
[03]={ORG,{1,0}, {1,1}, {0,-2}, {-1,1} },
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[32]={ORG,{-1,0}, {-1,-1},{1,0}, {0,2}, {-1,2} },
[23]={ORG,{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
[02]={ORG,{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={ORG,{-1,0}, {1,0}, {0,1}, {0,-1} },
[13]={ORG,{0,1}, {1,0}, {0,-1} },
[31]={ORG,{0,-1}, {-1,0}, {0,1} },
[01]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{0,1}, {-1,-1} },
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1} },
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {-1,1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[32]={TMP1,{-1,0}, {-1,-1},{1,0}, {0,2}, {-1,2} },
[23]={TMP1,{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
[02]={TMP1,{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={TMP1,{-1,0}, {1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,1}, {1,0}, {0,-1} },
[31]={TMP1,{0,-1}, {-1,0}, {0,1} },
},--L
[4]={
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {1,1} },
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {0,1}, {1,-1} },
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
[12]={ORG,{1,0}, {1,-1}, {-1,0}, {0,2}, {1,2} },
[21]={ORG,{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1} },
[02]={ORG,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={ORG,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={ORG,{0,-1}, {1,0}, {0,1} },
[31]={ORG,{0,1}, {-1,0}, {0,-1} },
[01]={TMP1,{-1,0}, {-1,1}, {0,-2}, {1,1} },
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {0,1}, {1,-1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
[12]={TMP1,{1,0}, {1,-1}, {-1,0}, {0,2}, {1,2} },
[21]={TMP1,{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
[32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1} },
[02]={TMP1,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={TMP1,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,-1}, {1,0}, {0,1} },
[31]={TMP1,{0,1}, {-1,0}, {0,-1} },
},--J
[5]={
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1}},
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
[12]={ORG,{1,0}, {1,-1}, {0,-1}, {0,2}, {1,2}, {-1,-1}},
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{1,1} },
[32]={ORG,{-1,0}, {-1,-1},{0,-1}, {0,2}, {-1,2}, {1,-1}},
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {-1,1} },
[02]={ORG,{-1,0}, {1,0}, {0,1} },
[20]={ORG,{1,0}, {-1,0}, {0,-1} },
[13]={ORG,{0,-1}, {0,1}, {1,0}, {0,-2}, {0,2}},
[31]={ORG,{0,-1}, {0,1}, {-1,0}, {0,-2}, {0,2}},
[01]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1}},
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
[12]={TMP1,{1,0}, {1,-1}, {0,-1}, {0,2}, {1,2}, {-1,-1}},
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{1,1} },
[32]={TMP1,{-1,0}, {-1,-1},{0,-1}, {0,2}, {-1,2}, {1,-1}},
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {-1,1} },
[02]={TMP1,{-1,0}, {1,0}, {0,1} },
[20]={TMP1,{1,0}, {-1,0}, {0,-1} },
[13]={TMP1,{0,-1}, {0,1}, {1,0}, {0,-2}, {0,2}},
[31]={TMP1,{0,-1}, {0,1}, {-1,0}, {0,-2}, {0,2}},
},--T
[6]={},--O(special)
[7]={
[01]={ORG,{0,1}, {1,0}, {-2,0}, {-2,-1},{1,2} },
[03]={ORG,{0,1}, {-1,0}, {2,0}, {2,-1}, {-1,2} },
[10]={ORG,{2,0}, {-1,0}, {-1,-2},{2,1}, {0,2} },
[30]={ORG,{-2,0}, {1,0}, {1,-2}, {-2,1}, {0,2} },
[12]={ORG,{-1,0}, {2,0}, {-1,2}, {2,-1} },
[32]={ORG,{1,0}, {-2,0}, {1,-2}, {-2,-1} },
[21]={ORG,{-2,0}, {1,0}, {1,-2}, {-2,1} },
[23]={ORG,{2,0}, {-1,0}, {-1,-2},{2,1} },
[02]={ORG,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={ORG,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={ORG,{0,-1}, {-1,0}, {1,0}, {0,1} },
[31]={ORG,{1,0}, {-1,0}},
[01]={TMP1,{0,1}, {1,0}, {-2,0}, {-2,-1},{1,2} },
[03]={TMP1,{0,1}, {-1,0}, {2,0}, {2,-1}, {-1,2} },
[10]={TMP1,{2,0}, {-1,0}, {-1,-2},{2,1}, {0,2} },
[30]={TMP1,{-2,0}, {1,0}, {1,-2}, {-2,1}, {0,2} },
[12]={TMP1,{-1,0}, {2,0}, {-1,2}, {2,-1} },
[32]={TMP1,{1,0}, {-2,0}, {1,-2}, {-2,-1} },
[21]={TMP1,{-2,0}, {1,0}, {1,-2}, {-2,1} },
[23]={TMP1,{2,0}, {-1,0}, {-1,-2},{2,1} },
[02]={TMP1,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={TMP1,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,-1}, {-1,0}, {1,0}, {0,1} },
[31]={TMP1,{1,0}, {-1,0}},
}
}
local AIRS={{
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
[01]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
[32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2} },
}}for i=2,6 do AIRS[i]=AIRS[1]end
AIRS[7]={
[01]={ORG,{-2,0}, {1,0}, {-2,-1},{1,2} },
[10]={ORG,{2,0}, {-1,0}, {2,1}, {-1,-2} },
[12]={ORG,{-1,0}, {2,0}, {-1,2}, {2,-1} },
[21]={ORG,{1,0}, {-2,0}, {1,-2}, {-2,1} },
[23]={ORG,{2,0}, {-1,0}, {2,1}, {-1,-2} },
[32]={ORG,{-2,0}, {1,0}, {-2,-1},{1,2} },
[30]={ORG,{1,0}, {-2,0}, {1,-2}, {-2,1} },
[03]={ORG,{-1,0}, {2,0}, {-1,2}, {2,-1} },
[01]={TMP1,{-2,0}, {1,0}, {-2,-1},{1,2} },
[10]={TMP1,{2,0}, {-1,0}, {2,1}, {-1,-2} },
[12]={TMP1,{-1,0}, {2,0}, {-1,2}, {2,-1} },
[21]={TMP1,{1,0}, {-2,0}, {1,-2}, {-2,1} },
[23]={TMP1,{2,0}, {-1,0}, {2,1}, {-1,-2} },
[32]={TMP1,{-2,0}, {1,0}, {-2,-1},{1,2} },
[30]={TMP1,{1,0}, {-2,0}, {1,-2}, {-2,1} },
[03]={TMP1,{-1,0}, {2,0}, {-1,2}, {2,-1} },
}
local TMP1={
[1]={
{1,2,1,0,1,2,2,1},
{2,2,3,1,1,2,3,2,2},
},--Z
[3]={
{1,2,1,0,1,2,2,1},
{2,2,3,2,1,2,3,3,2},
{3,4,3,2,3,4,4,3},
{2,3,2,1,2,3,3,2,2},
},--L
[6]={
{1,2,2,1,0,1,2,2,1},
},--O
[7]={
{1,2,1,0,1,2,1},
{2,2,2,2,1,1,2,2,2,2},
},--I
}--SZI逆态视为顺态JLT算法相同
TMP1[2]=TMP1[1]
TMP1[4]=TMP1[3]
TMP1[5]=TMP1[3]
local fineeseCtrlPar=TMP1
TMP1,TMP2,TMP3,TMP4=nil----------release
local CCblockID={4,3,5,6,1,2,0}
local freshMethod={
none=NULL,
@@ -443,14 +470,15 @@ function newDemoPlayer(id,x,y,size)
P.control=true
P.timing=false
P.stat={
time=0,
key=0,rotate=0,hold=0,piece=0,row=0,
time=0,score=0,
key=0,extraPiece=0,extraRate=0,
rotate=0,hold=0,piece=0,row=0,
atk=0,send=0,recv=0,pend=0,
clear_1=0,clear_2=0,clear_3=0,clear_4=0,
spin_0=0,spin_1=0,spin_2=0,spin_3=0,
pc=0,b2b=0,b3b=0,score=0,
}--Current gamestat
P.modeData={point=0,event=0}--data use by mode
pc=0,b2b=0,b3b=0,
}
P.modeData={point=0,event=0}
P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0
P.dropTime={}for i=1,10 do P.dropTime[i]=-1e5 end P.dropSpeed=0
@@ -475,7 +503,7 @@ function newDemoPlayer(id,x,y,size)
target=1e99,dropPiece="null",
}
P.cur={bk={{}},id=0,color=0,name=0}
P.sc,P.dir,P.r,P.c=ORG,0,0,0
P.sc,P.dir,P.r,P.c={0,0},0,0,0
P.curX,P.curY,P.y_img=0,0,0
P.hd={bk={{}},id=0,color=0,name=0}
P.holded=false
@@ -485,6 +513,7 @@ function newDemoPlayer(id,x,y,size)
P.freshTime=0
P.spinLast,P.lastClear=false,nil
P.spinSeq=0
P.ctrlCount=0
local bag1={1,2,3,4,5,6,7}
for i=1,7 do
@@ -558,12 +587,13 @@ function newPlayer(id,x,y,size,AIdata)
P.control=false
P.timing=false
P.stat={
time=0,
key=0,rotate=0,hold=0,piece=0,row=0,
time=0,score=0,
key=0,extraPiece=0,extraRate=0,
rotate=0,hold=0,piece=0,row=0,
atk=0,send=0,recv=0,pend=0,
clear_1=0,clear_2=0,clear_3=0,clear_4=0,
spin_0=0,spin_1=0,spin_2=0,spin_3=0,
pc=0,b2b=0,b3b=0,score=0,
pc=0,b2b=0,b3b=0,
}--Current gamestat
P.modeData={point=0,event=0}--data use by mode
P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0
@@ -588,7 +618,7 @@ function newPlayer(id,x,y,size,AIdata)
end
end--reset current game settings
P.cur={bk={{}},id=0,color=0,name=0}
P.sc,P.dir,P.r,P.c=ORG,0,0,0
P.sc,P.dir,P.r,P.c={0,0},0,0,0
P.curX,P.curY,P.y_img=0,0,0
P.hd={bk={{}},id=0,color=0,name=0}
P.holded=false
@@ -598,6 +628,7 @@ function newPlayer(id,x,y,size,AIdata)
P.freshTime=0
P.spinLast,P.lastClear=false,nil
P.spinSeq=0--for Ospin,each digit mean a spin
P.ctrlCount=0--key press time,for fineese check
P.his={rnd(7),rnd(7),rnd(7),rnd(7)}
local s=P.gameEnv.sequence
@@ -727,7 +758,7 @@ function player.update(P,dt)
if P.gameEnv.arr>0 then
P.act.moveLeft(P,true)
else
P.act.insLeft(P)
P.act.insLeft(P,true)
end
if x~=P.curX then P.moving=P.moving+P.gameEnv.arr-1 end
end
@@ -743,7 +774,7 @@ function player.update(P,dt)
if P.gameEnv.arr>0 then
P.act.moveRight(P,true)
else
P.act.insRight(P)
P.act.insRight(P,true)
end
if x~=P.curX then P.moving=P.moving-P.gameEnv.arr+1 end
end
@@ -1043,7 +1074,7 @@ function player.draw(P)
end
if P.gameEnv.center then
gc.setColor(1,1,1,trans)
local x=30*(P.curX+P.sc[2]-1)-30+15
local x=30*(P.curX+P.sc[2]-1)-15
gc.draw(spinCenter,x,600-30*(P.curY+P.sc[1]-1)+15,nil,nil,nil,4,4)
gc.translate(0,dy)
gc.setColor(1,1,1,.5)
@@ -1320,11 +1351,16 @@ end
-------------------------<Method>-------------------------
local function ifoverlap(P,bk,x,y)
if x<1 or x+#bk[1]>11 or y<1 then return true end
local C=#bk[1]
if x<1 or x+C>11 or y<1 then return true end
if y>#P.field then return end
for i=1,#bk do for j=1,#bk[1]do
if P.field[y+i-1]and bk[i][j]and P.field[y+i-1][x+j-1]>0 then return true end
end end
for i=1,#bk do
if P.field[y+i-1]then
for j=1,C do
if bk[i][j]and P.field[y+i-1][x+j-1]>0 then return true end
end
end
end
end
local function ckfull(P,i)
for j=1,10 do if P.field[i][j]<=0 then return end end
@@ -1364,6 +1400,16 @@ local function solid(P,x,y)
return P.field[y][x]>0
end
function player:fineError(rate)
self.stat.extraPiece=self.stat.extraPiece+1
self.stat.extraRate=self.stat.extraRate+rate
if self.gameEnv.fineKill then
SFX("error_long")
Event.lose(self)
else
SFX("error")
end
end
function player:garbageSend(R,send,time,...)
if setting.atkFX>0 then
self:createBeam(R,send,time,...)
@@ -1484,10 +1530,9 @@ end
function player:freshgho()
self.y_img=min(#self.field+1,self.curY)
if self.gameEnv._20G or self.keyPressing[7]and self.gameEnv.sdarr==0 then
::L::if not ifoverlap(self,self.cur.bk,self.curX,self.y_img-1)then
while not ifoverlap(self,self.cur.bk,self.curX,self.y_img-1)do
self.y_img=self.y_img-1
self.spinLast=false
goto L
end
if self.curY>self.y_img then
if not self.small then
@@ -1501,9 +1546,8 @@ function player:freshgho()
self.curY=self.y_img
end
else
::L::if not ifoverlap(self,self.cur.bk,self.curX,self.y_img-1)then
while not ifoverlap(self,self.cur.bk,self.curX,self.y_img-1)do
self.y_img=self.y_img-1
goto L
end
end
end
@@ -1679,12 +1723,22 @@ function player:spin(d,ifpre)
if self.human then
SFX(ifpre and"prerotate"or ifoverlap(self,self.cur.bk,self.curX,self.curY+1)and ifoverlap(self,self.cur.bk,self.curX-1,self.curY)and ifoverlap(self,self.cur.bk,self.curX+1,self.curY)and"rotatekick"or"rotate")
end
self.ctrlCount=self.ctrlCount+(d==2 and 2 or 1)
self.stat.rotate=self.stat.rotate+1
end
function player:hold(ifpre)
if not self.holded and self.waiting==-1 and self.gameEnv.hold then
--Fineese check
local H,B=self.hd,self.cur
if H and H.id==B.id and H.name==B.name then
self:fineError(1.5)
elseif self.ctrlCount>1 then
self:fineError(2)
end
self.holded=self.gameEnv.oncehold
self.spinLast=false
self.ctrlCount=0
self.spinSeq=0
self.cur,self.hd=self.hd,self.cur
self.hd.bk=blocks[self.hd.id][0]
@@ -1719,6 +1773,7 @@ function player:resetblock()
self.holded=false
self.spinLast=false
self.spinSeq=0
self.ctrlCount=0
self.cur=rem(self.next,1)
self:freshNext()
@@ -1785,6 +1840,44 @@ function player:drop()--(Place piece)
dospin=false
end
if self.gameEnv.fine then
if self.curY>18 then goto 通过测试 end
local y0=self.curY
local x,c=self.curX,self.c
local B=self.cur.bk
for x=1,c do
local y
for i=#B,1,-1 do
if B[i][x]then y=i;goto 继续 end
end
goto 操作判断法
::继续::
if y then
x=self.curX+x-1
for y=y0+y,#self.field do
if solid(self,x,y)then goto 通过测试 end
end
end
end--遮挡暂时都算最简
::操作判断法::
if dospin then self.ctrlCount=self.ctrlCount-2 end--对无遮挡spin宽松两步
local id=self.cur.id
local dir=self.dir+1
if id<3 or id==7 then
if dir>2 then
dir=dir-2
end
end--SZI的逆态视为顺态
local R,I=self.ctrlCount,fineeseCtrlPar[id][dir][self.curX]--Real key/Ideal key
local d=R-I
if d<=0 then
goto 通过测试
end
if I==0 then I=.67 end
self:fineError(R/I)
end--极简检测
::通过测试::
if cc>0 then
self.combo=self.combo+1
if cc==4 then
@@ -2037,7 +2130,10 @@ function player.act.moveLeft(P,auto)
if P.gameEnv.easyFresh or y0~=P.curY then P:freshLockDelay()end
if P.human and P.curY==P.y_img then SFX("move")end
P.spinLast=false
if not auto then P.moving=-1 end
if not auto then
P.moving=-1
P.ctrlCount=P.ctrlCount+1
end
else
P.moving=-P.gameEnv.das-1
end
@@ -2058,7 +2154,10 @@ function player.act.moveRight(P,auto)
if P.gameEnv.easyFresh or y0~=P.curY then P:freshLockDelay()end
if P.human and P.curY==P.y_img then SFX("move")end
P.spinLast=false
if not auto then P.moving=1 end
if not auto then
P.moving=1
P.ctrlCount=P.ctrlCount+1
end
else
P.moving=P.gameEnv.das+1
end
@@ -2118,11 +2217,13 @@ function player.act.softDrop(P)
P:changeAtkMode(4)
end
else
if P.curY~=P.y_img then
P.curY=P.curY-1
P.spinLast=false
end
P.downing=1
if P.control and P.waiting==-1 then
if P.curY~=P.y_img then
P.curY=P.curY-1
P.spinLast=false
end
end
end
end
function player.act.hold(P)
@@ -2152,15 +2253,14 @@ function player.act.insDown(P)
P.curY,P.lockDelay,P.spinLast=P.y_img,P.gameEnv.lock,false
end
end
function player.act.insLeft(P)
function player.act.insLeft(P,auto)
local x0,y0=P.curX,P.curY
::L::if not ifoverlap(P,P.cur.bk,P.curX-1,P.curY)then
while not ifoverlap(P,P.cur.bk,P.curX-1,P.curY)do
P.curX=P.curX-1
if not P.small and setting.dropFX>0 then
P:createShade(P.curX+1,P.curY+P.r-1,P.curX+1,P.curY)
end
P:freshgho()
goto L
end
if x0~=P.curX then
if P.human and setting.shakeFX>0 then
@@ -2168,16 +2268,20 @@ function player.act.insLeft(P)
end
if P.gameEnv.easyFresh or y0~=P.curY then P:freshLockDelay()end
end
if auto then
if P.ctrlCount==0 then P.ctrlCount=1 end
else
P.ctrlCount=P.ctrlCount+1
end
end
function player.act.insRight(P)
function player.act.insRight(P,auto)
local x0,y0=P.curX,P.curY
::L::if not ifoverlap(P,P.cur.bk,P.curX+1,P.curY)then
while not ifoverlap(P,P.cur.bk,P.curX+1,P.curY)do
P.curX=P.curX+1
if not P.small and setting.dropFX>0 then
P:createShade(P.curX+P.c-1,P.curY+P.r-1,P.curX+P.c-1,P.curY)
end
P:freshgho()
goto L
end
if x0~=P.curX then
if P.human and setting.shakeFX>0 then
@@ -2185,6 +2289,11 @@ function player.act.insRight(P)
end
if P.gameEnv.easyFresh or y0~=P.curY then P:freshLockDelay()end
end
if auto then
if P.ctrlCount==0 then P.ctrlCount=1 end
else
P.ctrlCount=P.ctrlCount+1
end
end
function player.act.down1(P)
if P.curY~=P.y_img then

View File

@@ -44,6 +44,7 @@ function destroyPlayers()
players.alive[i]=nil
end
players.human=0
collectgarbage()
end
function getNewRow(val)
local t=rem(freeRow)
@@ -128,15 +129,14 @@ end
function SFX(s,v)
if setting.sfx>0 then
local n=1
::L::if sfx[s][n]:isPlaying()then
while sfx[s][n]:isPlaying()do
n=n+1
if not sfx[s][n]then
sfx[s][n]=sfx[s][n-1]:clone()
sfx[s][n]:seek(0)
goto quit
break
end
goto L
end::quit::
end
sfx[s][n]:setVolume((v or 1)*setting.sfx*.125)
sfx[s][n]:play()
end
@@ -250,8 +250,9 @@ function gotoScene(s,style)
end
end
function updateStat()
for k,v in next,players[1].stat do
stat[k]=stat[k]+v
local S=players[1].stat
for k,v in next,S do
stat[k]=stat[k]+S[k]
end
end
local prevMenu={
@@ -474,6 +475,7 @@ end
local dataOpt={
"run","game","time",
"extraPiece","extraRate",
"key","rotate","hold","piece","row",
"atk","send","recv","pend",
"clear_1","clear_2","clear_3","clear_4",
@@ -536,7 +538,7 @@ function loadSetting()
setting.virtualkeyAlpha=min(int(abs(toN(v))),10)
elseif
t=="ghost"or t=="center"or t=="grid"or t=="swap"or
t=="quickR"or t=="bgblock"or t=="smo"or
t=="quickR"or t=="fine"or t=="bgblock"or t=="smo"or
t=="virtualkeyIcon"or t=="virtualkeySwitch"
then
setting[t]=v=="true"
@@ -578,6 +580,7 @@ local saveOpt={
"sddas","sdarr",
"quickR",
"swap",
"fine",
"ghost","center",
"smo","grid",

View File

@@ -1,6 +1,11 @@
local S=[=[
Patron(rmb10+):
gggf/T080/Ykzl/zxc
[D*a]?
Future outlook:
Normal Things:
ajustable next count
bag line in all mode
force fineese mode
highscore of most modes
custom block color/direction
@@ -19,6 +24,9 @@ Future outlook:
infinite 1v1
square mode
more FXs & 3d features & animations
0.7.28:
add fineese check
code optimized
0.7.27:
super O transform system
optimized light system(no used)