mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Added Big Mode as a piece type. (#20)
Survival A3 and Phantom Mania 2 are now in their fully complete glory! :D Implements #13.
This commit is contained in:
@@ -38,6 +38,7 @@ function GameMode:new()
|
||||
self.next_queue_length = 1
|
||||
self.draw_section_times = false
|
||||
self.draw_secondary_section_times = false
|
||||
self.big_mode = false
|
||||
-- variables related to configurable parameters
|
||||
self.drop_locked = false
|
||||
self.hard_drop_locked = false
|
||||
@@ -298,7 +299,7 @@ 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.lock_drop, self.lock_hard_drop, self.big_mode
|
||||
)
|
||||
if self.lock_drop then
|
||||
self.drop_locked = true
|
||||
|
||||
@@ -25,6 +25,8 @@ function PhantomMania2Game:new()
|
||||
self.combo = 1
|
||||
self.hold_age = 0
|
||||
self.queue_age = 0
|
||||
self.roll_points = 0
|
||||
|
||||
self.randomizer = History6RollsRandomizer()
|
||||
|
||||
self.lock_drop = true
|
||||
@@ -135,7 +137,7 @@ function PhantomMania2Game:onPieceEnter()
|
||||
end
|
||||
|
||||
local cleared_row_levels = {1, 2, 4, 6}
|
||||
local cleared_row_points = {0.02, 0.05, 0.15, 0.6}
|
||||
local cleared_row_points = {2, 6, 15, 40}
|
||||
|
||||
function PhantomMania2Game:onLineClear(cleared_row_count)
|
||||
if not self.clear then
|
||||
@@ -144,6 +146,7 @@ function PhantomMania2Game:onLineClear(cleared_row_count)
|
||||
if new_level >= 1300 or self:hitTorikan(self.level, new_level) then
|
||||
if new_level >= 1300 then
|
||||
self.level = 1300
|
||||
self.big_mode = true
|
||||
end
|
||||
self.clear = true
|
||||
self.grid:clear()
|
||||
@@ -152,6 +155,12 @@ function PhantomMania2Game:onLineClear(cleared_row_count)
|
||||
self.level = math.min(new_level, 1300)
|
||||
end
|
||||
self:advanceBottomRow(-cleared_row_count)
|
||||
else
|
||||
self.roll_points = self.roll_points + cleared_row_points[cleared_row_count / 2]
|
||||
if self.roll_points >= 100 then
|
||||
self.roll_points = self.roll_points - 100
|
||||
self.grade = self.grade + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -225,7 +234,7 @@ PhantomMania2Game.garbageOpacityFunction = function(age)
|
||||
end
|
||||
|
||||
function PhantomMania2Game:drawGrid()
|
||||
if not (self.game_over or self.clear) then
|
||||
if not (self.game_over or (self.clear and self.level < 1300)) then
|
||||
self.grid:drawInvisible(self.rollOpacityFunction, self.garbageOpacityFunction)
|
||||
else
|
||||
self.grid:draw()
|
||||
@@ -243,7 +252,7 @@ local function getLetterGrade(grade)
|
||||
end
|
||||
|
||||
function PhantomMania2Game:setNextOpacity(i)
|
||||
if self.level > 1000 then
|
||||
if self.level > 1000 and self.level < 1300 then
|
||||
local hidden_next_pieces = math.floor(self.level / 100) - 10
|
||||
if i < hidden_next_pieces then
|
||||
love.graphics.setColor(1, 1, 1, 0)
|
||||
@@ -258,7 +267,7 @@ function PhantomMania2Game:setNextOpacity(i)
|
||||
end
|
||||
|
||||
function PhantomMania2Game:setHoldOpacity()
|
||||
if self.level > 1000 then
|
||||
if self.level > 1000 and self.level < 1300 then
|
||||
love.graphics.setColor(1, 1, 1, 1 - math.min(1, self.hold_age / 15))
|
||||
else
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
|
||||
@@ -44,13 +44,14 @@ function SurvivalA3Game:getLineARE()
|
||||
end
|
||||
|
||||
function SurvivalA3Game:getDasLimit()
|
||||
if self.level < 200 then return 9
|
||||
if self.level < 100 then return 9
|
||||
elseif self.level < 500 then return 7
|
||||
else return 5 end
|
||||
end
|
||||
|
||||
function SurvivalA3Game:getLineClearDelay()
|
||||
return self:getLineARE() - 2
|
||||
if self.level < 1300 then return self:getLineARE() - 2
|
||||
else return 6 end
|
||||
end
|
||||
|
||||
function SurvivalA3Game:getLockDelay()
|
||||
@@ -60,7 +61,8 @@ function SurvivalA3Game:getLockDelay()
|
||||
elseif self.level < 600 then return 13
|
||||
elseif self.level < 1100 then return 12
|
||||
elseif self.level < 1200 then return 10
|
||||
else return 8 end
|
||||
elseif self.level < 1300 then return 8
|
||||
else return 15 end
|
||||
end
|
||||
|
||||
function SurvivalA3Game:getGravity()
|
||||
@@ -133,6 +135,7 @@ function SurvivalA3Game:onLineClear(cleared_row_count)
|
||||
end
|
||||
self.clear = true
|
||||
self.grid:clear()
|
||||
self.big_mode = true
|
||||
self.roll_frames = -150
|
||||
else
|
||||
self.level = math.min(new_level, 1300)
|
||||
@@ -188,10 +191,8 @@ end
|
||||
local function getLetterGrade(grade)
|
||||
if grade == 0 then
|
||||
return "1"
|
||||
elseif grade <= 9 then
|
||||
return "S" .. tostring(grade)
|
||||
else
|
||||
return "M" .. tostring(grade - 9)
|
||||
return "S" .. tostring(grade)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user