mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
12 Commits
0572803627
...
v0.1.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b9740768b | ||
|
|
0e65b39395 | ||
|
|
ca04333bb7 | ||
|
|
80c7c99bd7 | ||
|
|
717afbebf6 | ||
|
|
7227085f84 | ||
|
|
c40392f00f | ||
|
|
001c8f0ea8 | ||
|
|
7fa0e60145 | ||
|
|
901f7f2d12 | ||
|
|
35f4aea67d | ||
|
|
7deaa5ab92 |
@@ -15,7 +15,9 @@ There are several classes of game modes. The modes that originate from other gam
|
||||
* The "G" series stand for "Guideline" games, or games that follow the Tetris Guideline.
|
||||
* GF - Tetris Friends (2007-2019)
|
||||
* GJ - Tetris Online Japan (2005-2011)
|
||||
* N stands for Nullpomino, only used for Phantom Mania N.
|
||||
* The "N" series stands for Nullpomino, only used for Phantom Mania N.
|
||||
* The "W" series stands for "Web" games, which are fanmade games released on the web.
|
||||
* WCB - RainComplex.net's Cat Boi Quatro.
|
||||
|
||||
MARATHON
|
||||
--------
|
||||
@@ -23,12 +25,15 @@ MARATHON
|
||||
Modes in which the goal is to play as well as possible over a limited game interval.
|
||||
|
||||
* **MARATHON 2020**: 2020 levels of pure pain. Can you make it all the way?
|
||||
* **MARATHON WCB**: CatBoiQuatro! Can you control the pieces?
|
||||
|
||||
From other games:
|
||||
* **MARATHON A1**: Tetris the Grand Master 1.
|
||||
* **MARATHON A2**: Tetris the Grand Master 2 (TAP Master).
|
||||
* **MARATHON A3**: Tetris the Grand Master 3 (no exams).
|
||||
* **MARATHON AX4**: Another mode from TGM Ace.
|
||||
* **MARATHON AX**: Normal mode from TGM Ace.
|
||||
* **MARATHON AX2**: Hi-Speed1 mode from TGM Ace.
|
||||
* **MARATHON AX3**: Hi-Speed2 mode from TGM Ace.
|
||||
* **MARATHON C89**: Nintendo NES Tetris. Can you transition and make it to the killscreen?
|
||||
|
||||
|
||||
@@ -43,6 +48,8 @@ From other games:
|
||||
* **SURVIVAL A1**: 20G mode from Tetris the Grand Master.
|
||||
* **SURVIVAL A2**: T.A. Death.
|
||||
* **SURVIVAL A3**: Ti Shirase.
|
||||
* **SURVIVAL AX**: Another mode from TGM Ace.
|
||||
* **SURVIVAL AX2**: Another2 mode from TGM Ace.
|
||||
|
||||
|
||||
RACE
|
||||
@@ -53,6 +60,14 @@ Modes with no levels, just a single timed goal.
|
||||
* **Race 40**: How fast can you clear 40 lines? No limits, no holds barred.
|
||||
|
||||
|
||||
CREDITS
|
||||
-------
|
||||
|
||||
Modes that are just the credit rolls of specific games.
|
||||
|
||||
* **CREDITS A3**: Tetris the Grand Master 3's famous M-roll.
|
||||
|
||||
|
||||
PHANTOM MANIA
|
||||
-------------
|
||||
|
||||
@@ -63,7 +78,6 @@ Modes where pieces turn invisible as soon as you lock them. One of Cambridge's s
|
||||
* **Phantom Mania 2**: Phantom Mania but way faster! Can you face a mode where even the garbage and the next preview turn invisible?
|
||||
|
||||
|
||||
|
||||
OTHER MODES
|
||||
-----------
|
||||
|
||||
|
||||
@@ -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! From TGM ACE.
|
||||
1
main.lua
1
main.lua
@@ -11,6 +11,7 @@ function love.load()
|
||||
config["side_next"] = false
|
||||
config["reverse_rotate"] = true
|
||||
config["fullscreen"] = false
|
||||
config["das_last_key"] = false
|
||||
|
||||
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
|
||||
|
||||
|
||||
Binary file not shown.
@@ -5,12 +5,15 @@ ModeSelectScene.title = "Game Start"
|
||||
current_mode = 1
|
||||
current_ruleset = 1
|
||||
|
||||
MAX_MODES = 19
|
||||
|
||||
game_modes = {
|
||||
require 'tetris.modes.marathon_2020',
|
||||
require 'tetris.modes.survival_2020',
|
||||
require 'tetris.modes.strategy',
|
||||
require 'tetris.modes.interval_training',
|
||||
require 'tetris.modes.pacer_test',
|
||||
require 'tetris.modes.marathon_wcb',
|
||||
require 'tetris.modes.demon_mode',
|
||||
require 'tetris.modes.phantom_mania',
|
||||
require 'tetris.modes.phantom_mania2',
|
||||
@@ -19,18 +22,25 @@ game_modes = {
|
||||
require 'tetris.modes.marathon_a1',
|
||||
require 'tetris.modes.marathon_a2',
|
||||
require 'tetris.modes.marathon_a3',
|
||||
require 'tetris.modes.marathon_ax4',
|
||||
require 'tetris.modes.marathon_ax',
|
||||
require 'tetris.modes.marathon_ax2',
|
||||
require 'tetris.modes.marathon_ax3',
|
||||
require 'tetris.modes.marathon_c89',
|
||||
require 'tetris.modes.survival_a1',
|
||||
require 'tetris.modes.survival_a2',
|
||||
require 'tetris.modes.survival_a3',
|
||||
require 'tetris.modes.survival_ax',
|
||||
require 'tetris.modes.survival_ax2',
|
||||
require 'tetris.modes.credits_a3',
|
||||
}
|
||||
|
||||
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.standard_exp',
|
||||
require 'tetris.rulesets.arika_ace',
|
||||
--require 'tetris.rulesets.bonkers',
|
||||
--require 'tetris.rulesets.shirase',
|
||||
--require 'tetris.rulesets.super302',
|
||||
@@ -47,38 +57,58 @@ end
|
||||
function ModeSelectScene:update()
|
||||
end
|
||||
|
||||
function getCursorHeight(x)
|
||||
return 78 + 20 * x
|
||||
end
|
||||
|
||||
|
||||
function ModeSelectScene:drawList(name, items, cursor, x)
|
||||
local start, finish
|
||||
if table.getn(items) < MAX_MODES then
|
||||
start = 1
|
||||
finish = table.getn(items)
|
||||
else
|
||||
if cursor < 10 then
|
||||
start = 1
|
||||
finish = 19
|
||||
elseif cursor > table.getn(items) - 9 then
|
||||
start = table.getn(items) - 18
|
||||
finish = table.getn(items)
|
||||
else
|
||||
start = cursor - 9
|
||||
finish = cursor + 9
|
||||
end
|
||||
end
|
||||
|
||||
if self.menu_state.select == name then
|
||||
love.graphics.setColor(1, 1, 1, 0.5)
|
||||
else
|
||||
love.graphics.setColor(1, 1, 1, 0.25)
|
||||
end
|
||||
love.graphics.rectangle("fill", x, getCursorHeight(cursor - start), 240, 22)
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
for idx = start, finish do
|
||||
local item = items[idx]
|
||||
love.graphics.printf(item.name, x + 20, 80 + 20 * (idx - start), 200, "left")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function ModeSelectScene:render()
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
|
||||
love.graphics.draw(
|
||||
backgrounds[0],
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
if self.menu_state.select == "mode" then
|
||||
love.graphics.setColor(1, 1, 1, 0.5)
|
||||
elseif self.menu_state.select == "ruleset" then
|
||||
love.graphics.setColor(1, 1, 1, 0.25)
|
||||
end
|
||||
love.graphics.rectangle("fill", 20, 78 + 20 * self.menu_state.mode, 240, 22)
|
||||
love.graphics.draw(misc_graphics["select_mode"], 20, 30)
|
||||
|
||||
if self.menu_state.select == "mode" then
|
||||
love.graphics.setColor(1, 1, 1, 0.25)
|
||||
elseif self.menu_state.select == "ruleset" then
|
||||
love.graphics.setColor(1, 1, 1, 0.5)
|
||||
end
|
||||
love.graphics.rectangle("fill", 340, 78 + 20 * self.menu_state.ruleset, 200, 22)
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
love.graphics.draw(misc_graphics["select_mode"], 20, 40)
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
for idx, mode in pairs(game_modes) do
|
||||
love.graphics.printf(mode.name, 40, 80 + 20 * idx, 200, "left")
|
||||
end
|
||||
for idx, ruleset in pairs(rulesets) do
|
||||
love.graphics.printf(ruleset.name, 360, 80 + 20 * idx, 160, "left")
|
||||
end
|
||||
self:drawList("mode", game_modes, self.menu_state.mode, 20)
|
||||
self:drawList("ruleset", rulesets, self.menu_state.ruleset, 320)
|
||||
end
|
||||
|
||||
function ModeSelectScene:onKeyPress(e)
|
||||
|
||||
@@ -77,12 +77,15 @@ function Piece:setRelativeRotation(rot)
|
||||
return self
|
||||
end
|
||||
|
||||
function Piece:moveInGrid(step, squares, grid)
|
||||
function Piece:moveInGrid(step, squares, grid, instant)
|
||||
local moved = false
|
||||
for x = 1, squares do
|
||||
if grid:canPlacePiece(self:withOffset(step)) then
|
||||
moved = true
|
||||
self:setOffset(step)
|
||||
if instant then
|
||||
self:dropToBottom(grid)
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
|
||||
119
tetris/modes/credits_a3.lua
Normal file
119
tetris/modes/credits_a3.lua
Normal file
@@ -0,0 +1,119 @@
|
||||
require 'funcs'
|
||||
|
||||
local IntervalTrainingMode = require 'tetris.modes.interval_training'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local CreditsA3Game = IntervalTrainingMode:extend()
|
||||
|
||||
CreditsA3Game.name = "Credits A3"
|
||||
CreditsA3Game.hash = "CreditsA3"
|
||||
CreditsA3Game.tagline = "How consistently can you clear the Ti M-roll?"
|
||||
|
||||
function CreditsA3Game:new()
|
||||
CreditsA3Game.super:new()
|
||||
self.section_time_limit = 3238
|
||||
self.norm = 0
|
||||
self.section = 0
|
||||
end
|
||||
|
||||
function CreditsA3Game:advanceOneFrame(inputs, ruleset)
|
||||
if self.frames == 0 then
|
||||
switchBGM("credit_roll", "gm3")
|
||||
end
|
||||
if self.roll_frames > 0 then
|
||||
self.roll_frames = self.roll_frames - 1
|
||||
if self.roll_frames == 0 then
|
||||
-- reset
|
||||
self.norm = 0
|
||||
self.frames = 0
|
||||
self.grid:clear()
|
||||
switchBGM("credit_roll", "gm3")
|
||||
self:initializeOrHold(inputs, ruleset)
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif self.ready_frames == 0 then
|
||||
self.frames = self.frames + 1
|
||||
if self:getSectionTime() >= self.section_time_limit then
|
||||
self.norm = self.norm + 16
|
||||
self.piece = nil
|
||||
if self.norm >= 60 then
|
||||
self.section = self.section + 1
|
||||
self.roll_frames = 150
|
||||
else
|
||||
self.game_over = true
|
||||
switchBGM(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function CreditsA3Game:onPieceEnter()
|
||||
-- do nothing
|
||||
end
|
||||
|
||||
function CreditsA3Game:onLineClear(cleared_row_count)
|
||||
if not self.clear then
|
||||
self.norm = self.norm + (cleared_row_count == 4 and 10 or cleared_row_count)
|
||||
end
|
||||
end
|
||||
|
||||
CreditsA3Game.rollOpacityFunction = function(age)
|
||||
if age > 4 then return 0
|
||||
else return 1 - age / 4 end
|
||||
end
|
||||
|
||||
function CreditsA3Game:drawGrid(ruleset)
|
||||
if not self.game_over and self.roll_frames < 30 then
|
||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
||||
else
|
||||
self.grid:draw()
|
||||
end
|
||||
end
|
||||
|
||||
function CreditsA3Game:drawScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
love.graphics.print(
|
||||
self.das.direction .. " " ..
|
||||
self.das.frames .. " " ..
|
||||
st(self.prev_inputs)
|
||||
)
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
love.graphics.printf("TIME LEFT", 240, 250, 80, "left")
|
||||
love.graphics.printf("NORM", 240, 320, 40, "left")
|
||||
|
||||
self:drawSectionTimesWithSplits(self.section)
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
-- draw time left, flash red if necessary
|
||||
local time_left = self.section_time_limit - math.max(self:getSectionTime(), 0)
|
||||
|
||||
if not self.game_over and not self.clear and time_left < sp(0,10) and time_left % 4 < 2 then
|
||||
if self.norm >= 44 then
|
||||
love.graphics.setColor(0.3, 1, 0.3, 1) -- flash green if goal has been cleared
|
||||
else
|
||||
love.graphics.setColor(1, 0.3, 0.3, 1) -- otherwise flash red
|
||||
end
|
||||
end
|
||||
|
||||
love.graphics.printf(formatTime(time_left), 240, 270, 160, "left")
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.printf(self.norm, 240, 340, 40, "right")
|
||||
if self.game_over or self.roll_frames > 0 then
|
||||
love.graphics.printf("60", 240, 370, 40, "right")
|
||||
else
|
||||
love.graphics.printf("44", 240, 370, 40, "right")
|
||||
end
|
||||
end
|
||||
|
||||
function CreditsA3Game:getBackground()
|
||||
return self.section
|
||||
end
|
||||
|
||||
return CreditsA3Game
|
||||
@@ -91,10 +91,20 @@ function GameMode:update(inputs, ruleset)
|
||||
if self.completed then return end
|
||||
|
||||
-- advance one frame
|
||||
if self:advanceOneFrame(inputs) == false then return end
|
||||
if self:advanceOneFrame(inputs, ruleset) == false then return end
|
||||
|
||||
self:chargeDAS(inputs, self:getDasLimit(), self.getARR())
|
||||
|
||||
-- set attempt flags
|
||||
if inputs["left"] or inputs["right"] then self:onAttemptPieceMove(self.piece) end
|
||||
if
|
||||
inputs["rotate_left"] or inputs["rotate_right"] or
|
||||
inputs["rotate_left2"] or inputs["rotate_right2"] or
|
||||
inputs["rotate_180"]
|
||||
then
|
||||
self:onAttemptPieceRotate(self.piece)
|
||||
end
|
||||
|
||||
if self.piece == nil then
|
||||
self:processDelays(inputs, ruleset)
|
||||
else
|
||||
@@ -152,6 +162,10 @@ function GameMode:update(inputs, ruleset)
|
||||
|
||||
local cleared_row_count = self.grid:getClearedRowCount()
|
||||
|
||||
if self.big_mode then
|
||||
cleared_row_count = cleared_row_count / 2
|
||||
end
|
||||
|
||||
self:onPieceLock(self.piece, cleared_row_count)
|
||||
self:updateScore(self.level, self.drop_bonus, cleared_row_count)
|
||||
|
||||
@@ -194,6 +208,8 @@ end
|
||||
|
||||
-- event functions
|
||||
function GameMode:whilePieceActive() end
|
||||
function GameMode:onAttemptPieceMove(piece) end
|
||||
function GameMode:onAttemptPieceRotate(piece) end
|
||||
function GameMode:onPieceLock(piece, cleared_row_count) end
|
||||
function GameMode:onLineClear(cleared_row_count) end
|
||||
function GameMode:onPieceEnter() end
|
||||
@@ -211,30 +227,66 @@ function GameMode:onGameOver()
|
||||
switchBGM(nil)
|
||||
end
|
||||
|
||||
function GameMode:chargeDAS(inputs)
|
||||
if inputs[self.das.direction] == true then
|
||||
local das_frames = self.das.frames + 1
|
||||
if das_frames >= self:getDasLimit() then
|
||||
if self.das.direction == "left" then
|
||||
self.move = (self:getARR() == 0 and "speed" or "") .. "left"
|
||||
self.das.frames = self:getDasLimit() - self:getARR()
|
||||
elseif self.das.direction == "right" then
|
||||
self.move = (self:getARR() == 0 and "speed" or "") .. "right"
|
||||
self.das.frames = self:getDasLimit() - self:getARR()
|
||||
end
|
||||
else
|
||||
self.move = "none"
|
||||
self.das.frames = das_frames
|
||||
-- DAS functions
|
||||
|
||||
function GameMode:startRightDAS()
|
||||
self.move = "right"
|
||||
self.das = { direction = "right", frames = 0 }
|
||||
if self:getDasLimit() == 0 then
|
||||
self:continueDAS()
|
||||
end
|
||||
end
|
||||
|
||||
function GameMode:startLeftDAS()
|
||||
self.move = "left"
|
||||
self.das = { direction = "left", frames = 0 }
|
||||
if self:getDasLimit() == 0 then
|
||||
self:continueDAS()
|
||||
end
|
||||
end
|
||||
|
||||
function GameMode:continueDAS()
|
||||
local das_frames = self.das.frames + 1
|
||||
if das_frames >= self:getDasLimit() then
|
||||
if self.das.direction == "left" then
|
||||
self.move = (self:getARR() == 0 and "speed" or "") .. "left"
|
||||
self.das.frames = self:getDasLimit() - self:getARR()
|
||||
elseif self.das.direction == "right" then
|
||||
self.move = (self:getARR() == 0 and "speed" or "") .. "right"
|
||||
self.das.frames = self:getDasLimit() - self:getARR()
|
||||
end
|
||||
elseif inputs["right"] == true then
|
||||
self.move = "right"
|
||||
self.das = { direction = "right", frames = 0 }
|
||||
elseif inputs["left"] == true then
|
||||
self.move = "left"
|
||||
self.das = { direction = "left", frames = 0 }
|
||||
else
|
||||
self.move = "none"
|
||||
self.das = { direction = "none", frames = -1 }
|
||||
self.das.frames = das_frames
|
||||
end
|
||||
end
|
||||
|
||||
function GameMode:stopDAS()
|
||||
self.move = "none"
|
||||
self.das = { direction = "none", frames = -1 }
|
||||
end
|
||||
|
||||
function GameMode:chargeDAS(inputs)
|
||||
if config["das_last_key"] then
|
||||
if inputs["right"] == true and self.das.direction ~= "right" and not self.prev_inputs["right"] then
|
||||
self:startRightDAS()
|
||||
elseif inputs["left"] == true and self.das.direction ~= "left" and not self.prev_inputs["left"] then
|
||||
self:startLeftDAS()
|
||||
elseif inputs[self.das.direction] == true then
|
||||
self:continueDAS()
|
||||
else
|
||||
self:stopDAS()
|
||||
end
|
||||
else -- default behaviour, das first key pressed
|
||||
if inputs[self.das.direction] == true then
|
||||
self:continueDAS()
|
||||
elseif inputs["right"] == true then
|
||||
self:startRightDAS()
|
||||
elseif inputs["left"] == true then
|
||||
self:startLeftDAS()
|
||||
else
|
||||
self:stopDAS()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -392,8 +444,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 +454,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 +463,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 +474,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
|
||||
|
||||
@@ -28,19 +28,19 @@ function IntervalTrainingGame:new()
|
||||
end
|
||||
|
||||
function IntervalTrainingGame:getARE()
|
||||
return 4
|
||||
return 6
|
||||
end
|
||||
|
||||
function IntervalTrainingGame:getLineARE()
|
||||
return 4
|
||||
return 6
|
||||
end
|
||||
|
||||
function IntervalTrainingGame:getDasLimit()
|
||||
return 6
|
||||
return 7
|
||||
end
|
||||
|
||||
function IntervalTrainingGame:getLineClearDelay()
|
||||
return 6
|
||||
return 4
|
||||
end
|
||||
|
||||
function IntervalTrainingGame:getLockDelay()
|
||||
@@ -130,8 +130,6 @@ function IntervalTrainingGame:drawScoringInfo()
|
||||
self:drawSectionTimesWithSplits(current_section)
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
love.graphics.printf(self.level, 240, 340, 40, "right")
|
||||
|
||||
-- draw time left, flash red if necessary
|
||||
local time_left = self.section_time_limit - math.max(self:getSectionTime(), 0)
|
||||
if not self.game_over and not self.clear and time_left < sp(0,10) and time_left % 4 < 2 then
|
||||
@@ -140,6 +138,7 @@ function IntervalTrainingGame:drawScoringInfo()
|
||||
love.graphics.printf(formatTime(time_left), 240, 270, 160, "left")
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.printf(self.level, 240, 340, 40, "right")
|
||||
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
|
||||
end
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -12,7 +12,6 @@ MarathonA1Game.hash = "MarathonA1"
|
||||
MarathonA1Game.tagline = "Can you score enough points to reach the title of Grand Master?"
|
||||
|
||||
|
||||
|
||||
function MarathonA1Game:new()
|
||||
MarathonA1Game.super:new()
|
||||
|
||||
@@ -131,7 +130,8 @@ function MarathonA1Game:onLineClear(cleared_row_count)
|
||||
self:checkGMRequirements(self.level, self.level + cleared_row_count)
|
||||
if not self.clear then
|
||||
local new_level = math.min(self.level + cleared_row_count, 999)
|
||||
if self.level == 999 then
|
||||
if new_level == 999 then
|
||||
self.level = 999
|
||||
self.clear = true
|
||||
else
|
||||
self.level = new_level
|
||||
@@ -140,6 +140,7 @@ function MarathonA1Game:onLineClear(cleared_row_count)
|
||||
end
|
||||
|
||||
function MarathonA1Game:updateScore(level, drop_bonus, cleared_lines)
|
||||
if self.clear then return end
|
||||
if cleared_lines > 0 then
|
||||
self.combo = self.combo + (cleared_lines - 1) * 2
|
||||
self.score = self.score + (
|
||||
|
||||
@@ -5,20 +5,19 @@ local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local MarathonAX4Game = GameMode:extend()
|
||||
local MarathonAXGame = GameMode:extend()
|
||||
|
||||
MarathonAX4Game.name = "Marathon AX4"
|
||||
MarathonAX4Game.hash = "MarathonAX4"
|
||||
MarathonAX4Game.tagline = "Can you clear the time hurdles when the game goes this fast?"
|
||||
MarathonAXGame.name = "Marathon AX"
|
||||
MarathonAXGame.hash = "MarathonAX"
|
||||
MarathonAXGame.tagline = "Can you clear the time hurdles when the game goes this fast?"
|
||||
|
||||
|
||||
function MarathonAX4Game:new()
|
||||
MarathonAX4Game.super:new()
|
||||
function MarathonAXGame:new()
|
||||
MarathonAXGame.super:new()
|
||||
|
||||
self.roll_frames = 0
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.section_time_limit = 3600
|
||||
self.section_start_time = 0
|
||||
self.section_times = { [0] = 0 }
|
||||
self.section_clear = false
|
||||
@@ -28,52 +27,48 @@ function MarathonAX4Game:new()
|
||||
self.next_queue_length = 3
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getARE()
|
||||
if self.lines < 10 then return 18
|
||||
elseif self.lines < 40 then return 14
|
||||
elseif self.lines < 60 then return 12
|
||||
elseif self.lines < 70 then return 10
|
||||
elseif self.lines < 80 then return 8
|
||||
elseif self.lines < 90 then return 7
|
||||
else return 6 end
|
||||
function MarathonAXGame:getSectionTimeLimit()
|
||||
if self.lines < 20 then return 7200
|
||||
else return 5400 end
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getLineARE()
|
||||
function MarathonAXGame:getARE()
|
||||
return 27
|
||||
end
|
||||
|
||||
function MarathonAXGame:getLineARE()
|
||||
return self:getARE()
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getDasLimit()
|
||||
if self.lines < 20 then return 10
|
||||
elseif self.lines < 50 then return 9
|
||||
elseif self.lines < 70 then return 8
|
||||
else return 7 end
|
||||
function MarathonAXGame:getDasLimit()
|
||||
return 15
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getLineClearDelay()
|
||||
if self.lines < 10 then return 14
|
||||
elseif self.lines < 30 then return 9
|
||||
else return 5 end
|
||||
function MarathonAXGame:getLineClearDelay()
|
||||
return 40
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getLockDelay()
|
||||
if self.lines < 10 then return 28
|
||||
elseif self.lines < 20 then return 24
|
||||
elseif self.lines < 30 then return 22
|
||||
elseif self.lines < 40 then return 20
|
||||
elseif self.lines < 50 then return 18
|
||||
elseif self.lines < 70 then return 14
|
||||
else return 13 end
|
||||
function MarathonAXGame:getLockDelay()
|
||||
return 30
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getGravity()
|
||||
return 20
|
||||
function MarathonAXGame:getGravity()
|
||||
if self.lines < 10 then return 4/256
|
||||
elseif self.lines < 20 then return 12/256
|
||||
elseif self.lines < 30 then return 48/256
|
||||
elseif self.lines < 40 then return 72/256
|
||||
elseif self.lines < 50 then return 96/256
|
||||
elseif self.lines < 60 then return 1/2
|
||||
elseif self.lines < 70 then return 1
|
||||
elseif self.lines < 80 then return 3/2
|
||||
elseif self.lines < 90 then return 2
|
||||
elseif self.lines < 100 then return 3
|
||||
elseif self.lines < 110 then return 4
|
||||
elseif self.lines < 120 then return 5
|
||||
else return 20 end
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getSection()
|
||||
return math.floor(level / 100) + 1
|
||||
end
|
||||
|
||||
function MarathonAX4Game:advanceOneFrame()
|
||||
function MarathonAXGame:advanceOneFrame()
|
||||
if self.clear then
|
||||
self.roll_frames = self.roll_frames + 1
|
||||
if self.roll_frames < 0 then
|
||||
@@ -85,14 +80,14 @@ function MarathonAX4Game:advanceOneFrame()
|
||||
if not self.section_clear then
|
||||
self.frames = self.frames + 1
|
||||
end
|
||||
if self:getSectionTime() >= self.section_time_limit then
|
||||
if self:getSectionTime() >= self:getSectionTimeLimit() then
|
||||
self.game_over = true
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function MarathonAX4Game:onLineClear(cleared_row_count)
|
||||
function MarathonAXGame:onLineClear(cleared_row_count)
|
||||
if not self.clear then
|
||||
local new_lines = self.lines + cleared_row_count
|
||||
self:updateSectionTimes(self.lines, new_lines)
|
||||
@@ -104,11 +99,11 @@ function MarathonAX4Game:onLineClear(cleared_row_count)
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getSectionTime()
|
||||
function MarathonAXGame:getSectionTime()
|
||||
return self.frames - self.section_start_time
|
||||
end
|
||||
|
||||
function MarathonAX4Game:updateSectionTimes(old_lines, new_lines)
|
||||
function MarathonAXGame:updateSectionTimes(old_lines, new_lines)
|
||||
if math.floor(old_lines / 10) < math.floor(new_lines / 10) then
|
||||
-- record new section
|
||||
table.insert(self.section_times, self:getSectionTime())
|
||||
@@ -117,23 +112,23 @@ function MarathonAX4Game:updateSectionTimes(old_lines, new_lines)
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonAX4Game:onPieceEnter()
|
||||
function MarathonAXGame:onPieceEnter()
|
||||
self.section_clear = false
|
||||
end
|
||||
|
||||
function MarathonAX4Game:drawGrid(ruleset)
|
||||
function MarathonAXGame:drawGrid(ruleset)
|
||||
self.grid:draw()
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getHighscoreData()
|
||||
function MarathonAXGame:getHighscoreData()
|
||||
return {
|
||||
lines = self.lines,
|
||||
frames = self.frames,
|
||||
}
|
||||
end
|
||||
|
||||
function MarathonAX4Game:drawScoringInfo()
|
||||
MarathonAX4Game.super.drawScoringInfo(self)
|
||||
function MarathonAXGame:drawScoringInfo()
|
||||
MarathonAXGame.super.drawScoringInfo(self)
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
@@ -155,7 +150,7 @@ function MarathonAX4Game:drawScoringInfo()
|
||||
love.graphics.printf(self.clear and self.lines or self:getSectionEndLines(), 240, 370, 40, "right")
|
||||
|
||||
-- draw time left, flash red if necessary
|
||||
local time_left = self.section_time_limit - math.max(self:getSectionTime(), 0)
|
||||
local time_left = self:getSectionTimeLimit() - math.max(self:getSectionTime(), 0)
|
||||
if not self.game_over and not self.clear and time_left < sp(0,10) and time_left % 4 < 2 then
|
||||
love.graphics.setColor(1, 0.3, 0.3, 1)
|
||||
end
|
||||
@@ -163,12 +158,12 @@ function MarathonAX4Game:drawScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getSectionEndLines()
|
||||
function MarathonAXGame:getSectionEndLines()
|
||||
return math.floor(self.lines / 10 + 1) * 10
|
||||
end
|
||||
|
||||
function MarathonAX4Game:getBackground()
|
||||
function MarathonAXGame:getBackground()
|
||||
return math.floor(self.lines / 10)
|
||||
end
|
||||
|
||||
return MarathonAX4Game
|
||||
return MarathonAXGame
|
||||
42
tetris/modes/marathon_ax2.lua
Normal file
42
tetris/modes/marathon_ax2.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
require 'funcs'
|
||||
|
||||
local MarathonAX = require 'tetris.modes.marathon_ax'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local MarathonAX2Game = MarathonAX:extend()
|
||||
|
||||
MarathonAX2Game.name = "Marathon AX2"
|
||||
MarathonAX2Game.hash = "MarathonAX2"
|
||||
MarathonAX2Game.tagline = "Can you clear the time hurdles when the game goes this fast?"
|
||||
|
||||
|
||||
function MarathonAX2Game:new()
|
||||
MarathonAX2Game.super:new()
|
||||
|
||||
self.roll_frames = 0
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.section_time_limit = 3600
|
||||
self.section_start_time = 0
|
||||
self.section_times = { [0] = 0 }
|
||||
self.section_clear = false
|
||||
|
||||
self.lock_drop = true
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 3
|
||||
end
|
||||
|
||||
function MarathonAX2Game:getGravity()
|
||||
if self.lines < 10 then return 84/256
|
||||
elseif self.lines < 20 then return 1/2
|
||||
elseif self.lines < 30 then return 1
|
||||
elseif self.lines < 40 then return 2
|
||||
elseif self.lines < 50 then return 3
|
||||
elseif self.lines < 60 then return 4
|
||||
elseif self.lines < 70 then return 5
|
||||
else return 20 end
|
||||
end
|
||||
|
||||
return MarathonAX2Game
|
||||
35
tetris/modes/marathon_ax3.lua
Normal file
35
tetris/modes/marathon_ax3.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
require 'funcs'
|
||||
|
||||
local MarathonAX = require 'tetris.modes.marathon_ax'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local MarathonAX3Game = MarathonAX:extend()
|
||||
|
||||
MarathonAX3Game.name = "Marathon AX3"
|
||||
MarathonAX3Game.hash = "MarathonAX3"
|
||||
MarathonAX3Game.tagline = "Can you clear the time hurdles when the game goes this fast?"
|
||||
|
||||
|
||||
function MarathonAX3Game:new()
|
||||
MarathonAX3Game.super:new()
|
||||
|
||||
self.roll_frames = 0
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.section_time_limit = 3600
|
||||
self.section_start_time = 0
|
||||
self.section_times = { [0] = 0 }
|
||||
self.section_clear = false
|
||||
|
||||
self.lock_drop = true
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 3
|
||||
end
|
||||
|
||||
function MarathonAX3Game:getGravity()
|
||||
return 20
|
||||
end
|
||||
|
||||
return MarathonAX3Game
|
||||
133
tetris/modes/marathon_wcb.lua
Normal file
133
tetris/modes/marathon_wcb.lua
Normal file
@@ -0,0 +1,133 @@
|
||||
require 'funcs'
|
||||
|
||||
local GameMode = require 'tetris.modes.gamemode'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local MarathonWCBGame = GameMode:extend()
|
||||
|
||||
MarathonWCBGame.name = "Marathon WCB"
|
||||
MarathonWCBGame.hash = "MarathonWCB"
|
||||
MarathonWCBGame.tagline = "When all the pieces slip right to their destinations... can you keep up?"
|
||||
|
||||
|
||||
function MarathonWCBGame:new()
|
||||
MarathonWCBGame.super:new()
|
||||
|
||||
self.pieces = 0
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.lock_drop = true
|
||||
self.lock_hard_drop = true
|
||||
self.instant_hard_drop = true
|
||||
self.instant_soft_drop = true
|
||||
self.enable_hold = false
|
||||
self.next_queue_length = 3
|
||||
|
||||
self.piece_is_active = false
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getDropSpeed()
|
||||
return 20
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getARR()
|
||||
return 0
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getARE()
|
||||
return 0
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getLineARE()
|
||||
return 0
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getDasLimit()
|
||||
return 0
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getLineClearDelay()
|
||||
return 0
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getLockDelay()
|
||||
return math.huge
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getGravity()
|
||||
return self.piece_is_active and 20 or 0
|
||||
end
|
||||
|
||||
function MarathonWCBGame:advanceOneFrame()
|
||||
if self.clear then
|
||||
self.roll_frames = self.roll_frames + 1
|
||||
if self.roll_frames > 150 then
|
||||
self.completed = true
|
||||
end
|
||||
return false
|
||||
elseif self.ready_frames == 0 then
|
||||
self.frames = self.frames + 1
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function MarathonWCBGame:onAttemptPieceMove()
|
||||
if self.piece ~= nil then
|
||||
-- don't let the piece move before it's finished dropping
|
||||
self.piece:dropToBottom(self.grid)
|
||||
end
|
||||
self.piece_is_active = true
|
||||
end
|
||||
|
||||
function MarathonWCBGame:onAttemptPieceRotate()
|
||||
self.piece_is_active = true
|
||||
end
|
||||
|
||||
function MarathonWCBGame:onPieceLock()
|
||||
self.piece_is_active = false
|
||||
self.pieces = self.pieces + 1
|
||||
end
|
||||
|
||||
function MarathonWCBGame:onLineClear(cleared_row_count)
|
||||
if not self.clear then
|
||||
self.lines = self.lines + cleared_row_count
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonWCBGame:drawGrid(ruleset)
|
||||
self.grid:draw()
|
||||
if self.piece ~= nil then
|
||||
self:drawGhostPiece(ruleset)
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getHighscoreData()
|
||||
return {
|
||||
pieces = self.pieces,
|
||||
frames = self.frames,
|
||||
}
|
||||
end
|
||||
|
||||
function MarathonWCBGame:drawScoringInfo()
|
||||
MarathonWCBGame.super.drawScoringInfo(self)
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
local text_x = config["side_next"] and 320 or 240
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
love.graphics.printf("lines", text_x, 160, 80, "left")
|
||||
love.graphics.printf("pieces", text_x, 220, 80, "left")
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
love.graphics.printf(self.lines, text_x, 180, 80, "left")
|
||||
love.graphics.printf(self.pieces, text_x, 240, 80, "left")
|
||||
end
|
||||
|
||||
function MarathonWCBGame:getBackground()
|
||||
return (math.floor(self.pieces / 50) % 20)
|
||||
end
|
||||
|
||||
return MarathonWCBGame
|
||||
@@ -156,7 +156,7 @@ function PhantomMania2Game:onLineClear(cleared_row_count)
|
||||
end
|
||||
self:advanceBottomRow(-cleared_row_count)
|
||||
else
|
||||
self.roll_points = self.roll_points + cleared_row_points[cleared_row_count / 2]
|
||||
self.roll_points = self.roll_points + cleared_row_points[cleared_row_count]
|
||||
if self.roll_points >= 100 then
|
||||
self.roll_points = self.roll_points - 100
|
||||
self.grade = self.grade + 1
|
||||
@@ -234,7 +234,7 @@ PhantomMania2Game.garbageOpacityFunction = function(age)
|
||||
end
|
||||
|
||||
function PhantomMania2Game:drawGrid()
|
||||
if not (self.game_over or (self.clear and self.level < 1300)) then
|
||||
if not (self.game_over) then
|
||||
self.grid:drawInvisible(self.rollOpacityFunction, self.garbageOpacityFunction)
|
||||
else
|
||||
self.grid:draw()
|
||||
|
||||
@@ -25,7 +25,7 @@ function Race40Game:new()
|
||||
self.lock_drop = true
|
||||
self.lock_hard_drop = true
|
||||
self.instant_hard_drop = true
|
||||
self.instant_soft_drop = false
|
||||
self.instant_soft_drop = true
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 3
|
||||
end
|
||||
@@ -39,11 +39,11 @@ function Race40Game:getARR()
|
||||
end
|
||||
|
||||
function Race40Game:getARE()
|
||||
return 0
|
||||
return 4
|
||||
end
|
||||
|
||||
function Race40Game:getLineARE()
|
||||
return self:getARE()
|
||||
return 2
|
||||
end
|
||||
|
||||
function Race40Game:getDasLimit()
|
||||
@@ -51,15 +51,15 @@ function Race40Game:getDasLimit()
|
||||
end
|
||||
|
||||
function Race40Game:getLineClearDelay()
|
||||
return 0
|
||||
return 2
|
||||
end
|
||||
|
||||
function Race40Game:getLockDelay()
|
||||
return 15
|
||||
return 30
|
||||
end
|
||||
|
||||
function Race40Game:getGravity()
|
||||
return 1/64
|
||||
return 20
|
||||
end
|
||||
|
||||
function Race40Game:advanceOneFrame()
|
||||
|
||||
@@ -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)
|
||||
|
||||
76
tetris/modes/survival_ax.lua
Normal file
76
tetris/modes/survival_ax.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
require 'funcs'
|
||||
|
||||
local MarathonAX = require 'tetris.modes.marathon_ax'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local SurvivalAXGame = MarathonAX:extend()
|
||||
|
||||
SurvivalAXGame.name = "Survival AX"
|
||||
SurvivalAXGame.hash = "SurvivalAX"
|
||||
SurvivalAXGame.tagline = "Can you clear the time hurdles when the game goes this fast?"
|
||||
|
||||
|
||||
function SurvivalAXGame:new()
|
||||
SurvivalAXGame.super:new()
|
||||
|
||||
self.roll_frames = 0
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.section_time_limit = 3600
|
||||
self.section_start_time = 0
|
||||
self.section_times = { [0] = 0 }
|
||||
self.section_clear = false
|
||||
|
||||
self.lock_drop = true
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 3
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getSectionTimeLimit()
|
||||
return 3600
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getARE()
|
||||
if self.lines < 10 then return 18
|
||||
elseif self.lines < 40 then return 14
|
||||
elseif self.lines < 60 then return 12
|
||||
elseif self.lines < 70 then return 10
|
||||
elseif self.lines < 80 then return 8
|
||||
elseif self.lines < 90 then return 7
|
||||
else return 6 end
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getLineARE()
|
||||
return self:getARE()
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getDasLimit()
|
||||
if self.lines < 20 then return 10
|
||||
elseif self.lines < 50 then return 9
|
||||
elseif self.lines < 70 then return 8
|
||||
else return 7 end
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getLineClearDelay()
|
||||
if self.lines < 10 then return 14
|
||||
elseif self.lines < 30 then return 8
|
||||
else return 5 end
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getLockDelay()
|
||||
if self.lines < 10 then return 30
|
||||
elseif self.lines < 20 then return 26
|
||||
elseif self.lines < 30 then return 24
|
||||
elseif self.lines < 40 then return 22
|
||||
elseif self.lines < 50 then return 20
|
||||
elseif self.lines < 70 then return 16
|
||||
else return 15 end
|
||||
end
|
||||
|
||||
function SurvivalAXGame:getGravity()
|
||||
return 20
|
||||
end
|
||||
|
||||
return SurvivalAXGame
|
||||
59
tetris/modes/survival_ax2.lua
Normal file
59
tetris/modes/survival_ax2.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
require 'funcs'
|
||||
|
||||
local MarathonAX2 = require 'tetris.modes.marathon_ax2'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
local History6RollsRandomizer = require 'tetris.randomizers.history_6rolls'
|
||||
|
||||
local SurvivalAX2Game = MarathonAX2:extend()
|
||||
|
||||
SurvivalAX2Game.name = "Survival AX2"
|
||||
SurvivalAX2Game.hash = "SurvivalAX2"
|
||||
SurvivalAX2Game.tagline = "Can you clear the time hurdles when the game goes this fast?"
|
||||
|
||||
|
||||
function SurvivalAX2Game:new()
|
||||
SurvivalAX2Game.super:new()
|
||||
|
||||
self.roll_frames = 0
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.section_time_limit = 3600
|
||||
self.section_start_time = 0
|
||||
self.section_times = { [0] = 0 }
|
||||
self.section_clear = false
|
||||
|
||||
self.lock_drop = true
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 3
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getSectionTimeLimit()
|
||||
return 3600
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getARE()
|
||||
return 6
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getLineARE()
|
||||
return self:getARE()
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getDasLimit()
|
||||
return 7
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getLineClearDelay()
|
||||
return 5
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getLockDelay()
|
||||
return 15
|
||||
end
|
||||
|
||||
function SurvivalAX2Game:getGravity()
|
||||
return 20
|
||||
end
|
||||
|
||||
return SurvivalAX2Game
|
||||
32
tetris/rulesets/arika_ace.lua
Normal file
32
tetris/rulesets/arika_ace.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local ArikaTI = require 'tetris.rulesets.arika_ti'
|
||||
|
||||
local ARS = ArikaTI:extend()
|
||||
|
||||
ARS.name = "Ace-ARS"
|
||||
ARS.hash = "ArikaAce"
|
||||
|
||||
function ARS:onPieceCreate(piece, grid)
|
||||
piece.floorkick = 0
|
||||
piece.rotate_counter = 0
|
||||
piece.move_counter = 0
|
||||
end
|
||||
|
||||
function ARS:onPieceDrop(piece, grid)
|
||||
piece.lock_delay = 0 -- step reset
|
||||
end
|
||||
|
||||
function ARS: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 >= 128 then
|
||||
piece.locked = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ARS:onPieceRotate(piece, grid)
|
||||
self:onPieceMove(piece, grid)
|
||||
end
|
||||
|
||||
return ARS
|
||||
@@ -117,13 +117,12 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||
end
|
||||
end
|
||||
elseif piece.shape ~= "I" then
|
||||
-- kick right, kick left
|
||||
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
||||
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
||||
elseif (grid:canPlacePiece(new_piece:withOffset({x=-1, y=0}))) then
|
||||
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
||||
end
|
||||
else
|
||||
-- kick right, kick left
|
||||
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then
|
||||
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
|
||||
elseif (grid:canPlacePiece(new_piece:withOffset({x=-1, y=0}))) then
|
||||
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -398,6 +398,7 @@ function CRS:onPieceDrop(piece, grid)
|
||||
end
|
||||
|
||||
function CRS: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 >= 24 then
|
||||
@@ -407,6 +408,7 @@ function CRS:onPieceMove(piece, grid)
|
||||
end
|
||||
|
||||
function CRS:onPieceRotate(piece, grid)
|
||||
piece.lock_delay = 0 -- move reset
|
||||
if piece:isDropBlocked(grid) then
|
||||
piece.rotate_counter = piece.rotate_counter + 1
|
||||
if piece.rotate_counter >= 12 then
|
||||
@@ -415,6 +417,4 @@ function CRS:onPieceRotate(piece, grid)
|
||||
end
|
||||
end
|
||||
|
||||
function CRS:getDefaultOrientation() return 1 end -- downward facing pieces by default
|
||||
|
||||
return CRS
|
||||
|
||||
@@ -56,16 +56,16 @@ function Ruleset:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||
-- do nothing in default ruleset
|
||||
end
|
||||
|
||||
function Ruleset:movePiece(piece, grid, move)
|
||||
function Ruleset:movePiece(piece, grid, move, instant)
|
||||
local x = piece.position.x
|
||||
if move == "left" then
|
||||
piece:moveInGrid({x=-1, y=0}, 1, grid)
|
||||
elseif move == "speedleft" then
|
||||
piece:moveInGrid({x=-1, y=0}, 10, grid)
|
||||
piece:moveInGrid({x=-1, y=0}, 1, grid, false)
|
||||
elseif move == "right" then
|
||||
piece:moveInGrid({x=1, y=0}, 1, grid)
|
||||
piece:moveInGrid({x=1, y=0}, 1, grid, false)
|
||||
elseif move == "speedleft" then
|
||||
piece:moveInGrid({x=-1, y=0}, 10, grid, instant)
|
||||
elseif move == "speedright" then
|
||||
piece:moveInGrid({x=1, y=0}, 10, grid)
|
||||
piece:moveInGrid({x=1, y=0}, 10, grid, instant)
|
||||
end
|
||||
if piece.position.x ~= x then
|
||||
self:onPieceMove(piece, grid)
|
||||
@@ -138,7 +138,7 @@ function Ruleset:processPiece(
|
||||
hard_drop_enabled, additive_gravity
|
||||
)
|
||||
self:rotatePiece(inputs, piece, grid, prev_inputs, false)
|
||||
self:movePiece(piece, grid, move)
|
||||
self:movePiece(piece, grid, move, gravity >= 20)
|
||||
self:dropPiece(
|
||||
inputs, piece, grid, gravity, drop_speed, drop_locked, hard_drop_locked,
|
||||
hard_drop_enabled, additive_gravity
|
||||
|
||||
30
tetris/rulesets/standard_ti.lua
Normal file
30
tetris/rulesets/standard_ti.lua
Normal 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
|
||||
Reference in New Issue
Block a user