Compare commits

..

45 Commits

Author SHA1 Message Date
Ishaan Bhardwaj
0572803627 Fixed a slight indentation error 2023-07-09 22:35:07 -04:00
Ishaan Bhardwaj
e09b044de4 Merge pull request #71 from Kirby703/patch-13
fix lategame levelling bug
2023-07-09 20:45:35 -04:00
Kirby703
7d6f783c40 fix lategame levelling bug 2023-07-09 20:06:27 -04:00
Ishaan Bhardwaj
9d365f61a7 Merge pull request #70 from Kirby703/patch-12
fix duplicate cool at 2000
2023-07-09 15:44:04 -04:00
Kirby703
082697c3cd fix duplicate cool at 2000
now you have to survive the roll for gm! terrifying
2023-07-09 15:41:19 -04:00
Ishaan Bhardwaj
788aa11470 Bump version to v0.3.3.2 2023-07-07 18:16:34 -04:00
Ishaan Bhardwaj
a303e82b90 Merge branch 'master' of https://github.com/millabasset/cambridge 2023-07-07 18:14:20 -04:00
Ishaan Bhardwaj
b06d03c4e6 Fix bravo detection 2023-07-07 18:14:17 -04:00
Ishaan Bhardwaj
a6b8abff6d Merge pull request #69 from Kirby703/patch-11
hotfix cool logic
2023-07-07 17:19:24 -04:00
Kirby703
bdc317c3c5 hotfix cool logic 2023-07-07 17:10:24 -04:00
Ishaan Bhardwaj
71c9147a2c Merge pull request #68 from Kirby703/patch-10
re-add 180s and IRS wallkicks after inheritance change
2023-07-04 02:38:52 -04:00
Kirby703
79d706a415 re-add 180s and IRS wallkicks after inheritance change
fixes results of 323c457809
2023-07-04 02:27:04 -04:00
Ishaan Bhardwaj
5fa144f146 Fix Marathon 2020 section cool highlighting 2023-07-02 19:47:39 -04:00
Ishaan Bhardwaj
244e67074d Bump version to v0.3.3.1 2023-07-02 19:13:13 -04:00
Ishaan Bhardwaj
4b456cf49c Removed xcf fonts 2023-07-02 18:20:56 -04:00
Ishaan Bhardwaj
9a67a6ce03 8x11 font by MattMayuga with more characters 2023-07-02 18:07:40 -04:00
Ishaan Bhardwaj
df19129228 Update main.lua 2023-07-01 23:30:36 -04:00
--global
80de771d2a Elaborate on TARGET_FPS 2023-07-01 23:27:10 -04:00
--global
7c32273971 Alias Lua random functions to Love2D's 2023-07-01 23:15:14 -04:00
--global
9d5dbb4674 Bump version to v0.3.3 2023-07-01 22:34:34 -04:00
Ishaan Bhardwaj
8d7ccae2bc README: fix Cambridge logo link 2023-07-01 22:25:50 -04:00
Ishaan Bhardwaj
1e06a1ce8a Merge pull request #67 from MillaBasset/features/backgrounds
Slight revamp on BG image handling
2023-07-01 22:22:50 -04:00
Ishaan Bhardwaj
d24fff5bdc Merge pull request #65 from nightmareci/master
Create unified batch file for running the game from the source directory on Windows and update README.md
2023-07-01 22:22:38 -04:00
Ishaan Bhardwaj
e34005093c Merge pull request #64 from hebo-MAI/master
fix the bug hanging up when starting M-roll
2023-07-01 22:22:04 -04:00
Ishaan Bhardwaj
3dc8b1214b Merge pull request #63 from Kirby703/patch-9
fix line clear delay
2023-07-01 22:21:45 -04:00
Ishaan Bhardwaj
5d2da1b4fb Merge pull request #62 from Tetro48/replay-qol
New replay file naming and fast replay saving.
2023-07-01 22:21:30 -04:00
Ishaan Bhardwaj
f786bda9dd Merge pull request #59 from Tetro48/fixes
Replay tunings fix
2023-07-01 22:21:10 -04:00
Ishaan Bhardwaj
3f789210a6 Merge pull request #56 from Kirby703/patch-8
added cool+regret colors to splits
2023-07-01 22:20:52 -04:00
Ishaan Bhardwaj
a7e7ac43a6 Merge pull request #55 from Kirby703/patch-7
fixes a3 regret grading
2023-07-01 22:20:43 -04:00
Ishaan Bhardwaj
5dc72037ec Merge pull request #54 from Kirby703/patch-6
fixed 2s rule for cools
2023-07-01 22:20:30 -04:00
Oshisaure
e5cb69df43 Slight revamp on BG image handling
- The game can now load more than 20 backgrounds by putting them in /res/backgrounds in the save directory
- If a gamemode tries to set its background to an ID higher than the max it will be clamped down to the last background loaded
2023-07-01 01:56:51 +01:00
Oshisaure
3e68af6a5b Merge pull request #66 from MillaBasset/features/pausing
Added counter for amount of pauses used
2023-06-24 20:35:17 +01:00
Oshisaure
8e6a760fe7 Added counter for amount of pauses used
* Pause count is saved in replays and shown when viewing replay
* Old replays display ?? pauses
* Removed suspend on lose focus
2023-06-24 15:46:38 +01:00
Joe Zeng
a4b7a41a15 Changed the Phantom Mania non-N requirement back to automatic GM at 999.
(Only N should have the 31-tetris rule.)
2023-04-11 12:19:38 -04:00
nightmareci
aa9e03506b Create unified batch file for running the game from the source directory on Windows and update README.md 2023-02-13 09:35:28 -08:00
hebo-MAI
40ac08c7e5 fix the bug hanging up when starting M-roll 2023-01-09 00:12:00 +09:00
Joe Zeng
323c457809 Reorganized the ruleset names and added ARS-X.
Also, the ruleset inheritance was a little wonky, so I changed that too.
In particular, I made SRS-X always spawn in-frame since that was always
supposed to be how it worked.
2022-10-24 20:09:08 -04:00
Joe Zeng
decc1f563f Changed cool/regret cutoffs.
They're all the same past 500 now - I've been meaning to tweak that for quite some time now.
2022-09-28 00:18:44 -04:00
Kirby703
63823ed4b1 fix line clear delay 2022-06-14 00:28:27 -04:00
Tetro48
d7c83b0bc7 New replay file naming and *fast replay saving.
*fast because lower CPU and IO use. No longer O(n²).
2022-05-16 19:53:31 +07:00
nightmareci
e5892c0fae Rename shell scripts and implement better frame timing 2022-04-28 11:47:31 -07:00
Tetro48
d868e8b803 Replay tunings fix 2022-03-09 10:05:06 +07:00
Kirby703
47863175a3 added cool+regret colors to splits 2022-02-10 01:09:21 -05:00
Kirby703
8730261a78 fixes a3 regret grading
getting a cool and a regret in the same split displays as yellow
2022-02-10 00:40:25 -05:00
Kirby703
703ce66c42 fix 2s rule for cools 2022-02-09 23:48:09 -05:00
31 changed files with 278 additions and 114 deletions

