Replaced spaces with tabs.

Check CONTRIBUTING.md, guys!
pull/6/head
Joe Zeng 2020-11-06 20:49:44 -05:00
parent 4670cb7c15
commit 2e3eff025f
55 changed files with 1175 additions and 1175 deletions

View File

@ -37,13 +37,13 @@ If you haven't already, install `love` with your favourite package manager (Home
Clone the repository in git: Clone the repository in git:
git clone https://github.com/SashLilac/cambridge git clone https://github.com/SashLilac/cambridge
Alternatively, download the source code ZIP in the latest release. Alternatively, download the source code ZIP in the latest release.
Then, navigate to the root directory that you just cloned, and type: Then, navigate to the root directory that you just cloned, and type:
love . love .
It should run automatically! It should run automatically!
@ -53,11 +53,11 @@ You do not need LÖVE on Windows, as it comes bundled with the program. Download
Extract the ZIP, open a Command Prompt at the folder you extracted Cambridge to, then run this command: Extract the ZIP, open a Command Prompt at the folder you extracted Cambridge to, then run this command:
dist\windows\love.exe . dist\windows\love.exe .
Alternatively, if you're on a 32-bit system, run this instead: Alternatively, if you're on a 32-bit system, run this instead:
dist\win32\love.exe . dist\win32\love.exe .
32-bit systems do not support rich presence integration. 32-bit systems do not support rich presence integration.

View File

@ -4,17 +4,17 @@ Game modes
There are several classes of game modes. The modes that originate from other games are organized by suffix: There are several classes of game modes. The modes that originate from other games are organized by suffix:
* The "C" series stand for "Classic" games, games that were produced before around 1992-1993 and generally have no wallkicks or lock delay. * The "C" series stand for "Classic" games, games that were produced before around 1992-1993 and generally have no wallkicks or lock delay.
* C84 - The original version from the Electronika 60. * C84 - The original version from the Electronika 60.
* C88 - Sega Tetris. * C88 - Sega Tetris.
* C89 - Nintendo / NES Tetris. * C89 - Nintendo / NES Tetris.
* The "A" series stand for "Arika" games, or games in the Tetris the Grand Master series. * The "A" series stand for "Arika" games, or games in the Tetris the Grand Master series.
* A1 - Tetris The Grand Master (the original from 1998). * A1 - Tetris The Grand Master (the original from 1998).
* A2 - Tetris The Absolute The Grand Master 2 PLUS. * A2 - Tetris The Absolute The Grand Master 2 PLUS.
* A3 - Tetris The Grand Master 3 Terror-Instinct. * A3 - Tetris The Grand Master 3 Terror-Instinct.
* AX - Tetris The Grand Master ACE (X for Xbox). * AX - Tetris The Grand Master ACE (X for Xbox).
* The "G" series stand for "Guideline" games, or games that follow the Tetris Guideline. * The "G" series stand for "Guideline" games, or games that follow the Tetris Guideline.
* GF - Tetris Friends (2007-2019) * GF - Tetris Friends (2007-2019)
* GJ - Tetris Online Japan (2005-2011) * GJ - Tetris Online Japan (2005-2011)
* N stands for Nullpomino, only used for Phantom Mania N. * N stands for Nullpomino, only used for Phantom Mania N.
MARATHON MARATHON

View File

@ -1,11 +1,11 @@
function copy(t) function copy(t)
-- returns deep copy of t (as opposed to the shallow copy you get from var = t) -- returns deep copy of t (as opposed to the shallow copy you get from var = t)
if type(t) ~= "table" then return t end if type(t) ~= "table" then return t end
local meta = getmetatable(t) local meta = getmetatable(t)
local target = {} local target = {}
for k, v in pairs(t) do target[k] = v end for k, v in pairs(t) do target[k] = v end
setmetatable(target, meta) setmetatable(target, meta)
return target return target
end end
function strTrueValues(tbl) function strTrueValues(tbl)
@ -64,6 +64,6 @@ function formatBigNum(number)
end end
function Mod1(n, m) function Mod1(n, m)
-- returns a number congruent to n modulo m in the range [1;m] (as opposed to [0;m-1]) -- returns a number congruent to n modulo m in the range [1;m] (as opposed to [0;m-1])
return ((n-1) % m) + 1 return ((n-1) % m) + 1
end end

View File

@ -20,8 +20,8 @@ backgrounds = {
love.graphics.newImage("res/backgrounds/1800-railways.png"), love.graphics.newImage("res/backgrounds/1800-railways.png"),
love.graphics.newImage("res/backgrounds/1900-world-wide-web.png"), love.graphics.newImage("res/backgrounds/1900-world-wide-web.png"),
title = love.graphics.newImage("res/backgrounds/title_v0.1.png"), title = love.graphics.newImage("res/backgrounds/title_v0.1.png"),
input_config = love.graphics.newImage("res/backgrounds/options-pcb.png"), input_config = love.graphics.newImage("res/backgrounds/options-pcb.png"),
game_config = love.graphics.newImage("res/backgrounds/options-gears.png"), game_config = love.graphics.newImage("res/backgrounds/options-gears.png"),
} }
blocks = { blocks = {
@ -48,24 +48,24 @@ blocks = {
} }
ColourSchemes = { ColourSchemes = {
Arika = { Arika = {
I = "R", I = "R",
L = "O", L = "O",
J = "B", J = "B",
S = "M", S = "M",
Z = "G", Z = "G",
O = "Y", O = "Y",
T = "C", T = "C",
}, },
TTC = { TTC = {
I = "C", I = "C",
L = "O", L = "O",
J = "B", J = "B",
S = "G", S = "G",
Z = "R", Z = "R",
O = "Y", O = "Y",
T = "M", T = "M",
}, },
} }
for name, blockset in pairs(blocks) do for name, blockset in pairs(blocks) do

View File

@ -1,58 +1,58 @@
print("Loading discord RPC...") print("Loading discord RPC...")
DiscordRPC = { DiscordRPC = {
loaded = false loaded = false
} }
local success, RPC = pcall(require, "libs.discordRPC") local success, RPC = pcall(require, "libs.discordRPC")
if success then if success then
DiscordRPC.loaded = true DiscordRPC.loaded = true
DiscordRPC.appId = "599778517789573120" DiscordRPC.appId = "599778517789573120"
function RPC.ready(userId, username, discriminator, avatar) function RPC.ready(userId, username, discriminator, avatar)
print(string.format("Discord: ready (%s, %s, %s, %s)", userId, username, discriminator, avatar)) print(string.format("Discord: ready (%s, %s, %s, %s)", userId, username, discriminator, avatar))
end end
function RPC.disconnected(errorCode, message) function RPC.disconnected(errorCode, message)
print(string.format("Discord: disconnected (%d: %s)", errorCode, message)) print(string.format("Discord: disconnected (%d: %s)", errorCode, message))
end end
function RPC.errored(errorCode, message) function RPC.errored(errorCode, message)
print(string.format("Discord: error (%d: %s)", errorCode, message)) print(string.format("Discord: error (%d: %s)", errorCode, message))
end end
function RPC.joinGame(joinSecret) function RPC.joinGame(joinSecret)
print(string.format("Discord: join (%s)", joinSecret)) print(string.format("Discord: join (%s)", joinSecret))
end end
function RPC.spectateGame(spectateSecret) function RPC.spectateGame(spectateSecret)
print(string.format("Discord: spectate (%s)", spectateSecret)) print(string.format("Discord: spectate (%s)", spectateSecret))
end end
function RPC.joinRequest(userId, username, discriminator, avatar) function RPC.joinRequest(userId, username, discriminator, avatar)
print(string.format("Discord: join request (%s, %s, %s, %s)", userId, username, discriminator, avatar)) print(string.format("Discord: join request (%s, %s, %s, %s)", userId, username, discriminator, avatar))
RPC.respond(userId, "yes") RPC.respond(userId, "yes")
end end
RPC.initialize(DiscordRPC.appId, true) RPC.initialize(DiscordRPC.appId, true)
local now = os.time(os.date("*t")) local now = os.time(os.date("*t"))
DiscordRPC.RPC = RPC DiscordRPC.RPC = RPC
print("DiscordRPC successfully loaded.") print("DiscordRPC successfully loaded.")
else else
print("DiscordRPC failed to load!") print("DiscordRPC failed to load!")
print(RPC) print(RPC)
end end
DiscordRPC.presence = { DiscordRPC.presence = {
startTimestamp = now, startTimestamp = now,
details = "Loading game...", details = "Loading game...",
state = "", state = "",
largeImageKey = "icon2", largeImageKey = "icon2",
largeImageText = "Arcade Stacker", largeImageText = "Arcade Stacker",
smallImageKey = "", smallImageKey = "",
smallImageText = "" smallImageText = ""
} }
function DiscordRPC:update(newstuff) function DiscordRPC:update(newstuff)
for k, v in pairs(newstuff) do self.presence[k] = v end for k, v in pairs(newstuff) do self.presence[k] = v end
if self.loaded then self.RPC.updatePresence(self.presence) end if self.loaded then self.RPC.updatePresence(self.presence) end
end end

View File

@ -15,13 +15,13 @@ function love.load()
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true}); love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
if not config.gamesettings then config.gamesettings = {} end if not config.gamesettings then config.gamesettings = {} end
for _, option in ipairs(GameConfigScene.options) do for _, option in ipairs(GameConfigScene.options) do
if not config.gamesettings[option[1]] then if not config.gamesettings[option[1]] then
config.gamesettings[option[1]] = 1 config.gamesettings[option[1]] = 1
end end
end end
if not config.input then if not config.input then
config.input = {} config.input = {}
scene = InputConfigScene() scene = InputConfigScene()

View File

@ -7,7 +7,7 @@ function ExitScene:new()
end end
function ExitScene:update() function ExitScene:update()
love.event.quit() love.event.quit()
end end
function ExitScene:render() function ExitScene:render()

View File

@ -6,9 +6,9 @@ function GameScene:new(game_mode, ruleset)
self.ruleset = ruleset() self.ruleset = ruleset()
self.game:initialize(self.ruleset) self.game:initialize(self.ruleset)
DiscordRPC:update({ DiscordRPC:update({
details = self.game.rpc_details, details = self.game.rpc_details,
state = self.game.name, state = self.game.name,
}) })
end end
function GameScene:update() function GameScene:update()
@ -66,16 +66,16 @@ function GameScene:onKeyPress(e)
highscore_hash = self.game.hash .. "-" .. self.ruleset.hash highscore_hash = self.game.hash .. "-" .. self.ruleset.hash
submitHighscore(highscore_hash, highscore_entry) submitHighscore(highscore_hash, highscore_entry)
scene = ModeSelectScene() scene = ModeSelectScene()
elseif (e.scancode == config.input.retry) then elseif (e.scancode == config.input.retry) then
-- fuck this, this is hacky but the way this codebase is setup prevents anything else -- fuck this, this is hacky but the way this codebase is setup prevents anything else
-- it seems like all the values that get touched in the child gamemode class -- it seems like all the values that get touched in the child gamemode class
-- stop being linked to the values of the GameMode superclass because of how `mt.__index` works -- stop being linked to the values of the GameMode superclass because of how `mt.__index` works
-- not even sure this is the actual problem, but I don't want to have to rebuild everything about -- not even sure this is the actual problem, but I don't want to have to rebuild everything about
-- the core organisation of everything. this hacky way will have to do until someone figures out something. -- the core organisation of everything. this hacky way will have to do until someone figures out something.
love.keypressed("escape", "escape", false) love.keypressed("escape", "escape", false)
love.keypressed("return", "return", false) love.keypressed("return", "return", false)
elseif e.scancode == "escape" then elseif e.scancode == "escape" then
scene = ModeSelectScene() scene = ModeSelectScene()
end end
end end

View File

