mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 08:39:03 -06:00
Proper bravo detection!
This commit is contained in:
parent
4e8a237de3
commit
6178b2cee9
@ -185,6 +185,15 @@ function Grid:applyBigPiece(piece)
|
||||
end
|
||||
end
|
||||
|
||||
function Grid:checkForBravo(cleared_row_count)
|
||||
for i = 0, 23 - cleared_row_count do
|
||||
for j = 0, 9 do
|
||||
if self:isOccupied(j, i) then return false end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function Grid:update()
|
||||
for y = 1, 24 do
|
||||
for x = 1, 10 do
|
||||
|
@ -127,15 +127,7 @@ function KonohaGame:onLineClear(cleared_row_count)
|
||||
local oldtime = self.time_limit
|
||||
|
||||
self.level = self.level + cleared_row_levels[cleared_row_count / 2]
|
||||
self.bravo = true
|
||||
for i = 0, 23 - cleared_row_count do
|
||||
for j = 0, 9 do
|
||||
if self.grid:isOccupied(j, i) then
|
||||
self.bravo = false
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.bravo then
|
||||
if self.grid:checkForBravo(cleared_row_count) then
|
||||
self.bravos = self.bravos + 1
|
||||
if self.level < 1000 then self.time_limit = self.time_limit + bravo_bonus[cleared_row_count / 2]
|
||||
else self.time_limit = self.time_limit + bravo_ot_bonus[cleared_row_count / 2]
|
||||
|
Loading…
Reference in New Issue
Block a user