2020-10-05 21:17:15 -05:00
|
|
|
local Piece = require 'tetris.components.piece'
|
2020-12-04 19:36:11 -06:00
|
|
|
local Ruleset = require 'tetris.rulesets.ti_srs'
|
2020-10-05 21:17:15 -05:00
|
|
|
|
|
|
|
local SRS = Ruleset:extend()
|
|
|
|
|
|
|
|
SRS.name = "ACE-SRS"
|
|
|
|
SRS.hash = "ACE Standard"
|
|
|
|
|
|
|
|
SRS.spawn_positions = {
|
|
|
|
I = { x=5, y=2 },
|
|
|
|
J = { x=4, y=3 },
|
|
|
|
L = { x=4, y=3 },
|
|
|
|
O = { x=5, y=3 },
|
|
|
|
S = { x=4, y=3 },
|
|
|
|
T = { x=4, y=3 },
|
|
|
|
Z = { x=4, y=3 },
|
|
|
|
}
|
|
|
|
|
|
|
|
SRS.big_spawn_positions = {
|
2020-10-13 14:26:07 -05:00
|
|
|
I = { x=3, y=0 },
|
2020-10-06 15:27:28 -05:00
|
|
|
J = { x=2, y=1 },
|
|
|
|
L = { x=2, y=1 },
|
2020-10-13 14:26:07 -05:00
|
|
|
O = { x=3, y=1 },
|
2020-10-06 15:27:28 -05:00
|
|
|
S = { x=2, y=1 },
|
|
|
|
T = { x=2, y=1 },
|
|
|
|
Z = { x=2, y=1 },
|
2020-10-05 21:17:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function SRS:onPieceMove(piece, grid)
|
|
|
|
piece.lock_delay = 0 -- move reset
|
|
|
|
if piece:isDropBlocked(grid) then
|
|
|
|
piece.manipulations = piece.manipulations + 1
|
2020-12-04 10:22:32 -06:00
|
|
|
if piece.manipulations >= 128 then
|
2020-12-18 20:24:10 -06:00
|
|
|
piece:dropToBottom(grid)
|
2020-10-05 21:17:15 -05:00
|
|
|
piece.locked = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function SRS:onPieceRotate(piece, grid)
|
|
|
|
piece.lock_delay = 0 -- rotate reset
|
|
|
|
if piece:isDropBlocked(grid) then
|
|
|
|
piece.manipulations = piece.manipulations + 1
|
2020-12-04 10:22:32 -06:00
|
|
|
if piece.manipulations >= 128 then
|
2020-12-18 20:24:10 -06:00
|
|
|
piece:dropToBottom(grid)
|
2020-10-05 21:17:15 -05:00
|
|
|
piece.locked = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return SRS
|