@ -16,11 +16,11 @@ function ConfigScene:new()
-- load current config -- load current config
self.config = config.input self.config = config.input
self.highlight = 1 self.highlight = 1
DiscordRPC:update({ DiscordRPC:update({
details = "In menus", details = "In menus",
state = "Changing game settings", state = "Changing game settings",
}) })
end end
function ConfigScene:update() function ConfigScene:update()
@ -33,21 +33,21 @@ function ConfigScene:render()
0, 0, 0, 0, 0, 0,
0.5, 0.5 0.5, 0.5
) )
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.print("GAME SETTINGS", 80, 40) love.graphics.print("GAME SETTINGS", 80, 40)
love.graphics.setColor(1, 1, 1, 0.5) love.graphics.setColor(1, 1, 1, 0.5)
love.graphics.rectangle("fill", 20, 98 + self.highlight * 20, 170, 22) love.graphics.rectangle("fill", 20, 98 + self.highlight * 20, 170, 22)
love.graphics.setFont(font_3x5_2) love.graphics.setFont(font_3x5_2)
for i, option in ipairs(ConfigScene.options) do for i, option in ipairs(ConfigScene.options) do
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(option[2], 40, 100 + i * 20, 150, "left") love.graphics.printf(option[2], 40, 100 + i * 20, 150, "left")
for j, setting in ipairs(option[3]) do for j, setting in ipairs(option[3]) do
love.graphics.setColor(1, 1, 1, config.gamesettings[option[1]] == j and 1 or 0.5) love.graphics.setColor(1, 1, 1, config.gamesettings[option[1]] == j and 1 or 0.5)
love.graphics.printf(setting, 100 + 110 * j, 100 + i * 20, 100, "center") love.graphics.printf(setting, 100 + 110 * j, 100 + i * 20, 100, "center")
end end
end end
end end
@ -64,15 +64,15 @@ function ConfigScene:onKeyPress(e)
self.highlight = Mod1(self.highlight+1, optioncount) self.highlight = Mod1(self.highlight+1, optioncount)
elseif (e.scancode == config.input["left"] or e.scancode == "left") and e.isRepeat == false then elseif (e.scancode == config.input["left"] or e.scancode == "left") and e.isRepeat == false then
playSE("cursor_lr") playSE("cursor_lr")
local option = ConfigScene.options[self.highlight] local option = ConfigScene.options[self.highlight]
config.gamesettings[option[1]] = Mod1(config.gamesettings[option[1]]-1, #option[3]) config.gamesettings[option[1]] = Mod1(config.gamesettings[option[1]]-1, #option[3])
elseif (e.scancode == config.input["right"] or e.scancode == "right") and e.isRepeat == false then elseif (e.scancode == config.input["right"] or e.scancode == "right") and e.isRepeat == false then
playSE("cursor_lr") playSE("cursor_lr")
local option = ConfigScene.options[self.highlight] local option = ConfigScene.options[self.highlight]
config.gamesettings[option[1]] = Mod1(config.gamesettings[option[1]]+1, #option[3]) config.gamesettings[option[1]] = Mod1(config.gamesettings[option[1]]+1, #option[3])
elseif e.scancode == "escape" then elseif e.scancode == "escape" then
loadSave() loadSave()
scene = TitleScene() scene = TitleScene()
end end
end end

View File

@ -6,16 +6,16 @@ require 'load.save'
local configurable_inputs = { local configurable_inputs = {
"left", "left",
"right", "right",
"up", "up",
"down", "down",
"rotate_left", "rotate_left",
"rotate_left2", "rotate_left2",
"rotate_right", "rotate_right",
"rotate_right2", "rotate_right2",
"rotate_180", "rotate_180",
"hold", "hold",
"retry", "retry",
} }
function ConfigScene:new() function ConfigScene:new()
@ -24,9 +24,9 @@ function ConfigScene:new()
self.input_state = 1 self.input_state = 1
DiscordRPC:update({ DiscordRPC:update({
details = "In menus", details = "In menus",
state = "Changing input config", state = "Changing input config",
}) })
end end
function ConfigScene:update() function ConfigScene:update()
@ -42,7 +42,7 @@ function ConfigScene:render()
love.graphics.setFont(font_3x5_2) love.graphics.setFont(font_3x5_2)
for i, input in pairs(configurable_inputs) do for i, input in pairs(configurable_inputs) do
love.graphics.printf(input, 40, 50 + i * 20, 200, "left") love.graphics.printf(input, 40, 50 + i * 20, 200, "left")
if config.input[input] then if config.input[input] then
love.graphics.printf( love.graphics.printf(
love.keyboard.getKeyFromScancode(config.input[input]) .. " (" .. config.input[input] .. ")", love.keyboard.getKeyFromScancode(config.input[input]) .. " (" .. config.input[input] .. ")",
@ -67,13 +67,13 @@ function ConfigScene:onKeyPress(e)
self.input_state = 1 self.input_state = 1
end end
else else
if e.scancode == "escape" then if e.scancode == "escape" then
loadSave() loadSave()
scene = TitleScene() scene = TitleScene()
else else
config.input[configurable_inputs[self.input_state]] = e.scancode config.input[configurable_inputs[self.input_state]] = e.scancode
self.input_state = self.input_state + 1 self.input_state = self.input_state + 1
end end
end end
end end

View File

@ -12,9 +12,9 @@ function ModeSelectScene:new()
select = "mode", select = "mode",
} }
DiscordRPC:update({ DiscordRPC:update({
details = "In menus", details = "In menus",
state = "Choosing a mode", state = "Choosing a mode",
}) })
end end
function ModeSelectScene:update() function ModeSelectScene:update()
@ -77,8 +77,8 @@ function ModeSelectScene:onKeyPress(e)
(e.scancode == config.input["right"] or e.scancode == "right") then (e.scancode == config.input["right"] or e.scancode == "right") then
self:switchSelect() self:switchSelect()
playSE("cursor_lr") playSE("cursor_lr")
elseif e.scancode == "escape" then elseif e.scancode == "escape" then
scene = TitleScene() scene = TitleScene()
end end
end end

View File

@ -4,30 +4,30 @@ local main_menu_screens = {
ModeSelectScene, ModeSelectScene,
InputConfigScene, InputConfigScene,
GameConfigScene, GameConfigScene,
ExitScene, ExitScene,
} }
local mainmenuidle = { local mainmenuidle = {
"Idle", "Idle",
"On title screen", "On title screen",
"On main menu screen", "On main menu screen",
"Twiddling their thumbs", "Twiddling their thumbs",
"Admiring the main menu's BG", "Admiring the main menu's BG",
"Waiting for spring to come", "Waiting for spring to come",
"Actually not playing", "Actually not playing",
"Contemplating collecting stars", "Contemplating collecting stars",
"Preparing to put the block!!", "Preparing to put the block!!",
"Having a nap", "Having a nap",
"In menus", "In menus",
"Bottom text", "Bottom text",
} }
function TitleScene:new() function TitleScene:new()
self.main_menu_state = 1 self.main_menu_state = 1
DiscordRPC:update({ DiscordRPC:update({
details = "In menus", details = "In menus",
state = mainmenuidle[math.random(#mainmenuidle)], state = mainmenuidle[math.random(#mainmenuidle)],
}) })
end end
function TitleScene:update() function TitleScene:update()
@ -67,8 +67,8 @@ function TitleScene:onKeyPress(e)
elseif (e.scancode == config.input["down"] or e.scancode == "down") and e.isRepeat == false then elseif (e.scancode == config.input["down"] or e.scancode == "down") and e.isRepeat == false then
self:changeOption(1) self:changeOption(1)
playSE("cursor") playSE("cursor")
elseif e.scancode == "escape" and e.isRepeat == false then elseif e.scancode == "escape" and e.isRepeat == false then
love.event.quit() love.event.quit()
end end
end end

View File

@ -29,10 +29,10 @@ function Grid:clear()
end end
function Grid:getCell(x, y) function Grid:getCell(x, y)
if x < 1 or x > 10 or y > 24 then return oob if x < 1 or x > 10 or y > 24 then return oob
elseif y < 1 then return empty elseif y < 1 then return empty
else return self.grid[y][x] else return self.grid[y][x]
end end
end end
function Grid:isOccupied(x, y) function Grid:isOccupied(x, y)
@ -67,11 +67,11 @@ function Grid:canPlaceBigPiece(piece)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
local x = piece.position.x + offset.x local x = piece.position.x + offset.x
local y = piece.position.y + offset.y local y = piece.position.y + offset.y
if ( if (
self:isOccupied(x * 2 + 0, y * 2 + 0) self:isOccupied(x * 2 + 0, y * 2 + 0)
or self:isOccupied(x * 2 + 1, y * 2 + 0) or self:isOccupied(x * 2 + 1, y * 2 + 0)
or self:isOccupied(x * 2 + 0, y * 2 + 1) or self:isOccupied(x * 2 + 0, y * 2 + 1)
or self:isOccupied(x * 2 + 1, y * 2 + 1) or self:isOccupied(x * 2 + 1, y * 2 + 1)
) then ) then
return false return false
end end
@ -148,27 +148,27 @@ function Grid:copyBottomRow()
end end
function Grid:garbageRise(row_vals) function Grid:garbageRise(row_vals)
for row = 1, 23 do for row = 1, 23 do
self.grid[row] = self.grid[row+1] self.grid[row] = self.grid[row+1]
self.grid_age[row] = self.grid_age[row+1] self.grid_age[row] = self.grid_age[row+1]
end end
self.grid[24] = {empty, empty, empty, empty, empty, empty, empty, empty, empty, empty} self.grid[24] = {empty, empty, empty, empty, empty, empty, empty, empty, empty, empty}
self.grid_age[24] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} self.grid_age[24] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
for col = 1, 10 do for col = 1, 10 do
self.grid[24][col] = (row_vals[col] == "e") and empty or block self.grid[24][col] = (row_vals[col] == "e") and empty or block
end end
end end
function Grid:applyFourWide() function Grid:applyFourWide()
for row = 1, 24 do for row = 1, 24 do
local x = self.grid[row] local x = self.grid[row]
x[1] = x[1]~=block and block or x[1] x[1] = x[1]~=block and block or x[1]
x[2] = x[2]~=block and block or x[2] x[2] = x[2]~=block and block or x[2]
x[3] = x[3]~=block and block or x[3] x[3] = x[3]~=block and block or x[3]
x[8] = x[8]~=block and block or x[8] x[8] = x[8]~=block and block or x[8]
x[9] = x[9]~=block and block or x[9] x[9] = x[9]~=block and block or x[9]
x[10] = x[10]~=block and block or x[10] x[10] = x[10]~=block and block or x[10]
end end
end end
function Grid:applyPiece(piece) function Grid:applyPiece(piece)
if piece.big then if piece.big then
@ -195,12 +195,12 @@ function Grid:applyBigPiece(piece)
y = piece.position.y + offset.y y = piece.position.y + offset.y
for a = 1, 2 do for a = 1, 2 do
for b = 1, 2 do for b = 1, 2 do
if y*2+a > 0 then if y*2+a > 0 then
self.grid[y*2+a][x*2+b] = { self.grid[y*2+a][x*2+b] = {
skin = piece.skin, skin = piece.skin,
colour = piece.colour colour = piece.colour
} }
end end
end end
end end
end end
@ -208,45 +208,45 @@ end
function Grid:checkForBravo(cleared_row_count) function Grid:checkForBravo(cleared_row_count)
for i = 0, 23 - cleared_row_count do for i = 0, 23 - cleared_row_count do
for j = 0, 9 do for j = 0, 9 do
if self:isOccupied(j, i) then return false end if self:isOccupied(j, i) then return false end
end end
end end
return true return true
end end
function Grid:checkSecretGrade() function Grid:checkSecretGrade()
local sgrade = 0 local sgrade = 0
for i=23,5,-1 do for i=23,5,-1 do
local validLine = true local validLine = true
local emptyCell = 0 local emptyCell = 0
if i > 13 then if i > 13 then
emptyCell = 23-i emptyCell = 23-i
end end
if i <= 13 then if i <= 13 then
emptyCell = i-5 emptyCell = i-5
end end
for j=0,9 do for j=0,9 do
if (not self:isOccupied(j,i) and j ~= emptyCell) or (j == emptyCell and self:isOccupied(j,i)) then if (not self:isOccupied(j,i) and j ~= emptyCell) or (j == emptyCell and self:isOccupied(j,i)) then
validLine = false validLine = false
end end
end end
if not self:isOccupied(emptyCell,i-1) then if not self:isOccupied(emptyCell,i-1) then
validLine = false validLine = false
end end
if(validLine) then if(validLine) then
sgrade = sgrade + 1 sgrade = sgrade + 1
else else
return sgrade return sgrade
end end
end end
--[[ --[[
if(sgrade == 0) then return "" if(sgrade == 0) then return ""
elseif(sgrade < 10) then return 10-sgrade elseif(sgrade < 10) then return 10-sgrade
elseif(sgrade < 19) then return "S"..(sgrade-9) end elseif(sgrade < 19) then return "S"..(sgrade-9) end
return "GM" return "GM"
--]] --]]
return sgrade return sgrade
end end
function Grid:update() function Grid:update()

View File

@ -10,7 +10,7 @@ function Piece:new(shape, rotation, position, block_offsets, gravity, lock_delay
self.gravity = gravity self.gravity = gravity
self.lock_delay = lock_delay self.lock_delay = lock_delay
self.skin = skin self.skin = skin
self.colour = colour self.colour = colour
self.ghost = false self.ghost = false
self.locked = false self.locked = false
self.big = big self.big = big

View File

@ -20,13 +20,13 @@ function FourWideGame:onLineClear(cleared_row_count)
local new_level = self.level + cleared_row_levels[cleared_row_count] local new_level = self.level + cleared_row_levels[cleared_row_count]
self:updateSectionTimes(self.level, new_level) self:updateSectionTimes(self.level, new_level)
if new_level >= 1300 or self:hitTorikan(self.level, new_level) then if new_level >= 1300 or self:hitTorikan(self.level, new_level) then
self.clear = true self.clear = true
if new_level >= 1300 then if new_level >= 1300 then
self.level = 1300 self.level = 1300
self.grid:clear() self.grid:clear()
self.roll_frames = -150 self.roll_frames = -150
else else
self.game_over = true self.game_over = true
end end
else else
self.level = math.min(new_level, 1300) self.level = math.min(new_level, 1300)

View File

@ -15,86 +15,86 @@ MarathonA2Game.tagline = "The points don't matter! Can you reach the invisible r
function MarathonA2Game:new() function MarathonA2Game:new()
self.super:new() self.super:new()
self.big_mode = true self.big_mode = true
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.grade = 0 self.grade = 0
self.grade_points = 0 self.grade_points = 0
self.grade_point_decay_counter = 0 self.grade_point_decay_counter = 0
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.lock_drop = false self.lock_drop = false
self.enable_hold = false self.enable_hold = false
self.next_queue_length = 1 self.next_queue_length = 1
end end
function MarathonA2Game:getARE() function MarathonA2Game:getARE()
if self.level < 700 then return 27 if self.level < 700 then return 27
elseif self.level < 800 then return 18 elseif self.level < 800 then return 18
else return 14 end else return 14 end
end end
function MarathonA2Game:getLineARE() function MarathonA2Game:getLineARE()
if self.level < 600 then return 27 if self.level < 600 then return 27
elseif self.level < 700 then return 18 elseif self.level < 700 then return 18
elseif self.level < 800 then return 14 elseif self.level < 800 then return 14
else return 8 end else return 8 end
end end
function MarathonA2Game:getDasLimit() function MarathonA2Game:getDasLimit()
if self.level < 500 then return 15 if self.level < 500 then return 15
elseif self.level < 900 then return 9 elseif self.level < 900 then return 9
else return 7 end else return 7 end
end end
function MarathonA2Game:getLineClearDelay() function MarathonA2Game:getLineClearDelay()
if self.level < 500 then return 40 if self.level < 500 then return 40
elseif self.level < 600 then return 25 elseif self.level < 600 then return 25
elseif self.level < 700 then return 16 elseif self.level < 700 then return 16
elseif self.level < 800 then return 12 elseif self.level < 800 then return 12
else return 6 end else return 6 end
end end
function MarathonA2Game:getLockDelay() function MarathonA2Game:getLockDelay()
if self.level < 900 then return 30 if self.level < 900 then return 30
else return 17 end else return 17 end
end end
function MarathonA2Game:getGravity() function MarathonA2Game:getGravity()
if (self.level < 30) then return 4/256 if (self.level < 30) then return 4/256
elseif (self.level < 35) then return 6/256 elseif (self.level < 35) then return 6/256
elseif (self.level < 40) then return 8/256 elseif (self.level < 40) then return 8/256
elseif (self.level < 50) then return 10/256 elseif (self.level < 50) then return 10/256
elseif (self.level < 60) then return 12/256 elseif (self.level < 60) then return 12/256
elseif (self.level < 70) then return 16/256 elseif (self.level < 70) then return 16/256
elseif (self.level < 80) then return 32/256 elseif (self.level < 80) then return 32/256
elseif (self.level < 90) then return 48/256 elseif (self.level < 90) then return 48/256
elseif (self.level < 100) then return 64/256 elseif (self.level < 100) then return 64/256
elseif (self.level < 120) then return 80/256 elseif (self.level < 120) then return 80/256
elseif (self.level < 140) then return 96/256 elseif (self.level < 140) then return 96/256
elseif (self.level < 160) then return 112/256 elseif (self.level < 160) then return 112/256
elseif (self.level < 170) then return 128/256 elseif (self.level < 170) then return 128/256
elseif (self.level < 200) then return 144/256 elseif (self.level < 200) then return 144/256
elseif (self.level < 220) then return 4/256 elseif (self.level < 220) then return 4/256
elseif (self.level < 230) then return 32/256 elseif (self.level < 230) then return 32/256
elseif (self.level < 233) then return 64/256 elseif (self.level < 233) then return 64/256
elseif (self.level < 236) then return 96/256 elseif (self.level < 236) then return 96/256
elseif (self.level < 239) then return 128/256 elseif (self.level < 239) then return 128/256
elseif (self.level < 243) then return 160/256 elseif (self.level < 243) then return 160/256
elseif (self.level < 247) then return 192/256 elseif (self.level < 247) then return 192/256
elseif (self.level < 251) then return 224/256 elseif (self.level < 251) then return 224/256
elseif (self.level < 300) then return 1 elseif (self.level < 300) then return 1
elseif (self.level < 330) then return 2 elseif (self.level < 330) then return 2
elseif (self.level < 360) then return 3 elseif (self.level < 360) then return 3
elseif (self.level < 400) then return 4 elseif (self.level < 400) then return 4
elseif (self.level < 420) then return 5 elseif (self.level < 420) then return 5
elseif (self.level < 450) then return 4 elseif (self.level < 450) then return 4
elseif (self.level < 500) then return 3 elseif (self.level < 500) then return 3
else return 20 else return 20
end end
end end
function MarathonA2Game:advanceOneFrame() function MarathonA2Game:advanceOneFrame()
@ -118,12 +118,12 @@ end
function MarathonA2Game:onLineClear(cleared_row_count) function MarathonA2Game:onLineClear(cleared_row_count)
cleared_row_count = cleared_row_count / 2 cleared_row_count = cleared_row_count / 2
self.level = math.min(self.level + cleared_row_count, 999) self.level = math.min(self.level + cleared_row_count, 999)
if self.level == 999 and not self.clear then if self.level == 999 and not self.clear then
self.clear = true self.clear = true
self.grid:clear() self.grid:clear()
self.roll_frames = -150 self.roll_frames = -150
end end
end end
function MarathonA2Game:updateScore(level, drop_bonus, cleared_lines) function MarathonA2Game:updateScore(level, drop_bonus, cleared_lines)

View File

@ -29,7 +29,7 @@ function SurvivalCKGame:new()
end end
function SurvivalCKGame:getARE() function SurvivalCKGame:getARE()
if self.level < 100 then return 15 if self.level < 100 then return 15
elseif self.level < 200 then return 14 elseif self.level < 200 then return 14
elseif self.level < 300 then return 13 elseif self.level < 300 then return 13
elseif self.level < 400 then return 12 elseif self.level < 400 then return 12
@ -49,7 +49,7 @@ function SurvivalCKGame:getLineARE()
end end
function SurvivalCKGame:getDasLimit() function SurvivalCKGame:getDasLimit()
if self.level < 700 then return 10 if self.level < 700 then return 10
elseif self.level < 900 then return 9 elseif self.level < 900 then return 9
elseif self.level < 1100 then return 8 elseif self.level < 1100 then return 8
elseif self.level < 1300 then return 7 elseif self.level < 1300 then return 7
@ -58,7 +58,7 @@ function SurvivalCKGame:getDasLimit()
end end
function SurvivalCKGame:getLineClearDelay() function SurvivalCKGame:getLineClearDelay()
if self.level < 100 then return 10 if self.level < 100 then return 10
elseif self.level < 200 then return 8 elseif self.level < 200 then return 8
elseif self.level < 300 then return 7 elseif self.level < 300 then return 7
elseif self.level < 400 then return 6 elseif self.level < 400 then return 6
@ -66,7 +66,7 @@ function SurvivalCKGame:getLineClearDelay()
end end
function SurvivalCKGame:getLockDelay() function SurvivalCKGame:getLockDelay()
if self.level < 600 then return 20 if self.level < 600 then return 20
elseif self.level < 700 then return 19 elseif self.level < 700 then return 19
elseif self.level < 800 then return 18 elseif self.level < 800 then return 18
elseif self.level < 900 then return 17 elseif self.level < 900 then return 17
@ -87,7 +87,7 @@ function SurvivalCKGame:getGravity()
end end
function SurvivalCKGame:getGarbageLimit() function SurvivalCKGame:getGarbageLimit()
if self.level < 1000 then return 20 if self.level < 1000 then return 20
elseif self.level < 1100 then return 17 elseif self.level < 1100 then return 17
elseif self.level < 1200 then return 14 elseif self.level < 1200 then return 14
elseif self.level < 1300 then return 11 elseif self.level < 1300 then return 11
@ -95,7 +95,7 @@ function SurvivalCKGame:getGarbageLimit()
end end
function SurvivalCKGame:getRegretTime() function SurvivalCKGame:getRegretTime()
if self.level < 500 then return frameTime(0,55) if self.level < 500 then return frameTime(0,55)
elseif self.level < 1000 then return frameTime(0,50) elseif self.level < 1000 then return frameTime(0,50)
elseif self.level < 1500 then return frameTime(0,40) elseif self.level < 1500 then return frameTime(0,40)
elseif self.level < 2000 then return frameTime(0,35) elseif self.level < 2000 then return frameTime(0,35)
@ -153,11 +153,11 @@ function SurvivalCKGame:onLineClear(cleared_row_count)
local new_level = self.level + cleared_row_count * 2 local new_level = self.level + cleared_row_count * 2
self:updateSectionTimes(self.level, new_level) self:updateSectionTimes(self.level, new_level)
if new_level >= 2500 or self:hitTorikan(self.level, new_level) then if new_level >= 2500 or self:hitTorikan(self.level, new_level) then
self.clear = true self.clear = true
if new_level >= 2500 then if new_level >= 2500 then
self.level = 2500 self.level = 2500
self.grid:clear() self.grid:clear()
self.big_mode = true self.big_mode = true
self.roll_frames = -150 self.roll_frames = -150
end end
else else
@ -217,11 +217,11 @@ function SurvivalCKGame:drawGrid()
elseif self.level >= 1600 and self.level < 1700 then elseif self.level >= 1600 and self.level < 1700 then
self.grid:drawInvisible(self.rollOpacityFunction2) self.grid:drawInvisible(self.rollOpacityFunction2)
elseif self.level >= 1700 and self.level < 1800 then elseif self.level >= 1700 and self.level < 1800 then
self.grid:drawInvisible(self.rollOpacityFunction3) self.grid:drawInvisible(self.rollOpacityFunction3)
elseif self.level >= 1800 and self.level < 1900 then elseif self.level >= 1800 and self.level < 1900 then
self.grid:drawInvisible(self.rollOpacityFunction4) self.grid:drawInvisible(self.rollOpacityFunction4)
elseif self.level >= 1900 and self.level < 2000 then elseif self.level >= 1900 and self.level < 2000 then
self.grid:drawInvisible(self.rollOpacityFunction5) self.grid:drawInvisible(self.rollOpacityFunction5)
else else
self.grid:draw() self.grid:draw()
end end
@ -237,27 +237,27 @@ SurvivalCKGame.rollOpacityFunction1 = function(age)
end end
SurvivalCKGame.rollOpacityFunction2 = function(age) SurvivalCKGame.rollOpacityFunction2 = function(age)
if age < 360 then return 1 if age < 360 then return 1
elseif age > 420 then return 0 elseif age > 420 then return 0
else return 1 - (age - 360) / 60 end else return 1 - (age - 360) / 60 end
end end
SurvivalCKGame.rollOpacityFunction3 = function(age) SurvivalCKGame.rollOpacityFunction3 = function(age)
if age < 300 then return 1 if age < 300 then return 1
elseif age > 360 then return 0 elseif age > 360 then return 0
else return 1 - (age - 300) / 60 end else return 1 - (age - 300) / 60 end
end end
SurvivalCKGame.rollOpacityFunction4 = function(age) SurvivalCKGame.rollOpacityFunction4 = function(age)
if age < 240 then return 1 if age < 240 then return 1
elseif age > 300 then return 0 elseif age > 300 then return 0
else return 1 - (age - 240) / 60 end else return 1 - (age - 240) / 60 end
end end
SurvivalCKGame.rollOpacityFunction5 = function(age) SurvivalCKGame.rollOpacityFunction5 = function(age)
if age < 180 then return 1 if age < 180 then return 1
elseif age > 240 then return 0 elseif age > 240 then return 0
else return 1 - (age - 180) / 60 end else return 1 - (age - 180) / 60 end
end end
local master_grades = { "M", "MK", "MV", "MO", "MM" } local master_grades = { "M", "MK", "MV", "MO", "MM" }

View File

@ -26,13 +26,13 @@ function DemonModeGame:new()
self.enable_hold = true self.enable_hold = true
self.lock_drop = true self.lock_drop = true
self.next_queue_length = 3 self.next_queue_length = 3
if math.random() < 1/6.66 then if math.random() < 1/6.66 then
self.rpc_details = "Suffering" self.rpc_details = "Suffering"
end end
end end
function DemonModeGame:getARE() function DemonModeGame:getARE()
if self.level < 500 then return 30 if self.level < 500 then return 30
elseif self.level < 600 then return 25 elseif self.level < 600 then return 25
elseif self.level < 700 then return 15 elseif self.level < 700 then return 15
elseif self.level < 800 then return 14 elseif self.level < 800 then return 14
@ -53,7 +53,7 @@ function DemonModeGame:getLineARE()
end end
function DemonModeGame:getDasLimit() function DemonModeGame:getDasLimit()
if self.level < 500 then return 15 if self.level < 500 then return 15
elseif self.level < 1000 then return 10 elseif self.level < 1000 then return 10
elseif self.level < 1500 then return 5 elseif self.level < 1500 then return 5
elseif self.level < 1700 then return 4 elseif self.level < 1700 then return 4

View File

@ -40,12 +40,12 @@ function GameMode:new()
self.draw_section_times = false self.draw_section_times = false
self.draw_secondary_section_times = false self.draw_secondary_section_times = false
self.big_mode = false self.big_mode = false
self.rpc_details = "In game" self.rpc_details = "In game"
-- variables related to configurable parameters -- variables related to configurable parameters
self.drop_locked = false self.drop_locked = false
self.hard_drop_locked = false self.hard_drop_locked = false
self.lock_on_soft_drop = false self.lock_on_soft_drop = false
self.lock_on_hard_drop = false self.lock_on_hard_drop = false
self.hold_queue = nil self.hold_queue = nil
self.held = false self.held = false
self.section_start_time = 0 self.section_start_time = 0
@ -62,7 +62,7 @@ function GameMode:getLineClearDelay() return 40 end
function GameMode:getDasLimit() return 15 end function GameMode:getDasLimit() return 15 end
function GameMode:getNextPiece(ruleset) function GameMode:getNextPiece(ruleset)
return { return {
skin = "2tie", skin = "2tie",
shape = self.randomizer:nextPiece(), shape = self.randomizer:nextPiece(),
@ -72,12 +72,12 @@ end
function GameMode:initialize(ruleset) function GameMode:initialize(ruleset)
-- generate next queue -- generate next queue
self:new() self:new()
for i = 1, self.next_queue_length do for i = 1, self.next_queue_length do
table.insert(self.next_queue, self:getNextPiece(ruleset)) table.insert(self.next_queue, self:getNextPiece(ruleset))
end end
self.lock_on_soft_drop = ({ruleset.softdrop_lock, self.instant_soft_drop, false, true })[config.gamesettings.manlock] self.lock_on_soft_drop = ({ruleset.softdrop_lock, self.instant_soft_drop, false, true })[config.gamesettings.manlock]
self.lock_on_hard_drop = ({ruleset.harddrop_lock, self.instant_hard_drop, true, false})[config.gamesettings.manlock] self.lock_on_hard_drop = ({ruleset.harddrop_lock, self.instant_hard_drop, true, false})[config.gamesettings.manlock]
end end
function GameMode:update(inputs, ruleset) function GameMode:update(inputs, ruleset)
@ -346,7 +346,7 @@ function GameMode:drawGhostPiece(ruleset)
end end
function GameMode:drawNextQueue(ruleset) function GameMode:drawNextQueue(ruleset)
local colourscheme = ({ruleset.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour] local colourscheme = ({ruleset.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour]
function drawPiece(piece, skin, offsets, pos_x, pos_y) function drawPiece(piece, skin, offsets, pos_x, pos_y)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
local x = offset.x + ruleset.spawn_positions[piece].x local x = offset.x + ruleset.spawn_positions[piece].x
@ -379,9 +379,9 @@ function GameMode:drawNextQueue(ruleset)
end end
function GameMode:setNextOpacity(i, j) function GameMode:setNextOpacity(i, j)
i = i ~= nil and i or 1 i = i ~= nil and i or 1
j = j ~= nil and j or 1 j = j ~= nil and j or 1
love.graphics.setColor(j, j, j, i) love.graphics.setColor(j, j, j, i)
end end
function GameMode:setHoldOpacity(i, j) function GameMode:setHoldOpacity(i, j)
i = i ~= nil and i or 1 i = i ~= nil and i or 1

View File

@ -16,8 +16,8 @@ function KonohaGame:new()
self.randomizer = KonohaRandomizer() self.randomizer = KonohaRandomizer()
self.bravos = 0 self.bravos = 0
self.last_bonus_amount = 0 self.last_bonus_amount = 0
self.last_bonus_display_time = 0 self.last_bonus_display_time = 0
self.time_limit = 10800 self.time_limit = 10800
self.big_mode = true self.big_mode = true
@ -26,7 +26,7 @@ function KonohaGame:new()
end end
function KonohaGame:getARE() function KonohaGame:getARE()
if self.level < 300 then return 30 if self.level < 300 then return 30
elseif self.level < 400 then return 25 elseif self.level < 400 then return 25
elseif self.level < 500 then return 20 elseif self.level < 500 then return 20
elseif self.level < 600 then return 17 elseif self.level < 600 then return 17
@ -42,14 +42,14 @@ function KonohaGame:getLineARE()
end end
function KonohaGame:getDasLimit() function KonohaGame:getDasLimit()
if self.level < 500 then return 10 if self.level < 500 then return 10
elseif self.level < 800 then return 9 elseif self.level < 800 then return 9
elseif self.level < 1000 then return 8 elseif self.level < 1000 then return 8
else return 7 end else return 7 end
end end
function KonohaGame:getLineClearDelay() function KonohaGame:getLineClearDelay()
if self.level < 200 then return 14 if self.level < 200 then return 14
elseif self.level < 500 then return 9 elseif self.level < 500 then return 9
elseif self.level < 800 then return 8 elseif self.level < 800 then return 8
elseif self.level < 1000 then return 7 elseif self.level < 1000 then return 7
@ -57,7 +57,7 @@ function KonohaGame:getLineClearDelay()
end end
function KonohaGame:getLockDelay() function KonohaGame:getLockDelay()
if self.level < 500 then return 30 if self.level < 500 then return 30
elseif self.level < 600 then return 25 elseif self.level < 600 then return 25
elseif self.level < 700 then return 23 elseif self.level < 700 then return 23
elseif self.level < 800 then return 20 elseif self.level < 800 then return 20
@ -69,7 +69,7 @@ function KonohaGame:getLockDelay()
end end
function KonohaGame:getGravity() function KonohaGame:getGravity()
if (self.level < 30) then return 4/256 if (self.level < 30) then return 4/256
elseif (self.level < 35) then return 8/256 elseif (self.level < 35) then return 8/256
elseif (self.level < 40) then return 12/256 elseif (self.level < 40) then return 12/256
elseif (self.level < 50) then return 16/256 elseif (self.level < 50) then return 16/256
@ -102,7 +102,7 @@ function KonohaGame:advanceOneFrame()
if self.time_limit <= 0 then if self.time_limit <= 0 then
self.game_over = true self.game_over = true
end end
self.last_bonus_display_time = self.last_bonus_display_time - 1 self.last_bonus_display_time = self.last_bonus_display_time - 1
end end
function KonohaGame:onPieceEnter() function KonohaGame:onPieceEnter()
@ -124,9 +124,9 @@ local non_bravo_bonus = {0, 0, 20, 40}
local bravo_ot_bonus = {0, 60, 120, 180} local bravo_ot_bonus = {0, 60, 120, 180}
function KonohaGame:onLineClear(cleared_row_count) function KonohaGame:onLineClear(cleared_row_count)
local oldtime = self.time_limit local oldtime = self.time_limit
self.level = self.level + cleared_row_levels[cleared_row_count / 2] self.level = self.level + cleared_row_levels[cleared_row_count / 2]
if self.grid:checkForBravo(cleared_row_count) then if self.grid:checkForBravo(cleared_row_count) then
self.bravos = self.bravos + 1 self.bravos = self.bravos + 1
if self.level < 1000 then self.time_limit = self.time_limit + bravo_bonus[cleared_row_count / 2] if self.level < 1000 then self.time_limit = self.time_limit + bravo_bonus[cleared_row_count / 2]
@ -136,12 +136,12 @@ function KonohaGame:onLineClear(cleared_row_count)
elseif self.level < 1000 then elseif self.level < 1000 then
self.time_limit = self.time_limit + non_bravo_bonus[cleared_row_count / 2] self.time_limit = self.time_limit + non_bravo_bonus[cleared_row_count / 2]
end end
local bonus = self.time_limit - oldtime local bonus = self.time_limit - oldtime
if bonus > 0 then if bonus > 0 then
self.last_bonus_amount = bonus self.last_bonus_amount = bonus
self.last_bonus_display_time = 120 self.last_bonus_display_time = 120
end end
end end
function KonohaGame:getBackground() function KonohaGame:getBackground()
@ -164,13 +164,13 @@ function KonohaGame:drawScoringInfo()
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
if not self.game_over and self.time_limit < frameTime(0,10) and self.time_limit % 4 < 2 then if not self.game_over and self.time_limit < frameTime(0,10) and self.time_limit % 4 < 2 then
love.graphics.setColor(1, 0.3, 0.3, 1) love.graphics.setColor(1, 0.3, 0.3, 1)
end end
love.graphics.printf(formatTime(self.time_limit), 240, 140, 120, "right") love.graphics.printf(formatTime(self.time_limit), 240, 140, 120, "right")
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
if self.last_bonus_display_time > 0 then if self.last_bonus_display_time > 0 then
love.graphics.printf("+"..formatTime(self.last_bonus_amount), 240, 160, 120, "right") love.graphics.printf("+"..formatTime(self.last_bonus_amount), 240, 160, 120, "right")
end end
love.graphics.printf(self.bravos, 240, 220, 90, "left") love.graphics.printf(self.bravos, 240, 220, 90, "left")
love.graphics.printf(self.level, 240, 340, 50, "right") love.graphics.printf(self.level, 240, 340, 50, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 50, "right") love.graphics.printf(self:getSectionEndLevel(), 240, 370, 50, "right")

View File

@ -41,7 +41,7 @@ function Marathon2020Game:new()
end end
function Marathon2020Game:getARE() function Marathon2020Game:getARE()
if self.delay_level < 1 then return 27 if self.delay_level < 1 then return 27
elseif self.delay_level < 2 then return 24 elseif self.delay_level < 2 then return 24
elseif self.delay_level < 3 then return 21 elseif self.delay_level < 3 then return 21
elseif self.delay_level < 4 then return 18 elseif self.delay_level < 4 then return 18
@ -60,7 +60,7 @@ function Marathon2020Game:getLineARE()
end end
function Marathon2020Game:getDasLimit() function Marathon2020Game:getDasLimit()
if self.delay_level < 1 then return 15 if self.delay_level < 1 then return 15
elseif self.delay_level < 3 then return 12 elseif self.delay_level < 3 then return 12
elseif self.delay_level < 5 then return 9 elseif self.delay_level < 5 then return 9
elseif self.delay_level < 8 then return 8 elseif self.delay_level < 8 then return 8
@ -72,7 +72,7 @@ function Marathon2020Game:getDasLimit()
end end
function Marathon2020Game:getLineClearDelay() function Marathon2020Game:getLineClearDelay()
if self.delay_level < 1 then return 40 if self.delay_level < 1 then return 40
elseif self.delay_level < 3 then return 25 elseif self.delay_level < 3 then return 25
elseif self.delay_level < 4 then return 20 elseif self.delay_level < 4 then return 20
elseif self.delay_level < 5 then return 15 elseif self.delay_level < 5 then return 15
@ -84,7 +84,7 @@ 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
elseif self.delay_level < 9 then return 19 elseif self.delay_level < 9 then return 19
@ -98,35 +98,35 @@ function Marathon2020Game:getLockDelay()
end end
function Marathon2020Game:getGravity() function Marathon2020Game:getGravity()
if self.level < 30 then return 4/256 if self.level < 30 then return 4/256
elseif self.level < 35 then return 6/256 elseif self.level < 35 then return 6/256
elseif self.level < 40 then return 8/256 elseif self.level < 40 then return 8/256
elseif self.level < 50 then return 10/256 elseif self.level < 50 then return 10/256
elseif self.level < 60 then return 12/256 elseif self.level < 60 then return 12/256
elseif self.level < 70 then return 16/256 elseif self.level < 70 then return 16/256
elseif self.level < 80 then return 32/256 elseif self.level < 80 then return 32/256
elseif self.level < 90 then return 48/256 elseif self.level < 90 then return 48/256
elseif self.level < 100 then return 64/256 elseif self.level < 100 then return 64/256
elseif self.level < 120 then return 80/256 elseif self.level < 120 then return 80/256
elseif self.level < 140 then return 96/256 elseif self.level < 140 then return 96/256
elseif self.level < 160 then return 112/256 elseif self.level < 160 then return 112/256
elseif self.level < 170 then return 128/256 elseif self.level < 170 then return 128/256
elseif self.level < 200 then return 144/256 elseif self.level < 200 then return 144/256
elseif self.level < 220 then return 4/256 elseif self.level < 220 then return 4/256
elseif self.level < 230 then return 32/256 elseif self.level < 230 then return 32/256
elseif self.level < 233 then return 64/256 elseif self.level < 233 then return 64/256
elseif self.level < 236 then return 96/256 elseif self.level < 236 then return 96/256
elseif self.level < 239 then return 128/256 elseif self.level < 239 then return 128/256
elseif self.level < 243 then return 160/256 elseif self.level < 243 then return 160/256
elseif self.level < 247 then return 192/256 elseif self.level < 247 then return 192/256
elseif self.level < 251 then return 224/256 elseif self.level < 251 then return 224/256
elseif self.level < 300 then return 1 elseif self.level < 300 then return 1
elseif self.level < 330 then return 2 elseif self.level < 330 then return 2
elseif self.level < 360 then return 3 elseif self.level < 360 then return 3
elseif self.level < 400 then return 4 elseif self.level < 400 then return 4
elseif self.level < 420 then return 5 elseif self.level < 420 then return 5
elseif self.level < 450 then return 4 elseif self.level < 450 then return 4
elseif self.level < 500 then return 3 elseif self.level < 500 then return 3
else return 20 end else return 20 end
end end
@ -260,7 +260,7 @@ local function getSectionForLevel(level)
end end
function Marathon2020Game:getEndOfSectionForSection(section) function Marathon2020Game:getEndOfSectionForSection(section)
if self.torikan_passed[900] == false and section == 10 then return 999 if self.torikan_passed[900] == false and section == 10 then return 999
elseif self.torikan_passed[1900] == false and section == 20 then return 2000 elseif self.torikan_passed[1900] == false and section == 20 then return 2000
elseif section == 20 then return 2020 elseif section == 20 then return 2020
else return section * 100 end else return section * 100 end
@ -303,7 +303,7 @@ function Marathon2020Game:checkClear(level)
level >= 2020 level >= 2020
) then ) then
if self.torikan_passed[500] == false then self.level = 500 if self.torikan_passed[500] == false then self.level = 500
elseif self.torikan_passed[900] == false then self.level = 999 elseif self.torikan_passed[900] == false then self.level = 999
elseif self.torikan_passed[1000] == false then self.level = 1000 elseif self.torikan_passed[1000] == false then self.level = 1000
elseif self.torikan_passed[1500] == false then self.level = 1500 elseif self.torikan_passed[1500] == false then self.level = 1500
@ -434,9 +434,9 @@ function Marathon2020Game:drawScoringInfo()
self:drawSectionTimesWithSecondary(current_section) self:drawSectionTimesWithSecondary(current_section)
if (self.cool_timer > 0) then if (self.cool_timer > 0) then
love.graphics.printf("COOL!!", 64, 400, 160, "center") love.graphics.printf("COOL!!", 64, 400, 160, "center")
self.cool_timer = self.cool_timer - 1 self.cool_timer = self.cool_timer - 1
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(self:getTotalGrade(), text_x, 120, 90, "left") love.graphics.printf(self:getTotalGrade(), text_x, 120, 90, "left")

View File

@ -14,26 +14,26 @@ MarathonA1Game.tagline = "Can you score enough points to reach the title of Gran
function MarathonA1Game:new() function MarathonA1Game:new()
MarathonA1Game.super:new() MarathonA1Game.super:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.bravos = 0 self.bravos = 0
self.gm_conditions = { self.gm_conditions = {
level300 = false, level300 = false,
level500 = false, level500 = false,
level999 = false level999 = false
} }
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.randomizer = History4RollsRandomizer() self.randomizer = History4RollsRandomizer()
self.lock_drop = false self.lock_drop = false
self.enable_hard_drop = false self.enable_hard_drop = false
self.enable_hold = false self.enable_hold = false
self.next_queue_length = 1 self.next_queue_length = 1
end end
@ -59,60 +59,60 @@ function MarathonA1Game:getLockDelay()
end end
local function getRankForScore(score) local function getRankForScore(score)
if score < 400 then return {rank = "9", next = 400} if score < 400 then return {rank = "9", next = 400}
elseif score < 800 then return {rank = "8", next = 800} elseif score < 800 then return {rank = "8", next = 800}
elseif score < 1400 then return {rank = "7", next = 1400} elseif score < 1400 then return {rank = "7", next = 1400}
elseif score < 2000 then return {rank = "6", next = 2000} elseif score < 2000 then return {rank = "6", next = 2000}
elseif score < 3500 then return {rank = "5", next = 3500} elseif score < 3500 then return {rank = "5", next = 3500}
elseif score < 5500 then return {rank = "4", next = 5500} elseif score < 5500 then return {rank = "4", next = 5500}
elseif score < 8000 then return {rank = "3", next = 8000} elseif score < 8000 then return {rank = "3", next = 8000}
elseif score < 12000 then return {rank = "2", next = 12000} elseif score < 12000 then return {rank = "2", next = 12000}
elseif score < 16000 then return {rank = "1", next = 16000} elseif score < 16000 then return {rank = "1", next = 16000}
elseif score < 22000 then return {rank = "S1", next = 22000} elseif score < 22000 then return {rank = "S1", next = 22000}
elseif score < 30000 then return {rank = "S2", next = 30000} elseif score < 30000 then return {rank = "S2", next = 30000}
elseif score < 40000 then return {rank = "S3", next = 40000} elseif score < 40000 then return {rank = "S3", next = 40000}
elseif score < 52000 then return {rank = "S4", next = 52000} elseif score < 52000 then return {rank = "S4", next = 52000}
elseif score < 66000 then return {rank = "S5", next = 66000} elseif score < 66000 then return {rank = "S5", next = 66000}
elseif score < 82000 then return {rank = "S6", next = 82000} elseif score < 82000 then return {rank = "S6", next = 82000}
elseif score < 100000 then return {rank = "S7", next = 100000} elseif score < 100000 then return {rank = "S7", next = 100000}
elseif score < 120000 then return {rank = "S8", next = 120000} elseif score < 120000 then return {rank = "S8", next = 120000}
else return {rank = "S9", next = "???"} else return {rank = "S9", next = "???"}
end end
end end
function MarathonA1Game:getGravity() function MarathonA1Game:getGravity()
local level = self.level local level = self.level
if (level < 30) then return 4/256 if (level < 30) then return 4/256
elseif (level < 35) then return 6/256 elseif (level < 35) then return 6/256
elseif (level < 40) then return 8/256 elseif (level < 40) then return 8/256
elseif (level < 50) then return 10/256 elseif (level < 50) then return 10/256
elseif (level < 60) then return 12/256 elseif (level < 60) then return 12/256
elseif (level < 70) then return 16/256 elseif (level < 70) then return 16/256
elseif (level < 80) then return 32/256 elseif (level < 80) then return 32/256
elseif (level < 90) then return 48/256 elseif (level < 90) then return 48/256
elseif (level < 100) then return 64/256 elseif (level < 100) then return 64/256
elseif (level < 120) then return 80/256 elseif (level < 120) then return 80/256
elseif (level < 140) then return 96/256 elseif (level < 140) then return 96/256
elseif (level < 160) then return 112/256 elseif (level < 160) then return 112/256
elseif (level < 170) then return 128/256 elseif (level < 170) then return 128/256
elseif (level < 200) then return 144/256 elseif (level < 200) then return 144/256
elseif (level < 220) then return 4/256 elseif (level < 220) then return 4/256
elseif (level < 230) then return 32/256 elseif (level < 230) then return 32/256
elseif (level < 233) then return 64/256 elseif (level < 233) then return 64/256
elseif (level < 236) then return 96/256 elseif (level < 236) then return 96/256
elseif (level < 239) then return 128/256 elseif (level < 239) then return 128/256
elseif (level < 243) then return 160/256 elseif (level < 243) then return 160/256
elseif (level < 247) then return 192/256 elseif (level < 247) then return 192/256
elseif (level < 251) then return 224/256 elseif (level < 251) then return 224/256
elseif (level < 300) then return 1 elseif (level < 300) then return 1
elseif (level < 330) then return 2 elseif (level < 330) then return 2
elseif (level < 360) then return 3 elseif (level < 360) then return 3
elseif (level < 400) then return 4 elseif (level < 400) then return 4
elseif (level < 420) then return 5 elseif (level < 420) then return 5
elseif (level < 450) then return 4 elseif (level < 450) then return 4
elseif (level < 500) then return 3 elseif (level < 500) then return 3
else return 20 else return 20
end end
end end
function MarathonA1Game:advanceOneFrame() function MarathonA1Game:advanceOneFrame()
@ -134,7 +134,7 @@ function MarathonA1Game:onPieceEnter()
end end
function MarathonA1Game:onLineClear(cleared_row_count) function MarathonA1Game:onLineClear(cleared_row_count)
self:checkGMRequirements(self.level, self.level + cleared_row_count) self:checkGMRequirements(self.level, self.level + cleared_row_count)
if not self.clear then if not self.clear then
local new_level = math.min(self.level + cleared_row_count, 999) local new_level = math.min(self.level + cleared_row_count, 999)
if new_level == 999 then if new_level == 999 then
@ -201,10 +201,10 @@ function MarathonA1Game:drawScoringInfo()
love.graphics.printf("SCORE", 240, 200, 40, "left") love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("NEXT RANK", 240, 260, 90, "left") love.graphics.printf("NEXT RANK", 240, 260, 90, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left") love.graphics.printf("LEVEL", 240, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end
@ -218,11 +218,11 @@ function MarathonA1Game:drawScoringInfo()
love.graphics.printf(getRankForScore(self.score).next, 240, 280, 90, "left") love.graphics.printf(getRankForScore(self.score).next, 240, 280, 90, "left")
love.graphics.printf(self.level, 240, 340, 40, "right") love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end
love.graphics.setFont(font_8x11) love.graphics.setFont(font_8x11)
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center") love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")
end end

View File

@ -15,10 +15,10 @@ MarathonA2Game.tagline = "The points don't matter! Can you reach the invisible r
function MarathonA2Game:new() function MarathonA2Game:new()
MarathonA2Game.super:new() MarathonA2Game.super:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.grade = 0 self.grade = 0
self.grade_points = 0 self.grade_points = 0
@ -26,82 +26,82 @@ function MarathonA2Game:new()
self.section_start_time = 0 self.section_start_time = 0
self.section_times = { [0] = 0 } self.section_times = { [0] = 0 }
self.section_tetrises = { [0] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } self.section_tetrises = { [0] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.lock_drop = false self.lock_drop = false
self.enable_hold = false self.enable_hold = false
self.next_queue_length = 1 self.next_queue_length = 1
end end
function MarathonA2Game:getARE() function MarathonA2Game:getARE()
if self.level < 700 then return 27 if self.level < 700 then return 27
elseif self.level < 800 then return 18 elseif self.level < 800 then return 18
else return 14 end else return 14 end
end end
function MarathonA2Game:getLineARE() function MarathonA2Game:getLineARE()
if self.level < 600 then return 27 if self.level < 600 then return 27
elseif self.level < 700 then return 18 elseif self.level < 700 then return 18
elseif self.level < 800 then return 14 elseif self.level < 800 then return 14
else return 8 end else return 8 end
end end
function MarathonA2Game:getDasLimit() function MarathonA2Game:getDasLimit()
if self.level < 500 then return 15 if self.level < 500 then return 15
elseif self.level < 900 then return 9 elseif self.level < 900 then return 9
else return 7 end else return 7 end
end end
function MarathonA2Game:getLineClearDelay() function MarathonA2Game:getLineClearDelay()
if self.level < 500 then return 40 if self.level < 500 then return 40
elseif self.level < 600 then return 25 elseif self.level < 600 then return 25
elseif self.level < 700 then return 16 elseif self.level < 700 then return 16
elseif self.level < 800 then return 12 elseif self.level < 800 then return 12
else return 6 end else return 6 end
end end
function MarathonA2Game:getLockDelay() function MarathonA2Game:getLockDelay()
if self.level < 900 then return 30 if self.level < 900 then return 30
else return 17 end else return 17 end
end end
function MarathonA2Game:getGravity() function MarathonA2Game:getGravity()
if (self.level < 30) then return 4/256 if (self.level < 30) then return 4/256
elseif (self.level < 35) then return 6/256 elseif (self.level < 35) then return 6/256
elseif (self.level < 40) then return 8/256 elseif (self.level < 40) then return 8/256
elseif (self.level < 50) then return 10/256 elseif (self.level < 50) then return 10/256
elseif (self.level < 60) then return 12/256 elseif (self.level < 60) then return 12/256
elseif (self.level < 70) then return 16/256 elseif (self.level < 70) then return 16/256
elseif (self.level < 80) then return 32/256 elseif (self.level < 80) then return 32/256
elseif (self.level < 90) then return 48/256 elseif (self.level < 90) then return 48/256
elseif (self.level < 100) then return 64/256 elseif (self.level < 100) then return 64/256
elseif (self.level < 120) then return 80/256 elseif (self.level < 120) then return 80/256
elseif (self.level < 140) then return 96/256 elseif (self.level < 140) then return 96/256
elseif (self.level < 160) then return 112/256 elseif (self.level < 160) then return 112/256
elseif (self.level < 170) then return 128/256 elseif (self.level < 170) then return 128/256
elseif (self.level < 200) then return 144/256 elseif (self.level < 200) then return 144/256
elseif (self.level < 220) then return 4/256 elseif (self.level < 220) then return 4/256
elseif (self.level < 230) then return 32/256 elseif (self.level < 230) then return 32/256
elseif (self.level < 233) then return 64/256 elseif (self.level < 233) then return 64/256
elseif (self.level < 236) then return 96/256 elseif (self.level < 236) then return 96/256
elseif (self.level < 239) then return 128/256 elseif (self.level < 239) then return 128/256
elseif (self.level < 243) then return 160/256 elseif (self.level < 243) then return 160/256
elseif (self.level < 247) then return 192/256 elseif (self.level < 247) then return 192/256
elseif (self.level < 251) then return 224/256 elseif (self.level < 251) then return 224/256
elseif (self.level < 300) then return 1 elseif (self.level < 300) then return 1
elseif (self.level < 330) then return 2 elseif (self.level < 330) then return 2
elseif (self.level < 360) then return 3 elseif (self.level < 360) then return 3
elseif (self.level < 400) then return 4 elseif (self.level < 400) then return 4
elseif (self.level < 420) then return 5 elseif (self.level < 420) then return 5
elseif (self.level < 450) then return 4 elseif (self.level < 450) then return 4
elseif (self.level < 500) then return 3 elseif (self.level < 500) then return 3
else return 20 else return 20
end end
end end
function MarathonA2Game:advanceOneFrame() function MarathonA2Game:advanceOneFrame()
@ -144,13 +144,13 @@ function MarathonA2Game:updateScore(level, drop_bonus, cleared_lines)
end end
function MarathonA2Game:onLineClear(cleared_row_count) function MarathonA2Game:onLineClear(cleared_row_count)
self.level = math.min(self.level + cleared_row_count, 999) self.level = math.min(self.level + cleared_row_count, 999)
if self.level == 999 and not self.clear then if self.level == 999 and not self.clear then
self.clear = true self.clear = true
self.grid:clear() self.grid:clear()
if self:qualifiesForMRoll() then self.grade = 32 end if self:qualifiesForMRoll() then self.grade = 32 end
self.roll_frames = -150 self.roll_frames = -150
end end
end end
function MarathonA2Game:updateSectionTimes(old_level, new_level) function MarathonA2Game:updateSectionTimes(old_level, new_level)
@ -335,10 +335,10 @@ function MarathonA2Game:drawScoringInfo()
love.graphics.printf("GRADE", 240, 120, 40, "left") love.graphics.printf("GRADE", 240, 120, 40, "left")
love.graphics.printf("SCORE", 240, 200, 40, "left") love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left") love.graphics.printf("LEVEL", 240, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
if self.clear then if self.clear then
@ -355,9 +355,9 @@ function MarathonA2Game:drawScoringInfo()
love.graphics.printf(self.score, 240, 220, 90, "left") love.graphics.printf(self.score, 240, 220, 90, "left")
love.graphics.printf(self.level, 240, 340, 40, "right") love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
love.graphics.setFont(font_8x11) love.graphics.setFont(font_8x11)
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center") love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")

View File

@ -15,11 +15,11 @@ MarathonA3Game.tagline = "The game gets faster way more quickly! Can you get all
function MarathonA3Game:new() function MarathonA3Game:new()
MarathonA3Game.super:new() MarathonA3Game.super:new()
self.speed_level = 0 self.speed_level = 0
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.grade = 0 self.grade = 0
self.grade_points = 0 self.grade_points = 0
self.roll_points = 0 self.roll_points = 0
@ -30,17 +30,17 @@ function MarathonA3Game:new()
self.section_70_times = { [0] = 0 } self.section_70_times = { [0] = 0 }
self.section_times = { [0] = 0 } self.section_times = { [0] = 0 }
self.section_cool = false self.section_cool = false
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.lock_drop = true self.lock_drop = true
self.lock_hard_drop = true self.lock_hard_drop = true
self.enable_hold = true self.enable_hold = true
self.next_queue_length = 3 self.next_queue_length = 3
@ -51,77 +51,77 @@ self.SGnames = {
end end
function MarathonA3Game:getARE() function MarathonA3Game:getARE()
if self.speed_level < 700 then return 27 if self.speed_level < 700 then return 27
elseif self.speed_level < 800 then return 18 elseif self.speed_level < 800 then return 18
elseif self.speed_level < 1000 then return 14 elseif self.speed_level < 1000 then return 14
elseif self.speed_level < 1100 then return 8 elseif self.speed_level < 1100 then return 8
elseif self.speed_level < 1200 then return 7 elseif self.speed_level < 1200 then return 7
else return 6 end else return 6 end
end end
function MarathonA3Game:getLineARE() function MarathonA3Game:getLineARE()
if self.speed_level < 600 then return 27 if self.speed_level < 600 then return 27
elseif self.speed_level < 700 then return 18 elseif self.speed_level < 700 then return 18
elseif self.speed_level < 800 then return 14 elseif self.speed_level < 800 then return 14
elseif self.speed_level < 1100 then return 8 elseif self.speed_level < 1100 then return 8
elseif self.speed_level < 1200 then return 7 elseif self.speed_level < 1200 then return 7
else return 6 end else return 6 end
end end
function MarathonA3Game:getDasLimit() function MarathonA3Game:getDasLimit()
if self.speed_level < 500 then return 15 if self.speed_level < 500 then return 15
elseif self.speed_level < 900 then return 9 elseif self.speed_level < 900 then return 9
else return 7 end else return 7 end
end end
function MarathonA3Game:getLineClearDelay() function MarathonA3Game:getLineClearDelay()
if self.speed_level < 500 then return 40 if self.speed_level < 500 then return 40
elseif self.speed_level < 600 then return 25 elseif self.speed_level < 600 then return 25
elseif self.speed_level < 700 then return 16 elseif self.speed_level < 700 then return 16
elseif self.speed_level < 800 then return 12 elseif self.speed_level < 800 then return 12
elseif self.speed_level < 1100 then return 6 elseif self.speed_level < 1100 then return 6
elseif self.speed_level < 1200 then return 5 elseif self.speed_level < 1200 then return 5
else return 4 end else return 4 end
end end
function MarathonA3Game:getLockDelay() function MarathonA3Game:getLockDelay()
if self.speed_level < 900 then return 30 if self.speed_level < 900 then return 30
elseif self.speed_level < 1100 then return 17 elseif self.speed_level < 1100 then return 17
else return 15 end else return 15 end
end end
function MarathonA3Game:getGravity() function MarathonA3Game:getGravity()
if (self.speed_level < 30) then return 4/256 if (self.speed_level < 30) then return 4/256
elseif (self.speed_level < 35) then return 6/256 elseif (self.speed_level < 35) then return 6/256
elseif (self.speed_level < 40) then return 8/256 elseif (self.speed_level < 40) then return 8/256
elseif (self.speed_level < 50) then return 10/256 elseif (self.speed_level < 50) then return 10/256
elseif (self.speed_level < 60) then return 12/256 elseif (self.speed_level < 60) then return 12/256
elseif (self.speed_level < 70) then return 16/256 elseif (self.speed_level < 70) then return 16/256
elseif (self.speed_level < 80) then return 32/256 elseif (self.speed_level < 80) then return 32/256
elseif (self.speed_level < 90) then return 48/256 elseif (self.speed_level < 90) then return 48/256
elseif (self.speed_level < 100) then return 64/256 elseif (self.speed_level < 100) then return 64/256
elseif (self.speed_level < 120) then return 80/256 elseif (self.speed_level < 120) then return 80/256
elseif (self.speed_level < 140) then return 96/256 elseif (self.speed_level < 140) then return 96/256
elseif (self.speed_level < 160) then return 112/256 elseif (self.speed_level < 160) then return 112/256
elseif (self.speed_level < 170) then return 128/256 elseif (self.speed_level < 170) then return 128/256
elseif (self.speed_level < 200) then return 144/256 elseif (self.speed_level < 200) then return 144/256
elseif (self.speed_level < 220) then return 4/256 elseif (self.speed_level < 220) then return 4/256
elseif (self.speed_level < 230) then return 32/256 elseif (self.speed_level < 230) then return 32/256
elseif (self.speed_level < 233) then return 64/256 elseif (self.speed_level < 233) then return 64/256
elseif (self.speed_level < 236) then return 96/256 elseif (self.speed_level < 236) then return 96/256
elseif (self.speed_level < 239) then return 128/256 elseif (self.speed_level < 239) then return 128/256
elseif (self.speed_level < 243) then return 160/256 elseif (self.speed_level < 243) then return 160/256
elseif (self.speed_level < 247) then return 192/256 elseif (self.speed_level < 247) then return 192/256
elseif (self.speed_level < 251) then return 224/256 elseif (self.speed_level < 251) then return 224/256
elseif (self.speed_level < 300) then return 1 elseif (self.speed_level < 300) then return 1
elseif (self.speed_level < 330) then return 2 elseif (self.speed_level < 330) then return 2
elseif (self.speed_level < 360) then return 3 elseif (self.speed_level < 360) then return 3
elseif (self.speed_level < 400) then return 4 elseif (self.speed_level < 400) then return 4
elseif (self.speed_level < 420) then return 5 elseif (self.speed_level < 420) then return 5
elseif (self.speed_level < 450) then return 4 elseif (self.speed_level < 450) then return 4
elseif (self.speed_level < 500) then return 3 elseif (self.speed_level < 500) then return 3
else return 20 else return 20
end end
end end
function MarathonA3Game:advanceOneFrame() function MarathonA3Game:advanceOneFrame()
@ -149,28 +149,28 @@ end
function MarathonA3Game:onPieceEnter() function MarathonA3Game:onPieceEnter()
if (self.level % 100 ~= 99) and self.level ~= 998 and self.frames ~= 0 then if (self.level % 100 ~= 99) and self.level ~= 998 and self.frames ~= 0 then
self:updateSectionTimes(self.level, self.level + 1) self:updateSectionTimes(self.level, self.level + 1)
self.level = self.level + 1 self.level = self.level + 1
self.speed_level = self.speed_level + 1 self.speed_level = self.speed_level + 1
self.torikan_passed = self.level >= 500 and true or false self.torikan_passed = self.level >= 500 and true or false
end end
end end
local cleared_row_levels = {1, 2, 4, 6} local cleared_row_levels = {1, 2, 4, 6}
function MarathonA3Game:onLineClear(cleared_row_count) function MarathonA3Game:onLineClear(cleared_row_count)
local advanced_levels = cleared_row_levels[cleared_row_count] local advanced_levels = cleared_row_levels[cleared_row_count]
self:updateSectionTimes(self.level, self.level + advanced_levels) self:updateSectionTimes(self.level, self.level + advanced_levels)
if not self.clear then if not self.clear then
self.level = math.min(self.level + advanced_levels, 999) self.level = math.min(self.level + advanced_levels, 999)
end end
self.speed_level = self.speed_level + advanced_levels self.speed_level = self.speed_level + advanced_levels
if self.level == 999 and not self.clear then if self.level == 999 and not self.clear then
self.clear = true self.clear = true
self.grid:clear() self.grid:clear()
self.roll_frames = -150 self.roll_frames = -150
end end
if not self.torikan_passed and self.level >= 500 and self.frames >= 25200 then if not self.torikan_passed and self.level >= 500 and self.frames >= 25200 then
self.level = 500 self.level = 500
self.game_over = true self.game_over = true
end end
@ -217,15 +217,15 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
table.insert(self.section_70_times, section_70_time) table.insert(self.section_70_times, section_70_time)
if section <= 9 and self.section_status[section - 1] == "cool" and if section <= 9 and self.section_status[section - 1] == "cool" and
self.section_70_times[section] < self.section_70_times[section - 1] + 120 then self.section_70_times[section] < self.section_70_times[section - 1] + 120 then
self.section_cool = true self.section_cool = true
self.coolregret_message = "COOL!!" self.coolregret_message = "COOL!!"
self.coolregret_timer = 300 self.coolregret_timer = 300
elseif self.section_status[section - 1] == "cool" then self.section_cool = false elseif self.section_status[section - 1] == "cool" then self.section_cool = false
elseif section <= 9 and self.section_70_times[section] < cool_cutoffs[section] then elseif section <= 9 and self.section_70_times[section] < cool_cutoffs[section] then
self.section_cool = true self.section_cool = true
self.coolregret_message = "COOL!!" self.coolregret_message = "COOL!!"
self.coolregret_timer = 300 self.coolregret_timer = 300
end end
end end
end end
@ -407,9 +407,9 @@ function MarathonA3Game:drawScoringInfo()
love.graphics.printf("SCORE", 240, 200, 40, "left") love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left") love.graphics.printf("LEVEL", 240, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
-- draw section time data -- draw section time data
current_section = math.floor(self.level / 100) + 1 current_section = math.floor(self.level / 100) + 1
@ -439,9 +439,9 @@ function MarathonA3Game:drawScoringInfo()
if not self.clear then love.graphics.printf(formatTime(self.frames - self.section_start_time), current_x, 40 + 20 * current_section, 90, "left") end if not self.clear then love.graphics.printf(formatTime(self.frames - self.section_start_time), current_x, 40 + 20 * current_section, 90, "left") end
if(self.coolregret_timer > 0) then if(self.coolregret_timer > 0) then
love.graphics.printf(self.coolregret_message, 64, 400, 160, "center") love.graphics.printf(self.coolregret_message, 64, 400, 160, "center")
self.coolregret_timer = self.coolregret_timer - 1 self.coolregret_timer = self.coolregret_timer - 1
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(self.score, 240, 220, 90, "left") love.graphics.printf(self.score, 240, 220, 90, "left")
@ -452,8 +452,8 @@ function MarathonA3Game:drawScoringInfo()
love.graphics.printf(self.level, 240, 340, 40, "right") love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
love.graphics.setFont(font_8x11) love.graphics.setFont(font_8x11)
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center") love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")

View File

@ -29,7 +29,7 @@ function MarathonAX4Game:new()
end end
function MarathonAX4Game:getARE() function MarathonAX4Game:getARE()
if self.lines < 10 then return 18 if self.lines < 10 then return 18
elseif self.lines < 40 then return 14 elseif self.lines < 40 then return 14
elseif self.lines < 60 then return 12 elseif self.lines < 60 then return 12
elseif self.lines < 70 then return 10 elseif self.lines < 70 then return 10
@ -43,14 +43,14 @@ function MarathonAX4Game:getLineARE()
end end
function MarathonAX4Game:getDasLimit() function MarathonAX4Game:getDasLimit()
if self.lines < 20 then return 10 if self.lines < 20 then return 10
elseif self.lines < 50 then return 9 elseif self.lines < 50 then return 9
elseif self.lines < 70 then return 8 elseif self.lines < 70 then return 8
else return 7 end else return 7 end
end end
function MarathonAX4Game:getLineClearDelay() function MarathonAX4Game:getLineClearDelay()
if self.lines < 10 then return 14 if self.lines < 10 then return 14
elseif self.lines < 30 then return 9 elseif self.lines < 30 then return 9
else return 5 end else return 5 end
end end

View File

@ -13,8 +13,8 @@ MarathonC89Game.tagline = "Can you play fast enough to reach the killscreen?"
function MarathonC89Game:new() function MarathonC89Game:new()
MarathonC89Game.super:new() MarathonC89Game.super:new()
self.randomizer = Randomizer() self.randomizer = Randomizer()
self.ready_frames = 1 self.ready_frames = 1
@ -23,8 +23,8 @@ function MarathonC89Game:new()
self.start_level = 12 self.start_level = 12
self.level = 12 self.level = 12
self.lock_drop = true self.lock_drop = true
self.enable_hard_drop = false self.enable_hard_drop = false
self.enable_hold = false self.enable_hold = false
self.next_queue_length = 1 self.next_queue_length = 1
self.additive_gravity = false self.additive_gravity = false
@ -99,7 +99,7 @@ local gravity_table = {
function MarathonC89Game:getGravity() function MarathonC89Game:getGravity()
if self.waiting_frames > 0 then return 0 end if self.waiting_frames > 0 then return 0 end
if self.level >= 29 then return 1 if self.level >= 29 then return 1
elseif self.level >= 19 then return 1/2 elseif self.level >= 19 then return 1/2
else return gravity_table[self.level] end else return gravity_table[self.level] end
end end

View File

@ -16,12 +16,12 @@ function PhantomManiaGame:new()
self.lock_drop = true self.lock_drop = true
self.next_queue_length = 1 self.next_queue_length = 1
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
@ -29,7 +29,7 @@ function PhantomManiaGame:new()
end end
function PhantomManiaGame:getARE() function PhantomManiaGame:getARE()
if self.level < 100 then return 18 if self.level < 100 then return 18
elseif self.level < 200 then return 14 elseif self.level < 200 then return 14
elseif self.level < 400 then return 8 elseif self.level < 400 then return 8
elseif self.level < 500 then return 7 elseif self.level < 500 then return 7
@ -37,14 +37,14 @@ function PhantomManiaGame:getARE()
end end
function PhantomManiaGame:getLineARE() function PhantomManiaGame:getLineARE()
if self.level < 100 then return 18 if self.level < 100 then return 18
elseif self.level < 400 then return 8 elseif self.level < 400 then return 8
elseif self.level < 500 then return 7 elseif self.level < 500 then return 7
else return 6 end else return 6 end
end end
function PhantomManiaGame:getDasLimit() function PhantomManiaGame:getDasLimit()
if self.level < 200 then return 11 if self.level < 200 then return 11
elseif self.level < 300 then return 10 elseif self.level < 300 then return 10
elseif self.level < 400 then return 9 elseif self.level < 400 then return 9
else return 7 end else return 7 end
@ -55,7 +55,7 @@ function PhantomManiaGame:getLineClearDelay()
end end
function PhantomManiaGame:getLockDelay() function PhantomManiaGame:getLockDelay()
if self.level < 100 then return 30 if self.level < 100 then return 30
elseif self.level < 200 then return 26 elseif self.level < 200 then return 26
elseif self.level < 300 then return 22 elseif self.level < 300 then return 22
elseif self.level < 400 then return 18 elseif self.level < 400 then return 18
@ -171,10 +171,10 @@ function PhantomManiaGame:drawScoringInfo()
if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end
love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left") end if getLetterGrade(self.level, self.clear) ~= "" then love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left") end
@ -186,9 +186,9 @@ function PhantomManiaGame:drawScoringInfo()
love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right")
end end
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
end end
function PhantomManiaGame:getSectionEndLevel() function PhantomManiaGame:getSectionEndLevel()

View File

@ -25,12 +25,12 @@ function PhantomMania2Game:new()
self.hold_age = 0 self.hold_age = 0
self.queue_age = 0 self.queue_age = 0
self.roll_points = 0 self.roll_points = 0
self.SGnames = { self.SGnames = {
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9",
"GM" "GM"
} }
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
@ -43,12 +43,12 @@ function PhantomMania2Game:new()
end end
function PhantomMania2Game:getARE() function PhantomMania2Game:getARE()
if self.level < 300 then return 12 if self.level < 300 then return 12
else return 6 end else return 6 end
end end
function PhantomMania2Game:getLineARE() function PhantomMania2Game:getLineARE()
if self.level < 100 then return 8 if self.level < 100 then return 8
elseif self.level < 200 then return 7 elseif self.level < 200 then return 7
elseif self.level < 500 then return 6 elseif self.level < 500 then return 6
elseif self.level < 1300 then return 5 elseif self.level < 1300 then return 5
@ -56,7 +56,7 @@ function PhantomMania2Game:getLineARE()
end end
function PhantomMania2Game:getDasLimit() function PhantomMania2Game:getDasLimit()
if self.level < 200 then return 9 if self.level < 200 then return 9
elseif self.level < 500 then return 7 elseif self.level < 500 then return 7
else return 5 end else return 5 end
end end
@ -66,7 +66,7 @@ function PhantomMania2Game:getLineClearDelay()
end end
function PhantomMania2Game:getLockDelay() function PhantomMania2Game:getLockDelay()
if self.level < 200 then return 18 if self.level < 200 then return 18
elseif self.level < 300 then return 17 elseif self.level < 300 then return 17
elseif self.level < 500 then return 15 elseif self.level < 500 then return 15
elseif self.level < 600 then return 13 elseif self.level < 600 then return 13
@ -299,15 +299,15 @@ function PhantomMania2Game:drawScoringInfo()
love.graphics.printf("GRADE", text_x, 120, 40, "left") love.graphics.printf("GRADE", text_x, 120, 40, "left")
love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
if(self.coolregret_timer > 0) then if(self.coolregret_timer > 0) then
love.graphics.printf(self.coolregret_message, 64, 400, 160, "center") love.graphics.printf(self.coolregret_message, 64, 400, 160, "center")
self.coolregret_timer = self.coolregret_timer - 1 self.coolregret_timer = self.coolregret_timer - 1
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(getLetterGrade(math.floor(self.grade)), text_x, 140, 90, "left") love.graphics.printf(getLetterGrade(math.floor(self.grade)), text_x, 140, 90, "left")
@ -318,10 +318,10 @@ function PhantomMania2Game:drawScoringInfo()
else else
love.graphics.printf(math.floor(self.level / 100 + 1) * 100, text_x, 370, 50, "right") love.graphics.printf(math.floor(self.level / 100 + 1) * 100, text_x, 370, 50, "right")
end end
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
end end
function PhantomMania2Game:getBackground() function PhantomMania2Game:getBackground()

View File

@ -8,12 +8,12 @@ PhantomManiaNGame.tagline = "The old mode from Nullpomino, for Ti-ARS and SRS su
function PhantomManiaNGame:new() function PhantomManiaNGame:new()
PhantomManiaNGame.super:new() PhantomManiaNGame.super:new()
self.SGnames = { self.SGnames = {
"M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9",
"M10", "M11", "M12", "M13", "M14", "M15", "M16", "M17", "M18", "M10", "M11", "M12", "M13", "M14", "M15", "M16", "M17", "M18",
"GM" "GM"
} }
self.next_queue_length = 3 self.next_queue_length = 3
self.enable_hold = true self.enable_hold = true

View File

@ -23,10 +23,10 @@ function Race40Game:new()
self.roll_frames = 0 self.roll_frames = 0
self.SGnames = { self.SGnames = {
[0] = "", [0] = "",
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.upstacked = false self.upstacked = false
@ -128,16 +128,16 @@ function Race40Game:drawScoringInfo()
love.graphics.printf("line/min", text_x, 160, 80, "left") love.graphics.printf("line/min", text_x, 160, 80, "left")
love.graphics.printf("piece/sec", text_x, 220, 80, "left") love.graphics.printf("piece/sec", text_x, 220, 80, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 7 or self.upstacked then if sg >= 7 or self.upstacked then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(string.format("%.02f", self.lines / math.max(1, self.frames) * 3600), text_x, 180, 80, "left") love.graphics.printf(string.format("%.02f", self.lines / math.max(1, self.frames) * 3600), text_x, 180, 80, "left")
love.graphics.printf(string.format("%.04f", self.pieces / math.max(1, self.frames) * 60), text_x, 240, 80, "left") love.graphics.printf(string.format("%.04f", self.pieces / math.max(1, self.frames) * 60), text_x, 240, 80, "left")
if sg >= 7 or self.upstacked then if sg >= 7 or self.upstacked then
love.graphics.printf(self:getSecretGrade(sg), 240, 450, 180, "left") love.graphics.printf(self:getSecretGrade(sg), 240, 450, 180, "left")
end end
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.printf(math.max(0, self.line_goal - self.lines), text_x, 340, 40, "left") love.graphics.printf(math.max(0, self.line_goal - self.lines), text_x, 340, 40, "left")

View File

@ -20,83 +20,83 @@ function ScoreDrainGame:new()
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.lock_drop = true self.lock_drop = true
self.lock_hard_drop = true self.lock_hard_drop = true
self.enable_hold = true self.enable_hold = true
self.next_queue_length = 3 self.next_queue_length = 3
end end
function ScoreDrainGame:getARE() function ScoreDrainGame:getARE()
if self.level < 700 then return 27 if self.level < 700 then return 27
elseif self.level < 800 then return 18 elseif self.level < 800 then return 18
elseif self.level < 1000 then return 14 elseif self.level < 1000 then return 14
elseif self.level < 1100 then return 8 elseif self.level < 1100 then return 8
elseif self.level < 1200 then return 7 elseif self.level < 1200 then return 7
else return 6 end else return 6 end
end end
function ScoreDrainGame:getLineARE() function ScoreDrainGame:getLineARE()
if self.level < 600 then return 27 if self.level < 600 then return 27
elseif self.level < 700 then return 18 elseif self.level < 700 then return 18
elseif self.level < 800 then return 14 elseif self.level < 800 then return 14
elseif self.level < 1100 then return 8 elseif self.level < 1100 then return 8
elseif self.level < 1200 then return 7 elseif self.level < 1200 then return 7
else return 6 end else return 6 end
end end
function ScoreDrainGame:getDasLimit() function ScoreDrainGame:getDasLimit()
if self.level < 500 then return 15 if self.level < 500 then return 15
elseif self.level < 900 then return 9 elseif self.level < 900 then return 9
else return 7 end else return 7 end
end end
function ScoreDrainGame:getLineClearDelay() function ScoreDrainGame:getLineClearDelay()
if self.level < 500 then return 40 if self.level < 500 then return 40
elseif self.level < 600 then return 25 elseif self.level < 600 then return 25
elseif self.level < 700 then return 16 elseif self.level < 700 then return 16
elseif self.level < 800 then return 12 elseif self.level < 800 then return 12
elseif self.level < 1100 then return 6 elseif self.level < 1100 then return 6
elseif self.level < 1200 then return 5 elseif self.level < 1200 then return 5
else return 4 end else return 4 end
end end
function ScoreDrainGame:getLockDelay() function ScoreDrainGame:getLockDelay()
if self.level < 900 then return 30 if self.level < 900 then return 30
elseif self.level < 1100 then return 17 elseif self.level < 1100 then return 17
else return 15 end else return 15 end
end end
function ScoreDrainGame:getGravity() function ScoreDrainGame:getGravity()
if (self.level < 30) then return 4/256 if (self.level < 30) then return 4/256
elseif (self.level < 35) then return 6/256 elseif (self.level < 35) then return 6/256
elseif (self.level < 40) then return 8/256 elseif (self.level < 40) then return 8/256
elseif (self.level < 50) then return 10/256 elseif (self.level < 50) then return 10/256
elseif (self.level < 60) then return 12/256 elseif (self.level < 60) then return 12/256
elseif (self.level < 70) then return 16/256 elseif (self.level < 70) then return 16/256
elseif (self.level < 80) then return 32/256 elseif (self.level < 80) then return 32/256
elseif (self.level < 90) then return 48/256 elseif (self.level < 90) then return 48/256
elseif (self.level < 100) then return 64/256 elseif (self.level < 100) then return 64/256
elseif (self.level < 120) then return 80/256 elseif (self.level < 120) then return 80/256
elseif (self.level < 140) then return 96/256 elseif (self.level < 140) then return 96/256
elseif (self.level < 160) then return 112/256 elseif (self.level < 160) then return 112/256
elseif (self.level < 170) then return 128/256 elseif (self.level < 170) then return 128/256
elseif (self.level < 200) then return 144/256 elseif (self.level < 200) then return 144/256
elseif (self.level < 220) then return 4/256 elseif (self.level < 220) then return 4/256
elseif (self.level < 230) then return 32/256 elseif (self.level < 230) then return 32/256
elseif (self.level < 233) then return 64/256 elseif (self.level < 233) then return 64/256
elseif (self.level < 236) then return 96/256 elseif (self.level < 236) then return 96/256
elseif (self.level < 239) then return 128/256 elseif (self.level < 239) then return 128/256
elseif (self.level < 243) then return 160/256 elseif (self.level < 243) then return 160/256
elseif (self.level < 247) then return 192/256 elseif (self.level < 247) then return 192/256
elseif (self.level < 251) then return 224/256 elseif (self.level < 251) then return 224/256
elseif (self.level < 300) then return 1 elseif (self.level < 300) then return 1
elseif (self.level < 330) then return 2 elseif (self.level < 330) then return 2
elseif (self.level < 360) then return 3 elseif (self.level < 360) then return 3
elseif (self.level < 400) then return 4 elseif (self.level < 400) then return 4
elseif (self.level < 420) then return 5 elseif (self.level < 420) then return 5
elseif (self.level < 450) then return 4 elseif (self.level < 450) then return 4
elseif (self.level < 500) then return 3 elseif (self.level < 500) then return 3
else return 20 else return 20
end end
end end
function ScoreDrainGame:advanceOneFrame() function ScoreDrainGame:advanceOneFrame()
@ -110,8 +110,8 @@ end
function ScoreDrainGame:onPieceEnter() function ScoreDrainGame:onPieceEnter()
if (self.level % 100 ~= 99) and self.frames ~= 0 then if (self.level % 100 ~= 99) and self.frames ~= 0 then
self.level = self.level + 1 self.level = self.level + 1
end end
end end
local cleared_row_levels = {1, 2, 4, 6} local cleared_row_levels = {1, 2, 4, 6}

View File

@ -27,7 +27,7 @@ function StrategyGame:new()
end end
function StrategyGame:getARE() function StrategyGame:getARE()
if self.level < 100 then return 60 if self.level < 100 then return 60
elseif self.level < 200 then return 54 elseif self.level < 200 then return 54
elseif self.level < 300 then return 48 elseif self.level < 300 then return 48
elseif self.level < 400 then return 42 elseif self.level < 400 then return 42
@ -52,7 +52,7 @@ function StrategyGame:getLineClearDelay()
end end
function StrategyGame:getLockDelay() function StrategyGame:getLockDelay()
if self.level < 500 then return 8 if self.level < 500 then return 8
elseif self.level < 700 then return 6 elseif self.level < 700 then return 6
else return 4 end else return 4 end
end end

View File

@ -45,7 +45,7 @@ function Survival2020Game:getLineARE()
end end
function Survival2020Game:getDasLimit() function Survival2020Game:getDasLimit()
if self.level < 200 then return 9 if self.level < 200 then return 9
elseif self.level < 500 then return 7 elseif self.level < 500 then return 7
elseif self.level < 1000 then return 5 elseif self.level < 1000 then return 5
elseif self.level < 1500 then return 4 elseif self.level < 1500 then return 4

View File

@ -15,28 +15,28 @@ SurvivalA1Game.tagline = "The game starts fast and only gets faster!"
function SurvivalA1Game:new() function SurvivalA1Game:new()
SurvivalA1Game.super:new() SurvivalA1Game.super:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.bravos = 0 self.bravos = 0
self.gm_conditions = { self.gm_conditions = {
level300 = false, level300 = false,
level500 = false, level500 = false,
level999 = false level999 = false
} }
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.randomizer = History4RollsRandomizer() self.randomizer = History4RollsRandomizer()
self.lock_drop = false self.lock_drop = false
self.enable_hard_drop = false self.enable_hard_drop = false
self.enable_hold = false self.enable_hold = false
self.next_queue_length = 1 self.next_queue_length = 1
end end
@ -62,29 +62,29 @@ function SurvivalA1Game:getLockDelay()
end end
function SurvivalA1Game:getGravity() function SurvivalA1Game:getGravity()
return 20 return 20
end end
local function getRankForScore(score) local function getRankForScore(score)
if score < 400 then return {rank = "9", next = 400} if score < 400 then return {rank = "9", next = 400}
elseif score < 800 then return {rank = "8", next = 800} elseif score < 800 then return {rank = "8", next = 800}
elseif score < 1400 then return {rank = "7", next = 1400} elseif score < 1400 then return {rank = "7", next = 1400}
elseif score < 2000 then return {rank = "6", next = 2000} elseif score < 2000 then return {rank = "6", next = 2000}
elseif score < 3500 then return {rank = "5", next = 3500} elseif score < 3500 then return {rank = "5", next = 3500}
elseif score < 5500 then return {rank = "4", next = 5500} elseif score < 5500 then return {rank = "4", next = 5500}
elseif score < 8000 then return {rank = "3", next = 8000} elseif score < 8000 then return {rank = "3", next = 8000}
elseif score < 12000 then return {rank = "2", next = 12000} elseif score < 12000 then return {rank = "2", next = 12000}
elseif score < 16000 then return {rank = "1", next = 16000} elseif score < 16000 then return {rank = "1", next = 16000}
elseif score < 22000 then return {rank = "S1", next = 22000} elseif score < 22000 then return {rank = "S1", next = 22000}
elseif score < 30000 then return {rank = "S2", next = 30000} elseif score < 30000 then return {rank = "S2", next = 30000}
elseif score < 40000 then return {rank = "S3", next = 40000} elseif score < 40000 then return {rank = "S3", next = 40000}
elseif score < 52000 then return {rank = "S4", next = 52000} elseif score < 52000 then return {rank = "S4", next = 52000}
elseif score < 66000 then return {rank = "S5", next = 66000} elseif score < 66000 then return {rank = "S5", next = 66000}
elseif score < 82000 then return {rank = "S6", next = 82000} elseif score < 82000 then return {rank = "S6", next = 82000}
elseif score < 100000 then return {rank = "S7", next = 100000} elseif score < 100000 then return {rank = "S7", next = 100000}
elseif score < 120000 then return {rank = "S8", next = 120000} elseif score < 120000 then return {rank = "S8", next = 120000}
else return {rank = "S9", next = "???"} else return {rank = "S9", next = "???"}
end end
end end
function SurvivalA1Game:advanceOneFrame() function SurvivalA1Game:advanceOneFrame()
@ -106,7 +106,7 @@ function SurvivalA1Game:onPieceEnter()
end end
function SurvivalA1Game:onLineClear(cleared_row_count) function SurvivalA1Game:onLineClear(cleared_row_count)
self:checkGMRequirements(self.level, self.level + cleared_row_count) self:checkGMRequirements(self.level, self.level + cleared_row_count)
if not self.clear then if not self.clear then
local new_level = math.min(self.level + cleared_row_count, 999) local new_level = math.min(self.level + cleared_row_count, 999)
if new_level == 999 then if new_level == 999 then
@ -171,10 +171,10 @@ function SurvivalA1Game:drawScoringInfo()
love.graphics.printf("SCORE", 240, 200, 40, "left") love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("NEXT RANK", 240, 260, 90, "left") love.graphics.printf("NEXT RANK", 240, 260, 90, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left") love.graphics.printf("LEVEL", 240, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end
@ -188,9 +188,9 @@ function SurvivalA1Game:drawScoringInfo()
love.graphics.printf(getRankForScore(self.score).next, 240, 280, 90, "left") love.graphics.printf(getRankForScore(self.score).next, 240, 280, 90, "left")
love.graphics.printf(self.level, 240, 340, 40, "right") love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end
love.graphics.setFont(font_8x11) love.graphics.setFont(font_8x11)

View File

@ -19,12 +19,12 @@ function SurvivalA2Game:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.lock_drop = true self.lock_drop = true
end end
@ -98,9 +98,9 @@ function SurvivalA2Game:onLineClear(cleared_row_count)
local new_level = math.min(self.level + cleared_row_count, 999) local new_level = math.min(self.level + cleared_row_count, 999)
if self.level == 999 or self:hitTorikan(self.level, new_level) then if self.level == 999 or self:hitTorikan(self.level, new_level) then
self.clear = true self.clear = true
if self.level < 999 then if self.level < 999 then
self.game_over = true self.game_over = true
end end
else else
self.level = new_level self.level = new_level
end end
@ -150,10 +150,10 @@ function SurvivalA2Game:drawScoringInfo()
if self:getLetterGrade() ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end if self:getLetterGrade() ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end
love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(self.score, text_x, 220, 90, "left") love.graphics.printf(self.score, text_x, 220, 90, "left")
@ -162,9 +162,9 @@ function SurvivalA2Game:drawScoringInfo()
if self:getLetterGrade() ~= "" then love.graphics.printf(self:getLetterGrade(), text_x, 140, 90, "left") end if self:getLetterGrade() ~= "" then love.graphics.printf(self:getLetterGrade(), text_x, 140, 90, "left") end
love.graphics.printf(self.level, text_x, 340, 40, "right") love.graphics.printf(self.level, text_x, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right")
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
end end
function SurvivalA2Game:getSectionEndLevel() function SurvivalA2Game:getSectionEndLevel()

View File

@ -23,13 +23,13 @@ function SurvivalA3Game:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.SGnames = { self.SGnames = {
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9",
"GM" "GM"
} }
self.lock_drop = true self.lock_drop = true
self.enable_hold = true self.enable_hold = true
self.next_queue_length = 3 self.next_queue_length = 3
@ -40,19 +40,19 @@ end
function SurvivalA3Game:initialize(ruleset) function SurvivalA3Game:initialize(ruleset)
self.torikan_time = frameTime(2,28) self.torikan_time = frameTime(2,28)
if ruleset.world then self.torikan_time = frameTime(3,03) end if ruleset.world then self.torikan_time = frameTime(3,03) end
self.super.initialize(self, ruleset) self.super.initialize(self, ruleset)
-- ^ notice the . here instead of the : -- ^ notice the . here instead of the :
end end
function SurvivalA3Game:getARE() function SurvivalA3Game:getARE()
if self.level < 300 then return 12 if self.level < 300 then return 12
else return 6 end else return 6 end
end end
function SurvivalA3Game:getLineARE() function SurvivalA3Game:getLineARE()
if self.level < 100 then return 8 if self.level < 100 then return 8
elseif self.level < 200 then return 7 elseif self.level < 200 then return 7
elseif self.level < 500 then return 6 elseif self.level < 500 then return 6
elseif self.level < 1300 then return 5 elseif self.level < 1300 then return 5
@ -60,7 +60,7 @@ function SurvivalA3Game:getLineARE()
end end
function SurvivalA3Game:getDasLimit() function SurvivalA3Game:getDasLimit()
if self.level < 100 then return 9 if self.level < 100 then return 9
elseif self.level < 500 then return 7 elseif self.level < 500 then return 7
else return 5 end else return 5 end
end end
@ -71,7 +71,7 @@ function SurvivalA3Game:getLineClearDelay()
end end
function SurvivalA3Game:getLockDelay() function SurvivalA3Game:getLockDelay()
if self.level < 200 then return 18 if self.level < 200 then return 18
elseif self.level < 300 then return 17 elseif self.level < 300 then return 17
elseif self.level < 500 then return 15 elseif self.level < 500 then return 15
elseif self.level < 600 then return 13 elseif self.level < 600 then return 13
@ -145,14 +145,14 @@ function SurvivalA3Game:onLineClear(cleared_row_count)
local new_level = self.level + cleared_row_levels[cleared_row_count] local new_level = self.level + cleared_row_levels[cleared_row_count]
self:updateSectionTimes(self.level, new_level) self:updateSectionTimes(self.level, new_level)
if new_level >= 1300 or self:hitTorikan(self.level, new_level) then if new_level >= 1300 or self:hitTorikan(self.level, new_level) then
self.clear = true self.clear = true
if new_level >= 1300 then if new_level >= 1300 then
self.level = 1300 self.level = 1300
self.grid:clear() self.grid:clear()
self.big_mode = true self.big_mode = true
self.roll_frames = -150 self.roll_frames = -150
else else
self.game_over = true self.game_over = true
end end
else else
self.level = math.min(new_level, 1300) self.level = math.min(new_level, 1300)
@ -228,10 +228,10 @@ function SurvivalA3Game:drawScoringInfo()
love.graphics.printf("GRADE", text_x, 120, 40, "left") love.graphics.printf("GRADE", text_x, 120, 40, "left")
love.graphics.printf("SCORE", text_x, 200, 40, "left") love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left") love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
if(self.coolregret_timer > 0) then if(self.coolregret_timer > 0) then
love.graphics.printf(self.coolregret_message, 64, 400, 160, "center") love.graphics.printf(self.coolregret_message, 64, 400, 160, "center")
@ -243,7 +243,7 @@ function SurvivalA3Game:drawScoringInfo()
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
if self.roll_frames > 3238 then love.graphics.setColor(1, 0.5, 0, 1) if self.roll_frames > 3238 then love.graphics.setColor(1, 0.5, 0, 1)
elseif self.clear then love.graphics.setColor(0, 1, 0, 1) end elseif self.clear then love.graphics.setColor(0, 1, 0, 1) end
love.graphics.printf(getLetterGrade(math.floor(self.grade)), text_x, 140, 90, "left") love.graphics.printf(getLetterGrade(math.floor(self.grade)), text_x, 140, 90, "left")
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(self.score, text_x, 220, 90, "left") love.graphics.printf(self.score, text_x, 220, 90, "left")
@ -253,9 +253,9 @@ function SurvivalA3Game:drawScoringInfo()
else else
love.graphics.printf(math.floor(self.level / 100 + 1) * 100, text_x, 370, 50, "right") love.graphics.printf(math.floor(self.level / 100 + 1) * 100, text_x, 370, 50, "right")
end end
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
end end
function SurvivalA3Game:getBackground() function SurvivalA3Game:getBackground()

View File

@ -17,15 +17,15 @@ function TGMPlusGame:new()
self.roll_frames = 0 self.roll_frames = 0
self.combo = 1 self.combo = 1
self.SGnames = { self.SGnames = {
"9", "8", "7", "6", "5", "4", "3", "2", "1", "9", "8", "7", "6", "5", "4", "3", "2", "1",
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
"GM" "GM"
} }
self.randomizer = History6RollsRandomizer() self.randomizer = History6RollsRandomizer()
self.lock_drop = false self.lock_drop = false
self.enable_hold = false self.enable_hold = false
self.next_queue_length = 1 self.next_queue_length = 1
@ -33,29 +33,29 @@ function TGMPlusGame:new()
self.garbage_pos = 0 self.garbage_pos = 0
self.garbage_rows = { self.garbage_rows = {
[0] = {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, [0] = {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"},
{"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"},
{"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"},
{"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"},
{"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"},
{"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"},
{"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"},
{"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"},
{"e", "e", "b", "b", "b", "b", "b", "b", "b", "b"}, {"e", "e", "b", "b", "b", "b", "b", "b", "b", "b"},
{"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"},
{"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"},
{"b", "b", "b", "b", "b", "b", "b", "b", "e", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "e", "e"},
{"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"},
{"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"},
{"b", "b", "e", "b", "b", "b", "b", "b", "b", "b"}, {"b", "b", "e", "b", "b", "b", "b", "b", "b", "b"},
{"b", "e", "e", "b", "b", "b", "b", "b", "b", "b"}, {"b", "e", "e", "b", "b", "b", "b", "b", "b", "b"},
{"b", "e", "b", "b", "b", "b", "b", "b", "b", "b"}, {"b", "e", "b", "b", "b", "b", "b", "b", "b", "b"},
{"b", "b", "b", "b", "b", "b", "b", "e", "b", "b"}, {"b", "b", "b", "b", "b", "b", "b", "e", "b", "b"},
{"b", "b", "b", "b", "b", "b", "b", "e", "e", "b"}, {"b", "b", "b", "b", "b", "b", "b", "e", "e", "b"},
{"b", "b", "b", "b", "b", "b", "b", "b", "e", "b"}, {"b", "b", "b", "b", "b", "b", "b", "b", "e", "b"},
{"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"}, {"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"},
{"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"}, {"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"},
{"b", "b", "b", "b", "e", "b", "b", "b", "b", "b"}, {"b", "b", "b", "b", "e", "b", "b", "b", "b", "b"},
{"b", "b", "b", "e", "e", "e", "b", "b", "b", "b"}, {"b", "b", "b", "e", "e", "e", "b", "b", "b", "b"},
} }
end end
@ -65,37 +65,37 @@ function TGMPlusGame:getLockDelay() return 30 end
function TGMPlusGame:getLineClearDelay() return 40 end function TGMPlusGame:getLineClearDelay() return 40 end
function TGMPlusGame:getGravity() function TGMPlusGame:getGravity()
if (self.level < 30) then return 4/256 if (self.level < 30) then return 4/256
elseif (self.level < 35) then return 6/256 elseif (self.level < 35) then return 6/256
elseif (self.level < 40) then return 8/256 elseif (self.level < 40) then return 8/256
elseif (self.level < 50) then return 10/256 elseif (self.level < 50) then return 10/256
elseif (self.level < 60) then return 12/256 elseif (self.level < 60) then return 12/256
elseif (self.level < 70) then return 16/256 elseif (self.level < 70) then return 16/256
elseif (self.level < 80) then return 32/256 elseif (self.level < 80) then return 32/256
elseif (self.level < 90) then return 48/256 elseif (self.level < 90) then return 48/256
elseif (self.level < 100) then return 64/256 elseif (self.level < 100) then return 64/256
elseif (self.level < 120) then return 80/256 elseif (self.level < 120) then return 80/256
elseif (self.level < 140) then return 96/256 elseif (self.level < 140) then return 96/256
elseif (self.level < 160) then return 112/256 elseif (self.level < 160) then return 112/256
elseif (self.level < 170) then return 128/256 elseif (self.level < 170) then return 128/256
elseif (self.level < 200) then return 144/256 elseif (self.level < 200) then return 144/256
elseif (self.level < 220) then return 4/256 elseif (self.level < 220) then return 4/256
elseif (self.level < 230) then return 32/256 elseif (self.level < 230) then return 32/256
elseif (self.level < 233) then return 64/256 elseif (self.level < 233) then return 64/256
elseif (self.level < 236) then return 96/256 elseif (self.level < 236) then return 96/256
elseif (self.level < 239) then return 128/256 elseif (self.level < 239) then return 128/256
elseif (self.level < 243) then return 160/256 elseif (self.level < 243) then return 160/256
elseif (self.level < 247) then return 192/256 elseif (self.level < 247) then return 192/256
elseif (self.level < 251) then return 224/256 elseif (self.level < 251) then return 224/256
elseif (self.level < 300) then return 1 elseif (self.level < 300) then return 1
elseif (self.level < 330) then return 2 elseif (self.level < 330) then return 2
elseif (self.level < 360) then return 3 elseif (self.level < 360) then return 3
elseif (self.level < 400) then return 4 elseif (self.level < 400) then return 4
elseif (self.level < 420) then return 5 elseif (self.level < 420) then return 5
elseif (self.level < 450) then return 4 elseif (self.level < 450) then return 4
elseif (self.level < 500) then return 3 elseif (self.level < 500) then return 3
else return 20 else return 20
end end
end end
function TGMPlusGame:getGarbageLimit() return 13 - math.floor(self.level / 100) end function TGMPlusGame:getGarbageLimit() return 13 - math.floor(self.level / 100) end
@ -123,8 +123,8 @@ function TGMPlusGame:onPieceLock(piece, cleared_row_count)
end end
function TGMPlusGame:onLineClear(cleared_row_count) function TGMPlusGame:onLineClear(cleared_row_count)
self.level = math.min(self.level + cleared_row_count, 999) self.level = math.min(self.level + cleared_row_count, 999)
if self.level == 999 and not self.clear then self.clear = true end if self.level == 999 and not self.clear then self.clear = true end
end end
function TGMPlusGame:advanceBottomRow() function TGMPlusGame:advanceBottomRow()
@ -188,18 +188,18 @@ function TGMPlusGame:drawScoringInfo()
love.graphics.printf("NEXT", 64, 40, 40, "left") love.graphics.printf("NEXT", 64, 40, 40, "left")
love.graphics.printf("SCORE", 240, 200, 40, "left") love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left") love.graphics.printf("LEVEL", 240, 320, 40, "left")
local sg = self.grid:checkSecretGrade() local sg = self.grid:checkSecretGrade()
if sg >= 5 then if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left") love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
end end
love.graphics.setFont(font_3x5_3) love.graphics.setFont(font_3x5_3)
love.graphics.printf(self.score, 240, 220, 90, "left") love.graphics.printf(self.score, 240, 220, 90, "left")
love.graphics.printf(self.level, 240, 340, 40, "right") love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right") love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
if sg >= 5 then if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left") love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
end end
love.graphics.setFont(font_8x11) love.graphics.setFont(font_8x11)
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center") love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")

View File

@ -3,27 +3,27 @@ local Randomizer = require 'tetris.randomizers.randomizer'
local Bag7NoSZOStartRandomizer = Randomizer:extend() local Bag7NoSZOStartRandomizer = Randomizer:extend()
function Bag7NoSZOStartRandomizer:shuffleBag() function Bag7NoSZOStartRandomizer:shuffleBag()
local b = self.bag local b = self.bag
local ln = #b local ln = #b
for i = 1, ln do for i = 1, ln do
local j = math.random(i, ln) local j = math.random(i, ln)
b[i], b[j] = b[j], b[i] b[i], b[j] = b[j], b[i]
end end
end end
local function isnotSZO(x) return not(x == "S" or x == "Z" or x == "O") end local function isnotSZO(x) return not(x == "S" or x == "Z" or x == "O") end
function Bag7NoSZOStartRandomizer:initialize() function Bag7NoSZOStartRandomizer:initialize()
self.bag = {"I", "J", "L", "O", "S", "T", "Z"} self.bag = {"I", "J", "L", "O", "S", "T", "Z"}
repeat repeat
self:shuffleBag() self:shuffleBag()
until isnotSZO(self.bag[7]) until isnotSZO(self.bag[7])
end end
function Bag7NoSZOStartRandomizer:generatePiece() function Bag7NoSZOStartRandomizer:generatePiece()
if #self.bag == 0 then if #self.bag == 0 then
self.bag = {"I", "J", "L", "O", "S", "T", "Z"} self.bag = {"I", "J", "L", "O", "S", "T", "Z"}
self:shuffleBag() self:shuffleBag()
end end
return table.remove(self.bag) return table.remove(self.bag)
end end

View File

@ -10,8 +10,8 @@ end
function Bag7Randomizer:generatePiece() function Bag7Randomizer:generatePiece()
if next(self.extra) == nil then if next(self.extra) == nil then
self.extra = {"I", "J", "L", "O", "S", "T", "Z"} self.extra = {"I", "J", "L", "O", "S", "T", "Z"}
end end
if next(self.bag) == nil then if next(self.bag) == nil then
self.bag = {"I", "J", "L", "O", "S", "T", "Z"} self.bag = {"I", "J", "L", "O", "S", "T", "Z"}
table.insert(self.bag, table.remove(self.extra, math.random(table.getn(self.extra)))) table.insert(self.bag, table.remove(self.extra, math.random(table.getn(self.extra))))

View File

@ -4,22 +4,22 @@ local History4RollsRandomizer = Randomizer:extend()
function History4RollsRandomizer:initialize() function History4RollsRandomizer:initialize()
self.history = {"Z", "Z", "Z", "Z"} self.history = {"Z", "Z", "Z", "Z"}
self.first = true self.first = true
end end
function History4RollsRandomizer:generatePiece() function History4RollsRandomizer:generatePiece()
if self.first then if self.first then
self.first = false self.first = false
return self:updateHistory(({"L", "J", "I", "T"})[math.random(4)]) return self:updateHistory(({"L", "J", "I", "T"})[math.random(4)])
else else
local shapes = {"I", "J", "L", "O", "S", "T", "Z"} local shapes = {"I", "J", "L", "O", "S", "T", "Z"}
for i = 1, 4 do for i = 1, 4 do
local x = math.random(7) local x = math.random(7)
if not inHistory(shapes[x], self.history) or i == 4 then if not inHistory(shapes[x], self.history) or i == 4 then
return self:updateHistory(shapes[x]) return self:updateHistory(shapes[x])
end end
end end
end end
end end
function History4RollsRandomizer:updateHistory(shape) function History4RollsRandomizer:updateHistory(shape)

View File

@ -4,22 +4,22 @@ local History6RollsRandomizer = Randomizer:extend()
function History6RollsRandomizer:initialize() function History6RollsRandomizer:initialize()
self.history = {"Z", "S", "Z", "S"} self.history = {"Z", "S", "Z", "S"}
self.first = true self.first = true
end end
function History6RollsRandomizer:generatePiece() function History6RollsRandomizer:generatePiece()
if self.first then if self.first then
self.first = false self.first = false
return self:updateHistory(({"L", "J", "I", "T"})[math.random(4)]) return self:updateHistory(({"L", "J", "I", "T"})[math.random(4)])
else else
local shapes = {"I", "J", "L", "O", "S", "T", "Z"} local shapes = {"I", "J", "L", "O", "S", "T", "Z"}
for i = 1, 6 do for i = 1, 6 do
local x = math.random(7) local x = math.random(7)
if not inHistory(shapes[x], self.history) or i == 6 then if not inHistory(shapes[x], self.history) or i == 6 then
return self:updateHistory(shapes[x]) return self:updateHistory(shapes[x])
end end
end end
end end
end end
function History6RollsRandomizer:updateHistory(shape) function History6RollsRandomizer:updateHistory(shape)

View File

@ -3,67 +3,67 @@ local Randomizer = require 'tetris.randomizers.randomizer'
local History6Rolls35PoolRandomizer = Randomizer:extend() local History6Rolls35PoolRandomizer = Randomizer:extend()
function History6Rolls35PoolRandomizer:initialize() function History6Rolls35PoolRandomizer:initialize()
self.first = true self.first = true
self.history = {"Z", "S", "Z", "S"} self.history = {"Z", "S", "Z", "S"}
self.pool = { self.pool = {
"I", "I", "I", "I", "I", "I", "I", "I", "I", "I",
"T", "T", "T", "T", "T", "T", "T", "T", "T", "T",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"J", "J", "J", "J", "J", "J", "J", "J", "J", "J",
"S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z", "Z",
"O", "O", "O", "O", "O", "O", "O", "O", "O", "O",
}
self.droughts = {
I = 0,
T = 0,
L = 0,
J = 0,
S = 0,
Z = 0,
O = 0,
} }
self.droughts = {
I = 0,
T = 0,
L = 0,
J = 0,
S = 0,
Z = 0,
O = 0,
}
end end
function History6Rolls35PoolRandomizer:generatePiece() function History6Rolls35PoolRandomizer:generatePiece()
local index, x local index, x
if self.first then if self.first then
local prevent = {"S", "Z", "O"} local prevent = {"S", "Z", "O"}
repeat repeat
index = math.random(#self.pool) index = math.random(#self.pool)
x = self.pool[index] x = self.pool[index]
until not inHistory(x, prevent) until not inHistory(x, prevent)
self.first = false self.first = false
else else
for i = 1, 6 do for i = 1, 6 do
index = math.random(#self.pool) index = math.random(#self.pool)
x = self.pool[index] x = self.pool[index]
if not inHistory(x, self.history) or i == 6 then if not inHistory(x, self.history) or i == 6 then
break break
end end
end end
end end
self.pool[index] = self:updateHistory(x) self.pool[index] = self:updateHistory(x)
return x return x
end end
function History6Rolls35PoolRandomizer:updateHistory(shape) function History6Rolls35PoolRandomizer:updateHistory(shape)
table.remove(self.history, 1) table.remove(self.history, 1)
table.insert(self.history, shape) table.insert(self.history, shape)
local highdrought local highdrought
local highdroughtcount = 0 local highdroughtcount = 0
for k, v in pairs(self.droughts) do for k, v in pairs(self.droughts) do
if k == shape then if k == shape then
self.droughts[k] = 0 self.droughts[k] = 0
else else
self.droughts[k] = v + 1 self.droughts[k] = v + 1
if v >= highdroughtcount then if v >= highdroughtcount then
highdrought = k highdrought = k
highdroughtcount = v highdroughtcount = v
end end
end end
end end
return highdrought return highdrought
end end

View File

@ -82,18 +82,18 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
) and ( ) and (
piece.rotation == 0 or piece.rotation == 2 piece.rotation == 0 or piece.rotation == 2
) then ) then
local offsets = new_piece:getBlockOffsets() local offsets = new_piece:getBlockOffsets()
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end) table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
if offset.x == 0 then if offset.x == 0 then
return return
else else
break break
end end
end end
end end
end end
-- kick right, kick left -- kick right, kick left
if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then if (grid:canPlacePiece(new_piece:withOffset({x=1, y=0}))) then

View File

@ -7,13 +7,13 @@ ARS.name = "ACE-ARS"
ARS.hash = "ArikaACE" ARS.hash = "ArikaACE"
ARS.colourscheme = { ARS.colourscheme = {
I = "C", I = "C",
L = "O", L = "O",
J = "B", J = "B",
S = "G", S = "G",
Z = "R", Z = "R",
O = "Y", O = "Y",
T = "M", T = "M",
} }
ARS.softdrop_lock = false ARS.softdrop_lock = false
@ -98,18 +98,18 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
) and ( ) and (
piece.rotation == 0 or piece.rotation == 2 piece.rotation == 0 or piece.rotation == 2
) then ) then
local offsets = new_piece:getBlockOffsets() local offsets = new_piece:getBlockOffsets()
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end) table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
if offset.x == 0 then if offset.x == 0 then
return return
else else
break break
end end
end end
end end
end end
if piece.shape == "I" then if piece.shape == "I" then
-- special kick rules for I -- special kick rules for I
@ -138,20 +138,20 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
end end
end end
else else
-- kick right, kick left -- kick right, kick left
if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0}) piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0}) piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
elseif piece.shape == "T" elseif piece.shape == "T"
and new_piece.rotation == 0 and new_piece.rotation == 0
and piece.floorkick == 0 and piece.floorkick == 0
and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1})) and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1}))
then then
-- T floorkick -- T floorkick
piece.floorkick = piece.floorkick + 1 piece.floorkick = piece.floorkick + 1
piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1}) piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1})
end end
end end
end end

