Major sound effect update (closes #7?)

Sound effects can still be changed, and #7 can still be reopened.
This commit is contained in:
Ishaan Bhardwaj
2020-12-05 20:30:59 -05:00
parent 1f686fb5d4
commit 4afe9f2bd4
11 changed files with 19 additions and 9 deletions

View File

@@ -224,9 +224,7 @@ end
function GameMode:onLineClear(cleared_row_count) end
function GameMode:onPieceEnter() end
function GameMode:onHold()
playSE("hold")
end
function GameMode:onHold() end
function GameMode:onSoftDrop(dropped_row_count)
self.drop_bonus = self.drop_bonus + 1 * dropped_row_count
@@ -363,7 +361,7 @@ end
function GameMode:initializeOrHold(inputs, ruleset)
if self.ihs and self.enable_hold and inputs["hold"] == true then
self:hold(inputs, ruleset)
self:hold(inputs, ruleset, true)
else
self:initializeNextPiece(inputs, ruleset, self.next_queue[1])
end
@@ -374,7 +372,7 @@ function GameMode:initializeOrHold(inputs, ruleset)
end
end
function GameMode:hold(inputs, ruleset)
function GameMode:hold(inputs, ruleset, ihs)
local data = copy(self.hold_queue)
if self.piece == nil then
self.hold_queue = self.next_queue[1]
@@ -393,6 +391,8 @@ function GameMode:hold(inputs, ruleset)
self:initializeNextPiece(inputs, ruleset, data, false)
end
self.held = true
if ihs then playSE("ihs")
else playSE("hold") end
self:onHold()
end