Merge pull request #9 from Kirby703/patch-2

added cools+regret colors to splits
pull/6/merge
Ishaan Bhardwaj 2023-07-01 22:19:21 -04:00 committed by GitHub
commit 58abd40238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 2 deletions

View File

@ -35,6 +35,8 @@ function PhantomManiaNXGame:new()
self.coolregret_message = "COOL!!"
self.coolregret_timer = 0
self.section_cools = { [0] = 0 }
self.section_regrets = { [0] = 0 }
end
function PhantomManiaNXGame:getARE()
@ -209,11 +211,15 @@ function PhantomManiaNXGame:updateSectionTimes(old_level, new_level)
table.insert(self.section_times, section_time)
self.section_start_time = self.frames
if section_time >= frameTime(1,00) then
self.last_section_cool = false
--self.last_section_cool = false
self.coolregret_message = "REGRET!!"
self.coolregret_timer = 300
self.grade = self.grade - 1
elseif self.last_section_cool then
table.insert(self.section_regrets, 1)
else
table.insert(self.section_regrets, 0)
end
if self.last_section_cool then
self.cools = self.cools + 1
end
self.grade = self.grade + 1
@ -227,8 +233,10 @@ function PhantomManiaNXGame:updateSectionTimes(old_level, new_level)
self.last_section_cool = true
self.coolregret_message = "COOL!!"
self.coolregret_timer = 300
table.insert(self.section_cools, 1)
else
self.last_section_cool = false
table.insert(self.section_cools, 0)
end
end
end
@ -324,6 +332,18 @@ local function getLetterGrade(grade)
end
end
function PhantomManiaNXGame:sectionColourFunction(section)
if self.section_cools[section] == 1 and self.section_regrets[section] == 1 then
return { 1, 1, 0, 1 }
elseif self.section_cools[section] == 1 then
return { 0, 1, 0, 1 }
elseif self.section_regrets[section] == 1 then
return { 1, 0, 0, 1 }
else
return { 1, 1, 1, 1 }
end
end
function PhantomManiaNXGame:drawScoringInfo()
PhantomManiaNXGame.super.drawScoringInfo(self)