From 7d7dd8c3c213f1dd776f280c8ed958df07c9a886 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Thu, 7 Jan 2021 19:52:36 -0500 Subject: [PATCH] Roll roll bugfixes --- tetris/modes/sakura.lua | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tetris/modes/sakura.lua b/tetris/modes/sakura.lua index b7beebd..5ae29e8 100644 --- a/tetris/modes/sakura.lua +++ b/tetris/modes/sakura.lua @@ -274,7 +274,7 @@ function SakuraGame:new(secret_inputs) ) and History6RollsRandomizer() or SakuraRandomizer() ) - self.current_map = 1 + self.current_map = 16 self.time_limit = 10800 self.cleared_frames = STAGE_TRANSITION_TIME self.stage_frames = 0 @@ -408,18 +408,24 @@ function SakuraGame:advanceOneFrame(inputs, ruleset) self.frames = self.frames + 1 self.stage_frames = self.stage_frames + 1 - self.time_limit = self.time_limit - 1 - if self.time_limit <= 0 then self.game_over = true end + self.time_limit = math.max(self.time_limit - 1, 0) + if self.time_limit <= 0 and self.piece == nil then + self.game_over = true + end - if self.piece ~= nil and self.frames % 30 == 0 and - effects[self.current_map] == "roll" + if self.piece ~= nil and + effects[self.current_map] == "roll" and + self.stage_pieces % 4 == 0 then - ruleset:attemptRotate( - {[config.gamesettings.world_reverse == 3 or - (ruleset.world and config.gamesettings.world_reverse == 2) - and "rotate_left" or "rotate_right"] = true}, - self.piece, self.grid, false - ) + self.piece.colour = "F" + if self.stage_frames % 30 == 0 then + ruleset:attemptRotate( + {[config.gamesettings.world_reverse == 3 or + (ruleset.world and config.gamesettings.world_reverse == 2) + and "rotate_left" or "rotate_right"] = true}, + self.piece, self.grid, false + ) + end end else self.cleared_frames = STAGE_TRANSITION_TIME