cambridge/tetris/rulesets/arika_srs.lua

22 lines
478 B
Lua
Raw Normal View History

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.MANIPULATIONS_MAX = 128
2020-10-05 21:17:15 -05:00
function SRS:onPieceRotate(piece, grid)
piece.lock_delay = 0 -- rotate reset
if piece:isDropBlocked(grid) then
piece.manipulations = piece.manipulations + 1
if piece.manipulations >= self.MANIPULATIONS_MAX then
2020-10-05 21:17:15 -05:00
piece.locked = true
end
end
end
return SRS