From 7fe366a8dee4c1ddf2876fae3938eb2be8c8bd17 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sun, 11 Oct 2020 14:17:18 -0400 Subject: [PATCH 1/5] Bravo score update --- tetris/modes/marathon_a2.lua | 7 ++++--- tetris/modes/survival_a1.lua | 11 ++++++++++- tetris/modes/survival_a2.lua | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tetris/modes/marathon_a2.lua b/tetris/modes/marathon_a2.lua index cc8526a..601dc2e 100644 --- a/tetris/modes/marathon_a2.lua +++ b/tetris/modes/marathon_a2.lua @@ -142,13 +142,14 @@ end function MarathonA2Game:updateScore(level, drop_bonus, cleared_lines) self:updateGrade(cleared_lines) + if self.grid:checkForBravo(cleared_lines) then self.bravo = 4 else self.bravo = 1 end if cleared_lines > 0 then self.score = self.score + ( - (math.ceil((level + cleared_lines) / 4) + drop_bonus) * - cleared_lines * (cleared_lines * 2 - 1) * (self.combo * 2 - 1) + (math.ceil((level + cleared_lines) / 4) + 2 * drop_bonus) * + cleared_lines * self.combo * self.bravo ) self.lines = self.lines + cleared_lines - self.combo = self.combo + cleared_lines - 1 + self.combo = self.combo + (cleared_lines - 1) * 2 else self.drop_bonus = 0 self.combo = 1 diff --git a/tetris/modes/survival_a1.lua b/tetris/modes/survival_a1.lua index 41d10bc..4b10d4b 100644 --- a/tetris/modes/survival_a1.lua +++ b/tetris/modes/survival_a1.lua @@ -19,6 +19,8 @@ function SurvivalA1Game:new() self.roll_frames = 0 self.combo = 1 + self.bravos = 0 + self.gm_conditions = { level300 = false, level500 = false, @@ -116,10 +118,14 @@ function SurvivalA1Game:onLineClear(cleared_row_count) end function SurvivalA1Game:updateScore(level, drop_bonus, cleared_lines) + if self.grid:checkForBravo(cleared_lines) then + self.bravo = 4 + self.bravos = self.bravos + 1 + else self.bravo = 1 end if cleared_lines > 0 then self.score = self.score + ( (math.ceil((level + cleared_lines) / 4) + drop_bonus) * - cleared_lines * (cleared_lines * 2 - 1) * self.combo + cleared_lines * self.bravo * self.combo ) self.lines = self.lines + cleared_lines self.combo = self.combo + (cleared_lines - 1) * 2 @@ -169,6 +175,8 @@ function SurvivalA1Game:drawScoringInfo() love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") end + if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end + love.graphics.setFont(font_3x5_3) love.graphics.printf(self.score, 240, 220, 90, "left") if self.gm_conditions["level300"] and self.gm_conditions["level500"] and self.gm_conditions["level900"] then @@ -182,6 +190,7 @@ function SurvivalA1Game:drawScoringInfo() if sg >= 5 then love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") end + if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end love.graphics.setFont(font_8x11) love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center") diff --git a/tetris/modes/survival_a2.lua b/tetris/modes/survival_a2.lua index d44086d..197a997 100644 --- a/tetris/modes/survival_a2.lua +++ b/tetris/modes/survival_a2.lua @@ -105,10 +105,11 @@ function SurvivalA2Game:onLineClear(cleared_row_count) end function SurvivalA2Game:updateScore(level, drop_bonus, cleared_lines) + if self.grid:checkForBravo(cleared_lines) then self.bravo = 4 else self.bravo = 1 end if cleared_lines > 0 then self.score = self.score + ( (math.ceil((level + cleared_lines) / 4) + drop_bonus) * - cleared_lines * (cleared_lines * 2 - 1) * self.combo + cleared_lines * self.bravo * self.combo ) self.lines = self.lines + cleared_lines self.combo = self.combo + (cleared_lines - 1) * 2 From eddfee566d13b04ada602e56f22cee4049562e59 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sun, 11 Oct 2020 15:34:10 -0400 Subject: [PATCH 2/5] Grade display changed for TA Death modes --- tetris/modes/phantom_mania.lua | 4 ++-- tetris/modes/survival_a2.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tetris/modes/phantom_mania.lua b/tetris/modes/phantom_mania.lua index ff064dd..71b48e1 100644 --- a/tetris/modes/phantom_mania.lua +++ b/tetris/modes/phantom_mania.lua @@ -161,12 +161,12 @@ function PhantomManiaGame:drawScoringInfo() local text_x = config["side_next"] and 320 or 240 love.graphics.setFont(font_3x5_2) - love.graphics.printf("GRADE", text_x, 120, 40, "left") + if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left") love.graphics.setFont(font_3x5_3) - love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left") + if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left") end love.graphics.printf(self.score, text_x, 220, 90, "left") love.graphics.printf(self.level, text_x, 340, 40, "right") if self.clear then diff --git a/tetris/modes/survival_a2.lua b/tetris/modes/survival_a2.lua index 197a997..6d2f2c3 100644 --- a/tetris/modes/survival_a2.lua +++ b/tetris/modes/survival_a2.lua @@ -142,7 +142,7 @@ function SurvivalA2Game:drawScoringInfo() strTrueValues(self.prev_inputs) ) love.graphics.printf("NEXT", 64, 40, 40, "left") - love.graphics.printf("GRADE", text_x, 120, 40, "left") + if self:getLetterGrade() ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left") local sg = self.grid:checkSecretGrade() @@ -152,7 +152,7 @@ function SurvivalA2Game:drawScoringInfo() love.graphics.setFont(font_3x5_3) love.graphics.printf(self.score, text_x, 220, 90, "left") - love.graphics.printf(self:getLetterGrade(), text_x, 140, 90, "left") + if self:getLetterGrade() ~= "" then love.graphics.printf(self:getLetterGrade(), text_x, 140, 90, "left") end love.graphics.printf(self.level, text_x, 340, 40, "right") love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right") if sg >= 5 then From 0c317d9ce1cc4cddc2bb2e7de6067aebe15aa7a4 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sun, 11 Oct 2020 15:41:56 -0400 Subject: [PATCH 3/5] Fixing step reset --- tetris/rulesets/arika_ace.lua | 1 + tetris/rulesets/arika_srs.lua | 1 + tetris/rulesets/standard_exp.lua | 12 ++++++------ tetris/rulesets/ti_srs.lua | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tetris/rulesets/arika_ace.lua b/tetris/rulesets/arika_ace.lua index 3c2801f..a87a83b 100755 --- a/tetris/rulesets/arika_ace.lua +++ b/tetris/rulesets/arika_ace.lua @@ -150,6 +150,7 @@ end function ARS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset + piece.manipulations = 0 end function ARS:onPieceMove(piece, grid) diff --git a/tetris/rulesets/arika_srs.lua b/tetris/rulesets/arika_srs.lua index 0c99113..d9cec49 100755 --- a/tetris/rulesets/arika_srs.lua +++ b/tetris/rulesets/arika_srs.lua @@ -164,6 +164,7 @@ end function SRS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset + piece.manipulations = 0 end function SRS:onPieceMove(piece, grid) diff --git a/tetris/rulesets/standard_exp.lua b/tetris/rulesets/standard_exp.lua index 98fea77..9d6afb3 100755 --- a/tetris/rulesets/standard_exp.lua +++ b/tetris/rulesets/standard_exp.lua @@ -159,19 +159,19 @@ function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid) end function SRS:onPieceCreate(piece, grid) - piece.rotate_counter = 0 - piece.move_counter = 0 + piece.manipulations = 0 end function SRS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset + piece.manipulations = 0 end function SRS:onPieceMove(piece, grid) piece.lock_delay = 0 -- move reset if piece:isDropBlocked(grid) then - piece.move_counter = piece.move_counter + 1 - if piece.move_counter >= 24 then + piece.manipulations = piece.manipulations + 1 + if piece.manipulations >= 15 then piece.locked = true end end @@ -180,8 +180,8 @@ end function SRS:onPieceRotate(piece, grid) piece.lock_delay = 0 -- rotate reset if piece:isDropBlocked(grid) then - piece.rotate_counter = piece.rotate_counter + 1 - if piece.rotate_counter >= 12 then + piece.manipulations = piece.manipulations + 1 + if piece.manipulations >= 15 then piece.locked = true end end diff --git a/tetris/rulesets/ti_srs.lua b/tetris/rulesets/ti_srs.lua index 4caff19..61f965c 100644 --- a/tetris/rulesets/ti_srs.lua +++ b/tetris/rulesets/ti_srs.lua @@ -164,6 +164,7 @@ end function SRS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset + piece.manipulations = 0 end function SRS:onPieceMove(piece, grid) From 12a6f421986b506ddbc8ea858cf1015f746f0666 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sun, 11 Oct 2020 15:46:34 -0400 Subject: [PATCH 4/5] Revert "Fixing step reset" - didn't realize infinite floorkicks This reverts commit 0c317d9ce1cc4cddc2bb2e7de6067aebe15aa7a4. --- tetris/rulesets/arika_ace.lua | 1 - tetris/rulesets/arika_srs.lua | 1 - tetris/rulesets/standard_exp.lua | 12 ++++++------ tetris/rulesets/ti_srs.lua | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tetris/rulesets/arika_ace.lua b/tetris/rulesets/arika_ace.lua index a87a83b..3c2801f 100755 --- a/tetris/rulesets/arika_ace.lua +++ b/tetris/rulesets/arika_ace.lua @@ -150,7 +150,6 @@ end function ARS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset - piece.manipulations = 0 end function ARS:onPieceMove(piece, grid) diff --git a/tetris/rulesets/arika_srs.lua b/tetris/rulesets/arika_srs.lua index d9cec49..0c99113 100755 --- a/tetris/rulesets/arika_srs.lua +++ b/tetris/rulesets/arika_srs.lua @@ -164,7 +164,6 @@ end function SRS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset - piece.manipulations = 0 end function SRS:onPieceMove(piece, grid) diff --git a/tetris/rulesets/standard_exp.lua b/tetris/rulesets/standard_exp.lua index 9d6afb3..98fea77 100755 --- a/tetris/rulesets/standard_exp.lua +++ b/tetris/rulesets/standard_exp.lua @@ -159,19 +159,19 @@ function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid) end function SRS:onPieceCreate(piece, grid) - piece.manipulations = 0 + piece.rotate_counter = 0 + piece.move_counter = 0 end function SRS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset - piece.manipulations = 0 end function SRS:onPieceMove(piece, grid) piece.lock_delay = 0 -- move reset if piece:isDropBlocked(grid) then - piece.manipulations = piece.manipulations + 1 - if piece.manipulations >= 15 then + piece.move_counter = piece.move_counter + 1 + if piece.move_counter >= 24 then piece.locked = true end end @@ -180,8 +180,8 @@ end function SRS:onPieceRotate(piece, grid) piece.lock_delay = 0 -- rotate reset if piece:isDropBlocked(grid) then - piece.manipulations = piece.manipulations + 1 - if piece.manipulations >= 15 then + piece.rotate_counter = piece.rotate_counter + 1 + if piece.rotate_counter >= 12 then piece.locked = true end end diff --git a/tetris/rulesets/ti_srs.lua b/tetris/rulesets/ti_srs.lua index 61f965c..4caff19 100644 --- a/tetris/rulesets/ti_srs.lua +++ b/tetris/rulesets/ti_srs.lua @@ -164,7 +164,6 @@ end function SRS:onPieceDrop(piece, grid) piece.lock_delay = 0 -- step reset - piece.manipulations = 0 end function SRS:onPieceMove(piece, grid) From 090ffa512617909c79fb329a911600036b30da65 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj <59454579+SashLilac@users.noreply.github.com> Date: Mon, 12 Oct 2020 14:48:00 -0400 Subject: [PATCH 5/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 81e74f8..449f950 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Welcome to Cambridge, the next open-source falling-block game engine! This fork is written and maintained exclusively by [SashLilac](https://github.com/SashLilac) and [Oshisaure](https://github.com/oshisaure)! +Join our Discord server for help and a welcoming community! https://discord.gg/mteMJw4 + Credits -------