Merge pull request #11 from Kirby703/patch-4

adds MM-12 grade
pull/6/merge
Ishaan Bhardwaj 2023-07-01 22:20:06 -04:00 committed by GitHub
commit e91b91aff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -304,11 +304,7 @@ end
function PhantomManiaNXGame:getAggregateGrade()
local grade_cap
if self:qualifiesForGMRoll() then
if self.roll_frames > 3238 then
grade_cap = 42
else
grade_cap = 41
end
grade_cap = 42
else
grade_cap = 26
end
@ -321,7 +317,7 @@ end
local master_grades = {"M", "MK", "MV", "MO"}
local function getLetterGrade(grade)
local function getLetterGrade(grade, roll_frames)
if grade == 0 then
return "1"
elseif grade <= 13 then
@ -330,7 +326,7 @@ local function getLetterGrade(grade)
return "M" .. tostring(grade - 13)
elseif grade <= 30 then
return master_grades[grade - 26]
elseif grade <= 41 then
elseif grade <= 41 or roll_frames <= 3238 then
return "MM-" .. tostring(grade - 30)
else
return "GM"
@ -376,7 +372,7 @@ function PhantomManiaNXGame:drawScoringInfo()
love.graphics.setFont(font_3x5_3)
if self.roll_frames > 3238 then love.graphics.setColor(1, 0.5, 0, 1)
elseif self.level >= 1300 then love.graphics.setColor(0, 1, 0, 1) end
love.graphics.printf(getLetterGrade(self:getAggregateGrade()), text_x, 140, 90, "left")
love.graphics.printf(getLetterGrade(self:getAggregateGrade(), self.roll_frames), text_x, 140, 90, "left")
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(self.score, text_x, 220, 90, "left")
love.graphics.printf(self.level, text_x, 340, 50, "right")