View File

@@ -5,7 +5,7 @@ Cambridge
Welcome to Cambridge, the next open-source falling-block game engine!
The project is written and maintained exclusively by [Milla](https://github.com/MillaBasset), [joezeng](https://github.com/joezeng) and [Oshisaure](https://github.com/oshisaure)!
The project is written and maintained exclusively by [Milla](https://github.com/MillaBasset), [joezeng](https://github.com/joezeng) and [Oshisaure](https://github.com/oshisaure)!
The Discord server has been reopened! https://discord.gg/AADZUmgsph
@@ -16,11 +16,11 @@ Playing the game
### Windows
You do not need LÖVE on Windows, as it comes bundled with the program.
You do not need LÖVE on Windows, as it comes bundled with the program.
#### Stable release
To get the stable release, simply download either `cambridge-win32.zip` (32-bit) or `cambridge-windows.zip` (64-bit) in the [latest release](https://github.com/MillaBasset/cambridge/releases/latest).
To get the stable release, simply download either `cambridge-win32.zip` (32-bit) or `cambridge-windows.zip` (64-bit) in the [latest release](https://github.com/MillaBasset/cambridge/releases/latest).
All assets needed are bundled with the executable.
@@ -28,11 +28,11 @@ All assets needed are bundled with the executable.
If you want the bleeding edge version, download [this](https://github.com/MillaBasset/cambridge/archive/master.zip). Extract the ZIP to a folder of your choosing.
Assuming you're on a 64-bit system, you can double-click `start_win64.bat` to run the game. If that doesn't work, open a Command Prompt where you extracted Cambridge and run:
If you're on Windows, you can double-click `start.bat` to run the game. If that doesn't work, open a Command Prompt where you extracted Cambridge and run:
dist\windows\love.exe .
If you're on a 32-bit system, you'll want to double-click `start_win32.bat`. If that doesn't work, run this instead:
If that doesn't work, run this instead, still using Command Prompt where you extracted Cambridge:
dist\win32\love.exe .
@@ -107,4 +107,4 @@ Other Notable Games
- [Puzzle Trial](https://kagamine-rin.itch.io/puzzle-trial) by Rin
- [stackfuse](https://github.com/sinefuse/stackfuse) by sinefuse
![Cambridge Logo](https://cdn.discordapp.com/attachments/625496179433668635/763363717730664458/Icon_2.png)
![Cambridge Logo](https://cdn.discordapp.com/attachments/827186653772644452/1077674343544393820/Icon_2.png)

View File

@@ -26,8 +26,18 @@ font_3x5_4 = love.graphics.newImageFont(
-4
)
font_8x11 = love.graphics.newImageFont(
"res/fonts/8x11_medium.png",
"0123456789:.",
-- this would be font_8x11 with the other one as 8x11_2
-- but that would break compatibility :(
font_8x11_small = love.graphics.newImageFont(
"res/fonts/8x11.png",
" 0123456789:;.,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ..
"?!/\\^@$%<=>()*-+[]_&",
1
)
font_8x11 = love.graphics.newImageFont(
"res/fonts/8x11_medium.png",
" 0123456789:;.,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ..
"?!/\\^@$%<=>()*-+[]_&",
1
)

View File

@@ -1,24 +1,4 @@
backgrounds = {
[0] = love.graphics.newImage("res/backgrounds/0.png"),
love.graphics.newImage("res/backgrounds/100.png"),
love.graphics.newImage("res/backgrounds/200.png"),
love.graphics.newImage("res/backgrounds/300.png"),
love.graphics.newImage("res/backgrounds/400.png"),
love.graphics.newImage("res/backgrounds/500.png"),
love.graphics.newImage("res/backgrounds/600.png"),
love.graphics.newImage("res/backgrounds/700.png"),
love.graphics.newImage("res/backgrounds/800.png"),
love.graphics.newImage("res/backgrounds/900.png"),
love.graphics.newImage("res/backgrounds/1000.png"),
love.graphics.newImage("res/backgrounds/1100.png"),
love.graphics.newImage("res/backgrounds/1200.png"),
love.graphics.newImage("res/backgrounds/1300.png"),
love.graphics.newImage("res/backgrounds/1400.png"),
love.graphics.newImage("res/backgrounds/1500.png"),
love.graphics.newImage("res/backgrounds/1600.png"),
love.graphics.newImage("res/backgrounds/1700.png"),
love.graphics.newImage("res/backgrounds/1800.png"),
love.graphics.newImage("res/backgrounds/1900.png"),
title = love.graphics.newImage("res/backgrounds/title.png"),
title_no_icon = love.graphics.newImage("res/backgrounds/title-no-icon.jpg"),
title_night = love.graphics.newImage("res/backgrounds/title-night.jpg"),
@@ -27,6 +7,13 @@ backgrounds = {
game_config = love.graphics.newImage("res/backgrounds/options-game.png"),
}
local i = 0
local bgpath = "res/backgrounds/%d.png"
while love.filesystem.getInfo(bgpath:format(i*100)) do
backgrounds[i] = love.graphics.newImage(bgpath:format(i*100))
i = i + 1
end
-- in order, the colors are:
-- red, orange, yellow, green, cyan, blue
-- magenta (or purple), white, black

View File

@@ -1 +1 @@
version = "v0.3.1"
version = "v0.3.3.2"

View File

@@ -1,5 +1,4 @@
function love.load()
math.randomseed(os.time())
highscores = {}
love.graphics.setDefaultFilter("linear", "nearest")
require "load.rpc"
@@ -24,6 +23,11 @@ function love.load()
-- used for screenshots
GLOBAL_CANVAS = love.graphics.newCanvas()
-- aliasing to prevent people using math.random by accident
math.random = love.math.random
math.randomseed = love.math.setRandomSeed
math.randomseed(os.time())
-- init config
initConfig()
@@ -81,7 +85,7 @@ function love.draw()
love.graphics.setFont(font_3x5_2)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(
string.format("%.2f", 1 / love.timer.getAverageDelta()) ..
string.format("%.2f", 1.0 / love.timer.getAverageDelta()) ..
"fps - " .. version, 0, 460, 635, "right"
)
end
@@ -110,7 +114,7 @@ function love.keypressed(key, scancode)
scene.restart_message = true
if config.secret then playSE("mode_decide")
else playSE("erase") end
-- f12 is reserved for saving screenshots
-- f12 is reserved for saving screenshots
elseif scancode == "f12" then
local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png")
local info = love.filesystem.getInfo("ss", "directory")
@@ -285,12 +289,16 @@ function love.focus(f)
end
function love.resize(w, h)
GLOBAL_CANVAS:release()
GLOBAL_CANVAS = love.graphics.newCanvas(w, h)
GLOBAL_CANVAS:release()
GLOBAL_CANVAS = love.graphics.newCanvas(w, h)
end
-- higher values of TARGET_FPS will make the game run "faster"
-- since the game is mostly designed for 60 FPS
local TARGET_FPS = 60
local FRAME_DURATION = 1.0 / TARGET_FPS
-- custom run function; optimizes game by syncing draw/update calls
function love.run()
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
@@ -299,7 +307,7 @@ function love.run()
local dt = 0
local last_time = love.timer.getTime()
local time_accumulator = 0
local time_accumulator = 0.0
return function()
if love.event then
love.event.pump()
@@ -319,25 +327,40 @@ function love.run()
if scene and scene.update and love.timer then
scene:update()
local frame_duration = 1.0 / TARGET_FPS
if time_accumulator < frame_duration then
if time_accumulator < FRAME_DURATION then
if love.graphics and love.graphics.isActive() and love.draw then
love.graphics.origin()
love.graphics.clear(love.graphics.getBackgroundColor())
love.draw()
love.graphics.present()
end
local end_time = last_time + frame_duration
local time = love.timer.getTime()
while time < end_time do
love.timer.sleep(0.001)
time = love.timer.getTime()
-- request 1ms delays first but stop short of overshooting, then do "0ms" delays without overshooting (0ms requests generally do a delay of some nonzero amount of time, but maybe less than 1ms)
for milliseconds=0.001,0.000,-0.001 do
local max_delay = 0.0
while max_delay < FRAME_DURATION do
local delay_start_time = love.timer.getTime()
if delay_start_time - last_time < FRAME_DURATION - max_delay then
love.timer.sleep(milliseconds)
local last_delay = love.timer.getTime() - delay_start_time
if last_delay > max_delay then
max_delay = last_delay
end
else
break
end
end
end
while love.timer.getTime() - last_time < FRAME_DURATION do
-- busy loop, do nothing here until delay is finished; delays above stop short of finishing, so this part can finish it off precisely
end
time_accumulator = time_accumulator + time - last_time
end
time_accumulator = time_accumulator - frame_duration
local finish_delay_time = love.timer.getTime()
local real_frame_duration = finish_delay_time - last_time
time_accumulator = time_accumulator + real_frame_duration - FRAME_DURATION
last_time = finish_delay_time
end
last_time = love.timer.getTime()
end
end

View File

@@ -1 +1,3 @@
#!/bin/sh
zip -r cambridge.love libs load res scene tetris conf.lua main.lua scene.lua funcs.lua

View File

@@ -1,4 +1,6 @@
./package
#!/bin/sh
./package-love.sh
mkdir dist
mkdir dist/windows
mkdir dist/win32
@@ -8,4 +10,4 @@ zip dist/cambridge-windows.zip dist/windows/* SOURCES.md LICENSE.md
cat dist/win32/love.exe cambridge.love > dist/win32/cambridge.exe
zip dist/cambridge-win32.zip dist/win32/* SOURCES.md LICENSE.md
cp cambridge.love dist/other/
zip dist/cambridge-other.zip cambridge.love libs/discord-rpc.* SOURCES.md LICENSE.md
zip dist/cambridge-other.zip cambridge.love libs/discord-rpc.* SOURCES.md LICENSE.md

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

View File

@@ -25,6 +25,8 @@ function GameScene:new(game_mode, ruleset, inputs)
hold=false,
}
self.paused = false
self.game.pause_count = 0
self.game.pause_time = 0
DiscordRPC:update({
details = self.game.rpc_details,
state = self.game.name,
@@ -33,7 +35,9 @@ function GameScene:new(game_mode, ruleset, inputs)
end
function GameScene:update()
if love.window.hasFocus() and not self.paused then
if self.paused then
self.game.pause_time = self.game.pause_time + 1
else
local inputs = {}
for input, value in pairs(self.inputs) do
inputs[input] = value
@@ -50,6 +54,16 @@ end
function GameScene:render()
self.game:draw(self.paused)
if self.game.pause_time > 0 or self.game.pause_count > 0 then
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setFont(font_3x5_2)
love.graphics.printf(string.format(
"%d PAUSE%s (%s)",
self.game.pause_count,
self.game.pause_count == 1 and "" or "S",
formatTime(self.game.pause_time)
), 0, 0, 635, "right")
end
end
function GameScene:onInputPress(e)
@@ -71,8 +85,12 @@ function GameScene:onInputPress(e)
scene = GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs)
elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then
self.paused = not self.paused
if self.paused then pauseBGM()
else resumeBGM() end
if self.paused then
pauseBGM()
self.game.pause_count = self.game.pause_count + 1
else
resumeBGM()
end
elseif e.input == "menu_back" then
self.game:onExit()
scene = ModeSelectScene()

View File

@@ -6,6 +6,9 @@ ReplayScene.title = "Replay"
function ReplayScene:new(replay, game_mode, ruleset)
config.gamesettings = replay["gamesettings"]
if replay["delayed_auto_shift"] then config.das = replay["delayed_auto_shift"] end
if replay["auto_repeat_rate"] then config.arr = replay["auto_repeat_rate"] end
if replay["das_cut_delay"] then config.dcd = replay["das_cut_delay"] end
love.math.setRandomSeed(replay["random_low"], replay["random_high"])
love.math.setRandomState(replay["random_state"])
self.retry_replay = replay
@@ -29,6 +32,8 @@ function ReplayScene:new(replay, game_mode, ruleset)
hold=false,
}
self.paused = false
self.game.pause_count = replay["pause_count"]
self.game.pause_time = replay["pause_time"]
self.replay = deepcopy(replay)
self.replay_index = 1
DiscordRPC:update({
@@ -39,7 +44,7 @@ function ReplayScene:new(replay, game_mode, ruleset)
end
function ReplayScene:update()
if love.window.hasFocus() and not self.paused then
if not self.paused then
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
@@ -64,6 +69,19 @@ function ReplayScene:render()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setFont(font_3x5_3)
love.graphics.printf("REPLAY", 0, 0, 635, "right")
love.graphics.setFont(font_3x5_2)
if self.game.pause_time and self.game.pause_count then
if self.game.pause_time > 0 or self.game.pause_count > 0 then
love.graphics.printf(string.format(
"%d PAUSE%s (%s)",
self.game.pause_count,
self.game.pause_count == 1 and "" or "S",
formatTime(self.game.pause_time)
), 0, 23, 635, "right")
end
else
love.graphics.printf("?? PAUSES (--:--.--)", 0, 23, 635, "right")
end
end
function ReplayScene:onInputPress(e)

View File

@@ -83,7 +83,7 @@ function ReplaySelectScene:render()
-- Same graphic as mode select
--love.graphics.draw(misc_graphics["select_mode"], 20, 40)
love.graphics.setFont(font_3x5_4)
love.graphics.setFont(font_8x11)
love.graphics.print("SELECT REPLAY", 20, 35)
if self.display_warning then

7
start.bat Normal file
View File

@@ -0,0 +1,7 @@
@echo OFF
rem This solution of detecting the current CPU taken from here: https://stackoverflow.com/a/24590583
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set CURRENT_CPU=32BIT || set CURRENT_CPU=64BIT
if %CURRENT_CPU%==32BIT .\dist\win32\love.exe .
if %CURRENT_CPU%==64BIT .\dist\windows\love.exe .

View File

@@ -1 +0,0 @@
dist\win32\love.exe .

View File

@@ -1 +0,0 @@
dist\windows\love.exe .

View File

@@ -231,12 +231,15 @@ function Grid:applyBigPiece(piece)
end
end
function Grid:checkForBravo(cleared_row_count)
for i = 0, self.height - 1 - cleared_row_count do
for j = 0, self.width - 1 do
if self:isOccupied(j, i) then return false end
end
-- places where you see this take an argument used the old, buggy method
function Grid:checkForBravo()
for i = 0, self.height - 1 do
if not self:isRowFull(i+1) then
for j = 0, self.width - 1 do
if self:isOccupied(j, i) then return false end
end
end
end
return true
end

View File

@@ -135,25 +135,27 @@ function GameMode:saveReplay()
replay["lines"] = self.lines
replay["gamesettings"] = config.gamesettings
replay["secret_inputs"] = self.secret_inputs
replay["delayed_auto_shift"] = config.das
replay["auto_repeat_rate"] = config.arr
replay["das_cut_delay"] = config.dcd
replay["timestamp"] = os.time()
replay["pause_count"] = self.pause_count
replay["pause_time"] = self.pause_time
if love.filesystem.getInfo("replays") == nil then
love.filesystem.createDirectory("replays")
end
local replay_files = love.filesystem.getDirectoryItems("replays")
-- Select replay filename that doesn't collide with an existing one
local init_name = string.format("replays/%s.crp", os.date("%Y-%m-%d_%H-%M-%S"))
local replay_name = init_name
local replay_number = 0
local collision = true
while collision do
collision = false
replay_number = replay_number + 1
for key, file in pairs(replay_files) do
if file == replay_number..".crp" then
collision = true
break
end
while true do
if love.filesystem.getInfo(replay_name, "file") then
replay_number = replay_number + 1
replay_name = string.format("%s (%d)", init_name, replay_number)
else
break
end
end
love.filesystem.write("replays/"..replay_number..".crp", binser.serialize(replay))
love.filesystem.write(replay_name, binser.serialize(replay))
end
function GameMode:addReplayInput(inputs)
@@ -977,9 +979,11 @@ function GameMode:drawSectionTimesWithSplits(current_section, section_limit)
end
function GameMode:drawBackground()
local id = self:getBackground()
if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(
backgrounds[self:getBackground()],
backgrounds[id],
0, 0, 0,
0.5, 0.5
)

View File

@@ -283,7 +283,7 @@ function Marathon2020Game:sectionPassed(old_level, new_level)
)
else
return (
(new_level < 2001 and math.floor(old_level / 100) < math.floor(new_level / 100)) or
(new_level < 2000 and math.floor(old_level / 100) < math.floor(new_level / 100)) or
(new_level >= 2020)
)
end
@@ -353,15 +353,10 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
self.section_start_time = self.frames
if (
self.section_status[section - 1] == "cool" and
self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120 and
self.secondary_section_times[section] < cool_cutoffs[self.delay_level]
(self.secondary_section_times[section] < cool_cutoffs[self.delay_level]) and
(section == 1 or self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120)
) then
sectionCool(section)
elseif self.section_status[section - 1] == "cool" then
table.insert(self.section_status, "none")
elseif self.secondary_section_times[section] < cool_cutoffs[self.delay_level] then
sectionCool(section)
else
table.insert(self.section_status, "none")
end

View File

@@ -249,10 +249,13 @@ local grade_conversion = {
}
function MarathonA2Game:whilePieceActive()
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
self.grade_point_decay_counter = 0
self.grade_points = math.max(0, self.grade_points - 1)
if self.clear then return
else
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
self.grade_point_decay_counter = 0
self.grade_points = math.max(0, self.grade_points - 1)
end
end
end

View File

@@ -26,7 +26,9 @@ function MarathonA3Game:new()
self.roll_points = 0
self.grade_point_decay_counter = 0
self.section_cool_grade = 0
self.section_status = { [0] = "none" }
--self.section_status = { [0] = "none" }
self.section_cools = { [0] = 0 }
self.section_regrets = { [0] = 0 }
self.section_start_time = 0
self.secondary_section_times = { [0] = 0 }
self.section_times = { [0] = 0 }
@@ -201,15 +203,23 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
self.speed_level = self.section_cool and self.speed_level + 100 or self.speed_level
if section_time > regret_cutoffs[section] then
self.section_cool_grade = self.section_cool_grade - 1
table.insert(self.section_status, "regret")
if self.grade > 0 then
--this happens after the points are added, intentionally
local currentgrade = self:getAggregateGrade()
while self:getAggregateGrade() >= currentgrade do
self.grade = self.grade - 1
end
self.grade_points = 0
end
table.insert(self.section_regrets, 1)
self.coolregret_message = "REGRET!!"
self.coolregret_timer = 300
elseif self.section_cool then
self.section_cool_grade = self.section_cool_grade + 1
table.insert(self.section_status, "cool")
else
table.insert(self.section_status, "none")
table.insert(self.section_regrets, 0)
end
if self.section_cool then
self.section_cool_grade = self.section_cool_grade + 1
end
self.section_cool = false
@@ -223,6 +233,9 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
self.section_cool = true
self.coolregret_message = "COOL!!"
self.coolregret_timer = 300
table.insert(self.section_cools, 1)
else
table.insert(self.section_cools, 0)
end
end
end
@@ -402,9 +415,11 @@ MarathonA3Game.mRollOpacityFunction = function(age)
end
function MarathonA3Game:sectionColourFunction(section)
if self.section_status[section] == "cool" then
if self.section_cools[section] == 1 and self.section_regrets[section] == 1 then
return { 1, 1, 0, 1 }
elseif self.section_cools[section] == 1 then
return { 0, 1, 0, 1 }
elseif self.section_status[section] == "regret" then
elseif self.section_regrets[section] == 1 then
return { 1, 0, 0, 1 }
else
return { 1, 1, 1, 1 }

View File

@@ -28,7 +28,6 @@ function PhantomManiaGame:new()
self.combo = 1
self.tetrises = 0
self.section_tetrises = {[0] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
self.section_req = true
self.randomizer = History6RollsRandomizer()
end
@@ -55,7 +54,7 @@ function PhantomManiaGame:getDasLimit()
end
function PhantomManiaGame:getLineClearDelay()
return self:getLineARE()
return self:getLineARE() - 2
end
function PhantomManiaGame:getLockDelay()
@@ -120,11 +119,6 @@ function PhantomManiaGame:onLineClear(cleared_row_count)
self.level = 999
end
self.clear = true
for i = 0, 9 do
if self.section_tetrises[i] < (i == 9 and 1 or 2) then
self.section_req = false
end
end
else
self.level = new_level
end
@@ -175,6 +169,10 @@ local function getLetterGrade(level, clear)
end
end
function PhantomManiaGame:qualifiesForGM()
return true
end
function PhantomManiaGame:drawScoringInfo()
PhantomManiaGame.super.drawScoringInfo(self)
@@ -195,7 +193,7 @@ function PhantomManiaGame:drawScoringInfo()
if getLetterGrade(self.level, self.clear) ~= "" then
if self.roll_frames > 1982 then love.graphics.setColor(1, 0.5, 0, 1)
elseif self.level == 999 and self.clear then love.graphics.setColor(0, 1, 0, 1) end
if self.level == 999 and self.section_req and self.tetrises >= 31 then
if self.level == 999 and self:qualifiesForGM() then
love.graphics.printf("GM", text_x, 140, 90, "left")
else
love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left")

View File

@@ -41,6 +41,7 @@ function PhantomMania2Game:new()
self.coolregret_message = ""
self.coolregret_timer = 0
self.coolregrets = { [0] = 0 }
end
function PhantomMania2Game:getARE()
@@ -202,13 +203,13 @@ end
local cool_cutoffs = {
frameTime(0,36), frameTime(0,36), frameTime(0,36), frameTime(0,36), frameTime(0,36),
frameTime(0,30), frameTime(0,30), frameTime(0,30), frameTime(0,30), frameTime(0,30),
frameTime(0,27), frameTime(0,27), frameTime(0,27),
frameTime(0,30), frameTime(0,30), frameTime(0,30),
}
local regret_cutoffs = {
frameTime(0,50), frameTime(0,50), frameTime(0,50), frameTime(0,50), frameTime(0,50),
frameTime(0,40), frameTime(0,40), frameTime(0,40), frameTime(0,40), frameTime(0,40),
frameTime(0,35), frameTime(0,35), frameTime(0,35),
frameTime(0,42), frameTime(0,42), frameTime(0,42), frameTime(0,42), frameTime(0,42),
frameTime(0,42), frameTime(0,42), frameTime(0,42),
}
function PhantomMania2Game:updateSectionTimes(old_level, new_level)
@@ -219,11 +220,14 @@ function PhantomMania2Game:updateSectionTimes(old_level, new_level)
self.section_start_time = self.frames
if section_time <= cool_cutoffs[section] then
self.grade = self.grade + 2
table.insert(self.coolregrets, 2)
self.coolregret_message = "COOL!!"
self.coolregret_timer = 300
elseif section_time <= regret_cutoffs[section] then
self.grade = self.grade + 1
table.insert(self.coolregrets, 1)
else
table.insert(self.coolregrets, 0)
self.coolregret_message = "REGRET!!"
self.coolregret_timer = 300
end
@@ -292,6 +296,16 @@ function PhantomMania2Game:setHoldOpacity()
end
end
function PhantomMania2Game:sectionColourFunction(section)
if self.coolregrets[section] == 2 then
return { 0, 1, 0, 1 }
elseif self.coolregrets[section] == 0 then
return { 1, 0, 0, 1 }
else
return { 1, 1, 1, 1 }
end
end
function PhantomMania2Game:drawScoringInfo()
PhantomMania2Game.super.drawScoringInfo(self)

View File

@@ -13,4 +13,14 @@ function PhantomManiaNGame:new()
self.enable_hold = true
end
function PhantomManiaNGame:qualifiesForGM()
if self.tetrises < 31 then return false end
for i = 0, 9 do
if self.section_tetrises[i] < (i == 9 and 1 or 2) then
return false
end
end
return true
end
return PhantomManiaNGame

View File

@@ -143,7 +143,7 @@ end
function Survival2020Game:onPieceEnter()
if not self.clear and (
(self.level < 1900 and self.level % 100 ~= 99) or
self.level == 2019
(1900 <= self.level and self.level < 2019)
) then
self.level = self.level + 1
end
@@ -249,7 +249,7 @@ function Survival2020Game:drawScoringInfo()
end
function Survival2020Game:getBackground()
return math.floor(self.level / 100)
return math.min(19, math.floor(self.level / 100))
end
function Survival2020Game:getHighscoreData()

View File

@@ -0,0 +1,49 @@
local Piece = require 'tetris.components.piece'
local Ruleset = require 'tetris.rulesets.arika_ace2'
local ARS = Ruleset:extend()
ARS.name = "ARS-X"
ARS.hash = "ArikaEXP"
ARS.MANIPULATIONS_MAX = 24
ARS.ROTATIONS_MAX = 12
function ARS:onPieceCreate(piece, grid)
piece.manipulations = 0
piece.rotations = 0
piece.lowest_y = -math.huge
end
function ARS:checkNewLow(piece)
for _, block in pairs(piece:getBlockOffsets()) do
local y = piece.position.y + block.y
if y > piece.lowest_y then
piece.manipulations = 0
piece.rotations = 0
piece.lowest_y = y
end
end
end
function ARS:onPieceMove(piece, grid)
piece.lock_delay = 0 -- move reset
if piece:isDropBlocked(grid) then
piece.manipulations = piece.manipulations + 1
if piece.manipulations >= ARS.MANIPULATIONS_MAX then
piece.locked = true
end
end
end
function ARS:onPieceRotate(piece, grid, upward)
piece.lock_delay = 0 -- rotate reset
if upward or piece:isDropBlocked(grid) then
piece.rotations = piece.rotations + 1
if piece.rotations >= ARS.ROTATIONS_MAX and piece:isDropBlocked(grid) then
piece.locked = true
end
end
end
return ARS

View File

@@ -1,5 +1,5 @@
local Piece = require 'tetris.components.piece'
local Ruleset = require 'tetris.rulesets.standard_exp'
local Ruleset = require 'tetris.rulesets.standard_ace'
local SRS = Ruleset:extend()
@@ -8,6 +8,8 @@ SRS.hash = "Standard"
SRS.softdrop_lock = false
SRS.harddrop_lock = true
SRS.enable_IRS_wallkicks = true
SRS.MANIPULATIONS_MAX = 15
SRS.wallkicks_line = {
@@ -33,8 +35,8 @@ SRS.wallkicks_line = {
},
};
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
local kicks
if piece.shape == "O" then
return
@@ -69,6 +71,12 @@ function SRS:checkNewLow(piece)
end
end
function SRS:onPieceCreate(piece, grid)
piece.manipulations = 0
piece.rotations = 0
piece.lowest_y = -math.huge
end
function SRS:onPieceDrop(piece, grid)
self:checkNewLow(piece)
if piece.manipulations >= self.MANIPULATIONS_MAX and piece:isDropBlocked(grid) then
@@ -102,4 +110,6 @@ end
function SRS:canPieceRotate() return true end
function SRS:get180RotationValue() return 2 end
return SRS

View File

@@ -1,5 +1,5 @@
local Piece = require 'tetris.components.piece'
local Ruleset = require 'tetris.rulesets.ti_srs'
local Ruleset = require 'tetris.rulesets.standard_ti'
local SRS = Ruleset:extend()

View File

@@ -1,5 +1,5 @@
local Piece = require 'tetris.components.piece'
local Ruleset = require 'tetris.rulesets.arika_srs'
local Ruleset = require 'tetris.rulesets.standard_ti'
local SRS = Ruleset:extend()
@@ -27,8 +27,6 @@ function SRS:checkNewLow(piece)
for _, block in pairs(piece:getBlockOffsets()) do
local y = piece.position.y + block.y
if y > piece.lowest_y then
--piece.manipulations = 0
--piece.rotations = 0
piece.lowest_y = y
end
end