2023-03-25 23:25:42 -05:00
|
|
|
local SRS = require 'tetris.rulesets.standard_ti'
|
2021-01-28 20:09:42 -06:00
|
|
|
|
|
|
|
local EARS = SRS:extend()
|
|
|
|
|
|
|
|
EARS.name = "E.A.R.S."
|
|
|
|
EARS.hash = "EARS"
|
|
|
|
|
|
|
|
EARS.colourscheme = {
|
2021-09-21 22:29:45 -05:00
|
|
|
I = "W",
|
2021-01-28 20:09:42 -06:00
|
|
|
J = "G",
|
|
|
|
L = "R",
|
|
|
|
O = "C",
|
|
|
|
S = "B",
|
|
|
|
T = "Y",
|
|
|
|
Z = "O",
|
|
|
|
}
|
|
|
|
|
|
|
|
function EARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|
|
|
for kd = 1, grid.height do
|
|
|
|
for x = -kd, kd do
|
|
|
|
tx = rot_dir == 3 and -x or x
|
|
|
|
for y = kd, -kd, -1 do
|
|
|
|
if math.abs(tx) + math.abs(y) == kd then
|
|
|
|
offset = {x=tx, y=y}
|
|
|
|
kicked_piece = new_piece:withOffset(offset)
|
|
|
|
if grid:canPlacePiece(kicked_piece) then
|
|
|
|
piece:setRelativeRotation(rot_dir)
|
|
|
|
piece:setOffset(offset)
|
2021-02-17 20:46:01 -06:00
|
|
|
self:onPieceRotate(piece, grid, offset.y < 0)
|
2021-01-28 20:09:42 -06:00
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function EARS:get180RotationValue()
|
|
|
|
return 2
|
|
|
|
end
|
|
|
|
|
|
|
|
return EARS
|