From 8d77fd6400ca754525444ed534a689e84ac87973 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sat, 9 Jan 2021 11:21:14 -0500 Subject: [PATCH] DTET + Joker updates --- tetris/modes/joker.lua | 36 +++++++++++++++++++++++++++++++++--- tetris/rulesets/dtet.lua | 1 - 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/tetris/modes/joker.lua b/tetris/modes/joker.lua index bd62572..9668cfe 100644 --- a/tetris/modes/joker.lua +++ b/tetris/modes/joker.lua @@ -33,8 +33,13 @@ function JokerGame:getARE() else return math.max(math.ceil(20 - (self.level - 200) / 7), 5) end end -function JokerGame:getLineARE() return self:getARE() end -function JokerGame:getDasLimit() return 6 end +function JokerGame:getLineARE() + return self:getARE() +end + +function JokerGame:getDasLimit() + return 6 +end function JokerGame:getARR() return rush and 0 or 1 @@ -65,6 +70,31 @@ function JokerGame:advanceOneFrame(inputs, ruleset) return true end +function JokerGame:onPieceEnter() + -- The Initial Movement System, pioneered by DTET + if self.grid:canPlacePiece(self.piece) then + if self.das.direction == "left" then + for i = 1, 10 do + local new_piece = self.piece:withOffset({x=-i, y=0}) + if self.grid:canPlacePiece(new_piece) then + self.piece = new_piece + break + end + if not rush then break end + end + elseif self.das.direction == "right" then + for i = 1, 10 do + local new_piece = self.piece:withOffset({x=i, y=0}) + if self.grid:canPlacePiece(new_piece) then + self.piece = new_piece + break + end + if not rush then break end + end + end + end +end + function JokerGame:onLineClear(cleared_row_count) if cleared_row_count >= 4 and self.level < 200 then self.stock = self.stock + 1 elseif cleared_row_count < 4 and self.level >= 200 then self.stock = self.stock - 1 end @@ -112,7 +142,7 @@ function JokerGame:drawScoringInfo() if (self.ready_frames ~= 0) then love.graphics.printf( "RUSH: " .. (rush and "ON" or "OFF"), - 64, 110, 160, "center" + 64, 100, 160, "center" ) end diff --git a/tetris/rulesets/dtet.lua b/tetris/rulesets/dtet.lua index 13599e7..ead8e45 100644 --- a/tetris/rulesets/dtet.lua +++ b/tetris/rulesets/dtet.lua @@ -9,7 +9,6 @@ DTET.hash = "DTET" DTET.softdrop_lock = false DTET.harddrop_lock = true DTET.are_cancel = true -DTET.enable_IRS_wallkicks = true DTET.spawn_positions = { I = { x=5, y=4 },