Skin refactor update

This commit is contained in:
Ishaan Bhardwaj 2021-01-06 22:55:43 -05:00
parent 8cf4328264
commit 8d94f35104
4 changed files with 51 additions and 9 deletions

View File

@ -104,12 +104,8 @@ function SurvivalCKGame:getRegretTime()
else return frameTime(0,30) end
end
function SurvivalCKGame:getNextPiece(ruleset)
return {
skin = self.level >= 2000 and "bone" or "2tie",
shape = self.randomizer:nextPiece(),
orientation = ruleset:getDefaultOrientation(),
}
function SurvivalCKGame:getSkin()
return self.level >= 2000 and "bone" or "2tie"
end
local torikan_times = {300, 330, 360, 390, 420, 450, 478, 504, 528, 550, 570}

View File

@ -7,6 +7,8 @@ local DTETRandomizer = require 'tetris.randomizers.dtet'
local JokerGame = GameMode:extend()
local rush = false
JokerGame.name = "Final J"
JokerGame.hash = "Joker"
JokerGame.tagline = "One of the hardest modes! Can you retain your stock to level 300?"
@ -33,7 +35,10 @@ end
function JokerGame:getLineARE() return self:getARE() end
function JokerGame:getDasLimit() return 6 end
function JokerGame:getARR() return math.min(1, config.arr) end
function JokerGame:getARR()
return rush and 0 or 1
end
function JokerGame:getLineClearDelay()
if self.level < 200 then return math.ceil(6 - (self.level - 50) / 50)
@ -47,10 +52,14 @@ end
function JokerGame:getGravity() return 20 end
function JokerGame:advanceOneFrame()
function JokerGame:advanceOneFrame(inputs, ruleset)
if self.ready_frames == 0 then
self.frames = self.frames + 1
self.time_limit = self.time_limit - 1
else
if not self.prev_inputs.hold and inputs.hold then
rush = not rush
end
end
if self.time_limit <= 0 then self.game_over = true end
return true
@ -100,6 +109,12 @@ function JokerGame:drawScoringInfo()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(self.level, 240, 220, 90, "left")
love.graphics.printf(math.max(self.stock, 0), 240, 300, 90, "left")
if (self.ready_frames ~= 0) then
love.graphics.printf(
"RUSH: " .. (rush and "ON" or "OFF"),
64, 110, 160, "center"
)
end
love.graphics.setFont(font_8x11)
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")

View File

@ -3,7 +3,8 @@ local Randomizer = require 'tetris.randomizers.randomizer'
local HistoryRandomizer = Randomizer:extend()
function HistoryRandomizer:new(history_length, rolls, allowed_pieces)
self.history = {}
self.super:new()
self.history = {}
for i = 1, history_length do
table.insert(self.history, '')
end

View File

@ -79,6 +79,36 @@ DTET.block_offsets = {
DTET.wallkicks_cw = {{x=1, y=0}, {x=-1, y=0}, {x=0, y=1}, {x=1, y=1}, {x=-1, y=1}}
DTET.wallkicks_ccw = {{x=-1, y=0}, {x=1, y=0}, {x=0, y=1}, {x=-1, y=1}, {x=1, y=1}}
function DTET:attemptRotate(new_inputs, piece, grid, initial)
local rot_dir = 0
if (new_inputs["rotate_180"]) or
(new_inputs["rotate_left"] and new_inputs["rotate_right"]) or
(new_inputs["rotate_left2"] and new_inputs["rotate_right2"]) then
rot_dir = self:get180RotationValue()
elseif (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
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)
if (grid:canPlacePiece(new_piece)) then
piece:setRelativeRotation(rot_dir)
self:onPieceRotate(piece, grid)
else
if not(initial and self.enable_IRS_wallkicks == false) then
self:attemptWallkicks(piece, new_piece, rot_dir, grid)
end
end
end
function DTET:attemptWallkicks(piece, new_piece, rot_dir, grid)
local kicks