mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2025-04-19 18:22:56 -05:00
Merge c65bd78653
into 7273c473b6
This commit is contained in:
commit
588db12445
@ -8,8 +8,8 @@ DualityA1Game.name = "Duality A1"
|
||||
DualityA1Game.hash = "DualityA1"
|
||||
DualityA1Game.tagline = "Control two boards at once!"
|
||||
|
||||
function DualityA1Game:new()
|
||||
DualityA1Game.super:new()
|
||||
function DualityA1Game:new(_, c)
|
||||
DualityA1Game.super:new(_, c)
|
||||
self.randomizer = SplitHistoryRandomizer()
|
||||
self.other_grid = Grid(10, 24)
|
||||
self.next_queue_length = 2
|
||||
|
@ -6,8 +6,8 @@ InversionGame.name = "Inversion A2N"
|
||||
InversionGame.hash = "InversionA2N"
|
||||
InversionGame.tagline = "What if the active piece was invisible?"
|
||||
|
||||
function InversionGame:new()
|
||||
SurvivalA2Game:new()
|
||||
function InversionGame:new(_, c)
|
||||
SurvivalA2Game:new(_,c)
|
||||
self.piece_active_time = 0
|
||||
end
|
||||
|
||||
|
@ -47,8 +47,10 @@ local slots_table = {
|
||||
local slot_popup = {["text"]="",["time"]=0,["slotnum"]=0}
|
||||
local line_popup = {["y"]=0,["score"]=0,["lines"]=0}
|
||||
|
||||
function MarathonC99Game:new()
|
||||
self.super:new()
|
||||
function MarathonC99Game:new(_, cfg)
|
||||
if cfg == nil then cfg = {} end -- Don't break older Cambridge versions
|
||||
|
||||
self.super:new(_, cfg)
|
||||
self.grid = Grid(10, 22)
|
||||
self.slots_random = love.math.newRandomGenerator(os.time())
|
||||
|
||||
@ -60,10 +62,11 @@ function MarathonC99Game:new()
|
||||
self.tetris_slots = 0
|
||||
self.ccw_bonus = 10 ^ 7
|
||||
slot_popup = {["text"]="",["time"]=0}
|
||||
self.irs = false
|
||||
self.enable_hard_drop = false
|
||||
self.irs = cfg.irs == 2
|
||||
self.enable_hard_drop = cfg.hardDrop == 2
|
||||
self.lock_drop = false
|
||||
self.next_queue_length = 1
|
||||
self.next_queue_length = cfg.nextQueue == 2 and 3 or 1
|
||||
self.enable_hold = cfg.hold == 2
|
||||
end
|
||||
|
||||
function MarathonC99Game:getARE()
|
||||
@ -165,10 +168,11 @@ function MarathonC99Game:advanceOneFrame(inputs, ruleset)
|
||||
self.frames = self.frames + 1
|
||||
end
|
||||
if self.piece ~= nil then
|
||||
local lo = self.piece.last_orientation or self.piece.rotation
|
||||
if not (
|
||||
self.piece.rotation - self.piece.last_orientation == -1 or -- 3 >> 2, 2 >> 1, 1 >> 0
|
||||
self.piece.rotation - self.piece.last_orientation == 3 or -- 0 >> 3
|
||||
self.piece.rotation - self.piece.last_orientation == 0 -- not rotated
|
||||
self.piece.rotation - lo == -1 or -- 3 >> 2, 2 >> 1, 1 >> 0
|
||||
self.piece.rotation - lo == 3 or -- 0 >> 3
|
||||
self.piece.rotation - lo == 0 -- not rotated
|
||||
) then
|
||||
self.ccw_bonus = 0
|
||||
end
|
||||
@ -272,6 +276,9 @@ function MarathonC99Game:drawGrid()
|
||||
love.graphics.printf(line_popup.score,40,line_popup.y-1,200,"center")
|
||||
end
|
||||
self.grid:draw()
|
||||
if self.piece ~= nil and self.config.ghostPiece == 2 then
|
||||
self:drawGhostPiece(ruleset)
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonC99Game:drawScoringInfo()
|
||||
@ -372,4 +379,14 @@ function MarathonC99Game:getHighscoreData()
|
||||
}
|
||||
end
|
||||
|
||||
function MarathonC99Game:provideSettings()
|
||||
return {
|
||||
{"hardDrop", "Hard Drop", {"Off", "On"}},
|
||||
{"irs", "IRS", {"Off", "On"}},
|
||||
{"nextQueue", "Next pieces", {"One", "Three"}},
|
||||
{"hold", "Hold", {"Off", "On"}},
|
||||
{"ghostPiece", "Ghost piece", {"Off", "On"}}
|
||||
}
|
||||
end
|
||||
|
||||
return MarathonC99Game
|
@ -6,8 +6,8 @@ SurvivalA2NGame.name = "Survival A2N"
|
||||
SurvivalA2NGame.hash = "SurvivalA2N"
|
||||
SurvivalA2NGame.tagline = "A variation of Survival A2 for Carnival of Derp."
|
||||
|
||||
function SurvivalA2NGame:new()
|
||||
self.super:new()
|
||||
function SurvivalA2NGame:new(_, c)
|
||||
self.super:new(_, c)
|
||||
self.next_queue_length = 3
|
||||
self.enable_hold = true
|
||||
end
|
||||
|
55
tetris/rulesets/prs.lua
Normal file
55
tetris/rulesets/prs.lua
Normal file
@ -0,0 +1,55 @@
|
||||
local SRS = require 'tetris.rulesets.standard'
|
||||
|
||||
local PRS = SRS:extend()
|
||||
|
||||
PRS.name = "Permissive Rotation System"
|
||||
PRS.hash = "PRS"
|
||||
PRS.world = true
|
||||
|
||||
function PRS:attemptRotate(new_inputs, piece, grid, initial)
|
||||
local rot_dir = 0
|
||||
|
||||
if (new_inputs["rotate_left"] or new_inputs["rotate_left2"]) then
|
||||
rot_dir = 3
|
||||
elseif (new_inputs["rotate_right"] or new_inputs["rotate_right2"]) then
|
||||
rot_dir = 1
|
||||
elseif (new_inputs["rotate_180"]) then
|
||||
rot_dir = self:get180RotationValue()
|
||||
end
|
||||
|
||||
if rot_dir == 0 then return end
|
||||
|
||||
if config.gamesettings.world_reverse == 3 or (self.world and config.gamesettings.world_reverse == 2) then
|
||||
rot_dir = 4 - rot_dir
|
||||
end
|
||||
|
||||
local new_piece = piece:withRelativeRotation(rot_dir)
|
||||
self:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||
end
|
||||
|
||||
function PRS:attemptWallkicks(piece, newpiece, rot_dir, grid)
|
||||
for y=0,5 do
|
||||
for x=0,5 do
|
||||
local offset = {x=x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
for x=0,5 do
|
||||
local offset = {x=-x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return PRS
|
56
tetris/rulesets/sprs.lua
Normal file
56
tetris/rulesets/sprs.lua
Normal file
@ -0,0 +1,56 @@
|
||||
local PRS = require 'tetris.rulesets.prs'
|
||||
|
||||
local SPRS = PRS:extend()
|
||||
|
||||
SPRS.name = "Super P.R.S"
|
||||
SPRS.hash = "SuperPRS"
|
||||
SPRS.world = true
|
||||
|
||||
function SPRS:attemptWallkicks(piece, newpiece, rot_dir, grid)
|
||||
for y=0,5 do
|
||||
for x=0,5 do
|
||||
local offset = {x=x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
for x=0,5 do
|
||||
local offset = {x=-x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
for y=0,-5,-1 do
|
||||
for x=0,5 do
|
||||
local offset = {x=x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
for x=0,5 do
|
||||
local offset = {x=-x, y=y}
|
||||
kicked_piece = newpiece:withOffset(offset)
|
||||
if grid:canPlacePiece(kicked_piece) then
|
||||
piece:setRelativeRotation(rot_dir)
|
||||
piece:setOffset(offset)
|
||||
self:onPieceRotate(piece, grid)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return SPRS
|
Loading…
Reference in New Issue
Block a user