mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2025-05-13 20:21:24 -05:00
v0.2.5
This commit is contained in:
@@ -109,4 +109,4 @@ end
|
||||
|
||||
function DTET:getDefaultOrientation() return 3 end
|
||||
|
||||
return DTET
|
||||
return DTET
|
||||
@@ -23,6 +23,7 @@ function SRS:onPieceMove(piece, grid)
|
||||
if piece:isDropBlocked(grid) then
|
||||
piece.manipulations = piece.manipulations + 1
|
||||
if piece.manipulations >= 24 then
|
||||
piece:dropToBottom(grid)
|
||||
piece.locked = true
|
||||
end
|
||||
end
|
||||
@@ -33,6 +34,7 @@ function SRS:onPieceRotate(piece, grid)
|
||||
if piece:isDropBlocked(grid) then
|
||||
piece.rotations = piece.rotations + 1
|
||||
if piece.rotations >= 12 then
|
||||
piece:dropToBottom(grid)
|
||||
piece.locked = true
|
||||
end
|
||||
end
|
||||
|
||||
48
tetris/rulesets/trans.lua
Normal file
48
tetris/rulesets/trans.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
local ARS = require 'tetris.rulesets.arika'
|
||||
local Trans = ARS:extend()
|
||||
|
||||
Trans.name = "TransRS"
|
||||
Trans.hash = "TransRS"
|
||||
|
||||
function Trans:attemptRotate(new_inputs, piece, grid, initial)
|
||||
local rot_dir = 0
|
||||
|
||||
if (new_inputs["rotate_left"] or new_inputs["rotate_left2"]) then
|
||||
rot_dir = 3
|
||||
elseif (new_inputs["rotate_right"] or new_inputs["rotate_right2"]) then
|
||||
rot_dir = 1
|
||||
elseif (new_inputs["rotate_180"]) then
|
||||
rot_dir = 2
|
||||
end
|
||||
|
||||
if rot_dir == 0 then return end
|
||||
if config.gamesettings.world_reverse == 3 or (self.world and config.gamesettings.world_reverse == 2) then
|
||||
rot_dir = 4 - rot_dir
|
||||
end
|
||||
|
||||
local new_piece = piece:withRelativeRotation(rot_dir)
|
||||
local pieces = {"I", "J", "L", "O", "S", "T", "Z"}
|
||||
repeat
|
||||
new_piece.shape = pieces[math.random(7)]
|
||||
until piece.shape ~= new_piece.shape
|
||||
|
||||
if (grid:canPlacePiece(new_piece)) then
|
||||
self:onPieceRotate(piece, grid)
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece.shape = new_piece.shape
|
||||
else
|
||||
if not(initial and self.enable_IRS_wallkicks == false) then
|
||||
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
||||
self:onPieceRotate(piece, grid)
|
||||
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
||||
piece.shape = new_piece.shape
|
||||
elseif (grid:canPlacePiece(new_piece:withOffset({x=-1, y=0}))) then
|
||||
self:onPieceRotate(piece, grid)
|
||||
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
||||
piece.shape = new_piece.shape
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Trans
|
||||
Reference in New Issue
Block a user