View File

@ -85,18 +85,18 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
) and ( ) and (
piece.rotation == 0 or piece.rotation == 2 piece.rotation == 0 or piece.rotation == 2
) then ) then
local offsets = new_piece:getBlockOffsets() local offsets = new_piece:getBlockOffsets()
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end) table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
if offset.x == 0 then if offset.x == 0 then
return return
else else
break break
end end
end end
end end
end end
if piece.shape == "I" then if piece.shape == "I" then
-- special kick rules for I -- special kick rules for I
@ -125,20 +125,20 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
end end
end end
else else
-- kick right, kick left -- kick right, kick left
if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0}) piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0}) piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
elseif piece.shape == "T" elseif piece.shape == "T"
and new_piece.rotation == 0 and new_piece.rotation == 0
and piece.floorkick == 0 and piece.floorkick == 0
and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1})) and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1}))
then then
-- T floorkick -- T floorkick
piece.floorkick = piece.floorkick + 1 piece.floorkick = piece.floorkick + 1
piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1}) piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1})
end end
end end
end end

View File

@ -7,13 +7,13 @@ SRS.name = "ACE-SRS"
SRS.hash = "ACE Standard" SRS.hash = "ACE Standard"
SRS.world = true SRS.world = true
SRS.colourscheme = { SRS.colourscheme = {
I = "C", I = "C",
L = "O", L = "O",
J = "B", J = "B",
S = "G", S = "G",
Z = "R", Z = "R",
O = "Y", O = "Y",
T = "M", T = "M",
} }
SRS.softdrop_lock = false SRS.softdrop_lock = false
SRS.harddrop_lock = true SRS.harddrop_lock = true

