mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-21 15:29:03 -06:00
Simplified Big A2 code
This commit is contained in:
parent
e69659b2ad
commit
cd90405865
@ -10,41 +10,10 @@ BigA2Game.tagline = "Big blocks in the most celebrated TGM mode!"
|
|||||||
function BigA2Game:new()
|
function BigA2Game:new()
|
||||||
BigA2Game.super:new()
|
BigA2Game.super:new()
|
||||||
self.big_mode = true
|
self.big_mode = true
|
||||||
end
|
local getClearedRowCount = self.grid.getClearedRowCount
|
||||||
|
self.grid.getClearedRowCount = function(self)
|
||||||
function BigA2Game:updateScore(level, drop_bonus, cleared_lines)
|
return getClearedRowCount(self) / 2
|
||||||
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
|
|
||||||
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
|
end
|
||||||
self.lock_drop = self.level >= 900
|
|
||||||
self.lock_hard_drop = self.level >= 900
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return BigA2Game
|
return BigA2Game
|
Loading…
Reference in New Issue
Block a user