Bravo score update

This commit is contained in:
Ishaan Bhardwaj 2020-10-11 14:17:18 -04:00
parent 55be30c99f
commit 7fe366a8de
3 changed files with 16 additions and 5 deletions

View File

@ -142,13 +142,14 @@ end
function MarathonA2Game:updateScore(level, drop_bonus, cleared_lines) function MarathonA2Game:updateScore(level, drop_bonus, cleared_lines)
self:updateGrade(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 if cleared_lines > 0 then
self.score = self.score + ( self.score = self.score + (
(math.ceil((level + cleared_lines) / 4) + drop_bonus) * (math.ceil((level + cleared_lines) / 4) + 2 * drop_bonus) *
cleared_lines * (cleared_lines * 2 - 1) * (self.combo * 2 - 1) cleared_lines * self.combo * self.bravo
) )
self.lines = self.lines + cleared_lines self.lines = self.lines + cleared_lines
self.combo = self.combo + cleared_lines - 1 self.combo = self.combo + (cleared_lines - 1) * 2
else else
self.drop_bonus = 0 self.drop_bonus = 0
self.combo = 1 self.combo = 1

View File

@ -19,6 +19,8 @@ function SurvivalA1Game:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.bravos = 0
self.gm_conditions = { self.gm_conditions = {
level300 = false, level300 = false,
level500 = false, level500 = false,
@ -116,10 +118,14 @@ function SurvivalA1Game:onLineClear(cleared_row_count)
end end
function SurvivalA1Game:updateScore(level, drop_bonus, cleared_lines) 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 if cleared_lines > 0 then
self.score = self.score + ( self.score = self.score + (
(math.ceil((level + cleared_lines) / 4) + drop_bonus) * (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.lines = self.lines + cleared_lines
self.combo = self.combo + (cleared_lines - 1) * 2 self.combo = self.combo + (cleared_lines - 1) * 2
@ -169,6 +175,8 @@ function SurvivalA1Game:drawScoringInfo()
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(self.score, 240, 220, 90, "left") 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 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 if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end
love.graphics.setFont(font_8x11) love.graphics.setFont(font_8x11)
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center") love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")

View File

@ -105,10 +105,11 @@ function SurvivalA2Game:onLineClear(cleared_row_count)
end end
function SurvivalA2Game:updateScore(level, drop_bonus, cleared_lines) 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 if cleared_lines > 0 then
self.score = self.score + ( self.score = self.score + (
(math.ceil((level + cleared_lines) / 4) + drop_bonus) * (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.lines = self.lines + cleared_lines
self.combo = self.combo + (cleared_lines - 1) * 2 self.combo = self.combo + (cleared_lines - 1) * 2