From 8c62f321a0417464db55edf26db8eae8b372b3f1 Mon Sep 17 00:00:00 2001 From: Oshisaure Date: Sat, 17 Oct 2020 04:22:41 +0100 Subject: [PATCH] Added secret grade for the Phantom Mania/-2/-N modes --- tetris/modes/phantom_mania.lua | 13 +++++++++++++ tetris/modes/phantom_mania2.lua | 14 ++++++++++++++ tetris/modes/phantom_mania_n.lua | 6 ++++++ 3 files changed, 33 insertions(+) diff --git a/tetris/modes/phantom_mania.lua b/tetris/modes/phantom_mania.lua index 71b48e1..bab6c9d 100644 --- a/tetris/modes/phantom_mania.lua +++ b/tetris/modes/phantom_mania.lua @@ -16,6 +16,12 @@ function PhantomManiaGame:new() self.lock_drop = true self.next_queue_length = 1 + + self.SGnames = { + "9", "8", "7", "6", "5", "4", "3", "2", "1", + "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", + "GM" + } self.roll_frames = 0 self.combo = 1 @@ -164,6 +170,10 @@ function PhantomManiaGame:drawScoringInfo() 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") + local sg = self.grid:checkSecretGrade() + if sg >= 5 then + love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") + end love.graphics.setFont(font_3x5_3) if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left") end @@ -175,6 +185,9 @@ function PhantomManiaGame:drawScoringInfo() love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right") end + if sg >= 5 then + love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") + end end function PhantomManiaGame:getSectionEndLevel() diff --git a/tetris/modes/phantom_mania2.lua b/tetris/modes/phantom_mania2.lua index 5b30451..5dee33a 100644 --- a/tetris/modes/phantom_mania2.lua +++ b/tetris/modes/phantom_mania2.lua @@ -26,6 +26,12 @@ function PhantomMania2Game:new() self.hold_age = 0 self.queue_age = 0 self.roll_points = 0 + + self.SGnames = { + "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", + "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", + "GM" + } self.randomizer = History6RollsRandomizer() @@ -285,6 +291,10 @@ function PhantomMania2Game:drawScoringInfo() love.graphics.printf("GRADE", text_x, 120, 40, "left") love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left") + local sg = self.grid:checkSecretGrade() + if sg >= 5 then + love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") + end love.graphics.setFont(font_3x5_3) love.graphics.printf(getLetterGrade(math.floor(self.grade)), text_x, 140, 90, "left") @@ -295,6 +305,10 @@ function PhantomMania2Game:drawScoringInfo() else love.graphics.printf(math.floor(self.level / 100 + 1) * 100, text_x, 370, 50, "right") end + + if sg >= 5 then + love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") + end end function PhantomMania2Game:getBackground() diff --git a/tetris/modes/phantom_mania_n.lua b/tetris/modes/phantom_mania_n.lua index c063745..708ae7b 100644 --- a/tetris/modes/phantom_mania_n.lua +++ b/tetris/modes/phantom_mania_n.lua @@ -8,6 +8,12 @@ PhantomManiaNGame.tagline = "The old mode from Nullpomino, for Ti-ARS and SRS su function PhantomManiaNGame:new() PhantomManiaNGame.super:new() + + self.SGnames = { + "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", + "M10", "M11", "M12", "M13", "M14", "M15", "M16", "M17", "M18", + "GM" + } self.next_queue_length = 3 self.enable_hold = true