mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2025-05-13 20:21:24 -05:00
LARGE update to the modpack for upcoming beta5.1
This commit is contained in:
142
tetris/modes/baboo.lua
Normal file
142
tetris/modes/baboo.lua
Normal file
@@ -0,0 +1,142 @@
|
||||
local GameMode = require 'tetris.modes.gamemode'
|
||||
|
||||
local MarathonWBGame = GameMode:extend()
|
||||
|
||||
MarathonWBGame.name = "Marathon WB"
|
||||
MarathonWBGame.hash = "MarathonWB"
|
||||
MarathonWBGame.tagline = "What can you do with 300 keystrokes?"
|
||||
|
||||
function MarathonWBGame:new()
|
||||
GameMode:new()
|
||||
|
||||
self.lock_drop = true
|
||||
self.lock_hard_drop = true
|
||||
self.instant_hard_drop = true
|
||||
self.instant_soft_drop = false
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 6
|
||||
|
||||
self.keystrokes = 0
|
||||
self.pieces = 0
|
||||
self.b2b = false
|
||||
self.immobile_spin_bonus = true
|
||||
|
||||
self.message = ""
|
||||
self.message_timer = 0
|
||||
end
|
||||
|
||||
function MarathonWBGame:getARE() return 0 end
|
||||
function MarathonWBGame:getLineARE() return 0 end
|
||||
function MarathonWBGame:getLineClearDelay() return 0 end
|
||||
function MarathonWBGame:getDasLimit() return config.das end
|
||||
function MarathonWBGame:getARR() return config.arr end
|
||||
function MarathonWBGame:getDasCutDelay() return config.dcd end
|
||||
function MarathonWBGame:getGravity() return 0 end
|
||||
|
||||
function MarathonWBGame:onSoftDrop(dropped_row_count)
|
||||
self.score = self.score + dropped_row_count
|
||||
end
|
||||
|
||||
function MarathonWBGame:onHardDrop(dropped_row_count)
|
||||
self.score = self.score + 2 * dropped_row_count
|
||||
end
|
||||
|
||||
function MarathonWBGame:onPieceLock(piece, cleared_row_count)
|
||||
playSE("lock")
|
||||
self.pieces = self.pieces + 1
|
||||
if piece.spin then
|
||||
self.score = self.score + (
|
||||
500 * cleared_row_count +
|
||||
(self.b2b and cleared_row_count > 0 and 200 or 0)
|
||||
)
|
||||
self.message = (
|
||||
((self.b2b and cleared_row_count > 0) and "B2B " or "") ..
|
||||
(type(piece.shape) == "string" and piece.shape .. "-" or "") ..
|
||||
"SPIN " .. cleared_row_count .. "!"
|
||||
)
|
||||
if cleared_row_count > 0 then self.b2b = true end
|
||||
elseif cleared_row_count > 0 then
|
||||
local score_table = {100, 400, 700, 1200}
|
||||
self.score = self.score + (
|
||||
score_table[math.min(cleared_row_count, 4)] +
|
||||
(self.b2b and cleared_row_count >= 4 and 200 or 0)
|
||||
)
|
||||
self.message = cleared_row_count >= 4 and (
|
||||
(self.b2b and "B2B " or "") ..
|
||||
string.upper(string.sub(
|
||||
number_names[cleared_row_count * 3 + 3], 1, -7
|
||||
)) .. "A!"
|
||||
) or ""
|
||||
self.b2b = cleared_row_count >= 4
|
||||
else
|
||||
self.message = ""
|
||||
end
|
||||
self.message_timer = 60
|
||||
end
|
||||
|
||||
function MarathonWBGame:advanceOneFrame(inputs, ruleset)
|
||||
if self.ready_frames == 0 then
|
||||
self.frames = self.frames + 1
|
||||
for input, value in pairs(inputs) do
|
||||
if value and not self.prev_inputs[input] then
|
||||
self.keystrokes = self.keystrokes + 1
|
||||
self.game_over = self.keystrokes >= 300
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function MarathonWBGame:drawGrid()
|
||||
self.grid:draw()
|
||||
self:drawGhostPiece()
|
||||
end
|
||||
|
||||
function MarathonWBGame:drawScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
|
||||
if config["side_next"] then
|
||||
love.graphics.printf("NEXT", 240, 72, 40, "left")
|
||||
else
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
end
|
||||
|
||||
love.graphics.print(
|
||||
self.das.direction .. " " ..
|
||||
self.das.frames .. " " ..
|
||||
strTrueValues(self.prev_inputs)
|
||||
)
|
||||
|
||||
love.graphics.print("SCORE", 240, 140)
|
||||
love.graphics.print("KEYSTROKES", 240, 200)
|
||||
love.graphics.print("keys/piece", 240, 270)
|
||||
|
||||
if self.message_timer > 0 then
|
||||
love.graphics.printf(self.message, 64, 400, 160, "center")
|
||||
self.message_timer = self.message_timer - 1
|
||||
end
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
love.graphics.print(self.score, 240, 160)
|
||||
love.graphics.print(
|
||||
string.format("%.04f", self.keystrokes / math.max(self.pieces, 1)),
|
||||
240, 290
|
||||
)
|
||||
love.graphics.print("B2B " .. tostring(self.b2b), 240, 330)
|
||||
|
||||
love.graphics.setFont(font_8x11)
|
||||
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")
|
||||
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.print(math.max(300 - self.keystrokes, 0), 240, 220)
|
||||
|
||||
end
|
||||
|
||||
function MarathonWBGame:getHighscoreData()
|
||||
return {
|
||||
score = self.score
|
||||
}
|
||||
end
|
||||
|
||||
return MarathonWBGame
|
||||
149
tetris/modes/combo_challenge.lua
Normal file
149
tetris/modes/combo_challenge.lua
Normal file
@@ -0,0 +1,149 @@
|
||||
local GameMode = require 'tetris.modes.gamemode'
|
||||
local Grid = require 'tetris.components.grid'
|
||||
local BagRandomizer = require 'tetris.randomizers.bag7'
|
||||
|
||||
local ComboChallenge = GameMode:extend()
|
||||
|
||||
ComboChallenge.name = "Combo Challenge"
|
||||
ComboChallenge.hash = "ComboChallenge"
|
||||
ComboChallenge.tagline = "Make the highest combo you can in 30 seconds!"
|
||||
|
||||
local blk = { skin = "2tie", colour = "A" }
|
||||
|
||||
local maps = {
|
||||
[1] = {
|
||||
[23] = {blk, blk, nil, nil},
|
||||
[24] = {blk, nil, nil, nil},
|
||||
},
|
||||
[2] = {
|
||||
[23] = {blk, nil, nil, nil},
|
||||
[24] = {blk, blk, nil, nil},
|
||||
},
|
||||
[3] = {
|
||||
[23] = {nil, nil, blk, blk},
|
||||
[24] = {nil, nil, nil, blk},
|
||||
},
|
||||
[4] = {
|
||||
[23] = {nil, nil, nil, blk},
|
||||
[24] = {nil, nil, blk, blk},
|
||||
},
|
||||
[5] = {
|
||||
[24] = {blk, blk, blk, nil},
|
||||
},
|
||||
[6] = {
|
||||
[24] = {nil, blk, blk, blk},
|
||||
}
|
||||
}
|
||||
|
||||
function ComboChallenge:new()
|
||||
GameMode:new()
|
||||
self.grid = Grid(4, 24)
|
||||
self.grid:applyMap(maps[math.random(#maps)])
|
||||
self.lock_drop = true
|
||||
self.lock_hard_drop = true
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 6
|
||||
self.rta = 0
|
||||
self.combo = 0
|
||||
self.max_combo = 0
|
||||
self.skips = 2
|
||||
end
|
||||
|
||||
function ComboChallenge:getARR() return config.arr end
|
||||
function ComboChallenge:getARE() return 6 end
|
||||
function ComboChallenge:getLineARE() return 6 end
|
||||
function ComboChallenge:getLineClearDelay() return 12 end
|
||||
function ComboChallenge:getDasLimit() return config.das end
|
||||
function ComboChallenge:getDasCutDelay() return config.dcd end
|
||||
|
||||
-- skip instead of hold
|
||||
function ComboChallenge:hold(inputs, ruleset, ihs)
|
||||
if self.skips <= 0 then return end
|
||||
|
||||
-- special ihs case
|
||||
if ihs then
|
||||
table.remove(self.next_queue, 1)
|
||||
table.insert(self.next_queue, self:getNextPiece(ruleset))
|
||||
end
|
||||
|
||||
-- skip
|
||||
self:initializeNextPiece(inputs, ruleset, table.remove(self.next_queue, 1), false)
|
||||
table.insert(self.next_queue, self:getNextPiece(ruleset))
|
||||
self.skips = self.skips - 1
|
||||
|
||||
if ihs then playSE("ihs")
|
||||
else playSE("hold") end
|
||||
self:onHold()
|
||||
end
|
||||
|
||||
function ComboChallenge:advanceOneFrame()
|
||||
if self.ready_frames == 0 then
|
||||
self.rta = self.rta + 1
|
||||
if self.are == 0 then
|
||||
self.frames = self.frames + 1
|
||||
if self.frames >= frameTime(0,30) then
|
||||
self.game_over = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ComboChallenge:onPieceLock(piece, cleared_row_count)
|
||||
playSE("lock")
|
||||
self.skips = math.min(self.skips + 1, 2)
|
||||
if cleared_row_count > 0 then
|
||||
self.combo = self.combo + 1
|
||||
self.max_combo = math.max(self.combo, self.max_combo)
|
||||
else
|
||||
self.combo = 0
|
||||
end
|
||||
end
|
||||
|
||||
function ComboChallenge:drawGrid()
|
||||
self.grid:draw()
|
||||
self:drawGhostPiece()
|
||||
end
|
||||
|
||||
function ComboChallenge:getHighscoreData()
|
||||
return {
|
||||
combo = self.max_combo
|
||||
}
|
||||
end
|
||||
|
||||
function ComboChallenge:drawScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
|
||||
if config["side_next"] then
|
||||
love.graphics.printf("NEXT", 240, 72, 40, "left")
|
||||
else
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
end
|
||||
|
||||
love.graphics.print(
|
||||
self.das.direction .. " " ..
|
||||
self.das.frames .. " " ..
|
||||
strTrueValues(self.prev_inputs) ..
|
||||
self.drop_bonus
|
||||
)
|
||||
|
||||
love.graphics.print("SKIPS", 200, 120)
|
||||
love.graphics.print("MAX COMBO", 200, 200)
|
||||
love.graphics.print("COMBO", 200, 280)
|
||||
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.print(self.skips, 200, 140)
|
||||
love.graphics.print(self.max_combo, 200, 220)
|
||||
love.graphics.print(self.combo, 200, 300)
|
||||
|
||||
love.graphics.setFont(font_8x11)
|
||||
love.graphics.setColor(
|
||||
(
|
||||
self.frames >= frameTime(0,20) and self.rta % 4 < 2 and not self.game_over
|
||||
) and {1, 0.3, 0.3, 1} or {1, 1, 1, 1}
|
||||
)
|
||||
love.graphics.printf(formatTime(frameTime(0,30) - self.frames), 64, 420, 160, "center")
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
end
|
||||
|
||||
return ComboChallenge
|
||||
149
tetris/modes/lj.lua
Normal file
149
tetris/modes/lj.lua
Normal file
@@ -0,0 +1,149 @@
|
||||
local GameMode = require 'tetris.modes.gamemode'
|
||||
|
||||
local MarathonWLJGame = GameMode:extend()
|
||||
|
||||
MarathonWLJGame.name = "Marathon WLJ"
|
||||
MarathonWLJGame.hash = "MarathonWLJ"
|
||||
MarathonWLJGame.tagline = "A simple marathon mode, originating from Lockjaw."
|
||||
|
||||
function MarathonWLJGame:new()
|
||||
GameMode:new()
|
||||
|
||||
self.lock_drop = true
|
||||
self.lock_hard_drop = true
|
||||
self.instant_hard_drop = true
|
||||
self.instant_soft_drop = false
|
||||
self.enable_hold = true
|
||||
self.next_queue_length = 6
|
||||
|
||||
self.pieces = 0
|
||||
self.b2b = false
|
||||
self.immobile_spin_bonus = true
|
||||
|
||||
self.message = ""
|
||||
self.message_timer = 0
|
||||
end
|
||||
|
||||
function MarathonWLJGame:getARE() return 6 end
|
||||
function MarathonWLJGame:getLineARE() return 6 end
|
||||
function MarathonWLJGame:getLineClearDelay() return 24 end
|
||||
function MarathonWLJGame:getDasLimit() return config.das end
|
||||
function MarathonWLJGame:getARR() return config.arr end
|
||||
function MarathonWLJGame:getDasCutDelay() return config.dcd end
|
||||
|
||||
function MarathonWLJGame:getGravity()
|
||||
if self.pieces < 609 then
|
||||
return (1/60) * (259/256) ^ self.pieces
|
||||
else
|
||||
return 20
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonWLJGame:getLockDelay()
|
||||
if self.pieces >= 609 then
|
||||
return math.ceil(40 / (1 + (3/256) * (self.pieces - 609)))
|
||||
else
|
||||
return 40
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonWLJGame:onSoftDrop(dropped_row_count)
|
||||
self.score = self.score + dropped_row_count
|
||||
end
|
||||
|
||||
function MarathonWLJGame:onHardDrop(dropped_row_count)
|
||||
self.score = self.score + 2 * dropped_row_count
|
||||
end
|
||||
|
||||
function MarathonWLJGame:onPieceLock(piece, cleared_row_count)
|
||||
playSE("lock")
|
||||
self.pieces = self.pieces + 1
|
||||
self.lines = self.lines + cleared_row_count
|
||||
if piece.spin then
|
||||
self.score = self.score + (
|
||||
500 * cleared_row_count +
|
||||
(self.b2b and cleared_row_count > 0 and 200 or 0)
|
||||
)
|
||||
self.message = (
|
||||
((self.b2b and cleared_row_count > 0) and "B2B " or "") ..
|
||||
(type(piece.shape) == "string" and piece.shape .. "-" or "") ..
|
||||
"SPIN " .. cleared_row_count .. "!"
|
||||
)
|
||||
if cleared_row_count > 0 then self.b2b = true end
|
||||
elseif cleared_row_count > 0 then
|
||||
local score_table = {100, 400, 700, 1200}
|
||||
self.score = self.score + (
|
||||
score_table[math.min(cleared_row_count, 4)] +
|
||||
(self.b2b and cleared_row_count >= 4 and 200 or 0)
|
||||
)
|
||||
self.message = cleared_row_count >= 4 and (
|
||||
(self.b2b and "B2B " or "") ..
|
||||
string.upper(string.sub(
|
||||
number_names[cleared_row_count * 3 + 3], 1, -7
|
||||
)) .. "A!"
|
||||
) or ""
|
||||
self.b2b = cleared_row_count >= 4
|
||||
else
|
||||
self.message = ""
|
||||
end
|
||||
self.message_timer = 60
|
||||
end
|
||||
|
||||
function MarathonWLJGame:advanceOneFrame()
|
||||
if self.ready_frames == 0 then
|
||||
self.frames = self.frames + 1
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function MarathonWLJGame:drawGrid()
|
||||
self.grid:draw()
|
||||
self:drawGhostPiece()
|
||||
end
|
||||
|
||||
function MarathonWLJGame:getHighscoreData()
|
||||
return {
|
||||
score = self.score,
|
||||
pieces = self.pieces,
|
||||
frames = self.frames,
|
||||
}
|
||||
end
|
||||
|
||||
function MarathonWLJGame:getSectionEndLevel()
|
||||
return math.floor(self.pieces / 30 + 1) * 30
|
||||
end
|
||||
|
||||
function MarathonWLJGame:getBackground()
|
||||
return math.floor(self.pieces / 30) % 20
|
||||
end
|
||||
|
||||
function MarathonWLJGame:drawScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
love.graphics.print(
|
||||
self.das.direction .. " " ..
|
||||
self.das.frames .. " " ..
|
||||
strTrueValues(self.prev_inputs)
|
||||
)
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
love.graphics.printf("LINES", 240, 120, 40, "left")
|
||||
love.graphics.printf("SCORE", 240, 200, 40, "left")
|
||||
love.graphics.printf("LEVEL", 240, 320, 40, "left")
|
||||
|
||||
if self.message_timer > 0 then
|
||||
love.graphics.printf(self.message, 64, 400, 160, "center")
|
||||
self.message_timer = self.message_timer - 1
|
||||
end
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
love.graphics.printf(self.lines, 240, 140, 90, "left")
|
||||
love.graphics.printf(self.score, 240, 220, 90, "left")
|
||||
love.graphics.printf(self.pieces, 240, 340, 50, "right")
|
||||
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 50, "right")
|
||||
|
||||
love.graphics.setFont(font_8x11)
|
||||
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")
|
||||
end
|
||||
|
||||
return MarathonWLJGame
|
||||
264
tetris/modes/nes-tgm.lua
Normal file
264
tetris/modes/nes-tgm.lua
Normal file
@@ -0,0 +1,264 @@
|
||||
local GameMode = require 'tetris.modes.gamemode'
|
||||
local NESRandomizer = require 'tetris.randomizers.nes'
|
||||
|
||||
local NESTGMMode = GameMode:extend()
|
||||
|
||||
NESTGMMode.name = "NES-TGM"
|
||||
NESTGMMode.hash = "NESTGM"
|
||||
NESTGMMode.tagline = "An arcade-styled mode with roots in retro!"
|
||||
|
||||
function NESTGMMode:new()
|
||||
GameMode:new()
|
||||
self.quad_clears = {[0] = 0, 0}
|
||||
self.roll_frames = 0
|
||||
|
||||
self.randomizer = NESRandomizer()
|
||||
|
||||
self.ready_frames = 1
|
||||
self.waiting_frames = 96
|
||||
|
||||
self.last_row = 1
|
||||
|
||||
self.lock_drop = true
|
||||
self.enable_hard_drop = false
|
||||
self.enable_hold = false
|
||||
self.next_queue_length = 1
|
||||
self.additive_gravity = false
|
||||
self.classic_lock = true
|
||||
|
||||
self.irs = false
|
||||
end
|
||||
|
||||
function NESTGMMode:getDropSpeed() return 1/2 end
|
||||
function NESTGMMode:getDasLimit() return 16 end
|
||||
function NESTGMMode:getARR() return 6 end
|
||||
|
||||
function NESTGMMode:getARE()
|
||||
if self.last_row > 22 then return 10
|
||||
elseif self.last_row > 18 then return 12
|
||||
elseif self.last_row > 14 then return 14
|
||||
elseif self.last_row > 10 then return 16
|
||||
else return 18 end
|
||||
end
|
||||
|
||||
function NESTGMMode:getLineARE() return self:getARE() end
|
||||
|
||||
function NESTGMMode:getLineClearDelay()
|
||||
for i = 17, 20 do
|
||||
if (self.frames + i) % 4 == 0 then return i end
|
||||
end
|
||||
end
|
||||
|
||||
function NESTGMMode:getLockDelay() return 0 end
|
||||
|
||||
function NESTGMMode:chargeDAS(inputs)
|
||||
if inputs[self.das.direction] == true and
|
||||
self.prev_inputs[self.das.direction] == true and
|
||||
not inputs["down"] and
|
||||
self.piece ~= nil
|
||||
then
|
||||
local das_frames = self.das.frames + 1
|
||||
if das_frames >= self:getDasLimit() then
|
||||
if self.das.direction == "left" then
|
||||
self.move = (self:getARR() == 0 and "speed" or "") .. "left"
|
||||
self.das.frames = self:getDasLimit() - self:getARR()
|
||||
elseif self.das.direction == "right" then
|
||||
self.move = (self:getARR() == 0 and "speed" or "") .. "right"
|
||||
self.das.frames = self:getDasLimit() - self:getARR()
|
||||
end
|
||||
else
|
||||
self.move = "none"
|
||||
self.das.frames = das_frames
|
||||
end
|
||||
elseif inputs["right"] == true then
|
||||
self.das.direction = "right"
|
||||
if not inputs["down"] and self.piece ~= nil then
|
||||
self.move = "right"
|
||||
self.das.frames = 0
|
||||
else
|
||||
self.move = "none"
|
||||
end
|
||||
elseif inputs["left"] == true then
|
||||
self.das.direction = "left"
|
||||
if not inputs["down"] and self.piece ~= nil then
|
||||
self.move = "left"
|
||||
self.das.frames = 0
|
||||
else
|
||||
self.move = "none"
|
||||
end
|
||||
else
|
||||
self.move = "none"
|
||||
end
|
||||
|
||||
if self.das.direction == "left" and self.piece ~= nil and self.piece:isMoveBlocked(self.grid, {x=-1, y=0}) or
|
||||
self.das.direction == "right" and self.piece ~= nil and self.piece:isMoveBlocked(self.grid, {x=1, y=0})
|
||||
then
|
||||
self.das.frames = self:getDasLimit()
|
||||
end
|
||||
|
||||
if inputs["down"] == false and self.prev_inputs["down"] == true then
|
||||
self.drop_bonus = 0
|
||||
end
|
||||
|
||||
if inputs["down"] then self.waiting_frames = 0 end
|
||||
end
|
||||
|
||||
function NESTGMMode:getLevelForLines()
|
||||
if self.lines < 10 then return math.floor(self.lines / 5)
|
||||
elseif self.lines < 150 then return math.floor(self.lines / 10) + 1
|
||||
elseif self.lines < 300 then return math.floor(self.lines / 50) + 13
|
||||
else return 19 end
|
||||
end
|
||||
|
||||
local gravity_table = {
|
||||
[0] = 1/48, 1/43, 1/38, 1/33, 1/28,
|
||||
1/23, 1/48, 1/28, 1/13, 1/8, 1/6,
|
||||
1/5, 1/4, 1/4, 1/5, 1/5, 1/3, 1/3,
|
||||
1/3, 1/2
|
||||
}
|
||||
|
||||
function NESTGMMode:getGravity()
|
||||
if self.waiting_frames > 0 then return 0 end
|
||||
return gravity_table[self:getLevelForLines()]
|
||||
end
|
||||
|
||||
function NESTGMMode:advanceOneFrame()
|
||||
if self.waiting_frames > 0 then
|
||||
self.waiting_frames = self.waiting_frames - 1
|
||||
elseif self:getLevelForLines() >= 19 then
|
||||
self.roll_frames = self.roll_frames + 1
|
||||
if self.roll_frames >= 3600 then
|
||||
self.completed = true
|
||||
end
|
||||
else
|
||||
self.frames = self.frames + 1
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function NESTGMMode:onPieceLock()
|
||||
self.super:onPieceLock()
|
||||
self.score = self.score + self.drop_bonus
|
||||
self.drop_bonus = 0
|
||||
self.last_row = self.piece.position.y
|
||||
end
|
||||
|
||||
function NESTGMMode:getGrade()
|
||||
if (
|
||||
self.lines >= 300 and
|
||||
self.score >= 600000 and
|
||||
self.quad_clears[0] >= 25 and
|
||||
self.quad_clears[1] >= 15
|
||||
) then
|
||||
if self.roll_frames >= 3600 then return {19, "???"}
|
||||
else return {18, "???"} end
|
||||
else
|
||||
if self.score < 002000 then return {0, 2000}
|
||||
elseif self.score < 005300 then return {1, 5300}
|
||||
elseif self.score < 011000 then return {2, 11000}
|
||||
elseif self.score < 018000 then return {3, 18000}
|
||||
elseif self.score < 027000 then return {4, 27000}
|
||||
elseif self.score < 038000 then return {5, 38000}
|
||||
elseif self.score < 050000 then return {6, 50000}
|
||||
elseif self.score < 065000 then return {7, 65000}
|
||||
elseif self.score < 083000 then return {8, 83000}
|
||||
elseif self.score < 110000 then return {9, 110000}
|
||||
elseif self.score < 150000 then return {10, 150000}
|
||||
elseif self.score < 200000 then return {11, 200000}
|
||||
elseif self.score < 260000 then return {12, 260000}
|
||||
elseif self.score < 330000 then return {13, 330000}
|
||||
elseif self.score < 410000 then return {14, 410000}
|
||||
elseif self.score < 500000 then return {15, 500000}
|
||||
elseif self.score < 600000 then return {16, 600000}
|
||||
else return {17, "???"} end
|
||||
end
|
||||
end
|
||||
|
||||
function NESTGMMode:updateScore(level, drop_bonus, cleared_lines)
|
||||
if cleared_lines > 0 then
|
||||
if cleared_lines >= 4 and self.lines < 300 then
|
||||
self.quad_clears[math.floor(self.lines / 150)] = (
|
||||
self.quad_clears[math.floor(self.lines / 150)] + 1
|
||||
)
|
||||
end
|
||||
self.lines = self.lines + cleared_lines
|
||||
local score_to_add = 40
|
||||
if cleared_lines > 1 then
|
||||
score_to_add = 100
|
||||
for i = 3, cleared_lines do
|
||||
score_to_add = score_to_add * i
|
||||
end
|
||||
end
|
||||
self.score = self.score + score_to_add * (self:getLevelForLines() + 1)
|
||||
for i = 1, 4 do
|
||||
self.grid:clearSpecificRow(i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function NESTGMMode:drawScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
love.graphics.print(
|
||||
self.das.direction .. " " ..
|
||||
self.das.frames .. " " ..
|
||||
strTrueValues(self.prev_inputs)
|
||||
)
|
||||
love.graphics.printf("NEXT", 64, 40, 40, "left")
|
||||
love.graphics.printf("GRADE", 240, 120, 40, "left")
|
||||
love.graphics.printf("SCORE", 240, 200, 40, "left")
|
||||
love.graphics.printf("NEXT RANK", 240, 260, 90, "left")
|
||||
love.graphics.printf("LINES", 240, 320, 40, "left")
|
||||
local sg = self.grid:checkSecretGrade()
|
||||
if sg >= 5 then
|
||||
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
|
||||
end
|
||||
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
love.graphics.printf(self.score, 240, 220, 90, "left")
|
||||
if self:getGrade()[1] == 19 then
|
||||
love.graphics.printf("GM", 240, 140, 90, "left")
|
||||
elseif self:getGrade()[1] == 18 then
|
||||
love.graphics.printf("M", 240, 140, 90, "left")
|
||||
else
|
||||
love.graphics.printf(
|
||||
self.SGnames[self:getGrade()[1] + 1], 240, 140, 90, "left"
|
||||
)
|
||||
end
|
||||
love.graphics.printf(self:getGrade()[2], 240, 280, 90, "left")
|
||||
love.graphics.printf(math.min(300, self.lines), 240, 340, 40, "right")
|
||||
love.graphics.printf(self:getSectionEndLines(), 240, 370, 40, "right")
|
||||
if sg >= 5 then
|
||||
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
|
||||
end
|
||||
|
||||
love.graphics.setFont(font_8x11)
|
||||
love.graphics.printf(formatTime(self.frames), 64, 420, 160, "center")
|
||||
end
|
||||
|
||||
function NESTGMMode:getSectionEndLines()
|
||||
if self.lines < 10 then return (1 + math.floor(self.lines / 5)) * 5
|
||||
elseif self.lines < 150 then return (1 + math.floor(self.lines / 10)) * 10
|
||||
elseif self.lines < 300 then return (1 + math.floor(self.lines / 50)) * 50
|
||||
else return 300 end
|
||||
end
|
||||
|
||||
function NESTGMMode:drawGrid()
|
||||
self.grid:draw()
|
||||
end
|
||||
|
||||
function NESTGMMode:getBackground()
|
||||
return self:getLevelForLines()
|
||||
end
|
||||
|
||||
function NESTGMMode:getHighscoreData()
|
||||
return {
|
||||
grade = self:getGrade()[1],
|
||||
score = self.score,
|
||||
level = self:getLevelForLines(),
|
||||
lines = self.lines,
|
||||
}
|
||||
end
|
||||
|
||||
return NESTGMMode
|
||||
36
tetris/modes/survival_axh2.lua
Normal file
36
tetris/modes/survival_axh2.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
local SurvivalAXHGame = require 'tetris.modes.survival_axh'
|
||||
|
||||
local SurvivalAXH2Game = SurvivalAXHGame:extend()
|
||||
|
||||
SurvivalAXH2Game.name = "Survival AXH2"
|
||||
SurvivalAXH2Game.hash = "SurvivalAXH2"
|
||||
SurvivalAXH2Game.tagline = "Hellish speeds, fading blocks!"
|
||||
|
||||
function SurvivalAXH2Game:getSkin()
|
||||
return "bone"
|
||||
end
|
||||
|
||||
function SurvivalAXH2Game:getFadeoutTime()
|
||||
if self.lines >= 190 then return 60
|
||||
elseif self.lines >= 150 then return 120
|
||||
elseif self.lines >= 50 then return 150
|
||||
end
|
||||
end
|
||||
|
||||
local function rollOpacityFunction(game, block, x, y, age)
|
||||
local opacity
|
||||
if age < game:getFadeoutTime() then opacity = 1
|
||||
elseif age >= game:getFadeoutTime() + 60 then opacity = 0
|
||||
else opacity = 1 - (age - game:getFadeoutTime()) / 60 end
|
||||
return 0.5, 0.5, 0.5, opacity, 0
|
||||
end
|
||||
|
||||
function SurvivalAXH2Game:drawGrid()
|
||||
if self:getFadeoutTime() then
|
||||
self.grid:drawCustom(rollOpacityFunction, self)
|
||||
else
|
||||
self.grid:draw()
|
||||
end
|
||||
end
|
||||
|
||||
return SurvivalAXH2Game
|
||||
Reference in New Issue
Block a user