mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 22:59:02 -06:00
40 lines
879 B
Lua
40 lines
879 B
Lua
local Piece = require 'tetris.components.piece'
|
|
local Ruleset = require 'tetris.rulesets.arika_ti'
|
|
|
|
local ARS = Ruleset:extend()
|
|
|
|
ARS.name = "ACE-ARS2"
|
|
ARS.hash = "ArikaACE2"
|
|
|
|
function ARS:onPieceCreate(piece, grid)
|
|
piece.floorkick = 0
|
|
piece.manipulations = 0
|
|
end
|
|
|
|
function ARS:onPieceMove(piece, grid)
|
|
piece.lock_delay = 0 -- move reset
|
|
if piece:isDropBlocked(grid) then
|
|
piece.manipulations = piece.manipulations + 1
|
|
if piece.manipulations >= 128 then
|
|
piece:dropToBottom(grid)
|
|
piece.locked = true
|
|
end
|
|
end
|
|
end
|
|
|
|
function ARS:onPieceRotate(piece, grid)
|
|
piece.lock_delay = 0 -- rotate reset
|
|
if piece:isDropBlocked(grid) then
|
|
piece.manipulations = piece.manipulations + 1
|
|
if piece.manipulations >= 128 then
|
|
piece:dropToBottom(grid)
|
|
piece.locked = true
|
|
end
|
|
end
|
|
if piece.floorkick >= 1 then
|
|
piece.floorkick = piece.floorkick + 1
|
|
end
|
|
end
|
|
|
|
return ARS
|