View File

@ -85,18 +85,18 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
) and ( ) and (
piece.rotation == 0 or piece.rotation == 2 piece.rotation == 0 or piece.rotation == 2
) then ) then
local offsets = new_piece:getBlockOffsets() local offsets = new_piece:getBlockOffsets()
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end) table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
if offset.x == 0 then if offset.x == 0 then
return return
else else
break break
end end
end end
end end
end end
if piece.shape == "I" then if piece.shape == "I" then
-- special kick rules for I -- special kick rules for I
@ -125,20 +125,20 @@ function ARS:attemptWallkicks(piece, new_piece, rot_dir, grid)
end end
end end
else else
-- kick right, kick left -- kick right, kick left
if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then if grid:canPlacePiece(new_piece:withOffset({x=1, y=0})) then
piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0}) piece:setRelativeRotation(rot_dir):setOffset({x=1, y=0})
elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then elseif grid:canPlacePiece(new_piece:withOffset({x=-1, y=0})) then
piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0}) piece:setRelativeRotation(rot_dir):setOffset({x=-1, y=0})
elseif piece.shape == "T" elseif piece.shape == "T"
and new_piece.rotation == 0 and new_piece.rotation == 0
and piece.floorkick == 0 and piece.floorkick == 0
and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1})) and grid:canPlacePiece(new_piece:withOffset({x=0, y=-1}))
then then
-- T floorkick -- T floorkick
piece.floorkick = piece.floorkick + 1 piece.floorkick = piece.floorkick + 1
piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1}) piece:setRelativeRotation(rot_dir):setOffset({x=0, y=-1})
end end
end end
end end

