2020-10-05 10:52:37 -05:00
|
|
|
local Piece = require 'tetris.components.piece'
|
2020-12-04 19:36:11 -06:00
|
|
|
local Ruleset = require 'tetris.rulesets.arika_ti'
|
2020-10-05 10:52:37 -05:00
|
|
|
|
|
|
|
local ARS = Ruleset:extend()
|
|
|
|
|
|
|
|
ARS.name = "ACE-ARS"
|
|
|
|
ARS.hash = "ArikaACE"
|
|
|
|
|
2020-10-16 21:37:44 -05:00
|
|
|
ARS.colourscheme = {
|
2020-11-06 19:49:44 -06:00
|
|
|
I = "C",
|
|
|
|
L = "O",
|
|
|
|
J = "B",
|
|
|
|
S = "G",
|
|
|
|
Z = "R",
|
|
|
|
O = "Y",
|
|
|
|
T = "M",
|
2020-10-16 21:37:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
ARS.softdrop_lock = false
|
|
|
|
ARS.harddrop_lock = true
|
|
|
|
|
2020-10-05 10:52:37 -05:00
|
|
|
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
|
2020-11-21 20:48:45 -06:00
|
|
|
if piece.manipulations >= 128 then
|
2020-12-18 20:24:10 -06:00
|
|
|
piece:dropToBottom(grid)
|
2020-10-05 10:52:37 -05:00
|
|
|
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
|
2020-11-21 20:48:45 -06:00
|
|
|
if piece.manipulations >= 128 then
|
2020-12-18 20:24:10 -06:00
|
|
|
piece:dropToBottom(grid)
|
2020-10-05 10:52:37 -05:00
|
|
|
piece.locked = true
|
|
|
|
end
|
|
|
|
end
|
2020-11-21 20:48:45 -06:00
|
|
|
if piece.floorkick >= 1 then
|
|
|
|
piece.floorkick = piece.floorkick + 1
|
|
|
|
end
|
2020-10-05 10:52:37 -05:00
|
|
|
end
|
|
|
|
|
2020-12-02 23:26:36 -06:00
|
|
|
function ARS:get180RotationValue() return 3 end
|
|
|
|
|
|
|
|
function ARS:getDefaultOrientation() return 3 end -- downward facing pieces by default
|
|
|
|
|
2020-10-05 10:52:37 -05:00
|
|
|
return ARS
|