升级踢墙表初始化代码,修复部分方块按180度报错
This commit is contained in:
@@ -7,7 +7,9 @@ local noKick,noKick_180,pushZero do
|
||||
for _,L in next,t do
|
||||
if type(L)=="table"then
|
||||
for _,v in next,L do
|
||||
table.insert(v,1,zero)
|
||||
if not v[1]or v[1][1]~=0 or v[1][2]~=0 then
|
||||
table.insert(v,1,zero)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -31,6 +33,7 @@ end
|
||||
local function C_sym(L)--Use this if the block is centrosymmetry, *PTR!!!
|
||||
L[23]=L[01]L[32]=L[10]
|
||||
L[21]=L[03]L[12]=L[30]
|
||||
L[20]=L[02]L[31]=L[13]
|
||||
end
|
||||
local function flipList(O)--Use this to copy a symmetry list
|
||||
if not O then return end
|
||||
@@ -366,9 +369,7 @@ do
|
||||
[13]={{-1, 0},{ 1, 0}},
|
||||
[31]={{ 1, 0},{-1, 0}},
|
||||
},--I2
|
||||
{
|
||||
[01]={},[10]={},[03]={},[30]={},
|
||||
},--O1
|
||||
nil,--O1
|
||||
}
|
||||
TRS[2]= reflect(TRS[1])--SZ
|
||||
TRS[4]= reflect(TRS[3])--LJ
|
||||
@@ -377,9 +378,9 @@ do
|
||||
TRS[13]=reflect(TRS[12])--FE
|
||||
TRS[20]=reflect(TRS[19])--L5J5
|
||||
TRS[22]=reflect(TRS[21])--RY
|
||||
TRS[24]=reflect(TRS[23])--HN
|
||||
C_sym(TRS[8])C_sym(TRS[9])
|
||||
C_sym(TRS[25])C_sym(TRS[26])C_sym(TRS[29])
|
||||
TRS[24]=reflect(TRS[23])--NH
|
||||
C_sym(TRS[8])C_sym(TRS[9])--S5Z5
|
||||
C_sym(TRS[25])C_sym(TRS[26])--I5I3
|
||||
for i=1,29 do collect(TRS[i])end
|
||||
pushZero(TRS)
|
||||
end
|
||||
|
||||
@@ -576,10 +576,15 @@ function Player.spin(P,d,ifpre)
|
||||
local iki=P.RS[P.cur.id]
|
||||
if type(iki)=="table"then
|
||||
local idir=(P.cur.dir+d)%4
|
||||
iki=iki[P.cur.dir*10+idir]
|
||||
if not iki then
|
||||
P:freshBlock("move")
|
||||
SFX.fieldPlay(ifpre and"prerotate"or"rotate",nil,P)
|
||||
return
|
||||
end
|
||||
local icb=BLOCKS[P.cur.id][idir]
|
||||
local isc=SCS[P.cur.id][idir]
|
||||
local ix,iy=P.curX+P.cur.sc[2]-isc[2],P.curY+P.cur.sc[1]-isc[1]
|
||||
iki=iki[P.cur.dir*10+idir]
|
||||
for test=1,#iki do
|
||||
local x,y=ix+iki[test][1],iy+iki[test][2]
|
||||
if not P:ifoverlap(icb,x,y)and(P.freshTime>=0 or iki[test][2]<0)then
|
||||
|
||||
Reference in New Issue
Block a user