mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-11-22 17:49:02 -06:00
Added Hebo DRS
This commit is contained in:
parent
bc4179ef81
commit
2d88f1b084
35
tetris/rulesets/dtet-h.lua
Normal file
35
tetris/rulesets/dtet-h.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
local DTET = require 'tetris.rulesets.dtet'
|
||||||
|
|
||||||
|
local DTETH = DTET:extend()
|
||||||
|
|
||||||
|
DTETH.name = "D.R.S.-H"
|
||||||
|
DTETH.hash = "D.R.S.-H"
|
||||||
|
|
||||||
|
DTETH.are_cancel = false
|
||||||
|
|
||||||
|
function DTETH:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||||
|
|
||||||
|
local kicks
|
||||||
|
if piece.shape == "O" then
|
||||||
|
return
|
||||||
|
elseif rot_dir == 1 then
|
||||||
|
kicks = DTET.wallkicks_cw
|
||||||
|
else
|
||||||
|
kicks = DTET.wallkicks_ccw
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
self:onPieceRotate(piece, grid)
|
||||||
|
piece:setRelativeRotation(rot_dir)
|
||||||
|
piece:setOffset(offset)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return DTETH
|
Loading…
Reference in New Issue
Block a user