View File

@ -363,10 +363,10 @@ function CRS:attemptRotate(new_inputs, piece, grid, initial)
end end
if rot_dir == 0 then return end if rot_dir == 0 then return end
if self.world and config.gamesettings.world_reverse == 2 then if self.world and config.gamesettings.world_reverse == 2 then
rot_dir = 4 - rot_dir rot_dir = 4 - rot_dir
end end
local new_piece = piece:withRelativeRotation(rot_dir) local new_piece = piece:withRelativeRotation(rot_dir)
self:attemptWallkicks(piece, new_piece, rot_dir, grid) self:attemptWallkicks(piece, new_piece, rot_dir, grid)

View File

@ -8,13 +8,13 @@ CRAP.hash = "Completely Random Auto-Positioner"
CRAP.world = true CRAP.world = true
CRAP.colors={"C","O","M","R","G","Y","B"} CRAP.colors={"C","O","M","R","G","Y","B"}
CRAP.colourscheme = { CRAP.colourscheme = {
I = CRAP.colors[math.ceil(math.random(7))], I = CRAP.colors[math.ceil(math.random(7))],
L = CRAP.colors[math.ceil(math.random(7))], L = CRAP.colors[math.ceil(math.random(7))],
J = CRAP.colors[math.ceil(math.random(7))], J = CRAP.colors[math.ceil(math.random(7))],
S = CRAP.colors[math.ceil(math.random(7))], S = CRAP.colors[math.ceil(math.random(7))],
Z = CRAP.colors[math.ceil(math.random(7))], Z = CRAP.colors[math.ceil(math.random(7))],
O = CRAP.colors[math.ceil(math.random(7))], O = CRAP.colors[math.ceil(math.random(7))],
T = CRAP.colors[math.ceil(math.random(7))], T = CRAP.colors[math.ceil(math.random(7))],
} }
CRAP.softdrop_lock = true CRAP.softdrop_lock = true
CRAP.harddrop_lock = false CRAP.harddrop_lock = false

