mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-12-24 11:39:02 -06:00
Super PRS. It's PRS with up-kicks
This commit is contained in:
parent
00f2d1c4a8
commit
36c38bf574
56
tetris/rulesets/sprs.lua
Normal file
56
tetris/rulesets/sprs.lua
Normal file
@ -0,0 +1,56 @@
|
||||
local PRS = require 'tetris.rulesets.prs'
|
||||
|
||||
local SPRS = PRS:extend()
|
||||
|
||||
SPRS.name = "Super P.R.S"
|
||||
SPRS.hash = "SuperPRS"
|
||||
SPRS.world = true
|
||||
|
||||
function SPRS:attemptWallkicks(piece, newpiece, rot_dir, grid)
|
||||
for y=0,5 do
|
||||
for x=0,5 do
|
||||
local offset = {x=x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
for x=0,5 do
|
||||
local offset = {x=-x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
for y=0,-5,-1 do
|
||||
for x=0,5 do
|
||||
local offset = {x=x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
for x=0,5 do
|
||||
local offset = {x=-x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return SPRS
|
Loading…
Reference in New Issue
Block a user