Added Ti-SRS and modified delay curve behaviour on Marathon 2020.

I realized that playing at 4/8 for 800 levels straight is probably too much,
so I made it that only the first 10 sections count for advancing the delay
curve faster than it would normally go. Now only the last 500 levels can be
at delay level 20.
This commit is contained in:
Joe Z 2019-06-21 23:41:53 -04:00
parent 7deaa5ab92
commit 35f4aea67d
8 changed files with 61 additions and 23 deletions

View File

@ -10,16 +10,13 @@ A ruleset consists of the following things:
If you're used to Nullpomino, you may notice a few things missing from that definition. For example, piece previews, hold queues, and randomizers have been moved to being game-specific rules, rather than rules that are changeable with the ruleset you use. Soft and hard drop behaviour is also game-specific now, so that times can be more plausibly compared across rulesets.
There are six rulesets currently supported:
Rotation system
---------------
A rotation system defines the following things:
* The block offsets of each piece orientation.
* The wall or floor kicks that will be attempted for each type of rotation.
* Cambridge - a ruleset original to Cambridge, used for all custom modes. Supports 180-degree rotations!
There are four rotation systems currently supported:
* SRS - the rotation system used in the Tetris Guideline games. Supports 180-degree rotations!
* Ti-SRS - SRS but with no 180-degree rotations.
* Cambridge
* Classic ARS
* Ti-ARS
* SRS
* ARS - the rotation system from the original Tetris the Grand Master.
* Ti-ARS - ARS with floorkicks! From TGM3: Terror Instinct.
* Ace-ARS - ARS with floorkicks and move reset!

View File

@ -32,10 +32,11 @@ game_modes = {
rulesets = {
require 'tetris.rulesets.cambridge',
require 'tetris.rulesets.standard',
require 'tetris.rulesets.standard_ti',
require 'tetris.rulesets.arika',
require 'tetris.rulesets.arika_ti',
require 'tetris.rulesets.arika_ace',
require 'tetris.rulesets.standard_exp',
--require 'tetris.rulesets.bonkers',
--require 'tetris.rulesets.shirase',
--require 'tetris.rulesets.super302',

View File

@ -392,8 +392,7 @@ function GameMode:drawScoringInfo()
love.graphics.print(
self.das.direction .. " " ..
self.das.frames .. " " ..
st(self.prev_inputs) ..
self.drop_bonus
st(self.prev_inputs)
)
love.graphics.setFont(font_8x11)
@ -403,7 +402,7 @@ end
function GameMode:drawSectionTimes(current_section)
local section_x = 530
for section, time in pairs(self.section_times) do
for section, time in ipairs(self.section_times) do
if section > 0 then
love.graphics.printf(formatTime(time), section_x, 40 + 20 * section, 90, "left")
end
@ -412,7 +411,7 @@ function GameMode:drawSectionTimes(current_section)
love.graphics.printf(formatTime(self.frames - self.section_start_time), section_x, 40 + 20 * current_section, 90, "left")
end
function GameMode:drawSectionTimesWithSecondary(current_section)
function GameMode:drawSectionTimesWithSecondary(current_section, section_colour_function)
local section_x = 530
local section_secondary_x = 440
@ -423,6 +422,9 @@ function GameMode:drawSectionTimesWithSecondary(current_section)
end
for section, time in pairs(self.secondary_section_times) do
if self.section_colour_function then
love.graphics.setColor(self:section_colour_function(section))
end
if section > 0 then
love.graphics.printf(formatTime(time), section_secondary_x, 40 + 20 * section, 90, "left")
end

View File

@ -323,9 +323,9 @@ function Marathon2020Game:checkClear(level)
end
function Marathon2020Game:updateSectionTimes(old_level, new_level)
function sectionCool()
function sectionCool(section)
self.section_cool_count = self.section_cool_count + 1
self.delay_level = math.min(20, self.delay_level + 1)
if section < 10 then self.delay_level = math.min(20, self.delay_level + 1) end
table.insert(self.section_status, "cool")
end
@ -343,7 +343,7 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
table.insert(self.section_times, section_time)
self.section_start_time = self.frames
if section > 4 then self.delay_level = math.min(20, self.delay_level + 1) end
if section > 5 then self.delay_level = math.min(20, self.delay_level + 1) end
self:checkTorikan(section)
self:checkClear(new_level)
@ -352,11 +352,11 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
self.secondary_section_times[section] < self.secondary_section_times[section - 1] + 120 and
self.secondary_section_times[section] < cool_cutoffs[section]
) then
sectionCool()
sectionCool(section)
elseif self.section_status[section - 1] == "cool" then
table.insert(self.section_status, "none")
elseif section <= 19 and self.secondary_section_times[section] < cool_cutoffs[section] then
sectionCool()
sectionCool(section)
else
table.insert(self.section_status, "none")
end
@ -417,6 +417,14 @@ function Marathon2020Game:drawGrid()
end
end
function Marathon2020Game:sectionColourFunction(section)
if self.section_status[section] == "cool" then
return { 0, 1, 0, 1 }
else
return { 1, 1, 1, 1 }
end
end
function Marathon2020Game:drawScoringInfo()
Marathon2020Game.super.drawScoringInfo(self)
@ -428,7 +436,7 @@ function Marathon2020Game:drawScoringInfo()
love.graphics.printf("GRADE PTS.", text_x, 200, 90, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left")
self:drawSectionTimesWithSecondary(current_section)
self:drawSectionTimesWithSecondary(current_section, self.sectionColourFunction)
love.graphics.setFont(font_3x5_3)
love.graphics.printf(self:getTotalGrade(), text_x, 120, 90, "left")

View File

@ -132,10 +132,10 @@ function SurvivalA3Game:onLineClear(cleared_row_count)
if new_level >= 1300 or self:hitTorikan(self.level, new_level) then
if new_level >= 1300 then
self.level = 1300
self.big_mode = true
end
self.clear = true
self.grid:clear()
self.big_mode = true
self.roll_frames = -150
else
self.level = math.min(new_level, 1300)

View File

@ -1,6 +1,6 @@
require 'funcs'
local MarathonAX2 = require 'tetris.modes.marathon_AX2'
local MarathonAX2 = require 'tetris.modes.marathon_ax2'
local Piece = require 'tetris.components.piece'
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'

View File

@ -0,0 +1,30 @@
local Standard = require 'tetris.rulesets.standard'
local SRS = Standard:extend()
SRS.name = "Ti-SRS"
SRS.hash = "StandardTI"
function SRS:onPieceMove(piece, grid)
piece.lock_delay = 0 -- move reset
if piece:isDropBlocked(grid) then
piece.move_counter = piece.move_counter + 1
if piece.move_counter >= 10 then
piece.locked = true
end
end
end
function SRS:onPieceRotate(piece, grid)
piece.lock_delay = 0 -- rotate reset
if piece:isDropBlocked(grid) then
piece.rotate_counter = piece.rotate_counter + 1
if piece.rotate_counter >= 8 then
piece.locked = true
end
end
end
function SRS:get180RotationValue() return config["reverse_rotate"] and 1 or 3 end
return SRS