From 47863175a348e328fa6502ab7d74667326bfc89a Mon Sep 17 00:00:00 2001 From: Kirby703 <14858059+Kirby703@users.noreply.github.com> Date: Thu, 10 Feb 2022 01:09:21 -0500 Subject: [PATCH] added cool+regret colors to splits --- tetris/modes/phantom_mania2.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tetris/modes/phantom_mania2.lua b/tetris/modes/phantom_mania2.lua index 12ca98b..e78161d 100644 --- a/tetris/modes/phantom_mania2.lua +++ b/tetris/modes/phantom_mania2.lua @@ -41,6 +41,7 @@ function PhantomMania2Game:new() self.coolregret_message = "" self.coolregret_timer = 0 + self.coolregrets = { [0] = 0 } end function PhantomMania2Game:getARE() @@ -219,11 +220,14 @@ function PhantomMania2Game:updateSectionTimes(old_level, new_level) self.section_start_time = self.frames if section_time <= cool_cutoffs[section] then self.grade = self.grade + 2 + table.insert(self.coolregrets, 2) self.coolregret_message = "COOL!!" self.coolregret_timer = 300 elseif section_time <= regret_cutoffs[section] then self.grade = self.grade + 1 + table.insert(self.coolregrets, 1) else + table.insert(self.coolregrets, 0) self.coolregret_message = "REGRET!!" self.coolregret_timer = 300 end @@ -292,6 +296,16 @@ function PhantomMania2Game:setHoldOpacity() end end +function PhantomMania2Game:sectionColourFunction(section) + if self.coolregrets[section] == 2 then + return { 0, 1, 0, 1 } + elseif self.coolregrets[section] == 0 then + return { 1, 0, 0, 1 } + else + return { 1, 1, 1, 1 } + end +end + function PhantomMania2Game:drawScoringInfo() PhantomMania2Game.super.drawScoringInfo(self)