mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-11-24 21:29:02 -06:00
Compare commits
2 Commits
588c5515a5
...
2818fcf50b
Author | SHA1 | Date | |
---|---|---|---|
|
2818fcf50b | ||
|
504e9f5bd4 |
@ -349,7 +349,7 @@ function LifeGrid:markSquares()
|
||||
elseif i == 2 then
|
||||
for j = 0, 3 do
|
||||
for k = 0, 3 do
|
||||
self.grid[y+j][x+k].colour = "F"
|
||||
self.grid[y+j][x+k].colour = "W"
|
||||
self.grid[y+j][x+k].skin = "square"
|
||||
end
|
||||
|
||||
|
@ -363,7 +363,7 @@ function StrategyGrid:markSquares()
|
||||
elseif i == 2 then
|
||||
for j = 0, 3 do
|
||||
for k = 0, 3 do
|
||||
self.grid[y+j][x+k].colour = "F"
|
||||
self.grid[y+j][x+k].colour = "W"
|
||||
self.grid[y+j][x+k].skin = "square"
|
||||
end
|
||||
|
||||
|
@ -57,7 +57,7 @@ end
|
||||
|
||||
function CreditsA3Game:onLineClear(cleared_row_count)
|
||||
if not self.clear then
|
||||
self.norm = self.norm + (cleared_row_count == 4 and 10 or cleared_row_count)
|
||||
self.norm = self.norm + cleared_row_count + (cleared_row_count >= 4 and 6 or 0)
|
||||
end
|
||||
end
|
||||
|
||||
@ -84,12 +84,14 @@ function CreditsA3Game:drawScoringInfo()
|
||||
strTrueValues(self.prev_inputs)
|
||||
)
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
love.graphics.printf("ROLLS COMPLETED", 240, 170, 120, "left")
|
||||
love.graphics.printf("TIME LEFT", 240, 250, 80, "left")
|
||||
love.graphics.printf("NORM", 240, 320, 40, "left")
|
||||
|
||||
self:drawSectionTimesWithSplits(self.section)
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
|
||||
love.graphics.printf(self.section, 240, 190, 160, "left")
|
||||
|
||||
-- draw time left, flash red if necessary
|
||||
local time_left = self.section_time_limit - math.max(self:getSectionTime(), 0)
|
||||
|
||||
@ -113,7 +115,7 @@ function CreditsA3Game:drawScoringInfo()
|
||||
end
|
||||
|
||||
function CreditsA3Game:getBackground()
|
||||
return self.section
|
||||
return self.section % 20
|
||||
end
|
||||
|
||||
return CreditsA3Game
|
@ -2033,7 +2033,7 @@ local function parseMap(str, map)
|
||||
elseif char == "Z" then
|
||||
insert_this = { skin = "2tie", colour = "R" }
|
||||
elseif char == "C" then
|
||||
insert_this = { skin = "gem", colour = "F" }
|
||||
insert_this = { skin = "gem", colour = "W" }
|
||||
end
|
||||
row_array[col] = insert_this
|
||||
end
|
||||
|
@ -93,8 +93,8 @@ end
|
||||
function Minesweeper:mainGameLoop(inputs)
|
||||
self:moveCursor(inputs)
|
||||
if not self.prev_inputs.rotate_left and inputs.rotate_left and
|
||||
self.grid.grid[self.cursor.y+4][self.cursor.x].colour ~= "F" and
|
||||
self.grid.grid[self.cursor.y+4][self.cursor.x].colour ~= "A" then
|
||||
self.grid.grid[self.cursor.y+4][self.cursor.x].colour ~= "W" and
|
||||
self.grid.grid[self.cursor.y+4][self.cursor.x].colour ~= "D" then
|
||||
playSE("lock")
|
||||
if not self:isMine(self.cursor.x, self.cursor.y) then
|
||||
self:uncoverCell(self.cursor.x, self.cursor.y)
|
||||
@ -114,7 +114,7 @@ function Minesweeper:updateFlagCount()
|
||||
local flags = math.floor(0.15 * width * height)
|
||||
for y = 5, height + 4 do
|
||||
for x = 1, width do
|
||||
if self.grid.grid[y][x].colour == "A" then
|
||||
if self.grid.grid[y][x].colour == "D" then
|
||||
flags = flags - 1
|
||||
end
|
||||
end
|
||||
@ -136,9 +136,9 @@ end
|
||||
|
||||
function Minesweeper:flagCell(x, y)
|
||||
if self.flags > 0 and self.grid.grid[y+4][x].skin == "2tie" and
|
||||
self.grid.grid[y+4][x].colour ~= "F" then
|
||||
self.grid.grid[y+4][x].colour ~= "W" then
|
||||
self.grid.grid[y+4][x] = {
|
||||
skin = "gem", colour = "A"
|
||||
skin = "gem", colour = "D"
|
||||
}
|
||||
elseif self.grid.grid[y+4][x].skin == "gem" then
|
||||
self.grid.grid[y+4][x] = {
|
||||
@ -165,7 +165,7 @@ function Minesweeper:uncoverCell(x, y)
|
||||
local x = current.x
|
||||
local y = current.y
|
||||
|
||||
self.grid.grid[y+4][x] = { skin = "2tie", colour = "F" }
|
||||
self.grid.grid[y+4][x] = { skin = "2tie", colour = "W" }
|
||||
|
||||
if self:getSurroundingMineCount(x, y) == 0 then
|
||||
for dy = -1, 1 do
|
||||
@ -173,7 +173,7 @@ function Minesweeper:uncoverCell(x, y)
|
||||
if not (dx == 0 and dy == 0) and
|
||||
x+dx >= 1 and x+dx <= width and
|
||||
y+dy >= 1 and y+dy <= height and
|
||||
self.grid.grid[y+4+dy][x+dx].colour ~= "F"
|
||||
self.grid.grid[y+4+dy][x+dx].colour ~= "W"
|
||||
then
|
||||
table.insert(stack, {
|
||||
x = x + dx,
|
||||
@ -187,7 +187,7 @@ function Minesweeper:uncoverCell(x, y)
|
||||
|
||||
for y = 5, height + 4 do
|
||||
for x = 1, width do
|
||||
if self.grid.grid[y][x].colour ~= "F" and
|
||||
if self.grid.grid[y][x].colour ~= "W" and
|
||||
not self:isMine(x, y-4) then
|
||||
return
|
||||
end
|
||||
@ -215,7 +215,7 @@ function Minesweeper:onGameOver()
|
||||
if self:isMine(x, y-4) then
|
||||
self.grid.grid[y][x] = { skin = "gem", colour = "R" }
|
||||
else
|
||||
self.grid.grid[y][x] = { skin = "2tie", colour = "F" }
|
||||
self.grid.grid[y][x] = { skin = "2tie", colour = "W" }
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -233,7 +233,7 @@ function Minesweeper:onGameComplete()
|
||||
end
|
||||
|
||||
local function opacityFunction(game, block, x, y, age)
|
||||
if block.colour == "F" then
|
||||
if block.colour == "W" then
|
||||
return 0.5, 0.5, 0.5, 1, 1
|
||||
else
|
||||
return 1, 1, 1, 1, 1
|
||||
@ -251,7 +251,7 @@ function Minesweeper:drawGrid()
|
||||
love.graphics.rectangle("line", 48+x*16, y*16, 16, 16)
|
||||
end
|
||||
if self:getSurroundingMineCount(x, y-4) ~= 0 and
|
||||
self.grid.grid[y][x].colour == "F" then
|
||||
self.grid.grid[y][x].colour == "W" then
|
||||
love.graphics.print(self:getSurroundingMineCount(x, y-4), 50+x*16, -2+y*16)
|
||||
end
|
||||
end
|
||||
|
@ -75,7 +75,7 @@ function SurvivalAXHGame:drawGrid()
|
||||
if self:getHiddenDelay() then
|
||||
for i = 1, self.hidden_rows do
|
||||
for j = 1, 10 do
|
||||
love.graphics.draw(blocks["2tie"]["F"], 48+j*16, (24-i+1)*16)
|
||||
love.graphics.draw(blocks["2tie"]["W"], 48+j*16, (24-i+1)*16)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -24,7 +24,7 @@ function SurvivalGTEGame:getGravity() return 20 end
|
||||
function SurvivalGTEGame:getARR() return 2 end
|
||||
|
||||
function SurvivalGTEGame:getDasLimit()
|
||||
return math.min(self:getLockDelay() - 2, 10)
|
||||
return math.min(math.floor(self:getLockDelay() * 2/3), 10)
|
||||
end
|
||||
|
||||
function SurvivalGTEGame:getLockDelay()
|
||||
@ -51,8 +51,8 @@ function SurvivalGTEGame:getLineClearDelay()
|
||||
end
|
||||
|
||||
function SurvivalGTEGame:onLineClear(cleared_row_count)
|
||||
self.lines = math.min(self.lines + cleared_row_count, 300)
|
||||
self.completed = self.lines == 300
|
||||
self.lines = self.lines + cleared_row_count
|
||||
self.completed = self.lines >= 300
|
||||
end
|
||||
|
||||
function SurvivalGTEGame:advanceOneFrame()
|
||||
|
@ -10,7 +10,7 @@ Cultris.colourscheme = {
|
||||
L = "M",
|
||||
J = "B",
|
||||
S = "C",
|
||||
Z = "F",
|
||||
Z = "W",
|
||||
O = "Y",
|
||||
T = "R",
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ EARS.name = "E.A.R.S."
|
||||
EARS.hash = "EARS"
|
||||
|
||||
EARS.colourscheme = {
|
||||
I = "F",
|
||||
I = "W",
|
||||
J = "G",
|
||||
L = "R",
|
||||
O = "C",
|
||||
|
@ -1,3 +1,5 @@
|
||||
-- thanks Adventium_ for heavily un-spaghetti-ing this code
|
||||
|
||||
local Ruleset = require 'tetris.rulesets.ruleset'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
|
||||
@ -28,7 +30,7 @@ function RandomPieces:generateBlockOffsets()
|
||||
offsets[i] = generated_offset
|
||||
end
|
||||
|
||||
return offsets
|
||||
return { { offsets, offsets, offsets, offsets } }
|
||||
end
|
||||
|
||||
RandomPieces.pieces = 1
|
||||
@ -46,69 +48,23 @@ RandomPieces.next_sounds = {
|
||||
}
|
||||
|
||||
RandomPieces.colourscheme = {
|
||||
"F"
|
||||
"W"
|
||||
}
|
||||
|
||||
RandomPieces.block_offsets = {
|
||||
{
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
{ {x=0, y=0} },
|
||||
}
|
||||
}
|
||||
|
||||
function RandomPieces:onPieceCreate(piece)
|
||||
local offsets = self:generateBlockOffsets()
|
||||
piece.getBlockOffsets = function()
|
||||
return offsets
|
||||
end
|
||||
piece.withOffset = function(self, offset)
|
||||
local piece = Piece(
|
||||
self.shape, self.rotation,
|
||||
{x = self.position.x + offset.x, y = self.position.y + offset.y},
|
||||
self.block_offsets, self.gravity, self.lock_delay, self.skin, self.colour, self.big
|
||||
)
|
||||
local offsets = self:getBlockOffsets()
|
||||
piece.getBlockOffsets = function()
|
||||
return offsets
|
||||
end
|
||||
piece.draw = function(self, opacity, brightness, grid, partial_das)
|
||||
if self.ghost then return false end
|
||||
if opacity == nil then opacity = 1 end
|
||||
if brightness == nil then brightness = 1 end
|
||||
love.graphics.setColor(brightness, brightness, brightness, opacity)
|
||||
local offsets = self:getBlockOffsets()
|
||||
local gravity_offset = 0
|
||||
if config.gamesettings.smooth_movement == 1 and
|
||||
grid ~= nil and not self:isDropBlocked(grid) then
|
||||
gravity_offset = self.gravity * 16
|
||||
end
|
||||
if partial_das == nil then partial_das = 0 end
|
||||
for index, offset in pairs(offsets) do
|
||||
local x = self.position.x + offset.x
|
||||
local y = self.position.y + offset.y
|
||||
if self.big then
|
||||
love.graphics.draw(
|
||||
blocks[self.skin][self.colour],
|
||||
64+x*32+partial_das*2, 16+y*32+gravity_offset*2,
|
||||
0, 2, 2
|
||||
)
|
||||
else
|
||||
love.graphics.draw(
|
||||
blocks[self.skin][self.colour],
|
||||
64+x*16+partial_das, 16+y*16+gravity_offset
|
||||
)
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
return piece
|
||||
end
|
||||
piece.block_offsets = RandomPieces.generateBlockOffsets()
|
||||
end
|
||||
|
||||
function RandomPieces:attemptRotate(new_inputs, piece, grid, initial)
|
||||
|
||||
if not (
|
||||
new_inputs.rotate_left or new_inputs.rotate_left2 or
|
||||
new_inputs.rotate_right or new_inputs.rotate_right2 or
|
||||
@ -116,23 +72,14 @@ function RandomPieces:attemptRotate(new_inputs, piece, grid, initial)
|
||||
) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local new_piece = piece:withOffset({x=0, y=0})
|
||||
local offsets = self:generateBlockOffsets()
|
||||
new_piece.getBlockOffsets = function()
|
||||
return offsets
|
||||
end
|
||||
|
||||
if (grid:canPlacePiece(new_piece)) then
|
||||
piece.getBlockOffsets = function()
|
||||
return offsets
|
||||
end
|
||||
new_piece.block_offsets = RandomPieces.generateBlockOffsets()
|
||||
|
||||
if (grid:canPlacePiece(new_piece)) then
|
||||
piece.block_offsets = new_piece.block_offsets
|
||||
self:onPieceRotate(piece, grid)
|
||||
else
|
||||
if not(initial and self.enable_IRS_wallkicks == false) then
|
||||
self:attemptWallkicks(piece, new_piece, offsets, grid)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function RandomPieces:onPieceDrop(piece) piece.lock_delay = 0 end
|
||||
|
@ -13,7 +13,7 @@ TheNew.colourscheme = {
|
||||
I = "C",
|
||||
J = "B",
|
||||
L = "M",
|
||||
O = "F",
|
||||
O = "W",
|
||||
S = "G",
|
||||
Z = "R",
|
||||
T = "Y"
|
||||
|
@ -9,7 +9,7 @@ TOD.colourscheme = {
|
||||
I = "C",
|
||||
J = "B",
|
||||
L = "M",
|
||||
O = "F",
|
||||
O = "W",
|
||||
S = "G",
|
||||
Z = "R",
|
||||
T = "Y"
|
||||
|
Loading…
Reference in New Issue
Block a user