mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-11-22 16:59:03 -06:00
v0.2.6.2
This commit is contained in:
parent
92f17c54df
commit
e93034322c
@ -106,6 +106,7 @@ end
|
|||||||
function MarathonWCBGame:getHighscoreData()
|
function MarathonWCBGame:getHighscoreData()
|
||||||
return {
|
return {
|
||||||
pieces = self.pieces,
|
pieces = self.pieces,
|
||||||
|
lines = self.lines,
|
||||||
frames = self.frames,
|
frames = self.frames,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -81,7 +81,10 @@ DTET.wallkicks_ccw = {{x=-1, y=0}, {x=1, y=0}, {x=0, y=1}, {x=-1, y=1}, {x=1, y=
|
|||||||
function DTET:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
function DTET:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||||
|
|
||||||
local kicks
|
local kicks
|
||||||
if piece.shape == "O" then
|
if piece.shape == "O" or (
|
||||||
|
(piece.shape == "S" or piece.shape == "Z" or piece.shape == "I")
|
||||||
|
and rot_dir == 2
|
||||||
|
) then
|
||||||
return
|
return
|
||||||
elseif rot_dir == 1 then
|
elseif rot_dir == 1 then
|
||||||
kicks = DTET.wallkicks_cw
|
kicks = DTET.wallkicks_cw
|
||||||
|
@ -25,8 +25,8 @@ function H:attemptRotate(new_inputs, piece, grid, initial)
|
|||||||
local new_piece = piece:withRelativeRotation(rot_dir)
|
local new_piece = piece:withRelativeRotation(rot_dir)
|
||||||
|
|
||||||
if not(initial and self.enable_IRS_wallkicks == false) then
|
if not(initial and self.enable_IRS_wallkicks == false) then
|
||||||
self:onPieceRotate(piece, grid)
|
|
||||||
piece:setRelativeRotation(rot_dir)
|
piece:setRelativeRotation(rot_dir)
|
||||||
|
self:onPieceRotate(piece, grid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ PPTPRS.wallkicks_O = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function PPTPRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
function PPTPRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||||
local kicks
|
|
||||||
|
|
||||||
|
local kicks
|
||||||
if piece.shape == "O" then
|
if piece.shape == "O" then
|
||||||
kicks = PPTPRS.wallkicks_O[piece.rotation][new_piece.rotation]
|
kicks = PPTPRS.wallkicks_O[piece.rotation][new_piece.rotation]
|
||||||
elseif piece.shape == "I" then
|
elseif piece.shape == "I" then
|
||||||
@ -90,9 +90,9 @@ function PPTPRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
for idx, offset in pairs(kicks) do
|
for idx, offset in pairs(kicks) do
|
||||||
kicked_piece = new_piece:withOffset(offset)
|
kicked_piece = new_piece:withOffset(offset)
|
||||||
if grid:canPlacePiece(kicked_piece) then
|
if grid:canPlacePiece(kicked_piece) then
|
||||||
self:onPieceRotate(piece, grid)
|
|
||||||
piece:setRelativeRotation(rot_dir)
|
piece:setRelativeRotation(rot_dir)
|
||||||
piece:setOffset(offset)
|
piece:setOffset(offset)
|
||||||
|
self:onPieceRotate(piece, grid)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -50,7 +50,7 @@ OSpin.block_offsets = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function OSpin:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||||
|
|
||||||
local kicks
|
local kicks
|
||||||
if piece.shape == "I" then
|
if piece.shape == "I" then
|
||||||
@ -64,9 +64,9 @@ function OSpin:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|||||||
for idx, offset in pairs(kicks) do
|
for idx, offset in pairs(kicks) do
|
||||||
kicked_piece = new_piece:withOffset(offset)
|
kicked_piece = new_piece:withOffset(offset)
|
||||||
if grid:canPlacePiece(kicked_piece) then
|
if grid:canPlacePiece(kicked_piece) then
|
||||||
self:onPieceRotate(piece, grid)
|
|
||||||
piece:setRelativeRotation(rot_dir)
|
piece:setRelativeRotation(rot_dir)
|
||||||
piece:setOffset(offset)
|
piece:setOffset(offset)
|
||||||
|
self:onPieceRotate(piece, grid)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -18,12 +18,22 @@ SRS.colourscheme = {
|
|||||||
T = "C",
|
T = "C",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SRS.MANIPULATIONS_MAX = 24
|
||||||
|
SRS.ROTATIONS_MAX = 12
|
||||||
|
|
||||||
|
function SRS:onPieceDrop(piece, grid)
|
||||||
|
if (piece.manipulations >= self.MANIPULATIONS_MAX or piece.rotations >= self.ROTATIONS_MAX) and piece:isDropBlocked(grid) then
|
||||||
|
piece.locked = true
|
||||||
|
else
|
||||||
|
piece.lock_delay = 0 -- step reset
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function SRS:onPieceMove(piece, grid)
|
function SRS:onPieceMove(piece, grid)
|
||||||
piece.lock_delay = 0 -- move reset
|
piece.lock_delay = 0 -- move reset
|
||||||
if piece:isDropBlocked(grid) then
|
if piece:isDropBlocked(grid) then
|
||||||
piece.manipulations = piece.manipulations + 1
|
piece.manipulations = piece.manipulations + 1
|
||||||
if piece.manipulations >= 24 then
|
if piece.manipulations >= self.MANIPULATIONS_MAX then
|
||||||
piece:dropToBottom(grid)
|
|
||||||
piece.locked = true
|
piece.locked = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -33,8 +43,7 @@ function SRS:onPieceRotate(piece, grid)
|
|||||||
piece.lock_delay = 0 -- rotate reset
|
piece.lock_delay = 0 -- rotate reset
|
||||||
if piece:isDropBlocked(grid) then
|
if piece:isDropBlocked(grid) then
|
||||||
piece.rotations = piece.rotations + 1
|
piece.rotations = piece.rotations + 1
|
||||||
if piece.rotations >= 12 then
|
if piece.rotations >= self.ROTATIONS_MAX then
|
||||||
piece:dropToBottom(grid)
|
|
||||||
piece.locked = true
|
piece.locked = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user