View File

@ -29,21 +29,21 @@ DTET.big_spawn_positions = {
DTET.block_offsets = { DTET.block_offsets = {
I={ I={
{ {x=0, y=0}, {x=-1, y=0}, {x=-2, y=0}, {x=1, y=0} }, { {x=0, y=0}, {x=-1, y=0}, {x=-2, y=0}, {x=1, y=0} },
{ {x=-1, y=-1}, {x=-1, y=-2}, {x=-1, y=0}, {x=-1, y=1} }, { {x=-1, y=-1}, {x=-1, y=-2}, {x=-1, y=0}, {x=-1, y=1} },
{ {x=0, y=0}, {x=-1, y=0}, {x=-2, y=0}, {x=1, y=0} }, { {x=0, y=0}, {x=-1, y=0}, {x=-2, y=0}, {x=1, y=0} },
{ {x=0, y=-1}, {x=0, y=-2}, {x=0, y=0}, {x=0, y=1} }, { {x=0, y=-1}, {x=0, y=-2}, {x=0, y=0}, {x=0, y=1} },
}, },
J={ J={
{ {x=0, y=-1}, {x=-1, y=-1}, {x=1, y=-1}, {x=1, y=0} }, { {x=0, y=-1}, {x=-1, y=-1}, {x=1, y=-1}, {x=1, y=0} },
{ {x=0, y=-1}, {x=0, y=-2}, {x=0, y=0}, {x=-1, y=0} }, { {x=0, y=-1}, {x=0, y=-2}, {x=0, y=0}, {x=-1, y=0} },
{ {x=0, y=0}, {x=-1, y=0}, {x=1, y=0}, {x=-1, y=-1} }, { {x=0, y=0}, {x=-1, y=0}, {x=1, y=0}, {x=-1, y=-1} },
{ {x=0, y=-1}, {x=1, y=-2}, {x=0, y=-2}, {x=0, y=0} }, { {x=0, y=-1}, {x=1, y=-2}, {x=0, y=-2}, {x=0, y=0} },
}, },
L={ L={
{ {x=0, y=-1}, {x=-1, y=-1}, {x=1, y=-1}, {x=-1, y=0} }, { {x=0, y=-1}, {x=-1, y=-1}, {x=1, y=-1}, {x=-1, y=0} },
{ {x=0, y=-1}, {x=-1, y=-2}, {x=0, y=-2}, {x=0, y=0} }, { {x=0, y=-1}, {x=-1, y=-2}, {x=0, y=-2}, {x=0, y=0} },
{ {x=0, y=0}, {x=-1, y=0}, {x=1, y=0}, {x=1, y=-1} }, { {x=0, y=0}, {x=-1, y=0}, {x=1, y=0}, {x=1, y=-1} },
{ {x=0, y=-2}, {x=0, y=-1}, {x=1, y=0}, {x=0, y=0} }, { {x=0, y=-2}, {x=0, y=-1}, {x=1, y=0}, {x=0, y=0} },
}, },
O={ O={
{ {x=0, y=0}, {x=-1, y=0}, {x=-1, y=-1}, {x=0, y=-1} }, { {x=0, y=0}, {x=-1, y=0}, {x=-1, y=-1}, {x=0, y=-1} },
@ -60,7 +60,7 @@ DTET.block_offsets = {
T={ T={
{ {x=0, y=-1}, {x=-1, y=-1}, {x=1, y=-1}, {x=0, y=0} }, { {x=0, y=-1}, {x=-1, y=-1}, {x=1, y=-1}, {x=0, y=0} },
{ {x=0, y=-1}, {x=0, y=0}, {x=-1, y=-1}, {x=0, y=-2} }, { {x=0, y=-1}, {x=0, y=0}, {x=-1, y=-1}, {x=0, y=-2} },
{ {x=0, y=0}, {x=-1, y=0}, {x=1, y=0}, {x=0, y=-1} }, { {x=0, y=0}, {x=-1, y=0}, {x=1, y=0}, {x=0, y=-1} },
{ {x=0, y=-1}, {x=0, y=0}, {x=1, y=-1}, {x=0, y=-2} }, { {x=0, y=-1}, {x=0, y=0}, {x=1, y=-1}, {x=0, y=-2} },
}, },
Z={ Z={

View File

@ -13,25 +13,25 @@ function EHeart:attemptWallkicks(piece, new_piece, rot_dir, grid)
-- center column rule (kicks) -- center column rule (kicks)
local offsets = new_piece:getBlockOffsets() local offsets = new_piece:getBlockOffsets()
table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end) table.sort(offsets, function(A, B) return A.y < B.y or A.y == B.y and A.x < B.y end)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then if grid:isOccupied(piece.position.x + offset.x, piece.position.y + offset.y) then
-- individual checks for all 9 cells, in the given order -- individual checks for all 9 cells, in the given order
if offset.y < 0 then if offset.y < 0 then
if offset.x < 0 then self:lateralKick(1, piece, new_piece, rot_dir, grid) if offset.x < 0 then self:lateralKick(1, piece, new_piece, rot_dir, grid)
elseif offset.x == 0 then return elseif offset.x == 0 then return
elseif offset.x > 0 then self:lateralKick(-1, piece, new_piece, rot_dir, grid) end elseif offset.x > 0 then self:lateralKick(-1, piece, new_piece, rot_dir, grid) end
elseif offset.y == 0 then elseif offset.y == 0 then
if offset.x < 0 then self:lateralKick(1, piece, new_piece, rot_dir, grid) if offset.x < 0 then self:lateralKick(1, piece, new_piece, rot_dir, grid)
elseif offset.x == 0 then return elseif offset.x == 0 then return
elseif offset.x > 0 then self:lateralKick(-1, piece, new_piece, rot_dir, grid) end elseif offset.x > 0 then self:lateralKick(-1, piece, new_piece, rot_dir, grid) end
elseif offset.y > 0 then elseif offset.y > 0 then
if offset.x < 0 then self:lateralKick(1, piece, new_piece, rot_dir, grid) if offset.x < 0 then self:lateralKick(1, piece, new_piece, rot_dir, grid)
elseif offset.x == 0 then return elseif offset.x == 0 then return
elseif offset.x > 0 then self:lateralKick(-1, piece, new_piece, rot_dir, grid) end elseif offset.x > 0 then self:lateralKick(-1, piece, new_piece, rot_dir, grid) end
end end
end end
end end
end end

View File

@ -58,20 +58,20 @@ PPTPRS.wallkicks_O = {
[3]={{x=-1, y=0}}, [3]={{x=-1, y=0}},
}, },
[1]={ [1]={
[0]={{x=0, y=-1}}, [0]={{x=0, y=-1}},
[2]={{x=-1, y=0}}, [2]={{x=-1, y=0}},
[3]={{x=-1, y=0}}, [3]={{x=-1, y=0}},
}, },
[2]={ [2]={
[0]={{x=0, y=-1}}, [0]={{x=0, y=-1}},
[1]={{x=1, y=0}}, [1]={{x=1, y=0}},
[3]={{x=0, y=-1}}, [3]={{x=0, y=-1}},
}, },
[3]={ [3]={
[0]={{x=1, y=0}}, [0]={{x=1, y=0}},
[1]={{x=1, y=0}}, [1]={{x=1, y=0}},
[2]={{x=0, y=1}}, [2]={{x=0, y=1}},
}, },
} }
function PPTPRS:attemptWallkicks(piece, new_piece, rot_dir, grid) function PPTPRS:attemptWallkicks(piece, new_piece, rot_dir, grid)

View File

@ -9,13 +9,13 @@ Ruleset.hash = ""
-- Arika-type ruleset defaults -- Arika-type ruleset defaults
Ruleset.world = false Ruleset.world = false
Ruleset.colourscheme = { Ruleset.colourscheme = {
I = "R", I = "R",
L = "O", L = "O",
J = "B", J = "B",
S = "M", S = "M",
Z = "G", Z = "G",
O = "Y", O = "Y",
T = "C", T = "C",
} }
Ruleset.softdrop_lock = true Ruleset.softdrop_lock = true
Ruleset.harddrop_lock = false Ruleset.harddrop_lock = false
@ -157,8 +157,8 @@ function Ruleset:initializePiece(
else else
spawn_positions = self.spawn_positions spawn_positions = self.spawn_positions
end end
local colours = ({self.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour] local colours = ({self.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour]
local piece = Piece(data.shape, data.orientation - 1, { local piece = Piece(data.shape, data.orientation - 1, {
x = spawn_positions[data.shape].x, x = spawn_positions[data.shape].x,
y = spawn_positions[data.shape].y y = spawn_positions[data.shape].y

View File

@ -7,13 +7,13 @@ SRS.name = "Guideline SRS"
SRS.hash = "Standard" SRS.hash = "Standard"
SRS.world = true SRS.world = true
SRS.colourscheme = { SRS.colourscheme = {
I = "C", I = "C",
L = "O", L = "O",
J = "B", J = "B",
S = "G", S = "G",
Z = "R", Z = "R",
O = "Y", O = "Y",
T = "M", T = "M",
} }
SRS.softdrop_lock = false SRS.softdrop_lock = false
SRS.harddrop_lock = true SRS.harddrop_lock = true
@ -132,13 +132,13 @@ SRS.wallkicks_line = {
}; };
function SRS:check_new_low(piece) function SRS:check_new_low(piece)
for _, block in pairs(piece:getBlockOffsets()) do for _, block in pairs(piece:getBlockOffsets()) do
local y = piece.position.y + block.y local y = piece.position.y + block.y
if y > piece.lowest_y then if y > piece.lowest_y then
piece.manipulations = 0 piece.manipulations = 0
piece.lowest_y = y piece.lowest_y = y
end end
end end
end end
-- Component functions. -- Component functions.
@ -170,16 +170,16 @@ end
function SRS:onPieceCreate(piece, grid) function SRS:onPieceCreate(piece, grid)
piece.manipulations = 0 piece.manipulations = 0
piece.lowest_y = -math.huge piece.lowest_y = -math.huge
end end
function SRS:onPieceDrop(piece, grid) function SRS:onPieceDrop(piece, grid)
self:check_new_low(piece) self:check_new_low(piece)
if piece.manipulations >= 15 and piece:isDropBlocked(grid) then if piece.manipulations >= 15 and piece:isDropBlocked(grid) then
piece.locked = true piece.locked = true
else else
piece.lock_delay = 0 -- step reset piece.lock_delay = 0 -- step reset
end end
end end
function SRS:onPieceMove(piece, grid) function SRS:onPieceMove(piece, grid)
@ -194,8 +194,8 @@ end
function SRS:onPieceRotate(piece, grid) function SRS:onPieceRotate(piece, grid)
piece.lock_delay = 0 -- rotate reset piece.lock_delay = 0 -- rotate reset
self:check_new_low(piece) self:check_new_low(piece)
piece.manipulations = piece.manipulations + 1 piece.manipulations = piece.manipulations + 1
if piece:isDropBlocked(grid) then if piece:isDropBlocked(grid) then
if piece.manipulations >= 15 then if piece.manipulations >= 15 then
piece.locked = true piece.locked = true

View File

@ -7,13 +7,13 @@ SRS.name = "Ti-World"
SRS.hash = "Bad I-kicks" SRS.hash = "Bad I-kicks"
SRS.world = true SRS.world = true
SRS.colourscheme = { SRS.colourscheme = {
I = "C", I = "C",
L = "O", L = "O",
J = "B", J = "B",
S = "G", S = "G",
Z = "R", Z = "R",
O = "Y", O = "Y",
T = "M", T = "M",
} }
SRS.softdrop_lock = false SRS.softdrop_lock = false
SRS.harddrop_lock = true SRS.harddrop_lock = true