mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
351fb4cfe9 | ||
|
|
103f04ceaa | ||
|
|
88d2f0d8d1 | ||
|
|
e100289c82 | ||
|
|
e38da49180 | ||
|
|
b03473d2fe | ||
|
|
cf6e0be4e7 | ||
|
|
2bc9dc179c | ||
|
|
d626926d5a | ||
|
|
721acefea0 | ||
|
|
b9b71e90bb | ||
|
|
9f61b139fd |
@@ -29,6 +29,7 @@ The following people in no particular order also helped with the project:
|
|||||||
- [2Tie](https://github.com/2Tie)
|
- [2Tie](https://github.com/2Tie)
|
||||||
- [nightmareci](https://github.com/nightmareci)
|
- [nightmareci](https://github.com/nightmareci)
|
||||||
- [MyPasswordIsWeak](https://github.com/MyPasswordIsWeak)
|
- [MyPasswordIsWeak](https://github.com/MyPasswordIsWeak)
|
||||||
|
- [Dr Ocelot](https://github.com/Dr-Ocelot)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -230,6 +230,15 @@ function Grid:checkForBravo(cleared_row_count)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Grid:checkStackHeight()
|
||||||
|
for i = 0, 23 do
|
||||||
|
for j = 0, 9 do
|
||||||
|
if self:isOccupied(j, i) then return 24 - i end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
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
|
||||||
@@ -310,7 +319,32 @@ function Grid:draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Grid:drawInvisible(opacity_function, garbage_opacity_function)
|
function Grid:drawOutline()
|
||||||
|
for y = 5, 24 do
|
||||||
|
for x = 1, 10 do
|
||||||
|
if self.grid[y][x] ~= empty then
|
||||||
|
love.graphics.setColor(0.8, 0.8, 0.8, 1)
|
||||||
|
love.graphics.setLineWidth(1)
|
||||||
|
if y > 1 and self.grid[y-1][x] == empty then
|
||||||
|
love.graphics.line(48.0+x*16, -0.5+y*16, 64.0+x*16, -0.5+y*16)
|
||||||
|
end
|
||||||
|
if y < 24 and self.grid[y+1][x] == empty then
|
||||||
|
love.graphics.line(48.0+x*16, 16.5+y*16, 64.0+x*16, 16.5+y*16)
|
||||||
|
end
|
||||||
|
if x > 1 and self.grid[y][x-1] == empty then
|
||||||
|
love.graphics.line(47.5+x*16, -0.0+y*16, 47.5+x*16, 16.0+y*16)
|
||||||
|
end
|
||||||
|
if x < 10 and self.grid[y][x+1] == empty then
|
||||||
|
love.graphics.line(64.5+x*16, -0.0+y*16, 64.5+x*16, 16.0+y*16)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Grid:drawInvisible(opacity_function, garbage_opacity_function, lock_flash, brightness)
|
||||||
|
lock_flash = lock_flash == nil and true or lock_flash
|
||||||
|
brightness = brightness == nil and 0.5 or brightness
|
||||||
for y = 5, 24 do
|
for y = 5, 24 do
|
||||||
for x = 1, 10 do
|
for x = 1, 10 do
|
||||||
if self.grid[y][x] ~= empty then
|
if self.grid[y][x] ~= empty then
|
||||||
@@ -321,22 +355,24 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function)
|
|||||||
else
|
else
|
||||||
opacity = opacity_function(self.grid_age[y][x])
|
opacity = opacity_function(self.grid_age[y][x])
|
||||||
end
|
end
|
||||||
love.graphics.setColor(0.5, 0.5, 0.5, opacity)
|
love.graphics.setColor(brightness, brightness, brightness, opacity)
|
||||||
love.graphics.draw(blocks[self.grid[y][x].skin][self.grid[y][x].colour], 48+x*16, y*16)
|
love.graphics.draw(blocks[self.grid[y][x].skin][self.grid[y][x].colour], 48+x*16, y*16)
|
||||||
if opacity > 0 and self.grid[y][x].colour ~= "X" then
|
if lock_flash then
|
||||||
love.graphics.setColor(0.64, 0.64, 0.64)
|
if opacity > 0 and self.grid[y][x].colour ~= "X" then
|
||||||
love.graphics.setLineWidth(1)
|
love.graphics.setColor(0.64, 0.64, 0.64)
|
||||||
if y > 1 and self.grid[y-1][x] == empty then
|
love.graphics.setLineWidth(1)
|
||||||
love.graphics.line(48.0+x*16, -0.5+y*16, 64.0+x*16, -0.5+y*16)
|
if y > 1 and self.grid[y-1][x] == empty then
|
||||||
end
|
love.graphics.line(48.0+x*16, -0.5+y*16, 64.0+x*16, -0.5+y*16)
|
||||||
if y < 24 and self.grid[y+1][x] == empty then
|
end
|
||||||
love.graphics.line(48.0+x*16, 16.5+y*16, 64.0+x*16, 16.5+y*16)
|
if y < 24 and self.grid[y+1][x] == empty then
|
||||||
end
|
love.graphics.line(48.0+x*16, 16.5+y*16, 64.0+x*16, 16.5+y*16)
|
||||||
if x > 1 and self.grid[y][x-1] == empty then
|
end
|
||||||
love.graphics.line(47.5+x*16, -0.0+y*16, 47.5+x*16, 16.0+y*16)
|
if x > 1 and self.grid[y][x-1] == empty then
|
||||||
end
|
love.graphics.line(47.5+x*16, -0.0+y*16, 47.5+x*16, 16.0+y*16)
|
||||||
if x < 10 and self.grid[y][x+1] == empty then
|
end
|
||||||
love.graphics.line(64.5+x*16, -0.0+y*16, 64.5+x*16, 16.0+y*16)
|
if x < 10 and self.grid[y][x+1] == empty then
|
||||||
|
love.graphics.line(64.5+x*16, -0.0+y*16, 64.5+x*16, 16.0+y*16)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ end
|
|||||||
|
|
||||||
function MarathonA2Game:drawGrid(ruleset)
|
function MarathonA2Game:drawGrid(ruleset)
|
||||||
if self.clear and not (self.completed or self.game_over) then
|
if self.clear and not (self.completed or self.game_over) then
|
||||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
|
||||||
else
|
else
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
if self.piece ~= nil and self.level < 100 then
|
if self.piece ~= nil and self.level < 100 then
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ 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.irs = true
|
||||||
|
self.ihs = true
|
||||||
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
|
||||||
@@ -105,7 +107,7 @@ function GameMode:update(inputs, ruleset)
|
|||||||
self:whilePieceActive()
|
self:whilePieceActive()
|
||||||
local gravity = self:getGravity()
|
local gravity = self:getGravity()
|
||||||
|
|
||||||
if self.enable_hold and inputs["hold"] == true and self.held == false then
|
if self.enable_hold and inputs["hold"] == true and self.held == false and self.prev_inputs["hold"] == false then
|
||||||
self:hold(inputs, ruleset)
|
self:hold(inputs, ruleset)
|
||||||
self.prev_inputs = inputs
|
self.prev_inputs = inputs
|
||||||
return
|
return
|
||||||
@@ -277,6 +279,13 @@ function GameMode:processDelays(inputs, ruleset, drop_speed)
|
|||||||
end
|
end
|
||||||
elseif self.are > 0 then
|
elseif self.are > 0 then
|
||||||
self.are = self.are - 1
|
self.are = self.are - 1
|
||||||
|
if ruleset.are_cancel and
|
||||||
|
(inputs["left"] or inputs["right"] or
|
||||||
|
inputs["rotate_left"] or inputs["rotate_left2"] or
|
||||||
|
inputs["rotate_right"] or inputs["rotate_right2"] or
|
||||||
|
inputs["rotate_180"]) then
|
||||||
|
self.are = 0
|
||||||
|
end
|
||||||
if self.are == 0 then
|
if self.are == 0 then
|
||||||
self:initializeOrHold(inputs, ruleset)
|
self:initializeOrHold(inputs, ruleset)
|
||||||
end
|
end
|
||||||
@@ -284,7 +293,7 @@ function GameMode:processDelays(inputs, ruleset, drop_speed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:initializeOrHold(inputs, ruleset)
|
function GameMode:initializeOrHold(inputs, ruleset)
|
||||||
if self.enable_hold and inputs["hold"] == true then
|
if self.ihs and self.enable_hold and inputs["hold"] == true then
|
||||||
self:hold(inputs, ruleset)
|
self:hold(inputs, ruleset)
|
||||||
else
|
else
|
||||||
self:initializeNextPiece(inputs, ruleset, self.next_queue[1])
|
self:initializeNextPiece(inputs, ruleset, self.next_queue[1])
|
||||||
@@ -324,7 +333,8 @@ function GameMode:initializeNextPiece(inputs, ruleset, piece_data, generate_next
|
|||||||
inputs, piece_data, self.grid, gravity,
|
inputs, piece_data, self.grid, gravity,
|
||||||
self.prev_inputs, self.move,
|
self.prev_inputs, self.move,
|
||||||
self:getLockDelay(), self:getDropSpeed(),
|
self:getLockDelay(), self:getDropSpeed(),
|
||||||
self.lock_drop, self.lock_hard_drop, self.big_mode
|
self.lock_drop, self.lock_hard_drop, self.big_mode,
|
||||||
|
self.irs
|
||||||
)
|
)
|
||||||
if self.lock_drop then
|
if self.lock_drop then
|
||||||
self.drop_locked = true
|
self.drop_locked = true
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ function Marathon2020Game:advanceOneFrame()
|
|||||||
if self.roll_frames < 0 then
|
if self.roll_frames < 0 then
|
||||||
return false
|
return false
|
||||||
elseif self.roll_frames > 4000 then
|
elseif self.roll_frames > 4000 then
|
||||||
|
if self.grade >= 30 and self.section_cool_count >= 20 then self.grade = 31 end
|
||||||
self.completed = true
|
self.completed = true
|
||||||
end
|
end
|
||||||
elseif self.ready_frames == 0 then
|
elseif self.ready_frames == 0 then
|
||||||
@@ -248,6 +249,7 @@ function Marathon2020Game:updateGrade(cleared_lines)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Marathon2020Game:getTotalGrade()
|
function Marathon2020Game:getTotalGrade()
|
||||||
|
if self.grade + self.section_cool_count > 50 then return "GM" end
|
||||||
return self.grade + self.section_cool_count
|
return self.grade + self.section_cool_count
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -392,7 +394,6 @@ Marathon2020Game.mRollOpacityFunction = function(age)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Marathon2020Game:qualifiesForMRoll()
|
function Marathon2020Game:qualifiesForMRoll()
|
||||||
return false -- until I actually have grading working
|
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
GM-roll requirements
|
GM-roll requirements
|
||||||
@@ -403,6 +404,8 @@ You qualify for the GM roll if you:
|
|||||||
- in less than 13:30.00 total.
|
- in less than 13:30.00 total.
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
|
return self.level >= 2020 and self:getTotalGrade() == 50 and self.frames <= frameTime(13,30)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Marathon2020Game:drawGrid()
|
function Marathon2020Game:drawGrid()
|
||||||
|
|||||||
@@ -310,12 +310,12 @@ MarathonA2Game.mRollOpacityFunction = function(age)
|
|||||||
else return 1 - age / 4 end
|
else return 1 - age / 4 end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MarathonA2Game:drawGrid(ruleset)
|
function MarathonA2Game:drawGrid()
|
||||||
if self.clear and not (self.completed or self.game_over) then
|
if self.clear and not (self.completed or self.game_over) then
|
||||||
if self:qualifiesForMRoll() then
|
if self:qualifiesForMRoll() then
|
||||||
self.grid:drawInvisible(self.mRollOpacityFunction)
|
self.grid:drawInvisible(self.mRollOpacityFunction, nil, false)
|
||||||
else
|
else
|
||||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
|
|||||||
@@ -231,8 +231,8 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MarathonA3Game:updateScore(level, drop_bonus, cleared_lines)
|
function MarathonA3Game:updateScore(level, drop_bonus, cleared_lines)
|
||||||
if not self.clear then
|
self:updateGrade(cleared_lines)
|
||||||
self:updateGrade(cleared_lines)
|
if not self.clear then
|
||||||
if cleared_lines > 0 then
|
if cleared_lines > 0 then
|
||||||
self.combo = self.combo + (cleared_lines - 1) * 2
|
self.combo = self.combo + (cleared_lines - 1) * 2
|
||||||
self.score = self.score + (
|
self.score = self.score + (
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ end
|
|||||||
|
|
||||||
function PhantomManiaGame:drawGrid()
|
function PhantomManiaGame:drawGrid()
|
||||||
if not (self.game_over or self.clear) then
|
if not (self.game_over or self.clear) then
|
||||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
|
||||||
else
|
else
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
end
|
end
|
||||||
|
|||||||
22
tetris/modes/phantom_mania_n.lua
Normal file
22
tetris/modes/phantom_mania_n.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
local PhantomManiaGame = require 'tetris.modes.phantom_mania'
|
||||||
|
|
||||||
|
local PhantomManiaNGame = PhantomManiaGame:extend()
|
||||||
|
|
||||||
|
PhantomManiaNGame.name = "Phantom Mania N"
|
||||||
|
PhantomManiaNGame.hash = "PhantomManiaN"
|
||||||
|
PhantomManiaNGame.tagline = "The old mode from Nullpomino, for Ti-ARS and SRS support."
|
||||||
|
|
||||||
|
function PhantomManiaNGame:new()
|
||||||
|
PhantomManiaNGame.super:new()
|
||||||
|
|
||||||
|
self.SGnames = {
|
||||||
|
"M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9",
|
||||||
|
"M10", "M11", "M12", "M13", "M14", "M15", "M16", "M17", "M18",
|
||||||
|
"GM"
|
||||||
|
}
|
||||||
|
|
||||||
|
self.next_queue_length = 3
|
||||||
|
self.enable_hold = true
|
||||||
|
end
|
||||||
|
|
||||||
|
return PhantomManiaNGame
|
||||||
@@ -112,9 +112,9 @@ end
|
|||||||
|
|
||||||
function ARS:get180RotationValue()
|
function ARS:get180RotationValue()
|
||||||
if config.gamesettings.world_reverse == 3 then
|
if config.gamesettings.world_reverse == 3 then
|
||||||
return 3
|
|
||||||
else
|
|
||||||
return 1
|
return 1
|
||||||
|
else
|
||||||
|
return 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ end
|
|||||||
|
|
||||||
function ARS:get180RotationValue()
|
function ARS:get180RotationValue()
|
||||||
if config.gamesettings.world_reverse == 3 then
|
if config.gamesettings.world_reverse == 3 then
|
||||||
return 3
|
|
||||||
else
|
|
||||||
return 1
|
return 1
|
||||||
|
else
|
||||||
|
return 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -174,9 +174,9 @@ end
|
|||||||
|
|
||||||
function ARS:get180RotationValue()
|
function ARS:get180RotationValue()
|
||||||
if config.gamesettings.world_reverse == 3 then
|
if config.gamesettings.world_reverse == 3 then
|
||||||
return 3
|
|
||||||
else
|
|
||||||
return 1
|
return 1
|
||||||
|
else
|
||||||
|
return 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -153,9 +153,9 @@ end
|
|||||||
|
|
||||||
function ARS:get180RotationValue()
|
function ARS:get180RotationValue()
|
||||||
if config.gamesettings.world_reverse == 3 then
|
if config.gamesettings.world_reverse == 3 then
|
||||||
return 3
|
|
||||||
else
|
|
||||||
return 1
|
return 1
|
||||||
|
else
|
||||||
|
return 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ Ruleset.softdrop_lock = true
|
|||||||
Ruleset.harddrop_lock = false
|
Ruleset.harddrop_lock = false
|
||||||
|
|
||||||
Ruleset.enable_IRS_wallkicks = false
|
Ruleset.enable_IRS_wallkicks = false
|
||||||
|
Ruleset.are_cancel = false
|
||||||
|
|
||||||
-- Component functions.
|
-- Component functions.
|
||||||
|
|
||||||
@@ -180,7 +181,7 @@ function Ruleset:getDefaultOrientation() return 1 end
|
|||||||
function Ruleset:initializePiece(
|
function Ruleset:initializePiece(
|
||||||
inputs, data, grid, gravity, prev_inputs,
|
inputs, data, grid, gravity, prev_inputs,
|
||||||
move, lock_delay, drop_speed,
|
move, lock_delay, drop_speed,
|
||||||
drop_locked, hard_drop_locked, big
|
drop_locked, hard_drop_locked, big, irs
|
||||||
)
|
)
|
||||||
local spawn_positions
|
local spawn_positions
|
||||||
if big then
|
if big then
|
||||||
@@ -196,7 +197,7 @@ function Ruleset:initializePiece(
|
|||||||
}, self.block_offsets, 0, 0, data.skin, colours[data.shape], big)
|
}, self.block_offsets, 0, 0, data.skin, colours[data.shape], big)
|
||||||
|
|
||||||
self:onPieceCreate(piece)
|
self:onPieceCreate(piece)
|
||||||
self:rotatePiece(inputs, piece, grid, {}, true)
|
if irs then self:rotatePiece(inputs, piece, grid, {}, true) end
|
||||||
self:dropPiece(inputs, piece, grid, gravity, drop_speed, drop_locked, hard_drop_locked)
|
self:dropPiece(inputs, piece, grid, gravity, drop_speed, drop_locked, hard_drop_locked)
|
||||||
return piece
|
return piece
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user