Compare commits

...

3 Commits

Author SHA1 Message Date
Ishaan Bhardwaj
c5c4c4d95c Fixed delay curve calculation in Marathon 2020 2021-07-11 15:38:38 -04:00
Ishaan Bhardwaj
53c51c2062 Removed debug code for Marathon 2020 2021-07-11 14:57:14 -04:00
Ishaan Bhardwaj
e4eb9972e6 Fixed section COOL conditions for Marathon 2020 2021-07-11 14:55:45 -04:00

View File

@ -84,7 +84,6 @@ function Marathon2020Game:getLineClearDelay()
end end
function Marathon2020Game:getLockDelay() function Marathon2020Game:getLockDelay()
--[[
if self.delay_level < 6 then return 30 if self.delay_level < 6 then return 30
elseif self.delay_level < 7 then return 26 elseif self.delay_level < 7 then return 26
elseif self.delay_level < 8 then return 22 elseif self.delay_level < 8 then return 22
@ -96,7 +95,6 @@ function Marathon2020Game:getLockDelay()
elseif self.delay_level < 19 then return 10 elseif self.delay_level < 19 then return 10
elseif self.delay_level < 20 then return 9 elseif self.delay_level < 20 then return 9
else return 8 end else return 8 end
]] return 1
end end
function Marathon2020Game:getGravity() function Marathon2020Game:getGravity()
@ -156,11 +154,11 @@ function Marathon2020Game:advanceOneFrame()
end end
local cool_cutoffs = { local cool_cutoffs = {
frameTime(0,45,00), frameTime(0,41,50), frameTime(0,38,50), frameTime(0,35,00), frameTime(0,32,50), [0] = frameTime(0,45,00),
frameTime(0,29,20), frameTime(0,27,20), frameTime(0,24,80), frameTime(0,22,80), frameTime(0,20,60), frameTime(0,41,50), frameTime(0,38,50), frameTime(0,35,00), frameTime(0,32,50), frameTime(0,29,20),
frameTime(0,19,60), frameTime(0,19,40), frameTime(0,19,40), frameTime(0,18,40), frameTime(0,18,20), frameTime(0,27,20), frameTime(0,24,80), frameTime(0,22,80), frameTime(0,20,60), frameTime(0,19,60),
frameTime(0,16,20), frameTime(0,16,20), frameTime(0,16,20), frameTime(0,16,20), frameTime(0,16,20), frameTime(0,19,40), frameTime(0,19,40), frameTime(0,18,40), frameTime(0,18,20), frameTime(0,16,20),
frameTime(0,15,20) frameTime(0,16,20), frameTime(0,16,20), frameTime(0,16,20), frameTime(0,16,20), frameTime(0,15,20)
} }
local levels_for_cleared_rows = { 1, 2, 4, 6 } local levels_for_cleared_rows = { 1, 2, 4, 6 }
@ -256,7 +254,7 @@ function Marathon2020Game:getTotalGrade()
end end
local function getSectionForLevel(level) local function getSectionForLevel(level)
if level < 2001 then if level < 2000 then
return math.floor(level / 100) + 1 return math.floor(level / 100) + 1
elseif level < 2020 then elseif level < 2020 then
return 20 return 20
@ -333,7 +331,7 @@ end
function Marathon2020Game:updateSectionTimes(old_level, new_level) function Marathon2020Game:updateSectionTimes(old_level, new_level)
function sectionCool(section) function sectionCool(section)
self.section_cool_count = self.section_cool_count + 1 self.section_cool_count = self.section_cool_count + 1
if section < 10 then if section <= 10 then
self.delay_level = math.min(20, self.delay_level + 1) self.delay_level = math.min(20, self.delay_level + 1)
end end
table.insert(self.section_status, "cool") table.insert(self.section_status, "cool")
@ -354,23 +352,25 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
table.insert(self.section_times, section_time) table.insert(self.section_times, section_time)
self.section_start_time = self.frames self.section_start_time = self.frames
if section > 5 then self.delay_level = math.min(20, self.delay_level + 1) end
self:checkTorikan(section)
self:checkClear(new_level)
if ( if (
self.section_status[section - 1] == "cool" and self.section_status[section - 1] == "cool" and
self.secondary_section_times[section] < self.secondary_section_times[section - 1] + 120 and self.secondary_section_times[section] < self.secondary_section_times[section - 1] + 120 and
self.secondary_section_times[section] < cool_cutoffs[section] self.secondary_section_times[section] < cool_cutoffs[self.delay_level]
) then ) then
sectionCool(section) sectionCool(section)
elseif self.section_status[section - 1] == "cool" then elseif self.section_status[section - 1] == "cool" then
table.insert(self.section_status, "none") table.insert(self.section_status, "none")
elseif self.secondary_section_times[section] < cool_cutoffs[section] then elseif self.secondary_section_times[section] < cool_cutoffs[self.delay_level] then
sectionCool(section) sectionCool(section)
else else
table.insert(self.section_status, "none") table.insert(self.section_status, "none")
end end
if section > 5 then
self.delay_level = math.min(20, self.delay_level + 1)
end
self:checkTorikan(section)
self:checkClear(new_level)
end end
end end