mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 12:59:02 -06:00
Fixed Arika rulesets
- Fixed centre column rule on Classic ARS, Ti-ARS and ACE-ARS - Added T floorkick for Ti-ARS and ACE-ARS
This commit is contained in:
parent
bdad32ac79
commit
8a2237a77c
@ -81,11 +81,19 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
piece.shape == "J" or piece.shape == "T" or piece.shape == "L"
|
piece.shape == "J" or piece.shape == "T" or piece.shape == "L"
|
||||||
) and (
|
) and (
|
||||||
piece.rotation == 0 or piece.rotation == 2
|
piece.rotation == 0 or piece.rotation == 2
|
||||||
) and (
|
) then
|
||||||
grid:isOccupied(piece.position.x, piece.position.y) or
|
local offsets = new_piece:getBlockOffsets()
|
||||||
grid:isOccupied(piece.position.x, piece.position.y - 1) or
|
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
|
||||||
grid:isOccupied(piece.position.x, piece.position.y - 2)
|
for index, offset in pairs(offsets) do
|
||||||
) then return end
|
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
|
||||||
|
if offset.x == 0 then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- kick right, kick left
|
-- kick right, kick left
|
||||||
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
||||||
|
@ -84,11 +84,19 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
piece.shape == "J" or piece.shape == "T" or piece.shape == "L"
|
piece.shape == "J" or piece.shape == "T" or piece.shape == "L"
|
||||||
) and (
|
) and (
|
||||||
piece.rotation == 0 or piece.rotation == 2
|
piece.rotation == 0 or piece.rotation == 2
|
||||||
) and (
|
) then
|
||||||
grid:isOccupied(piece.position.x, piece.position.y) or
|
local offsets = new_piece:getBlockOffsets()
|
||||||
grid:isOccupied(piece.position.x, piece.position.y - 1) or
|
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
|
||||||
grid:isOccupied(piece.position.x, piece.position.y - 2)
|
for index, offset in pairs(offsets) do
|
||||||
) then return end
|
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
|
||||||
|
if offset.x == 0 then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if piece.shape == "I" then
|
if piece.shape == "I" then
|
||||||
-- special kick rules for I
|
-- special kick rules for I
|
||||||
@ -116,14 +124,21 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
piece.floorkick = 1
|
piece.floorkick = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif piece.shape ~= "I" then
|
else
|
||||||
-- kick right, kick left
|
-- kick right, kick left
|
||||||
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then
|
||||||
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
||||||
elseif (grid:canPlacePiece(new_piece:withOffset({x=-1, y=0}))) then
|
elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then
|
||||||
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
||||||
end
|
elseif piece.shape == "T"
|
||||||
else
|
and newpiece.rotation == 1
|
||||||
|
and piece.floorkick == 0
|
||||||
|
and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1}))
|
||||||
|
then
|
||||||
|
-- T floorkick
|
||||||
|
piece.floorkick = piece.floorkick + 1
|
||||||
|
piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -84,11 +84,19 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
piece.shape == "J" or piece.shape == "T" or piece.shape == "L"
|
piece.shape == "J" or piece.shape == "T" or piece.shape == "L"
|
||||||
) and (
|
) and (
|
||||||
piece.rotation == 0 or piece.rotation == 2
|
piece.rotation == 0 or piece.rotation == 2
|
||||||
) and (
|
) then
|
||||||
grid:isOccupied(piece.position.x, piece.position.y) or
|
local offsets = new_piece:getBlockOffsets()
|
||||||
grid:isOccupied(piece.position.x, piece.position.y - 1) or
|
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
|
||||||
grid:isOccupied(piece.position.x, piece.position.y - 2)
|
for index, offset in pairs(offsets) do
|
||||||
) then return end
|
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
|
||||||
|
if offset.x == 0 then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if piece.shape == "I" then
|
if piece.shape == "I" then
|
||||||
-- special kick rules for I
|
-- special kick rules for I
|
||||||
@ -116,14 +124,21 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
piece.floorkick = 1
|
piece.floorkick = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif piece.shape ~= "I" then
|
else
|
||||||
-- kick right, kick left
|
-- kick right, kick left
|
||||||
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then
|
||||||
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
||||||
elseif (grid:canPlacePiece(new_piece:withOffset({x=-1, y=0}))) then
|
elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then
|
||||||
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
||||||
end
|
elseif piece.shape == "T"
|
||||||
else
|
and newpiece.rotation == 1
|
||||||
|
and piece.floorkick == 0
|
||||||
|
and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1}))
|
||||||
|
then
|
||||||
|
-- T floorkick
|
||||||
|
piece.floorkick = piece.floorkick + 1
|
||||||
|
piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user