cambridge-modpack/tetris/rulesets/cultris.lua

43 lines
884 B
Lua
Raw Normal View History

local SRS = require 'tetris.rulesets.standard_ti'
2020-11-20 13:30:40 -06:00
local Cultris = SRS:extend()
Cultris.name = "Cultris II"
Cultris.hash = "Cultris"
Cultris.colourscheme = {
I = "G",
L = "M",
J = "B",
S = "C",
Z = "W",
2020-11-20 13:30:40 -06:00
O = "Y",
T = "R",
}
Cultris.wallkicks = {
{x=-1, y=0}, {x=1, y=0}, {x=0, y=1}, {x=-1, y=1}, {x=1, y=1}, {x=-2, y=0}, {x=2, y=0}
}
function Cultris:attemptWallkicks(piece, new_piece, rot_dir, grid)
local kicks = Cultris.wallkicks
assert(piece.rotation ~= new_piece.rotation)
for idx, offset in pairs(kicks) do
kicked_piece = new_piece:withOffset(offset)
if grid:canPlacePiece(kicked_piece) then
2020-12-04 19:53:09 -06:00
self:onPieceRotate(piece, grid)
2020-11-20 13:30:40 -06:00
piece:setRelativeRotation(rot_dir)
piece:setOffset(offset)
return
end
end
end
function Cultris:onPieceMove() end
function Cultris:onPieceRotate() end
function Cultris:get180RotationValue() return 2 end
return Cultris