Compare commits

..

12 Commits

Author SHA1 Message Date
Ishaan Bhardwaj
351fb4cfe9 Added the functionality to draw only an outline of the stack 2020-11-18 12:17:04 -05:00
Ishaan Bhardwaj
103f04ceaa added a misc function 2020-11-17 21:52:20 -05:00
Ishaan Bhardwaj
88d2f0d8d1 Made ARE canceling more consistent. 2020-11-17 13:50:38 -05:00
Ishaan Bhardwaj
e100289c82 Made ARE canceling less slippery 2020-11-16 22:23:05 -05:00
Ishaan Bhardwaj
e38da49180 ARE canceling 2020-11-16 21:16:59 -05:00
Ishaan Bhardwaj
b03473d2fe IRS fix 2020-11-16 12:51:21 -05:00
Ishaan Bhardwaj
cf6e0be4e7 New IRS and IHS settings 2020-11-16 12:48:28 -05:00
Ishaan Bhardwaj
2bc9dc179c Updated README with another contributor 2020-11-14 20:00:24 -05:00
Ishaan Bhardwaj
d626926d5a Fixed 180 rotation directions 2020-11-14 19:20:25 -05:00
Ishaan Bhardwaj
721acefea0 Cleaned up TAP M-roll 2020-11-14 09:35:16 -05:00
Ishaan Bhardwaj
b9b71e90bb Finished Marathon 2020 grading! 2020-11-12 17:01:28 -05:00
Ishaan Bhardwaj
9f61b139fd TAP M-roll created 2020-11-12 16:52:40 -05:00
14 changed files with 110 additions and 37 deletions

View File

@@ -29,6 +29,7 @@ The following people in no particular order also helped with the project:
- [2Tie](https://github.com/2Tie)
- [nightmareci](https://github.com/nightmareci)
- [MyPasswordIsWeak](https://github.com/MyPasswordIsWeak)
- [Dr Ocelot](https://github.com/Dr-Ocelot)
![Cambridge Logo](https://cdn.discordapp.com/attachments/625496179433668635/763363717730664458/Icon_2.png)

View File

@@ -230,6 +230,15 @@ function Grid:checkForBravo(cleared_row_count)
return true
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()
local sgrade = 0
for i=23,5,-1 do
@@ -310,7 +319,32 @@ function Grid:draw()
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 x = 1, 10 do
if self.grid[y][x] ~= empty then
@@ -321,8 +355,9 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function)
else
opacity = opacity_function(self.grid_age[y][x])
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)
if lock_flash then
if opacity > 0 and self.grid[y][x].colour ~= "X" then
love.graphics.setColor(0.64, 0.64, 0.64)
love.graphics.setLineWidth(1)
@@ -343,5 +378,6 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function)
end
end
end
end
return Grid

View File

@@ -250,7 +250,7 @@ end
function MarathonA2Game:drawGrid(ruleset)
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
self.grid:draw()
if self.piece ~= nil and self.level < 100 then

View File

@@ -43,6 +43,8 @@ function GameMode:new()
self.draw_section_times = false
self.draw_secondary_section_times = false
self.big_mode = false
self.irs = true
self.ihs = true
self.rpc_details = "In game"
-- variables related to configurable parameters
self.drop_locked = false
@@ -105,7 +107,7 @@ function GameMode:update(inputs, ruleset)
self:whilePieceActive()
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.prev_inputs = inputs
return
@@ -277,6 +279,13 @@ function GameMode:processDelays(inputs, ruleset, drop_speed)
end
elseif self.are > 0 then
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
self:initializeOrHold(inputs, ruleset)
end
@@ -284,7 +293,7 @@ function GameMode:processDelays(inputs, ruleset, drop_speed)
end
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)
else
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,
self.prev_inputs, self.move,
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
self.drop_locked = true

View File

@@ -144,6 +144,7 @@ function Marathon2020Game:advanceOneFrame()
if self.roll_frames < 0 then
return false
elseif self.roll_frames > 4000 then
if self.grade >= 30 and self.section_cool_count >= 20 then self.grade = 31 end
self.completed = true
end
elseif self.ready_frames == 0 then
@@ -248,6 +249,7 @@ function Marathon2020Game:updateGrade(cleared_lines)
end
function Marathon2020Game:getTotalGrade()
if self.grade + self.section_cool_count > 50 then return "GM" end
return self.grade + self.section_cool_count
end
@@ -392,7 +394,6 @@ Marathon2020Game.mRollOpacityFunction = function(age)
end
function Marathon2020Game:qualifiesForMRoll()
return false -- until I actually have grading working
--[[
GM-roll requirements
@@ -403,6 +404,8 @@ You qualify for the GM roll if you:
- in less than 13:30.00 total.
]]--
return self.level >= 2020 and self:getTotalGrade() == 50 and self.frames <= frameTime(13,30)
end
function Marathon2020Game:drawGrid()

View File

@@ -310,12 +310,12 @@ MarathonA2Game.mRollOpacityFunction = function(age)
else return 1 - age / 4 end
end
function MarathonA2Game:drawGrid(ruleset)
function MarathonA2Game:drawGrid()
if self.clear and not (self.completed or self.game_over) then
if self:qualifiesForMRoll() then
self.grid:drawInvisible(self.mRollOpacityFunction)
self.grid:drawInvisible(self.mRollOpacityFunction, nil, false)
else
self.grid:drawInvisible(self.rollOpacityFunction)
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
end
else
self.grid:draw()

View File

@@ -231,8 +231,8 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
end
function MarathonA3Game:updateScore(level, drop_bonus, cleared_lines)
if not self.clear then
self:updateGrade(cleared_lines)
if not self.clear then
if cleared_lines > 0 then
self.combo = self.combo + (cleared_lines - 1) * 2
self.score = self.score + (

View File

@@ -139,7 +139,7 @@ end
function PhantomManiaGame:drawGrid()
if not (self.game_over or self.clear) then
self.grid:drawInvisible(self.rollOpacityFunction)
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
else
self.grid:draw()
end

View 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

View File

@@ -112,9 +112,9 @@ end
function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
else
return 3
end
end

View File

@@ -187,9 +187,9 @@ end
function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
else
return 3
end
end

View File

@@ -174,9 +174,9 @@ end
function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
else
return 3
end
end

View File

@@ -153,9 +153,9 @@ end
function ARS:get180RotationValue()
if config.gamesettings.world_reverse == 3 then
return 3
else
return 1
else
return 3
end
end

View File

@@ -21,6 +21,7 @@ Ruleset.softdrop_lock = true
Ruleset.harddrop_lock = false
Ruleset.enable_IRS_wallkicks = false
Ruleset.are_cancel = false
-- Component functions.
@@ -180,7 +181,7 @@ function Ruleset:getDefaultOrientation() return 1 end
function Ruleset:initializePiece(
inputs, data, grid, gravity, prev_inputs,
move, lock_delay, drop_speed,
drop_locked, hard_drop_locked, big
drop_locked, hard_drop_locked, big, irs
)
local spawn_positions
if big then
@@ -196,7 +197,7 @@ function Ruleset:initializePiece(
}, self.block_offsets, 0, 0, data.skin, colours[data.shape], big)
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)
return piece
end