Shirase O kicks fixed

pull/4/head
Ishaan Bhardwaj 2021-01-10 20:56:26 -05:00
parent 520f553e6a
commit e67f431478
1 changed files with 23 additions and 0 deletions

View File

@ -60,6 +60,29 @@ Shirase.block_offsets = {
}
}
function Shirase:attemptWallkicks(piece, new_piece, rot_dir, grid)
local kicks
if piece.shape == "I" then
kicks = SRS.wallkicks_line[piece.rotation][new_piece.rotation]
else
kicks = SRS.wallkicks_3x3[piece.rotation][new_piece.rotation]
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
piece:setRelativeRotation(rot_dir)
piece:setOffset(offset)
self:onPieceRotate(piece, grid)
return
end
end
end
function Shirase:onPieceDrop(piece) piece.lock_delay = 0 end
function Shirase:onPieceMove(piece) piece.lock_delay = 0 end
function Shirase:onPieceRotate(piece) piece.lock_delay = 0 end