cambridge/tetris/modes/big_a2.lua

50 lines
1.5 KiB
Lua
Raw Permalink Normal View History

local GameMode = require 'tetris.modes.gamemode'
2021-03-08 19:59:51 -06:00
local MarathonA2Game = require 'tetris.modes.marathon_a2'
2020-10-05 10:11:46 -05:00
2021-03-08 19:59:51 -06:00
local BigA2Game = MarathonA2Game:extend()
2020-10-05 10:11:46 -05:00
2021-03-08 19:59:51 -06:00
BigA2Game.name = "Big A2"
BigA2Game.hash = "BigA2"
BigA2Game.tagline = "Big blocks in the most celebrated TGM mode!"
2020-10-05 10:11:46 -05:00
2021-03-08 19:59:51 -06:00
function BigA2Game:new()
BigA2Game.super:new()
self.big_mode = true
2020-10-05 10:11:46 -05:00
end
function BigA2Game:updateScore(level, drop_bonus, cleared_lines)
cleared_lines = cleared_lines / 2
if not self.clear then
self:updateGrade(cleared_lines)
if cleared_lines >= 4 then
self.tetris_count = self.tetris_count + 1
end
if self.grid:checkForBravo(cleared_lines) then self.bravo = 4 else self.bravo = 1 end
if cleared_lines > 0 then
self.combo = self.combo + (cleared_lines - 1) * 2
self.score = self.score + (
(math.ceil((level + cleared_lines) / 4) + drop_bonus) *
cleared_lines * self.combo * self.bravo
)
else
self.combo = 1
end
self.drop_bonus = 0
else self.lines = self.lines + cleared_lines end
2020-10-05 10:11:46 -05:00
end
function BigA2Game:onLineClear(cleared_row_count)
cleared_row_count = cleared_row_count / 2
self:updateSectionTimes(self.level, self.level + cleared_row_count)
self.level = math.min(self.level + cleared_row_count, 999)
if self.level == 999 and not self.clear then
self.clear = true
self.grid:clear()
if self:qualifiesForMRoll() then self.grade = 32 end
self.roll_frames = -150
end
self.lock_drop = self.level >= 900
self.lock_hard_drop = self.level >= 900
2020-10-05 10:11:46 -05:00
end
2021-03-08 19:59:51 -06:00
return BigA2Game