cambridge-modpack/tetris/rulesets/super302.lua

38 lines
784 B
Lua
Raw Normal View History

2020-12-22 21:09:17 -06:00
local ARS = require 'tetris.rulesets.arika'
local BONKERS = ARS:extend()
BONKERS.name = "SUPER302"
BONKERS.hash = "Super302"
2021-01-09 20:08:34 -06:00
BONKERS.colourscheme = {
I = "C",
J = "G",
L = "G",
O = "B",
S = "C",
T = "G",
Z = "C"
}
2020-12-22 21:09:17 -06:00
function BONKERS:attemptWallkicks(piece, new_piece, rot_dir, grid)
local prev_rot = piece.rotation
ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
if prev_rot ~= piece.rotation then return end
piece.big = false
2020-12-22 21:09:17 -06:00
unfilled_block_offsets = {}
2021-01-30 22:14:14 -06:00
for y = 4, grid.height - 1 do
2020-12-22 21:09:17 -06:00
for x = 0, 9 do
if not grid:isOccupied(x, y) then
table.insert(unfilled_block_offsets, {x=x-100, y=y-100})
end
end
end
-- don't ask
piece.position = {x=100, y=100}
piece.getBlockOffsets = function(piece)
return unfilled_block_offsets
end
end
return BONKERS